diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-05-22 21:14:29 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-05-22 21:14:29 +0300 |
| commit | d99be9e2912e0726ab779053b43a89e3b9e21490 (patch) | |
| tree | ec7bc982d6377f4fde4b3d85cf291a2698ab4254 /arch/riscv64/init | |
| parent | ae2843b3999f619da3cd4d6a37e488527dc481ac (diff) | |
| download | kmi-d99be9e2912e0726ab779053b43a89e3b9e21490.tar.gz kmi-d99be9e2912e0726ab779053b43a89e3b9e21490.zip | |
rename vm_branch to vmem
+ Closer to what it's for rather than what it is.
Diffstat (limited to 'arch/riscv64/init')
| -rw-r--r-- | arch/riscv64/init/init.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/riscv64/init/init.c b/arch/riscv64/init/init.c index 31a9155..bc68ea8 100644 --- a/arch/riscv64/init/init.c +++ b/arch/riscv64/init/init.c @@ -6,7 +6,7 @@ #include <csr.h> /* assume 64 bit for now */ -struct vm_branch *root_branch; +struct vmem *root_branch; #define to_pte(a, f) (((a) >> 12) << 10 | (f)) @@ -16,22 +16,21 @@ void init_bootmem() size_t flags = VM_V | VM_X | VM_R | VM_W; extern char *__init_start; - root_branch = (struct vm_branch *)align_down( + root_branch = (struct vmem *)align_down( (uintptr_t)&__init_start - SZ_4K, SZ_4K); /* direct mapping (temp) */ for (size_t i = 0; i < CSTACK_PAGE; ++i) - root_branch->leaf[i] = - (struct vm_branch *)to_pte(SZ_1G * i, flags); + root_branch->leaf[i] = (struct vmem *)to_pte(SZ_1G * i, flags); /* kernel (also sort of direct mapping) */ flags |= VM_G; for (size_t i = KSTART_PAGE; i < IO_PAGE; ++i) - root_branch->leaf[i] = (struct vm_branch *)to_pte( + root_branch->leaf[i] = (struct vmem *)to_pte( RAM_BASE + SZ_1G * (i - 256), flags); /* kernel IO, map to 0 for now, will be updated in the future */ - root_branch->leaf[IO_PAGE] = (struct vm_branch *)to_pte(0, flags); + root_branch->leaf[IO_PAGE] = (struct vmem *)to_pte(0, flags); csr_write(CSR_SATP, SATP_MODE_Sv39 | ((uintptr_t)root_branch >> 12)); } |
