usb.patch, with conflicts and some warnings fixed
[pintos-anon] / src / threads / palloc.h
index 38a401cb10b4971de6a59f5e5617ab480ba14270..adfb3ca67e7ecb0cd7e87c631b85f1c8023c44ff 100644 (file)
@@ -1,17 +1,23 @@
 #ifndef THREADS_PALLOC_H
 #define THREADS_PALLOC_H
 
-#include <stdint.h>
+#include <stddef.h>
 
+/* How to allocate pages. */
 enum palloc_flags
   {
-    PAL_ASSERT = 001,           /* Panic on failure. */
-    PAL_ZERO = 002,             /* Zero page contents. */
-    PAL_USER = 004              /* User page. */
+    PAL_ASSERT = 1 << 0,   /* Panic on failure. */
+    PAL_ZERO = 1 << 1,     /* Zero page contents. */
+    PAL_USER = 1 << 2,     /* User page. */
+    PAL_NOCACHE = 1 << 3   /* Disable memory caching for page. */
   };
 
-void palloc_init (void);
-void *palloc_get (enum palloc_flags);
-void palloc_free (void *);
+extern void *zero_page;
+
+void palloc_init (size_t user_page_limit);
+void *palloc_get_page (enum palloc_flags);
+void *palloc_get_multiple (enum palloc_flags, size_t page_cnt);
+void palloc_free_page (void *);
+void palloc_free_multiple (void *, size_t page_cnt);
 
 #endif /* threads/palloc.h */