diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-12-23 19:18:07 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-12-23 19:18:07 +0200 |
| commit | a64f3588ff5da7f148659ccb0eff844ccfb57088 (patch) | |
| tree | e7f02e67ba4e9f7c0ca8608addda4bacab09b7a4 /arch/riscv/kernel | |
| parent | f2300b433e152968a0fcabd79fb9d0f5fda6bca3 (diff) | |
| download | kmi-a64f3588ff5da7f148659ccb0eff844ccfb57088.tar.gz kmi-a64f3588ff5da7f148659ccb0eff844ccfb57088.zip | |
Fixups to four previous commits
+ Christ, I'm shit at git etiquette
Diffstat (limited to 'arch/riscv/kernel')
| -rw-r--r-- | arch/riscv/kernel/vmem.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/riscv/kernel/vmem.c b/arch/riscv/kernel/vmem.c index 80644bd..bf49716 100644 --- a/arch/riscv/kernel/vmem.c +++ b/arch/riscv/kernel/vmem.c @@ -97,11 +97,6 @@ void map_vmem(struct vm_branch_t *branch, while (top != order) { size_t idx = vm_to_index(vaddr, top); - if (is_branch(branch->leaf[idx])){ - __destroy_branch(branch->leaf[idx]); - branch->leaf[idx] = 0; - } - if (!branch->leaf[idx]) branch->leaf[idx] = __create_leaf(); @@ -111,6 +106,9 @@ void map_vmem(struct vm_branch_t *branch, } size_t idx = vm_to_index(vaddr, top); + if (is_branch(branch->leaf[idx])) /* something has gone terribly wrong */ + __destroy_branch(branch->leaf[idx]); + branch->leaf[idx] = (struct vm_branch_t *)to_pte(paddr, flags); } |
