|
PatchworkOS
19e446b
A non-POSIX operating system.
|
I/O Subsystem. More...
I/O Subsystem.
The I/O subsystem is responsible for asynchronous input and output operations within PatchworkOS.
Modules | |
| I/O Request Packet | |
| I/O Request Packet. | |
| Kernel-side I/O Ring Interface | |
| Programmable submission/completion interface. | |
Data Structures | |
| struct | sqe_t |
| Asynchronous submission queue entry (SQE). More... | |
| struct | cqe_t |
| Asynchronous completion queue entry (CQE). More... | |
| struct | ioring_ctrl_t |
| Shared ring control structure. More... | |
Macros | |
| #define | IO_OFF_CUR ((ssize_t) - 1) |
| Use the current file offset. | |
| #define | IO_SEEK_SET (1) |
| Use the start of the file. | |
| #define | IO_SEEK_END (2) |
| Use the end of the file. | |
| #define | IO_SEEK_CUR (3) |
| Use the current file offset. | |
| #define | IO_POLL_READ (1 << 0) |
| File descriptor is ready to read. | |
| #define | IO_POLL_WRITE (1 << 1) |
| File descriptor is ready to write. | |
| #define | IO_POLL_ERROR (1 << 2) |
| File descriptor caused an error. | |
| #define | IO_POLL_HUP (1 << 3) |
| File descriptor is closed. | |
| #define | IO_POLL_NVAL (1 << 4) |
| Invalid file descriptor. | |
| #define | IO_OP_NOP 0 |
| No-op operation. | |
| #define | IO_OP_READ 1 |
| Read operation. | |
| #define | IO_OP_WRITE 2 |
| Write operation. | |
| #define | IO_OP_POLL 3 |
| Poll operation. | |
| #define | IO_OP_MAX 4 |
| The maximum number of operation. | |
| #define | SQE_REG0 (0) |
| The first register. | |
| #define | SQE_REG1 (1) |
| The second register. | |
| #define | SQE_REG2 (2) |
| The third register. | |
| #define | SQE_REG3 (3) |
| The fourth register. | |
| #define | SQE_REG4 (4) |
| The fifth register. | |
| #define | SQE_REG5 (5) |
| The sixth register. | |
| #define | SQE_REG6 (6) |
| The seventh register. | |
| #define | SQE_REG_NONE (7) |
| No register. | |
| #define | SQE_REGS_MAX (7) |
| The maximum number of registers. | |
| #define | SQE_REG_SHIFT (3) |
The bitshift for each register specifier in a sqe_flags_t. | |
| #define | SQE_REG_MASK (0b111) |
The bitmask for a register specifier in a sqe_flags_t. | |
| #define | SQE_LOAD0 (0) |
| The offset to specify the register to load into the first argument. | |
| #define | SQE_LOAD1 (SQE_LOAD0 + SQE_REG_SHIFT) |
| The offset to specify the register to load into the second argument. | |
| #define | SQE_LOAD2 (SQE_LOAD1 + SQE_REG_SHIFT) |
| The offset to specify the register to load into the third argument. | |
| #define | SQE_LOAD3 (SQE_LOAD2 + SQE_REG_SHIFT) |
| The offset to specify the register to load into the fourth argument. | |
| #define | SQE_LOAD4 (SQE_LOAD3 + SQE_REG_SHIFT) |
| The offset to specify the register to load into the fifth argument. | |
| #define | SQE_SAVE (SQE_LOAD4 + SQE_REG_SHIFT) |
| The offset to specify the register to save the result into. | |
| #define | _SQE_FLAGS (SQE_SAVE + SQE_REG_SHIFT) |
The bitshift for where bit flags start in a sqe_flags_t. | |
| #define | SQE_LINK (1 << (_SQE_FLAGS)) |
| #define | SQE_HARDLINK (1 << (_SQE_FLAGS + 1)) |
| #define | SQE_CREATE(_op, _flags, _timeout, _data) |
| Macro to create an asynchronous submission queue entry (SQE). | |
Typedefs | |
| typedef uint64_t | io_whence_t |
| Seek origin type. | |
| typedef uint64_t | io_events_t |
| Poll events type. | |
| typedef uint32_t | io_op_t |
| I/O operation code type. | |
| typedef uint32_t | sqe_flags_t |
| Submission queue entry (SQE) flags. | |
Functions | |
| struct | ALIGNED (64) ioring_ctrl |
Variables | |
| ioring_ctrl_t | |
| #define IO_OFF_CUR ((ssize_t) - 1) |
| #define IO_POLL_READ (1 << 0) |
| #define IO_POLL_WRITE (1 << 1) |
| #define IO_POLL_ERROR (1 << 2) |
| #define SQE_REG_SHIFT (3) |
| #define SQE_REG_MASK (0b111) |
| #define SQE_LOAD0 (0) |
| #define SQE_LOAD1 (SQE_LOAD0 + SQE_REG_SHIFT) |
| #define SQE_LOAD2 (SQE_LOAD1 + SQE_REG_SHIFT) |
| #define SQE_LOAD3 (SQE_LOAD2 + SQE_REG_SHIFT) |
| #define SQE_LOAD4 (SQE_LOAD3 + SQE_REG_SHIFT) |
| #define SQE_SAVE (SQE_LOAD4 + SQE_REG_SHIFT) |
| #define _SQE_FLAGS (SQE_SAVE + SQE_REG_SHIFT) |
| #define SQE_LINK (1 << (_SQE_FLAGS)) |
| #define SQE_HARDLINK (1 << (_SQE_FLAGS + 1)) |
| #define SQE_CREATE | ( | _op, | |
| _flags, | |||
| _timeout, | |||
| _data | |||
| ) |
Macro to create an asynchronous submission queue entry (SQE).
| _op | The operation to perform. |
| _flags | Submission flags. |
| _timeout | Timeout for the operation, CLOCKS_NEVER for no timeout. |
| _data | Private data for the operation. |
| typedef uint64_t io_whence_t |
| typedef uint64_t io_events_t |
| typedef uint32_t sqe_flags_t |
| struct ALIGNED | ( | 64 | ) |