git: 68049f6da84a - main - amd64: -m32 support for machine/profile.h

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

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

commit 68049f6da84a620246b24c04da09db03564fa18c
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/profile.h
    
    Install the i386 profile.h under /usr/include/i386 on amd64 and include
    when targeting i386.
    
    Reviewed by:    jhb, imp
---
 include/i386/Makefile       | 3 ++-
 sys/amd64/include/profile.h | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/i386/Makefile b/include/i386/Makefile
index 9bf2cef50b78..e422a100bebd 100644
--- a/include/i386/Makefile
+++ b/include/i386/Makefile
@@ -2,7 +2,8 @@
 
 .PATH: ${SRCTOP}/sys/i386/include
 INCS=	\
-	cpufunc.h
+	cpufunc.h \
+	profile.h
 INCSDIR=	${INCLUDEDIR}/i386
 
 .include <bsd.prog.mk>
diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h
index e86fd582b407..31b6379d4735 100644
--- a/sys/amd64/include/profile.h
+++ b/sys/amd64/include/profile.h
@@ -32,6 +32,10 @@
  * $FreeBSD$
  */
 
+#ifdef __i386__
+#include <i386/profile.h>
+#else /* !__i386__ */
+
 #ifndef _MACHINE_PROFILE_H_
 #define	_MACHINE_PROFILE_H_
 
@@ -116,3 +120,5 @@ __END_DECLS
 #endif /* !_KERNEL */
 
 #endif /* !_MACHINE_PROFILE_H_ */
+
+#endif /* __i386__ */