Preprocessor macro expanding to an expression
| Space | User/kernel |
| Context | Sync/async/rt-irq |
| May block | No |
| SPL | Any |
| Dynamic memory | No |
#include <SPAD/AC.H>
x = SPL_X(spl); This macro converts portable SPL number (in range 0 – 30) to internal architecture-specific SPL representation.
It is good practice to pass costants defined in SPAD/SPLDEF.H, so that SPLs of all components can be changed in one file.
This macro returns internal SPL definition that can be further passed to SPL functions and macros having X suffix. The internal SPL definition fits into int type.
The macro tests at compile-time if the argument is valid.
On IA-32, the this macro is defined as -1 << (spl + 1). On other architectures, the internal format may be defined differently, accoring to the availability and speed of bit-manipulation functions.