version 1.11.2.3, 2004/08/25 06:57:19 |
version 1.11.2.4, 2004/09/03 12:44:47 |
|
|
#include <machine/i82489reg.h> |
#include <machine/i82489reg.h> |
#endif |
#endif |
|
|
/* |
/* This shouldn't conflict with a macro of the same name defined in pmap.h */ |
* PTmap is recursive pagemap at top of virtual address space. |
#define PTE_BASE (PDSLOT_PTE << PDSHIFT) |
* Within PTmap, the page directory can be found (third indirection). |
|
* |
|
* XXX 4 == sizeof pde |
|
*/ |
|
.set _C_LABEL(PTmap),(PDSLOT_PTE << PDSHIFT) |
|
.set _C_LABEL(PTD),(_C_LABEL(PTmap) + PDSLOT_PTE * PAGE_SIZE) |
|
.set _C_LABEL(PTDpde),(_C_LABEL(PTD) + PDSLOT_PTE * 4) |
|
|
|
/* |
|
* APTmap, APTD is the alternate recursive pagemap. |
|
* It's used when modifying another process's page tables. |
|
* |
|
* XXX 4 == sizeof pde |
|
*/ |
|
.set _C_LABEL(APTmap),(PDSLOT_APTE << PDSHIFT) |
|
.set _C_LABEL(APTD),(_C_LABEL(APTmap) + PDSLOT_APTE * PAGE_SIZE) |
|
.set _C_LABEL(APTDpde),(_C_LABEL(PTD) + PDSLOT_APTE * 4) |
|
|
|
|
|
/* |
/* |
* Initialization |
* Initialization |
|
|
#ifdef COMPAT_OLDBOOT |
#ifdef COMPAT_OLDBOOT |
.globl _C_LABEL(bootdev) |
.globl _C_LABEL(bootdev) |
#endif |
#endif |
.globl _C_LABEL(proc0paddr),_C_LABEL(PTDpaddr) |
.globl _C_LABEL(proc0paddr),_C_LABEL(PDPpaddr) |
.globl _C_LABEL(biosbasemem),_C_LABEL(biosextmem) |
.globl _C_LABEL(biosbasemem),_C_LABEL(biosextmem) |
.globl _C_LABEL(gdt) |
.globl _C_LABEL(gdt) |
#ifdef I586_CPU |
#ifdef I586_CPU |
Line 222 _C_LABEL(cpu): .long 0 # are we 386, 38 |
|
Line 204 _C_LABEL(cpu): .long 0 # are we 386, 38 |
|
_C_LABEL(esym): .long 0 # ptr to end of syms |
_C_LABEL(esym): .long 0 # ptr to end of syms |
_C_LABEL(atdevbase): .long 0 # location of start of iomem in virtual |
_C_LABEL(atdevbase): .long 0 # location of start of iomem in virtual |
_C_LABEL(proc0paddr): .long 0 |
_C_LABEL(proc0paddr): .long 0 |
_C_LABEL(PTDpaddr): .long 0 # paddr of PTD, for libkvm |
_C_LABEL(PDPpaddr): .long 0 # paddr of PDP, for libkvm |
#ifndef REALBASEMEM |
#ifndef REALBASEMEM |
_C_LABEL(biosbasemem): .long 0 # base memory reported by BIOS |
_C_LABEL(biosbasemem): .long 0 # base memory reported by BIOS |
#else |
#else |
Line 620 try586: /* Use the `cpuid' instruction. |
|
Line 602 try586: /* Use the `cpuid' instruction. |
|
leal (PROC0PDIR+PG_V|PG_KW)(%esi),%eax # pte for ptd |
leal (PROC0PDIR+PG_V|PG_KW)(%esi),%eax # pte for ptd |
movl %eax,(PROC0PDIR+PDSLOT_PTE*4)(%esi) # recursive PD slot |
movl %eax,(PROC0PDIR+PDSLOT_PTE*4)(%esi) # recursive PD slot |
|
|
/* Save phys. addr of PTD, for libkvm. */ |
/* Save phys. addr of PDP, for libkvm. */ |
movl %esi,RELOC(PTDpaddr) |
movl %esi,RELOC(PDPpaddr) |
|
|
/* Load base of page directory and enable mapping. */ |
/* Load base of page directory and enable mapping. */ |
movl %esi,%eax # phys address of ptd in proc 0 |
movl %esi,%eax # phys address of ptd in proc 0 |
Line 922 ENTRY(i386_copyout) |
|
Line 904 ENTRY(i386_copyout) |
|
movl $2f,PCB_ONFAULT(%edx) |
movl $2f,PCB_ONFAULT(%edx) |
|
|
1: /* Check PTE for each page. */ |
1: /* Check PTE for each page. */ |
testb $PG_RW,_C_LABEL(PTmap)(,%edi,4) |
testb $PG_RW,PTE_BASE(,%edi,4) |
jz 2f |
jz 2f |
|
|
4: incl %edi |
4: incl %edi |
Line 1132 ENTRY(copyoutstr) |
|
Line 1114 ENTRY(copyoutstr) |
|
movl %edi,%eax |
movl %edi,%eax |
shrl $PGSHIFT,%eax # calculate pte address |
shrl $PGSHIFT,%eax # calculate pte address |
|
|
testb $PG_RW,_C_LABEL(PTmap)(,%eax,4) |
testb $PG_RW,PTE_BASE(,%eax,4) |
jnz 2f |
jnz 2f |
|
|
6: /* Simulate a trap. */ |
6: /* Simulate a trap. */ |
|
|
|
|
movl %edx,%eax |
movl %edx,%eax |
shrl $PGSHIFT,%eax # calculate pte address |
shrl $PGSHIFT,%eax # calculate pte address |
testb $PG_RW,_C_LABEL(PTmap)(,%eax,4) |
testb $PG_RW,PTE_BASE(,%eax,4) |
jnz 1f |
jnz 1f |
|
|
3: /* Simulate a trap. */ |
3: /* Simulate a trap. */ |
|
|
|
|
movl %edx,%eax |
movl %edx,%eax |
shrl $PGSHIFT,%eax # calculate pte address |
shrl $PGSHIFT,%eax # calculate pte address |
testb $PG_RW,_C_LABEL(PTmap)(,%eax,4) |
testb $PG_RW,PTE_BASE(,%eax,4) |
jnz 1f |
jnz 1f |
|
|
3: /* Simulate a trap. */ |
3: /* Simulate a trap. */ |
Line 1546 ENTRY(suswintr) |
|
Line 1528 ENTRY(suswintr) |
|
|
|
movl %edx,%eax |
movl %edx,%eax |
shrl $PGSHIFT,%eax # calculate pte address |
shrl $PGSHIFT,%eax # calculate pte address |
testb $PG_RW,_C_LABEL(PTmap)(,%eax,4) |
testb $PG_RW,PTE_BASE(,%eax,4) |
jnz 1f |
jnz 1f |
|
|
/* Simulate a trap. */ |
/* Simulate a trap. */ |
|
|
|
|
movl %edx,%eax |
movl %edx,%eax |
shrl $PGSHIFT,%eax # calculate pte address |
shrl $PGSHIFT,%eax # calculate pte address |
testb $PG_RW,_C_LABEL(PTmap)(,%eax,4) |
testb $PG_RW,PTE_BASE(,%eax,4) |
jnz 1f |
jnz 1f |
|
|
3: /* Simulate a trap. */ |
3: /* Simulate a trap. */ |