aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aarch64/Makefrag.am1
-rw-r--r--aarch64/include/mach/aarch64/vm_param.h34
-rw-r--r--include/mach/vm_param.h6
3 files changed, 38 insertions, 3 deletions
diff --git a/aarch64/Makefrag.am b/aarch64/Makefrag.am
index 7949d7ba..3da88c18 100644
--- a/aarch64/Makefrag.am
+++ b/aarch64/Makefrag.am
@@ -32,6 +32,7 @@ include_mach_aarch64_HEADERS = \
aarch64/include/mach/aarch64/kern_return.h \
aarch64/include/mach/aarch64/machine_types.defs \
aarch64/include/mach/aarch64/syscall_sw.h \
+ aarch64/include/mach/aarch64/vm_param.h \
aarch64/include/mach/aarch64/vm_types.h
endif # HOST_aarch64
diff --git a/aarch64/include/mach/aarch64/vm_param.h b/aarch64/include/mach/aarch64/vm_param.h
new file mode 100644
index 00000000..d7b1e281
--- /dev/null
+++ b/aarch64/include/mach/aarch64/vm_param.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2023-2024 Free Software Foundation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _MACH_AARCH64_VM_PARAM_H_
+#define _MACH_AARCH64_VM_PARAM_H_
+
+#include <mach/machine/vm_types.h>
+
+#define BYTE_SIZE 8 /* byte size in bits */
+
+/*
+ * TODO: Exporting VM_MAX_ADDRESS basically locks in
+ * VM_AARCH64_T0SZ being 48. Consider dropping it from this
+ * public header once userland no longer depends on it.
+ */
+#define VM_MIN_ADDRESS (0ULL)
+#define VM_MAX_ADDRESS (0x1000000000000ULL)
+
+#endif /* _MACH_AARCH64_VM_PARAM_H_ */
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_ */