git: cca19272611d - main - amd64: -m32 support for machine/cpufunc.h

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

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

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

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

diff --git a/include/i386/Makefile b/include/i386/Makefile
index 60f70d4756b2..9bf2cef50b78 100644
--- a/include/i386/Makefile
+++ b/include/i386/Makefile
@@ -1,7 +1,8 @@
 # i386 headers installed on amd64
 
 .PATH: ${SRCTOP}/sys/i386/include
-INCS=
+INCS=	\
+	cpufunc.h
 INCSDIR=	${INCLUDEDIR}/i386
 
 .include <bsd.prog.mk>
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 941c951a941a..09f63b865948 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -38,6 +38,10 @@
  * used in preference to this.
  */
 
+#ifdef __i386__
+#include <i386/cpufunc.h>
+#else /* !__i386__ */
+
 #ifndef _MACHINE_CPUFUNC_H_
 #define	_MACHINE_CPUFUNC_H_
 
@@ -966,3 +970,5 @@ int	wrmsr_safe(u_int msr, uint64_t newval);
 #endif
 
 #endif /* !_MACHINE_CPUFUNC_H_ */
+
+#endif /* __i386__ */