Changeset View
Changeset View
Standalone View
Standalone View
head/share/man/man9/store.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 STORE 9 | .Dt STORE 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm store , | .Nm store , | ||||
.Nm subyte , | .Nm subyte , | ||||
.Nm suswintr , | |||||
.Nm suword | .Nm suword | ||||
.Nd store data to user-space | .Nd store data to user-space | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/types.h | .In sys/types.h | ||||
.In sys/time.h | .In sys/time.h | ||||
.In sys/systm.h | .In sys/systm.h | ||||
.Ft int | .Ft int | ||||
.Fn subyte "volatile void *base" "int byte" | .Fn subyte "volatile void *base" "int byte" | ||||
.Ft int | .Ft int | ||||
.Fn suword "volatile void *base" "long word" | .Fn suword "volatile void *base" "long word" | ||||
.Ft int | .Ft int | ||||
.Fn suword16 "volatile void *base" "int word" | .Fn suword16 "volatile void *base" "int word" | ||||
.Ft int | .Ft int | ||||
.Fn suword32 "volatile void *base" "int32_t word" | .Fn suword32 "volatile void *base" "int32_t word" | ||||
.Ft int | .Ft int | ||||
.Fn suword64 "volatile void *base" "int64_t word" | .Fn suword64 "volatile void *base" "int64_t word" | ||||
.In sys/resourcevar.h | .In sys/resourcevar.h | ||||
.Ft int | |||||
.Fn suswintr "void *base" "int word" | |||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
functions are designed to copy small amounts of data to user-space. | functions are designed to copy small amounts of data to user-space. | ||||
If write is successful, it is performed atomically. | If write is successful, it is performed atomically. | ||||
The data written must be naturally aligned. | The data written must be naturally aligned. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Nm | .Nm | ||||
routines provide the following functionality: | routines provide the following functionality: | ||||
.Bl -tag -width "suswintr()" | .Bl -tag -width "suword64()" | ||||
.It Fn subyte | .It Fn subyte | ||||
Stores a byte of data to the user-space address | Stores a byte of data to the user-space address | ||||
.Pa base . | .Pa base . | ||||
.It Fn suword | .It Fn suword | ||||
Stores a word of data to the user-space address | Stores a word of data to the user-space address | ||||
.Pa base . | .Pa base . | ||||
.It Fn suword16 | .It Fn suword16 | ||||
Stores 16 bits of data to the user-space address | Stores 16 bits of data to the user-space address | ||||
.Pa base . | .Pa base . | ||||
.It Fn suword32 | .It Fn suword32 | ||||
Stores 32 bits of data to the user-space address | Stores 32 bits of data to the user-space address | ||||
.Pa base . | .Pa base . | ||||
.It Fn suword64 | .It Fn suword64 | ||||
Stores 64 bits of data to the user-space address | Stores 64 bits of data to the user-space address | ||||
.Pa base . | .Pa base . | ||||
.It Fn suswintr | |||||
Stores a short word of data to the user-space address | |||||
.Pa base . | |||||
This function is safe to call during an interrupt context. | |||||
.El | .El | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
The | The | ||||
.Nm | .Nm | ||||
functions return 0 on success or -1 on failure. | functions return 0 on success or -1 on failure. | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr copy 9 , | .Xr copy 9 , | ||||
.Xr fetch 9 | .Xr fetch 9 |