| ... | ... | @@ -1284,6 +1284,9 @@ pub const IORING_SETUP_CLAMP = 1 << 4; |
| 1284 | 1284 | /// attach to existing wq |
| 1285 | 1285 | pub const IORING_SETUP_ATTACH_WQ = 1 << 5; |
| 1286 | 1286 | |
| 1287 | /// start with ring disabled |
| 1288 | pub const IORING_SETUP_R_DISABLED = 1 << 6; |
| 1289 | |
| 1287 | 1290 | pub const io_sqring_offsets = extern struct { |
| 1288 | 1291 | /// offset of ring head |
| 1289 | 1292 | head: u32, |
| ... | ... | @@ -1430,6 +1433,11 @@ pub const io_uring_cqe = extern struct { |
| 1430 | 1433 | flags: u32, |
| 1431 | 1434 | }; |
| 1432 | 1435 | |
| 1436 | // io_uring_cqe.flags |
| 1437 | |
| 1438 | /// If set, the upper 16 bits are the buffer ID |
| 1439 | pub const IORING_CQE_F_BUFFER = 1 << 0; |
| 1440 | |
| 1433 | 1441 | pub const IORING_OFF_SQ_RING = 0; |
| 1434 | 1442 | pub const IORING_OFF_CQ_RING = 0x8000000; |
| 1435 | 1443 | pub const IORING_OFF_SQES = 0x10000000; |
| ... | ... | @@ -1439,7 +1447,7 @@ pub const IORING_ENTER_GETEVENTS = 1 << 0; |
| 1439 | 1447 | pub const IORING_ENTER_SQ_WAKEUP = 1 << 1; |
| 1440 | 1448 | |
| 1441 | 1449 | // io_uring_register opcodes and arguments |
| 1442 | | pub const IORING_REGISTER = extern enum(u32) { |
| 1450 | pub const IORING_REGISTER = extern enum(u8) { |
| 1443 | 1451 | REGISTER_BUFFERS, |
| 1444 | 1452 | UNREGISTER_BUFFERS, |
| 1445 | 1453 | REGISTER_FILES, |
| ... | ... | @@ -1451,11 +1459,13 @@ pub const IORING_REGISTER = extern enum(u32) { |
| 1451 | 1459 | REGISTER_PROBE, |
| 1452 | 1460 | REGISTER_PERSONALITY, |
| 1453 | 1461 | UNREGISTER_PERSONALITY, |
| 1462 | REGISTER_RESTRICTIONS, |
| 1463 | REGISTER_ENABLE_RINGS, |
| 1454 | 1464 | |
| 1455 | 1465 | _, |
| 1456 | 1466 | }; |
| 1457 | 1467 | |
| 1458 | | pub const io_uring_files_update = struct { |
| 1468 | pub const io_uring_files_update = extern struct { |
| 1459 | 1469 | offset: u32, |
| 1460 | 1470 | resv: u32, |
| 1461 | 1471 | fds: u64, |
| ... | ... | @@ -1463,7 +1473,7 @@ pub const io_uring_files_update = struct { |
| 1463 | 1473 | |
| 1464 | 1474 | pub const IO_URING_OP_SUPPORTED = 1 << 0; |
| 1465 | 1475 | |
| 1466 | | pub const io_uring_probe_op = struct { |
| 1476 | pub const io_uring_probe_op = extern struct { |
| 1467 | 1477 | op: IORING_OP, |
| 1468 | 1478 | |
| 1469 | 1479 | resv: u8, |
| ... | ... | @@ -1474,7 +1484,7 @@ pub const io_uring_probe_op = struct { |
| 1474 | 1484 | resv2: u32, |
| 1475 | 1485 | }; |
| 1476 | 1486 | |
| 1477 | | pub const io_uring_probe = struct { |
| 1487 | pub const io_uring_probe = extern struct { |
| 1478 | 1488 | /// last opcode supported |
| 1479 | 1489 | last_op: IORING_OP, |
| 1480 | 1490 | |
| ... | ... | @@ -1487,6 +1497,39 @@ pub const io_uring_probe = struct { |
| 1487 | 1497 | // Followed by up to `ops_len` io_uring_probe_op structures |
| 1488 | 1498 | }; |
| 1489 | 1499 | |
| 1500 | pub const io_uring_restriction = extern struct { |
| 1501 | opcode: u16, |
| 1502 | arg: extern union { |
| 1503 | /// IORING_RESTRICTION_REGISTER_OP |
| 1504 | register_op: IORING_REGISTER, |
| 1505 | |
| 1506 | /// IORING_RESTRICTION_SQE_OP |
| 1507 | sqe_op: IORING_OP, |
| 1508 | |
| 1509 | /// IORING_RESTRICTION_SQE_FLAGS_* |
| 1510 | sqe_flags: u8, |
| 1511 | }, |
| 1512 | resv: u8, |
| 1513 | resv2: u32[3], |
| 1514 | }; |
| 1515 | |
| 1516 | /// io_uring_restriction->opcode values |
| 1517 | pub const IORING_RESTRICTION = extern enum(u8) { |
| 1518 | /// Allow an io_uring_register(2) opcode |
| 1519 | REGISTER_OP = 0, |
| 1520 | |
| 1521 | /// Allow an sqe opcode |
| 1522 | SQE_OP = 1, |
| 1523 | |
| 1524 | /// Allow sqe flags |
| 1525 | SQE_FLAGS_ALLOWED = 2, |
| 1526 | |
| 1527 | /// Require sqe flags (these flags must be set on each submission) |
| 1528 | SQE_FLAGS_REQUIRED = 3, |
| 1529 | |
| 1530 | _, |
| 1531 | }; |
| 1532 | |
| 1490 | 1533 | pub const utsname = extern struct { |
| 1491 | 1534 | sysname: [64:0]u8, |
| 1492 | 1535 | nodename: [64:0]u8, |