Changeset View
Changeset View
Standalone View
Standalone View
head/share/man/man9/fetch.9
Show All 28 Lines | |||||
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||||
.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||||
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd October 29, 2014 | .Dd April 17, 2018 | ||||
.Dt FETCH 9 | .Dt FETCH 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm fetch , | .Nm fetch , | ||||
.Nm fubyte , | .Nm fubyte , | ||||
.Nm fuswintr , | |||||
.Nm fuword , | .Nm fuword , | ||||
.Nm fuword16 , | .Nm fuword16 , | ||||
.Nm fuword32 , | .Nm fuword32 , | ||||
.Nm fuword64 , | .Nm fuword64 , | ||||
.Nm fueword , | .Nm fueword , | ||||
.Nm fueword32 , | .Nm fueword32 , | ||||
.Nm fueword64 | .Nm fueword64 | ||||
.Nd fetch data from user-space | .Nd fetch data from user-space | ||||
Show All 12 Lines | |||||
.Fn fuword64 "volatile const void *base" | .Fn fuword64 "volatile const void *base" | ||||
.Ft long | .Ft long | ||||
.Fn fueword "volatile const void *base" "long *val" | .Fn fueword "volatile const void *base" "long *val" | ||||
.Ft int32_t | .Ft int32_t | ||||
.Fn fueword32 "volatile const void *base" "int32_t *val" | .Fn fueword32 "volatile const void *base" "int32_t *val" | ||||
.Ft int64_t | .Ft int64_t | ||||
.Fn fueword64 "volatile const void *base" "int64_t *val" | .Fn fueword64 "volatile const void *base" "int64_t *val" | ||||
.In sys/resourcevar.h | .In sys/resourcevar.h | ||||
.Ft int | |||||
.Fn fuswintr "void *base" | |||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
functions are designed to copy small amounts of data from user-space | functions are designed to copy small amounts of data from user-space | ||||
of the current process. | of the current process. | ||||
If read is successful, it is performed atomically. | If read is successful, it is performed atomically. | ||||
The data read must be naturally aligned. | The data read must be naturally aligned. | ||||
.Pp | .Pp | ||||
Show All 13 Lines | |||||
.Pa base . | .Pa base . | ||||
The half-word read is zero-extended into the results variable. | The half-word read is zero-extended into the results variable. | ||||
.It Fn fuword32 | .It Fn fuword32 | ||||
Fetches 32 bits of data from the user-space address | Fetches 32 bits of data from the user-space address | ||||
.Pa base . | .Pa base . | ||||
.It Fn fuword64 | .It Fn fuword64 | ||||
Fetches 64 bits of data from the user-space address | Fetches 64 bits of data from the user-space address | ||||
.Pa base . | .Pa base . | ||||
.It Fn fuswintr | |||||
Fetches a short word of data from the user-space address | |||||
.Pa base . | |||||
This function is safe to call during an interrupt context. | |||||
.It Fn fueword | .It Fn fueword | ||||
Fetches a word of data (long) from the user-space address | Fetches a word of data (long) from the user-space address | ||||
.Pa base | .Pa base | ||||
and stores the result in the variable pointed by | and stores the result in the variable pointed by | ||||
.Pa val . | .Pa val . | ||||
.It Fn fueword32 | .It Fn fueword32 | ||||
Fetches 32 bits of data from the user-space address | Fetches 32 bits of data from the user-space address | ||||
.Pa base | .Pa base | ||||
Show All 14 Lines | |||||
functions cannot distinguish between -1 read from | functions cannot distinguish between -1 read from | ||||
userspace and function failure. | userspace and function failure. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
The | The | ||||
.Fn fubyte , | .Fn fubyte , | ||||
.Fn fuword , | .Fn fuword , | ||||
.Fn fuword16 , | .Fn fuword16 , | ||||
.Fn fuword32 , | .Fn fuword32 , | ||||
.Fn fuword64 , | |||||
and | and | ||||
.Fn fuswintr | .Fn fuword64 | ||||
functions return the data fetched or -1 on failure. | functions return the data fetched or -1 on failure. | ||||
The | The | ||||
.Fn fueword , | .Fn fueword , | ||||
.Fn fueword32 | .Fn fueword32 | ||||
and | and | ||||
.Fn fueword64 | .Fn fueword64 | ||||
functions return 0 on success and -1 on failure. | functions return 0 on success and -1 on failure. | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr copy 9 , | .Xr copy 9 , | ||||
.Xr store 9 | .Xr store 9 |