git: 721b44ba5f3f - main - amd64: pmap.h put a guard around a pcpu.h function
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 12 May 2023 11:17:17 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=721b44ba5f3fb711af5797eae6345295721e13dd
commit 721b44ba5f3fb711af5797eae6345295721e13dd
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-05-12 11:14:54 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-05-12 11:14:54 +0000
amd64: pmap.h put a guard around a pcpu.h function
pmap_get_pcid() calls zpcpu_get() which is defined in pcpu.h.
It is unclear why we do not include that header but like right
above the change add another guard around pmap_get_pcid().
This allows some LinuxKPI headers to compile again.
Suggested by: markj
MFC after: 10 days
---
sys/amd64/include/pmap.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index cf41855a7c59..b61edf475b4b 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -534,6 +534,7 @@ pmap_invlpg(pmap_t pmap, vm_offset_t va)
}
#endif /* sys/pcpu.h && machine/cpufunc.h */
+#if defined(_SYS_PCPU_H_)
/* Return pcid for the pmap pmap on current cpu */
static __inline uint32_t
pmap_get_pcid(pmap_t pmap)
@@ -544,6 +545,7 @@ pmap_get_pcid(pmap_t pmap)
pcidp = zpcpu_get(pmap->pm_pcidp);
return (pcidp->pm_pcid);
}
+#endif /* sys/pcpu.h */
#endif /* _KERNEL */