aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memblock.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-12-08 13:22:06 -0500
committerTejun Heo <tj@kernel.org>2011-12-08 13:22:06 -0500
commit581adcbe121872429de76ff9884762de71a76200 (patch)
tree6c7f0faf7ee8812630197e7c23fc32bb4cc978c2 /include/linux/memblock.h
parent1c16d242aa441c11ccaeaa63b49712555b8bfaeb (diff)
memblock: Make memblock_{add|remove|free|reserve}() return int and update prototypes
memblock_{add|remove|free|reserve}() return either 0 or -errno but had long as return type. Chage it to int. Also, drop 'extern' from all prototypes in memblock.h - they are unnecessary and used inconsistently (especially if mm.h is included in the picture). Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Yinghai Lu <yinghai@kernel.org>
Diffstat (limited to 'include/linux/memblock.h')
-rw-r--r--include/linux/memblock.h64
1 files changed, 29 insertions, 35 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index ab89b417655c..2f8e28f859b3 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -52,15 +52,15 @@ phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end,
52int memblock_free_reserved_regions(void); 52int memblock_free_reserved_regions(void);
53int memblock_reserve_reserved_regions(void); 53int memblock_reserve_reserved_regions(void);
54 54
55extern void memblock_init(void); 55void memblock_init(void);
56extern void memblock_analyze(void); 56void memblock_analyze(void);
57extern long memblock_add(phys_addr_t base, phys_addr_t size); 57int memblock_add(phys_addr_t base, phys_addr_t size);
58extern long memblock_remove(phys_addr_t base, phys_addr_t size); 58int memblock_remove(phys_addr_t base, phys_addr_t size);
59extern long memblock_free(phys_addr_t base, phys_addr_t size); 59int memblock_free(phys_addr_t base, phys_addr_t size);
60extern long memblock_reserve(phys_addr_t base, phys_addr_t size); 60int memblock_reserve(phys_addr_t base, phys_addr_t size);
61 61
62extern void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start, 62void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start,
63 phys_addr_t *out_end, int *out_nid); 63 phys_addr_t *out_end, int *out_nid);
64 64
65/** 65/**
66 * for_each_free_mem_range - iterate through free memblock areas 66 * for_each_free_mem_range - iterate through free memblock areas
@@ -80,7 +80,7 @@ extern void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start,
80 __next_free_mem_range(&i, nid, p_start, p_end, p_nid)) 80 __next_free_mem_range(&i, nid, p_start, p_end, p_nid))
81 81
82#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 82#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
83extern int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid); 83int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid);
84 84
85static inline void memblock_set_region_node(struct memblock_region *r, int nid) 85static inline void memblock_set_region_node(struct memblock_region *r, int nid)
86{ 86{
@@ -105,37 +105,31 @@ static inline int memblock_get_region_node(const struct memblock_region *r)
105/* The numa aware allocator is only available if 105/* The numa aware allocator is only available if
106 * CONFIG_ARCH_POPULATES_NODE_MAP is set 106 * CONFIG_ARCH_POPULATES_NODE_MAP is set
107 */ 107 */
108extern phys_addr_t memblock_find_in_range_node(phys_addr_t start, 108phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end,
109 phys_addr_t end, 109 phys_addr_t size, phys_addr_t align, int nid);
110 phys_addr_t size, 110phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid);
111 phys_addr_t align, int nid); 111phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid);
112extern phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
113 int nid);
114extern phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
115 int nid);
116 112
117extern phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align); 113phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
118 114
119/* Flags for memblock_alloc_base() amd __memblock_alloc_base() */ 115/* Flags for memblock_alloc_base() amd __memblock_alloc_base() */
120#define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) 116#define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)
121#define MEMBLOCK_ALLOC_ACCESSIBLE 0 117#define MEMBLOCK_ALLOC_ACCESSIBLE 0
122 118
123extern phys_addr_t memblock_alloc_base(phys_addr_t size, 119phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align,
124 phys_addr_t align, 120 phys_addr_t max_addr);
125 phys_addr_t max_addr); 121phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align,
126extern phys_addr_t __memblock_alloc_base(phys_addr_t size, 122 phys_addr_t max_addr);
127 phys_addr_t align, 123phys_addr_t memblock_phys_mem_size(void);
128 phys_addr_t max_addr); 124phys_addr_t memblock_start_of_DRAM(void);
129extern phys_addr_t memblock_phys_mem_size(void); 125phys_addr_t memblock_end_of_DRAM(void);
130extern phys_addr_t memblock_start_of_DRAM(void); 126void memblock_enforce_memory_limit(phys_addr_t memory_limit);
131extern phys_addr_t memblock_end_of_DRAM(void); 127int memblock_is_memory(phys_addr_t addr);
132extern void memblock_enforce_memory_limit(phys_addr_t memory_limit); 128int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
133extern int memblock_is_memory(phys_addr_t addr); 129int memblock_is_reserved(phys_addr_t addr);
134extern int memblock_is_region_memory(phys_addr_t base, phys_addr_t size); 130int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
135extern int memblock_is_reserved(phys_addr_t addr); 131
136extern int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size); 132void memblock_dump_all(void);
137
138extern void memblock_dump_all(void);
139 133
140/** 134/**
141 * memblock_set_current_limit - Set the current allocation limit to allow 135 * memblock_set_current_limit - Set the current allocation limit to allow
@@ -143,7 +137,7 @@ extern void memblock_dump_all(void);
143 * accessible during boot 137 * accessible during boot
144 * @limit: New limit value (physical address) 138 * @limit: New limit value (physical address)
145 */ 139 */
146extern void memblock_set_current_limit(phys_addr_t limit); 140void memblock_set_current_limit(phys_addr_t limit);
147 141
148 142
149/* 143/*