OpenBSD manual page server

Manual Page Search Parameters

SMR_PTR_GET(9) Kernel Developer's Manual SMR_PTR_GET(9)

SMR_PTR_GET, SMR_PTR_GET_LOCKED, SMR_PTR_SET_LOCKEDsafe memory reclamation pointer API

TYPE
SMR_PTR_GET(TYPE *pptr);

TYPE
SMR_PTR_GET_LOCKED(TYPE *pptr);

void
SMR_PTR_SET_LOCKED(TYPE *pptr, TYPE v);

The SMR_PTR macros are used for accessing SMR-protected pointers.

The macro () reads the pointer referenced by pptr for dereferencing inside SMR read-side critical section.

() reads the pointer referenced by pptr for dereferencing inside writer context.

() writes value v to the pointer referenced by pptr. The operation issues a write-write memory barrier with membar_producer(9) before the pointer write.

SMR_PTR_GET(), SMR_PTR_GET_LOCKED() and SMR_PTR_SET_LOCKED() can be called during autoconf, from process context, or from interrupt context.

SMR_PTR_GET() can be used from SMR read-side critical section. SMR_PTR_GET_LOCKED() and SMR_PTR_SET_LOCKED() can be used from writer context.

membar_producer(9), SMR_LIST_INIT(9), smr_read_enter(9)

The SMR_PTR macros first appeared in OpenBSD 6.5.

July 5, 2019 OpenBSD-current