1 #include <linux/compiler.h> 2 #include <linux/bitmap.h> 11 { .
node = 0, .map =
"0" },
12 { .node = 1, .map =
"1-2" },
13 { .node = 3, .map =
"5-7,9" },
16 #define T TEST_ASSERT_VAL 21 unsigned long *bm = NULL;
24 bm = bitmap_alloc(nbits);
27 bitmap_zero(bm, nbits);
29 for (i = 0; i < map->
nr; i++) {
30 set_bit(map->
map[i], bm);
39 return bm && map ? bm : NULL;
48 .nr_memory_nodes = ARRAY_SIZE(nodes),
49 .memory_bsize = 0x100,
53 for (i = 0; i < ARRAY_SIZE(nodes); i++) {
57 T(
"failed: alloc bitmap",
70 for (i = 0; i < ARRAY_SIZE(nodes); i++)
int mem2node__node(struct mem2node *map, u64 addr)
void mem2node__exit(struct mem2node *map)
void cpu_map__put(struct cpu_map *map)
struct memory_node * memory_nodes
static unsigned long * get_bitmap(const char *str, int nbits)
static int str(yyscan_t scanner, int token)
int test__mem2node(struct test *t __maybe_unused, int subtest __maybe_unused)
int mem2node__init(struct mem2node *map, struct perf_env *env)
static struct node test_nodes[]
struct cpu_map * cpu_map__new(const char *cpu_list)