Preprocessor macro expanding to a command
Space | User/kernel |
Context | Sync/async |
May block | No |
SPL | Any |
Dynamic memory | No |
#include <SPAD/AC.H>
CALL_IORQ(iorq, handler);
This is a preprocessor macro that expands to machine- and compiler-dependent code to call an IORQ. If the current SPL is lower than IORQ handler's SPL, the handler is executed immediatelly, otherwise the IORQ is queued. IORQ posted with this function may be canceled with KERNEL$CIO function, however, after cancel, the caller must still wait for AST to arrive. After the AST arrives, he may free or reuse the structure.
fn
pointing to AST function declared with DECL_AST. When the AST is called, status of the request is reported in iorq's status
field. All the fields (except fn
) may change while the IORQ is being executed. IORQs on the same SPL are called in the same order they were queued, but the programmer must not depend on it for correctness. The programmer may depend on this feature for good performance (for example networking packets are queued with this call — the protocols are required to handle out-of-order packets correctly, altough it causes performance degradation).