numa.h | numa.h | |||
---|---|---|---|---|
skipping to change at line 15 | skipping to change at line 15 | |||
#include <stddef.h> | #include <stddef.h> | |||
#include <string.h> | #include <string.h> | |||
#if defined(__x86_64__) || defined(__i386__) | #if defined(__x86_64__) || defined(__i386__) | |||
#define NUMA_NUM_NODES 128 | #define NUMA_NUM_NODES 128 | |||
#else | #else | |||
#define NUMA_NUM_NODES 2048 | #define NUMA_NUM_NODES 2048 | |||
#endif | #endif | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
typedef struct { | typedef struct { | |||
unsigned long n[NUMA_NUM_NODES/(sizeof(unsigned long)*8)]; | unsigned long n[NUMA_NUM_NODES/(sizeof(unsigned long)*8)]; | |||
} nodemask_t; | } nodemask_t; | |||
static inline void nodemask_zero(nodemask_t *mask) | static inline void nodemask_zero(nodemask_t *mask) | |||
{ | { | |||
memset(mask->n, 0, sizeof(mask->n)); | memset(mask->n, 0, sizeof(mask->n)); | |||
} | } | |||
static inline void nodemask_set(nodemask_t *mask, int node) | static inline void nodemask_set(nodemask_t *mask, int node) | |||
skipping to change at line 153 | skipping to change at line 157 | |||
program. Default is to print an error to stderr and exit if numa_exit_on _error | program. Default is to print an error to stderr and exit if numa_exit_on _error | |||
is true. */ | is true. */ | |||
void numa_error(char *where); | void numa_error(char *where); | |||
/* When true exit the program when a NUMA system call (except numa_availabl e) | /* When true exit the program when a NUMA system call (except numa_availabl e) | |||
fails */ | fails */ | |||
int numa_exit_on_error; | int numa_exit_on_error; | |||
/* Warning function. Can also be overwritten. Default is to print on stderr | /* Warning function. Can also be overwritten. Default is to print on stderr | |||
once. */ | once. */ | |||
void numa_warn(int num, char *fmt, ...); | void numa_warn(int num, char *fmt, ...); | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 8 lines changed or added | |||
numaif.h | numaif.h | |||
---|---|---|---|---|
#ifndef NUMAIF_H | #ifndef NUMAIF_H | |||
#define NUMAIF_H 1 | #define NUMAIF_H 1 | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/* Kernel interface for NUMA API */ | /* Kernel interface for NUMA API */ | |||
/* System calls */ | /* System calls */ | |||
extern long get_mempolicy(int *policy, | extern long get_mempolicy(int *policy, | |||
unsigned long *nmask, unsigned long maxnode, | unsigned long *nmask, unsigned long maxnode, | |||
void *addr, int flags); | void *addr, int flags); | |||
extern long mbind(void *start, unsigned long len, int mode, | extern long mbind(void *start, unsigned long len, int mode, | |||
unsigned long *nmask, unsigned long maxnode, unsigned flag s); | unsigned long *nmask, unsigned long maxnode, unsigned flag s); | |||
extern long set_mempolicy(int mode, unsigned long *nmask, | extern long set_mempolicy(int mode, unsigned long *nmask, | |||
unsigned long maxnode); | unsigned long maxnode); | |||
skipping to change at line 30 | skipping to change at line 34 | |||
#define MPOL_MAX MPOL_INTERLEAVE | #define MPOL_MAX MPOL_INTERLEAVE | |||
/* Flags for get_mem_policy */ | /* Flags for get_mem_policy */ | |||
#define MPOL_F_NODE (1<<0) /* return next il node or node of address * / | #define MPOL_F_NODE (1<<0) /* return next il node or node of address * / | |||
#define MPOL_F_ADDR (1<<1) /* look up vma using address */ | #define MPOL_F_ADDR (1<<1) /* look up vma using address */ | |||
/* Flags for mbind */ | /* Flags for mbind */ | |||
#define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ | #define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 8 lines changed or added | |||