aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include/pcpu.h
diff options
context:
space:
mode:
authorJason Evans <jasone@FreeBSD.org>2000-09-07 01:33:02 +0000
committerJason Evans <jasone@FreeBSD.org>2000-09-07 01:33:02 +0000
commit0384fff8c5b098545c3db311b0e0aa1ec4c9ae7e (patch)
treebc6e36e781569f3efe04995c0b0befebb9154ef5 /sys/amd64/include/pcpu.h
parent62ae6c89ad2b03770097d05590093f93b9d94e08 (diff)
downloadsrc-0384fff8c5b098545c3db311b0e0aa1ec4c9ae7e.tar.gz
src-0384fff8c5b098545c3db311b0e0aa1ec4c9ae7e.zip
Major update to the way synchronization is done in the kernel. Highlights
include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh
Notes
Notes: svn path=/head/; revision=65557
Diffstat (limited to 'sys/amd64/include/pcpu.h')
-rw-r--r--sys/amd64/include/pcpu.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h
index 58bd9cfe9416..440da60b4b83 100644
--- a/sys/amd64/include/pcpu.h
+++ b/sys/amd64/include/pcpu.h
@@ -26,6 +26,20 @@
* $FreeBSD$
*/
+#ifndef _MACHINE_GLOBALDATA_H_
+#define _MACHINE_GLOBALDATA_H_
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#include <machine/pmap.h>
+#include <machine/segments.h>
+#include <machine/tss.h>
+
+/* XXX */
+#ifdef KTR_PERCPU
+#include <sys/ktr.h>
+#endif
+
/*
* This structure maps out the global data that needs to be kept on a
* per-cpu basis. genassym uses this to generate offsets for the assembler
@@ -41,11 +55,14 @@
struct globaldata {
struct privatespace *gd_prvspace; /* self-reference */
struct proc *gd_curproc;
+ struct proc *gd_prevproc;
struct proc *gd_npxproc;
struct pcb *gd_curpcb;
+ struct proc *gd_idleproc;
struct timeval gd_switchtime;
struct i386tss gd_common_tss;
int gd_switchticks;
+ int gd_intr_nesting_level;
struct segment_descriptor gd_common_tssd;
struct segment_descriptor *gd_tss_gdt;
#ifdef USER_LDT
@@ -67,8 +84,22 @@ struct globaldata {
unsigned *gd_prv_PADDR1;
#endif
u_int gd_astpending;
+ SLIST_ENTRY(globaldata) gd_allcpu;
+ int gd_witness_spin_check;
+#ifdef KTR_PERCPU
+#ifdef KTR
+ volatile int gd_ktr_idx;
+ char *gd_ktr_buf;
+ char gd_ktr_buf_data[KTR_SIZE];
+#endif
+#endif
};
+extern struct globaldata globaldata;
+
+SLIST_HEAD(cpuhead, globaldata);
+extern struct cpuhead cpuhead;
+
#ifdef SMP
/*
* This is the upper (0xff800000) address space layout that is per-cpu.
@@ -93,3 +124,5 @@ struct privatespace {
extern struct privatespace SMP_prvspace[];
#endif
+
+#endif /* ! _MACHINE_GLOBALDATA_H_ */