summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2003-02-01 12:17:09 +0000
committerjulian <julian@FreeBSD.org>2003-02-01 12:17:09 +0000
commite8efa7328e487806fb77d3ec54bf5fa5f8b017ed (patch)
tree5ab8f2c0a0aaeb3da3779201a31e710dee48d388 /sys/i386
parent1c5753d03f1205c6e2831f320c4007946a4b050f (diff)
downloadFreeBSD-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/i386')
-rw-r--r--sys/i386/i386/critical.c2
-rw-r--r--sys/i386/i386/exception.s3
-rw-r--r--sys/i386/i386/genassym.c1
-rw-r--r--sys/i386/i386/mp_machdep.c3
-rw-r--r--sys/i386/i386/mptable.c3
-rw-r--r--sys/i386/i386/trap.c4
-rw-r--r--sys/i386/i386/vm_machdep.c10
-rw-r--r--sys/i386/include/mptable.h3
8 files changed, 15 insertions, 14 deletions
diff --git a/sys/i386/i386/critical.c b/sys/i386/i386/critical.c
index a19a35b..de91426 100644
--- a/sys/i386/i386/critical.c
+++ b/sys/i386/i386/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/i386/i386/exception.s b/sys/i386/i386/exception.s
index d618cb8..f16f1b1 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/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/i386/i386/genassym.c b/sys/i386/i386/genassym.c
index 65f94fd..92915b6 100644
--- a/sys/i386/i386/genassym.c
+++ b/sys/i386/i386/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/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 323a0fb..39d10d6 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/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/i386/i386/mptable.c b/sys/i386/i386/mptable.c
index 323a0fb..39d10d6 100644
--- a/sys/i386/i386/mptable.c
+++ b/sys/i386/i386/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/i386/i386/trap.c b/sys/i386/i386/trap.c
index 2c21983..54c4af8 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/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/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index 903a2b0..823cad9 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/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/i386/include/mptable.h b/sys/i386/include/mptable.h
index 323a0fb..39d10d6 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/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);
}
OpenPOWER on IntegriCloud