tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

fetch32/store32 et al


Unless anyone objects, I would like to replace current fuword(), suword()
and friends with a little bit better API:

        int     fetch32(void *addr, uint32_t *c);
        int     store32(void *addr, uint32_t c);

And equivalent routines to fetch/store 8, 16 and 64 (if needed) bit values.
Routines would return 0 on success and EFAULT on failure.

Rationale:  1) there are already bugs in the tree where incorrect sizes of
"word" are assumed (e.g. see amd64 fuword)  2) currently, fuword() et al
cannot return -1 as a value.

Also, this would be consistent with atomic_ops(3) and would close PR/2512.


Home | Main Index | Thread Index | Old Index