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/powerpc | |
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/powerpc')
-rw-r--r-- | sys/powerpc/aim/machdep.c | 17 | ||||
-rw-r--r-- | sys/powerpc/aim/vm_machdep.c | 4 | ||||
-rw-r--r-- | sys/powerpc/powerpc/machdep.c | 17 | ||||
-rw-r--r-- | sys/powerpc/powerpc/vm_machdep.c | 4 |
4 files changed, 18 insertions, 24 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c index c93d5e3..04e30ef 100644 --- a/sys/powerpc/aim/machdep.c +++ b/sys/powerpc/aim/machdep.c @@ -415,15 +415,14 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args) pmap_setavailmem(startkernel, endkernel); - proc_linkup(&proc0); + proc_linkup(&proc0, &proc0.p_ksegrp, &proc0.p_kse, &thread0); proc0uarea = (struct user *)pmap_steal_memory(UAREA_PAGES * PAGE_SIZE); proc0kstack = pmap_steal_memory(KSTACK_PAGES * PAGE_SIZE); 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; pcpup = pmap_steal_memory(round_page(sizeof(struct pcpu))); @@ -440,9 +439,9 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args) /* setup curproc so the mutexes work */ - PCPU_SET(curthread, thread0); + PCPU_SET(curthread, &thread0); - LIST_INIT(&thread0->td_contested); + LIST_INIT(&thread0.td_contested); /* XXX: NetBSDism I _think_. Not sure yet. */ #if 0 @@ -596,8 +595,8 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args) PCPU_GET(next_asn) = 1; /* 0 used for proc0 pmap */ /* setup proc 0's pcb */ - thread0->td_pcb->pcb_flags = 0; /* XXXKSE */ - thread0->td_frame = &proc0_tf; + thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ + thread0.td_frame = &proc0_tf; } static int N_mapping; diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index e6cb805..7670b59 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -120,10 +120,9 @@ vm_fault_quick(v, prot) * ready to run and return to user mode. */ void -cpu_fork(struct thread *td1, struct proc *p2, int flags) +cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) { struct proc *p1; - struct thread *td2; struct trapframe *tf; struct callframe *cf; struct switchframe *sf; @@ -136,7 +135,6 @@ cpu_fork(struct thread *td1, struct proc *p2, int flags) return; p1 = td1->td_proc; - td2 = &p2->p_thread; /* Point the pcb to the top of the stack */ pcb2 = (struct pcb *)(td2->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index c93d5e3..04e30ef 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -415,15 +415,14 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args) pmap_setavailmem(startkernel, endkernel); - proc_linkup(&proc0); + proc_linkup(&proc0, &proc0.p_ksegrp, &proc0.p_kse, &thread0); proc0uarea = (struct user *)pmap_steal_memory(UAREA_PAGES * PAGE_SIZE); proc0kstack = pmap_steal_memory(KSTACK_PAGES * PAGE_SIZE); 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; pcpup = pmap_steal_memory(round_page(sizeof(struct pcpu))); @@ -440,9 +439,9 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args) /* setup curproc so the mutexes work */ - PCPU_SET(curthread, thread0); + PCPU_SET(curthread, &thread0); - LIST_INIT(&thread0->td_contested); + LIST_INIT(&thread0.td_contested); /* XXX: NetBSDism I _think_. Not sure yet. */ #if 0 @@ -596,8 +595,8 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, char *args) PCPU_GET(next_asn) = 1; /* 0 used for proc0 pmap */ /* setup proc 0's pcb */ - thread0->td_pcb->pcb_flags = 0; /* XXXKSE */ - thread0->td_frame = &proc0_tf; + thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ + thread0.td_frame = &proc0_tf; } static int N_mapping; diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index e6cb805..7670b59 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -120,10 +120,9 @@ vm_fault_quick(v, prot) * ready to run and return to user mode. */ void -cpu_fork(struct thread *td1, struct proc *p2, int flags) +cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) { struct proc *p1; - struct thread *td2; struct trapframe *tf; struct callframe *cf; struct switchframe *sf; @@ -136,7 +135,6 @@ cpu_fork(struct thread *td1, struct proc *p2, int flags) return; p1 = td1->td_proc; - td2 = &p2->p_thread; /* Point the pcb to the top of the stack */ pcb2 = (struct pcb *)(td2->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; |