-/* allocate kernel page table pages */
- ALLOCPAGES(NKPT)
- movl %esi,PA(EXT(KPTphys))
-
-#ifdef PAE
-/* allocate Page Table Directory Page */
- ALLOCPAGES(1)
- movl %esi,PA(EXT(IdlePDPT))
-#endif
-
-/* allocate kernel page directory page */
- ALLOCPAGES(NPGPTD)
- movl %esi,PA(EXT(IdlePTD))
-
-/* map from zero to end of kernel */
- xorl %eax,%eax
- movl PA(physfree),%ecx
- shrl $(PAGE_SHIFT),%ecx
- fillkptphys( $(PTE_W) )
-
-/* map page directory */
-#ifdef PAE
- movl PA(EXT(IdlePDPT)), %eax
- movl $1, %ecx
- fillkptphys( $(PTE_W) )
-#endif
- movl PA(EXT(IdlePTD)),%eax
- movl $(NPGPTD), %ecx
- fillkptphys( $(PTE_W) )
-
-/* install a pde for temp double map of bottom of VA */
- movl PA(EXT(KPTphys)),%eax
- xorl %ebx,%ebx
- movl $(NKPT), %ecx
- fillkpt(PA(EXT(IdlePTD)), $(PTE_W))
-
-/* install pde's for page tables */
- movl PA(EXT(KPTphys)),%eax
- movl $(KPTDI),%ebx
- movl $(NKPT),%ecx
- fillkpt(PA(EXT(IdlePTD)), $(PTE_W))
-
-/* install a pde recursively mapping page directory as a page table */
- movl PA(EXT(IdlePTD)),%eax
- movl $(PTDPTDI),%ebx
- movl $(NPGPTD),%ecx
- fillkpt(PA(EXT(IdlePTD)), $(PTE_W))
-
-#ifdef PAE
- movl PA(EXT(IdlePTD)), %eax
- xorl %ebx, %ebx
- movl $(NPGPTD), %ecx
- fillkpt(PA(EXT(IdlePDPT)), $0)
-#endif
-
-/* install a pde page for commpage use up in high memory */
-
- movl PA(physfree),%eax /* grab next phys page */
- movl %eax,%ebx
- addl $(PAGE_SIZE),%ebx
- movl %ebx,PA(physfree) /* show next free phys pg */
- movl $(COMM_PAGE_BASE_ADDR),%ebx
- shrl $(PDESHIFT),%ebx /* index into pde page */
- movl $(1), %ecx /* # pdes to store */
- fillkpt(PA(EXT(IdlePTD)), $(PTE_W|PTE_U)) /* user has access! */
-
- movl PA(physfree),%edi
- movl %edi,PA(EXT(first_avail)) /* save first available phys addr */
-
-#ifdef PAE
-/*
- * We steal 0x4000 for a temp pdpt and 0x5000-0x8000
- * for temp pde pages in the PAE case. Once we are
- * running at the proper virtual address we switch to
- * the PDPT/PDE's the master is using */
-
- /* clear pdpt page to be safe */
- xorl %eax, %eax
- movl $(PAGE_SIZE),%ecx
- movl $(0x4000),%edi