diff options
author | julian <julian@FreeBSD.org> | 2003-02-01 12:17:09 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2003-02-01 12:17:09 +0000 |
commit | e8efa7328e487806fb77d3ec54bf5fa5f8b017ed (patch) | |
tree | 5ab8f2c0a0aaeb3da3779201a31e710dee48d388 /sys/amd64 | |
parent | 1c5753d03f1205c6e2831f320c4007946a4b050f (diff) | |
download | FreeBSD-src-e8efa7328e487806fb77d3ec54bf5fa5f8b017ed.zip FreeBSD-src-e8efa7328e487806fb77d3ec54bf5fa5f8b017ed.tar.gz |
Reversion of commit by Davidxu plus fixes since applied.
I'm not convinced there is anything major wrong with the patch but
them's the rules..
I am using my "David's mentor" hat to revert this as he's
offline for a while.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/critical.c | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/exception.S | 3 | ||||
-rw-r--r-- | sys/amd64/amd64/exception.s | 3 | ||||
-rw-r--r-- | sys/amd64/amd64/genassym.c | 1 | ||||
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 3 | ||||
-rw-r--r-- | sys/amd64/amd64/mptable.c | 3 | ||||
-rw-r--r-- | sys/amd64/amd64/trap.c | 4 | ||||
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 10 | ||||
-rw-r--r-- | sys/amd64/include/mptable.h | 3 |
9 files changed, 15 insertions, 17 deletions
diff --git a/sys/amd64/amd64/critical.c b/sys/amd64/amd64/critical.c index a19a35b..de91426 100644 --- a/sys/amd64/amd64/critical.c +++ b/sys/amd64/amd64/critical.c @@ -137,7 +137,7 @@ i386_unpend(void) break; case 1: /* bit 1 - statclock */ mtx_lock_spin(&sched_lock); - statclock_process(curthread, + statclock_process(curthread->td_kse, (register_t)i386_unpend, 0); mtx_unlock_spin(&sched_lock); break; diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index d618cb8..f16f1b1 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -280,12 +280,9 @@ doreti_ast: */ cli movl PCPU(CURTHREAD),%eax - testl $TDF_ASTPENDING, TD_FLAGS(%eax) - jnz call_ast movl TD_KSE(%eax), %eax testl $KEF_ASTPENDING | KEF_NEEDRESCHED,KE_FLAGS(%eax) je doreti_exit -call_ast: sti pushl %esp /* pass a pointer to the trapframe */ call ast diff --git a/sys/amd64/amd64/exception.s b/sys/amd64/amd64/exception.s index d618cb8..f16f1b1 100644 --- a/sys/amd64/amd64/exception.s +++ b/sys/amd64/amd64/exception.s @@ -280,12 +280,9 @@ doreti_ast: */ cli movl PCPU(CURTHREAD),%eax - testl $TDF_ASTPENDING, TD_FLAGS(%eax) - jnz call_ast movl TD_KSE(%eax), %eax testl $KEF_ASTPENDING | KEF_NEEDRESCHED,KE_FLAGS(%eax) je doreti_exit -call_ast: sti pushl %esp /* pass a pointer to the trapframe */ call ast diff --git a/sys/amd64/amd64/genassym.c b/sys/amd64/amd64/genassym.c index 65f94fd..92915b6 100644 --- a/sys/amd64/amd64/genassym.c +++ b/sys/amd64/amd64/genassym.c @@ -92,7 +92,6 @@ ASSYM(TD_INTR_NESTING_LEVEL, offsetof(struct thread, td_intr_nesting_level)); ASSYM(TD_CRITNEST, offsetof(struct thread, td_critnest)); ASSYM(TD_SWITCHIN, offsetof(struct thread, td_switchin)); ASSYM(TD_MD, offsetof(struct thread, td_md)); -ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(P_MD, offsetof(struct proc, p_md)); ASSYM(MD_LDT, offsetof(struct mdproc, md_ldt)); diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 323a0fb..39d10d6 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -2611,7 +2611,8 @@ forwarded_statclock(struct trapframe frame) { mtx_lock_spin(&sched_lock); - statclock_process(curthread, TRAPF_PC(&frame), TRAPF_USERMODE(&frame)); + statclock_process(curthread->td_kse, TRAPF_PC(&frame), + TRAPF_USERMODE(&frame)); mtx_unlock_spin(&sched_lock); } diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index 323a0fb..39d10d6 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/mptable.c @@ -2611,7 +2611,8 @@ forwarded_statclock(struct trapframe frame) { mtx_lock_spin(&sched_lock); - statclock_process(curthread, TRAPF_PC(&frame), TRAPF_USERMODE(&frame)); + statclock_process(curthread->td_kse, TRAPF_PC(&frame), + TRAPF_USERMODE(&frame)); mtx_unlock_spin(&sched_lock); } diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 2c21983..54c4af8 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -264,7 +264,7 @@ trap(frame) !(PCPU_GET(curpcb)->pcb_flags & PCB_VM86CALL))) { /* user trap */ - sticks = td->td_sticks; + sticks = td->td_kse->ke_sticks; td->td_frame = &frame; if (td->td_ucred != p->p_ucred) cred_update_thread(td); @@ -957,7 +957,7 @@ syscall(frame) KASSERT((td->td_kse != NULL), ("syscall: kse/thread UNLINKED")); KASSERT((td->td_kse->ke_thread == td), ("syscall:kse/thread mismatch")); - sticks = td->td_sticks; + sticks = td->td_kse->ke_sticks; td->td_frame = &frame; if (td->td_ucred != p->p_ucred) cred_update_thread(td); diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 903a2b0..823cad9 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -312,6 +312,8 @@ cpu_set_upcall(struct thread *td, void *pcb) { struct pcb *pcb2; + td->td_flags |= TDF_UPCALLING; + /* Point the pcb to the top of the stack. */ pcb2 = td->td_pcb; @@ -368,7 +370,7 @@ cpu_set_upcall(struct thread *td, void *pcb) * in thread_userret() itself can be done as well. */ void -cpu_set_upcall_kse(struct thread *td, struct kse_upcall *ku) +cpu_set_upcall_kse(struct thread *td, struct kse *ke) { /* @@ -385,15 +387,15 @@ cpu_set_upcall_kse(struct thread *td, struct kse_upcall *ku) * function. */ td->td_frame->tf_esp = - (int)ku->ku_stack.ss_sp + ku->ku_stack.ss_size - 16; - td->td_frame->tf_eip = (int)ku->ku_func; + (int)ke->ke_stack.ss_sp + ke->ke_stack.ss_size - 16; + td->td_frame->tf_eip = (int)ke->ke_upcall; /* * Pass the address of the mailbox for this kse to the uts * function as a parameter on the stack. */ suword((void *)(td->td_frame->tf_esp + sizeof(void *)), - (int)ku->ku_mailbox); + (int)ke->ke_mailbox); } void diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index 323a0fb..39d10d6 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -2611,7 +2611,8 @@ forwarded_statclock(struct trapframe frame) { mtx_lock_spin(&sched_lock); - statclock_process(curthread, TRAPF_PC(&frame), TRAPF_USERMODE(&frame)); + statclock_process(curthread->td_kse, TRAPF_PC(&frame), + TRAPF_USERMODE(&frame)); mtx_unlock_spin(&sched_lock); } |