aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/arm64/mp_machdep.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2019-08-29 07:25:27 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2019-08-29 07:25:27 +0000
commita2a0f90654eeca563cf47f043d6c1a14e6a7e289 (patch)
tree0f0f88ea65718314696b068de30da60a01a3fdb8 /sys/arm64/arm64/mp_machdep.c
parent4b4d1b818e84c6eee3c06f60315510bf34729aba (diff)
downloadsrc-a2a0f90654eeca563cf47f043d6c1a14e6a7e289.tar.gz
src-a2a0f90654eeca563cf47f043d6c1a14e6a7e289.zip
Centralize __pcpu definitions.
Many extern struct pcpu <something>__pcpu declarations were copied/pasted in sources. The issue is that the definition is MD, but it cannot be provided by machine/pcpu.h due to actual struct pcpu defined in sys/pcpu.h later than the inclusion of machine/pcpu.h. This forced the copying when other code needed direct access to __pcpu. There is no way around it, due to machine/pcpu.h supplying part of struct pcpu fields. To work around the problem, add a new machine/pcpu_aux.h header, which should fill any needed MD definitions after struct pcpu definition is completed. This allows to remove copies of __pcpu spread around the source. Also on x86 it makes it possible to remove work arounds like OFFSETOF_CURTHREAD or clang specific warnings supressions. Reported and tested by: lwhsu, bcran Reviewed by: imp, markj (previous version) Discussed with: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D21418
Notes
Notes: svn path=/head/; revision=351594
Diffstat (limited to 'sys/arm64/arm64/mp_machdep.c')
-rw-r--r--sys/arm64/arm64/mp_machdep.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
index d046c27b8bad..ae35b26ffdb4 100644
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mutex.h>
+#include <sys/pcpu.h>
#include <sys/proc.h>
#include <sys/sched.h>
#include <sys/smp.h>
@@ -112,8 +113,6 @@ static struct intr_ipi *intr_ipi_lookup(u_int);
static void intr_pic_ipi_setup(u_int, const char *, intr_ipi_handler_t *,
void *);
-extern struct pcpu __pcpu[];
-
static void ipi_ast(void *);
static void ipi_hardclock(void *);
static void ipi_preempt(void *);