Interface SPLX_BELOW

Preprocessor macro expanding to an expression

SpaceUser/kernel
ContextSync/async/rt-irq
May blockNo
SPLAny
Dynamic memoryNo

#include <SPAD/AC.H>

if (SPLX_BELOW(splx1, splx2)) ...

Description

This macro compares two SPL levels specified in internal SPL format (as returned by SPL_X). It returns non-zero if splx1 is lower than SPL2. Because the internal format is not specified (it's architecture-specific), they can't be compared with operators < or >.

Arguments

Returns

Returns non-zero if splx1 is below splx2.

Implementation note

If one of the arguments is constant, the macro performs a compile-time check for correctness.

Example

if (SPLX_BELOW(SPL_X(SPL_DEV), KERNEL$SPL))
        KERNEL$SUICIDE("FUNCTION CALLED AT BAD SPL: %08X", KERNEL$SPL);
RAISE_SPL(SPL_DEV);

See also

SPL_X, KERNEL$SPL