The
fetch
functions are designed to copy small amounts of data from user-space
of the current process.
If the user address is naturally aligned, then the operation will be
performed atomically.
Otherwise it may fail or be performed non-atomically, depending on
the platform.
The
fetch
routines provide the following functionality:
fubyte()
|
|
Fetches a byte of data from the user-space address
base.
The byte read is zero-extended into the results variable.
|
fuword()
|
|
Fetches a word of data (long) from the user-space address
base.
|
fuword16()
|
|
Fetches 16 bits of data from the user-space address
base.
The half-word read is zero-extended into the results variable.
|
fuword32()
|
|
Fetches 32 bits of data from the user-space address
base.
|
fuword64()
|
|
Fetches 64 bits of data from the user-space address
base.
|
fueword()
|
|
Fetches a word of data (long) from the user-space address
base
and stores the result in the variable pointed by
val.
|
fueword32()
|
|
Fetches 32 bits of data from the user-space address
base
and stores the result in the variable pointed by
val.
|
fueword64()
|
|
Fetches 64 bits of data from the user-space address
base
and stores the result in the variable pointed by
val.
|
The callers of
fuword(),
fuword32()
and
fuword64()
functions cannot distinguish between -1 read from
userspace and function failure.