aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/include/mm.h
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-08-26 10:35:36 +0000
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-08-26 10:35:36 +0000
commit393415f09c80d9846cba6b7462d152bc0f032ede (patch)
tree3ae768c32dc6ff5d55be75a5263fad1a64a06f6c /extras/mini-os/include/mm.h
parent4fb2acfb09468669ebbeaa6570d42403bb8ffc4f (diff)
downloadxen-393415f09c80d9846cba6b7462d152bc0f032ede.tar.gz
xen-393415f09c80d9846cba6b7462d152bc0f032ede.tar.bz2
xen-393415f09c80d9846cba6b7462d152bc0f032ede.zip
The patch removes broken, and very complicated malloc in
favour of much simpler (and working) Xen's allocator (xmalloc by Rusty). Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Diffstat (limited to 'extras/mini-os/include/mm.h')
-rw-r--r--extras/mini-os/include/mm.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/extras/mini-os/include/mm.h b/extras/mini-os/include/mm.h
index d841aae8ca..27af789315 100644
--- a/extras/mini-os/include/mm.h
+++ b/extras/mini-os/include/mm.h
@@ -126,6 +126,18 @@ static __inline__ unsigned long machine_to_phys(unsigned long machine)
void init_mm(void);
unsigned long alloc_pages(int order);
-int is_mfn_mapped(unsigned long mfn);
+#define alloc_page() alloc_pages(0);
+void free_pages(void *pointer, int order);
+//int is_mfn_mapped(unsigned long mfn);
+
+static __inline__ int get_order(unsigned long size)
+{
+ int order;
+ size = (size-1) >> PAGE_SHIFT;
+ for ( order = 0; size; order++ )
+ size >>= 1;
+ return order;
+}
+
#endif /* _MM_H_ */