kernel/vm: Overhaul protection checks and fixup.

* Give arch_vm_supports_protection a team_id argument (primarily
   to allow the kernel address space to be more restricted than
   user ones.)

 * Move invocation of arch_vm_supports_protection to a static method,
   and also call fix_protection from there.

 * Consolidate protection checks.
This commit is contained in:
Augustin Cavalier
2026-03-21 09:26:44 -04:00
parent 17a4eb1ef9
commit 05f1182cca
9 changed files with 59 additions and 53 deletions
+2 -2
View File
@@ -11,7 +11,7 @@
#include <arch_vm.h>
#include <SupportDefs.h>
#include <OS.h>
struct kernel_args;
@@ -29,7 +29,7 @@ status_t arch_vm_init_end(struct kernel_args *args);
status_t arch_vm_init_post_modules(struct kernel_args *args);
void arch_vm_aspace_swap(struct VMAddressSpace *from,
struct VMAddressSpace *to);
bool arch_vm_supports_protection(uint32 protection);
bool arch_vm_supports_protection(team_id team, uint32 protection);
status_t arch_vm_set_memory_type(struct VMArea *area, phys_addr_t physicalBase,
uint32 type, uint32 *effectiveType);