version 1.96, 2012/02/24 08:06:07 |
version 1.97, 2012/03/02 16:43:31 |
Line 1013 ENTRY(cpu_switchto) |
|
Line 1013 ENTRY(cpu_switchto) |
|
pushl %edi |
pushl %edi |
call _C_LABEL(i386_switch_context) |
call _C_LABEL(i386_switch_context) |
addl $4,%esp |
addl $4,%esp |
#else /* XEN */ |
#else /* !XEN */ |
/* Switch ring0 esp */ |
/* Switch ring0 esp */ |
movl PCB_ESP0(%ebx),%eax |
movl PCB_ESP0(%ebx),%eax |
movl %eax,CPUVAR(ESP0) |
movl %eax,CPUVAR(ESP0) |
|
#endif /* !XEN */ |
|
|
/* 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 $LW_SYSTEM,L_FLAG(%edi) |
testl $LW_SYSTEM,L_FLAG(%edi) |
jnz 4f |
jnz 4f |
|
|
|
#ifndef XEN |
/* Restore thread-private %fs/%gs descriptors. */ |
/* Restore thread-private %fs/%gs descriptors. */ |
movl CPUVAR(GDT),%ecx |
movl CPUVAR(GDT),%ecx |
movl PCB_FSD(%ebx), %eax |
movl PCB_FSD(%ebx), %eax |
Line 1032 ENTRY(cpu_switchto) |
|
Line 1034 ENTRY(cpu_switchto) |
|
movl PCB_GSD+4(%ebx), %edx |
movl PCB_GSD+4(%ebx), %edx |
movl %eax, (GUGS_SEL*8)(%ecx) |
movl %eax, (GUGS_SEL*8)(%ecx) |
movl %edx, (GUGS_SEL*8+4)(%ecx) |
movl %edx, (GUGS_SEL*8+4)(%ecx) |
#endif /* XEN */ |
#endif /* !XEN */ |
|
|
/* Switch I/O bitmap */ |
/* Switch I/O bitmap */ |
movl PCB_IOMAP(%ebx),%eax |
movl PCB_IOMAP(%ebx),%eax |
Line 1052 ENTRY(cpu_switchto) |
|
Line 1054 ENTRY(cpu_switchto) |
|
* is deferred until mi_switch(), when cpu_switchto() returns. |
* is deferred until mi_switch(), when cpu_switchto() returns. |
*/ |
*/ |
2: |
2: |
#ifndef XEN |
#ifdef XEN |
|
pushl %edi |
|
call _C_LABEL(i386_tls_switch) |
|
addl $4,%esp |
|
#else /* !XEN */ |
movl $IPL_HIGH,CPUVAR(ILEVEL) |
movl $IPL_HIGH,CPUVAR(ILEVEL) |
movl PCB_CR0(%ebx),%ecx /* has CR0_TS clear */ |
movl PCB_CR0(%ebx),%ecx /* has CR0_TS clear */ |
movl %cr0,%edx |
movl %cr0,%edx |
Line 1069 ENTRY(cpu_switchto) |
|
Line 1075 ENTRY(cpu_switchto) |
|
3: cmpl %edx,%ecx |
3: cmpl %edx,%ecx |
je 4f |
je 4f |
movl %ecx,%cr0 |
movl %ecx,%cr0 |
#endif /* XEN */ |
#endif /* !XEN */ |
|
|
/* Return to the new LWP, returning 'oldlwp' in %eax. */ |
/* Return to the new LWP, returning 'oldlwp' in %eax. */ |
4: movl %esi,%eax |
4: movl %esi,%eax |