summaryrefslogtreecommitdiffstats
path: root/sys/i386/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/include')
-rw-r--r--sys/i386/include/cpu.h4
-rw-r--r--sys/i386/include/globaldata.h26
-rw-r--r--sys/i386/include/globals.h8
-rw-r--r--sys/i386/include/md_var.h8
-rw-r--r--sys/i386/include/mptable.h18
-rw-r--r--sys/i386/include/mutex.h2
-rw-r--r--sys/i386/include/npx.h2
-rw-r--r--sys/i386/include/param.h7
-rw-r--r--sys/i386/include/pcb_ext.h2
-rw-r--r--sys/i386/include/pcpu.h26
-rw-r--r--sys/i386/include/privatespace.h6
-rw-r--r--sys/i386/include/proc.h3
-rw-r--r--sys/i386/include/reg.h8
-rw-r--r--sys/i386/include/vm86.h2
14 files changed, 65 insertions, 57 deletions
diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h
index 04ef7a0..a7783a0 100644
--- a/sys/i386/include/cpu.h
+++ b/sys/i386/include/cpu.h
@@ -56,8 +56,8 @@
#define cpu_exec(p) /* nothing */
#define cpu_swapin(p) /* nothing */
-#define cpu_getstack(p) ((p)->p_frame->tf_esp)
-#define cpu_setstack(p, ap) ((p)->p_frame->tf_esp = (ap))
+#define cpu_getstack(td) ((td)->td_frame->tf_esp)
+#define cpu_setstack(td, ap) ((td)->td_frame->tf_esp = (ap))
#define TRAPF_USERMODE(framep) \
((ISPL((framep)->tf_cs) == SEL_UPL) || ((framep)->tf_eflags & PSL_VM))
diff --git a/sys/i386/include/globaldata.h b/sys/i386/include/globaldata.h
index 37388aa..f02354d 100644
--- a/sys/i386/include/globaldata.h
+++ b/sys/i386/include/globaldata.h
@@ -52,19 +52,19 @@
* other processors"
*/
struct globaldata {
- struct globaldata *gd_prvspace; /* self-reference */
- struct proc *gd_curproc; /* current process */
- struct proc *gd_idleproc; /* idle process */
- struct proc *gd_npxproc;
- struct pcb *gd_curpcb; /* current pcb */
- struct timeval gd_switchtime;
- struct i386tss gd_common_tss;
- int gd_switchticks;
- struct segment_descriptor gd_common_tssd;
- struct segment_descriptor *gd_tss_gdt;
- int gd_currentldt;
- u_int gd_cpuid; /* this cpu number */
- u_int gd_other_cpus; /* all other cpus */
+ struct globaldata *gd_prvspace; /* self-reference */
+ struct thread *gd_curthread;
+ struct thread *gd_npxthread;
+ struct pcb *gd_curpcb;
+ struct thread *gd_idlethread;
+ struct timeval gd_switchtime;
+ struct i386tss gd_common_tss;
+ int gd_switchticks;
+ struct segment_descriptor gd_common_tssd;
+ struct segment_descriptor *gd_tss_gdt;
+ int gd_currentldt;
+ u_int gd_cpuid;
+ u_int gd_other_cpus;
SLIST_ENTRY(globaldata) gd_allcpu;
struct lock_list_entry *gd_spinlocks;
#ifdef KTR_PERCPU
diff --git a/sys/i386/include/globals.h b/sys/i386/include/globals.h
index 7613069..c3cc211 100644
--- a/sys/i386/include/globals.h
+++ b/sys/i386/include/globals.h
@@ -129,10 +129,12 @@
#define PCPU_PTR(member) __PCPU_PTR(gd_ ## member)
#define PCPU_SET(member, val) __PCPU_SET(gd_ ## member, val)
-#define CURPROC PCPU_GET(curproc)
-#define CURTHD PCPU_GET(curproc)
#define GLOBALDATA PCPU_GET(prvspace)
-#define curproc PCPU_GET(curproc)
+#define curthread PCPU_GET(curthread)
+#define CURPROC (curthread->td_proc)
+#define curproc (curthread->td_proc)
+#define curksegrp (curthread->td_ksegrp)
+#define curkse (curthread->td_kse)
#endif /* _KERNEL */
diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h
index bc9cb75..c3564c2 100644
--- a/sys/i386/include/md_var.h
+++ b/sys/i386/include/md_var.h
@@ -61,7 +61,7 @@ extern char sigcode[];
extern int szsigcode, szosigcode;
typedef void alias_for_inthand_t __P((u_int cs, u_int ef, u_int esp, u_int ss));
-struct proc;
+struct thread;
struct reg;
struct fpreg;
struct dbreg;
@@ -80,9 +80,9 @@ void doreti_popl_es __P((void)) __asm(__STRING(doreti_popl_es));
void doreti_popl_es_fault __P((void)) __asm(__STRING(doreti_popl_es_fault));
void doreti_popl_fs __P((void)) __asm(__STRING(doreti_popl_fs));
void doreti_popl_fs_fault __P((void)) __asm(__STRING(doreti_popl_fs_fault));
-int fill_fpregs __P((struct proc *, struct fpreg *));
-int fill_regs __P((struct proc *p, struct reg *regs));
-int fill_dbregs __P((struct proc *p, struct dbreg *dbregs));
+int fill_fpregs __P((struct thread *, struct fpreg *));
+int fill_regs __P((struct thread *p, struct reg *regs));
+int fill_dbregs __P((struct thread *p, struct dbreg *dbregs));
void fillw __P((int /*u_short*/ pat, void *base, size_t cnt));
void i486_bzero __P((void *buf, size_t len));
void i586_bcopy __P((const void *from, void *to, size_t len));
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index d912e0c..f558524 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -26,7 +26,7 @@
*/
#include "opt_cpu.h"
-#include "opt_upages.h"
+#include "opt_kstack_pages.h"
#ifdef SMP
#include <machine/smptests.h>
@@ -1960,8 +1960,8 @@ start_all_aps(u_int boot_addr)
SMPpt[pg] = (pt_entry_t)(PG_V | PG_RW | vtophys(gd));
/* allocate and set up an idle stack data page */
- stack = (char *)kmem_alloc(kernel_map, UPAGES*PAGE_SIZE);
- for (i = 0; i < UPAGES; i++)
+ stack = (char *)kmem_alloc(kernel_map, KSTACK_PAGES * PAGE_SIZE); /* XXXKSE */
+ for (i = 0; i < KSTACK_PAGES; i++)
SMPpt[pg + 1 + i] = (pt_entry_t)
(PG_V | PG_RW | vtophys(PAGE_SIZE * i + stack));
@@ -1977,7 +1977,7 @@ start_all_aps(u_int boot_addr)
outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */
#endif
- bootSTK = &SMP_prvspace[x].idlestack[UPAGES*PAGE_SIZE];
+ bootSTK = &SMP_prvspace[x].idlekstack[KSTACK_PAGES * PAGE_SIZE];
bootAP = x;
/* attempt to start the Application Processor */
@@ -2019,8 +2019,8 @@ start_all_aps(u_int boot_addr)
*/
/* Allocate and setup BSP idle stack */
- stack = (char *)kmem_alloc(kernel_map, UPAGES * PAGE_SIZE);
- for (i = 0; i < UPAGES; i++)
+ stack = (char *)kmem_alloc(kernel_map, KSTACK_PAGES * PAGE_SIZE);
+ for (i = 0; i < KSTACK_PAGES; i++)
SMPpt[1 + i] = (pt_entry_t)
(PG_V | PG_RW | vtophys(PAGE_SIZE * i + stack));
@@ -2241,7 +2241,7 @@ ap_init(void)
* Set curproc to our per-cpu idleproc so that mutexes have
* something unique to lock with.
*/
- PCPU_SET(curproc, PCPU_GET(idleproc));
+ PCPU_SET(curthread, PCPU_GET(idlethread));
PCPU_SET(spinlocks, NULL);
/* lock against other AP's that are waking up */
@@ -2323,7 +2323,7 @@ forwarded_statclock(struct trapframe frame)
{
mtx_lock_spin(&sched_lock);
- statclock_process(curproc, TRAPF_PC(&frame), TRAPF_USERMODE(&frame));
+ statclock_process(curthread->td_kse, TRAPF_PC(&frame), TRAPF_USERMODE(&frame));
mtx_unlock_spin(&sched_lock);
}
@@ -2354,7 +2354,7 @@ forwarded_hardclock(struct trapframe frame)
{
mtx_lock_spin(&sched_lock);
- hardclock_process(curproc, TRAPF_USERMODE(&frame));
+ hardclock_process(curthread, TRAPF_USERMODE(&frame));
mtx_unlock_spin(&sched_lock);
}
diff --git a/sys/i386/include/mutex.h b/sys/i386/include/mutex.h
index b0fe512..ae37b23 100644
--- a/sys/i386/include/mutex.h
+++ b/sys/i386/include/mutex.h
@@ -250,7 +250,7 @@ extern struct mtx clock_lock;
pushl %ecx ; \
pushl %ebx ; \
movl $(MTX_UNOWNED) , %eax ; \
- movl PCPU(CURPROC), %ebx ; \
+ movl PCPU(CURTHREAD), %ebx ; \
pushfl ; \
popl %ecx ; \
cli ; \
diff --git a/sys/i386/include/npx.h b/sys/i386/include/npx.h
index 67ce661..589a4be 100644
--- a/sys/i386/include/npx.h
+++ b/sys/i386/include/npx.h
@@ -142,7 +142,7 @@ union savefpu {
#ifdef _KERNEL
int npxdna __P((void));
-void npxexit __P((struct proc *p));
+void npxexit __P((struct thread *td));
void npxinit __P((int control));
void npxsave __P((union savefpu *addr));
int npxtrap __P((void));
diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
index 9f63c01..ba28cfb 100644
--- a/sys/i386/include/param.h
+++ b/sys/i386/include/param.h
@@ -111,9 +111,12 @@
#define IOPAGES 2 /* pages of i/o permission bitmap */
-#ifndef UPAGES
-#define UPAGES 2 /* pages of u-area */
+#ifndef KSTACK_PAGES
+#define KSTACK_PAGES 2 /* Includes pcb! */
#endif
+#define UAREA_PAGES 1 /* holds struct user WITHOUT PCB (see def.) */
+
+#define KSTACK_GUARD /* compile in the kstack guard page */
/*
* Ceiling on amount of swblock kva space.
diff --git a/sys/i386/include/pcb_ext.h b/sys/i386/include/pcb_ext.h
index 7d6fb08..c6f9fc0 100644
--- a/sys/i386/include/pcb_ext.h
+++ b/sys/i386/include/pcb_ext.h
@@ -53,7 +53,7 @@ struct pcb_ldt {
#ifdef _KERNEL
-int i386_extend_pcb __P((struct proc *));
+int i386_extend_pcb __P((struct thread *));
void set_user_ldt __P((struct pcb *));
struct pcb_ldt *user_ldt_alloc __P((struct pcb *, int));
void user_ldt_free __P((struct pcb *));
diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h
index 37388aa..f02354d 100644
--- a/sys/i386/include/pcpu.h
+++ b/sys/i386/include/pcpu.h
@@ -52,19 +52,19 @@
* other processors"
*/
struct globaldata {
- struct globaldata *gd_prvspace; /* self-reference */
- struct proc *gd_curproc; /* current process */
- struct proc *gd_idleproc; /* idle process */
- struct proc *gd_npxproc;
- struct pcb *gd_curpcb; /* current pcb */
- struct timeval gd_switchtime;
- struct i386tss gd_common_tss;
- int gd_switchticks;
- struct segment_descriptor gd_common_tssd;
- struct segment_descriptor *gd_tss_gdt;
- int gd_currentldt;
- u_int gd_cpuid; /* this cpu number */
- u_int gd_other_cpus; /* all other cpus */
+ struct globaldata *gd_prvspace; /* self-reference */
+ struct thread *gd_curthread;
+ struct thread *gd_npxthread;
+ struct pcb *gd_curpcb;
+ struct thread *gd_idlethread;
+ struct timeval gd_switchtime;
+ struct i386tss gd_common_tss;
+ int gd_switchticks;
+ struct segment_descriptor gd_common_tssd;
+ struct segment_descriptor *gd_tss_gdt;
+ int gd_currentldt;
+ u_int gd_cpuid;
+ u_int gd_other_cpus;
SLIST_ENTRY(globaldata) gd_allcpu;
struct lock_list_entry *gd_spinlocks;
#ifdef KTR_PERCPU
diff --git a/sys/i386/include/privatespace.h b/sys/i386/include/privatespace.h
index 496c4b6..83320cf 100644
--- a/sys/i386/include/privatespace.h
+++ b/sys/i386/include/privatespace.h
@@ -39,9 +39,9 @@ struct privatespace {
struct globaldata globaldata;
char __filler0[PAGE_SIZE - sizeof(struct globaldata)];
- /* page 1 - idle stack (UPAGES pages) */
- char idlestack[UPAGES * PAGE_SIZE];
- /* page 1+UPAGES... */
+ /* page 1 - idle stack (KSTACK_PAGES pages) */
+ char idlekstack[KSTACK_PAGES * PAGE_SIZE];
+ /* page 1+KSTACK_PAGES... */
};
extern struct privatespace SMP_prvspace[];
diff --git a/sys/i386/include/proc.h b/sys/i386/include/proc.h
index 4217c4f..9e9e449 100644
--- a/sys/i386/include/proc.h
+++ b/sys/i386/include/proc.h
@@ -42,6 +42,9 @@
/*
* Machine-dependent part of the proc structure for i386.
*/
+struct mdthread {
+};
+
struct mdproc {
};
diff --git a/sys/i386/include/reg.h b/sys/i386/include/reg.h
index 47856a3..f4c6ae5 100644
--- a/sys/i386/include/reg.h
+++ b/sys/i386/include/reg.h
@@ -143,10 +143,10 @@ struct dbreg {
/*
* XXX these interfaces are MI, so they should be declared in a MI place.
*/
-int set_fpregs __P((struct proc *, struct fpreg *));
-int set_regs __P((struct proc *p, struct reg *regs));
-void setregs __P((struct proc *, u_long, u_long, u_long));
-int set_dbregs __P((struct proc *p, struct dbreg *dbregs));
+int set_fpregs __P((struct thread *, struct fpreg *));
+int set_regs __P((struct thread *p, struct reg *regs));
+void setregs __P((struct thread *, u_long, u_long, u_long));
+int set_dbregs __P((struct thread *p, struct dbreg *dbregs));
#endif
#endif /* !_MACHINE_REG_H_ */
diff --git a/sys/i386/include/vm86.h b/sys/i386/include/vm86.h
index 60c5615..fa77013 100644
--- a/sys/i386/include/vm86.h
+++ b/sys/i386/include/vm86.h
@@ -149,7 +149,7 @@ extern int vm86paddr;
struct proc;
extern int vm86_emulate __P((struct vm86frame *));
-extern int vm86_sysarch __P((struct proc *, char *));
+extern int vm86_sysarch __P((struct thread *, char *));
extern void vm86_trap __P((struct vm86frame *));
extern int vm86_intcall __P((int, struct vm86frame *));
extern int vm86_datacall __P((int, struct vm86frame *, struct vm86context *));
OpenPOWER on IntegriCloud