Function
compose_opcode
(
dir: Direction,
group: Opcode,
num: Opcode,
size: Opcode,
)
Source from the content-addressed store, hash-verified
| 3 | use super::{Direction, Opcode}; |
| 4 | |
| 5 | pub(super) const fn compose_opcode( |
| 6 | dir: Direction, |
| 7 | group: Opcode, |
| 8 | num: Opcode, |
| 9 | size: Opcode, |
| 10 | ) -> Opcode { |
| 11 | let dir = match dir { |
| 12 | Direction::None => NONE, |
| 13 | Direction::Read => READ, |
| 14 | Direction::Write => WRITE, |
| 15 | Direction::ReadWrite => READ | WRITE, |
| 16 | }; |
| 17 | |
| 18 | dir | num | (group << 8) | ((size & IOCPARAM_MASK) << 16) |
| 19 | } |
| 20 | |
| 21 | // `IOC_VOID` |
| 22 | pub const NONE: Opcode = 0x2000_0000; |
Tested by
no test coverage detected