Destroy PT pages in addrspace_destroy().
[pintos-anon] / src / lib / bitmap.h
index 50d8db646caa11eb0018a0ac98b2bdc586b894f9..2dbf38a4bdfb9faa179cbb6daa7b82ad209db915 100644 (file)
@@ -4,10 +4,19 @@
 #include <stdbool.h>
 #include <stddef.h>
 
-struct bitmap *bitmap_create (size_t bit_cnt);
+typedef unsigned long elem_type;
+
+struct bitmap
+  {
+    size_t bit_cnt;
+    elem_type *bits;
+  };
+
+bool bitmap_init (struct bitmap *, size_t bit_cnt);
 void bitmap_destroy (struct bitmap *);
 
 size_t bitmap_size (const struct bitmap *);
+size_t bitmap_storage_size (const struct bitmap *);
 
 void bitmap_set (struct bitmap *, size_t idx, bool);
 void bitmap_set_all (struct bitmap *, bool);
@@ -30,4 +39,12 @@ bool bitmap_any (const struct bitmap *);
 bool bitmap_none (const struct bitmap *);
 bool bitmap_all (const struct bitmap *);
 
+#ifdef FILESYS
+struct file;
+void bitmap_read (struct bitmap *, struct file *);
+void bitmap_write (const struct bitmap *, struct file *);
+#endif
+
+void bitmap_dump (const struct bitmap *);
+
 #endif /* bitmap.h */