[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

@@ -4,6 +4,7 @@
#include "cpu.h"
#include "objects/process.h"
#include "objects/thread.h"
#include "objects/vm_area.h"
// This object is initialized _before_ global constructors are called,
// so we don't want it to have a global constructor at all, lest it
@@ -94,7 +95,11 @@ process::create_thread(uint8_t priority, bool user)
if (user) {
uintptr_t stack_top = stacks_top - (m_threads.count() * stack_size);
m_space.allow(stack_top - stack_size, stack_size, true);
vm_area *vma = new vm_area_open(stack_size, m_space,
vm_flags::zero|vm_flags::write);
m_space.add(stack_top - stack_size, vma);
th->tcb()->rsp3 = stack_top;
}