1#ifndef NUMAIF_H
2#define NUMAIF_H 1
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8/* Kernel interface for NUMA API */
9
10/* System calls */
11extern long get_mempolicy(int *policy, const unsigned long *nmask,
12 unsigned long maxnode, void *addr, int flags);
13extern long mbind(void *start, unsigned long len, int mode,
14 const unsigned long *nmask, unsigned long maxnode, unsigned flags);
15extern long set_mempolicy(int mode, const unsigned long *nmask,
16 unsigned long maxnode);
17extern long migrate_pages(int pid, unsigned long maxnode,
18 const unsigned long *frommask,
19 const unsigned long *tomask);
20
21extern long move_pages(int pid, unsigned long count,
22 void **pages, const int *nodes, int *status, int flags);
23
24/* Policies */
25#define MPOL_DEFAULT 0
26#define MPOL_PREFERRED 1
27#define MPOL_BIND 2
28#define MPOL_INTERLEAVE 3
29
30#define MPOL_MAX MPOL_INTERLEAVE
31
32/* Flags for get_mem_policy */
33#define MPOL_F_NODE (1<<0) /* return next il node or node of address */
34 /* Warning: MPOL_F_NODE is unsupported and
35 subject to change. Don't use. */
36#define MPOL_F_ADDR (1<<1) /* look up vma using address */
37#define MPOL_F_MEMS_ALLOWED (1<<2) /* query nodes allowed in cpuset */
38
39/* Flags for mbind */
40#define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */
41#define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform to mapping */
42#define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif
49