q Tn PCB .
p The .Tn RAS functionality is provided by a combination of the machine-independent routines discussed in this page and a machine-dependent component in .Xr cpu_switchto 9 . A port which supports restartable atomic sequences will define .Dv __HAVE_RAS in n machine/types.h for machine-independent code to conditionally provide RAS support.
p A complicated side-effect of restartable atomic sequences is their interaction with the machine-dependent .Xr ptrace 2 support. Specifically, single-step traps and/or the emulation of single-stepping must carefully consider the effect on restartable atomic sequences. A general solution is to ignore these traps or disable them within restartable atomic sequences. .Sh FUNCTIONS The functions which operate on restartable atomic sequences are:
p l -tag -width compact t Fn ras_lookup "p" "addr" This function searches the registered restartable atomic sequences for process .Fa p which contain the user address .Fa addr . If the address .Fa addr is found within a .Tn RAS , then the restart address of the .Tn RAS is returned, otherwise -1 is returned. t Fn ras_fork "p1" "p2" This function is used to copy all registered restartable atomic sequences for process .Fa p1 to process .Fa p2 . It is primarily called from .Xr fork1 9 when the sequences are inherited from the parent by the child. t Fn ras_purgeall "p" This function is used to remove all registered restartable atomic sequences for process .Fa p . It is primarily used to remove all registered restartable atomic sequences for a process during .Xr exec 3 and by .Xr rasctl 2 . .El .Sh CODE REFERENCES The RAS framework itself is implemented within the file
a sys/kern/kern_ras.c . Data structures and function prototypes for the framework are located in n sys/ras.h . Machine-dependent portions are implemented within .Xr cpu_switchto 9 in the machine-dependent file
a sys/arch/<arch>/<arch>/locore.S . .Sh SEE ALSO .Xr rasctl 2 , .Xr cpu_switchto 9 , .Xr fork1 9 .Rs .%A Gregory McGarry .%T "An Implementation of User-level Restartable \ Atomic Sequences on the NetBSD Operating System" .%I USENIX Association .%B Proceedings of the FREENIX Track: 2003 USENIX Annual Technical Conference .%P 311-322 .%D June 9-14, 2003 .%U http://www.usenix.org/publications/library/proceedings/usenix03/tech/freenix03/full_papers/mcgarry/mcgarry.pdf .Re .Sh HISTORY The RAS functionality first appeared in .Nx 2.0 .