Skip to content

Commit

Permalink
mm: Switch riscv64 to the new page table code
Browse files Browse the repository at this point in the history
Switch riscv64 to the new page table code, and add a few new wrappers
and headers (pmd_mkpmd, et al). This commit also fixed fork() breakage
that was introduced at some unknown point in time.

Signed-off-by: Pedro Falcato <[email protected]>
  • Loading branch information
heatd committed Jul 15, 2024
1 parent a628ce8 commit 87ff1a3
Show file tree
Hide file tree
Showing 8 changed files with 480 additions and 695 deletions.
665 changes: 2 additions & 663 deletions kernel/arch/riscv64/mmu.cpp

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions kernel/include/onyx/mm/pgtable-nop4d.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2024 Pedro Falcato
* This file is part of Onyx, and is released under the terms of the MIT License
* check LICENSE at the root directory for more information
*
* SPDX-License-Identifier: MIT
*/
#ifndef _ONYX_PGTABLE_NOP4D_H
#define _ONYX_PGTABLE_NOP4D_H

#define PTRS_PER_P4D 1

static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long addr)
{
return (p4d_t *) pgd;
}

static inline bool pgd_none(pgd_t pgd)
{
return false;
}

static inline bool pgd_present(pgd_t pgd)
{
return true;
}

static inline bool p4d_folded(void)
{
return true;
}

#endif
Loading

0 comments on commit 87ff1a3

Please sign in to comment.