diff options
Diffstat (limited to 'aarch64')
-rw-r--r-- | aarch64/Makefrag.am | 2 | ||||
-rw-r--r-- | aarch64/include/mach/aarch64/asm.h | 39 | ||||
-rw-r--r-- | aarch64/include/mach/aarch64/syscall_sw.h | 32 |
3 files changed, 73 insertions, 0 deletions
diff --git a/aarch64/Makefrag.am b/aarch64/Makefrag.am index 15ce3f49..7949d7ba 100644 --- a/aarch64/Makefrag.am +++ b/aarch64/Makefrag.am @@ -27,9 +27,11 @@ if HOST_aarch64 include_mach_aarch64dir = $(includedir)/mach/aarch64 include_mach_aarch64_HEADERS = \ + aarch64/include/mach/aarch64/asm.h \ aarch64/include/mach/aarch64/boolean.h \ 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_types.h endif # HOST_aarch64 diff --git a/aarch64/include/mach/aarch64/asm.h b/aarch64/include/mach/aarch64/asm.h new file mode 100644 index 00000000..ae94e637 --- /dev/null +++ b/aarch64/include/mach/aarch64/asm.h @@ -0,0 +1,39 @@ +/* + * 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_ASM_H_ +#define _MACH_AARCH64_ASM_H_ + +#define EXT(x) x +#define LEXT(x) x ## : +#define SEXT(x) #x + +#define TEXT_ALIGN 4 +#define DATA_ALIGN 4 + +#define SVC svc # (0) +#define ENTRY(x) .globl EXT(x); .type EXT(x), @function; .p2align TEXT_ALIGN; LEXT(x) +#define END(x) .size x,.-x + +#ifdef __ARM_FEATURE_BTI_DEFAULT +#define MACH_BTI_C bti c +#else +#define MACH_BTI_C +#endif + +#endif /* _MACH_AARCH64_ASM_H_ */ diff --git a/aarch64/include/mach/aarch64/syscall_sw.h b/aarch64/include/mach/aarch64/syscall_sw.h new file mode 100644 index 00000000..cf13dd7e --- /dev/null +++ b/aarch64/include/mach/aarch64/syscall_sw.h @@ -0,0 +1,32 @@ +/* + * 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_SYSCALL_SW_H_ +#define _MACH_AARCH64_SYSCALL_SW_H_ + +#include <mach/machine/asm.h> + +#define kernel_trap(trap_name,trap_number,number_args) \ +ENTRY(trap_name) \ + MACH_BTI_C; \ + mov w8, #(trap_number); \ + SVC; \ + ret; \ +END(trap_name) + +#endif /* _MACH_AARCH64_SYSCALL_SW_H_ */ |