diff options
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/mmu_oea.c | 8 | ||||
-rw-r--r-- | sys/powerpc/aim/swtch.S | 10 | ||||
-rw-r--r-- | sys/powerpc/include/globaldata.h | 19 | ||||
-rw-r--r-- | sys/powerpc/include/globals.h | 10 | ||||
-rw-r--r-- | sys/powerpc/include/pcpu.h | 19 | ||||
-rw-r--r-- | sys/powerpc/include/proc.h | 3 | ||||
-rw-r--r-- | sys/powerpc/powerpc/genassym.c | 6 | ||||
-rw-r--r-- | sys/powerpc/powerpc/mmu_oea.c | 8 | ||||
-rw-r--r-- | sys/powerpc/powerpc/pmap.c | 8 | ||||
-rw-r--r-- | sys/powerpc/powerpc/swtch.S | 10 | ||||
-rw-r--r-- | sys/powerpc/powerpc/swtch.s | 10 |
11 files changed, 60 insertions, 51 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index e5b6198..ad79c602 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -1441,15 +1441,15 @@ next: * is the current process, load the new MMU context. */ void -pmap_activate(struct proc *p) +pmap_activate(struct thread *td) { struct pcb *pcb; pmap_t pmap; pmap_t rpm; int psl, i, ksr, seg; - pcb = &p->p_addr->u_pcb; - pmap = p->p_vmspace->vm_map.pmap; + pcb = td->td_pcb; + pmap = td->td_pric->p_vmspace->vm_map.pmap; /* * XXX Normally performed in cpu_fork(). @@ -1460,7 +1460,7 @@ pmap_activate(struct proc *p) (vm_offset_t)pcb->pcb_pm); } - if (p == curproc) { + if (td == curthread) { /* Disable interrupts while switching. */ psl = mfmsr(); mtmsr(psl & ~PSL_EE); diff --git a/sys/powerpc/aim/swtch.S b/sys/powerpc/aim/swtch.S index 35a5ed5..af18976 100644 --- a/sys/powerpc/aim/swtch.S +++ b/sys/powerpc/aim/swtch.S @@ -143,7 +143,7 @@ ENTRY(cpu_switch) mr 30,3 mfsprg 3,0 xor 31,31,31 - stw 31,GD_CURPROC(3) /* Zero to not accumulate cpu time */ + stw 31,GD_CURTHREAD(3) /* Zero to not accumulate cpu time */ mfsprg 3,0 lwz 31,GD_CURPCB(3) @@ -159,7 +159,7 @@ ENTRY(cpu_switch) 1: /* record new process */ mfsprg 4,0 - stw 3,GD_CURPROC(4) + stw 3,GD_CURTHREAD(4) cmpl 0,31,30 /* is it the same process? */ beq switch_return @@ -172,7 +172,7 @@ ENTRY(cpu_switch) mr 12,2 /* save r2 */ stwu 1,-SFRAMELEN(1) /* still running on old stack */ stmw 10,8(1) - lwz 3,P_ADDR(30) + lwz 3,TD_ADDR(30) stw 1,PCB_SP(3) /* save SP */ switch_exited: @@ -182,7 +182,7 @@ switch_exited: mtmsr 3 /* indicate new pcb */ - lwz 4,P_ADDR(31) + lwz 4,TD_ADDR(31) mfsprg 5,0 stw 4,GD_CURPCB(5) @@ -227,7 +227,7 @@ switch_return: bl lcsplx #endif - mr 3,30 /* get curproc for special fork + mr 3,30 /* get curthread for special fork returns */ lwz 31,12(1) diff --git a/sys/powerpc/include/globaldata.h b/sys/powerpc/include/globaldata.h index b51592a..c95a725 100644 --- a/sys/powerpc/include/globaldata.h +++ b/sys/powerpc/include/globaldata.h @@ -44,15 +44,16 @@ * point at the globaldata structure. */ struct globaldata { - struct proc *gd_curproc; /* current process */ - struct proc *gd_idleproc; /* idle process */ - struct proc *gd_fpcurproc; /* fp state owner */ - struct pcb *gd_curpcb; /* current pcb */ - struct timeval gd_switchtime; - int gd_switchticks; - u_int gd_cpuid; /* this cpu number */ - u_int gd_other_cpus; /* all other cpus */ - int gd_inside_intr; + struct thread *gd_curthread; /* current thread */ + struct proc *gd_idleproc; /* idle process */ + struct thread *gd_fpcurthread; /* fp state owner */ + struct proc *gd_fpcurproc; /* fp state owner */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ + int gd_inside_intr; u_int32_t gd_next_asn; /* next ASN to allocate */ u_int32_t gd_current_asngen; /* ASN rollover check */ u_int32_t gd_intr_nesting_level; /* interrupt recursion */ diff --git a/sys/powerpc/include/globals.h b/sys/powerpc/include/globals.h index 26c21e8..6aa1a7a 100644 --- a/sys/powerpc/include/globals.h +++ b/sys/powerpc/include/globals.h @@ -45,12 +45,16 @@ * other hand, kernel modules should always use these macros to maintain * portability between UP and SMP kernels. */ -#define CURPROC PCPU_GET(curproc) -#define CURTHD PCPU_GET(curproc) /* temporary */ -#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) + #define idleproc PCPU_GET(idleproc) #define curpcb PCPU_GET(curpcb) #define fpcurproc PCPU_GET(fpcurproc) +#define fpcurthread PCPU_GET(fpcurthread) #define switchtime PCPU_GET(switchtime) #define switchticks PCPU_GET(switchticks) #define witness_spin_check PCPU_GET(witness_spin_check) diff --git a/sys/powerpc/include/pcpu.h b/sys/powerpc/include/pcpu.h index b51592a..c95a725 100644 --- a/sys/powerpc/include/pcpu.h +++ b/sys/powerpc/include/pcpu.h @@ -44,15 +44,16 @@ * point at the globaldata structure. */ struct globaldata { - struct proc *gd_curproc; /* current process */ - struct proc *gd_idleproc; /* idle process */ - struct proc *gd_fpcurproc; /* fp state owner */ - struct pcb *gd_curpcb; /* current pcb */ - struct timeval gd_switchtime; - int gd_switchticks; - u_int gd_cpuid; /* this cpu number */ - u_int gd_other_cpus; /* all other cpus */ - int gd_inside_intr; + struct thread *gd_curthread; /* current thread */ + struct proc *gd_idleproc; /* idle process */ + struct thread *gd_fpcurthread; /* fp state owner */ + struct proc *gd_fpcurproc; /* fp state owner */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ + int gd_inside_intr; u_int32_t gd_next_asn; /* next ASN to allocate */ u_int32_t gd_current_asngen; /* ASN rollover check */ u_int32_t gd_intr_nesting_level; /* interrupt recursion */ diff --git a/sys/powerpc/include/proc.h b/sys/powerpc/include/proc.h index 21b9b32..33eb778 100644 --- a/sys/powerpc/include/proc.h +++ b/sys/powerpc/include/proc.h @@ -37,5 +37,8 @@ /* * Machine-dependent part of the proc structure */ +struct mdthread { +}; + struct mdproc { }; diff --git a/sys/powerpc/powerpc/genassym.c b/sys/powerpc/powerpc/genassym.c index c140bcb..07c972b 100644 --- a/sys/powerpc/powerpc/genassym.c +++ b/sys/powerpc/powerpc/genassym.c @@ -64,7 +64,7 @@ #include <machine/pcb.h> #include <machine/pmap.h> -ASSYM(GD_CURPROC, offsetof(struct globaldata, gd_curproc)); +ASSYM(GD_CURTHREAD, offsetof(struct globaldata, gd_curthread)); ASSYM(GD_CURPCB, offsetof(struct globaldata, gd_curpcb)); ASSYM(GD_SWITCHTIME, offsetof(struct globaldata, gd_switchtime)); @@ -95,6 +95,6 @@ ASSYM(SFRAMELEN, roundup(sizeof(struct switchframe), 16)); ASSYM(PCB_PMR, offsetof(struct pcb, pcb_pmreal)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); ASSYM(PCB_SPL, offsetof(struct pcb, pcb_spl)); -ASSYM(PCB_FAULT, offsetof(struct pcb, pcb_onfault)); -ASSYM(P_ADDR, offsetof(struct proc, p_addr)); +ASSYM(TD_PROC, offsetof(struct thread, td_proc)); +ASSYM(TD_ADDR, offsetof(struct thread, td_addr)); diff --git a/sys/powerpc/powerpc/mmu_oea.c b/sys/powerpc/powerpc/mmu_oea.c index e5b6198..ad79c602 100644 --- a/sys/powerpc/powerpc/mmu_oea.c +++ b/sys/powerpc/powerpc/mmu_oea.c @@ -1441,15 +1441,15 @@ next: * is the current process, load the new MMU context. */ void -pmap_activate(struct proc *p) +pmap_activate(struct thread *td) { struct pcb *pcb; pmap_t pmap; pmap_t rpm; int psl, i, ksr, seg; - pcb = &p->p_addr->u_pcb; - pmap = p->p_vmspace->vm_map.pmap; + pcb = td->td_pcb; + pmap = td->td_pric->p_vmspace->vm_map.pmap; /* * XXX Normally performed in cpu_fork(). @@ -1460,7 +1460,7 @@ pmap_activate(struct proc *p) (vm_offset_t)pcb->pcb_pm); } - if (p == curproc) { + if (td == curthread) { /* Disable interrupts while switching. */ psl = mfmsr(); mtmsr(psl & ~PSL_EE); diff --git a/sys/powerpc/powerpc/pmap.c b/sys/powerpc/powerpc/pmap.c index e5b6198..ad79c602 100644 --- a/sys/powerpc/powerpc/pmap.c +++ b/sys/powerpc/powerpc/pmap.c @@ -1441,15 +1441,15 @@ next: * is the current process, load the new MMU context. */ void -pmap_activate(struct proc *p) +pmap_activate(struct thread *td) { struct pcb *pcb; pmap_t pmap; pmap_t rpm; int psl, i, ksr, seg; - pcb = &p->p_addr->u_pcb; - pmap = p->p_vmspace->vm_map.pmap; + pcb = td->td_pcb; + pmap = td->td_pric->p_vmspace->vm_map.pmap; /* * XXX Normally performed in cpu_fork(). @@ -1460,7 +1460,7 @@ pmap_activate(struct proc *p) (vm_offset_t)pcb->pcb_pm); } - if (p == curproc) { + if (td == curthread) { /* Disable interrupts while switching. */ psl = mfmsr(); mtmsr(psl & ~PSL_EE); diff --git a/sys/powerpc/powerpc/swtch.S b/sys/powerpc/powerpc/swtch.S index 35a5ed5..af18976 100644 --- a/sys/powerpc/powerpc/swtch.S +++ b/sys/powerpc/powerpc/swtch.S @@ -143,7 +143,7 @@ ENTRY(cpu_switch) mr 30,3 mfsprg 3,0 xor 31,31,31 - stw 31,GD_CURPROC(3) /* Zero to not accumulate cpu time */ + stw 31,GD_CURTHREAD(3) /* Zero to not accumulate cpu time */ mfsprg 3,0 lwz 31,GD_CURPCB(3) @@ -159,7 +159,7 @@ ENTRY(cpu_switch) 1: /* record new process */ mfsprg 4,0 - stw 3,GD_CURPROC(4) + stw 3,GD_CURTHREAD(4) cmpl 0,31,30 /* is it the same process? */ beq switch_return @@ -172,7 +172,7 @@ ENTRY(cpu_switch) mr 12,2 /* save r2 */ stwu 1,-SFRAMELEN(1) /* still running on old stack */ stmw 10,8(1) - lwz 3,P_ADDR(30) + lwz 3,TD_ADDR(30) stw 1,PCB_SP(3) /* save SP */ switch_exited: @@ -182,7 +182,7 @@ switch_exited: mtmsr 3 /* indicate new pcb */ - lwz 4,P_ADDR(31) + lwz 4,TD_ADDR(31) mfsprg 5,0 stw 4,GD_CURPCB(5) @@ -227,7 +227,7 @@ switch_return: bl lcsplx #endif - mr 3,30 /* get curproc for special fork + mr 3,30 /* get curthread for special fork returns */ lwz 31,12(1) diff --git a/sys/powerpc/powerpc/swtch.s b/sys/powerpc/powerpc/swtch.s index 35a5ed5..af18976 100644 --- a/sys/powerpc/powerpc/swtch.s +++ b/sys/powerpc/powerpc/swtch.s @@ -143,7 +143,7 @@ ENTRY(cpu_switch) mr 30,3 mfsprg 3,0 xor 31,31,31 - stw 31,GD_CURPROC(3) /* Zero to not accumulate cpu time */ + stw 31,GD_CURTHREAD(3) /* Zero to not accumulate cpu time */ mfsprg 3,0 lwz 31,GD_CURPCB(3) @@ -159,7 +159,7 @@ ENTRY(cpu_switch) 1: /* record new process */ mfsprg 4,0 - stw 3,GD_CURPROC(4) + stw 3,GD_CURTHREAD(4) cmpl 0,31,30 /* is it the same process? */ beq switch_return @@ -172,7 +172,7 @@ ENTRY(cpu_switch) mr 12,2 /* save r2 */ stwu 1,-SFRAMELEN(1) /* still running on old stack */ stmw 10,8(1) - lwz 3,P_ADDR(30) + lwz 3,TD_ADDR(30) stw 1,PCB_SP(3) /* save SP */ switch_exited: @@ -182,7 +182,7 @@ switch_exited: mtmsr 3 /* indicate new pcb */ - lwz 4,P_ADDR(31) + lwz 4,TD_ADDR(31) mfsprg 5,0 stw 4,GD_CURPCB(5) @@ -227,7 +227,7 @@ switch_return: bl lcsplx #endif - mr 3,30 /* get curproc for special fork + mr 3,30 /* get curthread for special fork returns */ lwz 31,12(1) |