summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/apic_vector.s9
-rw-r--r--sys/i386/isa/ipl.s18
2 files changed, 10 insertions, 17 deletions
diff --git a/sys/i386/isa/apic_vector.s b/sys/i386/isa/apic_vector.s
index fbaceff..68b6c77 100644
--- a/sys/i386/isa/apic_vector.s
+++ b/sys/i386/isa/apic_vector.s
@@ -304,10 +304,9 @@ _Xcpuast:
FAKE_MCOUNT(13*4(%esp))
- orl $AST_PENDING, PCPU(ASTPENDING) /* XXX */
+ MTX_LOCK_SPIN(sched_lock, 0)
movl PCPU(CURPROC),%ebx
- incl P_INTR_NESTING_LEVEL(%ebx)
- sti
+ orl $PS_ASTPENDING, P_SFLAG(%ebx)
movl PCPU(CPUID), %eax
lock
@@ -315,13 +314,13 @@ _Xcpuast:
lock
btrl %eax, CNAME(resched_cpus)
jnc 2f
- orl $AST_PENDING+AST_RESCHED, PCPU(ASTPENDING)
+ orl $PS_NEEDRESCHED, P_SFLAG(%ebx)
lock
incl CNAME(want_resched_cnt)
2:
+ MTX_UNLOCK_SPIN(sched_lock)
lock
incl CNAME(cpuast_cnt)
- decl P_INTR_NESTING_LEVEL(%ebx)
MEXITCOUNT
jmp _doreti
1:
diff --git a/sys/i386/isa/ipl.s b/sys/i386/isa/ipl.s
index 7c41589..25af1f7 100644
--- a/sys/i386/isa/ipl.s
+++ b/sys/i386/isa/ipl.s
@@ -55,17 +55,20 @@
SUPERALIGN_TEXT
.type _doreti,@function
_doreti:
+
FAKE_MCOUNT(_bintr) /* init "from" _bintr -> _doreti */
doreti_next:
/* Check for ASTs that can be handled now. */
- testl $AST_PENDING,PCPU(ASTPENDING)
- je doreti_exit /* no AST, exit */
testb $SEL_RPL_MASK,TF_CS(%esp) /* are we in user mode? */
jne doreti_ast /* yes, do it now. */
testl $PSL_VM,TF_EFLAGS(%esp) /* kernel mode */
je doreti_exit /* and not VM86 mode, defer */
cmpl $1,_in_vm86call /* are we in a VM86 call? */
- jne doreti_ast /* yes, we can do it */
+ je doreti_exit /* no, defer */
+
+doreti_ast:
+ movl $T_ASTFLT,TF_TRAPNO(%esp)
+ call _ast
/*
* doreti_exit: release MP lock, pop registers, iret.
@@ -80,7 +83,6 @@ doreti_exit:
.globl doreti_popl_fs
.globl doreti_syscall_ret
-doreti_syscall_ret:
doreti_popl_fs:
popl %fs
.globl doreti_popl_es
@@ -120,14 +122,6 @@ doreti_popl_fs_fault:
movl $T_PROTFLT,TF_TRAPNO(%esp)
jmp alltraps_with_regs_pushed
- ALIGN_TEXT
-doreti_ast:
- andl $~AST_PENDING,PCPU(ASTPENDING)
- sti
- movl $T_ASTFLT,TF_TRAPNO(%esp)
- call _ast
- jmp doreti_next
-
#ifdef APIC_IO
#include "i386/isa/apic_ipl.s"
#else
OpenPOWER on IntegriCloud