[BACK]Return to SMR_PTR_GET.9 CVS log [TXT][DIR] Up to [local] / src / share / man / man9

File: [local] / src / share / man / man9 / SMR_PTR_GET.9 (download)

Revision 1.3, Fri Jul 5 04:46:26 2019 UTC (4 years, 10 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, HEAD
Changes since 1.2: +10 -7 lines

make the pointer value argument name "v" instead of "value"

this makes a sentence read better when there's no syntax hilighting
in effect.

while here, say the write-write memory barrier is implemented with
membar_producer so it's easier to go read about what that provides.

.\"	$OpenBSD: SMR_PTR_GET.9,v 1.3 2019/07/05 04:46:26 dlg Exp $
.\"
.\" Copyright (c) 2019 Visa Hankala
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: July 5 2019 $
.Dt SMR_PTR_GET 9
.Os
.Sh NAME
.Nm SMR_PTR_GET ,
.Nm SMR_PTR_GET_LOCKED ,
.Nm SMR_PTR_SET_LOCKED
.Nd safe memory reclamation pointer API
.Sh SYNOPSIS
.Ft TYPE
.Fn SMR_PTR_GET "TYPE *pptr"
.Ft TYPE
.Fn SMR_PTR_GET_LOCKED "TYPE *pptr"
.Ft void
.Fn SMR_PTR_SET_LOCKED "TYPE *pptr" "TYPE v"
.Sh DESCRIPTION
The SMR_PTR macros are used for accessing SMR-protected pointers.
.Pp
The macro
.Fn SMR_PTR_GET
reads the pointer referenced by
.Fa pptr
for dereferencing inside SMR read-side critical section.
.Pp
.Fn SMR_PTR_GET_LOCKED
reads the pointer referenced by
.Fa pptr
for dereferencing inside writer context.
.Pp
.Fn SMR_PTR_SET_LOCKED
writes value
.Fa v
to the pointer referenced by
.Fa pptr .
The operation issues a write-write memory barrier with
.Xr membar_producer 9
before the pointer write.
.Sh CONTEXT
.Fn SMR_PTR_GET ,
.Fn SMR_PTR_GET_LOCKED
and
.Fn SMR_PTR_SET_LOCKED
can be called during autoconf, from process context, or from interrupt context.
.Pp
.Fn SMR_PTR_GET
can be used from SMR read-side critical section.
.Fn SMR_PTR_GET_LOCKED
and
.Fn SMR_PTR_SET_LOCKED
can be used from writer context.
.Sh SEE ALSO
.Xr membar_producer 9 ,
.Xr SMR_LIST_INIT 9 ,
.Xr smr_read_enter 9
.Sh HISTORY
The SMR_PTR macros first appeared in
.Ox 6.5 .