X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fbitmap.h;h=2dbf38a4bdfb9faa179cbb6daa7b82ad209db915;hb=dc83e159fc3dd0301a967aef2b84f1460aa3ef08;hp=50d8db646caa11eb0018a0ac98b2bdc586b894f9;hpb=750d21936d284127e265d050ccbce76fca1ece1a;p=pintos-anon diff --git a/src/lib/bitmap.h b/src/lib/bitmap.h index 50d8db6..2dbf38a 100644 --- a/src/lib/bitmap.h +++ b/src/lib/bitmap.h @@ -4,10 +4,19 @@ #include #include -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 */