git: 92a98611ca20 - main - amd64: -m32 support for machine/asm(macros).h

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Mon, 13 Jun 2022 17:36:02 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=92a98611ca2019c1cbc432617c130355108890cd

commit 92a98611ca2019c1cbc432617c130355108890cd
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2022-06-13 17:35:39 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2022-06-13 17:35:39 +0000

    amd64: -m32 support for machine/asm(macros).h
    
    Install the i386 versions under /usr/include/i386 on amd64 and include
    when targeting i386.
    
    Reviewed by:    jhb, imp
---
 include/i386/Makefile        | 2 ++
 sys/amd64/include/asm.h      | 6 ++++++
 sys/amd64/include/asmacros.h | 6 ++++++
 3 files changed, 14 insertions(+)

diff --git a/include/i386/Makefile b/include/i386/Makefile
index e422a100bebd..6870657b6bfa 100644
--- a/include/i386/Makefile
+++ b/include/i386/Makefile
@@ -2,6 +2,8 @@
 
 .PATH: ${SRCTOP}/sys/i386/include
 INCS=	\
+	asm.h \
+	asmacros.h \
 	cpufunc.h \
 	profile.h
 INCSDIR=	${INCLUDEDIR}/i386
diff --git a/sys/amd64/include/asm.h b/sys/amd64/include/asm.h
index 7b66e9446ff3..a0f886443e52 100644
--- a/sys/amd64/include/asm.h
+++ b/sys/amd64/include/asm.h
@@ -35,6 +35,10 @@
  * $FreeBSD$
  */
 
+#ifdef __i386__
+#include <i386/asm.h>
+#else /* !__i386__ */
+
 #ifndef _MACHINE_ASM_H_
 #define	_MACHINE_ASM_H_
 
@@ -110,3 +114,5 @@
 #endif /* !STRIP_FBSDID */
 
 #endif /* !_MACHINE_ASM_H_ */
+
+#endif /* __i386__ */
diff --git a/sys/amd64/include/asmacros.h b/sys/amd64/include/asmacros.h
index 973a1c761c6b..a0d2e153f09b 100644
--- a/sys/amd64/include/asmacros.h
+++ b/sys/amd64/include/asmacros.h
@@ -39,6 +39,10 @@
  * $FreeBSD$
  */
 
+#if defined(__i386__)
+#include <i386/asmacros.h>
+#else /* !__i386__ */
+
 #ifndef _MACHINE_ASMACROS_H_
 #define _MACHINE_ASMACROS_H_
 
@@ -264,3 +268,5 @@ X\vec_name:
 #endif /* __STDC__ */
 
 #endif /* !_MACHINE_ASMACROS_H_ */
+
+#endif /* __i386__ */