summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2017-07-24 15:31:14 +0000
committerrobert <robert@openbsd.org>2017-07-24 15:31:14 +0000
commit4150df27a6788cc417bb6f4bf4e72c8df0034df2 (patch)
tree7a2822ef3115c0f264a375b60e91efed84cfbafb
parentDon't attempt to deactivate a class that doesn't have any packets in it (diff)
downloadwireguard-openbsd-4150df27a6788cc417bb6f4bf4e72c8df0034df2.tar.xz
wireguard-openbsd-4150df27a6788cc417bb6f4bf4e72c8df0034df2.zip
add some missing MULTIPROCESSOR ifdefs to not compile in code on
non-multiprocessor kernels to avoid unused function warnings by clang
-rw-r--r--sys/arch/amd64/amd64/amd64errata.c4
-rw-r--r--sys/arch/amd64/amd64/lapic.c6
-rw-r--r--sys/arch/amd64/amd64/pmap.c6
3 files changed, 12 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/amd64errata.c b/sys/arch/amd64/amd64/amd64errata.c
index b1123e1c12b..7e3a55583a6 100644
--- a/sys/arch/amd64/amd64/amd64errata.c
+++ b/sys/arch/amd64/amd64/amd64errata.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amd64errata.c,v 1.7 2014/07/13 12:11:01 jasper Exp $ */
+/* $OpenBSD: amd64errata.c,v 1.8 2017/07/24 15:31:14 robert Exp $ */
/* $NetBSD: errata.c,v 1.6 2007/02/05 21:05:45 ad Exp $ */
/*-
@@ -92,9 +92,11 @@ static const uint8_t amd64_errata_set1[] = {
SH_B3, SH_C0, SH_CG, DH_CG, CH_CG, OINK
};
+#ifdef MULTIPROCESSOR
static const uint8_t amd64_errata_set2[] = {
SH_B3, SH_C0, SH_CG, DH_CG, CH_CG, SH_D0, DH_D0, CH_D0, OINK
};
+#endif
static const uint8_t amd64_errata_set3[] = {
JH_E1, DH_E3, OINK
diff --git a/sys/arch/amd64/amd64/lapic.c b/sys/arch/amd64/amd64/lapic.c
index 49363987b23..a4cbad1cb81 100644
--- a/sys/arch/amd64/amd64/lapic.c
+++ b/sys/arch/amd64/amd64/lapic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lapic.c,v 1.47 2017/05/29 14:19:49 mpi Exp $ */
+/* $OpenBSD: lapic.c,v 1.48 2017/07/24 15:31:14 robert Exp $ */
/* $NetBSD: lapic.c,v 1.2 2003/05/08 01:04:35 fvdl Exp $ */
/*-
@@ -148,12 +148,14 @@ x2apic_writereg(int reg, u_int32_t val)
wrmsr(MSR_X2APIC_BASE + (reg >> 4), val);
}
+#ifdef MULTIPROCESSOR
static inline void
x2apic_writeicr(u_int32_t hi, u_int32_t lo)
{
u_int32_t msr = MSR_X2APIC_BASE + (LAPIC_ICRLO >> 4);
__asm volatile("wrmsr" : : "a" (lo), "d" (hi), "c" (msr));
}
+#endif
u_int32_t
lapic_cpu_number(void)
@@ -579,6 +581,7 @@ lapic_delay(int usec)
* XXX the following belong mostly or partly elsewhere..
*/
+#ifdef MULTIPROCESSOR
static __inline void i82489_icr_wait(void);
static __inline void
@@ -598,7 +601,6 @@ i82489_icr_wait(void)
}
}
-#ifdef MULTIPROCESSOR
void
i82489_ipi_init(int target)
{
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c
index 68580d24877..5833da94304 100644
--- a/sys/arch/amd64/amd64/pmap.c
+++ b/sys/arch/amd64/amd64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.104 2017/05/29 14:19:49 mpi Exp $ */
+/* $OpenBSD: pmap.c,v 1.105 2017/07/24 15:31:14 robert Exp $ */
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
/*
@@ -287,7 +287,9 @@ int pmap_find_pte_direct(struct pmap *pm, vaddr_t va, pt_entry_t **pd, int *offs
void pmap_free_ptp(struct pmap *, struct vm_page *,
vaddr_t, pt_entry_t *, pd_entry_t **, struct pg_to_free *);
void pmap_freepage(struct pmap *, struct vm_page *, int, struct pg_to_free *);
+#ifdef MULTIPROCESSOR
static boolean_t pmap_is_active(struct pmap *, int);
+#endif
void pmap_map_ptes(struct pmap *, pt_entry_t **, pd_entry_t ***, paddr_t *);
struct pv_entry *pmap_remove_pv(struct vm_page *, struct pmap *, vaddr_t);
void pmap_do_remove(struct pmap *, vaddr_t, vaddr_t, int);
@@ -335,12 +337,14 @@ pmap_is_curpmap(struct pmap *pmap)
* pmap_is_active: is this pmap loaded into the specified processor's %cr3?
*/
+#ifdef MULTIPROCESSOR
static __inline boolean_t
pmap_is_active(struct pmap *pmap, int cpu_id)
{
return (pmap == pmap_kernel() ||
(pmap->pm_cpus & (1ULL << cpu_id)) != 0);
}
+#endif
static __inline u_int
pmap_pte2flags(u_long pte)