version 1.34.2.3, 2007/02/26 09:06:56 |
version 1.43.4.5, 2007/01/11 22:22:56 |
|
|
pushl %eax |
pushl %eax |
lret |
lret |
|
|
NENTRY(x86_flush) |
|
/* Reload code selector by doing intersegment return. */ |
|
popl %eax |
|
pushl $GSEL(GCODE_SEL, SEL_KPL) |
|
pushl %eax |
|
lret |
|
|
|
/*****************************************************************************/ |
/*****************************************************************************/ |
|
|
/* |
/* |
Line 886 ENTRY(cpu_switch) |
|
Line 879 ENTRY(cpu_switch) |
|
xorl %esi,%esi |
xorl %esi,%esi |
sti |
sti |
idle_unlock: |
idle_unlock: |
|
#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) || defined(DIAGNOSTIC) |
call _C_LABEL(sched_unlock_idle) |
call _C_LABEL(sched_unlock_idle) |
|
#endif |
/* Interrupts are okay again. */ |
/* Interrupts are okay again. */ |
pushl $IPL_NONE # spl0() |
pushl $IPL_NONE # spl0() |
call _C_LABEL(spllower) # process pending interrupts |
call _C_LABEL(Xspllower) # process pending interrupts |
addl $4,%esp |
addl $4,%esp |
jmp idle_start |
jmp idle_start |
idle_zero: |
idle_zero: |
|
|
idle_exit: |
idle_exit: |
movl $IPL_HIGH,CPUVAR(ILEVEL) # splhigh |
movl $IPL_HIGH,CPUVAR(ILEVEL) # splhigh |
sti |
sti |
|
#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) || defined(DIAGNOSTIC) |
call _C_LABEL(sched_lock_idle) |
call _C_LABEL(sched_lock_idle) |
|
#endif |
movl _C_LABEL(sched_whichqs),%ecx |
movl _C_LABEL(sched_whichqs),%ecx |
bsfl %ecx,%ebx |
bsfl %ecx,%ebx |
jz idle_unlock |
jz idle_unlock |
|
|
|
|
#if 0 |
#if 0 |
/* Don't bother with the rest if switching to a system process. */ |
/* Don't bother with the rest if switching to a system process. */ |
testl $PK_SYSTEM,L_FLAG(%edi); XXX NJWLWP lwp's don't have PK_SYSTEM! |
testl $P_SYSTEM,L_FLAG(%edi); XXX NJWLWP lwp's don't have P_SYSTEM! |
jnz switch_restored |
jnz switch_restored |
#endif |
#endif |
|
|
Line 1065 switch_restored: |
|
Line 1062 switch_restored: |
|
movl $1,%ebx |
movl $1,%ebx |
|
|
switch_return: |
switch_return: |
|
#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) || defined(DIAGNOSTIC) |
call _C_LABEL(sched_unlock_idle) |
call _C_LABEL(sched_unlock_idle) |
|
#endif |
cmpl $0,CPUVAR(IPENDING) |
cmpl $0,CPUVAR(IPENDING) |
jz 3f |
jz 3f |
pushl $IPL_NONE # spl0() |
pushl $IPL_NONE # spl0() |
call _C_LABEL(spllower) # process pending interrupts |
call _C_LABEL(Xspllower) # process pending interrupts |
addl $4,%esp |
addl $4,%esp |
3: |
3: |
movl $IPL_HIGH,CPUVAR(ILEVEL) # splhigh() |
movl $IPL_HIGH,CPUVAR(ILEVEL) # splhigh() |
Line 1156 ENTRY(cpu_exit) |
|
Line 1155 ENTRY(cpu_exit) |
|
movl CPUVAR(IDLE_PCB),%esi |
movl CPUVAR(IDLE_PCB),%esi |
movl CPUVAR(IDLE_TSS_SEL),%edx |
movl CPUVAR(IDLE_TSS_SEL),%edx |
#endif |
#endif |
|
/* In case we fault... */ |
|
movl $0,CPUVAR(CURLWP) |
|
|
/* Restore the idle context. */ |
/* Restore the idle context. */ |
cli |
cli |
Line 1186 ENTRY(cpu_exit) |
|
Line 1187 ENTRY(cpu_exit) |
|
/* Record new pcb. */ |
/* Record new pcb. */ |
SET_CURPCB(%esi) |
SET_CURPCB(%esi) |
|
|
/* Now off the CPU. */ |
|
movl $0,CPUVAR(CURLWP) |
|
|
|
/* Interrupts are okay again. */ |
/* Interrupts are okay again. */ |
sti |
sti |
|
|
|
/* |
|
* Schedule the dead LWP's stack to be freed. |
|
*/ |
|
pushl %edi |
|
call _C_LABEL(lwp_exit2) |
|
addl $4,%esp |
|
|
/* Jump into cpu_switch() with the right state. */ |
/* Jump into cpu_switch() with the right state. */ |
xorl %esi,%esi |
xorl %esi,%esi |
|
movl %esi,CPUVAR(CURLWP) |
jmp idle_start |
jmp idle_start |
|
|
/* |
/* |
Line 1202 ENTRY(cpu_exit) |
|
Line 1208 ENTRY(cpu_exit) |
|
*/ |
*/ |
/* LINTSTUB: Func: void savectx(struct pcb *pcb) */ |
/* LINTSTUB: Func: void savectx(struct pcb *pcb) */ |
ENTRY(savectx) |
ENTRY(savectx) |
movl 4(%esp),%edx # edx = pcb |
movl 4(%esp),%edx # edx = p->p_addr |
|
|
/* Save stack pointers. */ |
/* Save stack pointers. */ |
movl %esp,PCB_ESP(%edx) |
movl %esp,PCB_ESP(%edx) |