git: f6fada5eed38 - main - amd64: -m32 support for machine/pcpu.h

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

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

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

    amd64: -m32 support for machine/pcpu.h
    
    Install the i386 pcpu.h under /usr/include/i386 on amd64 and include
    when targeting i386.
    
    This is a kernel-only header and should not be required, but
    procstat's zfs support includes this with _KERNEL defined.
    
    Reviewed by:    jhb, imp
---
 include/i386/Makefile    | 4 ++++
 sys/amd64/include/pcpu.h | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/include/i386/Makefile b/include/i386/Makefile
index 5bc1a13033e5..70d825bab9cf 100644
--- a/include/i386/Makefile
+++ b/include/i386/Makefile
@@ -11,6 +11,10 @@ INCS=	\
 	profile.h \
 	segments.h \
 	vmparam.h
+# These kernel-only headers are used by procstat's ZFS support.
+# This should be fixed.
+INCS+=	\
+	pcpu.h
 INCSDIR=	${INCLUDEDIR}/i386
 
 .include <bsd.prog.mk>
diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h
index a671f01dbad5..8dcf51cc71c6 100644
--- a/sys/amd64/include/pcpu.h
+++ b/sys/amd64/include/pcpu.h
@@ -28,6 +28,10 @@
  * $FreeBSD$
  */
 
+#ifdef __i386__
+#include <i386/pcpu.h>
+#else /* !__i386__ */
+
 #ifndef _MACHINE_PCPU_H_
 #define	_MACHINE_PCPU_H_
 
@@ -274,3 +278,5 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line");
 #endif /* _KERNEL */
 
 #endif /* !_MACHINE_PCPU_H_ */
+
+#endif /* __i386__ */