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> --- aarch64/Makefrag.am | 1 + aarch64/include/mach/aarch64/vm_param.h | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 aarch64/include/mach/aarch64/vm_param.h (limited to 'aarch64') 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 + +#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_ */ -- cgit v1.2.3