X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fkernel%2Fbitmap.h;h=1c66c2a613ee6e7d35b15d0f825d84727f54d72f;hb=07ee003af55dc3aab779e95ef2a4f095f6b65964;hp=8aef186f709a6073c6c445f19b20285f2b114d08;hpb=7106fafb92091fe9f85fbe051ed5bed5a9ff805a;p=pintos-anon diff --git a/src/lib/kernel/bitmap.h b/src/lib/kernel/bitmap.h index 8aef186..1c66c2a 100644 --- a/src/lib/kernel/bitmap.h +++ b/src/lib/kernel/bitmap.h @@ -13,6 +13,7 @@ size_t bitmap_size (const struct bitmap *); void bitmap_set (struct bitmap *, size_t idx, bool); void bitmap_set_all (struct bitmap *, bool); +void bitmap_set_multiple (struct bitmap *, size_t start, size_t cnt, bool); void bitmap_mark (struct bitmap *, size_t idx); void bitmap_reset (struct bitmap *, size_t idx); @@ -21,16 +22,14 @@ void bitmap_flip (struct bitmap *, size_t idx); bool bitmap_test (const struct bitmap *, size_t idx); #define BITMAP_ERROR ((size_t) -1) -size_t bitmap_scan (const struct bitmap *, bool); -size_t bitmap_find_and_set (struct bitmap *); -size_t bitmap_find_and_clear (struct bitmap *); +size_t bitmap_scan (const struct bitmap *, size_t start, size_t cnt, bool); +size_t bitmap_scan_and_flip (struct bitmap *, size_t start, size_t cnt, + bool); -size_t bitmap_set_cnt (const struct bitmap *); -bool bitmap_clear_cnt (const struct bitmap *); - -bool bitmap_any (const struct bitmap *); -bool bitmap_none (const struct bitmap *); -bool bitmap_all (const struct bitmap *); +size_t bitmap_count (const struct bitmap *, size_t start, size_t cnt, bool); +bool bitmap_any (const struct bitmap *, size_t start, size_t cnt); +bool bitmap_none (const struct bitmap *, size_t start, size_t cnt); +bool bitmap_all (const struct bitmap *, size_t start, size_t cnt); #ifdef FILESYS struct file; @@ -41,4 +40,8 @@ void bitmap_write (const struct bitmap *, struct file *); void bitmap_dump (const struct bitmap *); +size_t bitmap_needed_bytes (size_t bit_cnt); +struct bitmap *bitmap_create_preallocated (size_t bit_cnt, + void *, size_t byte_cnt); + #endif /* lib/kernel/bitmap.h */