version 1.94, 2010/12/20 00:25:35 |
version 1.95.8.1, 2012/03/04 00:46:09 |
Line 238 _C_LABEL(tablesize): .long 0 |
|
Line 238 _C_LABEL(tablesize): .long 0 |
|
|
|
.space 512 |
.space 512 |
tmpstk: |
tmpstk: |
|
#ifdef XEN |
|
.align PAGE_SIZE, 0x0 # Align on page boundary |
|
_C_LABEL(tmpgdt): |
|
.space PAGE_SIZE # Xen expects a page |
|
#endif /* XEN */ |
|
.globl tmpgdt |
#ifndef XEN |
#ifndef XEN |
#define _RELOC(x) ((x) - KERNBASE) |
#define _RELOC(x) ((x) - KERNBASE) |
#else |
#else |
|
|
cpuid |
cpuid |
movl %eax,RELOC(cpuid_level) |
movl %eax,RELOC(cpuid_level) |
|
|
|
/* |
|
* Use a temp page. We'll re- add it to uvm(9) once we're |
|
* done using it. |
|
*/ |
|
movl $RELOC(tmpgdt), %eax |
|
pushl %eax # start of temporary gdt |
|
call _C_LABEL(initgdt) |
|
addl $4,%esp |
|
|
call xen_pmap_bootstrap |
call xen_pmap_bootstrap |
|
|
/* |
/* |
Line 999 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 1018 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 |
orl %eax,%eax |
orl %eax,%eax |
jnz,pn .Lcopy_iobitmap |
jnz .Lcopy_iobitmap |
movl $(IOMAP_INVALOFF << 16),CPUVAR(IOBASE) |
movl $(IOMAP_INVALOFF << 16),CPUVAR(IOBASE) |
.Liobitmap_done: |
.Liobitmap_done: |
|
|
Line 1038 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 1055 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 |