diff options
Diffstat (limited to 'include/linux/memblock.h')
-rw-r--r-- | include/linux/memblock.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 434b958a4f5f..c36a55d3c1c2 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -24,6 +24,9 @@ | |||
24 | struct memblock_region { | 24 | struct memblock_region { |
25 | phys_addr_t base; | 25 | phys_addr_t base; |
26 | phys_addr_t size; | 26 | phys_addr_t size; |
27 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | ||
28 | int nid; | ||
29 | #endif | ||
27 | }; | 30 | }; |
28 | 31 | ||
29 | struct memblock_type { | 32 | struct memblock_type { |
@@ -58,6 +61,29 @@ extern long memblock_remove(phys_addr_t base, phys_addr_t size); | |||
58 | extern long memblock_free(phys_addr_t base, phys_addr_t size); | 61 | extern long memblock_free(phys_addr_t base, phys_addr_t size); |
59 | extern long memblock_reserve(phys_addr_t base, phys_addr_t size); | 62 | extern long memblock_reserve(phys_addr_t base, phys_addr_t size); |
60 | 63 | ||
64 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | ||
65 | extern int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid); | ||
66 | |||
67 | static inline void memblock_set_region_node(struct memblock_region *r, int nid) | ||
68 | { | ||
69 | r->nid = nid; | ||
70 | } | ||
71 | |||
72 | static inline int memblock_get_region_node(const struct memblock_region *r) | ||
73 | { | ||
74 | return r->nid; | ||
75 | } | ||
76 | #else | ||
77 | static inline void memblock_set_region_node(struct memblock_region *r, int nid) | ||
78 | { | ||
79 | } | ||
80 | |||
81 | static inline int memblock_get_region_node(const struct memblock_region *r) | ||
82 | { | ||
83 | return 0; | ||
84 | } | ||
85 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ | ||
86 | |||
61 | /* The numa aware allocator is only available if | 87 | /* The numa aware allocator is only available if |
62 | * CONFIG_ARCH_POPULATES_NODE_MAP is set | 88 | * CONFIG_ARCH_POPULATES_NODE_MAP is set |
63 | */ | 89 | */ |