fueword32 (9)
Leading comments
$NetBSD: fetch.9,v 1.2 1996/01/09 21:59:24 perry Exp $ Copyright (c) 1996 Jason R. Thorpe. All rights reserved. This code is derived from software contributed by Kenneth Stailey. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary fo...
NAME
fetch fubyte fuswintr fuword fuword16 fuword32 fuword64 fueword fueword32 fueword64 - fetch data from user-spaceSYNOPSIS
In sys/types.h In sys/systm.h Ft int Fn fubyte volatile const void *base Ft long Fn fuword volatile const void *base Ft int Fn fuword16 volatile const void *base Ft int32_t Fn fuword32 volatile const void *base Ft int64_t Fn fuword64 volatile const void *base Ft long Fn fueword volatile const void *base long *val Ft int32_t Fn fueword32 volatile const void *base int32_t *val Ft int64_t Fn fueword64 volatile const void *base int64_t *val In sys/resourcevar.h Ft int Fn fuswintr void *baseDESCRIPTION
The functions are designed to copy small amounts of data from user-space of the current process. If read is successful, it is performed atomically. The data read must be naturally aligned.The routines provide the following functionality:
- Fn fubyte
- Fetches a byte of data from the user-space address base The byte read is zero-extended into the results variable.
- Fn fuword
- Fetches a word of data (long) from the user-space address base
- Fn fuword16
- Fetches 16 bits of data from the user-space address base The half-word read is zero-extended into the results variable.
- Fn fuword32
- Fetches 32 bits of data from the user-space address base
- Fn fuword64
- Fetches 64 bits of data from the user-space address base
- Fn fuswintr
- Fetches a short word of data from the user-space address base This function is safe to call during an interrupt context.
- Fn fueword
- Fetches a word of data (long) from the user-space address base and stores the result in the variable pointed by val
- Fn fueword32
- Fetches 32 bits of data from the user-space address base and stores the result in the variable pointed by val
- Fn 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 Fn fuword , Fn fuword32 and Fn fuword64 functions cannot distinguish between -1 read from userspace and function failure.