- Timestamp:
- Feb 26, 2016 8:59:52 PM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 5 added
- 19 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/Config.kmk
r59803 r59863 343 343 TEMPLATE_VBoxBS3KitImg_CXXFLAGS = \ 344 344 -nt=BS3TEXT16 -nd=BS3DATA16 -nc=BS3CODE16 -ecw -q -0 -wx -zl -zu -mc $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os 345 TEMPLATE_VBoxBS3KitImg_INCS = $(VBOX_PATH_BS3KIT_SRC) 345 TEMPLATE_VBoxBS3KitImg_INCS = $(VBOX_PATH_BS3KIT_SRC) . 346 346 TEMPLATE_VBoxBS3KitImg_LDTOOL = OPENWATCOM-WL 347 347 # option quiet, nofarcalls\ … … 451 451 TEMPLATE_VBoxBS3KitImg32_CXXFLAGS = \ 452 452 -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CODE32 -ecc -q -wx -zl -mf $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os 453 TEMPLATE_VBoxBS3KitImg32_INCS = $(VBOX_PATH_BS3KIT_SRC) 453 TEMPLATE_VBoxBS3KitImg32_INCS = $(VBOX_PATH_BS3KIT_SRC) . 454 454 TEMPLATE_VBoxBS3KitImg32_LDTOOL = VBoxBsUnusedLd 455 455 … … 465 465 TEMPLATE_VBoxBS3KitImg64_DEFS.debug = BS3_STRICT 466 466 TEMPLATE_VBoxBS3KitImg64_ARTOOL = OPENWATCOM 467 TEMPLATE_VBoxBS3KitImg64_INCS = $(VBOX_PATH_BS3KIT_SRC) 467 TEMPLATE_VBoxBS3KitImg64_INCS = $(VBOX_PATH_BS3KIT_SRC) . 468 468 if1of ($(KBUILD_HOST), win) 469 469 ifndef TOOL_VCC100AMD64 # For win.x86 builds. … … 494 494 TEMPLATE_VBoxBS3KitBS_ASFLAGS = -f bin --mapfile 495 495 TEMPLATE_VBoxBS3KitBS_ASDEFS = ASM_FORMAT_BIN RT_NOINC_SEGMENTS ARCH_BITS=16 __YASM__ 496 TEMPLATE_VBoxBS3KitBS_INCS = $(VBOX_PATH_BS3KIT_SRC) 496 TEMPLATE_VBoxBS3KitBS_INCS = $(VBOX_PATH_BS3KIT_SRC) . 497 497 TEMPLATE_VBoxBS3KitBS_LDTOOL = VBoxBsCpLd 498 498 -
trunk/src/VBox/ValidationKit/bootsectors/Makefile.kmk
r59316 r59863 229 229 bs3-cpu-basic-2_TEMPLATE = VBoxBS3KitImg 230 230 bs3-cpu-basic-2_SOURCES = \ 231 bs3-cpu-basic-2.asm 231 bs3kit/bs3-first-rm.asm \ 232 bs3-cpu-basic-2-c.c 233 # bs3-cpu-basic-2.asm 232 234 endif 233 235 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2.asm
r59789 r59863 63 63 ; 64 64 65 66 65 67 ; 66 68 ; Done. … … 72 74 73 75 76 ; 77 ; Instantiate the test template code. 78 ; 79 %include "bs3kit-template-footer.mac" ; reset the initial environemnt. 74 80 81 82 BS3_INSTANTIATE_TEMPLATE_WITH_WEIRD_ONES "bs3-cpu-basic-2-template.mac" 83 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r59789 r59863 5 5 6 6 # 7 # Copyright (C) 2006-201 5Oracle Corporation7 # Copyright (C) 2006-2016 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 100 100 bs3-cmn-TestData.c \ 101 101 bs3-cmn-TestInit.c \ 102 bs3-cmn-TestSendStrCmd.asm \ 102 bs3-cmn-TestTerm.c \ 103 bs3-cmn-TestSendCmdWithStr.asm \ 104 bs3-cmn-TestSendCmdWithU32.asm \ 103 105 bs3-cmn-TestIsVmmDevTestingPresent.asm \ 104 106 bs3-cmn-Trap16SetGate.c \ … … 136 138 bs3-cmn-hexdigits.c \ 137 139 bs3-cmn-CpuDetectData.c \ 140 bs3-cmn-PerCpuData.c \ 138 141 bs3-cmn-ConvertRMStackToP16UsingCxReturnToAx.asm \ 139 142 bs3-wc16-U8DR.asm \ … … 204 207 bs3kit-rm_TEMPLATE = VBoxBS3KitImg 205 208 bs3kit-rm_INSTTYPE = none 206 bs3kit-rm_DEFS = TMPL_ RM209 bs3kit-rm_DEFS = TMPL_MODE=BS3_MODE_RM 207 210 bs3kit-rm_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 208 211 bs3-first-rm.asm \ … … 210 213 211 214 212 # The 16-bit protected mode BS3Kit library.215 # The 16-bit BS3Kit library for 16-bit protected kernel+tss. 213 216 LIBRARIES += bs3kit-pe16 214 217 bs3kit-pe16_TEMPLATE = VBoxBS3KitImg 215 218 bs3kit-pe16_INSTTYPE = none 216 bs3kit-pe16_DEFS = TMPL_ PE16219 bs3kit-pe16_DEFS = TMPL_MODE=BS3_MODE_PE16 217 220 bs3kit-pe16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 218 221 bs3-first-pe16.asm \ 219 222 # bs3-mode-CpuDetect.asm 220 223 221 # The virtual 8086 under protected mode BS3Kit library. 224 # The 32-bit BS3Kit library for 16-bit protected kernel+tss. 225 LIBRARIES += bs3kit-pe16_32 226 bs3kit-pe16_32_TEMPLATE = VBoxBS3KitImg32 227 bs3kit-pe16_32_INSTTYPE = none 228 bs3kit-pe16_32_DEFS = TMPL_MODE=BS3_MODE_PE16_32 229 bs3kit-pe16_32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 230 231 # The v86 BS3Kit library for 16-bit protected kernel+tss. 232 LIBRARIES += bs3kit-pe16_v86 233 bs3kit-pe16_v86_TEMPLATE = VBoxBS3KitImg 234 bs3kit-pe16_v86_INSTTYPE = none 235 bs3kit-pe16_v86_DEFS = TMPL_MODE=BS3_MODE_PE16_V86 236 bs3kit-pe16_v86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 237 238 # The 32-bit BS3Kit library for 32-bit protected kernel+tss. 239 LIBRARIES += bs3kit-pe32 240 bs3kit-pe32_TEMPLATE = VBoxBS3KitImg32 241 bs3kit-pe32_INSTTYPE = none 242 bs3kit-pe32_DEFS = TMPL_MODE=BS3_MODE_PE32 243 bs3kit-pe32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 244 245 # The 16-bit BS3Kit library for 32-bit protected kernel+tss. 246 LIBRARIES += bs3kit-pe32_16 247 bs3kit-pe32_16_TEMPLATE = VBoxBS3KitImg 248 bs3kit-pe32_16_INSTTYPE = none 249 bs3kit-pe32_16_DEFS = TMPL_MODE=BS3_MODE_PE32_16 250 bs3kit-pe32_16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 251 252 # The v8086 BS3Kit library for 32-bit protected kernel+tss. 222 253 LIBRARIES += bs3kit-pev86 223 254 bs3kit-pev86_TEMPLATE = VBoxBS3KitImg 224 255 bs3kit-pev86_INSTTYPE = none 225 bs3kit-pev86_DEFS = TMPL_PEV86 226 bs3kit-pev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 227 228 # The 32-bit protected mode BS3Kit library. 229 LIBRARIES += bs3kit-pe32 230 bs3kit-pe32_TEMPLATE = VBoxBS3KitImg32 231 bs3kit-pe32_INSTTYPE = none 232 bs3kit-pe32_DEFS = TMPL_PE32 233 bs3kit-pe32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 234 235 236 # The 16-bit paged protected mode BS3Kit library. 256 bs3kit-pev86_DEFS = TMPL_MODE=BS3_MODE_PEV86 257 bs3kit-pev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 258 259 260 # The 16-bit BS3Kit library for 16-bit paged protected kernel+tss. 237 261 LIBRARIES += bs3kit-pp16 238 262 bs3kit-pp16_TEMPLATE = VBoxBS3KitImg 239 263 bs3kit-pp16_INSTTYPE = none 240 bs3kit-pp16_DEFS = TMPL_ PP16264 bs3kit-pp16_DEFS = TMPL_MODE=BS3_MODE_PP16 241 265 bs3kit-pp16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 242 266 bs3-mode-CpuDetect.asm 243 267 244 # The 32-bit paged protected mode BS3Kit library. 268 # The 32-bit BS3Kit library for 16-bit paged protected kernel+tss. 269 LIBRARIES += bs3kit-pp16_32 270 bs3kit-pp16_32_TEMPLATE = VBoxBS3KitImg32 271 bs3kit-pp16_32_INSTTYPE = none 272 bs3kit-pp16_32_DEFS = TMPL_MODE=BS3_MODE_PP16_32 273 bs3kit-pp16_32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 274 275 # The v8086 BS3Kit library for 16-bit paged protected kernel+tss. 276 LIBRARIES += bs3kit-pp16_v86 277 bs3kit-pp16_v86_TEMPLATE = VBoxBS3KitImg 278 bs3kit-pp16_v86_INSTTYPE = none 279 bs3kit-pp16_v86_DEFS = TMPL_MODE=BS3_MODE_PP16_V86 280 bs3kit-pp16_v86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 281 282 # The 32-bit BS3Kit library for 32-bit paged protected kernel+tss. 245 283 LIBRARIES += bs3kit-pp32 246 284 bs3kit-pp32_TEMPLATE = VBoxBS3KitImg32 247 285 bs3kit-pp32_INSTTYPE = none 248 bs3kit-pp32_DEFS = TMPL_ PP32286 bs3kit-pp32_DEFS = TMPL_MODE=BS3_MODE_PP32 249 287 bs3kit-pp32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 250 288 251 # The virtual 8086 under protected mode BS3Kit library. 289 # The 16-bit BS3Kit library for 32-bit paged protected kernel+tss. 290 LIBRARIES += bs3kit-pp32_16 291 bs3kit-pp32_16_TEMPLATE = VBoxBS3KitImg 292 bs3kit-pp32_16_INSTTYPE = none 293 bs3kit-pp32_16_DEFS = TMPL_MODE=BS3_MODE_PP32_16 294 bs3kit-pp32_16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 295 296 # The v8086 BS3Kit library for 32-bit paged protected kernel+tss. 252 297 LIBRARIES += bs3kit-ppv86 253 298 bs3kit-ppv86_TEMPLATE = VBoxBS3KitImg 254 299 bs3kit-ppv86_INSTTYPE = none 255 bs3kit-ppv86_DEFS = TMPL_ PPV86256 bs3kit-ppv86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \257 258 259 # The 16-bit paged protected mode BS3Kit library.300 bs3kit-ppv86_DEFS = TMPL_MODE=BS3_MODE_PPV86 301 bs3kit-ppv86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 302 303 304 # The 16-bit BS3Kit library for 16-bit PAE paged protected kernel+tss. 260 305 LIBRARIES += bs3kit-pae16 261 306 bs3kit-pae16_TEMPLATE = VBoxBS3KitImg 262 307 bs3kit-pae16_INSTTYPE = none 263 bs3kit-pae16_DEFS = TMPL_ PAE16308 bs3kit-pae16_DEFS = TMPL_MODE=BS3_MODE_PAE16 264 309 bs3kit-pae16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \ 265 310 bs3-mode-CpuDetect.asm 266 311 267 # The 32-bit paged protected mode BS3Kit library. 312 # The 16-bit BS3Kit library for 16-bit PAE paged protected kernel+tss. 313 LIBRARIES += bs3kit-pae16_32 314 bs3kit-pae16_32_TEMPLATE = VBoxBS3KitImg32 315 bs3kit-pae16_32_INSTTYPE = none 316 bs3kit-pae16_32_DEFS = TMPL_MODE=BS3_MODE_PAE16_32 317 bs3kit-pae16_32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 318 319 # The v8086 BS3Kit library for 16-bit PAE paged protected kernel+tss. 320 LIBRARIES += bs3kit-pae16_v86 321 bs3kit-pae16_v86_TEMPLATE = VBoxBS3KitImg 322 bs3kit-pae16_v86_INSTTYPE = none 323 bs3kit-pae16_v86_DEFS = TMPL_MODE=BS3_MODE_PAE16_V86 324 bs3kit-pae16_v86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 325 326 # The 32-bit BS3Kit library for 32-bit PAE paged protected kernel+tss. 268 327 LIBRARIES += bs3kit-pae32 269 328 bs3kit-pae32_TEMPLATE = VBoxBS3KitImg32 270 329 bs3kit-pae32_INSTTYPE = none 271 bs3kit-pae32_DEFS = TMPL_ PAE32330 bs3kit-pae32_DEFS = TMPL_MODE=BS3_MODE_PAE32 272 331 bs3kit-pae32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 273 332 274 # The virtual 8086 under protected mode BS3Kit library. 333 # The 16-bit BS3Kit library for 32-bit PAE paged protected kernel+tss. 334 LIBRARIES += bs3kit-pae32_16 335 bs3kit-pae32_16_TEMPLATE = VBoxBS3KitImg 336 bs3kit-pae32_16_INSTTYPE = none 337 bs3kit-pae32_16_DEFS = TMPL_MODE=BS3_MODE_PAE32_16 338 bs3kit-pae32_16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 339 340 # The v8086 BS3Kit library for 32-bit PAE paged protected kernel+tss. 275 341 LIBRARIES += bs3kit-paev86 276 342 bs3kit-paev86_TEMPLATE = VBoxBS3KitImg 277 343 bs3kit-paev86_INSTTYPE = none 278 bs3kit-paev86_DEFS = TMPL_ PAEV86279 bs3kit-paev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \344 bs3kit-paev86_DEFS = TMPL_MODE=BS3_MODE_PAEV86 345 bs3kit-paev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 280 346 281 347 … … 284 350 bs3kit-lm16_TEMPLATE = VBoxBS3KitImg 285 351 bs3kit-lm16_INSTTYPE = none 286 bs3kit-lm16_DEFS = TMPL_ LM16287 bs3kit-lm16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \352 bs3kit-lm16_DEFS = TMPL_MODE=BS3_MODE_LM16 353 bs3kit-lm16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 288 354 289 355 # The 32-bit long mode BS3Kit library. … … 291 357 bs3kit-lm32_TEMPLATE = VBoxBS3KitImg32 292 358 bs3kit-lm32_INSTTYPE = none 293 bs3kit-lm32_DEFS = TMPL_ LM32294 bs3kit-lm32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \359 bs3kit-lm32_DEFS = TMPL_MODE=BS3_MODE_LM32 360 bs3kit-lm32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) 295 361 296 362 # The 64-bit long mode BS3Kit library. … … 298 364 bs3kit-lm64-asm_TEMPLATE = VBoxBS3KitImg64 299 365 bs3kit-lm64-asm_INSTTYPE = none 300 bs3kit-lm64-asm_DEFS = TMPL_ LM64301 bs3kit-lm64-asm_SOURCES = $(filter %.asm,$(VBOX_BS3KIT_MODE_SOURCES)) \366 bs3kit-lm64-asm_DEFS = TMPL_MODE=BS3_MODE_LM64 367 bs3kit-lm64-asm_SOURCES = $(filter %.asm,$(VBOX_BS3KIT_MODE_SOURCES)) 302 368 303 369 # The 64-bit long mode BS3Kit library. … … 305 371 bs3kit-lm64-c_TEMPLATE = VBoxBS3KitImg64 306 372 bs3kit-lm64-c_INSTTYPE = none 307 bs3kit-lm64-c_DEFS = TMPL_ LM64308 bs3kit-lm64-c_SOURCES = $(filter-out %.asm, $(VBOX_BS3KIT_MODE_SOURCES)) \373 bs3kit-lm64-c_DEFS = TMPL_MODE=BS3_MODE_LM64 374 bs3kit-lm64-c_SOURCES = $(filter-out %.asm, $(VBOX_BS3KIT_MODE_SOURCES)) 309 375 310 376 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo16Bit.asm
r59287 r59863 26 26 27 27 %include "bs3kit-template-header.mac" 28 29 %if TMPL_BITS != 16 30 BS3_EXTERN_DATA16 g_bBs3CurrentMode 31 TMPL_BEGIN_TEXT 32 %endif 33 28 34 29 35 ;; … … 62 68 mov es, ax 63 69 70 ; Update globals. 71 and byte [g_bBs3CurrentMode], ~BS3_MODE_CODE_MASK 72 or byte [g_bBs3CurrentMode], BS3_MODE_CODE_16 73 64 74 popfd 65 75 %if TMPL_BITS == 64 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo32Bit.asm
r59287 r59863 26 26 27 27 %include "bs3kit-template-header.mac" 28 29 30 %if TMPL_BITS != 32 31 BS3_EXTERN_DATA16 g_bBs3CurrentMode 32 TMPL_BEGIN_TEXT 33 %endif 34 28 35 29 36 ;; … … 72 79 mov es, ax 73 80 81 ; Update globals. 82 and byte [g_bBs3CurrentMode], ~BS3_MODE_CODE_MASK 83 or byte [g_bBs3CurrentMode], BS3_MODE_CODE_32 84 74 85 %if TMPL_BITS == 16 75 86 ; Adjust the return address. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo64Bit.asm
r59287 r59863 27 27 %include "bs3kit-template-header.mac" 28 28 29 %ifndef TMPL_CMN_LM 29 %if TMPL_BITS != 64 30 BS3_EXTERN_DATA16 g_bBs3CurrentMode 31 TMPL_BEGIN_TEXT 32 %endif 33 30 34 31 35 ;; … … 35 39 ; 36 40 BS3_PROC_BEGIN_CMN Bs3SwitchTo64Bit 37 41 %if TMPL_BITS == 64 38 42 ret 43 %else 44 %if TMPL_BITS == 16 45 sub sp, 6 ; Space for extended return value (corrected in 64-bit mode). 39 46 %else 40 %if TMPL_BITS == 1641 sub sp, 6 ; Space for extended return value (corrected in 64-bit mode).42 %else43 47 push xPRE [xSP] ; Duplicate the return address. 44 48 and dword [xSP + xCB], 0 ; Clear the high dword or it. 45 49 %endif 46 50 push dword 0 47 51 push sAX … … 58 62 ; setup far return. 59 63 push sAX 60 64 %if TMPL_BITS == 16 61 65 push dword .sixty_four_bit 62 66 o32 retf 63 67 %else 64 68 push .sixty_four_bit 65 69 retf 66 70 %endif 67 71 68 72 BS3_SET_BITS 64 … … 75 79 mov es, ax 76 80 77 %if TMPL_BITS == 16 81 ; Update globals. 82 and byte [BS3_WRT_RIP(g_bBs3CurrentMode)], ~BS3_MODE_CODE_MASK 83 or byte [BS3_WRT_RIP(g_bBs3CurrentMode)], BS3_MODE_CODE_64 84 85 %if TMPL_BITS == 16 78 86 movzx eax, word [rsp + 8*2+6] 79 87 add eax, BS3_ADDR_BS3TEXT16 80 88 mov [rsp + 8*2], rax 81 89 %endif 82 90 83 91 popfq 84 92 pop rax 85 93 ret 86 94 %endif 87 95 BS3_PROC_END_CMN Bs3SwitchTo64Bit 88 96 89 %endif90 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestData.c
r59237 r59863 42 42 43 43 /** The number of tests that have failed. */ 44 uint16_t g_ uscBs3TestErrors = 0;44 uint16_t g_cusBs3TestErrors = 0; 45 45 46 46 /** The start error count of the current subtest. */ 47 uint16_t g_ uscBs3SubTestAtErrors = 0;47 uint16_t g_cusBs3SubTestAtErrors = 0; 48 48 49 49 /** Whether we've reported the sub-test result or not. */ … … 51 51 52 52 /** The number of sub tests. */ 53 uint16_t g_ uscBs3SubTests = 0;53 uint16_t g_cusBs3SubTests = 0; 54 54 55 55 /** The number of sub tests that failed. */ 56 uint16_t g_ uscBs3SubTestsFailed = 0;56 uint16_t g_cusBs3SubTestsFailed = 0; 57 57 58 58 /** VMMDEV_TESTING_UNIT_XXX -> string */ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestInit.c
r58675 r59863 43 43 BS3_CMN_NM(g_pszBs3Test) = pszTest; 44 44 BS3_CMN_NM(g_pszBs3SubTest) = NULL; 45 g_ uscBs3TestErrors = 0;46 g_ uscBs3SubTestAtErrors = 0;45 g_cusBs3TestErrors = 0; 46 g_cusBs3SubTestAtErrors = 0; 47 47 g_fbBs3SubTestReported = true; 48 g_ uscBs3SubTests = 0;49 g_ uscBs3SubTestsFailed = 0;48 g_cusBs3SubTests = 0; 49 g_cusBs3SubTestsFailed = 0; 50 50 g_fbBs3VMMDevTesting = bs3TestIsVmmDevTestingPresent(); 51 51 … … 59 59 * Report it to the VMMDev. 60 60 */ 61 bs3TestSend StrCmd(VMMDEV_TESTING_CMD_INIT, pszTest);61 bs3TestSendCmdWithStr(VMMDEV_TESTING_CMD_INIT, pszTest); 62 62 } 63 63 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSendCmdWithStr.asm
r59827 r59863 32 32 33 33 ;; 34 ; @cproto BS3_DECL(void) bs3TestSend StrCmd_c16(uint32_t uCmd, const char BS3_FAR *pszString);34 ; @cproto BS3_DECL(void) bs3TestSendCmdWithStr_c16(uint32_t uCmd, const char BS3_FAR *pszString); 35 35 ; 36 BS3_PROC_BEGIN_CMN bs3TestSend StrCmd36 BS3_PROC_BEGIN_CMN bs3TestSendCmdWithStr 37 37 BS3_CALL_CONV_PROLOG 2 38 38 push xBP … … 48 48 ; The command (uCmd). 49 49 mov dx, VMMDEV_TESTING_IOPORT_CMD 50 mov eax, [xBP + xCB ]50 mov eax, [xBP + xCB*2] 51 51 out dx, eax 52 52 … … 54 54 mov dx, VMMDEV_TESTING_IOPORT_DATA 55 55 %ifdef TMPL_16BIT 56 lds si, [xBP + xCB + sCB]56 lds si, [xBP + xCB*2 + sCB] 57 57 %else 58 mov xSI, [xBP + xCB + sCB]58 mov xSI, [xBP + xCB*2 + sCB] 59 59 %endif 60 60 .next_char: … … 72 72 BS3_CALL_CONV_EPILOG 2 73 73 ret 74 BS3_PROC_END_CMN bs3TestSend StrCmd74 BS3_PROC_END_CMN bs3TestSendCmdWithStr 75 75 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-test.h
r58675 r59863 36 36 37 37 /** The number of tests that have failed. */ 38 extern uint16_t g_ uscBs3TestErrors;38 extern uint16_t g_cusBs3TestErrors; 39 39 40 40 /** The start error count of the current subtest. */ 41 extern uint16_t g_ uscBs3SubTestAtErrors;41 extern uint16_t g_cusBs3SubTestAtErrors; 42 42 43 43 /** Whether we've reported the sub-test result or not. */ … … 45 45 46 46 /** The number of sub tests. */ 47 extern uint16_t g_ uscBs3SubTests;47 extern uint16_t g_cusBs3SubTests; 48 48 49 49 /** The number of sub tests that failed. */ 50 extern uint16_t g_ uscBs3SubTestsFailed;50 extern uint16_t g_cusBs3SubTestsFailed; 51 51 52 52 /** VMMDEV_TESTING_UNIT_XXX -> string */ … … 69 69 * do nothing. 70 70 * 71 * @param uCmd The command.72 * @param pszString The string.71 * @param uCmd The command. 72 * @param pszString The string. 73 73 */ 74 BS3_DECL(void) bs3TestSendStrCmd_c16(uint32_t uCmd, const char BS3_FAR *pszString); 75 BS3_DECL(void) bs3TestSendStrCmd_c32(uint32_t uCmd, const char BS3_FAR *pszString); /**< @copydoc bs3TestSendStrCmd_c16 */ 76 BS3_DECL(void) bs3TestSendStrCmd_c64(uint32_t uCmd, const char BS3_FAR *pszString); /**< @copydoc bs3TestSendStrCmd_c16 */ 77 #define bs3TestSendStrCmd BS3_CMN_NM(bs3TestSendStrCmd) /**< Selects #bs3TestSendStrCmd_c16, #bs3TestSendStrCmd_c32 or #bs3TestSendStrCmd_c64. */ 74 BS3_DECL(void) bs3TestSendCmdWithStr_c16(uint32_t uCmd, const char BS3_FAR *pszString); 75 BS3_DECL(void) bs3TestSendCmdWithStr_c32(uint32_t uCmd, const char BS3_FAR *pszString); /**< @copydoc bs3TestSendCmdWithStr_c16 */ 76 BS3_DECL(void) bs3TestSendCmdWithStr_c64(uint32_t uCmd, const char BS3_FAR *pszString); /**< @copydoc bs3TestSendCmdWithStr_c16 */ 77 #define bs3TestSendCmdWithStr BS3_CMN_NM(bs3TestSendCmdWithStr) /**< Selects #bs3TestSendCmdWithStr_c16, #bs3TestSendCmdWithStr_c32 or #bs3TestSendCmdWithStr_c64. */ 78 79 /** 80 * Sends a command to VMMDev followed by a 32-bit unsigned integer value. 81 * 82 * If the VMMDev is not present or is not being used, this function will 83 * do nothing. 84 * 85 * @param uCmd The command. 86 * @param uValue The value. 87 */ 88 BS3_DECL(void) bs3TestSendCmdWithU32_c16(uint32_t uCmd, uint32_t uValue); 89 BS3_DECL(void) bs3TestSendCmdWithU32_c32(uint32_t uCmd, uint32_t uValue); /**< @copydoc bs3TestSendCmdWithU32_c16 */ 90 BS3_DECL(void) bs3TestSendCmdWithU32_c64(uint32_t uCmd, uint32_t uValue); /**< @copydoc bs3TestSendCmdWithU32_c16 */ 91 #define bs3TestSendCmdWithU32 BS3_CMN_NM(bs3TestSendCmdWithU32) /**< Selects #bs3TestSendCmdWithU32_c16, #bs3TestSendCmdWithU32_c32 or #bs3TestSendCmdWithU32_c64. */ 78 92 79 93 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-rm.asm
r58812 r59863 38 38 EXTERN Main_rm 39 39 BS3_EXTERN_CMN Bs3Shutdown 40 push word 0 ; zero return address. 41 push word 0 ; zero caller BP 42 mov bp, sp 40 43 41 ;42 ; Nothing to init here, just call main and shutdown if it returns.43 ;44 mov ax, BS3DATA1645 mov es, ax46 mov ds, ax47 call NAME(Main_rm)48 call Bs3Shutdown44 ; 45 ; Nothing to init here, just call main and shutdown if it returns. 46 ; 47 mov ax, BS3DATA16 48 mov es, ax 49 mov ds, ax 50 call NAME(Main_rm) 51 call Bs3Shutdown 49 52 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-EnteredMode.asm
r59287 r59863 27 27 %include "bs3kit-template-header.mac" 28 28 29 BS3_EXTERN_DATA16 g_bBs3CurrentMode 30 TMPL_BEGIN_TEXT 29 31 30 32 ;; … … 39 41 mov xBP, xSP 40 42 push xAX 41 %if TMPL_BITS == 6443 %if BS3_MODE_IS_64BIT_CODE(TMPL_MODE) 42 44 push rcx 43 45 push rdx … … 49 51 ; Load stack selector (not always necessary) and sometimes CS too. 50 52 ; 51 %if def TMPL_RM53 %if BS3_MODE_IS_RM_SYS(TMPL_MODE) 52 54 xor ax, ax 53 %elif def TMPL_CMN_V8655 %elif BS3_MODE_IS_V86(TMPL_MODE) 54 56 extern v86_versions_of_Bs3EnteredMode_should_not_be_dragged_into_the_link 55 57 call v86_versions_of_Bs3EnteredMode_should_not_be_dragged_into_the_link 56 %elif TMPL_BITS == 1658 %elif BS3_MODE_IS_16BIT_CODE(TMPL_MODE) 57 59 jmp BS3_SEL_R0_CS16:.reloaded_cs 58 60 .reloaded_cs: 59 61 mov ax, BS3_SEL_R0_SS16 60 %elif TMPL_BITS == 3262 %elif BS3_MODE_IS_32BIT_CODE(TMPL_MODE) 61 63 mov ax, BS3_SEL_R0_SS32 62 %elif TMPL_BITS == 6464 %elif BS3_MODE_IS_64BIT_CODE(TMPL_MODE) 63 65 mov ax, BS3_SEL_R0_DS64 64 66 %else 65 %error "TMPL_ BITS"67 %error "TMPL_MODE" 66 68 %endif 67 69 mov ss, ax … … 70 72 ; Load selector appropriate for accessing BS3SYSTEM16 data. 71 73 ; 72 %if TMPL_BITS == 1674 %if BS3_MODE_IS_16BIT_CODE(TMPL_MODE) 73 75 mov ax, BS3_SEL_SYSTEM16 74 76 %else … … 81 83 ; Always 64-bit in long mode, otherwise according to TMPL_BITS. 82 84 ; 83 %if def TMPL_CMN_R8685 %if BS3_MODE_IS_RM_SYS(TMPL_MODE) 84 86 BS3_EXTERN_SYSTEM16 Bs3Lidt_Ivt 85 87 TMPL_BEGIN_TEXT 86 88 lidt [Bs3Lidt_Ivt] 87 %elifdef TMPL_CMN_LM 89 90 %elif BS3_MODE_IS_16BIT_SYS(TMPL_MODE) 91 BS3_EXTERN_SYSTEM16 Bs3Lidt_Idt16 92 TMPL_BEGIN_TEXT 93 lidt [Bs3Lidt_Idt16 TMPL_WRT_SYSTEM16_OR_FLAT] 94 95 %elif BS3_MODE_IS_32BIT_SYS(TMPL_MODE) 96 BS3_EXTERN_SYSTEM16 Bs3Lidt_Idt32 97 TMPL_BEGIN_TEXT 98 lidt [Bs3Lidt_Idt32 TMPL_WRT_SYSTEM16_OR_FLAT] 99 100 %elif BS3_MODE_IS_64BIT_SYS(TMPL_MODE) 88 101 BS3_EXTERN_SYSTEM16 Bs3Lidt_Idt64 89 102 TMPL_BEGIN_TEXT 90 103 lidt [Bs3Lidt_Idt64 TMPL_WRT_SYSTEM16_OR_FLAT] 91 104 %else 92 BS3_EXTERN_SYSTEM16 RT_CONCAT(Bs3Lidt_Idt,TMPL_BITS) 93 TMPL_BEGIN_TEXT 94 lidt [RT_CONCAT(Bs3Lidt_Idt,TMPL_BITS) TMPL_WRT_SYSTEM16_OR_FLAT] 95 %endif 96 97 %ifndef TMPL_CMN_R86 105 %error "TMPL_MODE" 106 %endif 107 108 %if !BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 98 109 ; 99 110 ; Load the appropriate task selector. … … 101 112 ; 102 113 mov ax, X86DESCGENERIC_BIT_OFF_TYPE + 1 ; For clearing the busy bit in the TSS descriptor type. 103 %if def TMPL_CMN_LM114 %if BS3_MODE_IS_64BIT_SYS(TMPL_MODE) 104 115 BS3_EXTERN_SYSTEM16 Bs3Gdte_Tss64 105 116 TMPL_BEGIN_TEXT … … 107 118 mov ax, BS3_SEL_TSS64 108 119 109 %elif TMPL_BITS == 16120 %elif BS3_MODE_IS_16BIT_SYS(TMPL_MODE) 110 121 BS3_EXTERN_SYSTEM16 Bs3Gdte_Tss16 111 122 BS3_EXTERN_SYSTEM16 Bs3Gdte_Tss16DoubleFault … … 115 126 mov ax, BS3_SEL_TSS16 116 127 117 %elif TMPL_BITS == 32128 %elif BS3_MODE_IS_32BIT_SYS(TMPL_MODE) 118 129 BS3_EXTERN_SYSTEM16 Bs3Gdte_Tss32 119 130 BS3_EXTERN_SYSTEM16 Bs3Gdte_Tss32DoubleFault … … 128 139 mov ax, BS3_SEL_TSS32 129 140 %else 130 %error "TMPL_BITS"141 %error "TMPL_BITS" 131 142 %endif 132 143 ltr ax 133 144 %endif ; !TMPL_CMN_R86 134 145 135 %if ndef TMPL_CMN_R86146 %if !BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 136 147 ; 137 148 ; Load the LDT. … … 153 164 154 165 ; 166 ; Set global indicating CPU mode. 167 ; 168 mov byte [BS3_WRT_RIP(g_bBs3CurrentMode)], TMPL_MODE 169 170 ; 155 171 ; Install system call handler. 156 172 ; Always 64-bit in long mode, otherwise according to TMPL_BITS. 157 173 ; 158 %ifdef TMPL_CMN_RM 159 mov word [ss: BS3_TRAP_SYSCALL*4], TMPL_NM(Bs3TrapSystemCallHandler) wrt BS3TEXT16 174 %if BS3_MODE_IS_RM_SYS(TMPL_MODE) 175 extern _Bs3TrapSystemCallHandler_rm 176 mov word [ss: BS3_TRAP_SYSCALL*4], _Bs3TrapSystemCallHandler_rm wrt BS3TEXT16 160 177 mov word [ss: BS3_TRAP_SYSCALL*4 + 2], BS3TEXT16 161 %elifdef TMPL_CMN_LM 178 179 %elif BS3_MODE_IS_16BIT_SYS(TMPL_MODE) 180 BS3_EXTERN_CMN Bs3Trap16SetGate 181 extern TMPL_NM(Bs3TrapSystemCallHandler) 182 BS3_BEGIN_TEXT16 183 TMPL_BEGIN_TEXT 184 push 0 ; cParams 185 push TMPL_NM(Bs3TrapSystemCallHandler) wrt BS3TEXT16 186 push BS3_SEL_R0_CS16 187 push 3 ; DPL 188 push X86_SEL_TYPE_SYS_286_INT_GATE 189 push BS3_TRAP_SYSCALL 190 BS3_CALL Bs3Trap16SetGate,6 191 add xSP, xCB * 6 192 193 %elif BS3_MODE_IS_32BIT_SYS(TMPL_MODE) 194 BS3_EXTERN_CMN Bs3Trap32SetGate 195 extern TMPL_NM(Bs3TrapSystemCallHandler) 196 TMPL_BEGIN_TEXT 197 push 0 ; cParams 198 push dword TMPL_NM(Bs3TrapSystemCallHandler) wrt FLAT 199 push BS3_SEL_R0_CS32 200 push 3 ; DPL 201 push X86_SEL_TYPE_SYS_386_INT_GATE 202 push BS3_TRAP_SYSCALL 203 BS3_CALL Bs3Trap32SetGate,6 204 add xSP, xCB * 6 205 206 %elif BS3_MODE_IS_64BIT_SYS(TMPL_MODE) 162 207 BS3_EXTERN_CMN Bs3Trap64SetGate 163 208 extern Bs3TrapSystemCallHandler_lm64 164 209 TMPL_BEGIN_TEXT 165 210 push 0 ; bIst 166 %if def TMPL_64BIT211 %if BS3_MODE_IS_64BIT_CODE(TMPL_MODE) 167 212 push Bs3TrapSystemCallHandler_lm64 wrt FLAT 168 213 %else … … 176 221 BS3_CALL Bs3Trap64SetGate,6 177 222 add xSP, xCB * 5 + 8 178 179 %elif TMPL_BITS == 16180 BS3_EXTERN_CMN Bs3Trap16SetGate181 extern TMPL_NM(Bs3TrapSystemCallHandler)182 TMPL_BEGIN_TEXT183 push 0 ; cParams184 push TMPL_NM(Bs3TrapSystemCallHandler) wrt BS3TEXT16185 push BS3_SEL_R0_CS16186 push 3 ; DPL187 push X86_SEL_TYPE_SYS_286_INT_GATE188 push BS3_TRAP_SYSCALL189 BS3_CALL Bs3Trap16SetGate,6190 add xSP, xCB * 6191 192 %elif TMPL_BITS == 32193 BS3_EXTERN_CMN Bs3Trap32SetGate194 extern TMPL_NM(Bs3TrapSystemCallHandler)195 TMPL_BEGIN_TEXT196 push 0 ; cParams197 push TMPL_NM(Bs3TrapSystemCallHandler) wrt FLAT198 push BS3_SEL_R0_CS32199 push 3 ; DPL200 push X86_SEL_TYPE_SYS_386_INT_GATE201 push BS3_TRAP_SYSCALL202 BS3_CALL Bs3Trap32SetGate,6203 add xSP, xCB * 6204 223 %else 205 224 %error "TMPL_BITS" -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToRM.asm
r59287 r59863 34 34 ; Switch to real mode from any other mode. 35 35 ; 36 ; @cproto BS3_DECL(void) Bs3SwitchToR ealMode(void);36 ; @cproto BS3_DECL(void) Bs3SwitchToRM(void); 37 37 ; 38 38 ; @uses Nothing (except high 32-bit register parts). -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-footer.h
r59311 r59863 5 5 6 6 /* 7 * Copyright (C) 2007-201 5Oracle Corporation7 * Copyright (C) 2007-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 32 32 #undef TMPL_RM 33 33 #undef TMPL_PE16 34 #undef TMPL_PE16_32 35 #undef TMPL_PE16_V86 34 36 #undef TMPL_PE32 37 #undef TMPL_PE32_16 35 38 #undef TMPL_PEV86 36 39 #undef TMPL_PP16 40 #undef TMPL_PP16_32 41 #undef TMPL_PP16_V86 37 42 #undef TMPL_PP32 43 #undef TMPL_PP32_16 38 44 #undef TMPL_PPV86 39 45 #undef TMPL_PAE16 46 #undef TMPL_PAE16_32 47 #undef TMPL_PAE16_V86 40 48 #undef TMPL_PAE32 49 #undef TMPL_PAE32_16 41 50 #undef TMPL_PAEV86 42 51 #undef TMPL_LM16 … … 45 54 46 55 #undef TMPL_CMN_PE 56 #undef TMPL_SYS_PE16 57 #undef TMPL_SYS_PE32 47 58 #undef TMPL_CMN_PP 59 #undef TMPL_SYS_PP16 60 #undef TMPL_SYS_PP32 48 61 #undef TMPL_CMN_PAE 62 #undef TMPL_SYS_PAE16 63 #undef TMPL_SYS_PAE32 49 64 #undef TMPL_CMN_LM 50 65 #undef TMPL_CMN_V86 66 #undef TMPL_CMN_R86 51 67 #undef TMPL_CMN_PAGING 68 #undef TMPL_CMN_WEIRD 69 #undef TMPL_CMN_WEIRD_V86 52 70 53 #undef TMPL_CMN_P1654 #undef TMPL_CMN_P3255 #undef TMPL_CMN_P6456 #undef TMPL_CMN_R1657 71 #undef TMPL_CMN_R86 58 72 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-footer.mac
r59311 r59863 42 42 %undef TMPL_RM 43 43 %undef TMPL_PE16 44 %undef TMPL_PE16_32 45 %undef TMPL_PE16_V86 44 46 %undef TMPL_PE32 47 %undef TMPL_PE32_16 45 48 %undef TMPL_PEV86 46 49 %undef TMPL_PP16 50 %undef TMPL_PP16_32 51 %undef TMPL_PP16_V86 47 52 %undef TMPL_PP32 53 %undef TMPL_PP32_16 48 54 %undef TMPL_PPV86 49 55 %undef TMPL_PAE16 56 %undef TMPL_PAE16_32 57 %undef TMPL_PAE16_V86 50 58 %undef TMPL_PAE32 59 %undef TMPL_PAE32_16 51 60 %undef TMPL_PAEV86 52 61 %undef TMPL_LM16 … … 55 64 56 65 %undef TMPL_CMN_PE 66 %undef TMPL_SYS_PE16 67 %undef TMPL_SYS_PE32 57 68 %undef TMPL_CMN_PP 69 %undef TMPL_SYS_PP16 70 %undef TMPL_SYS_PP32 58 71 %undef TMPL_CMN_PAE 72 %undef TMPL_SYS_PAE16 73 %undef TMPL_SYS_PAE32 59 74 %undef TMPL_CMN_LM 60 75 %undef TMPL_CMN_V86 76 %undef TMPL_CMN_R86 61 77 %undef TMPL_CMN_PAGING 78 %undef TMPL_CMN_WEIRD 79 %undef TMPL_CMN_WEIRD_V86 62 80 63 %undef TMPL_CMN_P1664 %undef TMPL_CMN_P3265 %undef TMPL_CMN_P6466 %undef TMPL_CMN_R1667 81 %undef TMPL_CMN_R86 68 82 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-header.h
r59311 r59863 54 54 * 55 55 * @{ */ 56 # define TMPL_RM /**< real mode. */ 57 # define TMPL_PE16 /**< 16-bit protected mode, unpaged. */ 58 # define TMPL_PE32 /**< 32-bit protected mode, unpaged. */ 59 # define TMPL_PEV86 /**< virtual 8086 mode under protected mode, unpaged. */ 60 # define TMPL_PP16 /**< 16-bit protected mode, paged. */ 61 # define TMPL_PP32 /**< 32-bit protected mode, paged. */ 62 # define TMPL_PPV86 /**< virtual 8086 mode under protected mode, paged. */ 63 # define TMPL_PAE16 /**< 16-bit protected mode with PAE (paged). */ 64 # define TMPL_PAE32 /**< 16-bit protected mode with PAE (paged). */ 65 # define TMPL_PAEV86 /**< virtual 8086 mode under protected mode with PAE (paged). */ 66 # define TMPL_LM16 /**< 16-bit long mode (paged). */ 67 # define TMPL_LM32 /**< 32-bit long mode (paged). */ 68 # define TMPL_LM64 /**< 64-bit long mode (paged). */ 56 # define TMPL_RM /**< real mode. */ 57 58 # define TMPL_PE16 /**< 16-bit protected mode kernel+tss, running 16-bit code, unpaged. */ 59 # define TMPL_PE16_32 /**< 16-bit protected mode kernel+tss, running 32-bit code, unpaged. */ 60 # define TMPL_PE16_V86 /**< 16-bit protected mode kernel+tss, running virtual 8086 mode code, unpaged. */ 61 # define TMPL_PE32 /**< 32-bit protected mode kernel+tss, running 32-bit code, unpaged. */ 62 # define TMPL_PE32_16 /**< 32-bit protected mode kernel+tss, running 16-bit code, unpaged. */ 63 # define TMPL_PEV86 /**< 32-bit protected mode kernel+tss, running virtual 8086 mode code, unpaged. */ 64 65 # define TMPL_PP16 /**< 16-bit protected mode kernel+tss, running 16-bit code, paged. */ 66 # define TMPL_PP16_32 /**< 16-bit protected mode kernel+tss, running 32-bit code, paged. */ 67 # define TMPL_PP16_V86 /**< 16-bit protected mode kernel+tss, running virtual 8086 mode code, paged. */ 68 # define TMPL_PP32 /**< 32-bit protected mode kernel+tss, running 32-bit code, paged. */ 69 # define TMPL_PP32_16 /**< 32-bit protected mode kernel+tss, running 16-bit code, paged. */ 70 # define TMPL_PPV86 /**< 32-bit protected mode kernel+tss, running virtual 8086 mode code, paged. */ 71 72 # define TMPL_PAE16 /**< 16-bit protected mode kernel+tss, running 16-bit code, PAE paging. */ 73 # define TMPL_PAE16_32 /**< 16-bit protected mode kernel+tss, running 32-bit code, PAE paging. */ 74 # define TMPL_PAE16_V86 /**< 16-bit protected mode kernel+tss, running virtual 8086 mode code, PAE paging. */ 75 # define TMPL_PAE32 /**< 32-bit protected mode kernel+tss, running 32-bit code, PAE paging. */ 76 # define TMPL_PAE32_16 /**< 32-bit protected mode kernel+tss, running 16-bit code, PAE paging. */ 77 # define TMPL_PAEV86 /**< 32-bit protected mode kernel+tss, running virtual 8086 mode code, PAE paging. */ 78 79 # define TMPL_LM16 /**< 16-bit long mode (paged), kernel+tss always 64-bit. */ 80 # define TMPL_LM32 /**< 32-bit long mode (paged), kernel+tss always 64-bit. */ 81 # define TMPL_LM64 /**< 64-bit long mode (paged), kernel+tss always 64-bit. */ 69 82 /** @} */ 70 83 71 84 /** @name Derived Indicators 72 85 * @{ */ 73 # define TMPL_CMN_PE /**< TMPL_PE16 | TMPL_PE32 | TMPL_PEV86 */ 74 # define TMPL_CMN_PP /**< TMPL_PP16 | TMPL_PP32 | TMPL_PPV86 */ 75 # define TMPL_CMN_PAE /**< TMPL_PAE16 | TMPL_PAE32 | TMPL_PAEV86 */ 76 # define TMPL_CMN_LM /**< TMPL_LM16 | TMPL_LM32 | TMPL_LM64 */ 77 # define TMPL_CMN_V86 /**< TMPL_PEV86 | TMPL_PPV86 | TMPL_PAEV86 */ 78 # define TMPL_CMN_R86 /**< TMPL_CMN_V86 | TMPL_RM */ 79 # define TMPL_CMN_PAGING /**< TMPL_CMN_PP | TMPL_CMN_PAE | TMPL_CMN_LM */ 86 # define TMPL_CMN_PE /**< TMPL_PE16 | TMPL_PE16_32 | TMPL_PE16_V86 | TMPL_PE32 | TMPL_PE32_16 | TMPL_PEV86 */ 87 # define TMPL_SYS_PE16 /**< TMPL_PE16 | TMPL_PE16_32 | TMPL_PE16_V86 */ 88 # define TMPL_SYS_PE32 /**< TMPL_PE32 | TMPL_PE32_16 | TMPL_PEV86 */ 89 # define TMPL_CMN_PP /**< TMPL_PP16 | TMPL_PP16_32 | TMPL_PP16_V86 | TMPL_PP32 | TMPL_PP32_16 | TMPL_PPV86 */ 90 # define TMPL_SYS_PP16 /**< TMPL_PP16 | TMPL_PP16_32 | TMPL_PP16_V86 */ 91 # define TMPL_SYS_PP32 /**< TMPL_PP32 | TMPL_PP32_16 | TMPL_PPV86 */ 92 # define TMPL_CMN_PAE /**< TMPL_PAE16 | TMPL_PAE16_32 | TMPL_PAE16_V86 | TMPL_PAE32 | TMPL_PAE32_16 | TMPL_PAEV86 */ 93 # define TMPL_SYS_PAE16 /**< TMPL_PAE16 | TMPL_PAE16_32 | TMPL_PAE16_V86 */ 94 # define TMPL_SYS_PAE32 /**< TMPL_PAE32 | TMPL_PAE32_16 | TMPL_PAEV86 */ 95 # define TMPL_CMN_LM /**< TMPL_LM16 | TMPL_LM32 | TMPL_LM64 */ 96 # define TMPL_CMN_V86 /**< TMPL_PEV86 | TMPL_PE16_V86 | TMPL_PPV86 | TMPL_PP16_V86 | TMPL_PAEV86 | TMPL_PAE16_V86 */ 97 # define TMPL_CMN_R86 /**< TMPL_CMN_V86 | TMPL_RM */ 98 # define TMPL_CMN_PAGING /**< TMPL_CMN_PP | TMPL_CMN_PAE | TMPL_CMN_LM */ 99 # define TMPL_CMN_WEIRD /**< TMPL_PE16_32 | TMPL_PE32_16 | TMPL_PP16_32 | TMPL_PP32_16 | TMPL_PAE16_32 | TMPL_PAE32_16 | TMPL_CMN_WEIRD_V86 */ 100 # define TMPL_CMN_WEIRD_V86 /**< TMPL_PE16_V86 | TMPL_PP16_V86 | TMPL_PAE16_V86 */ 80 101 /** @} */ 81 102 … … 119 140 #undef BS3_CMN_NM 120 141 121 #ifdef TMPL_RM 122 # ifdef TMPL_PE16 123 # error "Both 'TMPL_RM' and 'TMPL_PE16' are defined." 142 143 /* 144 * Convert TMPL_XXX to TMPL_MODE. 145 */ 146 #ifndef TMPL_MODE 147 # ifdef TMPL_RM 148 # define TMPL_MODE BS3_MODE_RM 149 # elif defined(TMPL_PE16) 150 # define TMPL_MODE BS3_MODE_PE16 151 # elif defined(TMPL_PE16_32) 152 # define TMPL_MODE BS3_MODE_PE16_32 153 # elif defined(TMPL_PE16_V86) 154 # define TMPL_MODE BS3_MODE_PE16_V86 155 # elif defined(TMPL_PE32) 156 # define TMPL_MODE BS3_MODE_PE32 157 # elif defined(TMPL_PE32_16) 158 # define TMPL_MODE BS3_MODE_PE32_16 159 # elif defined(TMPL_PEV86) 160 # define TMPL_MODE BS3_MODE_PEV86 161 # elif defined(TMPL_PP16) 162 # define TMPL_MODE BS3_MODE_PP16 163 # elif defined(TMPL_PP16_32) 164 # define TMPL_MODE BS3_MODE_PP16_32 165 # elif defined(TMPL_PP16_V86) 166 # define TMPL_MODE BS3_MODE_PP16_V86 167 # elif defined(TMPL_PP32) 168 # define TMPL_MODE BS3_MODE_PP32 169 # elif defined(TMPL_PP32_16) 170 # define TMPL_MODE BS3_MODE_PP32_16 171 # elif defined(TMPL_PPV86) 172 # define TMPL_MODE BS3_MODE_PPV86 173 # elif defined(TMPL_PAE16) 174 # define TMPL_MODE BS3_MODE_PAE16 175 # elif defined(TMPL_PAE16_32) 176 # define TMPL_MODE BS3_MODE_PAE16_32 177 # elif defined(TMPL_PAE16_V86) 178 # define TMPL_MODE BS3_MODE_PAE16_V86 179 # elif defined(TMPL_PAE32) 180 # define TMPL_MODE BS3_MODE_PAE32 181 # elif defined(TMPL_PAE32_16) 182 # define TMPL_MODE BS3_MODE_PAE32_16 183 # elif defined(TMPL_PAEV86) 184 # define TMPL_MODE BS3_MODE_PAEV86 185 # elif defined(TMPL_LM16) 186 # define TMPL_MODE BS3_MODE_LM16 187 # elif defined(TMPL_LM32) 188 # define TMPL_MODE BS3_MODE_LM32 189 # elif defined(TMPL_LM64) 190 # define TMPL_MODE BS3_MODE_LM64 191 # else 192 # error "Unable to to figure out the template mode." 124 193 # endif 125 # ifdef TMPL_PE32 126 # error "Both 'TMPL_RM' and 'TMPL_PE32' are defined." 127 # endif 128 # ifdef TMPL_PEV86 129 # error "Both 'TMPL_RM' and 'TMPL_PEV86' are defined." 130 # endif 131 # ifdef TMPL_PP16 132 # error "Both 'TMPL_RM' and 'TMPL_PP16' are defined." 133 # endif 134 # ifdef TMPL_PP32 135 # error "Both 'TMPL_RM' and 'TMPL_PP32' are defined." 136 # endif 137 # ifdef TMPL_PPV86 138 # error "Both 'TMPL_RM' and 'TMPL_PPV86' are defined." 139 # endif 140 # ifdef TMPL_PAE16 141 # error "Both 'TMPL_RM' and 'TMPL_PAE16' are defined." 142 # endif 143 # ifdef TMPL_PAE32 144 # error "Both 'TMPL_RM' and 'TMPL_PAE32' are defined." 145 # endif 146 # ifdef TMPL_PAEV86 147 # error "Both 'TMPL_RM' and 'TMPL_PAEV86' are defined." 148 # endif 149 # ifdef TMPL_LM16 150 # error "Both 'TMPL_RM' and 'TMPL_LM16' are defined." 151 # endif 152 # ifdef TMPL_LM32 153 # error "Both 'TMPL_RM' and 'TMPL_LM32' are defined." 154 # endif 155 # ifdef TMPL_LM64 156 # error "Both 'TMPL_RM' and 'TMPL_LM64' are defined." 157 # endif 194 #endif 195 196 197 /* 198 * Check the code bitness and set derived defines. 199 */ 200 #if (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_16 158 201 # if ARCH_BITS != 16 159 # error " TMPL_RMrequires ARCH_BITS to be 16."202 # error "BS3_MODE_CODE_16 requires ARCH_BITS to be 16." 160 203 # endif 161 204 # define TMPL_16BIT 162 205 # define TMPL_BITS 16 163 # define TMPL_ NM(Name) RT_CONCAT(Name,_rm)206 # define TMPL_UNDERSCORE _ 164 207 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 165 # define TMPL_MODE_STR "real mode" 208 209 #elif (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_32 210 # if ARCH_BITS != 32 211 # error "BS3_MODE_CODE_32 requires ARCH_BITS to be 32." 212 # endif 213 # define TMPL_32BIT 214 # define TMPL_BITS 32 215 # define TMPL_UNDERSCORE _ 216 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32) 217 218 #elif (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_V86 219 # if ARCH_BITS != 16 220 # error "BS3_MODE_CODE_V86 requires ARCH_BITS to be 16." 221 # endif 222 # define TMPL_16BIT 223 # define TMPL_BITS 16 224 # define TMPL_UNDERSCORE _ 225 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 226 # define TMPL_CMN_R86 227 # define TMPL_CMN_V86 228 229 #elif (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_64 230 # if ARCH_BITS != 64 231 # error "BS3_MODE_CODE_64 requires ARCH_BITS to be 64." 232 # endif 233 # define TMPL_64BIT 234 # define TMPL_BITS 64 235 # define TMPL_UNDERSCORE 236 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c64) 237 238 #else 239 # error "Invalid TMPL_MODE value!" 240 #endif 241 242 243 /* 244 * Check the system specific mask and set derived values. 245 */ 246 #if (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_RM 166 247 # define TMPL_HAVE_BIOS 167 248 # define TMPL_CMN_R86 168 #endif 169 170 #ifdef TMPL_PE16 171 # ifdef TMPL_RM 172 # error "Both 'TMPL_PE16' and 'TMPL_RM' are defined." 173 # endif 174 # ifdef TMPL_PE32 175 # error "Both 'TMPL_PE16' and 'TMPL_PE32' are defined." 176 # endif 177 # ifdef TMPL_PEV86 178 # error "Both 'TMPL_RM' and 'TMPL_PEV86' are defined." 179 # endif 180 # ifdef TMPL_PP16 181 # error "Both 'TMPL_PE16' and 'TMPL_PP16' are defined." 182 # endif 183 # ifdef TMPL_PP32 184 # error "Both 'TMPL_PE16' and 'TMPL_PP32' are defined." 185 # endif 186 # ifdef TMPL_PPV86 187 # error "Both 'TMPL_PE16' and 'TMPL_PPV86' are defined." 188 # endif 189 # ifdef TMPL_PAE16 190 # error "Both 'TMPL_PE16' and 'TMPL_PAE16' are defined." 191 # endif 192 # ifdef TMPL_PAE32 193 # error "Both 'TMPL_PE16' and 'TMPL_PAE32' are defined." 194 # endif 195 # ifdef TMPL_PAEV86 196 # error "Both 'TMPL_PE32' and 'TMPL_PAEV86' are defined." 197 # endif 198 # ifdef TMPL_LM16 199 # error "Both 'TMPL_PE16' and 'TMPL_LM16' are defined." 200 # endif 201 # ifdef TMPL_LM32 202 # error "Both 'TMPL_PE16' and 'TMPL_LM32' are defined." 203 # endif 204 # ifdef TMPL_LM64 205 # error "Both 'TMPL_PE16' and 'TMPL_LM64' are defined." 206 # endif 207 # if ARCH_BITS != 16 208 # error "TMPL_PE16 requires ARCH_BITS to be 16." 209 # endif 249 250 #elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PE16 251 # define TMPL_SYS_PE16 210 252 # define TMPL_CMN_PE 211 # define TMPL_CMN_P16 212 # define TMPL_16BIT 213 # define TMPL_BITS 16 214 # define TMPL_NM(Name) RT_CONCAT(Name,_pe16) 215 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 216 # define TMPL_MODE_STR "16-bit unpaged protected mode" 217 #endif 218 219 #ifdef TMPL_PE32 220 # ifdef TMPL_RM 221 # error "Both 'TMPL_PE32' and 'TMPL_RM' are defined." 222 # endif 223 # ifdef TMPL_PE16 224 # error "Both 'TMPL_PE32' and 'TMPL_PE16' are defined." 225 # endif 226 # ifdef TMPL_PEV86 227 # error "Both 'TMPL_PE32' and 'TMPL_PEV86' are defined." 228 # endif 229 # ifdef TMPL_PP16 230 # error "Both 'TMPL_PE32' and 'TMPL_PP16' are defined." 231 # endif 232 # ifdef TMPL_PP32 233 # error "Both 'TMPL_PE32' and 'TMPL_PP32' are defined." 234 # endif 235 # ifdef TMPL_PPV86 236 # error "Both 'TMPL_PE32' and 'TMPL_PPV86' are defined." 237 # endif 238 # ifdef TMPL_PAE16 239 # error "Both 'TMPL_PE32' and 'TMPL_PAE16' are defined." 240 # endif 241 # ifdef TMPL_PAE32 242 # error "Both 'TMPL_PE32' and 'TMPL_PAE32' are defined." 243 # endif 244 # ifdef TMPL_PAE86 245 # error "Both 'TMPL_PE32' and 'TMPL_PPV86' are defined." 246 # endif 247 # ifdef TMPL_LM16 248 # error "Both 'TMPL_PE32' and 'TMPL_LM16' are defined." 249 # endif 250 # ifdef TMPL_LM32 251 # error "Both 'TMPL_PE32' and 'TMPL_LM32' are defined." 252 # endif 253 # ifdef TMPL_LM64 254 # error "Both 'TMPL_PE32' and 'TMPL_LM64' are defined." 255 # endif 256 # if ARCH_BITS != 32 257 # error "TMPL_PE32 requires ARCH_BITS to be 32." 258 # endif 253 254 #elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PE32 255 # define TMPL_SYS_PE32 259 256 # define TMPL_CMN_PE 260 # define TMPL_CMN_P32 261 # define TMPL_32BIT 262 # define TMPL_BITS 32 263 # define TMPL_NM(Name) RT_CONCAT(Name,_pe32) 264 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32) 265 # define TMPL_MODE_STR "32-bit unpaged protected mode" 266 #endif 267 268 #ifdef TMPL_PEV86 269 # ifdef TMPL_RM 270 # error "Both 'TMPL_PEV86' and 'TMPL_RM' are defined." 271 # endif 272 # ifdef TMPL_PE16 273 # error "Both 'TMPL_PEV86' and 'TMPL_PE16' are defined." 274 # endif 275 # ifdef TMPL_PP32 276 # error "Both 'TMPL_PEV86' and 'TMPL_PP32' are defined." 277 # endif 278 # ifdef TMPL_PP16 279 # error "Both 'TMPL_PEV86' and 'TMPL_PP16' are defined." 280 # endif 281 # ifdef TMPL_PP32 282 # error "Both 'TMPL_PEV86' and 'TMPL_PP32' are defined." 283 # endif 284 # ifdef TMPL_PPV86 285 # error "Both 'TMPL_PEV86' and 'TMPL_PPV86' are defined." 286 # endif 287 # ifdef TMPL_PAE16 288 # error "Both 'TMPL_PEV86' and 'TMPL_PAE16' are defined." 289 # endif 290 # ifdef TMPL_PAE32 291 # error "Both 'TMPL_PEV86' and 'TMPL_PAE32' are defined." 292 # endif 293 # ifdef TMPL_PAE86 294 # error "Both 'TMPL_PEV86' and 'TMPL_PPV86' are defined." 295 # endif 296 # ifdef TMPL_LM16 297 # error "Both 'TMPL_PEV86' and 'TMPL_LM16' are defined." 298 # endif 299 # ifdef TMPL_LM32 300 # error "Both 'TMPL_PEV86' and 'TMPL_LM32' are defined." 301 # endif 302 # ifdef TMPL_LM64 303 # error "Both 'TMPL_PEV86' and 'TMPL_LM64' are defined." 304 # endif 305 # if ARCH_BITS != 16 306 # error "TMPL_PEV86 requires ARCH_BITS to be 16." 307 # endif 308 # define TMPL_CMN_PE 309 # define TMPL_CMN_V86 310 # define TMPL_CMN_R86 311 # define TMPL_16BIT 312 # define TMPL_BITS 16 313 # define TMPL_NM(Name) RT_CONCAT(Name,_pev86) 314 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 315 # define TMPL_MODE_STR "v8086 unpaged protected mode" 316 #endif 317 318 #ifdef TMPL_PP16 319 # ifdef TMPL_RM 320 # error "Both 'TMPL_PP16' and 'TMPL_RM' are defined." 321 # endif 322 # ifdef TMPL_PE16 323 # error "Both 'TMPL_PP16' and 'TMPL_PE16' are defined." 324 # endif 325 # ifdef TMPL_PE32 326 # error "Both 'TMPL_PP16' and 'TMPL_PE32' are defined." 327 # endif 328 # ifdef TMPL_PEV86 329 # error "Both 'TMPL_PP16' and 'TMPL_PEV86' are defined." 330 # endif 331 # ifdef TMPL_PP32 332 # error "Both 'TMPL_PP16' and 'TMPL_PP32' are defined." 333 # endif 334 # ifdef TMPL_PPV86 335 # error "Both 'TMPL_PP32' and 'TMPL_PPV86' are defined." 336 # endif 337 # ifdef TMPL_PAE16 338 # error "Both 'TMPL_PP16' and 'TMPL_PAE16' are defined." 339 # endif 340 # ifdef TMPL_PAE32 341 # error "Both 'TMPL_PP16' and 'TMPL_PAE32' are defined." 342 # endif 343 # ifdef TMPL_PAEV86 344 # error "Both 'TMPL_PP16' and 'TMPL_PAEV86' are defined." 345 # endif 346 # ifdef TMPL_LM16 347 # error "Both 'TMPL_PP16' and 'TMPL_LM16' are defined." 348 # endif 349 # ifdef TMPL_LM32 350 # error "Both 'TMPL_PP16' and 'TMPL_LM32' are defined." 351 # endif 352 # ifdef TMPL_LM64 353 # error "Both 'TMPL_PP16' and 'TMPL_LM64' are defined." 354 # endif 355 # if ARCH_BITS != 16 356 # error "TMPL_PP16 requires ARCH_BITS to be 16." 357 # endif 257 258 #elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PP16 259 # define TMPL_SYS_PP16 358 260 # define TMPL_CMN_PP 359 261 # define TMPL_CMN_PAGING 360 # define TMPL_CMN_P16 361 # define TMPL_16BIT 362 # define TMPL_BITS 16 363 # define TMPL_NM(Name) RT_CONCAT(Name,_pp16) 364 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 365 # define TMPL_MODE_STR "16-bit paged protected mode" 366 #endif 367 368 #ifdef TMPL_PP32 369 # ifdef TMPL_RM 370 # error "Both 'TMPL_PP32' and 'TMPL_RM' are defined." 371 # endif 372 # ifdef TMPL_PE16 373 # error "Both 'TMPL_PP32' and 'TMPL_PE16' are defined." 374 # endif 375 # ifdef TMPL_PE32 376 # error "Both 'TMPL_PP32' and 'TMPL_PE32' are defined." 377 # endif 378 # ifdef TMPL_PEV86 379 # error "Both 'TMPL_PP32' and 'TMPL_PEV86' are defined." 380 # endif 381 # ifdef TMPL_PP16 382 # error "Both 'TMPL_PP32' and 'TMPL_PP16' are defined." 383 # endif 384 # ifdef TMPL_PPV86 385 # error "Both 'TMPL_PP32' and 'TMPL_PPV86' are defined." 386 # endif 387 # ifdef TMPL_PAE16 388 # error "Both 'TMPL_PP32' and 'TMPL_PAE16' are defined." 389 # endif 390 # ifdef TMPL_PAE32 391 # error "Both 'TMPL_PP32' and 'TMPL_PAE32' are defined." 392 # endif 393 # ifdef TMPL_PAEV86 394 # error "Both 'TMPL_PP32' and 'TMPL_PAEV86' are defined." 395 # endif 396 # ifdef TMPL_LM16 397 # error "Both 'TMPL_PP32' and 'TMPL_LM16' are defined." 398 # endif 399 # ifdef TMPL_LM32 400 # error "Both 'TMPL_PP32' and 'TMPL_LM32' are defined." 401 # endif 402 # ifdef TMPL_LM64 403 # error "Both 'TMPL_PP32' and 'TMPL_LM64' are defined." 404 # endif 405 # if ARCH_BITS != 32 406 # error "TMPL_PP32 requires ARCH_BITS to be 32." 407 # endif 262 263 #elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PP32 264 # define TMPL_SYS_PP32 408 265 # define TMPL_CMN_PP 409 266 # define TMPL_CMN_PAGING 410 # define TMPL_CMN_P32 411 # define TMPL_32BIT 412 # define TMPL_BITS 32 413 # define TMPL_NM(Name) RT_CONCAT(Name,_pp32) 414 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32) 415 # define TMPL_MODE_STR "32-bit paged protected mode" 416 #endif 417 418 #ifdef TMPL_PPV86 419 # ifdef TMPL_RM 420 # error "Both 'TMPL_PPV86' and 'TMPL_RM' are defined." 421 # endif 422 # ifdef TMPL_PE16 423 # error "Both 'TMPL_PPV86' and 'TMPL_PE16' are defined." 424 # endif 425 # ifdef TMPL_PE32 426 # error "Both 'TMPL_PPV86' and 'TMPL_PE32' are defined." 427 # endif 428 # ifdef TMPL_PEV86 429 # error "Both 'TMPL_PPV86' and 'TMPL_PEV86' are defined." 430 # endif 431 # ifdef TMPL_PP16 432 # error "Both 'TMPL_PPV86' and 'TMPL_PP16' are defined." 433 # endif 434 # ifdef TMPL_PP32 435 # error "Both 'TMPL_PPV86' and 'TMPL_PP32' are defined." 436 # endif 437 # ifdef TMPL_PAE16 438 # error "Both 'TMPL_PPV86' and 'TMPL_PAE16' are defined." 439 # endif 440 # ifdef TMPL_PAE32 441 # error "Both 'TMPL_PPV86' and 'TMPL_PAE32' are defined." 442 # endif 443 # ifdef TMPL_PAEV86 444 # error "Both 'TMPL_PPV86' and 'TMPL_PAEV86' are defined." 445 # endif 446 # ifdef TMPL_LM16 447 # error "Both 'TMPL_PPV86' and 'TMPL_LM16' are defined." 448 # endif 449 # ifdef TMPL_LM32 450 # error "Both 'TMPL_PPV86' and 'TMPL_LM32' are defined." 451 # endif 452 # ifdef TMPL_LM64 453 # error "Both 'TMPL_PPV86' and 'TMPL_LM64' are defined." 454 # endif 455 # if ARCH_BITS != 16 456 # error "TMPL_PPV86 requires ARCH_BITS to be 16." 457 # endif 458 # define TMPL_CMN_PP 459 # define TMPL_CMN_PAGING 460 # define TMPL_CMN_V86 461 # define TMPL_CMN_R86 462 # define TMPL_16BIT 463 # define TMPL_BITS 16 464 # define TMPL_NM(Name) RT_CONCAT(Name,_ppv86) 465 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c86) 466 # define TMPL_MODE_STR "v8086 paged protected mode" 467 #endif 468 469 #ifdef TMPL_PAE16 470 # ifdef TMPL_RM 471 # error "Both 'TMPL_PAE16' and 'TMPL_RM' are defined." 472 # endif 473 # ifdef TMPL_PE16 474 # error "Both 'TMPL_PAE16' and 'TMPL_PE16' are defined." 475 # endif 476 # ifdef TMPL_PE32 477 # error "Both 'TMPL_PAE16' and 'TMPL_PE32' are defined." 478 # endif 479 # ifdef TMPL_PEV86 480 # error "Both 'TMPL_PAE16' and 'TMPL_PEV86' are defined." 481 # endif 482 # ifdef TMPL_PP16 483 # error "Both 'TMPL_PAE16' and 'TMPL_PP16' are defined." 484 # endif 485 # ifdef TMPL_PP32 486 # error "Both 'TMPL_PAE16' and 'TMPL_PP32' are defined." 487 # endif 488 # ifdef TMPL_PPV86 489 # error "Both 'TMPL_PAE16' and 'TMPL_PPV86' are defined." 490 # endif 491 # ifdef TMPL_PAE32 492 # error "Both 'TMPL_PAE16' and 'TMPL_PAE32' are defined." 493 # endif 494 # ifdef TMPL_LM16 495 # error "Both 'TMPL_PAE16' and 'TMPL_LM16' are defined." 496 # endif 497 # ifdef TMPL_PAEV86 498 # error "Both 'TMPL_PAE16' and 'TMPL_PAEV86' are defined." 499 # endif 500 # ifdef TMPL_LM32 501 # error "Both 'TMPL_PAE16' and 'TMPL_LM32' are defined." 502 # endif 503 # ifdef TMPL_LM64 504 # error "Both 'TMPL_PAE16' and 'TMPL_LM64' are defined." 505 # endif 506 # if ARCH_BITS != 16 507 # error "TMPL_PAE16 requires ARCH_BITS to be 16." 508 # endif 267 268 #elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PAE16 269 # define TMPL_SYS_PAE16 509 270 # define TMPL_CMN_PAE 510 271 # define TMPL_CMN_PAGING 511 # define TMPL_16BIT 512 # define TMPL_CMN_P16 513 # define TMPL_BITS 16 514 # define TMPL_NM(Name) RT_CONCAT(Name,_pae16) 515 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 516 # define TMPL_MODE_STR "16-bit pae protected mode" 517 #endif 518 519 #ifdef TMPL_PAE32 520 # ifdef TMPL_RM 521 # error "Both 'TMPL_PAE32' and 'TMPL_RM' are defined." 522 # endif 523 # ifdef TMPL_PE16 524 # error "Both 'TMPL_PAE32' and 'TMPL_PE16' are defined." 525 # endif 526 # ifdef TMPL_PE32 527 # error "Both 'TMPL_PAE32' and 'TMPL_PE32' are defined." 528 # endif 529 # ifdef TMPL_PEV86 530 # error "Both 'TMPL_PAE32' and 'TMPL_PEV86' are defined." 531 # endif 532 # ifdef TMPL_PP16 533 # error "Both 'TMPL_PAE32' and 'TMPL_PP16' are defined." 534 # endif 535 # ifdef TMPL_PP32 536 # error "Both 'TMPL_PAE32' and 'TMPL_PP32' are defined." 537 # endif 538 # ifdef TMPL_PPV86 539 # error "Both 'TMPL_PAE32' and 'TMPL_PPV86' are defined." 540 # endif 541 # ifdef TMPL_PAE16 542 # error "Both 'TMPL_PAE32' and 'TMPL_PAE16' are defined." 543 # endif 544 # ifdef TMPL_PAEV86 545 # error "Both 'TMPL_PAE32' and 'TMPL_PAEV86' are defined." 546 # endif 547 # ifdef TMPL_LM16 548 # error "Both 'TMPL_PAE32' and 'TMPL_LM16' are defined." 549 # endif 550 # ifdef TMPL_LM32 551 # error "Both 'TMPL_PAE32' and 'TMPL_LM32' are defined." 552 # endif 553 # ifdef TMPL_LM64 554 # error "Both 'TMPL_PAE32' and 'TMPL_LM64' are defined." 555 # endif 556 # if ARCH_BITS != 32 557 # error "TMPL_PAE32 requires ARCH_BITS to be 32." 558 # endif 272 273 #elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PAE32 274 # define TMPL_SYS_PAE32 559 275 # define TMPL_CMN_PAE 560 276 # define TMPL_CMN_PAGING 561 # define TMPL_CMN_P32 562 # define TMPL_32BIT 563 # define TMPL_BITS 32 564 # define TMPL_NM(Name) RT_CONCAT(Name,_pae32) 565 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32) 566 # define TMPL_MODE_STR "32-bit pae protected mode" 567 #endif 568 569 #ifdef TMPL_PAEV86 570 # ifdef TMPL_RM 571 # error "Both 'TMPL_PAEV86' and 'TMPL_RM' are defined." 572 # endif 573 # ifdef TMPL_PE16 574 # error "Both 'TMPL_PAEV86' and 'TMPL_PE16' are defined." 575 # endif 576 # ifdef TMPL_PE32 577 # error "Both 'TMPL_PAEV86' and 'TMPL_PE32' are defined." 578 # endif 579 # ifdef TMPL_PEV86 580 # error "Both 'TMPL_PAEV86' and 'TMPL_PEV86' are defined." 581 # endif 582 # ifdef TMPL_PP16 583 # error "Both 'TMPL_PAEV86' and 'TMPL_PP16' are defined." 584 # endif 585 # ifdef TMPL_PP32 586 # error "Both 'TMPL_PAEV86' and 'TMPL_PP32' are defined." 587 # endif 588 # ifdef TMPL_PPV86 589 # error "Both 'TMPL_PAEV86' and 'TMPL_PPV86' are defined." 590 # endif 591 # ifdef TMPL_PAE16 592 # error "Both 'TMPL_PAEV86' and 'TMPL_PAE16' are defined." 593 # endif 594 # ifdef TMPL_PAEV86 595 # error "Both 'TMPL_PAEV86' and 'TMPL_PAEV86' are defined." 596 # endif 597 # ifdef TMPL_LM16 598 # error "Both 'TMPL_PAEV86' and 'TMPL_LM16' are defined." 599 # endif 600 # ifdef TMPL_LM32 601 # error "Both 'TMPL_PAEV86' and 'TMPL_LM32' are defined." 602 # endif 603 # ifdef TMPL_LM64 604 # error "Both 'TMPL_PAEV86' and 'TMPL_LM64' are defined." 605 # endif 606 # if ARCH_BITS != 16 607 # error "TMPL_PAEV86 requires ARCH_BITS to be 16." 608 # endif 609 # define TMPL_CMN_PAE 610 # define TMPL_CMN_PAGING 611 # define TMPL_CMN_V86 612 # define TMPL_CMN_R86 613 # define TMPL_16BIT 614 # define TMPL_BITS 16 615 # define TMPL_NM(Name) RT_CONCAT(Name,_paev86) 616 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c86) 617 # define TMPL_MODE_STR "v8086 pae protected mode" 618 #endif 619 620 #ifdef TMPL_LM16 621 # ifdef TMPL_RM 622 # error "Both 'TMPL_LM16' and 'TMPL_RM' are defined." 623 # endif 624 # ifdef TMPL_PE16 625 # error "Both 'TMPL_LM16' and 'TMPL_PE16' are defined." 626 # endif 627 # ifdef TMPL_PE32 628 # error "Both 'TMPL_LM16' and 'TMPL_PE32' are defined." 629 # endif 630 # ifdef TMPL_PEV86 631 # error "Both 'TMPL_LM16' and 'TMPL_PEV86' are defined." 632 # endif 633 # ifdef TMPL_PP16 634 # error "Both 'TMPL_LM16' and 'TMPL_PP16' are defined." 635 # endif 636 # ifdef TMPL_PP32 637 # error "Both 'TMPL_LM16' and 'TMPL_PP32' are defined." 638 # endif 639 # ifdef TMPL_PPV86 640 # error "Both 'TMPL_LM16' and 'TMPL_PPV86' are defined." 641 # endif 642 # ifdef TMPL_PAE16 643 # error "Both 'TMPL_LM16' and 'TMPL_PAE16' are defined." 644 # endif 645 # ifdef TMPL_PAE32 646 # error "Both 'TMPL_LM16' and 'TMPL_PAE32' are defined." 647 # endif 648 # ifdef TMPL_PAEV86 649 # error "Both 'TMPL_LM16' and 'TMPL_PAEV86' are defined." 650 # endif 651 # ifdef TMPL_LM32 652 # error "Both 'TMPL_LM16' and 'TMPL_LM32' are defined." 653 # endif 654 # ifdef TMPL_LM64 655 # error "Both 'TMPL_LM16' and 'TMPL_LM64' are defined." 656 # endif 657 # if ARCH_BITS != 16 658 # error "TMPL_LM16 requires ARCH_BITS to be 16." 659 # endif 277 278 #elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_LM 279 # define TMPL_SYS_LM 660 280 # define TMPL_CMN_LM 661 281 # define TMPL_CMN_PAGING 662 # define TMPL_CMN_P16 663 # define TMPL_16BIT 664 # define TMPL_BITS 16 282 283 #else 284 # error "Invalid TMPL_MODE value!" 285 #endif 286 287 288 /* 289 * Mode specific stuff. 290 */ 291 #if TMPL_MODE == BS3_MODE_RM 292 # define TMPL_RM 1 293 # define TMPL_MODE_STR "real mode" 294 # define TMPL_NM(Name) RT_CONCAT(Name,_rm) 295 # define TMPL_MODE_LNAME rm 296 # define TMPL_MODE_UNAME RM 297 298 299 #elif TMPL_MODE == BS3_MODE_PE16 300 # define TMPL_PE16 1 301 # define TMPL_MODE_STR "16-bit prot, 16-bit" 302 # define TMPL_NM(Name) RT_CONCAT(Name,_pe16) 303 # define TMPL_MODE_LNAME pe16 304 # define TMPL_MODE_UNAME PE16 305 306 #elif TMPL_MODE == BS3_MODE_PE16_32 307 # define TMPL_PE16_32 1 308 # define TMPL_MODE_STR "16-bit prot, 32-bit" 309 # define TMPL_NM(Name) RT_CONCAT(Name,_pe16_32) 310 # define TMPL_MODE_LNAME pe16_32 311 # define TMPL_MODE_UNAME PE16_32 312 # define TMPL_CMN_WEIRD 313 314 #elif TMPL_MODE == BS3_MODE_PE16_V86 315 # define TMPL_PE16_V86 1 316 # define TMPL_MODE_STR "16-bit prot, v8086" 317 # define TMPL_NM(Name) RT_CONCAT(Name,_pe16_v86) 318 # define TMPL_MODE_LNAME pe16_v86 319 # define TMPL_MODE_UNAME PE16_v86 320 # define TMPL_CMN_WEIRD 321 # define TMPL_CMN_WEIRD_V86 322 323 324 #elif TMPL_MODE == BS3_MODE_PE32 325 # define TMPL_PE32 1 326 # define TMPL_MODE_STR "32-bit prot, 32-bit" 327 # define TMPL_NM(Name) RT_CONCAT(Name,_pe32) 328 # define TMPL_MODE_LNAME pe32 329 # define TMPL_MODE_UNAME PE32 330 331 #elif TMPL_MODE == BS3_MODE_PE32_16 332 # define TMPL_PE32_16 1 333 # define TMPL_MODE_STR "32-bit prot, 16-bit" 334 # define TMPL_NM(Name) RT_CONCAT(Name,_pe32_16) 335 # define TMPL_MODE_LNAME pe32_16 336 # define TMPL_MODE_UNAME PE32_16 337 # define TMPL_CMN_WEIRD 338 339 #elif TMPL_MODE == BS3_MODE_PEV86 340 # define TMPL_PEV86 1 341 # define TMPL_MODE_STR "32-bit prot, v8086" 342 # define TMPL_NM(Name) RT_CONCAT(Name,_pev86) 343 # define TMPL_MODE_LNAME pev86 344 # define TMPL_MODE_UNAME PEV86 345 346 347 #elif TMPL_MODE == BS3_MODE_PP16 348 # define TMPL_PP16 1 349 # define TMPL_MODE_STR "16-bit paged, 16-bit" 350 # define TMPL_NM(Name) RT_CONCAT(Name,_pp16) 351 # define TMPL_MODE_LNAME pp16 352 # define TMPL_MODE_UNAME PP16 353 354 #elif TMPL_MODE == BS3_MODE_PP16_32 355 # define TMPL_PP16_32 1 356 # define TMPL_MODE_STR "16-bit paged, 32-bit" 357 # define TMPL_NM(Name) RT_CONCAT(Name,_pp16_32) 358 # define TMPL_MODE_LNAME pp16_32 359 # define TMPL_MODE_UNAME PP16_32 360 # define TMPL_CMN_WEIRD 361 362 #elif TMPL_MODE == BS3_MODE_PP16_V86 363 # define TMPL_PP16_V86 1 364 # define TMPL_MODE_STR "16-bit paged, v8086" 365 # define TMPL_NM(Name) RT_CONCAT(Name,_pp16_v86) 366 # define TMPL_MODE_LNAME pp16_v86 367 # define TMPL_MODE_UNAME PP16_v86 368 # define TMPL_CMN_WEIRD 369 # define TMPL_CMN_WEIRD_V86 370 371 372 #elif TMPL_MODE == BS3_MODE_PP32 373 # define TMPL_PP32 1 374 # define TMPL_MODE_STR "32-bit paged, 32-bit" 375 # define TMPL_NM(Name) RT_CONCAT(Name,_pp32) 376 # define TMPL_MODE_LNAME pp32 377 # define TMPL_MODE_UNAME PP32 378 379 #elif TMPL_MODE == BS3_MODE_PP32_16 380 # define TMPL_PP32_16 1 381 # define TMPL_MODE_STR "32-bit paged, 16-bit" 382 # define TMPL_NM(Name) RT_CONCAT(Name,_pp32_16) 383 # define TMPL_MODE_LNAME pp32_16 384 # define TMPL_MODE_UNAME PP32_16 385 # define TMPL_CMN_WEIRD 386 387 #elif TMPL_MODE == BS3_MODE_PPV86 388 # define TMPL_PPV86 1 389 # define TMPL_MODE_STR "32-bit paged, v8086" 390 # define TMPL_NM(Name) RT_CONCAT(Name,_ppv86) 391 # define TMPL_MODE_LNAME ppv86 392 # define TMPL_MODE_UNAME PPV86 393 394 395 #elif TMPL_MODE == BS3_MODE_PAE16 396 # define TMPL_PAE16 1 397 # define TMPL_MODE_STR "16-bit pae, 16-bit" 398 # define TMPL_NM(Name) RT_CONCAT(Name,_pae16) 399 # define TMPL_MODE_LNAME pae16 400 # define TMPL_MODE_UNAME PAE16 401 402 #elif TMPL_MODE == BS3_MODE_PAE16_32 403 # define TMPL_PAE16_32 1 404 # define TMPL_MODE_STR "16-bit pae, 32-bit" 405 # define TMPL_NM(Name) RT_CONCAT(Name,_pae16_32) 406 # define TMPL_MODE_LNAME pae16_32 407 # define TMPL_MODE_UNAME PAE16_32 408 # define TMPL_CMN_WEIRD 409 410 #elif TMPL_MODE == BS3_MODE_PAE16_V86 411 # define TMPL_PAE16_V86 1 412 # define TMPL_MODE_STR "16-bit pae, v8086" 413 # define TMPL_NM(Name) RT_CONCAT(Name,_pae16_v86) 414 # define TMPL_MODE_LNAME pae16_v86 415 # define TMPL_MODE_UNAME PAE16_v86 416 # define TMPL_CMN_WEIRD 417 # define TMPL_CMN_WEIRD_V86 418 419 420 #elif TMPL_MODE == BS3_MODE_PAE32 421 # define TMPL_PAE32 1 422 # define TMPL_MODE_STR "32-bit pae, 32-bit" 423 # define TMPL_NM(Name) RT_CONCAT(Name,_pae32) 424 # define TMPL_MODE_LNAME pae32 425 # define TMPL_MODE_UNAME PAE32 426 427 #elif TMPL_MODE == BS3_MODE_PAE32_16 428 # define TMPL_PAE32_16 1 429 # define TMPL_MODE_STR "32-bit pae, 32-bit" 430 # define TMPL_NM(Name) RT_CONCAT(Name,_pae32_16) 431 # define TMPL_MODE_LNAME pae32_16 432 # define TMPL_MODE_UNAME PAE32_16 433 # define TMPL_CMN_WEIRD 434 435 #elif TMPL_MODE == BS3_MODE_PAEV86 436 # define TMPL_PAEV86 1 437 # define TMPL_MODE_STR "32-bit pae, v8086 pae" 438 # define TMPL_NM(Name) RT_CONCAT(Name,_paev86) 439 # define TMPL_MODE_LNAME paev86 440 # define TMPL_MODE_UNAME PAEV86 441 442 443 #elif TMPL_MODE == BS3_MODE_LM16 444 # define TMPL_LM16 1 445 # define TMPL_MODE_STR "long, 16-bit" 665 446 # define TMPL_NM(Name) RT_CONCAT(Name,_lm16) 666 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 667 # define TMPL_MODE_STR "16-bit long mode" 447 # define TMPL_MODE_LNAME lm16 448 # define TMPL_MODE_UNAME LM16 449 450 #elif TMPL_MODE == BS3_MODE_LM32 451 # define TMPL_LM32 1 452 # define TMPL_MODE_STR "long, 32-bit" 453 # define TMPL_NM(Name) RT_CONCAT(Name,_lm32) 454 # define TMPL_MODE_LNAME lm32 455 # define TMPL_MODE_UNAME LM32 456 457 #elif TMPL_MODE == BS3_MODE_LM64 458 # define TMPL_LM64 1 459 # define TMPL_MODE_STR "long, 64-bit" 460 # define TMPL_NM(Name) RT_CONCAT(Name,_lm64) 461 # define TMPL_MODE_LNAME lm64 462 # define TMPL_MODE_UNAME LM64 463 464 #else 465 # error "Invalid TMPL_MODE value!!" 668 466 #endif 669 467 670 #ifdef TMPL_LM32671 # ifdef TMPL_RM672 # error "Both 'TMPL_LM32' and 'TMPL_RM' are defined."673 # endif674 # ifdef TMPL_PE16675 # error "Both 'TMPL_LM32' and 'TMPL_PE16' are defined."676 # endif677 # ifdef TMPL_PE32678 # error "Both 'TMPL_LM32' and 'TMPL_PE32' are defined."679 # endif680 # ifdef TMPL_PEV86681 # error "Both 'TMPL_LM32' and 'TMPL_PEV86' are defined."682 # endif683 # ifdef TMPL_PP16684 # error "Both 'TMPL_LM32' and 'TMPL_PP16' are defined."685 # endif686 # ifdef TMPL_PP32687 # error "Both 'TMPL_LM32' and 'TMPL_PP32' are defined."688 # endif689 # ifdef TMPL_PPV86690 # error "Both 'TMPL_LM32' and 'TMPL_PPV86' are defined."691 # endif692 # ifdef TMPL_PAE16693 # error "Both 'TMPL_LM32' and 'TMPL_PAE16' are defined."694 # endif695 # ifdef TMPL_PAE32696 # error "Both 'TMPL_LM32' and 'TMPL_PAE32' are defined."697 # endif698 # ifdef TMPL_PAEV86699 # error "Both 'TMPL_LM32' and 'TMPL_PAEV86' are defined."700 # endif701 # ifdef TMPL_LM16702 # error "Both 'TMPL_LM32' and 'TMPL_LM16' are defined."703 # endif704 # ifdef TMPL_LM64705 # error "Both 'TMPL_LM32' and 'TMPL_LM64' are defined."706 # endif707 # if ARCH_BITS != 32708 # error "TMPL_LM32 requires ARCH_BITS to be 32."709 # endif710 # define TMPL_CMN_LM711 # define TMPL_CMN_PAGING712 # define TMPL_CMN_P32713 # define TMPL_32BIT714 # define TMPL_BITS 32715 # define TMPL_NM(Name) RT_CONCAT(Name,_lm32)716 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32)717 # define TMPL_MODE_STR "32-bit long mode"718 #endif719 720 #ifdef TMPL_LM64721 # ifdef TMPL_RM722 # error ""Both 'TMPL_LM64' and 'TMPL_RM' are defined.""723 # endif724 # ifdef TMPL_PE16725 # error "Both 'TMPL_LM64' and 'TMPL_PE16' are defined."726 # endif727 # ifdef TMPL_PE32728 # error "Both 'TMPL_LM64' and 'TMPL_PE32' are defined."729 # endif730 # ifdef TMPL_PEV86731 # error "Both 'TMPL_LM64' and 'TMPL_PEV86' are defined."732 # endif733 # ifdef TMPL_PP16734 # error "Both 'TMPL_LM64' and 'TMPL_PP16' are defined."735 # endif736 # ifdef TMPL_PP32737 # error "Both 'TMPL_LM64' and 'TMPL_PP32' are defined."738 # endif739 # ifdef TMPL_PPV86740 # error "Both 'TMPL_LM64' and 'TMPL_PPV86' are defined."741 # endif742 # ifdef TMPL_PAE16743 # error "Both 'TMPL_LM64' and 'TMPL_PAE16' are defined."744 # endif745 # ifdef TMPL_PAE32746 # error "Both 'TMPL_LM64' and 'TMPL_PAE32' are defined."747 # endif748 # ifdef TMPL_PAEV86749 # error "Both 'TMPL_LM64' and 'TMPL_PAEV86' are defined."750 # endif751 # ifdef TMPL_LM16752 # error "Both 'TMPL_LM64' and 'TMPL_LM16' are defined."753 # endif754 # ifdef TMPL_LM32755 # error "Both 'TMPL_LM64' and 'TMPL_LM32' are defined."756 # endif757 # if ARCH_BITS != 64758 # error "TMPL_LM64 requires ARCH_BITS to be 64."759 # endif760 # define TMPL_CMN_LM761 # define TMPL_CMN_PAGING762 # define TMPL_CMN_P64763 # define TMPL_64BIT764 # define TMPL_BITS 64765 # define TMPL_NM(Name) RT_CONCAT(Name,_lm64)766 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c64)767 # define TMPL_MODE_STR "64-bit long mode"768 #endif769 468 770 469 #ifndef TMPL_MODE_STR -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-header.mac
r59311 r59863 53 53 ; - TMPL_CMN_PAGING = TMPL_CMN_PP | TMPL_CMN_PAE | TMPL_CMN_LM 54 54 ; 55 %ifdef TMPL_RM 56 %ifdef TMPL_PE16 57 %error "Both 'TMPL_RM' and 'TMPL_PE16' are defined." 55 56 57 ; 58 ; Convert TMPL_XXX to TMPL_MODE. 59 ; 60 %ifndef TMPL_MODE 61 %ifdef TMPL_RM 62 %define TMPL_MODE BS3_MODE_RM 63 %elifdef TMPL_PE16 64 %define TMPL_MODE BS3_MODE_PE16 65 %elifdef TMPL_PE16_32 66 %define TMPL_MODE BS3_MODE_PE16_32 67 %elifdef TMPL_PE16_V86 68 %define TMPL_MODE BS3_MODE_PE16_V86 69 %elifdef TMPL_PE32 70 %define TMPL_MODE BS3_MODE_PE32 71 %elifdef TMPL_PE32_16 72 %define TMPL_MODE BS3_MODE_PE32_16 73 %elifdef TMPL_PEV86 74 %define TMPL_MODE BS3_MODE_PEV86 75 %elifdef TMPL_PP16 76 %define TMPL_MODE BS3_MODE_PP16 77 %elifdef TMPL_PP16_32 78 %define TMPL_MODE BS3_MODE_PP16_32 79 %elifdef TMPL_PP16_V86 80 %define TMPL_MODE BS3_MODE_PP16_V86 81 %elifdef TMPL_PP32 82 %define TMPL_MODE BS3_MODE_PP32 83 %elifdef TMPL_PP32_16 84 %define TMPL_MODE BS3_MODE_PP32_16 85 %elifdef TMPL_PPV86 86 %define TMPL_MODE BS3_MODE_PPV86 87 %elifdef TMPL_PAE16 88 %define TMPL_MODE BS3_MODE_PAE16 89 %elifdef TMPL_PAE16_32 90 %define TMPL_MODE BS3_MODE_PAE16_32 91 %elifdef TMPL_PAE16_V86 92 %define TMPL_MODE BS3_MODE_PAE16_V86 93 %elifdef TMPL_PAE32 94 %define TMPL_MODE BS3_MODE_PAE32 95 %elifdef TMPL_PAE32_16 96 %define TMPL_MODE BS3_MODE_PAE32_16 97 %elifdef TMPL_PAEV86 98 %define TMPL_MODE BS3_MODE_PAEV86 99 %elifdef TMPL_LM16 100 %define TMPL_MODE BS3_MODE_LM16 101 %elifdef TMPL_LM32 102 %define TMPL_MODE BS3_MODE_LM32 103 %elifdef TMPL_LM64 104 %define TMPL_MODE BS3_MODE_LM64 105 %else 106 %error "Unable to to figure out the template mode." 58 107 %endif 59 %ifdef TMPL_PE32 60 %error "Both 'TMPL_RM' and 'TMPL_PE32' are defined." 61 %endif 62 %ifdef TMPL_PEV86 63 %error "Both 'TMPL_RM' and 'TMPL_PEV86' are defined." 64 %endif 65 %ifdef TMPL_PP16 66 %error "Both 'TMPL_RM' and 'TMPL_PP16' are defined." 67 %endif 68 %ifdef TMPL_PP32 69 %error "Both 'TMPL_RM' and 'TMPL_PP32' are defined." 70 %endif 71 %ifdef TMPL_PPV86 72 %error "Both 'TMPL_RM' and 'TMPL_PPV86' are defined." 73 %endif 74 %ifdef TMPL_PAE16 75 %error "Both 'TMPL_RM' and 'TMPL_PAE16' are defined." 76 %endif 77 %ifdef TMPL_PAE32 78 %error "Both 'TMPL_RM' and 'TMPL_PAE32' are defined." 79 %endif 80 %ifdef TMPL_PAEV86 81 %error "Both 'TMPL_RM' and 'TMPL_PAEV86' are defined." 82 %endif 83 %ifdef TMPL_LM16 84 %error "Both 'TMPL_RM' and 'TMPL_LM16' are defined." 85 %endif 86 %ifdef TMPL_LM32 87 %error "Both 'TMPL_RM' and 'TMPL_LM32' are defined." 88 %endif 89 %ifdef TMPL_LM64 90 %error "Both 'TMPL_RM' and 'TMPL_LM64' are defined." 91 %endif 108 %endif 109 110 ; 111 ; Check the code bitness and set TMPL_XXBITS, TMPL_BITS, BS3_CMN_NM 112 ; 113 %if (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_16 92 114 %define TMPL_16BIT 93 115 %define TMPL_BITS 16 94 116 %define TMPL_PTR_DEF dw 95 %define TMPL_ NM(Name) _ %+ Name %+ _rm117 %define TMPL_UNDERSCORE _ 96 118 %define BS3_CMN_NM(Name) _ %+ Name %+ _c16 97 %define TMPL_UNDERSCORE _ 98 %define TMPL_MODE_LNAME rm 99 %define TMPL_MODE_UNAME RM 100 %define TMPL_MODE_STR 'real mode' 101 %define TMPL_HAVE_BIOS 102 %define TMPL_CMN_R86 103 %endif 104 105 %ifdef TMPL_PE16 106 %ifdef TMPL_RM 107 %error "Both 'TMPL_PE16' and 'TMPL_RM' are defined." 108 %endif 109 %ifdef TMPL_PE32 110 %error "Both 'TMPL_PE16' and 'TMPL_PE32' are defined." 111 %endif 112 %ifdef TMPL_PEV86 113 %error "Both 'TMPL_RM' and 'TMPL_PEV86' are defined." 114 %endif 115 %ifdef TMPL_PP16 116 %error "Both 'TMPL_PE16' and 'TMPL_PP16' are defined." 117 %endif 118 %ifdef TMPL_PP32 119 %error "Both 'TMPL_PE16' and 'TMPL_PP32' are defined." 120 %endif 121 %ifdef TMPL_PPV86 122 %error "Both 'TMPL_PE16' and 'TMPL_PPV86' are defined." 123 %endif 124 %ifdef TMPL_PAE16 125 %error "Both 'TMPL_PE16' and 'TMPL_PAE16' are defined." 126 %endif 127 %ifdef TMPL_PAE32 128 %error "Both 'TMPL_PE16' and 'TMPL_PAE32' are defined." 129 %endif 130 %ifdef TMPL_PAEV86 131 %error "Both 'TMPL_PE32' and 'TMPL_PAEV86' are defined." 132 %endif 133 %ifdef TMPL_LM16 134 %error "Both 'TMPL_PE16' and 'TMPL_LM16' are defined." 135 %endif 136 %ifdef TMPL_LM32 137 %error "Both 'TMPL_PE16' and 'TMPL_LM32' are defined." 138 %endif 139 %ifdef TMPL_LM64 140 %error "Both 'TMPL_PE16' and 'TMPL_LM64' are defined." 141 %endif 142 %define TMPL_CMN_PE 143 %define TMPL_CMN_P16 144 %define TMPL_16BIT 145 %define TMPL_BITS 16 146 %define TMPL_PTR_DEF dw 147 %define TMPL_NM(Name) _ %+ Name %+ _pe16 148 %define BS3_CMN_NM(Name) _ %+ Name %+ _c16 149 %define TMPL_UNDERSCORE _ 150 %define TMPL_MODE_LNAME pe16 151 %define TMPL_MODE_UNAME PE16 152 %define TMPL_MODE_STR '16-bit unpaged protected mode' 153 %endif 154 155 %ifdef TMPL_PE32 156 %ifdef TMPL_RM 157 %error "Both 'TMPL_PE32' and 'TMPL_RM' are defined." 158 %endif 159 %ifdef TMPL_PE16 160 %error "Both 'TMPL_PE32' and 'TMPL_PE16' are defined." 161 %endif 162 %ifdef TMPL_PEV86 163 %error "Both 'TMPL_PE32' and 'TMPL_PEV86' are defined." 164 %endif 165 %ifdef TMPL_PP16 166 %error "Both 'TMPL_PE32' and 'TMPL_PP16' are defined." 167 %endif 168 %ifdef TMPL_PP32 169 %error "Both 'TMPL_PE32' and 'TMPL_PP32' are defined." 170 %endif 171 %ifdef TMPL_PPV86 172 %error "Both 'TMPL_PE32' and 'TMPL_PPV86' are defined." 173 %endif 174 %ifdef TMPL_PAE16 175 %error "Both 'TMPL_PE32' and 'TMPL_PAE16' are defined." 176 %endif 177 %ifdef TMPL_PAE32 178 %error "Both 'TMPL_PE32' and 'TMPL_PAE32' are defined." 179 %endif 180 %ifdef TMPL_PAE86 181 %error "Both 'TMPL_PE32' and 'TMPL_PPV86' are defined." 182 %endif 183 %ifdef TMPL_LM16 184 %error "Both 'TMPL_PE32' and 'TMPL_LM16' are defined." 185 %endif 186 %ifdef TMPL_LM32 187 %error "Both 'TMPL_PE32' and 'TMPL_LM32' are defined." 188 %endif 189 %ifdef TMPL_LM64 190 %error "Both 'TMPL_PE32' and 'TMPL_LM64' are defined." 191 %endif 192 %define TMPL_CMN_PE 193 %define TMPL_CMN_P32 119 120 %elif (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_32 194 121 %define TMPL_32BIT 195 122 %define TMPL_BITS 32 196 123 %define TMPL_PTR_DEF dd 197 %define TMPL_ NM(Name) _ %+ Name %+ _pe32124 %define TMPL_UNDERSCORE _ 198 125 %define BS3_CMN_NM(Name) _ %+ Name %+ _c32 199 %define TMPL_UNDERSCORE _ 200 %define TMPL_MODE_LNAME pe32 201 %define TMPL_MODE_UNAME PE32 202 %define TMPL_MODE_STR '32-bit unpaged protected mode' 203 %endif 204 205 %ifdef TMPL_PEV86 206 %ifdef TMPL_RM 207 %error "Both 'TMPL_PEV86' and 'TMPL_RM' are defined." 208 %endif 209 %ifdef TMPL_PE16 210 %error "Both 'TMPL_PEV86' and 'TMPL_PE16' are defined." 211 %endif 212 %ifdef TMPL_PP32 213 %error "Both 'TMPL_PEV86' and 'TMPL_PP32' are defined." 214 %endif 215 %ifdef TMPL_PP16 216 %error "Both 'TMPL_PEV86' and 'TMPL_PP16' are defined." 217 %endif 218 %ifdef TMPL_PP32 219 %error "Both 'TMPL_PEV86' and 'TMPL_PP32' are defined." 220 %endif 221 %ifdef TMPL_PPV86 222 %error "Both 'TMPL_PEV86' and 'TMPL_PPV86' are defined." 223 %endif 224 %ifdef TMPL_PAE16 225 %error "Both 'TMPL_PEV86' and 'TMPL_PAE16' are defined." 226 %endif 227 %ifdef TMPL_PAE32 228 %error "Both 'TMPL_PEV86' and 'TMPL_PAE32' are defined." 229 %endif 230 %ifdef TMPL_PAE86 231 %error "Both 'TMPL_PEV86' and 'TMPL_PPV86' are defined." 232 %endif 233 %ifdef TMPL_LM16 234 %error "Both 'TMPL_PEV86' and 'TMPL_LM16' are defined." 235 %endif 236 %ifdef TMPL_LM32 237 %error "Both 'TMPL_PEV86' and 'TMPL_LM32' are defined." 238 %endif 239 %ifdef TMPL_LM64 240 %error "Both 'TMPL_PEV86' and 'TMPL_LM64' are defined." 241 %endif 242 %define TMPL_CMN_PE 243 %define TMPL_CMN_V86 244 %define TMPL_CMN_R86 126 127 %elif (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_V86 245 128 %define TMPL_16BIT 246 129 %define TMPL_BITS 16 247 %define TMPL_PTR_DEF dw 248 %define TMPL_NM(Name) _ %+ Name %+ _pev86 130 %define TMPL_UNDERSCORE _ 249 131 %define BS3_CMN_NM(Name) _ %+ Name %+ _c16 250 %define TMPL_UNDERSCORE _ 251 %define TMPL_MODE_LNAME pev86 252 %define TMPL_MODE_UNAME PEV86 253 %define TMPL_MODE_STR 'v8086 unpaged protected mode' 254 %endif 255 256 %ifdef TMPL_PP16 257 %ifdef TMPL_RM 258 %error "Both 'TMPL_PP16' and 'TMPL_RM' are defined." 259 %endif 260 %ifdef TMPL_PE16 261 %error "Both 'TMPL_PP16' and 'TMPL_PE16' are defined." 262 %endif 263 %ifdef TMPL_PE32 264 %error "Both 'TMPL_PP16' and 'TMPL_PE32' are defined." 265 %endif 266 %ifdef TMPL_PEV86 267 %error "Both 'TMPL_PP16' and 'TMPL_PEV86' are defined." 268 %endif 269 %ifdef TMPL_PP32 270 %error "Both 'TMPL_PP16' and 'TMPL_PP32' are defined." 271 %endif 272 %ifdef TMPL_PPV86 273 %error "Both 'TMPL_PP32' and 'TMPL_PPV86' are defined." 274 %endif 275 %ifdef TMPL_PAE16 276 %error "Both 'TMPL_PP16' and 'TMPL_PAE16' are defined." 277 %endif 278 %ifdef TMPL_PAE32 279 %error "Both 'TMPL_PP16' and 'TMPL_PAE32' are defined." 280 %endif 281 %ifdef TMPL_PAEV86 282 %error "Both 'TMPL_PP16' and 'TMPL_PAEV86' are defined." 283 %endif 284 %ifdef TMPL_LM16 285 %error "Both 'TMPL_PP16' and 'TMPL_LM16' are defined." 286 %endif 287 %ifdef TMPL_LM32 288 %error "Both 'TMPL_PP16' and 'TMPL_LM32' are defined." 289 %endif 290 %ifdef TMPL_LM64 291 %error "Both 'TMPL_PP16' and 'TMPL_LM64' are defined." 292 %endif 293 %define TMPL_CMN_PP 294 %define TMPL_CMN_PAGING 295 %define TMPL_CMN_P16 296 %define TMPL_16BIT 297 %define TMPL_BITS 16 298 %define TMPL_PTR_DEF dw 299 %define TMPL_NM(Name) _ %+ Name %+ _pp16 300 %define BS3_CMN_NM(Name) _ %+ Name %+ _c16 301 %define TMPL_UNDERSCORE _ 302 %define TMPL_MODE_LNAME pp16 303 %define TMPL_MODE_UNAME PP16 304 %define TMPL_MODE_STR '16-bit paged protected mode' 305 %endif 306 307 %ifdef TMPL_PP32 308 %ifdef TMPL_RM 309 %error "Both 'TMPL_PP32' and 'TMPL_RM' are defined." 310 %endif 311 %ifdef TMPL_PE16 312 %error "Both 'TMPL_PP32' and 'TMPL_PE16' are defined." 313 %endif 314 %ifdef TMPL_PE32 315 %error "Both 'TMPL_PP32' and 'TMPL_PE32' are defined." 316 %endif 317 %ifdef TMPL_PEV86 318 %error "Both 'TMPL_PP32' and 'TMPL_PEV86' are defined." 319 %endif 320 %ifdef TMPL_PP16 321 %error "Both 'TMPL_PP32' and 'TMPL_PP16' are defined." 322 %endif 323 %ifdef TMPL_PPV86 324 %error "Both 'TMPL_PP32' and 'TMPL_PPV86' are defined." 325 %endif 326 %ifdef TMPL_PAE16 327 %error "Both 'TMPL_PP32' and 'TMPL_PAE16' are defined." 328 %endif 329 %ifdef TMPL_PAE32 330 %error "Both 'TMPL_PP32' and 'TMPL_PAE32' are defined." 331 %endif 332 %ifdef TMPL_PAEV86 333 %error "Both 'TMPL_PP32' and 'TMPL_PAEV86' are defined." 334 %endif 335 %ifdef TMPL_LM16 336 %error "Both 'TMPL_PP32' and 'TMPL_LM16' are defined." 337 %endif 338 %ifdef TMPL_LM32 339 %error "Both 'TMPL_PP32' and 'TMPL_LM32' are defined." 340 %endif 341 %ifdef TMPL_LM64 342 %error "Both 'TMPL_PP32' and 'TMPL_LM64' are defined." 343 %endif 344 %define TMPL_CMN_PP 345 %define TMPL_CMN_PAGING 346 %define TMPL_CMN_P32 347 %define TMPL_32BIT 348 %define TMPL_BITS 32 349 %define TMPL_PTR_DEF dd 350 %define TMPL_NM(Name) _ %+ Name %+ _pp32 351 %define BS3_CMN_NM(Name) _ %+ Name %+ _c32 352 %define TMPL_UNDERSCORE _ 353 %define TMPL_MODE_LNAME pp32 354 %define TMPL_MODE_UNAME PP32 355 %define TMPL_MODE_STR '32-bit paged protected mode' 356 %endif 357 358 %ifdef TMPL_PPV86 359 %ifdef TMPL_RM 360 %error "Both 'TMPL_PPV86' and 'TMPL_RM' are defined." 361 %endif 362 %ifdef TMPL_PE16 363 %error "Both 'TMPL_PPV86' and 'TMPL_PE16' are defined." 364 %endif 365 %ifdef TMPL_PE32 366 %error "Both 'TMPL_PPV86' and 'TMPL_PE32' are defined." 367 %endif 368 %ifdef TMPL_PEV86 369 %error "Both 'TMPL_PPV86' and 'TMPL_PEV86' are defined." 370 %endif 371 %ifdef TMPL_PP16 372 %error "Both 'TMPL_PPV86' and 'TMPL_PP16' are defined." 373 %endif 374 %ifdef TMPL_PP32 375 %error "Both 'TMPL_PPV86' and 'TMPL_PP32' are defined." 376 %endif 377 %ifdef TMPL_PAE16 378 %error "Both 'TMPL_PPV86' and 'TMPL_PAE16' are defined." 379 %endif 380 %ifdef TMPL_PAE32 381 %error "Both 'TMPL_PPV86' and 'TMPL_PAE32' are defined." 382 %endif 383 %ifdef TMPL_PAEV86 384 %error "Both 'TMPL_PPV86' and 'TMPL_PAEV86' are defined." 385 %endif 386 %ifdef TMPL_LM16 387 %error "Both 'TMPL_PPV86' and 'TMPL_LM16' are defined." 388 %endif 389 %ifdef TMPL_LM32 390 %error "Both 'TMPL_PPV86' and 'TMPL_LM32' are defined." 391 %endif 392 %ifdef TMPL_LM64 393 %error "Both 'TMPL_PPV86' and 'TMPL_LM64' are defined." 394 %endif 395 %define TMPL_CMN_PP 396 %define TMPL_CMN_PAGING 132 %define TMPL_CMN_R86 397 133 %define TMPL_CMN_V86 398 %define TMPL_CMN_R86 399 %define TMPL_16BIT 400 %define TMPL_BITS 16 401 %define TMPL_PTR_DEF dw 402 %define TMPL_NM(Name) _ %+ Name %+ _ppv86 403 %define BS3_CMN_NM(Name) _ %+ Name %+ _c86 404 %define TMPL_UNDERSCORE _ 405 %define TMPL_MODE_LNAME ppv86 406 %define TMPL_MODE_UNAME PPV86 407 %define TMPL_MODE_STR 'v8086 paged protected mode' 408 %endif 409 410 %ifdef TMPL_PAE16 411 %ifdef TMPL_RM 412 %error "Both 'TMPL_PAE16' and 'TMPL_RM' are defined." 413 %endif 414 %ifdef TMPL_PE16 415 %error "Both 'TMPL_PAE16' and 'TMPL_PE16' are defined." 416 %endif 417 %ifdef TMPL_PE32 418 %error "Both 'TMPL_PAE16' and 'TMPL_PE32' are defined." 419 %endif 420 %ifdef TMPL_PEV86 421 %error "Both 'TMPL_PAE16' and 'TMPL_PEV86' are defined." 422 %endif 423 %ifdef TMPL_PP16 424 %error "Both 'TMPL_PAE16' and 'TMPL_PP16' are defined." 425 %endif 426 %ifdef TMPL_PP32 427 %error "Both 'TMPL_PAE16' and 'TMPL_PP32' are defined." 428 %endif 429 %ifdef TMPL_PPV86 430 %error "Both 'TMPL_PAE16' and 'TMPL_PPV86' are defined." 431 %endif 432 %ifdef TMPL_PAE32 433 %error "Both 'TMPL_PAE16' and 'TMPL_PAE32' are defined." 434 %endif 435 %ifdef TMPL_LM16 436 %error "Both 'TMPL_PAE16' and 'TMPL_LM16' are defined." 437 %endif 438 %ifdef TMPL_PAEV86 439 %error "Both 'TMPL_PAE16' and 'TMPL_PAEV86' are defined." 440 %endif 441 %ifdef TMPL_LM32 442 %error "Both 'TMPL_PAE16' and 'TMPL_LM32' are defined." 443 %endif 444 %ifdef TMPL_LM64 445 %error "Both 'TMPL_PAE16' and 'TMPL_LM64' are defined." 446 %endif 447 %define TMPL_CMN_PAE 448 %define TMPL_CMN_PAGING 449 %define TMPL_16BIT 450 %define TMPL_CMN_P16 451 %define TMPL_BITS 16 452 %define TMPL_PTR_DEF dw 453 %define TMPL_NM(Name) _ %+ Name %+ _pae16 454 %define BS3_CMN_NM(Name) _ %+ Name %+ _c16 455 %define TMPL_UNDERSCORE _ 456 %define TMPL_MODE_LNAME pae16 457 %define TMPL_MODE_UNAME PAE16 458 %define TMPL_MODE_STR '16-bit pae protected mode' 459 %endif 460 461 %ifdef TMPL_PAE32 462 %ifdef TMPL_RM 463 %error "Both 'TMPL_PAE32' and 'TMPL_RM' are defined." 464 %endif 465 %ifdef TMPL_PE16 466 %error "Both 'TMPL_PAE32' and 'TMPL_PE16' are defined." 467 %endif 468 %ifdef TMPL_PE32 469 %error "Both 'TMPL_PAE32' and 'TMPL_PE32' are defined." 470 %endif 471 %ifdef TMPL_PEV86 472 %error "Both 'TMPL_PAE32' and 'TMPL_PEV86' are defined." 473 %endif 474 %ifdef TMPL_PP16 475 %error "Both 'TMPL_PAE32' and 'TMPL_PP16' are defined." 476 %endif 477 %ifdef TMPL_PP32 478 %error "Both 'TMPL_PAE32' and 'TMPL_PP32' are defined." 479 %endif 480 %ifdef TMPL_PPV86 481 %error "Both 'TMPL_PAE32' and 'TMPL_PPV86' are defined." 482 %endif 483 %ifdef TMPL_PAE16 484 %error "Both 'TMPL_PAE32' and 'TMPL_PAE16' are defined." 485 %endif 486 %ifdef TMPL_PAEV86 487 %error "Both 'TMPL_PAE32' and 'TMPL_PAEV86' are defined." 488 %endif 489 %ifdef TMPL_LM16 490 %error "Both 'TMPL_PAE32' and 'TMPL_LM16' are defined." 491 %endif 492 %ifdef TMPL_LM32 493 %error "Both 'TMPL_PAE32' and 'TMPL_LM32' are defined." 494 %endif 495 %ifdef TMPL_LM64 496 %error "Both 'TMPL_PAE32' and 'TMPL_LM64' are defined." 497 %endif 498 %define TMPL_CMN_PAE 499 %define TMPL_CMN_PAGING 500 %define TMPL_CMN_P32 501 %define TMPL_32BIT 502 %define TMPL_BITS 32 503 %define TMPL_PTR_DEF dd 504 %define TMPL_NM(Name) _ %+ Name %+ _pae32 505 %define BS3_CMN_NM(Name) _ %+ Name %+ _c32 506 %define TMPL_UNDERSCORE _ 507 %define TMPL_MODE_LNAME pae32 508 %define TMPL_MODE_UNAME PAE32 509 %define TMPL_MODE_STR '32-bit pae protected mode' 510 %endif 511 512 %ifdef TMPL_PAEV86 513 %ifdef TMPL_RM 514 %error "Both 'TMPL_PAEV86' and 'TMPL_RM' are defined." 515 %endif 516 %ifdef TMPL_PE16 517 %error "Both 'TMPL_PAEV86' and 'TMPL_PE16' are defined." 518 %endif 519 %ifdef TMPL_PE32 520 %error "Both 'TMPL_PAEV86' and 'TMPL_PE32' are defined." 521 %endif 522 %ifdef TMPL_PEV86 523 %error "Both 'TMPL_PAEV86' and 'TMPL_PEV86' are defined." 524 %endif 525 %ifdef TMPL_PP16 526 %error "Both 'TMPL_PAEV86' and 'TMPL_PP16' are defined." 527 %endif 528 %ifdef TMPL_PP32 529 %error "Both 'TMPL_PAEV86' and 'TMPL_PP32' are defined." 530 %endif 531 %ifdef TMPL_PPV86 532 %error "Both 'TMPL_PAEV86' and 'TMPL_PPV86' are defined." 533 %endif 534 %ifdef TMPL_PAE16 535 %error "Both 'TMPL_PAEV86' and 'TMPL_PAE16' are defined." 536 %endif 537 %ifdef TMPL_PAE32 538 %error "Both 'TMPL_PAEV86' and 'TMPL_PAE32' are defined." 539 %endif 540 %ifdef TMPL_LM16 541 %error "Both 'TMPL_PAEV86' and 'TMPL_LM16' are defined." 542 %endif 543 %ifdef TMPL_LM32 544 %error "Both 'TMPL_PAEV86' and 'TMPL_LM32' are defined." 545 %endif 546 %ifdef TMPL_LM64 547 %error "Both 'TMPL_PAEV86' and 'TMPL_LM64' are defined." 548 %endif 549 %define TMPL_CMN_PAE 550 %define TMPL_CMN_PAGING 551 %define TMPL_CMN_V86 552 %define TMPL_CMN_R86 553 %define TMPL_16BIT 554 %define TMPL_BITS 16 555 %define TMPL_PTR_DEF dw 556 %define TMPL_NM(Name) _ %+ Name %+ _paev86 557 %define BS3_CMN_NM(Name) _ %+ Name %+ _c86 558 %define TMPL_UNDERSCORE _ 559 %define TMPL_MODE_LNAME paev86 560 %define TMPL_MODE_UNAME PAEV86 561 %define TMPL_MODE_STR 'v8086 pae protected mode' 562 %endif 563 564 %ifdef TMPL_LM16 565 %ifdef TMPL_RM 566 %error "Both 'TMPL_LM16' and 'TMPL_RM' are defined." 567 %endif 568 %ifdef TMPL_PE16 569 %error "Both 'TMPL_LM16' and 'TMPL_PE16' are defined." 570 %endif 571 %ifdef TMPL_PE32 572 %error "Both 'TMPL_LM16' and 'TMPL_PE32' are defined." 573 %endif 574 %ifdef TMPL_PEV86 575 %error "Both 'TMPL_LM16' and 'TMPL_PEV86' are defined." 576 %endif 577 %ifdef TMPL_PP16 578 %error "Both 'TMPL_LM16' and 'TMPL_PP16' are defined." 579 %endif 580 %ifdef TMPL_PP32 581 %error "Both 'TMPL_LM16' and 'TMPL_PP32' are defined." 582 %endif 583 %ifdef TMPL_PPV86 584 %error "Both 'TMPL_LM16' and 'TMPL_PPV86' are defined." 585 %endif 586 %ifdef TMPL_PAE16 587 %error "Both 'TMPL_LM16' and 'TMPL_PAE16' are defined." 588 %endif 589 %ifdef TMPL_PAE32 590 %error "Both 'TMPL_LM16' and 'TMPL_PAE32' are defined." 591 %endif 592 %ifdef TMPL_PAEV86 593 %error "Both 'TMPL_LM16' and 'TMPL_PAEV86' are defined." 594 %endif 595 %ifdef TMPL_LM32 596 %error "Both 'TMPL_LM16' and 'TMPL_LM32' are defined." 597 %endif 598 %ifdef TMPL_LM64 599 %error "Both 'TMPL_LM16' and 'TMPL_LM64' are defined." 600 %endif 601 %define TMPL_CMN_LM 602 %define TMPL_CMN_PAGING 603 %define TMPL_CMN_P16 604 %define TMPL_16BIT 605 %define TMPL_BITS 16 606 %define TMPL_PTR_DEF dw 607 %define TMPL_NM(Name) _ %+ Name %+ _lm16 608 %define BS3_CMN_NM(Name) _ %+ Name %+ _c16 609 %define TMPL_UNDERSCORE _ 610 %define TMPL_MODE_LNAME lm16 611 %define TMPL_MODE_UNAME LM16 612 %define TMPL_MODE_STR '16-bit long mode' 613 %endif 614 615 %ifdef TMPL_LM32 616 %ifdef TMPL_RM 617 %error "Both 'TMPL_LM32' and 'TMPL_RM' are defined." 618 %endif 619 %ifdef TMPL_PE16 620 %error "Both 'TMPL_LM32' and 'TMPL_PE16' are defined." 621 %endif 622 %ifdef TMPL_PE32 623 %error "Both 'TMPL_LM32' and 'TMPL_PE32' are defined." 624 %endif 625 %ifdef TMPL_PEV86 626 %error "Both 'TMPL_LM32' and 'TMPL_PEV86' are defined." 627 %endif 628 %ifdef TMPL_PP16 629 %error "Both 'TMPL_LM32' and 'TMPL_PP16' are defined." 630 %endif 631 %ifdef TMPL_PP32 632 %error "Both 'TMPL_LM32' and 'TMPL_PP32' are defined." 633 %endif 634 %ifdef TMPL_PPV86 635 %error "Both 'TMPL_LM32' and 'TMPL_PPV86' are defined." 636 %endif 637 %ifdef TMPL_PAE16 638 %error "Both 'TMPL_LM32' and 'TMPL_PAE16' are defined." 639 %endif 640 %ifdef TMPL_PAE32 641 %error "Both 'TMPL_LM32' and 'TMPL_PAE32' are defined." 642 %endif 643 %ifdef TMPL_PAEV86 644 %error "Both 'TMPL_LM32' and 'TMPL_PAEV86' are defined." 645 %endif 646 %ifdef TMPL_LM16 647 %error "Both 'TMPL_LM32' and 'TMPL_LM16' are defined." 648 %endif 649 %ifdef TMPL_LM64 650 %error "Both 'TMPL_LM32' and 'TMPL_LM64' are defined." 651 %endif 652 %define TMPL_CMN_LM 653 %define TMPL_CMN_PAGING 654 %define TMPL_CMN_P32 655 %define TMPL_32BIT 656 %define TMPL_BITS 32 657 %define TMPL_PTR_DEF dd 658 %define TMPL_NM(Name) _ %+ Name %+ _lm32 659 %define BS3_CMN_NM(Name) _ %+ Name %+ _c32 660 %define TMPL_UNDERSCORE _ 661 %define TMPL_MODE_LNAME lm32 662 %define TMPL_MODE_UNAME LM32 663 %define TMPL_MODE_STR '32-bit long mode' 664 %endif 665 666 %ifdef TMPL_LM64 667 %ifdef TMPL_RM 668 %error ""Both 'TMPL_LM64' and 'TMPL_RM' are defined."" 669 %endif 670 %ifdef TMPL_PE16 671 %error "Both 'TMPL_LM64' and 'TMPL_PE16' are defined." 672 %endif 673 %ifdef TMPL_PE32 674 %error "Both 'TMPL_LM64' and 'TMPL_PE32' are defined." 675 %endif 676 %ifdef TMPL_PEV86 677 %error "Both 'TMPL_LM64' and 'TMPL_PEV86' are defined." 678 %endif 679 %ifdef TMPL_PP16 680 %error "Both 'TMPL_LM64' and 'TMPL_PP16' are defined." 681 %endif 682 %ifdef TMPL_PP32 683 %error "Both 'TMPL_LM64' and 'TMPL_PP32' are defined." 684 %endif 685 %ifdef TMPL_PPV86 686 %error "Both 'TMPL_LM64' and 'TMPL_PPV86' are defined." 687 %endif 688 %ifdef TMPL_PAE16 689 %error "Both 'TMPL_LM64' and 'TMPL_PAE16' are defined." 690 %endif 691 %ifdef TMPL_PAE32 692 %error "Both 'TMPL_LM64' and 'TMPL_PAE32' are defined." 693 %endif 694 %ifdef TMPL_PAEV86 695 %error "Both 'TMPL_LM64' and 'TMPL_PAEV86' are defined." 696 %endif 697 %ifdef TMPL_LM16 698 %error "Both 'TMPL_LM64' and 'TMPL_LM16' are defined." 699 %endif 700 %ifdef TMPL_LM32 701 %error "Both 'TMPL_LM64' and 'TMPL_LM32' are defined." 702 %endif 703 %define TMPL_CMN_LM 704 %define TMPL_CMN_PAGING 705 %define TMPL_CMN_P64 134 135 %elif (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_64 706 136 %define TMPL_64BIT 707 137 %define TMPL_BITS 64 708 138 %define TMPL_PTR_DEF dq 709 %define TMPL_NM(Name) Name %+ _lm64 ; No underscore (C/C++ compatibility).710 %define BS3_CMN_NM(Name) Name %+ _c64 ; No underscore (C/C++ compatibility).711 139 %define TMPL_UNDERSCORE 140 %define BS3_CMN_NM(Name) Name %+ _c64 141 142 %else 143 %error "Invalid TMPL_MODE value!" 144 %endif 145 146 ; 147 ; Check the system specific mask and set derived values. 148 ; 149 %if (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_RM 150 %define TMPL_HAVE_BIOS 151 %define TMPL_CMN_R86 152 153 %elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PE16 154 %define TMPL_SYS_PE16 155 %define TMPL_CMN_PE 156 157 %elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PE32 158 %define TMPL_SYS_PE32 159 %define TMPL_CMN_PE 160 161 %elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PP16 162 %define TMPL_SYS_PP16 163 %define TMPL_CMN_PP 164 %define TMPL_CMN_PAGING 165 166 %elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PP32 167 %define TMPL_SYS_PP32 168 %define TMPL_CMN_PP 169 %define TMPL_CMN_PAGING 170 171 %elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PAE16 172 %define TMPL_SYS_PAE16 173 %define TMPL_CMN_PAE 174 %define TMPL_CMN_PAGING 175 176 %elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PAE32 177 %define TMPL_SYS_PAE32 178 %define TMPL_CMN_PAE 179 %define TMPL_CMN_PAGING 180 181 %elif (TMPL_MODE & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_LM 182 %define TMPL_SYS_LM 183 %define TMPL_CMN_LM 184 %define TMPL_CMN_PAGING 185 186 %else 187 %error "Invalid TMPL_MODE value!" 188 %endif 189 190 191 ; 192 ; Mode specific stuff. 193 ; 194 %if TMPL_MODE == BS3_MODE_RM 195 %define TMPL_RM 196 %define TMPL_MODE_STR "real mode" 197 %define TMPL_NM(Name) _ %+ Name %+ _rm 198 %define TMPL_MODE_LNAME rm 199 %define TMPL_MODE_UNAME RM 200 201 202 %elif TMPL_MODE == BS3_MODE_PE16 203 %define TMPL_PE16 204 %define TMPL_MODE_STR "16-bit prot, 16-bit" 205 %define TMPL_NM(Name) _ %+ Name %+ _pe16 206 %define TMPL_MODE_LNAME pe16 207 %define TMPL_MODE_UNAME PE16 208 209 %elif TMPL_MODE == BS3_MODE_PE16_32 210 %define TMPL_PE16_32 211 %define TMPL_MODE_STR "16-bit prot, 32-bit" 212 %define TMPL_NM(Name) _ %+ Name %+ _pe16_32 213 %define TMPL_MODE_LNAME pe16_32 214 %define TMPL_MODE_UNAME PE16_32 215 %define TMPL_CMN_WEIRD 216 217 %elif TMPL_MODE == BS3_MODE_PE16_V86 218 %define TMPL_PE16_V86 219 %define TMPL_MODE_STR "16-bit prot, v8086" 220 %define TMPL_NM(Name) _ %+ Name %+ _pe16_v86 221 %define TMPL_MODE_LNAME pe16_v86 222 %define TMPL_MODE_UNAME PE16_v86 223 %define TMPL_CMN_WEIRD 224 %define TMPL_CMN_WEIRD_V86 225 226 227 %elif TMPL_MODE == BS3_MODE_PE32 228 %define TMPL_PE32 229 %define TMPL_MODE_STR "32-bit prot, 32-bit" 230 %define TMPL_NM(Name) _ %+ Name %+ _pe32 231 %define TMPL_MODE_LNAME pe32 232 %define TMPL_MODE_UNAME PE32 233 234 %elif TMPL_MODE == BS3_MODE_PE32_16 235 %define TMPL_PE32_16 236 %define TMPL_MODE_STR "32-bit prot, 16-bit" 237 %define TMPL_NM(Name) _ %+ Name %+ _pe32_16 238 %define TMPL_MODE_LNAME pe32_16 239 %define TMPL_MODE_UNAME PE32_16 240 %define TMPL_CMN_WEIRD 241 242 %elif TMPL_MODE == BS3_MODE_PEV86 243 %define TMPL_PEV86 244 %define TMPL_MODE_STR "32-bit prot, v8086" 245 %define TMPL_NM(Name) _ %+ Name %+ _pev86 246 %define TMPL_MODE_LNAME pev86 247 %define TMPL_MODE_UNAME PEV86 248 249 250 %elif TMPL_MODE == BS3_MODE_PP16 251 %define TMPL_PP16 252 %define TMPL_MODE_STR "16-bit paged, 16-bit" 253 %define TMPL_NM(Name) _ %+ Name %+ _pp16 254 %define TMPL_MODE_LNAME pp16 255 %define TMPL_MODE_UNAME PP16 256 257 %elif TMPL_MODE == BS3_MODE_PP16_32 258 %define TMPL_PP16_32 259 %define TMPL_MODE_STR "16-bit paged, 32-bit" 260 %define TMPL_NM(Name) _ %+ Name %+ _pp16_32 261 %define TMPL_MODE_LNAME pp16_32 262 %define TMPL_MODE_UNAME PP16_32 263 %define TMPL_CMN_WEIRD 264 265 %elif TMPL_MODE == BS3_MODE_PP16_V86 266 %define TMPL_PP16_V86 267 %define TMPL_MODE_STR "16-bit paged, v8086" 268 %define TMPL_NM(Name) _ %+ Name %+ _pp16_v86 269 %define TMPL_MODE_LNAME pp16_v86 270 %define TMPL_MODE_UNAME PP16_v86 271 %define TMPL_CMN_WEIRD 272 %define TMPL_CMN_WEIRD_V86 273 274 275 %elif TMPL_MODE == BS3_MODE_PP32 276 %define TMPL_PP32 277 %define TMPL_MODE_STR "32-bit paged, 32-bit" 278 %define TMPL_NM(Name) _ %+ Name %+ _pp32 279 %define TMPL_MODE_LNAME pp32 280 %define TMPL_MODE_UNAME PP32 281 282 %elif TMPL_MODE == BS3_MODE_PP32_16 283 %define TMPL_PP32_16 284 %define TMPL_MODE_STR "32-bit paged, 16-bit" 285 %define TMPL_NM(Name) _ %+ Name %+ _pp32_16 286 %define TMPL_MODE_LNAME pp32_16 287 %define TMPL_MODE_UNAME PP32_16 288 %define TMPL_CMN_WEIRD 289 290 %elif TMPL_MODE == BS3_MODE_PPV86 291 %define TMPL_PPV86 292 %define TMPL_MODE_STR "32-bit paged, v8086" 293 %define TMPL_NM(Name) _ %+ Name %+ _ppv86 294 %define TMPL_MODE_LNAME ppv86 295 %define TMPL_MODE_UNAME PPV86 296 297 298 %elif TMPL_MODE == BS3_MODE_PAE16 299 %define TMPL_PAE16 300 %define TMPL_MODE_STR "16-bit pae, 16-bit" 301 %define TMPL_NM(Name) _ %+ Name %+ _pae16 302 %define TMPL_MODE_LNAME pae16 303 %define TMPL_MODE_UNAME PAE16 304 305 %elif TMPL_MODE == BS3_MODE_PAE16_32 306 %define TMPL_PAE16_32 307 %define TMPL_MODE_STR "16-bit pae, 32-bit" 308 %define TMPL_NM(Name) _ %+ Name %+ _pae16_32 309 %define TMPL_MODE_LNAME pae16_32 310 %define TMPL_MODE_UNAME PAE16_32 311 %define TMPL_CMN_WEIRD 312 313 %elif TMPL_MODE == BS3_MODE_PAE16_V86 314 %define TMPL_PAE16_V86 315 %define TMPL_MODE_STR "16-bit pae, v8086" 316 %define TMPL_NM(Name) _ %+ Name %+ _pae16_v86 317 %define TMPL_MODE_LNAME pae16_v86 318 %define TMPL_MODE_UNAME PAE16_v86 319 %define TMPL_CMN_WEIRD 320 %define TMPL_CMN_WEIRD_V86 321 322 323 %elif TMPL_MODE == BS3_MODE_PAE32 324 %define TMPL_PAE32 325 %define TMPL_MODE_STR "32-bit pae, 32-bit" 326 %define TMPL_NM(Name) _ %+ Name %+ _pae32 327 %define TMPL_MODE_LNAME pae32 328 %define TMPL_MODE_UNAME PAE32 329 330 %elif TMPL_MODE == BS3_MODE_PAE32_16 331 %define TMPL_PAE32_16 332 %define TMPL_MODE_STR "32-bit pae, 32-bit" 333 %define TMPL_NM(Name) _ %+ Name %+ _pae32_16 334 %define TMPL_MODE_LNAME pae32_16 335 %define TMPL_MODE_UNAME PAE32_16 336 %define TMPL_CMN_WEIRD 337 338 %elif TMPL_MODE == BS3_MODE_PAEV86 339 %define TMPL_PAEV86 340 %define TMPL_MODE_STR "32-bit pae, v8086 pae" 341 %define TMPL_NM(Name) _ %+ Name %+ _paev86 342 %define TMPL_MODE_LNAME paev86 343 %define TMPL_MODE_UNAME PAEV86 344 345 346 %elif TMPL_MODE == BS3_MODE_LM16 347 %define TMPL_LM16 348 %define TMPL_MODE_STR "long, 16-bit" 349 %define TMPL_NM(Name) _ %+ Name %+ _lm16 350 %define TMPL_MODE_LNAME lm16 351 %define TMPL_MODE_UNAME LM16 352 353 %elif TMPL_MODE == BS3_MODE_LM32 354 %define TMPL_LM32 355 %define TMPL_MODE_STR "long, 32-bit" 356 %define TMPL_NM(Name) _ %+ Name %+ _lm32 357 %define TMPL_MODE_LNAME lm32 358 %define TMPL_MODE_UNAME LM32 359 360 %elif TMPL_MODE == BS3_MODE_LM64 361 %define TMPL_LM64 362 %define TMPL_MODE_STR "long, 64-bit" 363 %define TMPL_NM(Name) Name %+ _lm64 712 364 %define TMPL_MODE_LNAME lm64 713 365 %define TMPL_MODE_UNAME LM64 714 %define TMPL_MODE_STR '64-bit long mode' 715 %endif 716 717 %ifndef TMPL_MODE_STR 718 %error "internal error" 366 367 %else 368 %error "Invalid TMPL_MODE value!!" 719 369 %endif 720 370 … … 739 389 740 390 741 ;742 ; Register aliases.743 ;744 %ifdef TMPL_64BIT745 %define xCB 8746 %define xDEF dq747 %define xRES resq748 %define xPRE qword749 %define xSP rsp750 %define xBP rbp751 %define xAX rax752 %define xBX rbx753 %define xCX rcx754 %define xDX rdx755 %define xDI rdi756 %define xSI rsi757 %define xWrtRIP wrt rip758 %define xPUSHF pushfq759 %define xPOPF popfq760 %define xRETF o64 retf761 %else762 %ifdef TMPL_32BIT763 %define xCB 4764 %define xDEF dd765 %define xRES resd766 %define xPRE dword767 %define xSP esp768 %define xBP ebp769 %define xAX eax770 %define xBX ebx771 %define xCX ecx772 %define xDX edx773 %define xDI edi774 %define xSI esi775 %define xWrtRIP776 %define xPUSHF pushfd777 %define xPOPF popfd778 %define xRETF retf779 %else780 %ifndef TMPL_16BIT781 %error "TMPL_XXBIT is not defined."782 %endif783 %define xCB 2784 %define xDEF dw785 %define xRES resw786 %define xPRE word787 %define xSP sp788 %define xBP bp789 %define xAX ax790 %define xBX bx791 %define xCX cx792 %define xDX dx793 %define xDI di794 %define xSI si795 %define xWrtRIP796 %define xPUSHF pushf797 %define xPOPF popf798 %define xRETF retf799 %endif800 %endif801 802 803 ;804 ; Register names corresponding to the max size for pop/push <reg>.805 ;806 ; 16-bit can push both 32-bit and 16-bit registers. This 's' prefixed variant807 ; is used when 16-bit should use the 32-bit register.808 ;809 %ifdef TMPL_64BIT810 %define sCB 8811 %define sDEF dq812 %define sRES resq813 %define sPRE qword814 %define sSP rsp815 %define sBP rbp816 %define sAX rax817 %define sBX rbx818 %define sCX rcx819 %define sDX rdx820 %define sDI rdi821 %define sSI rsi822 %define sPUSHF pushfq823 %define sPOPF popfq824 %else825 %define sCB 4826 %define sDEF dd827 %define sRES resd828 %define sPRE dword829 %define sSP esp830 %define sBP ebp831 %define sAX eax832 %define sBX ebx833 %define sCX ecx834 %define sDX edx835 %define sDI edi836 %define sSI esi837 %define sPUSHF pushfd838 %define sPOPF popfd839 %endif840 841 391 ;; @def TMPL_WRT_FLAT 842 392 ; WRT flat when not in 16-bit modes. … … 866 416 %define TMPL_WRT_SYSTEM16_OR_FLAT wrt FLAT 867 417 %endif 868 869 ;; @def BS3_EXTERN_TMPL870 ; Mangles the given name into a template specific one. For ease of use, the871 ; name is redefined to the mangled one, just like BS3_EXTERN_CMN does.872 ; @note Segment does not change.873 %macro BS3_EXTERN_TMPL 1874 extern TMPL_NM(%1)875 %undef %1876 %define %1 TMPL_NM(%1)877 %endmacro878 418 879 419 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r59789 r59863 54 54 /** @defgroup grp_bs3kit BS3Kit 55 55 * @{ */ 56 57 /** @name Execution modes. 58 * @{ */ 59 #define BS3_MODE_INVALID UINT8_C(0x00) 60 #define BS3_MODE_RM UINT8_C(0x01) /**< real mode. */ 61 #define BS3_MODE_PE16 UINT8_C(0x11) /**< 16-bit protected mode kernel+tss, running 16-bit code, unpaged. */ 62 #define BS3_MODE_PE16_32 UINT8_C(0x12) /**< 16-bit protected mode kernel+tss, running 32-bit code, unpaged. */ 63 #define BS3_MODE_PE16_V86 UINT8_C(0x13) /**< 16-bit protected mode kernel+tss, running virtual 8086 mode code, unpaged. */ 64 #define BS3_MODE_PE32 UINT8_C(0x22) /**< 32-bit protected mode kernel+tss, running 32-bit code, unpaged. */ 65 #define BS3_MODE_PE32_16 UINT8_C(0x21) /**< 32-bit protected mode kernel+tss, running 16-bit code, unpaged. */ 66 #define BS3_MODE_PEV86 UINT8_C(0x23) /**< 32-bit protected mode kernel+tss, running virtual 8086 mode code, unpaged. */ 67 #define BS3_MODE_PP16 UINT8_C(0x31) /**< 16-bit protected mode kernel+tss, running 16-bit code, paged. */ 68 #define BS3_MODE_PP16_32 UINT8_C(0x32) /**< 16-bit protected mode kernel+tss, running 32-bit code, paged. */ 69 #define BS3_MODE_PP16_V86 UINT8_C(0x33) /**< 16-bit protected mode kernel+tss, running virtual 8086 mode code, paged. */ 70 #define BS3_MODE_PP32 UINT8_C(0x42) /**< 32-bit protected mode kernel+tss, running 32-bit code, paged. */ 71 #define BS3_MODE_PP32_16 UINT8_C(0x41) /**< 32-bit protected mode kernel+tss, running 16-bit code, paged. */ 72 #define BS3_MODE_PPV86 UINT8_C(0x43) /**< 32-bit protected mode kernel+tss, running virtual 8086 mode code, paged. */ 73 #define BS3_MODE_PAE16 UINT8_C(0x51) /**< 16-bit protected mode kernel+tss, running 16-bit code, PAE paging. */ 74 #define BS3_MODE_PAE16_32 UINT8_C(0x52) /**< 16-bit protected mode kernel+tss, running 32-bit code, PAE paging. */ 75 #define BS3_MODE_PAE16_V86 UINT8_C(0x53) /**< 16-bit protected mode kernel+tss, running virtual 8086 mode, PAE paging. */ 76 #define BS3_MODE_PAE32 UINT8_C(0x62) /**< 32-bit protected mode kernel+tss, running 32-bit code, PAE paging. */ 77 #define BS3_MODE_PAE32_16 UINT8_C(0x61) /**< 32-bit protected mode kernel+tss, running 16-bit code, PAE paging. */ 78 #define BS3_MODE_PAEV86 UINT8_C(0x63) /**< 32-bit protected mode kernel+tss, running virtual 8086 mode, PAE paging. */ 79 #define BS3_MODE_LM16 UINT8_C(0x71) /**< 16-bit long mode (paged), kernel+tss always 64-bit. */ 80 #define BS3_MODE_LM32 UINT8_C(0x72) /**< 32-bit long mode (paged), kernel+tss always 64-bit. */ 81 #define BS3_MODE_LM64 UINT8_C(0x74) /**< 64-bit long mode (paged), kernel+tss always 64-bit. */ 82 83 #define BS3_MODE_CODE_MASK UINT8_C(0x0f) /**< Running code mask. */ 84 #define BS3_MODE_CODE_16 UINT8_C(0x01) /**< Running 16-bit code. */ 85 #define BS3_MODE_CODE_32 UINT8_C(0x02) /**< Running 32-bit code. */ 86 #define BS3_MODE_CODE_V86 UINT8_C(0x03) /**< Running 16-bit virtual 8086 code. */ 87 #define BS3_MODE_CODE_64 UINT8_C(0x04) /**< Running 64-bit code. */ 88 89 #define BS3_MODE_SYS_MASK UINT8_C(0xf0) /**< kernel+tss mask. */ 90 #define BS3_MODE_SYS_RM UINT8_C(0x00) /**< Real mode kernel+tss. */ 91 #define BS3_MODE_SYS_PE16 UINT8_C(0x10) /**< 16-bit protected mode kernel+tss. */ 92 #define BS3_MODE_SYS_PE32 UINT8_C(0x20) /**< 32-bit protected mode kernel+tss. */ 93 #define BS3_MODE_SYS_PP16 UINT8_C(0x30) /**< 16-bit paged protected mode kernel+tss. */ 94 #define BS3_MODE_SYS_PP32 UINT8_C(0x40) /**< 32-bit paged protected mode kernel+tss. */ 95 #define BS3_MODE_SYS_PAE16 UINT8_C(0x50) /**< 16-bit PAE paged protected mode kernel+tss. */ 96 #define BS3_MODE_SYS_PAE32 UINT8_C(0x60) /**< 32-bit PAE paged protected mode kernel+tss. */ 97 #define BS3_MODE_SYS_LM UINT8_C(0x70) /**< 64-bit (paged) long mode protected mode kernel+tss. */ 98 99 /** Whether the mode has paging enabled. */ 100 #define BS3_MODE_IS_PAGED(a_fMode) ((a_fMode) >= BS3_MODE_PP16) 101 102 /** Whether the mode is running v8086 code. */ 103 #define BS3_MODE_IS_V86(a_fMode) (((a_fMode) & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_V86) 104 /** Whether the we're executing in real mode or v8086 mode. */ 105 #define BS3_MODE_IS_RM_OR_V86(a_fMode) ((a_fMode) == BS3_MODE_RM || BS3_MODE_IS_V86(a_fMode)) 106 /** Whether the mode is running 16-bit code, except v8086. */ 107 #define BS3_MODE_IS_16BIT_CODE_NO_V86(a_fMode) (((a_fMode) & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_16) 108 /** Whether the mode is running 16-bit code (includes v8086). */ 109 #define BS3_MODE_IS_16BIT_CODE(a_fMode) (BS3_MODE_IS_16BIT_CODE_NO_V86(a_fMode) || BS3_MODE_IS_V86(a_fMode)) 110 /** Whether the mode is running 32-bit code. */ 111 #define BS3_MODE_IS_32BIT_CODE(a_fMode) (((a_fMode) & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_32) 112 /** Whether the mode is running 64-bit code. */ 113 #define BS3_MODE_IS_64BIT_CODE(a_fMode) (((a_fMode) & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_64) 114 115 /** Whether the system is in real mode. */ 116 #define BS3_MODE_IS_RM_SYS(a_fMode) (((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_RM) 117 /** Whether the system is some 16-bit mode that isn't real mode. */ 118 #define BS3_MODE_IS_16BIT_SYS_NO_RM(a_fMode) ( ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PE16 \ 119 || ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PP16 \ 120 || ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PAE16) 121 /** Whether the system is some 16-bit mode (includes real mode). */ 122 #define BS3_MODE_IS_16BIT_SYS(a_fMode) (BS3_MODE_IS_16BIT_SYS_NO_RM(a_fMode) || BS3_MODE_IS_RM_SYS(a_fMode)) 123 /** Whether the system is some 32-bit mode. */ 124 #define BS3_MODE_IS_32BIT_SYS(a_fMode) ( ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PE32 \ 125 || ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PP32 \ 126 || ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PAE32) 127 /** Whether the system is long mode. */ 128 #define BS3_MODE_IS_64BIT_SYS(a_fMode) (((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_LM) 129 130 /** @todo testcase: How would long-mode handle a 16-bit TSS loaded prior to the switch? (mainly stack switching wise) Hopefully, it will tripple fault, right? */ 131 /** @} */ 56 132 57 133 … … 722 798 723 799 800 /** The current mode (BS3_MODE_XXX) of CPU \#0. */ 801 extern uint8_t BS3_FAR_DATA BS3_DATA_NM(g_bBs3CurrentMode); 802 803 724 804 #ifdef __WATCOMC__ 725 805 /** … … 741 821 # define BS3_IS_PROTECTED_MODE() (true) 742 822 #else 743 # define BS3_IS_PROTECTED_MODE() (Bs3AsmSmsw() & 1 /*PE*/) 823 # if 1 824 # define BS3_IS_PROTECTED_MODE() (!BS3_MODE_IS_RM_SYS(BS3_DATA_NM(g_bBs3CurrentMode))) 825 # else 826 # define BS3_IS_PROTECTED_MODE() (Bs3AsmSmsw() & 1 /*PE*/) 827 # endif 744 828 #endif 745 829 … … 1235 1319 BS3_DECL(void) Bs3TestInit_c64(const char BS3_FAR *pszTest); /**< @copydoc Bs3TestInit_c16 */ 1236 1320 #define Bs3TestInit BS3_CMN_NM(Bs3TestInit) /**< Selects #Bs3TestInit_c16, #Bs3TestInit_c32 or #Bs3TestInit_c64. */ 1321 1322 1323 /** 1324 * Equivalent to RTTestSummaryAndDestroy. 1325 */ 1326 BS3_DECL(void) Bs3TestTerm_c16(void); 1327 BS3_DECL(void) Bs3TestTerm_c32(void); /**< @copydoc Bs3TestTerm_c16 */ 1328 BS3_DECL(void) Bs3TestTerm_c64(void); /**< @copydoc Bs3TestTerm_c16 */ 1329 #define Bs3TestTerm BS3_CMN_NM(Bs3TestTerm) /**< Selects #Bs3TestTerm_c16, #Bs3TestTerm_c32 or #Bs3TestTerm_c64. */ 1237 1330 1238 1331 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r59789 r59863 36 36 %undef RT_ASMDEFS_INC_FIRST_FILE 37 37 38 ;; 39 ; Macro for setting register aliases according to the bit count given by %1. 40 ; 41 %macro BS3_SET_REG_ALIASES 1 42 ; 43 ; Register aliases. 44 ; 45 %if %1 == 64 46 %define xCB 8 47 %define xDEF dq 48 %define xRES resq 49 %define xPRE qword 50 %define xSP rsp 51 %define xBP rbp 52 %define xAX rax 53 %define xBX rbx 54 %define xCX rcx 55 %define xDX rdx 56 %define xDI rdi 57 %define xSI rsi 58 %define xWrtRIP wrt rip 59 %define xPUSHF pushfq 60 %define xPOPF popfq 61 %define xRETF o64 retf 62 %elif %1 == 32 63 %define xCB 4 64 %define xDEF dd 65 %define xRES resd 66 %define xPRE dword 67 %define xSP esp 68 %define xBP ebp 69 %define xAX eax 70 %define xBX ebx 71 %define xCX ecx 72 %define xDX edx 73 %define xDI edi 74 %define xSI esi 75 %define xWrtRIP 76 %define xPUSHF pushfd 77 %define xPOPF popfd 78 %define xRETF retf 79 %elif %1 == 16 80 %define xCB 2 81 %define xDEF dw 82 %define xRES resw 83 %define xPRE word 84 %define xSP sp 85 %define xBP bp 86 %define xAX ax 87 %define xBX bx 88 %define xCX cx 89 %define xDX dx 90 %define xDI di 91 %define xSI si 92 %define xWrtRIP 93 %define xPUSHF pushf 94 %define xPOPF popf 95 %define xRETF retf 96 %else 97 %error "Invalid BS3_SET_REG_ALIASES argument:" %1 98 %endif 99 100 101 ; 102 ; Register names corresponding to the max size for pop/push <reg>. 103 ; 104 ; 16-bit can push both 32-bit and 16-bit registers. This 's' prefixed variant 105 ; is used when 16-bit should use the 32-bit register. 106 ; 107 %if %1 == 64 108 %define sCB 8 109 %define sDEF dq 110 %define sRES resq 111 %define sPRE qword 112 %define sSP rsp 113 %define sBP rbp 114 %define sAX rax 115 %define sBX rbx 116 %define sCX rcx 117 %define sDX rdx 118 %define sDI rdi 119 %define sSI rsi 120 %define sPUSHF pushfq 121 %define sPOPF popfq 122 %else 123 %define sCB 4 124 %define sDEF dd 125 %define sRES resd 126 %define sPRE dword 127 %define sSP esp 128 %define sBP ebp 129 %define sAX eax 130 %define sBX ebx 131 %define sCX ecx 132 %define sDX edx 133 %define sDI edi 134 %define sSI esi 135 %define sPUSHF pushfd 136 %define sPOPF popfd 137 %endif 138 %endmacro 139 140 ; Default to register aliases for ARCH_BITS. 141 BS3_SET_REG_ALIASES ARCH_BITS 142 143 38 144 ;; Wrapper around BITS. 39 ; Updates __BITS__ (built-in variable in nasm, we work it for yasm). 145 ; Updates __BITS__ (built-in variable in nasm, we work it for yasm) as well 146 ; a number of convenient macros and register aliases. 147 ; 40 148 ; @param %1 The CPU bit count: 16, 32 or 64 41 149 ; @remarks ARCH_BITS is not modified and will remain what it was on the … … 81 189 %undef BS3_WRT_RIP 82 190 %if %1 == 64 83 %define BS3_WRT_RIP wrt rip 84 %else 85 %define BS3_WRT_RIP 191 %ifdef __YASM__ 192 %define BS3_WRT_RIP(a_Sym) a_Sym wrt rip 193 %else 194 %define BS3_WRT_RIP(a_Sym) rel a_Sym ; Baka! Why couldn't they do 'wrt rip' like yasm? 195 %endif 196 %else 197 %define BS3_WRT_RIP(a_Sym) a_Sym 86 198 %endif 87 199 … … 106 218 %define BS3_IF_64BIT_OTHERWISE(a_64BitExpr, a_OtherwiseExpr) a_OtherwiseExpr 107 219 %endif 108 %endmacro 220 221 BS3_SET_REG_ALIASES %1 222 %endmacro 223 109 224 110 225 ;; Emulate the __BITS__ macro in NASM 2.0+. Follows BS3_SET_BITS. … … 123 238 ; other modes. Follows BS3_SET_BITS. 124 239 %if ARCH_BITS == 64 125 %define BS3_WRT_RIP wrt rip 240 %ifdef __YASM__ 241 %define BS3_WRT_RIP(a_Sym) a_Sym wrt rip 242 %else 243 %define BS3_WRT_RIP(a_Sym) rel a_Sym ; Baka! Why couldn't they do 'wrt rip' like yasm? 244 %endif 126 245 %else 127 %define BS3_WRT_RIP 246 %define BS3_WRT_RIP(a_Sym) a_Sym 128 247 %endif 129 248 … … 363 482 %endmacro 364 483 484 ;; @def BS3_EXTERN_TMPL 485 ; Mangles the given name into a template specific one. For ease of use, the 486 ; name is redefined to the mangled one, just like BS3_EXTERN_CMN does. 487 ; @note Segment does not change. 488 %macro BS3_EXTERN_TMPL 1 489 extern TMPL_NM(%1) 490 %undef %1 491 %define %1 TMPL_NM(%1) 492 %endmacro 493 494 365 495 ;; 366 496 ; Mangles a 16-bit and 32-bit accessible data name. … … 585 715 %endif 586 716 call %1 717 %endmacro 718 719 720 ;; @name Execution Modes 721 ; @{ 722 %define BS3_MODE_INVALID 000h 723 %define BS3_MODE_RM 001h ;;< real mode. 724 %define BS3_MODE_PE16 011h ;;< 16-bit protected mode kernel+tss, running 16-bit code, unpaged. 725 %define BS3_MODE_PE16_32 012h ;;< 16-bit protected mode kernel+tss, running 32-bit code, unpaged. 726 %define BS3_MODE_PE16_V86 013h ;;< 16-bit protected mode kernel+tss, running virtual 8086 mode code, unpaged. 727 %define BS3_MODE_PE32 022h ;;< 32-bit protected mode kernel+tss, running 32-bit code, unpaged. 728 %define BS3_MODE_PE32_16 021h ;;< 32-bit protected mode kernel+tss, running 16-bit code, unpaged. 729 %define BS3_MODE_PEV86 023h ;;< 32-bit protected mode kernel+tss, running virtual 8086 mode code, unpaged. 730 %define BS3_MODE_PP16 031h ;;< 16-bit protected mode kernel+tss, running 16-bit code, paged. 731 %define BS3_MODE_PP16_32 032h ;;< 16-bit protected mode kernel+tss, running 32-bit code, paged. 732 %define BS3_MODE_PP16_V86 033h ;;< 16-bit protected mode kernel+tss, running virtual 8086 mode code, paged. 733 %define BS3_MODE_PP32 042h ;;< 32-bit protected mode kernel+tss, running 32-bit code, paged. 734 %define BS3_MODE_PP32_16 041h ;;< 32-bit protected mode kernel+tss, running 16-bit code, paged. 735 %define BS3_MODE_PPV86 043h ;;< 32-bit protected mode kernel+tss, running virtual 8086 mode code, paged. 736 %define BS3_MODE_PAE16 051h ;;< 16-bit protected mode kernel+tss, running 16-bit code, PAE paging. 737 %define BS3_MODE_PAE16_32 052h ;;< 16-bit protected mode kernel+tss, running 32-bit code, PAE paging. 738 %define BS3_MODE_PAE16_V86 053h ;;< 16-bit protected mode kernel+tss, running virtual 8086 mode, PAE paging. 739 %define BS3_MODE_PAE32 062h ;;< 32-bit protected mode kernel+tss, running 32-bit code, PAE paging. 740 %define BS3_MODE_PAE32_16 061h ;;< 32-bit protected mode kernel+tss, running 16-bit code, PAE paging. 741 %define BS3_MODE_PAEV86 063h ;;< 32-bit protected mode kernel+tss, running virtual 8086 mode, PAE paging. 742 %define BS3_MODE_LM16 071h ;;< 16-bit long mode (paged), kernel+tss always 64-bit. 743 %define BS3_MODE_LM32 072h ;;< 32-bit long mode (paged), kernel+tss always 64-bit. 744 %define BS3_MODE_LM64 074h ;;< 64-bit long mode (paged), kernel+tss always 64-bit. 745 746 %define BS3_MODE_CODE_MASK 00fh ;;< Running code mask. 747 %define BS3_MODE_CODE_16 001h ;;< Running 16-bit code. 748 %define BS3_MODE_CODE_32 002h ;;< Running 32-bit code. 749 %define BS3_MODE_CODE_V86 003h ;;< Running 16-bit virtual 8086 code. 750 %define BS3_MODE_CODE_64 004h ;;< Running 64-bit code. 751 752 %define BS3_MODE_SYS_MASK 0f0h ;;< kernel+tss mask. 753 %define BS3_MODE_SYS_RM 000h ;;< Real mode kernel+tss. 754 %define BS3_MODE_SYS_PE16 010h ;;< 16-bit protected mode kernel+tss. 755 %define BS3_MODE_SYS_PE32 020h ;;< 32-bit protected mode kernel+tss. 756 %define BS3_MODE_SYS_PP16 030h ;;< 16-bit paged protected mode kernel+tss. 757 %define BS3_MODE_SYS_PP32 040h ;;< 32-bit paged protected mode kernel+tss. 758 %define BS3_MODE_SYS_PAE16 050h ;;< 16-bit PAE paged protected mode kernel+tss. 759 %define BS3_MODE_SYS_PAE32 060h ;;< 32-bit PAE paged protected mode kernel+tss. 760 %define BS3_MODE_SYS_LM 070h ;;< 64-bit (paged) long mode protected mode kernel+tss. 761 762 ;; Whether the mode has paging enabled. 763 %define BS3_MODE_IS_PAGED(a_fMode) ((a_fMode) >= BS3_MODE_PP16) 764 765 ;; Whether the mode is running v8086 code. 766 %define BS3_MODE_IS_V86(a_fMode) (((a_fMode) & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_V86) 767 ;; Whether the we're executing in real mode or v8086 mode. 768 %define BS3_MODE_IS_RM_OR_V86(a_fMode) ((a_fMode) == BS3_MODE_RM || BS3_MODE_IS_V86(a_fMode)) 769 ;; Whether the mode is running 16-bit code, except v8086. 770 %define BS3_MODE_IS_16BIT_CODE_NO_V86(a_fMode) (((a_fMode) & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_16) 771 ;; Whether the mode is running 16-bit code (includes v8086). 772 %define BS3_MODE_IS_16BIT_CODE(a_fMode) (BS3_MODE_IS_16BIT_CODE_NO_V86(a_fMode) || BS3_MODE_IS_V86(a_fMode)) 773 ;; Whether the mode is running 32-bit code. 774 %define BS3_MODE_IS_32BIT_CODE(a_fMode) (((a_fMode) & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_32) 775 ;; Whether the mode is running 64-bit code. 776 %define BS3_MODE_IS_64BIT_CODE(a_fMode) (((a_fMode) & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_64) 777 778 ;; Whether the system is in real mode. 779 %define BS3_MODE_IS_RM_SYS(a_fMode) (((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_RM) 780 ;; Whether the system is some 16-bit mode that isn't real mode. 781 %define BS3_MODE_IS_16BIT_SYS_NO_RM(a_fMode) ( ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PE16 \ 782 || ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PP16 \ 783 || ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PAE16) 784 ;; Whether the system is some 16-bit mode (includes real mode). 785 %define BS3_MODE_IS_16BIT_SYS(a_fMode) (BS3_MODE_IS_16BIT_SYS_NO_RM(a_fMode) || BS3_MODE_IS_RM_SYS(a_fMode)) 786 ;; Whether the system is some 32-bit mode. 787 %define BS3_MODE_IS_32BIT_SYS(a_fMode) ( ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PE32 \ 788 || ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PP32 \ 789 || ((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_PAE32) 790 ;; Whether the system is long mode. 791 %define BS3_MODE_IS_64BIT_SYS(a_fMode) (((a_fMode) & BS3_MODE_SYS_MASK) == BS3_MODE_SYS_LM) 792 793 ;; @} 794 795 ;; 796 ; Includes the file %1 with TMPL_MODE set to all possible value. 797 ; @param 1 Double quoted include file name. 798 %macro BS3_INSTANTIATE_TEMPLATE_WITH_WEIRD_ONES 1 799 %define TMPL_MODE BS3_MODE_RM 800 %include %1 801 802 %define TMPL_MODE BS3_MODE_PE16 803 %include %1 804 %define TMPL_MODE BS3_MODE_PE16_32 805 %include %1 806 %define TMPL_MODE BS3_MODE_PE16_V86 807 %include %1 808 809 %define TMPL_MODE BS3_MODE_PE32 810 %include %1 811 %define TMPL_MODE BS3_MODE_PE32_16 812 %include %1 813 %define TMPL_MODE BS3_MODE_PEV86 814 %include %1 815 816 %define TMPL_MODE BS3_MODE_PP16 817 %include %1 818 %define TMPL_MODE BS3_MODE_PP16_32 819 %include %1 820 %define TMPL_MODE BS3_MODE_PP16_V86 821 %include %1 822 823 %define TMPL_MODE BS3_MODE_PP32 824 %include %1 825 %define TMPL_MODE BS3_MODE_PP32_16 826 %include %1 827 %define TMPL_MODE BS3_MODE_PPV86 828 %include %1 829 830 %define TMPL_MODE BS3_MODE_PAE16 831 %include %1 832 %define TMPL_MODE BS3_MODE_PAE16_32 833 %include %1 834 %define TMPL_MODE BS3_MODE_PAE16_V86 835 %include %1 836 837 %define TMPL_MODE BS3_MODE_PAE32 838 %include %1 839 %define TMPL_MODE BS3_MODE_PAE32_16 840 %include %1 841 %define TMPL_MODE BS3_MODE_PAEV86 842 %include %1 843 844 %define TMPL_MODE BS3_MODE_LM16 845 %include %1 846 %define TMPL_MODE BS3_MODE_LM32 847 %include %1 848 %define TMPL_MODE BS3_MODE_LM64 849 %include %1 850 %endmacro 851 852 853 ;; 854 ; Includes the file %1 with TMPL_MODE set to all but the "weird" value. 855 ; @param 1 Double quoted include file name. 856 %macro BS3_INSTANTIATE_TEMPLATE_ESSENTIALS 1 857 %define TMPL_MODE BS3_MODE_RM 858 %include %1 859 860 %define TMPL_MODE BS3_MODE_PE16 861 %include %1 862 863 %define TMPL_MODE BS3_MODE_PE32 864 %include %1 865 %define TMPL_MODE BS3_MODE_PEV86 866 %include %1 867 868 %define TMPL_MODE BS3_MODE_PP16 869 %include %1 870 871 %define TMPL_MODE BS3_MODE_PP32 872 %include %1 873 %define TMPL_MODE BS3_MODE_PPV86 874 %include %1 875 876 %define TMPL_MODE BS3_MODE_PAE16 877 %include %1 878 879 %define TMPL_MODE BS3_MODE_PAE32 880 %include %1 881 %define TMPL_MODE BS3_MODE_PAEV86 882 %include %1 883 884 %define TMPL_MODE BS3_MODE_LM16 885 %include %1 886 %define TMPL_MODE BS3_MODE_LM32 887 %include %1 888 %define TMPL_MODE BS3_MODE_LM64 889 %include %1 890 %endmacro 891 892 ;; 893 ; Includes the file %1 with TMPL_MODE set to a 16-bit, a 32-bit and a 64-bit value. 894 ; @param 1 Double quoted include file name. 895 %macro BS3_INSTANTIATE_COMMON_TEMPLATE 1 896 %define TMPL_MODE BS3_MODE_RM 897 %include %1 898 %define TMPL_MODE BS3_MODE_PE32 899 %include %1 900 %define TMPL_MODE BS3_MODE_LM64 901 %include %1 587 902 %endmacro 588 903 … … 850 1165 %define BS3_SEL_TILED_AREA_SIZE 001000000h ;;< 16-bit data tiling: Size of addressable area, in bytes. (16 MB) 851 1166 852 %define BS3_SEL_FREE_PART1 0e00h ;;< Free selector space - part \ #1.853 %define BS3_SEL_FREE_PART1_LAST 0ff8h ;;< Free selector space - part \ #1, last entry.1167 %define BS3_SEL_FREE_PART1 0e00h ;;< Free selector space - part \%1. 1168 %define BS3_SEL_FREE_PART1_LAST 0ff8h ;;< Free selector space - part \%1, last entry. 854 1169 855 1170 %define BS3_SEL_TEXT16 1000h ;;< The BS3TEXT16 selector. 856 1171 857 %define BS3_SEL_FREE_PART2 1008h ;;< Free selector space - part \ #2.858 %define BS3_SEL_FREE_PART2_LAST 1ff8h ;;< Free selector space - part \ #2, last entry.1172 %define BS3_SEL_FREE_PART2 1008h ;;< Free selector space - part \%2. 1173 %define BS3_SEL_FREE_PART2_LAST 1ff8h ;;< Free selector space - part \%2, last entry. 859 1174 860 1175 %define BS3_SEL_SYSTEM16 2000h ;;< The BS3SYSTEM16 selector. 861 1176 862 %define BS3_SEL_FREE_PART3 2008h ;;< Free selector space - part \ #3.863 %define BS3_SEL_FREE_PART3_LAST 26f8h ;;< Free selector space - part \ #3, last entry.1177 %define BS3_SEL_FREE_PART3 2008h ;;< Free selector space - part \%3. 1178 %define BS3_SEL_FREE_PART3_LAST 26f8h ;;< Free selector space - part \%3, last entry. 864 1179 865 1180 %define BS3_SEL_DATA16 2700h ;;< The BS3DATA16 selector.
Note:
See TracChangeset
for help on using the changeset viewer.