| version 1.20, 2003/11/04 10:33:15 |
version 1.21, 2004/01/04 11:44:52 |
| Line 2028 ENTRY(cpu_switchto) |
|
| Line 2028 ENTRY(cpu_switchto) |
|
| jmp switch_resume |
jmp switch_resume |
| |
|
| /* |
/* |
| * void switch_exit(struct lwp *l, void (*exit)(struct lwp *)); |
* void cpu_exit(struct lwp *l) |
| * Switch to the appropriate idle context (lwp0's if uniprocessor; the cpu's |
* Switch to the appropriate idle context (lwp0's if uniprocessor; the cpu's |
| * if multiprocessor) and deallocate the address space and kernel stack for p. |
* if multiprocessor) and deallocate the address space and kernel stack for p. |
| * Then jump into cpu_switch(), as if we were in the idle proc all along. |
* Then jump into cpu_switch(), as if we were in the idle proc all along. |
| Line 2038 ENTRY(cpu_switchto) |
|
| Line 2038 ENTRY(cpu_switchto) |
|
| #endif |
#endif |
| .globl _C_LABEL(uvmspace_free),_C_LABEL(kernel_map) |
.globl _C_LABEL(uvmspace_free),_C_LABEL(kernel_map) |
| .globl _C_LABEL(uvm_km_free),_C_LABEL(tss_free) |
.globl _C_LABEL(uvm_km_free),_C_LABEL(tss_free) |
| /* LINTSTUB: Func: void switch_exit(struct lwp *l, void (*exit)(struct lwp *)) */ |
/* LINTSTUB: Func: void cpu_exit(struct lwp *l) */ |
| ENTRY(switch_exit) |
ENTRY(cpu_exit) |
| movl 4(%esp),%edi # old process |
movl 4(%esp),%edi # old process |
| movl 8(%esp),%eax # exit func |
|
| #ifndef MULTIPROCESSOR |
#ifndef MULTIPROCESSOR |
| movl $_C_LABEL(lwp0),%ebx |
movl $_C_LABEL(lwp0),%ebx |
| movl L_ADDR(%ebx),%esi |
movl L_ADDR(%ebx),%esi |
| Line 2060 ENTRY(switch_exit) |
|
| Line 2059 ENTRY(switch_exit) |
|
| movl PCB_ESP(%esi),%esp |
movl PCB_ESP(%esi),%esp |
| movl PCB_EBP(%esi),%ebp |
movl PCB_EBP(%esi),%ebp |
| |
|
| /* Save exit func. */ |
|
| pushl %eax |
|
| |
|
| /* Load TSS info. */ |
/* Load TSS info. */ |
| #ifdef MULTIPROCESSOR |
#ifdef MULTIPROCESSOR |
| movl CPUVAR(GDT),%eax |
movl CPUVAR(GDT),%eax |
| Line 2092 ENTRY(switch_exit) |
|
| Line 2088 ENTRY(switch_exit) |
|
| sti |
sti |
| |
|
| /* |
/* |
| * Schedule the dead process's vmspace and stack to be freed. |
* Schedule the dead LWP's stack to be freed. |
| */ |
*/ |
| movl 0(%esp),%eax /* %eax = exit func */ |
pushl %edi |
| movl %edi,0(%esp) /* {lwp_}exit2(l) */ |
call _C_LABEL(lwp_exit2) |
| call *%eax |
|
| addl $4,%esp |
addl $4,%esp |
| |
|
| /* Jump into cpu_switch() with the right state. */ |
/* Jump into cpu_switch() with the right state. */ |