Changeset 60686 in vbox
- Timestamp:
- Apr 25, 2016 12:51:41 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 106859
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 1 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c
r60682 r60686 1944 1944 } 1945 1945 1946 /* 1947 * Move the table by setting up alias pages. Aim at areas above 2GB for 32-bit and in 1948 * the 'negative' space of 64-bit addresses. 1949 */ 1950 if (BS3_MODE_IS_PAGED(bTestMode)) 1951 { 1952 1953 } 1954 1955 1946 1956 } 1947 1957 … … 1960 1970 for (idx = 0; idx < cWorkers; idx++) 1961 1971 if ( (paWorkers[idx].bMode & (bTestMode & BS3_MODE_CODE_MASK)) 1962 && (!paWorkers[idx].fSs || bRing != 0 ))1972 && (!paWorkers[idx].fSs || bRing != 0 /** @todo || BS3_MODE_IS_64BIT_SYS(bTestMode)*/ )) 1963 1973 { 1964 1974 g_usBs3TestStep = iStep; … … 2253 2263 BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_sgdt)(uint8_t bMode) 2254 2264 { 2255 //if (bMode == BS3_MODE_LM64) 2256 { 2265 //if (bMode >= BS3_MODE_LM16) 2266 { 2267 uint64_t const uOrgAddr = Bs3Lgdt_Gdt.uAddr; 2268 uint64_t uNew = 0; 2257 2269 union 2258 2270 { … … 2264 2276 g_bTestMode = bMode; 2265 2277 g_f16BitSys = BS3_MODE_IS_16BIT_SYS(TMPL_MODE); 2266 2267 2278 BS3_ASSERT(bMode == TMPL_MODE); 2279 2280 /* 2281 * If paged mode, try push the GDT way up. 2282 */ 2283 if (BS3_MODE_IS_PAGED(bMode)) 2284 { 2285 /** @todo loading non-canonical base addresses. */ 2286 int rc; 2287 uNew = BS3_MODE_IS_64BIT_SYS(bMode) ? UINT64_C(0xffff80fedcb70000) : UINT64_C(0xc2d28000); 2288 uNew |= uOrgAddr & X86_PAGE_OFFSET_MASK; 2289 rc = Bs3PagingAlias(uNew, uOrgAddr, Bs3Lgdt_Gdt.cb, X86_PTE_P | X86_PTE_RW | X86_PTE_US | X86_PTE_D | X86_PTE_A); 2290 if (RT_SUCCESS(rc)) 2291 { 2292 Bs3Lgdt_Gdt.uAddr = uNew; 2293 Bs3UtilSetFullGdtr(Bs3Lgdt_Gdt.cb, uNew); 2294 } 2295 } 2268 2296 2269 2297 /* … … 2273 2301 ASMGetGDTR(&Expected.Gdtr); 2274 2302 bs3CpuBasic2_sidt_sgdt_Common(bMode, g_aSgdtWorkers, RT_ELEMENTS(g_aSgdtWorkers), Expected.ab); 2303 2304 /* 2305 * Unalias the GDT. 2306 */ 2307 if (uNew != 0) 2308 { 2309 Bs3Lgdt_Gdt.uAddr = uOrgAddr; 2310 Bs3UtilSetFullGdtr(Bs3Lgdt_Gdt.cb, uOrgAddr); 2311 Bs3PagingUnalias(uNew, Bs3Lgdt_Gdt.cb); 2312 } 2275 2313 2276 2314 /* -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r60682 r60686 86 86 bs3-cmn-PagingInitRootForPAE.c \ 87 87 bs3-cmn-PagingInitRootForLM.c \ 88 bs3-cmn-PagingAlias.c \ 88 89 bs3-cmn-PagingProtect.c \ 89 90 bs3-cmn-PagingSetupCanonicalTraps.c \ … … 158 159 bs3-cmn-TrapSetJmpAndRestore.c \ 159 160 bs3-cmn-TrapUnsetJmp.c \ 161 bs3-cmn-UtilSetFullGdtr.asm \ 162 bs3-cmn-UtilSetFullIdtr.asm \ 160 163 ../../../Runtime/common/asm/ASMBitFirstClear.asm \ 161 164 ../../../Runtime/common/asm/ASMBitFirstSet.asm \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingProtect.c
r60682 r60686 100 100 { 101 101 X86PT BS3_FAR *pPT; 102 uint32_t uPte = (pPD->a[iPde].u & ~(uint32_t)(X86_PTE_PG_MASK | X86_PDE4M_PS | X86_PDE4M_G)) | X86_PTE_D; 102 uint32_t uPte = (pPD->a[iPde].u & ~(uint32_t)(X86_PDE4M_PS | X86_PDE4M_G | X86_PDE4M_PG_HIGH_MASK)) \ 103 | X86_PTE_D; 103 104 if (pPD->a[iPde].b.u1Global) 104 105 uPte |= X86_PTE_G; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToLM32.asm
r60557 r60686 134 134 135 135 ; 136 ; Load full 64-bit GDT base address from 64-bit segment. 137 ; 138 jmp dword BS3_SEL_R0_CS64:.load_full_gdt_base wrt FLAT 139 .load_full_gdt_base: 140 BS3_SET_BITS 64 141 lgdt [Bs3Lgdt_Gdt wrt FLAT] 142 push BS3_SEL_R0_CS32 143 push .back_to_32bit wrt FLAT 144 o64 retf 145 .back_to_32bit: 146 BS3_SET_BITS 32 147 148 ; 136 149 ; Restore ecx, eax and flags (IF). 137 150 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAE16.asm
r60557 r60686 132 132 ; Load the GDT and enable PP16. 133 133 ; 134 BS3_EXTERN_SYSTEM16 Bs3LgdtDef_Gdt 134 135 BS3_EXTERN_SYSTEM16 Bs3Lgdt_Gdt 135 136 BS3_BEGIN_TEXT16 136 137 mov ax, BS3SYSTEM16 137 138 mov ds, ax 138 lgdt [Bs3Lgdt _Gdt]139 lgdt [Bs3LgdtDef_Gdt] ; Will only load 24-bit base! 139 140 140 141 mov eax, cr0 … … 156 157 ; 157 158 call NAME(Bs3EnteredMode_pae16) 159 160 ; 161 ; Load full 32-bit GDT base address from 32-bit segment. 162 ; 163 push ds 164 mov ax, BS3_SEL_SYSTEM16 165 mov ds, ax 166 jmp dword BS3_SEL_R0_CS32:.load_full_gdt_base wrt FLAT 167 .load_full_gdt_base: 168 BS3_SET_BITS 32 169 lgdt [Bs3Lgdt_Gdt wrt BS3SYSTEM16] 170 jmp BS3_SEL_R0_CS16:.back_to_16bit 171 .back_to_16bit: 172 BS3_SET_BITS 16 173 pop ds 158 174 159 175 popfd -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAE32.asm
r60557 r60686 109 109 ; Load the GDT and enable PE32. 110 110 ; 111 BS3_EXTERN_SYSTEM16 Bs3LgdtDef_Gdt 111 112 BS3_EXTERN_SYSTEM16 Bs3Lgdt_Gdt 112 113 BS3_BEGIN_TEXT16 113 114 mov ax, BS3SYSTEM16 114 115 mov ds, ax 115 lgdt [Bs3Lgdt _Gdt]116 lgdt [Bs3LgdtDef_Gdt] ; Will only load 24-bit base! 116 117 117 118 mov eax, cr0 … … 139 140 extern NAME(Bs3EnteredMode_pae32) 140 141 call NAME(Bs3EnteredMode_pae32) 142 143 ; Load full 32-bit GDT base address. 144 lgdt [Bs3Lgdt_Gdt wrt FLAT] 141 145 142 146 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPE16.asm
r60557 r60686 94 94 ; 95 95 BS3_EXTERN_SYSTEM16 Bs3Lgdt_Gdt 96 BS3_EXTERN_SYSTEM16 Bs3LgdtDef_Gdt 96 97 BS3_BEGIN_TEXT16 97 98 mov ax, BS3SYSTEM16 98 99 mov ds, ax 99 lgdt [Bs3Lgdt _Gdt]100 lgdt [Bs3LgdtDef_Gdt] ; Will only load 24-bit base! 100 101 101 102 smsw ax … … 116 117 extern NAME(Bs3EnteredMode_pe16) 117 118 call NAME(Bs3EnteredMode_pe16) 119 120 ; 121 ; Load full 32-bit GDT base address from 32-bit segment, if 386+ CPU. 122 ; 123 BS3_EXTERN_DATA16 g_uBs3CpuDetected 124 BS3_BEGIN_TEXT16 125 cmp byte [g_uBs3CpuDetected], BS3CPU_80386 126 jb .old_cpu_skip_32bit_lgdt 127 push ds 128 mov ax, BS3_SEL_SYSTEM16 129 mov ds, ax 130 jmp dword BS3_SEL_R0_CS32:.load_full_gdt_base wrt FLAT 131 .load_full_gdt_base: 132 BS3_SET_BITS 32 133 lgdt [Bs3Lgdt_Gdt wrt BS3SYSTEM16] 134 jmp BS3_SEL_R0_CS16:.back_to_16bit 135 .back_to_16bit: 136 BS3_SET_BITS 16 137 pop ds 138 .old_cpu_skip_32bit_lgdt: 118 139 119 140 popf -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPE32.asm
r60557 r60686 87 87 ; Load the GDT and enable PE32. 88 88 ; 89 BS3_EXTERN_SYSTEM16 Bs3LgdtDef_Gdt 89 90 BS3_EXTERN_SYSTEM16 Bs3Lgdt_Gdt 90 91 BS3_BEGIN_TEXT16 91 92 mov ax, BS3SYSTEM16 92 93 mov ds, ax 93 lgdt [Bs3Lgdt _Gdt]94 lgdt [Bs3LgdtDef_Gdt] ; Will only load 24-bit base! 94 95 95 96 mov eax, cr0 … … 117 118 extern NAME(Bs3EnteredMode_pe32) 118 119 call NAME(Bs3EnteredMode_pe32) 120 121 ; Load full 32-bit GDT base address. 122 lgdt [Bs3Lgdt_Gdt wrt FLAT] 119 123 120 124 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPP16.asm
r60557 r60686 148 148 ; Load the GDT and enable PP16. 149 149 ; 150 BS3_EXTERN_SYSTEM16 Bs3LgdtDef_Gdt 150 151 BS3_EXTERN_SYSTEM16 Bs3Lgdt_Gdt 151 152 BS3_BEGIN_TEXT16 152 153 mov ax, BS3SYSTEM16 153 154 mov ds, ax 154 lgdt [Bs3Lgdt _Gdt]155 lgdt [Bs3LgdtDef_Gdt] ; Will only load 24-bit base! 155 156 156 157 mov eax, cr0 … … 172 173 ; 173 174 call NAME(Bs3EnteredMode_pp16) 175 176 ; 177 ; Load full 32-bit GDT base address from 32-bit segment. 178 ; 179 push ds 180 mov ax, BS3_SEL_SYSTEM16 181 mov ds, ax 182 jmp dword BS3_SEL_R0_CS32:.load_full_gdt_base wrt FLAT 183 .load_full_gdt_base: 184 BS3_SET_BITS 32 185 lgdt [Bs3Lgdt_Gdt wrt BS3SYSTEM16] 186 jmp BS3_SEL_R0_CS16:.back_to_16bit 187 .back_to_16bit: 188 BS3_SET_BITS 16 189 pop ds 174 190 175 191 popfd -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPP32.asm
r60557 r60686 117 117 ; Load the GDT and enable PE32. 118 118 ; 119 BS3_EXTERN_SYSTEM16 Bs3LgdtDef_Gdt 119 120 BS3_EXTERN_SYSTEM16 Bs3Lgdt_Gdt 120 121 BS3_BEGIN_TEXT16 121 122 mov ax, BS3SYSTEM16 122 123 mov ds, ax 123 lgdt [Bs3Lgdt _Gdt]124 lgdt [Bs3LgdtDef_Gdt] ; Will only load 24-bit base! 124 125 125 126 mov eax, cr0 … … 129 130 BS3_BEGIN_TEXT32 130 131 .thirty_two_bit: 131 132 132 ; 133 133 ; Convert the (now) real mode stack pointer to 32-bit flat. … … 147 147 extern NAME(Bs3EnteredMode_pp32) 148 148 call NAME(Bs3EnteredMode_pp32) 149 150 ; Load full 32-bit GDT base address. 151 lgdt [Bs3Lgdt_Gdt wrt FLAT] 149 152 150 153 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitMemory.c
r60578 r60686 175 175 176 176 177 /** The last RAM address below 4GB (approximately). */ 178 uint32_t g_uBs3EndOfRamBelow4G = 0; 179 180 181 177 182 /** 178 183 * Adds a range of memory to the tiled slabs. … … 181 186 * @param cbRange Size of range. 182 187 */ 183 static void bs3InitMemoryAddRange(uint32_t uRange, uint32_t cbRange) 184 { 185 if (uRange < BS3_SEL_TILED_AREA_SIZE) 188 static void bs3InitMemoryAddRange32(uint32_t uRange, uint32_t cbRange) 189 { 190 uint32_t uRangeEnd = uRange + cbRange; 191 if (uRangeEnd < uRange) 192 uRangeEnd = UINT32_MAX; 193 194 /* Raise the end-of-ram-below-4GB marker? */ 195 if (uRangeEnd > g_uBs3EndOfRamBelow4G) 196 g_uBs3EndOfRamBelow4G = uRangeEnd; 197 198 /* Applicable to tiled memory? */ 199 if ( uRange < BS3_SEL_TILED_AREA_SIZE 200 && ( uRange >= _1M 201 || uRangeEnd >= _1M)) 186 202 { 187 uint32_t uRangeEnd = uRange + cbRange; 188 if ( uRange >= _1M 189 || uRangeEnd > _1M) 190 { 191 uint16_t cPages; 192 193 /* Adjust the start of the range such that it's at or above 1MB and page aligned. */ 194 if (uRange < _1M) 203 uint16_t cPages; 204 205 /* Adjust the start of the range such that it's at or above 1MB and page aligned. */ 206 if (uRange < _1M) 207 { 208 cbRange -= _1M - uRange; 209 uRange = _1M; 210 } 211 else if (uRange & (_4K - 1U)) 212 { 213 cbRange -= uRange & (_4K - 1U); 214 uRange = RT_ALIGN_32(uRange, _4K); 215 } 216 217 /* Adjust the end/size of the range such that it's page aligned and not beyond the tiled area. */ 218 if (uRangeEnd > BS3_SEL_TILED_AREA_SIZE) 219 { 220 cbRange -= uRangeEnd - BS3_SEL_TILED_AREA_SIZE; 221 uRangeEnd = BS3_SEL_TILED_AREA_SIZE; 222 } 223 else if (uRangeEnd & (_4K - 1U)) 224 { 225 cbRange -= uRangeEnd & (_4K - 1U); 226 uRangeEnd &= ~(uint32_t)(_4K - 1U); 227 } 228 229 /* If there is still something, enable it. 230 (We're a bit paranoid here don't trust the BIOS to only report a page once.) */ 231 cPages = cbRange >> 12; /*div 4K*/ 232 if (cPages) 233 { 234 unsigned i; 235 uRange -= _1M; 236 i = uRange >> 12; /*div _4K*/ 237 while (cPages-- > 0) 195 238 { 196 cbRange -= _1M - uRange; 197 uRange = _1M; 198 } 199 else if (uRange & (_4K - 1U)) 200 { 201 cbRange -= uRange & (_4K - 1U); 202 uRange = RT_ALIGN_32(uRange, _4K); 203 } 204 205 /* Adjust the end/size of the range such that it's page aligned and not beyond the tiled area. */ 206 if (uRangeEnd > BS3_SEL_TILED_AREA_SIZE) 207 { 208 cbRange -= uRangeEnd - BS3_SEL_TILED_AREA_SIZE; 209 uRangeEnd = BS3_SEL_TILED_AREA_SIZE; 210 } 211 else if (uRangeEnd & (_4K - 1U)) 212 { 213 cbRange -= uRangeEnd & (_4K - 1U); 214 uRangeEnd &= ~(uint32_t)(_4K - 1U); 215 } 216 217 /* If there is still something, enable it. 218 (We're a bit paranoid here don't trust the BIOS to only report a page once.) */ 219 cPages = cbRange >> 12; /*div 4K*/ 220 if (cPages) 221 { 222 unsigned i; 223 uRange -= _1M; 224 i = uRange >> 12; /*div _4K*/ 225 while (cPages-- > 0) 226 { 227 uint16_t uLineToLong = ASMBitTestAndClear(g_Bs3Mem4KUpperTiled.Core.bmAllocated, i); 228 g_Bs3Mem4KUpperTiled.Core.cFreeChunks += uLineToLong; 229 i++; 230 } 239 uint16_t uLineToLong = ASMBitTestAndClear(g_Bs3Mem4KUpperTiled.Core.bmAllocated, i); 240 g_Bs3Mem4KUpperTiled.Core.cFreeChunks += uLineToLong; 241 i++; 231 242 } 232 243 } … … 308 319 while ( (uCont = Bs3BiosInt15hE820(&Entry, sizeof(Entry), uCont)) != 0 309 320 && i++ < 2048) 310 { 311 if ( Entry.uType == INT15E820_TYPE_USABLE 312 && Entry.uBaseAddr < BS3_SEL_TILED_AREA_SIZE) 313 { 314 /* Entry concerning tiled memory. Convert from 64-bit to 32-bit 315 values and check whether it's concerning anything at or above 1MB */ 316 uint32_t uRange = (uint32_t)Entry.uBaseAddr; 317 uint32_t cbRange = Entry.cbRange >= BS3_SEL_TILED_AREA_SIZE 318 ? BS3_SEL_TILED_AREA_SIZE : (uint32_t)Entry.cbRange; 319 AssertCompile(BS3_SEL_TILED_AREA_SIZE <= _512M /* the range of 16-bit cPages. */ ); 320 bs3InitMemoryAddRange(uRange, cbRange); 321 } 322 } 321 if (Entry.uType == INT15E820_TYPE_USABLE) 322 if (!(Entry.uBaseAddr >> 32)) 323 /* Convert from 64-bit to 32-bit value and record it. */ 324 bs3InitMemoryAddRange32((uint32_t)Entry.uBaseAddr, 325 (Entry.cbRange >> 32) ? UINT32_C(0xfffff000) : (uint32_t)Entry.cbRange); 323 326 } 324 327 /* Try the 286+ API for getting memory above 1MB and (usually) below 16MB. */ … … 326 329 && (u32 = Bs3BiosInt15h88()) != UINT32_MAX 327 330 && u32 > 0) 328 bs3InitMemoryAddRange (_1M, u32 * _1K);331 bs3InitMemoryAddRange32(_1M, u32 * _1K); 329 332 330 333 /* -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-system-data.asm
r60595 r60686 1005 1005 1006 1006 ;; 1007 ; LGDT structure for the GDT (8-byte aligned on offset).1007 ; LGDT structure for the current GDT (8-byte aligned on offset). 1008 1008 BS3_GLOBAL_DATA Bs3Lgdt_Gdt, 2+8 1009 1009 dw BS3_DATA_NM(Bs3GdtEnd) - BS3_DATA_NM(Bs3Gdt) - 1 ; limit … … 1012 1012 dd 0 ; top32 offset 1013 1013 1014 ;; 1015 ; LGDT structure for the default GDT (8-byte aligned on offset). 1016 ; This must not be modified, whereas Bs3Lgdt_Gdt can be modified by the user. 1017 BS3_GLOBAL_DATA Bs3LgdtDef_Gdt, 2+8 1018 dw BS3_DATA_NM(Bs3GdtEnd) - BS3_DATA_NM(Bs3Gdt) - 1 ; limit 1019 dw BS3_SYSTEM16_BASE_LOW(Bs3Gdt) ; low offset 1020 dw (BS3_ADDR_BS3SYSTEM16 >> 16) ; high offset 1021 dd 0 ; top32 offset 1022 1014 1023 1015 1024 … … 1018 1027 ; LDT filling up the rest of the segment. 1019 1028 ; 1020 ; Currently this starts at 0x84 d0, which leaves us with 0xb30 bytes. We'll use1029 ; Currently this starts at 0x84e0, which leaves us with 0xb20 bytes. We'll use 1021 1030 ; the last 32 of those for an eye catcher. 1022 1031 ; 1023 BS3_GLOBAL_DATA Bs3Ldt, 0b 30h - 321024 times (0b 30h - 32) db 01032 BS3_GLOBAL_DATA Bs3Ldt, 0b20h - 32 1033 times (0b20h - 32) db 0 1025 1034 BS3_GLOBAL_DATA Bs3LdtEnd, 0 1026 1035 db 10, 13, 'eye-catcher: SYSTEM16 END', 10, 13, 0, 0, 0 ; 32 bytes long -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk
r60682 r60686 36 36 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestCheckRegCtxEx) 37 37 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3StrCpy) 38 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingAlias) 38 39 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForLM) 39 40 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForPAE) … … 41 42 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtect) 42 43 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtectPtr) 44 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingUnalias) 43 45 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SwitchFromV86To16BitAndCallC) 44 46 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetHandler) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
r60682 r60686 47 47 #define Bs3MemSet BS3_CMN_MANGLER(Bs3MemSet) 48 48 #define Bs3MemZero BS3_CMN_MANGLER(Bs3MemZero) 49 #define Bs3PagingAlias BS3_CMN_MANGLER(Bs3PagingAlias) 49 50 #define bs3PagingGetLegacyPte BS3_CMN_MANGLER(bs3PagingGetLegacyPte) 50 51 #define bs3PagingGetPte BS3_CMN_MANGLER(bs3PagingGetPte) … … 55 56 #define Bs3PagingProtectPtr BS3_CMN_MANGLER(Bs3PagingProtectPtr) 56 57 #define Bs3PagingSetupCanonicalTraps BS3_CMN_MANGLER(Bs3PagingSetupCanonicalTraps) 58 #define Bs3PagingUnalias BS3_CMN_MANGLER(Bs3PagingUnalias) 57 59 #define Bs3Panic BS3_CMN_MANGLER(Bs3Panic) 58 60 #define Bs3PicMaskAll BS3_CMN_MANGLER(Bs3PicMaskAll) … … 138 140 #define Bs3UInt32Div BS3_CMN_MANGLER(Bs3UInt32Div) 139 141 #define Bs3UInt64Div BS3_CMN_MANGLER(Bs3UInt64Div) 142 #define Bs3UtilSetFullGdtr BS3_CMN_MANGLER(Bs3UtilSetFullGdtr) 143 #define Bs3UtilSetFullIdtr BS3_CMN_MANGLER(Bs3UtilSetFullIdtr) 140 144 #ifndef BS3_CMN_ONLY 141 145 # define Bs3CpuDetect BS3_MODE_MANGLER(Bs3CpuDetect) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r60682 r60686 47 47 #undef Bs3MemSet 48 48 #undef Bs3MemZero 49 #undef Bs3PagingAlias 49 50 #undef bs3PagingGetLegacyPte 50 51 #undef bs3PagingGetPte … … 55 56 #undef Bs3PagingProtectPtr 56 57 #undef Bs3PagingSetupCanonicalTraps 58 #undef Bs3PagingUnalias 57 59 #undef Bs3Panic 58 60 #undef Bs3PicMaskAll … … 138 140 #undef Bs3UInt32Div 139 141 #undef Bs3UInt64Div 142 #undef Bs3UtilSetFullGdtr 143 #undef Bs3UtilSetFullIdtr 140 144 #ifndef BS3_CMN_ONLY 141 145 # undef Bs3CpuDetect -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60682 r60686 196 196 /** Whether the mode has paging enabled. */ 197 197 #define BS3_MODE_IS_PAGED(a_fMode) ((a_fMode) >= BS3_MODE_PP16) 198 /** Whether the mode has legacy paging enabled (legacy as opposed to PAE or 199 * long mode). */ 200 #define BS3_MODE_IS_LEGACY_PAGING(a_fMode) ((a_fMode) >= BS3_MODE_PP16 && (a_fMode) < BS3_MODE_PAE16) 198 201 199 202 /** Whether the mode is running v8086 code. */ … … 998 1001 * vector table.. */ 999 1002 extern X86XDTR64 BS3_FAR_DATA Bs3Lidt_Ivt; 1000 /** Structure for the LGDT instruction for loading the GDT. */1003 /** Structure for the LGDT instruction for loading the current GDT. */ 1001 1004 extern X86XDTR64 BS3_FAR_DATA Bs3Lgdt_Gdt; 1005 /** Structure for the LGDT instruction for loading the default GDT. */ 1006 extern X86XDTR64 BS3_FAR_DATA Bs3LgdtDef_Gdt; 1002 1007 /** The LDT (all entries are empty, fill in for testing). */ 1003 extern X86DESC BS3_FAR_DATA Bs3Ldt[11 8];1008 extern X86DESC BS3_FAR_DATA Bs3Ldt[116]; 1004 1009 /** The end of the LDT (exclusive). */ 1005 1010 extern X86DESC BS3_FAR_DATA Bs3LdtEnd; … … 2043 2048 BS3_CMN_PROTO_STUB(void, Bs3MemGuardedTestPageFree,(void BS3_FAR *pvGuardedPage)); 2044 2049 2050 /** Highes RAM byte below 4G. */ 2051 extern uint32_t g_uBs3EndOfRamBelow4G; 2052 2045 2053 2046 2054 /** … … 2136 2144 */ 2137 2145 BS3_CMN_PROTO_STUB(int, Bs3PagingProtectPtr,(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear)); 2146 2147 /** 2148 * Aliases (maps) one or more contiguous physical pages to a virtual range. 2149 * 2150 * @returns VBox status code. 2151 * @retval VERR_INVALID_PARAMETER if we're in legacy paging mode and @a uDst or 2152 * @a uPhysToAlias are not compatible with legacy paging. 2153 * @retval VERR_OUT_OF_RANGE if we cannot traverse the page tables in this mode 2154 * (typically real mode or v86, maybe 16-bit PE). 2155 * @retval VERR_NO_MEMORY if we cannot allocate page tables for splitting up 2156 * the necessary large pages. No aliasing was performed. 2157 * 2158 * @param uDst The virtual address to map it at. Rounded down 2159 * to the nearest page (@a cbHowMuch is adjusted 2160 * up). 2161 * @param uPhysToAlias The physical address of the first page in the 2162 * (contiguous) range to map. Chopped down to 2163 * nearest page boundrary (@a cbHowMuch is not 2164 * adjusted). 2165 * @param cbHowMuch How much to map. Rounded up to nearest page. 2166 * @param fPte The PTE flags. 2167 */ 2168 BS3_CMN_PROTO_STUB(int, Bs3PagingAlias,(uint64_t uDst, uint64_t uPhysToAlias, uint32_t cbHowMuch, uint64_t fPte)); 2169 2170 /** 2171 * Unaliases memory, i.e. restores the 1:1 mapping. 2172 * 2173 * @returns VBox status code. Cannot fail if @a uDst and @a cbHowMuch specify 2174 * the range of a successful Bs3PagingAlias call, however it may run 2175 * out of memory if it's breaking new ground. 2176 * 2177 * @param uDst The virtual address to restore to 1:1 mapping. 2178 * Rounded down to the nearest page (@a cbHowMuch 2179 * is adjusted up). 2180 * @param cbHowMuch How much to restore. Rounded up to nearest page. 2181 */ 2182 BS3_CMN_PROTO_STUB(int, Bs3PagingUnalias,(uint64_t uDst, uint32_t cbHowMuch)); 2183 2138 2184 2139 2185 /** The physical / flat address of the buffer backing the canonical traps. … … 2899 2945 FNBS3TESTDOMODE RT_CONCAT(a_BaseNm, _lm64) 2900 2946 2947 2948 /** 2949 * Sets the full GDTR register. 2950 * 2951 * @param cbLimit The limit. 2952 * @param uBase The base address - 24, 32 or 64 bit depending on the 2953 * CPU mode. 2954 */ 2955 BS3_CMN_PROTO_NOSB(void, Bs3UtilSetFullGdtr,(uint16_t cbLimit, uint64_t uBase)); 2956 2957 /** 2958 * Sets the full IDTR register. 2959 * 2960 * @param cbLimit The limit. 2961 * @param uBase The base address - 24, 32 or 64 bit depending on the 2962 * CPU mode. 2963 */ 2964 BS3_CMN_PROTO_NOSB(void, Bs3UtilSetFullIdtr,(uint16_t cbLimit, uint64_t uBase)); 2965 2966 2901 2967 /** @} */ 2902 2968
Note:
See TracChangeset
for help on using the changeset viewer.