summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2008-08-26 17:48:10 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2008-08-26 17:48:10 +0000
commit8fa62068c24863225169a97c4c01bbaa8103fa89 (patch)
tree473cc9984dd2bbb40b05334d771dced7f01d90e6
parenta78d8a9fe1037c50d57c2676ed3759079364b447 (diff)
Notes
-rw-r--r--sys/amd64/include/pcpu.h4
-rw-r--r--sys/arm/include/pcpu.h4
-rw-r--r--sys/i386/include/pcpu.h5
-rw-r--r--sys/ia64/include/pcpu.h4
-rw-r--r--sys/powerpc/include/pcpu.h3
-rw-r--r--sys/sparc64/include/pcpu.h4
-rw-r--r--sys/sun4v/include/pcpu.h5
-rw-r--r--sys/sys/pcpu.h8
-rw-r--r--sys/sys/types.h2
9 files changed, 23 insertions, 16 deletions
diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h
index 9245bbebbcbb..f3977987033d 100644
--- a/sys/amd64/include/pcpu.h
+++ b/sys/amd64/include/pcpu.h
@@ -33,8 +33,6 @@
#error "sys/cdefs.h is a prerequisite for this file"
#endif
-#ifdef _KERNEL
-
/*
* The SMP parts are setup in pmap.c and locore.s for the BSP, and
* mp_machdep.c sets up the data for the AP's to "see" when they awake.
@@ -51,6 +49,8 @@
u_int pc_apic_id; \
u_int pc_acpi_id /* ACPI CPU id */
+#ifdef _KERNEL
+
#ifdef lint
extern struct pcpu *pcpup;
diff --git a/sys/arm/include/pcpu.h b/sys/arm/include/pcpu.h
index 8388ba6fdd1b..387035cf2446 100644
--- a/sys/arm/include/pcpu.h
+++ b/sys/arm/include/pcpu.h
@@ -38,6 +38,8 @@
struct vmspace;
+#endif /* _KERNEL */
+
/*
* Inside the kernel, the globally reserved register g7 is used to
* point at the globaldata structure.
@@ -45,6 +47,8 @@ struct vmspace;
#define PCPU_MD_FIELDS \
struct pcup *pc_prvspace;
+#ifdef _KERNEL
+
struct pcb;
struct pcpu;
diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h
index 67cb5309fa00..26cce363c4af 100644
--- a/sys/i386/include/pcpu.h
+++ b/sys/i386/include/pcpu.h
@@ -33,8 +33,6 @@
#error "sys/cdefs.h is a prerequisite for this file"
#endif
-#ifdef _KERNEL
-
#include <machine/segments.h>
#include <machine/tss.h>
@@ -57,6 +55,9 @@
u_int pc_apic_id; \
int pc_private_tss /* Flag indicating private tss */
+
+#ifdef _KERNEL
+
#ifdef lint
extern struct pcpu *pcpup;
diff --git a/sys/ia64/include/pcpu.h b/sys/ia64/include/pcpu.h
index d641816d1f95..c63573b9992f 100644
--- a/sys/ia64/include/pcpu.h
+++ b/sys/ia64/include/pcpu.h
@@ -30,8 +30,6 @@
#ifndef _MACHINE_PCPU_H_
#define _MACHINE_PCPU_H_
-#ifdef _KERNEL
-
#include <machine/pcb.h>
#define PCPU_MD_FIELDS \
@@ -43,6 +41,8 @@
uint32_t pc_awake:1; /* CPU is awake? */ \
uint32_t pc_acpi_id /* ACPI CPU id. */
+#ifdef _KERNEL
+
struct pcpu;
register struct pcpu *pcpup __asm__("r13");
diff --git a/sys/powerpc/include/pcpu.h b/sys/powerpc/include/pcpu.h
index 6e9507630126..09d2f4c63056 100644
--- a/sys/powerpc/include/pcpu.h
+++ b/sys/powerpc/include/pcpu.h
@@ -30,7 +30,6 @@
#ifndef _MACHINE_PCPU_H_
#define _MACHINE_PCPU_H_
-#ifdef _KERNEL
#include <machine/cpufunc.h>
struct pmap;
@@ -54,6 +53,8 @@ struct pmap;
#define CPUSAVE_SRR0 6 /* where SRR0 gets saved */
#define CPUSAVE_SRR1 7 /* where SRR1 gets saved */
+#ifdef _KERNEL
+
#define PCPUP ((struct pcpu *) powerpc_get_pcpup())
#define PCPU_GET(member) (PCPUP->pc_ ## member)
diff --git a/sys/sparc64/include/pcpu.h b/sys/sparc64/include/pcpu.h
index 04f5ee6ca333..91c1e5dd5ca9 100644
--- a/sys/sparc64/include/pcpu.h
+++ b/sys/sparc64/include/pcpu.h
@@ -30,8 +30,6 @@
#ifndef _MACHINE_PCPU_H_
#define _MACHINE_PCPU_H_
-#ifdef _KERNEL
-
#include <machine/asmacros.h>
#include <machine/frame.h>
#include <machine/intr_machdep.h>
@@ -59,6 +57,8 @@ struct pmap;
u_int pc_tlb_ctx_max; \
u_int pc_tlb_ctx_min
+#ifdef _KERNEL
+
struct pcb;
struct pcpu;
diff --git a/sys/sun4v/include/pcpu.h b/sys/sun4v/include/pcpu.h
index 50bc3710f509..e679123fbd4d 100644
--- a/sys/sun4v/include/pcpu.h
+++ b/sys/sun4v/include/pcpu.h
@@ -30,8 +30,6 @@
#ifndef _MACHINE_PCPU_H_
#define _MACHINE_PCPU_H_
-#ifdef _KERNEL
-
#include <machine/asmacros.h>
#include <machine/frame.h>
#include <machine/intr_machdep.h>
@@ -82,6 +80,9 @@ struct pmap;
* be L2 cache aligned - they're surrounded by per-cpu data, so there is
* no possibility of false sharing, but this might help in reducing misses
*/
+
+#ifdef _KERNEL
+
struct pcpu;
register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG));
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index 942557431845..ef8037512b19 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -33,10 +33,6 @@
#ifndef _SYS_PCPU_H_
#define _SYS_PCPU_H_
-#ifndef _KERNEL
-#error "no user-serviceable parts inside"
-#endif
-
#ifdef LOCORE
#error "no assembler-serviceable parts inside"
#endif
@@ -78,6 +74,8 @@ struct pcpu {
struct device *pc_device;
};
+#ifdef _KERNEL
+
SLIST_HEAD(cpuhead, pcpu);
extern struct cpuhead cpuhead;
@@ -101,4 +99,6 @@ void pcpu_destroy(struct pcpu *pcpu);
struct pcpu *pcpu_find(u_int cpuid);
void pcpu_init(struct pcpu *pcpu, int cpuid, size_t size);
+#endif /* _KERNEL */
+
#endif /* !_SYS_PCPU_H_ */
diff --git a/sys/sys/types.h b/sys/sys/types.h
index 8f426e4f9944..37b8b0534831 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -143,6 +143,7 @@ typedef __clockid_t clockid_t;
#define _CLOCKID_T_DECLARED
#endif
+typedef __cpumask_t cpumask_t;
typedef __critical_t critical_t; /* Critical section value */
typedef __int64_t daddr_t; /* disk address */
@@ -278,7 +279,6 @@ typedef __vm_size_t vm_size_t;
#ifdef _KERNEL
typedef int boolean_t;
-typedef __cpumask_t cpumask_t;
typedef struct device *device_t;
typedef __intfptr_t intfptr_t;