From fd2482bb3500602b8f747ab96df195b1d5c511d5 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Mon, 15 Apr 2024 12:01:44 +0300 Subject: aarch64: Add vm_param.h And make it so that the generic vm_param.h doesn't require the machine- specific one to define PAGE_SIZE etc. We *don't* want a PAGE_SIZE constant to be statically exported to userland; instead userland should initialize vm_page_size by querying vm_statistics(), and then use vm_page_size. We'd also like to eventually avoid exporting VM_MAX_ADDRESS, but this is not feasible at the moment. To make it feasible in the future, userland should try to avoid relying on the definition where possible. Message-ID: <20240415090149.38358-5-bugaevc@gmail.com> --- include/mach/vm_param.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/mach/vm_param.h b/include/mach/vm_param.h index 4cbd0eca..8ddb5d99 100644 --- a/include/mach/vm_param.h +++ b/include/mach/vm_param.h @@ -59,9 +59,7 @@ * PAGE_SIZE and PAGE_MASK should also be variables * so their values don't have to be constantly recomputed.) */ -#ifndef PAGE_SHIFT -#error mach/machine/vm_param.h needs to define PAGE_SHIFT. -#endif +#ifdef PAGE_SHIFT #ifndef PAGE_SIZE #define PAGE_SIZE (1 << PAGE_SHIFT) @@ -99,4 +97,6 @@ #define page_aligned(x) ((((vm_offset_t) (x)) & PAGE_MASK) == 0) #define phys_aligned(x) ((((phys_addr_t) (x)) & PAGE_MASK) == 0) +#endif /* PAGE_SHIFT */ + #endif /* _MACH_VM_PARAM_H_ */ -- cgit v1.2.3