Skip to content

Commit 7e4d7ad

Browse files
krhKristian H. Kristensen
andauthored
Add mempolicy.h definition (#96)
Co-authored-by: Kristian H. Kristensen <krh@rivosinc.com>
1 parent aaa9f6a commit 7e4d7ad

19 files changed

Lines changed: 1497 additions & 540 deletions

File tree

gen/modules/general.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/inotify.h>
1717
#include <linux/limits.h>
1818
#include <linux/magic.h>
19+
#include <linux/mempolicy.h>
1920
#include <linux/mman.h>
2021
#include <linux/poll.h>
2122
#include <linux/random.h>

src/aarch64/general.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,6 +1473,25 @@ pub const UDF_SUPER_MAGIC: u32 = 352400198;
14731473
pub const DMA_BUF_MAGIC: u32 = 1145913666;
14741474
pub const DEVMEM_MAGIC: u32 = 1162691661;
14751475
pub const SECRETMEM_MAGIC: u32 = 1397048141;
1476+
pub const MPOL_F_STATIC_NODES: u32 = 32768;
1477+
pub const MPOL_F_RELATIVE_NODES: u32 = 16384;
1478+
pub const MPOL_F_NUMA_BALANCING: u32 = 8192;
1479+
pub const MPOL_MODE_FLAGS: u32 = 57344;
1480+
pub const MPOL_F_NODE: u32 = 1;
1481+
pub const MPOL_F_ADDR: u32 = 2;
1482+
pub const MPOL_F_MEMS_ALLOWED: u32 = 4;
1483+
pub const MPOL_MF_STRICT: u32 = 1;
1484+
pub const MPOL_MF_MOVE: u32 = 2;
1485+
pub const MPOL_MF_MOVE_ALL: u32 = 4;
1486+
pub const MPOL_MF_LAZY: u32 = 8;
1487+
pub const MPOL_MF_INTERNAL: u32 = 16;
1488+
pub const MPOL_MF_VALID: u32 = 7;
1489+
pub const MPOL_F_SHARED: u32 = 1;
1490+
pub const MPOL_F_MOF: u32 = 8;
1491+
pub const MPOL_F_MORON: u32 = 16;
1492+
pub const RECLAIM_ZONE: u32 = 1;
1493+
pub const RECLAIM_WRITE: u32 = 2;
1494+
pub const RECLAIM_UNMAP: u32 = 4;
14761495
pub const PROT_READ: u32 = 1;
14771496
pub const PROT_WRITE: u32 = 2;
14781497
pub const PROT_EXEC: u32 = 4;
@@ -2548,6 +2567,13 @@ pub const SPLICE_F_MOVE: u32 = 1;
25482567
pub const SPLICE_F_NONBLOCK: u32 = 2;
25492568
pub const SPLICE_F_MORE: u32 = 4;
25502569
pub const SPLICE_F_GIFT: u32 = 8;
2570+
pub const MPOL_DEFAULT: _bindgen_ty_1 = _bindgen_ty_1::MPOL_DEFAULT;
2571+
pub const MPOL_PREFERRED: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED;
2572+
pub const MPOL_BIND: _bindgen_ty_1 = _bindgen_ty_1::MPOL_BIND;
2573+
pub const MPOL_INTERLEAVE: _bindgen_ty_1 = _bindgen_ty_1::MPOL_INTERLEAVE;
2574+
pub const MPOL_LOCAL: _bindgen_ty_1 = _bindgen_ty_1::MPOL_LOCAL;
2575+
pub const MPOL_PREFERRED_MANY: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED_MANY;
2576+
pub const MPOL_MAX: _bindgen_ty_1 = _bindgen_ty_1::MPOL_MAX;
25512577
#[repr(u32)]
25522578
#[non_exhaustive]
25532579
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -2564,6 +2590,18 @@ FSCONFIG_CMD_RECONFIGURE = 7,
25642590
#[repr(u32)]
25652591
#[non_exhaustive]
25662592
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2593+
pub enum _bindgen_ty_1 {
2594+
MPOL_DEFAULT = 0,
2595+
MPOL_PREFERRED = 1,
2596+
MPOL_BIND = 2,
2597+
MPOL_INTERLEAVE = 3,
2598+
MPOL_LOCAL = 4,
2599+
MPOL_PREFERRED_MANY = 5,
2600+
MPOL_MAX = 6,
2601+
}
2602+
#[repr(u32)]
2603+
#[non_exhaustive]
2604+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25672605
pub enum membarrier_cmd {
25682606
MEMBARRIER_CMD_QUERY = 0,
25692607
MEMBARRIER_CMD_GLOBAL = 1,

src/arm/general.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,25 @@ pub const UDF_SUPER_MAGIC: u32 = 352400198;
15041504
pub const DMA_BUF_MAGIC: u32 = 1145913666;
15051505
pub const DEVMEM_MAGIC: u32 = 1162691661;
15061506
pub const SECRETMEM_MAGIC: u32 = 1397048141;
1507+
pub const MPOL_F_STATIC_NODES: u32 = 32768;
1508+
pub const MPOL_F_RELATIVE_NODES: u32 = 16384;
1509+
pub const MPOL_F_NUMA_BALANCING: u32 = 8192;
1510+
pub const MPOL_MODE_FLAGS: u32 = 57344;
1511+
pub const MPOL_F_NODE: u32 = 1;
1512+
pub const MPOL_F_ADDR: u32 = 2;
1513+
pub const MPOL_F_MEMS_ALLOWED: u32 = 4;
1514+
pub const MPOL_MF_STRICT: u32 = 1;
1515+
pub const MPOL_MF_MOVE: u32 = 2;
1516+
pub const MPOL_MF_MOVE_ALL: u32 = 4;
1517+
pub const MPOL_MF_LAZY: u32 = 8;
1518+
pub const MPOL_MF_INTERNAL: u32 = 16;
1519+
pub const MPOL_MF_VALID: u32 = 7;
1520+
pub const MPOL_F_SHARED: u32 = 1;
1521+
pub const MPOL_F_MOF: u32 = 8;
1522+
pub const MPOL_F_MORON: u32 = 16;
1523+
pub const RECLAIM_ZONE: u32 = 1;
1524+
pub const RECLAIM_WRITE: u32 = 2;
1525+
pub const RECLAIM_UNMAP: u32 = 4;
15071526
pub const PROT_READ: u32 = 1;
15081527
pub const PROT_WRITE: u32 = 2;
15091528
pub const PROT_EXEC: u32 = 4;
@@ -2672,6 +2691,13 @@ pub const SPLICE_F_NONBLOCK: u32 = 2;
26722691
pub const SPLICE_F_MORE: u32 = 4;
26732692
pub const SPLICE_F_GIFT: u32 = 8;
26742693
pub const _NSIG: u32 = 64;
2694+
pub const MPOL_DEFAULT: _bindgen_ty_1 = _bindgen_ty_1::MPOL_DEFAULT;
2695+
pub const MPOL_PREFERRED: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED;
2696+
pub const MPOL_BIND: _bindgen_ty_1 = _bindgen_ty_1::MPOL_BIND;
2697+
pub const MPOL_INTERLEAVE: _bindgen_ty_1 = _bindgen_ty_1::MPOL_INTERLEAVE;
2698+
pub const MPOL_LOCAL: _bindgen_ty_1 = _bindgen_ty_1::MPOL_LOCAL;
2699+
pub const MPOL_PREFERRED_MANY: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED_MANY;
2700+
pub const MPOL_MAX: _bindgen_ty_1 = _bindgen_ty_1::MPOL_MAX;
26752701
#[repr(u32)]
26762702
#[non_exhaustive]
26772703
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -2688,6 +2714,18 @@ FSCONFIG_CMD_RECONFIGURE = 7,
26882714
#[repr(u32)]
26892715
#[non_exhaustive]
26902716
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2717+
pub enum _bindgen_ty_1 {
2718+
MPOL_DEFAULT = 0,
2719+
MPOL_PREFERRED = 1,
2720+
MPOL_BIND = 2,
2721+
MPOL_INTERLEAVE = 3,
2722+
MPOL_LOCAL = 4,
2723+
MPOL_PREFERRED_MANY = 5,
2724+
MPOL_MAX = 6,
2725+
}
2726+
#[repr(u32)]
2727+
#[non_exhaustive]
2728+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26912729
pub enum membarrier_cmd {
26922730
MEMBARRIER_CMD_QUERY = 0,
26932731
MEMBARRIER_CMD_GLOBAL = 1,

src/csky/general.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,25 @@ pub const UDF_SUPER_MAGIC: u32 = 352400198;
14951495
pub const DMA_BUF_MAGIC: u32 = 1145913666;
14961496
pub const DEVMEM_MAGIC: u32 = 1162691661;
14971497
pub const SECRETMEM_MAGIC: u32 = 1397048141;
1498+
pub const MPOL_F_STATIC_NODES: u32 = 32768;
1499+
pub const MPOL_F_RELATIVE_NODES: u32 = 16384;
1500+
pub const MPOL_F_NUMA_BALANCING: u32 = 8192;
1501+
pub const MPOL_MODE_FLAGS: u32 = 57344;
1502+
pub const MPOL_F_NODE: u32 = 1;
1503+
pub const MPOL_F_ADDR: u32 = 2;
1504+
pub const MPOL_F_MEMS_ALLOWED: u32 = 4;
1505+
pub const MPOL_MF_STRICT: u32 = 1;
1506+
pub const MPOL_MF_MOVE: u32 = 2;
1507+
pub const MPOL_MF_MOVE_ALL: u32 = 4;
1508+
pub const MPOL_MF_LAZY: u32 = 8;
1509+
pub const MPOL_MF_INTERNAL: u32 = 16;
1510+
pub const MPOL_MF_VALID: u32 = 7;
1511+
pub const MPOL_F_SHARED: u32 = 1;
1512+
pub const MPOL_F_MOF: u32 = 8;
1513+
pub const MPOL_F_MORON: u32 = 16;
1514+
pub const RECLAIM_ZONE: u32 = 1;
1515+
pub const RECLAIM_WRITE: u32 = 2;
1516+
pub const RECLAIM_UNMAP: u32 = 4;
14981517
pub const PROT_READ: u32 = 1;
14991518
pub const PROT_WRITE: u32 = 2;
15001519
pub const PROT_EXEC: u32 = 4;
@@ -2585,6 +2604,13 @@ pub const SPLICE_F_MOVE: u32 = 1;
25852604
pub const SPLICE_F_NONBLOCK: u32 = 2;
25862605
pub const SPLICE_F_MORE: u32 = 4;
25872606
pub const SPLICE_F_GIFT: u32 = 8;
2607+
pub const MPOL_DEFAULT: _bindgen_ty_1 = _bindgen_ty_1::MPOL_DEFAULT;
2608+
pub const MPOL_PREFERRED: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED;
2609+
pub const MPOL_BIND: _bindgen_ty_1 = _bindgen_ty_1::MPOL_BIND;
2610+
pub const MPOL_INTERLEAVE: _bindgen_ty_1 = _bindgen_ty_1::MPOL_INTERLEAVE;
2611+
pub const MPOL_LOCAL: _bindgen_ty_1 = _bindgen_ty_1::MPOL_LOCAL;
2612+
pub const MPOL_PREFERRED_MANY: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED_MANY;
2613+
pub const MPOL_MAX: _bindgen_ty_1 = _bindgen_ty_1::MPOL_MAX;
25882614
#[repr(u32)]
25892615
#[non_exhaustive]
25902616
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -2601,6 +2627,18 @@ FSCONFIG_CMD_RECONFIGURE = 7,
26012627
#[repr(u32)]
26022628
#[non_exhaustive]
26032629
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2630+
pub enum _bindgen_ty_1 {
2631+
MPOL_DEFAULT = 0,
2632+
MPOL_PREFERRED = 1,
2633+
MPOL_BIND = 2,
2634+
MPOL_INTERLEAVE = 3,
2635+
MPOL_LOCAL = 4,
2636+
MPOL_PREFERRED_MANY = 5,
2637+
MPOL_MAX = 6,
2638+
}
2639+
#[repr(u32)]
2640+
#[non_exhaustive]
2641+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26042642
pub enum membarrier_cmd {
26052643
MEMBARRIER_CMD_QUERY = 0,
26062644
MEMBARRIER_CMD_GLOBAL = 1,

src/loongarch64/general.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,25 @@ pub const UDF_SUPER_MAGIC: u32 = 352400198;
14711471
pub const DMA_BUF_MAGIC: u32 = 1145913666;
14721472
pub const DEVMEM_MAGIC: u32 = 1162691661;
14731473
pub const SECRETMEM_MAGIC: u32 = 1397048141;
1474+
pub const MPOL_F_STATIC_NODES: u32 = 32768;
1475+
pub const MPOL_F_RELATIVE_NODES: u32 = 16384;
1476+
pub const MPOL_F_NUMA_BALANCING: u32 = 8192;
1477+
pub const MPOL_MODE_FLAGS: u32 = 57344;
1478+
pub const MPOL_F_NODE: u32 = 1;
1479+
pub const MPOL_F_ADDR: u32 = 2;
1480+
pub const MPOL_F_MEMS_ALLOWED: u32 = 4;
1481+
pub const MPOL_MF_STRICT: u32 = 1;
1482+
pub const MPOL_MF_MOVE: u32 = 2;
1483+
pub const MPOL_MF_MOVE_ALL: u32 = 4;
1484+
pub const MPOL_MF_LAZY: u32 = 8;
1485+
pub const MPOL_MF_INTERNAL: u32 = 16;
1486+
pub const MPOL_MF_VALID: u32 = 7;
1487+
pub const MPOL_F_SHARED: u32 = 1;
1488+
pub const MPOL_F_MOF: u32 = 8;
1489+
pub const MPOL_F_MORON: u32 = 16;
1490+
pub const RECLAIM_ZONE: u32 = 1;
1491+
pub const RECLAIM_WRITE: u32 = 2;
1492+
pub const RECLAIM_UNMAP: u32 = 4;
14741493
pub const PROT_READ: u32 = 1;
14751494
pub const PROT_WRITE: u32 = 2;
14761495
pub const PROT_EXEC: u32 = 4;
@@ -2533,6 +2552,13 @@ pub const SPLICE_F_MOVE: u32 = 1;
25332552
pub const SPLICE_F_NONBLOCK: u32 = 2;
25342553
pub const SPLICE_F_MORE: u32 = 4;
25352554
pub const SPLICE_F_GIFT: u32 = 8;
2555+
pub const MPOL_DEFAULT: _bindgen_ty_1 = _bindgen_ty_1::MPOL_DEFAULT;
2556+
pub const MPOL_PREFERRED: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED;
2557+
pub const MPOL_BIND: _bindgen_ty_1 = _bindgen_ty_1::MPOL_BIND;
2558+
pub const MPOL_INTERLEAVE: _bindgen_ty_1 = _bindgen_ty_1::MPOL_INTERLEAVE;
2559+
pub const MPOL_LOCAL: _bindgen_ty_1 = _bindgen_ty_1::MPOL_LOCAL;
2560+
pub const MPOL_PREFERRED_MANY: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED_MANY;
2561+
pub const MPOL_MAX: _bindgen_ty_1 = _bindgen_ty_1::MPOL_MAX;
25362562
#[repr(u32)]
25372563
#[non_exhaustive]
25382564
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -2549,6 +2575,18 @@ FSCONFIG_CMD_RECONFIGURE = 7,
25492575
#[repr(u32)]
25502576
#[non_exhaustive]
25512577
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2578+
pub enum _bindgen_ty_1 {
2579+
MPOL_DEFAULT = 0,
2580+
MPOL_PREFERRED = 1,
2581+
MPOL_BIND = 2,
2582+
MPOL_INTERLEAVE = 3,
2583+
MPOL_LOCAL = 4,
2584+
MPOL_PREFERRED_MANY = 5,
2585+
MPOL_MAX = 6,
2586+
}
2587+
#[repr(u32)]
2588+
#[non_exhaustive]
2589+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25522590
pub enum membarrier_cmd {
25532591
MEMBARRIER_CMD_QUERY = 0,
25542592
MEMBARRIER_CMD_GLOBAL = 1,

0 commit comments

Comments
 (0)