From fc22b3d6507c6745911b9dfcc68f1e665ae13dbc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:43:11 +0200 Subject: Adding upstream version 4.22.0. Signed-off-by: Daniel Baumann --- upstream/mageia-cauldron/man9/save_flags.9 | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 upstream/mageia-cauldron/man9/save_flags.9 (limited to 'upstream/mageia-cauldron/man9/save_flags.9') diff --git a/upstream/mageia-cauldron/man9/save_flags.9 b/upstream/mageia-cauldron/man9/save_flags.9 new file mode 100644 index 00000000..da290dd7 --- /dev/null +++ b/upstream/mageia-cauldron/man9/save_flags.9 @@ -0,0 +1,63 @@ +.\" -*- nroff -*- +.TH save_flags 9 "$Date:$" "Linux DDI" "Linux Kernel Functions" +.SH NAME +save_flags, restore_flags \- save/restore processor state and irq mask +.SH SYNOPSIS +.B #include +.sp +.BI "unsigned long " flags ";" +.br +.BI "void save_flags(" flags ")" +.br +.BI "void restore_flags(" flags ")" +.SH DESCRIPTION +The +.B save_flags +and +.B restore_flags +macros cooperate with the +.B cli +function to provide interrupt protection to critical sections of +code. The +.B save_flags +function saves the current processor state, most specifically the +interrupt priority level, in the +.I flags +value (which must be an l-value). The flags must be passed to a +subsequent call to +.B restore_flags +to restore the processor state. +.PP +The +.B save_flags +macro does not affect the processor state, but drivers may use the +.BR cli (9) +and +.B sti +functions to disable and enable interrupts after saving the current +flags. When the critical section of code is passed, the +.B restore_flags +returns the processor to its state at the point where the matching +.B save_flags +was called. +.PP +Only values returned by +.B save_flags +can be passed to +.B restore_flags. +Any other values may cause unpredictable results, and are +certainly not portable. +.SH "RETURN VALUE" +The +.B restore_flags +macro saves the processor state in the +.I flags +parameter, which must be a non-const l-value. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.BR "cli" (9) +.SH AUTHOR +Stephen Williams (steve@icarus.com) +.SH BUGS +How does all this react with symmetric multiprocessor machines? -- cgit v1.2.3