version 1.25, 2004/03/26 19:05:33 |
version 1.25.2.3, 2005/03/16 11:49:54 |
Line 524 try586: /* Use the `cpuid' instruction. |
|
Line 524 try586: /* Use the `cpuid' instruction. |
|
|
|
/* |
/* |
* Calculate the size of the kernel page table directory, and |
* Calculate the size of the kernel page table directory, and |
* how many entries it will have. |
* how many entries it will have. Adjust nkpde to the actual |
|
* kernel size automatically. Account for the bootstrap tables, |
|
* round up, and add an extra 4MB. |
*/ |
*/ |
|
leal TABLESIZE+NBPD+PDOFSET(%edi),%eax |
|
shrl $PDSHIFT,%eax |
movl RELOC(nkpde),%ecx # get nkpde |
movl RELOC(nkpde),%ecx # get nkpde |
cmpl $NKPTP_MIN,%ecx # larger than min? |
cmpl %ecx,%eax |
|
jb 1f |
|
movl %eax,%ecx |
|
1: cmpl $NKPTP_MIN,%ecx # larger than min? |
jge 1f |
jge 1f |
movl $NKPTP_MIN,%ecx # set at min |
movl $NKPTP_MIN,%ecx # set at min |
jmp 2f |
jmp 2f |
1: cmpl $NKPTP_MAX,%ecx # larger than max? |
1: cmpl $NKPTP_MAX,%ecx # larger than max? |
jle 2f |
jle 2f |
movl $NKPTP_MAX,%ecx |
movl $NKPTP_MAX,%ecx |
2: |
2: movl %ecx,RELOC(nkpde) |
|
|
/* Clear memory for bootstrap tables. */ |
/* Clear memory for bootstrap tables. */ |
shll $PGSHIFT,%ecx |
shll $PGSHIFT,%ecx |
Line 1173 ENTRY(copyoutstr) |
|
Line 1180 ENTRY(copyoutstr) |
|
*/ |
*/ |
movl $VM_MAXUSER_ADDRESS,%eax |
movl $VM_MAXUSER_ADDRESS,%eax |
subl %edi,%eax |
subl %edi,%eax |
|
jc _C_LABEL(copystr_efault) |
cmpl %edx,%eax |
cmpl %edx,%eax |
jae 1f |
jae 1f |
movl %eax,%edx |
movl %eax,%edx |
Line 1227 ENTRY(copyinstr) |
|
Line 1235 ENTRY(copyinstr) |
|
*/ |
*/ |
movl $VM_MAXUSER_ADDRESS,%eax |
movl $VM_MAXUSER_ADDRESS,%eax |
subl %esi,%eax |
subl %esi,%eax |
|
jc _C_LABEL(copystr_efault) |
cmpl %edx,%eax |
cmpl %edx,%eax |
jae 1f |
jae 1f |
movl %eax,%edx |
movl %eax,%edx |
Line 1775 ENTRY(cpu_switch) |
|
Line 1784 ENTRY(cpu_switch) |
|
movl PCB_EBP(%edi),%ebp |
movl PCB_EBP(%edi),%ebp |
|
|
/* Switch TSS. Reset "task busy" flag before loading. */ |
/* Switch TSS. Reset "task busy" flag before loading. */ |
|
movl %cr3,%eax |
|
movl %eax,PCB_CR3(%edi) |
#ifdef MULTIPROCESSOR |
#ifdef MULTIPROCESSOR |
movl CPUVAR(GDT),%eax |
movl CPUVAR(GDT),%eax |
#else |
#else |
|
|
jnz switch_restored |
jnz switch_restored |
#endif |
#endif |
|
|
|
/* Switch TSS. Reset "task busy" flag before loading. */ |
|
movl %cr3,%eax |
|
movl %eax,PCB_CR3(%esi) /* XXX should be done by pmap_activate? */ |
#ifdef MULTIPROCESSOR |
#ifdef MULTIPROCESSOR |
movl CPUVAR(GDT),%eax |
movl CPUVAR(GDT),%eax |
#else |
#else |
|
|
#endif |
#endif |
movl L_MD_TSS_SEL(%edi),%edx |
movl L_MD_TSS_SEL(%edi),%edx |
|
|
/* Switch TSS. Reset "task busy" flag before loading. */ |
|
andl $~0x0200,4(%eax,%edx, 1) |
andl $~0x0200,4(%eax,%edx, 1) |
ltr %dx |
ltr %dx |
|
|
Line 2078 ENTRY(cpu_exit) |
|
Line 2091 ENTRY(cpu_exit) |
|
movl PCB_ESP(%esi),%esp |
movl PCB_ESP(%esi),%esp |
movl PCB_EBP(%esi),%ebp |
movl PCB_EBP(%esi),%ebp |
|
|
/* Load TSS info. */ |
/* Switch TSS. Reset "task busy" flag before loading. */ |
|
movl %cr3,%eax |
|
movl %eax,PCB_CR3(%esi) |
#ifdef MULTIPROCESSOR |
#ifdef MULTIPROCESSOR |
movl CPUVAR(GDT),%eax |
movl CPUVAR(GDT),%eax |
#else |
#else |
Line 2086 ENTRY(cpu_exit) |
|
Line 2101 ENTRY(cpu_exit) |
|
movl _C_LABEL(gdt),%eax |
movl _C_LABEL(gdt),%eax |
#endif |
#endif |
|
|
/* Switch TSS. */ |
|
andl $~0x0200,4-SEL_KPL(%eax,%edx,1) |
andl $~0x0200,4-SEL_KPL(%eax,%edx,1) |
ltr %dx |
ltr %dx |
|
|