From nobody Wed Jul 26 00:00:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R9Ytt3bQSz4pMcg; Wed, 26 Jul 2023 00:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R9Ytt2pMBz459N; Wed, 26 Jul 2023 00:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690329622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pf4Ya9384IUDO3VvJRcuiyB6Img+P37px6xpO3MEu4k=; b=TisCzpSG3kMrbbDHR/Hsprm5FCXVe6ASwiPwm/MEEt1O3EksqPy41GdfZrrs2EE9U0TyGP sjS1VQyAcoQjLw3YN+NwznXrvk6W1zMbK6vsvgHjfRW6iDjFavGsoDRaVRNmSWztrXTiDI arfLEzkSsPZp5V4Byee7/D8me+iv+xmHn+9EpbMAUKFM3u5AKnjg0H/8L/yJ8/3oE4FKvA pWXo6NxiPszKl7CqLV2MNaU+6Q/XDbp1m0fxl5lmToXmVCypltODBNkTfisTDBZe8Lzbqx rfNpDkqOesSuUFqVOQBagNee7We2cQu1RyNKmv9suLOg+EJlQ7NbwLobPd7hXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690329622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pf4Ya9384IUDO3VvJRcuiyB6Img+P37px6xpO3MEu4k=; b=DZXJqLC8rqHGDNes+n0DhbLRcpB4IZSOsrZfiUfyfnorpm/1cu7p/99ikVRhdExrH28ItY AaQVi3ev02QHmMWUWi1+qFQ4Thbt5LWNa0k/W6+dbjEOvZUOPCbkTloF62IBZ9PcpgNBto 0tn2p3zjfb7HUePT0joWwvSncbadqrVvARsEpaGdioVY0ymPo2/lTIRPC4wPSRwjoduZ/+ Vr4Qq1nmwQzhQycvBQIr67w2xPRRWU54DjWUMs2sMLsWHpcSLK0BrOfUicGQciQB6bTgFy oF03G0kTbMCOnexVNxBlE9c2gj22uKcfam2rhH5pT6xHjsWwsxN+lWLK3e2xmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690329622; a=rsa-sha256; cv=none; b=l6UfRb2jm+CqGGIep+NZSCi6KNPfPQhpXOznaC+CH1WO6AFooVHgniq4czPsiElHQ6GFHt GFZuksBu1dSTGLu1XVWBCm/YXnyDnXbHMmOpSVcD/Bq0w4SVFOIUhOpNeJrnXzUqMRyVAG XvoP9hcASiwrDBU4sEwLRMS4Jd/rEwWsanIPvCYE9p5ijt3YAkJcq4efYoqEg7A9pXBaM6 ihYz6ChMKKB5QfYneMx/UgcaVLcF76Y1QXDPXjlwb7SeumzA/zICX3QKG2KTZe7sJ2Xw1M sop4h8iLCvz7kSdTwYqro7eBK89OX4cqhEqfti8Hil77jBskHWbrjVWw5jwL/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R9Ytt1cbCzLMj; Wed, 26 Jul 2023 00:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36Q00M1V087397; Wed, 26 Jul 2023 00:00:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36Q00MjE087396; Wed, 26 Jul 2023 00:00:22 GMT (envelope-from git) Date: Wed, 26 Jul 2023 00:00:22 GMT Message-Id: <202307260000.36Q00MjE087396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: d5d97bed4ab6 - main - arm64 lib32: prepare arm64 headers to redirect to arm List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5d97bed4ab6bb63e97c8ff67b5b94ae37cd24fc Auto-Submitted: auto-generated The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=d5d97bed4ab6bb63e97c8ff67b5b94ae37cd24fc commit d5d97bed4ab6bb63e97c8ff67b5b94ae37cd24fc Author: Mike Karels AuthorDate: 2023-07-25 23:59:26 +0000 Commit: Mike Karels CommitDate: 2023-07-25 23:59:26 +0000 arm64 lib32: prepare arm64 headers to redirect to arm In order to compile lib32 libraries and other 32-bit code on arm64, needs to be redirected to an arm header rather than arm64 when building with -m32. Ifdef the arm64 headers that are installed in /usr/include/machine and used by user-level software (including references from /usr/include/*.h) so that if __arm__ is defined when including the arm64 version, is included rather than using the rest of the file's contents. Some arm headers had no arm64 equivalent; headers were added just to do the redirection. These files use #error if __arm__ is not defined to guard against confusion. Also add an include/arm Makefile, and modify Makefiles as needed to install everything, including the arm files in /usr/include/arm. fenv.h comes from lib/msun/arm/fenv.h. The new arm64 headers are: acle-compat.h cpuinfo.h sysreg.h Reviewed by: jrtc27, imp Differential Revision: https://reviews.freebsd.org/D40944 --- include/Makefile | 13 ++++++--- include/arm/Makefile | 60 +++++++++++++++++++++++++++++++++++++++++ lib/msun/aarch64/fenv.h | 6 +++++ sys/arm64/include/_align.h | 6 +++++ sys/arm64/include/_inttypes.h | 6 +++++ sys/arm64/include/_limits.h | 6 +++++ sys/arm64/include/_stdint.h | 6 +++++ sys/arm64/include/_types.h | 6 +++++ sys/arm64/include/acle-compat.h | 5 ++++ sys/arm64/include/armreg.h | 6 +++++ sys/arm64/include/asm.h | 6 +++++ sys/arm64/include/atomic.h | 6 +++++ sys/arm64/include/bus.h | 6 +++++ sys/arm64/include/counter.h | 6 +++++ sys/arm64/include/cpu.h | 6 +++++ sys/arm64/include/cpufunc.h | 6 +++++ sys/arm64/include/cpuinfo.h | 5 ++++ sys/arm64/include/efi.h | 6 +++++ sys/arm64/include/elf.h | 6 +++++ sys/arm64/include/exec.h | 6 +++++ sys/arm64/include/float.h | 6 +++++ sys/arm64/include/frame.h | 6 +++++ sys/arm64/include/ieeefp.h | 6 +++++ sys/arm64/include/param.h | 6 +++++ sys/arm64/include/pcb.h | 6 +++++ sys/arm64/include/pcpu.h | 6 +++++ sys/arm64/include/pcpu_aux.h | 6 +++++ sys/arm64/include/pmap.h | 6 +++++ sys/arm64/include/proc.h | 6 +++++ sys/arm64/include/profile.h | 6 +++++ sys/arm64/include/pte.h | 6 +++++ sys/arm64/include/reg.h | 6 +++++ sys/arm64/include/reloc.h | 6 +++++ sys/arm64/include/resource.h | 6 +++++ sys/arm64/include/runq.h | 6 +++++ sys/arm64/include/setjmp.h | 6 +++++ sys/arm64/include/sf_buf.h | 6 +++++ sys/arm64/include/signal.h | 6 +++++ sys/arm64/include/sysarch.h | 6 +++++ sys/arm64/include/sysreg.h | 5 ++++ sys/arm64/include/tls.h | 6 +++++ sys/arm64/include/ucontext.h | 6 +++++ sys/arm64/include/vdso.h | 6 +++++ sys/arm64/include/vfp.h | 6 +++++ sys/arm64/include/vmparam.h | 6 +++++ 45 files changed, 324 insertions(+), 4 deletions(-) diff --git a/include/Makefile b/include/Makefile index 922337a87772..ce8c49d3a7cd 100644 --- a/include/Makefile +++ b/include/Makefile @@ -9,7 +9,12 @@ PACKAGE=runtime CLEANFILES= osreldate.h version SUBDIR= arpa protocols rpcsvc rpc xlocale .if ${MACHINE_CPUARCH} == "amd64" -SUBDIR+= i386 +SUBDIR+= i386 +INCLUDE_SUBDIRS+= i386 +.endif +.if ${MACHINE_CPUARCH} == "aarch64" +SUBDIR+= arm +INCLUDE_SUBDIRS+= arm .endif SUBDIR_PARALLEL= INCS= a.out.h ar.h assert.h bitstring.h byteswap.h \ @@ -353,10 +358,10 @@ compat: mtree -deU ${NO_ROOT:D-W} ${MTREE_FOLLOWS_SYMLINKS} \ -f ${SRCTOP}/etc/mtree/BSD.include.dist \ -p ${SDESTDIR}${INCLUDEDIR} > /dev/null -.if ${MACHINE_CPUARCH} == "amd64" +.for d in ${INCLUDE_SUBDIRS} ${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \ - ${SDESTDIR}${INCLUDEDIR}/i386 -.endif + ${SDESTDIR}${INCLUDEDIR}/${d} +.endfor copies: .PHONY .META cd ${SDESTDIR}${INCLUDEDIR}; find ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto \ diff --git a/include/arm/Makefile b/include/arm/Makefile new file mode 100644 index 000000000000..1f596763df77 --- /dev/null +++ b/include/arm/Makefile @@ -0,0 +1,60 @@ +# arm headers installed on arm64 + +.PATH: ${SRCTOP}/sys/arm/include ${SRCTOP}/lib/msun/arm + +INCS= _align.h \ + _inttypes.h \ + _limits.h \ + _stdint.h \ + _types.h \ + acle-compat.h \ + armreg.h \ + asm.h \ + atomic.h \ + bus.h \ + counter.h \ + cpu.h \ + cpufunc.h \ + cpuinfo.h \ + efi.h \ + elf.h \ + exec.h \ + float.h \ + frame.h \ + ieeefp.h \ + param.h \ + pcb.h \ + pcpu.h \ + pmap.h \ + proc.h \ + profile.h \ + pte.h \ + reg.h \ + reloc.h \ + resource.h \ + runq.h \ + setjmp.h \ + signal.h \ + sysarch.h \ + sysreg.h \ + tls.h \ + ucontext.h \ + vdso.h \ + vfp.h \ + vmparam.h +# These kernel-only headers are used by procstat's ZFS support. +# This should be fixed. +INCS+= pcpu_aux.h \ + sf_buf.h +# from lib/msun/arm +INCS+= fenv.h +INCSDIR= ${INCLUDEDIR}/arm + +beforeinstall: armdir +META_TARGETS+= armdir + +armdir: + ${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \ + ${DESTDIR}${INCLUDEDIR}/arm + +.include diff --git a/lib/msun/aarch64/fenv.h b/lib/msun/aarch64/fenv.h index 2a55db3a9545..80b3fdf4cc1b 100644 --- a/lib/msun/aarch64/fenv.h +++ b/lib/msun/aarch64/fenv.h @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* __arm__ */ + #ifndef _FENV_H_ #define _FENV_H_ @@ -244,3 +248,5 @@ fegetexcept(void) __END_DECLS #endif /* !_FENV_H_ */ + +#endif /* __arm__ */ diff --git a/sys/arm64/include/_align.h b/sys/arm64/include/_align.h index 3844133ffb68..5c153779aca3 100644 --- a/sys/arm64/include/_align.h +++ b/sys/arm64/include/_align.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE__ALIGN_H_ #define _MACHINE__ALIGN_H_ @@ -42,3 +46,5 @@ #define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #endif /* !_MACHINE__ALIGN_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/_inttypes.h b/sys/arm64/include/_inttypes.h index df1af0b25df0..4c21d47f6c51 100644 --- a/sys/arm64/include/_inttypes.h +++ b/sys/arm64/include/_inttypes.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE__INTTYPES_H_ #define _MACHINE__INTTYPES_H_ @@ -211,3 +215,5 @@ #define SCNxPTR "lx" /* uintptr_t */ #endif /* !_MACHINE__INTTYPES_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/_limits.h b/sys/arm64/include/_limits.h index 39f0bcf0f5b2..d64a9afe1a1c 100644 --- a/sys/arm64/include/_limits.h +++ b/sys/arm64/include/_limits.h @@ -27,6 +27,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE__LIMITS_H_ #define _MACHINE__LIMITS_H_ @@ -83,3 +87,5 @@ #define __MINSIGSTKSZ (1024 * 4) #endif /* !_MACHINE__LIMITS_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/_stdint.h b/sys/arm64/include/_stdint.h index d73a9c088b59..6c978befc8b2 100644 --- a/sys/arm64/include/_stdint.h +++ b/sys/arm64/include/_stdint.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE__STDINT_H_ #define _MACHINE__STDINT_H_ @@ -156,3 +160,5 @@ #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ #endif /* !_MACHINE__STDINT_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/_types.h b/sys/arm64/include/_types.h index 720900a270d4..69610b96fa3b 100644 --- a/sys/arm64/include/_types.h +++ b/sys/arm64/include/_types.h @@ -32,6 +32,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE__TYPES_H_ #define _MACHINE__TYPES_H_ @@ -67,3 +71,5 @@ typedef unsigned int ___wchar_t; #define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ #endif /* !_MACHINE__TYPES_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/acle-compat.h b/sys/arm64/include/acle-compat.h new file mode 100644 index 000000000000..9954f27fd424 --- /dev/null +++ b/sys/arm64/include/acle-compat.h @@ -0,0 +1,5 @@ +#ifdef __arm__ +#include +#else /* !__arm__ */ +#error Do not include this header, used only for 32-bit compatibility +#endif /* !__arm__ */ diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index b40dfb206f99..f20b7a8c710e 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -29,6 +29,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_ARMREG_H_ #define _MACHINE_ARMREG_H_ @@ -1994,3 +1998,5 @@ #define ZCR_LEN_BYTES(x) ((((x) & ZCR_LEN_MASK) + 1) * 16) #endif /* !_MACHINE_ARMREG_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index b1d4ba50be9a..fbd09a5607c4 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_ASM_H_ #define _MACHINE_ASM_H_ @@ -113,3 +117,5 @@ isb #endif /* _MACHINE_ASM_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/atomic.h b/sys/arm64/include/atomic.h index b14cd303da3a..172bf051edf3 100644 --- a/sys/arm64/include/atomic.h +++ b/sys/arm64/include/atomic.h @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ @@ -670,3 +674,5 @@ atomic_thread_fence_seq_cst(void) #endif /* KCSAN && !KCSAN_RUNTIME */ #endif /* _MACHINE_ATOMIC_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/bus.h b/sys/arm64/include/bus.h index 902be0db3b62..4a43a8fb94c2 100644 --- a/sys/arm64/include/bus.h +++ b/sys/arm64/include/bus.h @@ -65,6 +65,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_BUS_H_ #define _MACHINE_BUS_H_ @@ -521,3 +525,5 @@ struct bus_space { #include #endif /* _MACHINE_BUS_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/counter.h b/sys/arm64/include/counter.h index 7f747b525d9c..513f67ac7f90 100644 --- a/sys/arm64/include/counter.h +++ b/sys/arm64/include/counter.h @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_COUNTER_H_ #define _MACHINE_COUNTER_H_ @@ -85,3 +89,5 @@ counter_u64_add(counter_u64_t c, int64_t inc) } #endif /* ! _MACHINE_COUNTER_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 0bb320f2e0a0..6d83ef25793c 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -38,6 +38,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_CPU_H_ #define _MACHINE_CPU_H_ @@ -253,3 +257,5 @@ ADDRESS_TRANSLATE_FUNC(s1e1w) #endif #endif /* !_MACHINE_CPU_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/cpufunc.h b/sys/arm64/include/cpufunc.h index f2de8a0e560c..b2ec5672aeb8 100644 --- a/sys/arm64/include/cpufunc.h +++ b/sys/arm64/include/cpufunc.h @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_CPUFUNC_H_ #define _MACHINE_CPUFUNC_H_ @@ -193,3 +197,5 @@ bool arm64_get_writable_addr(vm_offset_t, vm_offset_t *); #endif /* _KERNEL */ #endif /* _MACHINE_CPUFUNC_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/cpuinfo.h b/sys/arm64/include/cpuinfo.h new file mode 100644 index 000000000000..004f611ccf80 --- /dev/null +++ b/sys/arm64/include/cpuinfo.h @@ -0,0 +1,5 @@ +#ifdef __arm__ +#include +#else /* !__arm__ */ +#error Do not include this header, used only for 32-bit compatibility +#endif /* !__arm__ */ diff --git a/sys/arm64/include/efi.h b/sys/arm64/include/efi.h index 6db16e5b8291..3494c547362d 100644 --- a/sys/arm64/include/efi.h +++ b/sys/arm64/include/efi.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef __ARM64_INCLUDE_EFI_H_ #define __ARM64_INCLUDE_EFI_H_ @@ -58,3 +62,5 @@ struct efirt_callinfo { }; #endif /* __ARM64_INCLUDE_EFI_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/elf.h b/sys/arm64/include/elf.h index 22e968c632bf..0399392b8fb6 100644 --- a/sys/arm64/include/elf.h +++ b/sys/arm64/include/elf.h @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_ELF_H_ #define _MACHINE_ELF_H_ @@ -180,3 +184,5 @@ __ElfType(Auxinfo); #endif #endif /* !_MACHINE_ELF_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/exec.h b/sys/arm64/include/exec.h index da23dbe43a4f..00b6fc25f3a2 100644 --- a/sys/arm64/include/exec.h +++ b/sys/arm64/include/exec.h @@ -1 +1,7 @@ /* $FreeBSD$ */ + +#ifdef __arm__ +#include +#else /* !__arm__ */ +/* empty */ +#endif /* !__arm__ */ diff --git a/sys/arm64/include/float.h b/sys/arm64/include/float.h index 0829f6f52aa9..0fe90637fda1 100644 --- a/sys/arm64/include/float.h +++ b/sys/arm64/include/float.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_FLOAT_H_ #define _MACHINE_FLOAT_H_ @@ -92,3 +96,5 @@ __END_DECLS #endif /* __ISO_C_VISIBLE >= 2011 */ #endif /* _MACHINE_FLOAT_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/frame.h b/sys/arm64/include/frame.h index c838193bee9e..7a841ff160f1 100644 --- a/sys/arm64/include/frame.h +++ b/sys/arm64/include/frame.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_FRAME_H_ #define _MACHINE_FRAME_H_ @@ -77,3 +81,5 @@ struct sigframe32 { #endif /* !LOCORE */ #endif /* !_MACHINE_FRAME_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/ieeefp.h b/sys/arm64/include/ieeefp.h index 178721a65b1e..8c7166741c0c 100644 --- a/sys/arm64/include/ieeefp.h +++ b/sys/arm64/include/ieeefp.h @@ -4,6 +4,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ @@ -41,3 +45,5 @@ extern fp_except_t fpsetmask(fp_except_t); __END_DECLS #endif /* _MACHINE_IEEEFP_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/param.h b/sys/arm64/include/param.h index c94b797f8cca..a44fa3fcd9d2 100644 --- a/sys/arm64/include/param.h +++ b/sys/arm64/include/param.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ @@ -130,3 +134,5 @@ #define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) #endif /* !_MACHINE_PARAM_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/pcb.h b/sys/arm64/include/pcb.h index 85c92727ca43..8eb342ecd0bc 100644 --- a/sys/arm64/include/pcb.h +++ b/sys/arm64/include/pcb.h @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_PCB_H_ #define _MACHINE_PCB_H_ @@ -87,3 +91,5 @@ int savectx(struct pcb *pcb) __returns_twice; #endif /* !LOCORE */ #endif /* !_MACHINE_PCB_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/pcpu.h b/sys/arm64/include/pcpu.h index 38a8cd3c3e56..ebb72799d83f 100644 --- a/sys/arm64/include/pcpu.h +++ b/sys/arm64/include/pcpu.h @@ -27,6 +27,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_PCPU_H_ #define _MACHINE_PCPU_H_ @@ -89,3 +93,5 @@ get_curthread(void) #endif /* _KERNEL */ #endif /* !_MACHINE_PCPU_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/pcpu_aux.h b/sys/arm64/include/pcpu_aux.h index 57637c50063a..fada4ed65fb5 100644 --- a/sys/arm64/include/pcpu_aux.h +++ b/sys/arm64/include/pcpu_aux.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_PCPU_AUX_H_ #define _MACHINE_PCPU_AUX_H_ @@ -50,3 +54,5 @@ _Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size"); extern struct pcpu pcpu0; #endif /* _MACHINE_PCPU_AUX_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index b855a811d3c0..5af90e6a3ca7 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -33,6 +33,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ @@ -198,3 +202,5 @@ void pmap_san_bootstrap(struct arm64_bootparams *); #endif /* !LOCORE */ #endif /* !_MACHINE_PMAP_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/proc.h b/sys/arm64/include/proc.h index eb5fe806088a..9538c3ea1e4a 100644 --- a/sys/arm64/include/proc.h +++ b/sys/arm64/include/proc.h @@ -31,6 +31,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_PROC_H_ #define _MACHINE_PROC_H_ @@ -75,3 +79,5 @@ struct mdproc { #define KINFO_PROC32_SIZE 816 #endif /* !_MACHINE_PROC_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/profile.h b/sys/arm64/include/profile.h index f898e2707d65..0f077e4ba6ed 100644 --- a/sys/arm64/include/profile.h +++ b/sys/arm64/include/profile.h @@ -31,6 +31,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_PROFILE_H_ #define _MACHINE_PROFILE_H_ @@ -89,3 +93,5 @@ mcount(uintfptr_t frompc) #endif /* !_KERNEL */ #endif /* !_MACHINE_PROFILE_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/pte.h b/sys/arm64/include/pte.h index c320d71bb0f6..f51ac49a5d5d 100644 --- a/sys/arm64/include/pte.h +++ b/sys/arm64/include/pte.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_PTE_H_ #define _MACHINE_PTE_H_ @@ -188,3 +192,5 @@ typedef uint64_t pt_entry_t; /* page table entry */ #endif /* !_MACHINE_PTE_H_ */ /* End of pte.h */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/reg.h b/sys/arm64/include/reg.h index 4e8ca4f4e834..027c02a59903 100644 --- a/sys/arm64/include/reg.h +++ b/sys/arm64/include/reg.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_REG_H_ #define _MACHINE_REG_H_ @@ -91,3 +95,5 @@ struct arm64_addr_mask { #define __HAVE_REG32 #endif /* !_MACHINE_REG_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/reloc.h b/sys/arm64/include/reloc.h index da23dbe43a4f..b6e2eb6f775c 100644 --- a/sys/arm64/include/reloc.h +++ b/sys/arm64/include/reloc.h @@ -1 +1,7 @@ /* $FreeBSD$ */ + +#ifdef __arm__ +#include +#else /* !__arm__ */ +/* empty */ +#endif /* !__arm__ */ diff --git a/sys/arm64/include/resource.h b/sys/arm64/include/resource.h index aef4fad4516d..82d36fe6beb7 100644 --- a/sys/arm64/include/resource.h +++ b/sys/arm64/include/resource.h @@ -29,6 +29,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_RESOURCE_H_ #define _MACHINE_RESOURCE_H_ 1 @@ -47,3 +51,5 @@ #endif #endif /* !_MACHINE_RESOURCE_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/runq.h b/sys/arm64/include/runq.h index eaeb824a6698..0dfd55d3b726 100644 --- a/sys/arm64/include/runq.h +++ b/sys/arm64/include/runq.h @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_RUNQ_H_ #define _MACHINE_RUNQ_H_ @@ -44,3 +48,5 @@ typedef unsigned long rqb_word_t; #endif + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/setjmp.h b/sys/arm64/include/setjmp.h index af11a246cd3f..a88452a55015 100644 --- a/sys/arm64/include/setjmp.h +++ b/sys/arm64/include/setjmp.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_SETJMP_H_ #define _MACHINE_SETJMP_H_ @@ -71,3 +75,5 @@ typedef struct _jmp_buf { __int128_t _jb[_JBLEN + 1]; } jmp_buf[1]; #endif /* __ASSEMBLER__ */ #endif /* !_MACHINE_SETJMP_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/sf_buf.h b/sys/arm64/include/sf_buf.h index 59f9009bd086..7e99ae379b8a 100644 --- a/sys/arm64/include/sf_buf.h +++ b/sys/arm64/include/sf_buf.h @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ @@ -49,3 +53,5 @@ sf_buf_page(struct sf_buf *sf) return ((vm_page_t)sf); } #endif /* !_MACHINE_SF_BUF_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/signal.h b/sys/arm64/include/signal.h index 6c8ac5cabab5..2684a89952d7 100644 --- a/sys/arm64/include/signal.h +++ b/sys/arm64/include/signal.h @@ -32,6 +32,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_SIGNAL_H_ #define _MACHINE_SIGNAL_H_ @@ -48,3 +52,5 @@ struct sigcontext { #endif #endif /* !_MACHINE_SIGNAL_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/sysarch.h b/sys/arm64/include/sysarch.h index 4d6c547fd3df..22248cf1b867 100644 --- a/sys/arm64/include/sysarch.h +++ b/sys/arm64/include/sysarch.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + /* * Architecture specific syscalls (arm64) */ @@ -45,3 +49,5 @@ __END_DECLS #endif #endif /* !_MACHINE_SYSARCH_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/sysreg.h b/sys/arm64/include/sysreg.h new file mode 100644 index 000000000000..4ec435f9dcc1 --- /dev/null +++ b/sys/arm64/include/sysreg.h @@ -0,0 +1,5 @@ +#ifdef __arm__ +#include +#else /* !__arm__ */ +#error Do not include this header, used only for 32-bit compatibility +#endif /* !__arm__ */ diff --git a/sys/arm64/include/tls.h b/sys/arm64/include/tls.h index a3ec7f7952e8..c9db2bdfd708 100644 --- a/sys/arm64/include/tls.h +++ b/sys/arm64/include/tls.h @@ -28,6 +28,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_TLS_H_ #define _MACHINE_TLS_H_ @@ -53,3 +57,5 @@ _tcb_get(void) } #endif /* !_MACHINE_TLS_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/ucontext.h b/sys/arm64/include/ucontext.h index edb4cf8e63e3..d0b9296fe514 100644 --- a/sys/arm64/include/ucontext.h +++ b/sys/arm64/include/ucontext.h @@ -30,6 +30,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_UCONTEXT_H_ #define _MACHINE_UCONTEXT_H_ @@ -86,3 +90,5 @@ typedef struct __mcontext32_vfp { #endif /* COMPAT_FREEBSD32 */ #endif /* !_MACHINE_UCONTEXT_H_ */ + +#endif /* !__arm__ */ diff --git a/sys/arm64/include/vdso.h b/sys/arm64/include/vdso.h index fef74df39663..f84c980077ab 100644 --- a/sys/arm64/include/vdso.h +++ b/sys/arm64/include/vdso.h @@ -25,6 +25,10 @@ * $FreeBSD$ */ +#ifdef __arm__ +#include +#else /* !__arm__ */ + #ifndef _MACHINE_VDSO_H_ #define _MACHINE_VDSO_H_ @@ -37,3 +41,5 @@ #define VDSO_TIMEHANDS_MD32 VDSO_TIMEHANDS_MD *** 46 LINES SKIPPED ***