[kernel] Replace buffer_cache with vm_area_buffers

In order to reduce the amount of tracked state, now use the
vm_area_buffers instead of a VMA with buffer_cache on top.
This commit is contained in:
2020-09-27 15:34:24 -07:00
parent 67ebc58812
commit f7f8bb3f45
14 changed files with 161 additions and 120 deletions

View File

@@ -64,4 +64,11 @@ namespace memory {
inline size_t page_count(size_t bytes) {
return ((bytes - 1) >> 12) + 1;
}
/// Get the given address, aligned to the next lowest page
inline uintptr_t page_align_down(uintptr_t a) { return a & ~(frame_size-1); }
/// Get the given address, aligned to the next page
inline uintptr_t page_align_up(uintptr_t a) { return page_align_down(a-1) + frame_size; }
} // namespace memory