diff options
author | julian <julian@FreeBSD.org> | 2002-02-07 20:58:47 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2002-02-07 20:58:47 +0000 |
commit | b5eb64d6f0fccb72419da5552deee22cb6117fac (patch) | |
tree | b267ad497d8d81c2c79c107443dabe850da2126b /sys/pc98 | |
parent | fce570367d0faf3002916a499e684172e61d8b9b (diff) | |
download | FreeBSD-src-b5eb64d6f0fccb72419da5552deee22cb6117fac.zip FreeBSD-src-b5eb64d6f0fccb72419da5552deee22cb6117fac.tar.gz |
Pre-KSE/M3 commit.
this is a low-functionality change that changes the kernel to access the main
thread of a process via the linked list of threads rather than
assuming that it is embedded in the process. It IS still embeded there
but remove all teh code that assumes that in preparation for the next commit
which will actually move it out.
Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/i386/machdep.c | 23 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 23 |
2 files changed, 22 insertions, 24 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 71d2098..5b9bcd8 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -1715,12 +1715,11 @@ init386(first) #endif struct pcpu *pc; - proc_linkup(&proc0); + proc_linkup(&proc0, &proc0.p_ksegrp, &proc0.p_kse, &thread0); proc0.p_uarea = proc0uarea; - thread0 = &proc0.p_thread; - thread0->td_kstack = proc0kstack; - thread0->td_pcb = (struct pcb *) - (thread0->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; + thread0.td_kstack = proc0kstack; + thread0.td_pcb = (struct pcb *) + (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; atdevbase = ISA_HOLE_START + KERNBASE; #ifdef PC98 @@ -1785,9 +1784,9 @@ init386(first) PCPU_SET(prvspace, pc); /* setup curproc so that mutexes work */ - PCPU_SET(curthread, thread0); + PCPU_SET(curthread, &thread0); - LIST_INIT(&thread0->td_contested); + LIST_INIT(&thread0.td_contested); /* * Initialize mutexes. @@ -1890,7 +1889,7 @@ init386(first) /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ - PCPU_SET(common_tss.tss_esp0, thread0->td_kstack + + PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16); PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); @@ -1947,10 +1946,10 @@ init386(first) _udatasel = LSEL(LUDATA_SEL, SEL_UPL); /* setup proc 0's pcb */ - thread0->td_pcb->pcb_flags = 0; /* XXXKSE */ - thread0->td_pcb->pcb_cr3 = (int)IdlePTD; - thread0->td_pcb->pcb_ext = 0; - thread0->td_frame = &proc0_tf; + thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ + thread0.td_pcb->pcb_cr3 = (int)IdlePTD; + thread0.td_pcb->pcb_ext = 0; + thread0.td_frame = &proc0_tf; } void diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 71d2098..5b9bcd8 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -1715,12 +1715,11 @@ init386(first) #endif struct pcpu *pc; - proc_linkup(&proc0); + proc_linkup(&proc0, &proc0.p_ksegrp, &proc0.p_kse, &thread0); proc0.p_uarea = proc0uarea; - thread0 = &proc0.p_thread; - thread0->td_kstack = proc0kstack; - thread0->td_pcb = (struct pcb *) - (thread0->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; + thread0.td_kstack = proc0kstack; + thread0.td_pcb = (struct pcb *) + (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; atdevbase = ISA_HOLE_START + KERNBASE; #ifdef PC98 @@ -1785,9 +1784,9 @@ init386(first) PCPU_SET(prvspace, pc); /* setup curproc so that mutexes work */ - PCPU_SET(curthread, thread0); + PCPU_SET(curthread, &thread0); - LIST_INIT(&thread0->td_contested); + LIST_INIT(&thread0.td_contested); /* * Initialize mutexes. @@ -1890,7 +1889,7 @@ init386(first) /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ - PCPU_SET(common_tss.tss_esp0, thread0->td_kstack + + PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16); PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); @@ -1947,10 +1946,10 @@ init386(first) _udatasel = LSEL(LUDATA_SEL, SEL_UPL); /* setup proc 0's pcb */ - thread0->td_pcb->pcb_flags = 0; /* XXXKSE */ - thread0->td_pcb->pcb_cr3 = (int)IdlePTD; - thread0->td_pcb->pcb_ext = 0; - thread0->td_frame = &proc0_tf; + thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ + thread0.td_pcb->pcb_cr3 = (int)IdlePTD; + thread0.td_pcb->pcb_ext = 0; + thread0.td_frame = &proc0_tf; } void |