summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2024-04-15 12:01:44 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-04-16 09:41:51 +0900
commitfd2482bb3500602b8f747ab96df195b1d5c511d5 (patch)
tree75e96700ad6bec4c3c2fdf96ea4a5052eea0a1dc /include
parenta0ff799984cf2ed1a50c1161aabff3aaee622c64 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/mach/vm_param.h6
1 files changed, 3 insertions, 3 deletions
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_ */