aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/mdesc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/mdesc.c')
-rw-r--r--arch/sparc/kernel/mdesc.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
index 938da19dc065..cdc91d919e93 100644
--- a/arch/sparc/kernel/mdesc.c
+++ b/arch/sparc/kernel/mdesc.c
@@ -10,6 +10,7 @@
10#include <linux/slab.h> 10#include <linux/slab.h>
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/miscdevice.h> 12#include <linux/miscdevice.h>
13#include <linux/bootmem.h>
13 14
14#include <asm/cpudata.h> 15#include <asm/cpudata.h>
15#include <asm/hypervisor.h> 16#include <asm/hypervisor.h>
@@ -108,25 +109,15 @@ static struct mdesc_handle * __init mdesc_lmb_alloc(unsigned int mdesc_size)
108 109
109static void mdesc_lmb_free(struct mdesc_handle *hp) 110static void mdesc_lmb_free(struct mdesc_handle *hp)
110{ 111{
111 unsigned int alloc_size, handle_size = hp->handle_size; 112 unsigned int alloc_size;
112 unsigned long start, end; 113 unsigned long start;
113 114
114 BUG_ON(atomic_read(&hp->refcnt) != 0); 115 BUG_ON(atomic_read(&hp->refcnt) != 0);
115 BUG_ON(!list_empty(&hp->list)); 116 BUG_ON(!list_empty(&hp->list));
116 117
117 alloc_size = PAGE_ALIGN(handle_size); 118 alloc_size = PAGE_ALIGN(hp->handle_size);
118 119 start = __pa(hp);
119 start = (unsigned long) hp; 120 free_bootmem_late(start, alloc_size);
120 end = start + alloc_size;
121
122 while (start < end) {
123 struct page *p;
124
125 p = virt_to_page(start);
126 ClearPageReserved(p);
127 __free_page(p);
128 start += PAGE_SIZE;
129 }
130} 121}
131 122
132static struct mdesc_mem_ops lmb_mdesc_ops = { 123static struct mdesc_mem_ops lmb_mdesc_ops = {