Changeset 60019 in vbox
- Timestamp:
- Mar 14, 2016 11:33:59 AM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/VBoxBs3ObjConverter.cpp
r60009 r60019 1575 1575 return false; 1576 1576 1577 /* If the symbol doesn't start with an underscore, add an underscore 1578 prefixed alias to ease access from 16-bit and 32-bit code. */ 1579 if (*pszName != '_') 1577 /* If the symbol doesn't start with an underscore and is a _c64 or _lm64 symbol, 1578 add an underscore prefixed alias to ease access from 16-bit and 32-bit code. */ 1579 size_t cchName = strlen(pszName); 1580 if ( *pszName != '_' 1581 && ( (cchName > 4 && strcmp(&pszName[cchName - 4], "_c64") == 0) 1582 || (cchName > 5 && strcmp(&pszName[cchName - 5], "_lm64") == 0) ) ) 1580 1583 { 1581 1584 char szCdeclName[512]; 1582 size_t cchName = strlen(pszName);1583 1585 if (cchName > sizeof(szCdeclName) - 2) 1584 1586 cchName = sizeof(szCdeclName) - 2; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PrintChr.asm
r60000 r60019 65 65 .do_vga_bios_call: 66 66 mov al, [xBP + xCB*2] ; Load the char 67 cmp al, 0ah ; \n 68 je .newline 67 69 mov bx, 0ff00h 68 70 mov ah, 0eh 71 int 10h 72 jmp .return 73 .newline: 74 mov ax, 0e0dh ; cmd + '\r'. 75 mov bx, 0ff00h 76 int 10h 77 mov ax, 0e0ah ; cmd + '\n'. 78 mov bx, 0ff00h 69 79 int 10h 70 80 jmp .return -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo16BitV86.asm
r59984 r60019 97 97 or byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86 98 98 99 %if TMPL_BITS != 16100 ; Set GS.101 mov ax, gs102 mov [xSP + 4*4 + 20h], ax103 %endif104 105 99 ; Thunk return SS:ESP to real-mode address via 32-bit flat. 106 lea eax, [esp + 4*4 + 24h ]100 lea eax, [esp + 4*4 + 24h + xCB] 107 101 push ss 108 102 push eax -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestFailed.c
r59865 r60019 43 43 44 44 /* 45 * VMMDev first. 45 * VMMDev first. We postpone newline processing here so we can strip one 46 * trailing newline. 46 47 */ 47 48 if (BS3_DATA_NM(g_fbBs3VMMDevTesting)) 48 ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, ch); 49 { 50 if (*pfNewLine && ch != '\0') 51 ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, '\n'); 52 if (ch != '\n') 53 ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, ch); 54 } 49 55 50 56 /* … … 53 59 if (ch != 0) 54 60 { 55 if (ch != '\n') 56 { 57 Bs3PrintChr(ch); 58 *pfNewLine = false; 59 } 60 else 61 { 62 Bs3PrintStr("\r\n"); 63 *pfNewLine = true; 64 } 61 Bs3PrintChr(ch); 62 *pfNewLine = ch == '\n'; 65 63 } 66 64 /* We're called with '\0' to indicate end-of-string. Supply trailing 67 65 newline if necessary. */ 68 66 else if (!*pfNewLine) 69 Bs3Print Str("\r\n");67 Bs3PrintChr('\n'); 70 68 71 69 return 1; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestInit.c
r59941 r60019 57 57 */ 58 58 Bs3PrintStr(pszTest); 59 Bs3PrintStr(": TESTING...\ r\n");59 Bs3PrintStr(": TESTING...\n"); 60 60 61 61 /* -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSkipped.c
r59865 r60019 31 31 #include "bs3kit-template-header.h" 32 32 #include "bs3-cmn-test.h" 33 #include <iprt/asm-amd64-x86.h> 33 34 34 35 … … 38 39 BS3_DECL(void) Bs3TestSkippedV(const char *pszFormat, va_list va) 39 40 { 40 /* Just mark it as skipped and deal with it when the sub-test is done. */ 41 BS3_DATA_NM(g_fbBs3SubTestSkipped) = true; 41 if (BS3_DATA_NM(g_cusBs3TestErrors) == BS3_DATA_NM(g_cusBs3SubTestAtErrors)) 42 { 43 /* Just mark it as skipped and deal with it when the sub-test is done. */ 44 BS3_DATA_NM(g_fbBs3SubTestSkipped) = true; 42 45 43 /* The reason why it was skipp is optional. */ 44 if (pszFormat) 45 { 46 bool fNewLine = false; 47 Bs3StrFormatV(pszFormat, va, bs3TestFailedStrOutput, &fNewLine); 46 /* Tell VMMDev */ 47 if (BS3_DATA_NM(g_fbBs3VMMDevTesting)) 48 ASMOutU32(VMMDEV_TESTING_IOPORT_CMD, VMMDEV_TESTING_CMD_SKIPPED); 49 50 /* The reason why it was skipped is optional. */ 51 if (pszFormat) 52 { 53 bool fNewLine = false; 54 Bs3StrFormatV(pszFormat, va, bs3TestFailedStrOutput, &fNewLine); 55 } 56 else if (BS3_DATA_NM(g_fbBs3VMMDevTesting)) 57 ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, 0); 48 58 } 49 59 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-instantiate-common.h
r60003 r60019 1 1 2 2 3 /* 4 * Instantiating common code (c16, c32, c64). 5 */ 6 #define BS3_INSTANTIATING_CMN 3 7 4 8 #ifdef BS3_CMN_INSTANTIATE_FILE1 … … 29 33 #endif 30 34 35 #undef BS3_INSTANTIATING_CMN 36 37 38 /* 39 * Instantiating code for each individual mode (rm, pe16, pe16_32, ..). 40 */ 41 #define BS3_INSTANTIATING_MODE 42 43 #ifdef BS3_MODE_INSTANTIATE_FILE1 44 45 # define BS3_MODE_INSTANTIATE_FILE1_B <BS3_MODE_INSTANTIATE_FILE1> 46 47 # if ARCH_BITS == 16 /* 16-bit */ 48 49 # define TMPL_MODE BS3_MODE_RM 50 # include <bs3kit/bs3kit-template-header.h> 51 # include BS3_MODE_INSTANTIATE_FILE1_B 52 # include <bs3kit/bs3kit-template-footer.h> 53 54 # define TMPL_MODE BS3_MODE_PE16 55 # include <bs3kit/bs3kit-template-header.h> 56 # include BS3_MODE_INSTANTIATE_FILE1_B 57 # include <bs3kit/bs3kit-template-footer.h> 58 59 # define TMPL_MODE BS3_MODE_PE16_V86 60 # include <bs3kit/bs3kit-template-header.h> 61 # include BS3_MODE_INSTANTIATE_FILE1_B 62 # include <bs3kit/bs3kit-template-footer.h> 63 64 # define TMPL_MODE BS3_MODE_PE32_16 65 # include <bs3kit/bs3kit-template-header.h> 66 # include BS3_MODE_INSTANTIATE_FILE1_B 67 # include <bs3kit/bs3kit-template-footer.h> 68 69 # define TMPL_MODE BS3_MODE_PEV86 70 # include <bs3kit/bs3kit-template-header.h> 71 # include BS3_MODE_INSTANTIATE_FILE1_B 72 # include <bs3kit/bs3kit-template-footer.h> 73 74 # define TMPL_MODE BS3_MODE_PP16 75 # include <bs3kit/bs3kit-template-header.h> 76 # include BS3_MODE_INSTANTIATE_FILE1_B 77 # include <bs3kit/bs3kit-template-footer.h> 78 79 # define TMPL_MODE BS3_MODE_PP16_V86 80 # include <bs3kit/bs3kit-template-header.h> 81 # include BS3_MODE_INSTANTIATE_FILE1_B 82 # include <bs3kit/bs3kit-template-footer.h> 83 84 # define TMPL_MODE BS3_MODE_PP32_16 85 # include <bs3kit/bs3kit-template-header.h> 86 # include BS3_MODE_INSTANTIATE_FILE1_B 87 # include <bs3kit/bs3kit-template-footer.h> 88 89 # define TMPL_MODE BS3_MODE_PPV86 90 # include <bs3kit/bs3kit-template-header.h> 91 # include BS3_MODE_INSTANTIATE_FILE1_B 92 # include <bs3kit/bs3kit-template-footer.h> 93 94 # define TMPL_MODE BS3_MODE_PAE16 95 # include <bs3kit/bs3kit-template-header.h> 96 # include BS3_MODE_INSTANTIATE_FILE1_B 97 # include <bs3kit/bs3kit-template-footer.h> 98 99 # define TMPL_MODE BS3_MODE_PAE16_V86 100 # include <bs3kit/bs3kit-template-header.h> 101 # include BS3_MODE_INSTANTIATE_FILE1_B 102 # include <bs3kit/bs3kit-template-footer.h> 103 104 # define TMPL_MODE BS3_MODE_PAE32_16 105 # include <bs3kit/bs3kit-template-header.h> 106 # include BS3_MODE_INSTANTIATE_FILE1_B 107 # include <bs3kit/bs3kit-template-footer.h> 108 109 # define TMPL_MODE BS3_MODE_PAEV86 110 # include <bs3kit/bs3kit-template-header.h> 111 # include BS3_MODE_INSTANTIATE_FILE1_B 112 # include <bs3kit/bs3kit-template-footer.h> 113 114 # define TMPL_MODE BS3_MODE_LM16 115 # include <bs3kit/bs3kit-template-header.h> 116 # include BS3_MODE_INSTANTIATE_FILE1_B 117 # include <bs3kit/bs3kit-template-footer.h> 118 119 # endif 120 121 # if ARCH_BITS == 32 /* 32-bit */ 122 123 # define TMPL_MODE BS3_MODE_PE16_32 124 # include <bs3kit/bs3kit-template-header.h> 125 # include BS3_MODE_INSTANTIATE_FILE1_B 126 # include <bs3kit/bs3kit-template-footer.h> 127 128 # define TMPL_MODE BS3_MODE_PE32 129 # include <bs3kit/bs3kit-template-header.h> 130 # include BS3_MODE_INSTANTIATE_FILE1_B 131 # include <bs3kit/bs3kit-template-footer.h> 132 133 # define TMPL_MODE BS3_MODE_PP16_32 134 # include <bs3kit/bs3kit-template-header.h> 135 # include BS3_MODE_INSTANTIATE_FILE1_B 136 # include <bs3kit/bs3kit-template-footer.h> 137 138 # define TMPL_MODE BS3_MODE_PP32 139 # include <bs3kit/bs3kit-template-header.h> 140 # include BS3_MODE_INSTANTIATE_FILE1_B 141 # include <bs3kit/bs3kit-template-footer.h> 142 143 # define TMPL_MODE BS3_MODE_PAE16_32 144 # include <bs3kit/bs3kit-template-header.h> 145 # include BS3_MODE_INSTANTIATE_FILE1_B 146 # include <bs3kit/bs3kit-template-footer.h> 147 148 # define TMPL_MODE BS3_MODE_PAE32 149 # include <bs3kit/bs3kit-template-header.h> 150 # include BS3_MODE_INSTANTIATE_FILE1_B 151 # include <bs3kit/bs3kit-template-footer.h> 152 153 # define TMPL_MODE BS3_MODE_LM32 154 # include <bs3kit/bs3kit-template-header.h> 155 # include BS3_MODE_INSTANTIATE_FILE1_B 156 # include <bs3kit/bs3kit-template-footer.h> 157 158 # endif 159 160 # if ARCH_BITS == 64 /* 64-bit. */ 161 # define TMPL_MODE BS3_MODE_LM64 162 # include <bs3kit/bs3kit-template-header.h> 163 # include BS3_MODE_INSTANTIATE_FILE1_B 164 # include <bs3kit/bs3kit-template-footer.h> 165 # endif 166 167 #endif 168 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForLM64.asm
r59949 r60019 52 52 ; 53 53 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForLM64 54 BS3_ONLY_16BIT_STMT push ds55 BS3_ONLY_16BIT_STMT push BS3DATA1656 BS3_ONLY_16BIT_STMT pop ds57 54 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootLM)] 58 BS3_ONLY_16BIT_STMT pop ds59 55 cmp eax, 0ffffffffh 60 56 je .init_root … … 64 60 push xBP 65 61 mov xBP, xSP 66 BS3_ONLY_16BIT_STMT push ds 62 BS3_ONLY_16BIT_STMT push es 63 push sDX 64 push sCX 65 push sBX 66 %if TMPL_BITS == 64 67 push r8 68 push r9 69 push r10 70 push r11 71 %endif 67 72 68 73 %ifdef TMPL_RM … … 94 99 ; Load the value and return. 95 100 ; 96 BS3_ONLY_16BIT_STMT push BS3DATA1697 BS3_ONLY_16BIT_STMT pop ds98 101 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootLM)] 99 102 100 BS3_ONLY_16BIT_STMT pop ds 103 %if TMPL_BITS == 64 104 pop r11 105 pop r10 106 pop r9 107 pop r8 108 %endif 109 pop sBX 110 pop sCX 111 pop sDX 112 BS3_ONLY_16BIT_STMT pop es 101 113 leave 102 114 ret -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForPAE32.asm
r59949 r60019 52 52 ; 53 53 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPAE32 54 BS3_ONLY_16BIT_STMT push ds55 BS3_ONLY_16BIT_STMT push BS3DATA1656 BS3_ONLY_16BIT_STMT pop ds57 54 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPAE)] 58 BS3_ONLY_16BIT_STMT pop ds59 55 cmp eax, 0ffffffffh 60 56 je .init_root … … 64 60 push xBP 65 61 mov xBP, xSP 66 BS3_ONLY_16BIT_STMT push ds 62 BS3_ONLY_16BIT_STMT push es 63 push sDX 64 push sCX 65 push sBX 66 %if TMPL_BITS == 64 67 push r8 68 push r9 69 push r10 70 push r11 71 %endif 67 72 68 73 %ifdef TMPL_RM … … 95 100 ; Load the value and return. 96 101 ; 97 BS3_ONLY_16BIT_STMT push BS3DATA1698 BS3_ONLY_16BIT_STMT pop ds99 102 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPAE)] 100 103 101 BS3_ONLY_16BIT_STMT pop ds 104 %if TMPL_BITS == 64 105 pop r11 106 pop r10 107 pop r9 108 pop r8 109 %endif 110 pop sBX 111 pop sCX 112 pop sDX 113 BS3_ONLY_16BIT_STMT pop es 102 114 leave 103 115 ret -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForPP32.asm
r59949 r60019 52 52 ; 53 53 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPP32 54 BS3_ONLY_16BIT_STMT push ds55 BS3_ONLY_16BIT_STMT push BS3DATA1656 BS3_ONLY_16BIT_STMT pop ds57 54 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPP)] 58 BS3_ONLY_16BIT_STMT pop ds59 55 cmp eax, 0ffffffffh 60 56 je .init_root … … 64 60 push xBP 65 61 mov xBP, xSP 66 BS3_ONLY_16BIT_STMT push ds 62 BS3_ONLY_16BIT_STMT push es 63 push sDX 64 push sCX 65 push sBX 66 %if TMPL_BITS == 64 67 push r8 68 push r9 69 push r10 70 push r11 71 %endif 67 72 68 73 %ifdef TMPL_RM … … 95 100 ; Load the value and return. 96 101 ; 97 BS3_ONLY_16BIT_STMT push BS3DATA1698 BS3_ONLY_16BIT_STMT pop ds99 102 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPP)] 100 103 101 BS3_ONLY_16BIT_STMT pop ds 104 %if TMPL_BITS == 64 105 pop r11 106 pop r10 107 pop r9 108 pop r8 109 %endif 110 pop sBX 111 pop sCX 112 pop sDX 113 BS3_ONLY_16BIT_STMT pop es 102 114 leave 103 115 ret -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAEV86.asm
r59938 r60019 46 46 %else 47 47 ; 48 ; Convert the return address and jump to the 16-bit code segment.49 ;50 %if TMPL_BITS != 1651 shl xPRE [xSP], TMPL_BITS - 1652 add xSP, (TMPL_BITS - 16) / 853 jmp .sixteen_bit_segment54 BS3_BEGIN_TEXT1655 BS3_SET_BITS TMPL_BITS56 .sixteen_bit_segment:57 %endif58 59 ;60 48 ; Switch to 32-bit PAE32 and from there to V8086. 61 49 ; … … 65 53 66 54 ; 67 ; Switch to v8086 mode (return address is already 16-bit).55 ; Switch to v8086 mode after adjusting the return address. 68 56 ; 57 %if TMPL_BITS == 16 58 push word [esp] 59 mov word [esp + 2], 0 60 %elif TMPL_BITS == 64 61 pop dword [esp + 4] 62 %endif 69 63 extern _Bs3SwitchTo16BitV86_c32 70 64 jmp _Bs3SwitchTo16BitV86_c32 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPEV86.asm
r59938 r60019 46 46 %else 47 47 ; 48 ; Convert the return address and jump to the 16-bit code segment.49 ;50 %if TMPL_BITS != 1651 shl xPRE [xSP], TMPL_BITS - 1652 add xSP, (TMPL_BITS - 16) / 853 jmp .sixteen_bit_segment54 BS3_BEGIN_TEXT1655 BS3_SET_BITS TMPL_BITS56 .sixteen_bit_segment:57 %endif58 59 ;60 48 ; Switch to 32-bit PE32 and from there to V8086. 61 49 ; … … 65 53 66 54 ; 67 ; Switch to v8086 mode (return address is already 16-bit).55 ; Switch to v8086 mode after adjusting the return address. 68 56 ; 57 %if TMPL_BITS == 16 58 push word [esp] 59 mov word [esp + 2], 0 60 %elif TMPL_BITS == 64 61 pop dword [esp + 4] 62 %endif 69 63 extern _Bs3SwitchTo16BitV86_c32 70 64 jmp _Bs3SwitchTo16BitV86_c32 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPPV86.asm
r59938 r60019 46 46 %else 47 47 ; 48 ; Convert the return address and jump to the 16-bit code segment.49 ;50 %if TMPL_BITS != 1651 shl xPRE [xSP], TMPL_BITS - 1652 add xSP, (TMPL_BITS - 16) / 853 jmp .sixteen_bit_segment54 BS3_BEGIN_TEXT1655 BS3_SET_BITS TMPL_BITS56 .sixteen_bit_segment:57 %endif58 59 ;60 48 ; Switch to 32-bit PP32 and from there to V8086. 61 49 ; … … 65 53 66 54 ; 67 ; Switch to v8086 mode (return address is already 16-bit).55 ; Switch to v8086 mode after adjusting the return address. 68 56 ; 57 %if TMPL_BITS == 16 58 push word [esp] 59 mov word [esp + 2], 0 60 %elif TMPL_BITS == 64 61 pop dword [esp + 4] 62 %endif 69 63 extern _Bs3SwitchTo16BitV86_c32 70 64 jmp _Bs3SwitchTo16BitV86_c32 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToRM.asm
r60000 r60019 70 70 ; 71 71 %if TMPL_MODE == BS3_MODE_PE16 72 mov ax, BS3_SEL_DATA1673 mov ds, ax ; Bs3EnterMode_rm will set ds, so no need to preserve it74 72 cmp byte [BS3_DATA16_WRT(g_uBs3CpuDetected)], BS3CPU_80286 75 73 ja .do_386_prologue … … 86 84 %if TMPL_MODE == BS3_MODE_PE16 87 85 push word 0 86 %elif BS3_MODE_IS_64BIT_SYS(TMPL_MODE) 87 push sDX 88 push sCX 88 89 %endif 89 90 .done_prologue: … … 169 170 %endif 170 171 172 %if BS3_MODE_IS_64BIT_SYS(TMPL_MODE) 173 ; 174 ; Clear the long mode enable bit. 175 ; 176 mov ecx, MSR_K6_EFER 177 rdmsr 178 and eax, ~MSR_K6_EFER_LME 179 wrmsr 180 %endif 181 171 182 ; 172 183 ; Call routine for doing mode specific setups. … … 185 196 %endif 186 197 .do_386_epilogue: 198 %if BS3_MODE_IS_64BIT_SYS(TMPL_MODE) 199 pop ecx 200 TMPL_ONLY_64BIT_STMT pop eax 201 pop edx 202 TMPL_ONLY_64BIT_STMT pop eax 203 %endif 187 204 popfd 188 TMPL_ONLY_64BIT_STMT pop e bx205 TMPL_ONLY_64BIT_STMT pop eax 189 206 pop ebx 190 207 TMPL_ONLY_64BIT_STMT pop eax -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModes.c
r60002 r60019 189 189 for (i = 0; i < cEntries; i++) 190 190 { 191 uint8_t bErrNo; 191 const char *pszFmtStr = "Error #%u (%#x) in %s!\n"; 192 bool fSkipped = true; 193 uint8_t bErrNo; 192 194 Bs3TestSub(paEntries[i].pszSubTest); 193 195 196 #define CHECK_RESULT(a_szModeName) \ 197 do { \ 198 if (bErrNo != BS3TESTDOMODE_SKIPPED) \ 199 { \ 200 Bs3Printf("bErrNo=%#x %s\n", bErrNo, a_szModeName); \ 201 fSkipped = false; \ 202 if (bErrNo != 0) \ 203 Bs3TestFailedF(pszFmtStr, bErrNo, bErrNo, a_szModeName); \ 204 } \ 205 } while (0) 206 194 207 if (paEntries[i].pfnDoRM) 195 208 { 196 209 bErrNo = TMPL_NM(Bs3TestCallDoerInRM)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoRM)); 197 if (bErrNo != 0) 198 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_rm)); 210 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_rm)); 199 211 } 200 212 201 213 if (bCpuType < BS3CPU_80286) 214 { 215 if (fSkipped) 216 Bs3TestSkipped(NULL); 202 217 continue; 218 } 203 219 204 220 /* … … 208 224 { 209 225 bErrNo = TMPL_NM(Bs3TestCallDoerInPE16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPE16)); 210 if (bErrNo != 0) 211 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pe16)); 226 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pe16)); 212 227 } 213 228 if (bCpuType < BS3CPU_80386) 229 { 230 if (fSkipped) 231 Bs3TestSkipped(NULL); 214 232 continue; 233 } 215 234 216 235 if (paEntries[i].pfnDoPE16_32) 217 236 { 218 237 bErrNo = TMPL_NM(Bs3TestCallDoerInPE16_32)(CONV_TO_FLAT(paEntries[i].pfnDoPE16_32)); 219 if (bErrNo != 0) 220 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pe16_32)); 238 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pe16_32)); 221 239 } 222 240 … … 224 242 { 225 243 bErrNo = TMPL_NM(Bs3TestCallDoerInPE16_V86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPE16_V86)); 226 if (bErrNo != 0) 227 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pe16_v86)); 244 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pe16_v86)); 228 245 } 229 246 … … 231 248 { 232 249 bErrNo = TMPL_NM(Bs3TestCallDoerInPE32)(CONV_TO_FLAT(paEntries[i].pfnDoPE32)); 233 if (bErrNo != 0) 234 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pe32)); 250 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pe32)); 235 251 } 236 252 … … 238 254 { 239 255 bErrNo = TMPL_NM(Bs3TestCallDoerInPE32_16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPE32_16)); 240 if (bErrNo != 0) 241 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pe32_16)); 256 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pe32_16)); 242 257 } 243 258 … … 245 260 { 246 261 bErrNo = TMPL_NM(Bs3TestCallDoerInPEV86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPEV86)); 247 if (bErrNo != 0) 248 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pev86)); 262 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pev86)); 249 263 } 250 264 … … 255 269 { 256 270 bErrNo = TMPL_NM(Bs3TestCallDoerInPP16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPP16)); 257 if (bErrNo != 0) 258 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pp16)); 271 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pp16)); 259 272 } 260 273 … … 262 275 { 263 276 bErrNo = TMPL_NM(Bs3TestCallDoerInPP16_32)(CONV_TO_FLAT(paEntries[i].pfnDoPP16_32)); 264 if (bErrNo != 0) 265 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pp16_32)); 277 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pp16_32)); 266 278 } 267 279 … … 269 281 { 270 282 bErrNo = TMPL_NM(Bs3TestCallDoerInPP16_V86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPP16_V86)); 271 if (bErrNo != 0) 272 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pp16_v86)); 283 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pp16_v86)); 273 284 } 274 285 … … 276 287 { 277 288 bErrNo = TMPL_NM(Bs3TestCallDoerInPP32)(CONV_TO_FLAT(paEntries[i].pfnDoPP32)); 278 if (bErrNo != 0) 279 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pp32)); 289 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pp32)); 280 290 } 281 291 … … 283 293 { 284 294 bErrNo = TMPL_NM(Bs3TestCallDoerInPP32_16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPP32_16)); 285 if (bErrNo != 0) 286 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pp32_16)); 295 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pp32_16)); 287 296 } 288 297 … … 290 299 { 291 300 bErrNo = TMPL_NM(Bs3TestCallDoerInPPV86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPPV86)); 292 if (bErrNo != 0) 293 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_ppv86)); 301 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_ppv86)); 294 302 } 295 303 … … 298 306 */ 299 307 if (!fHavePae) 308 { 309 if (fSkipped) 310 Bs3TestSkipped(NULL); 300 311 continue; 312 } 301 313 302 314 if (paEntries[i].pfnDoPAE16) 303 315 { 304 316 bErrNo = TMPL_NM(Bs3TestCallDoerInPAE16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAE16)); 305 if (bErrNo != 0) 306 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pae16)); 317 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pae16)); 307 318 } 308 319 … … 310 321 { 311 322 bErrNo = TMPL_NM(Bs3TestCallDoerInPAE16_32)(CONV_TO_FLAT(paEntries[i].pfnDoPAE16_32)); 312 if (bErrNo != 0) 313 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pae16_32)); 323 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pae16_32)); 314 324 } 315 325 … … 317 327 { 318 328 bErrNo = TMPL_NM(Bs3TestCallDoerInPAE16_V86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAE16_V86)); 319 if (bErrNo != 0) 320 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pae16_v86)); 329 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pae16_v86)); 321 330 } 322 331 … … 324 333 { 325 334 bErrNo = TMPL_NM(Bs3TestCallDoerInPAE32)(CONV_TO_FLAT(paEntries[i].pfnDoPAE32)); 326 if (bErrNo != 0) 327 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pae32)); 335 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pae32)); 328 336 } 329 337 … … 331 339 { 332 340 bErrNo = TMPL_NM(Bs3TestCallDoerInPAE32_16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAE32_16)); 333 if (bErrNo != 0) 334 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_pae32_16)); 341 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_pae32_16)); 335 342 } 336 343 … … 338 345 { 339 346 bErrNo = TMPL_NM(Bs3TestCallDoerInPAEV86)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoPAEV86)); 340 if (bErrNo != 0) 341 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_paev86)); 347 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_paev86)); 342 348 } 343 349 … … 346 352 */ 347 353 if (!fHaveLongMode) 354 { 355 if (fSkipped) 356 Bs3TestSkipped(NULL); 348 357 continue; 358 } 349 359 350 360 if (paEntries[i].pfnDoLM16) 351 361 { 352 362 bErrNo = TMPL_NM(Bs3TestCallDoerInLM16)(CONV_TO_BS3TEXT16(paEntries[i].pfnDoLM16)); 353 if (bErrNo != 0) 354 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_lm16)); 363 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_lm16)); 355 364 } 356 365 … … 358 367 { 359 368 bErrNo = TMPL_NM(Bs3TestCallDoerInLM32)(CONV_TO_FLAT(paEntries[i].pfnDoLM32)); 360 if (bErrNo != 0) 361 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_lm32)); 369 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_lm32)); 362 370 } 363 371 … … 365 373 { 366 374 bErrNo = TMPL_NM(Bs3TestCallDoerInLM64)(CONV_TO_FLAT(paEntries[i].pfnDoLM64)); 367 if (bErrNo != 0) 368 Bs3TestFailedF("Error #%u (%#x) in %s!\n", bErrNo, bErrNo, BS3_DATA_NM(g_szBs3ModeName_lm64)); 369 } 375 CHECK_RESULT(BS3_DATA_NM(g_szBs3ModeName_lm64)); 376 } 377 378 if (fSkipped) 379 Bs3TestSkipped("skipped\n"); 370 380 } 371 for (;;) { } 381 Bs3TestSubDone(); 372 382 } 373 383 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModesHlp.asm
r60000 r60019 156 156 ret 157 157 158 ; 159 ; For checking that the mode switching macros doesn't screw up GPRs. 160 ; Note! Does not work on pre 286 hardware! 161 ; 162 %ifdef BS3_STRICT 163 %macro STRICT_SAVE_REGS 0 164 movzx esp, sp 165 sub esp, BS3REGCTX_size 166 mov [esp + BS3REGCTX.rax], eax 167 mov dword [esp + BS3REGCTX.rax+4], 0xdead0000 168 mov [esp + BS3REGCTX.rcx], ecx 169 mov dword [esp + BS3REGCTX.rcx+4], 0xdead0001 170 mov [esp + BS3REGCTX.rdx], edx 171 mov dword [esp + BS3REGCTX.rdx+4], 0xdead0002 172 mov [esp + BS3REGCTX.rbx], ebx 173 mov dword [esp + BS3REGCTX.rbx+4], 0xdead0003 174 mov [esp + BS3REGCTX.rbp], ebp 175 mov [esp + BS3REGCTX.rsp], esp 176 mov [esp + BS3REGCTX.rsi], esi 177 mov [esp + BS3REGCTX.rdi], edi 178 %endmacro 179 180 %macro STRICT_CHECK_REGS 0 181 %%_esp: cmp [esp + BS3REGCTX.rsp], esp 182 jne %%_esp 183 %%_eax: cmp [esp + BS3REGCTX.rax], eax 184 jne %%_eax 185 %%_ecx: mov [esp + BS3REGCTX.rcx], ecx 186 jne %%_ecx 187 %%_edx: cmp [esp + BS3REGCTX.rdx], edx 188 jne %%_edx 189 %%_ebx: cmp [esp + BS3REGCTX.rbx], ebx 190 jne %%_ebx 191 %%_ebp: cmp [esp + BS3REGCTX.rbp], ebp 192 jne %%_ebp 193 %%_esi: cmp [esp + BS3REGCTX.rsi], esi 194 jne %%_esi 195 %%_edi: cmp [esp + BS3REGCTX.rdi], edi 196 jne %%_edi 197 add esp, BS3REGCTX_size 198 %endmacro 199 %else 200 201 %macro STRICT_SAVE_REGS 0 202 %endmacro 203 %macro STRICT_CHECK_REGS 0 204 %endmacro 205 %endif 158 206 159 207 … … 174 222 175 223 ; Mode switch, make the call, switch back. 224 STRICT_SAVE_REGS 176 225 call TMPL_NM(Bs3SwitchToRM) 177 226 BS3_SET_BITS 16 227 STRICT_CHECK_REGS 228 178 229 mov cx, BS3_MODE_RM 179 230 push cx 180 231 call ax 181 add sp, 2 232 233 STRICT_SAVE_REGS 182 234 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_rm) 183 235 BS3_SET_BITS TMPL_BITS 236 STRICT_CHECK_REGS 184 237 jmp TMPL_NM(bs3TestCallDoerEpilogue) 185 238 TMPL_BEGIN_TEXT … … 203 256 204 257 ; Mode switch, make the call, switch back. 258 STRICT_SAVE_REGS 205 259 call TMPL_NM(Bs3SwitchToPE16) 206 260 BS3_SET_BITS 16 261 STRICT_CHECK_REGS 262 207 263 push BS3_MODE_PE16 208 264 call ax 265 266 STRICT_SAVE_REGS 209 267 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16) 210 268 BS3_SET_BITS TMPL_BITS … … 223 281 224 282 ; Mode switch, make the call, switch back. 283 STRICT_SAVE_REGS 225 284 call TMPL_NM(Bs3SwitchToPE16_32) 226 285 BS3_SET_BITS 32 286 STRICT_CHECK_REGS 287 227 288 push BS3_MODE_RM 228 289 call eax 290 291 STRICT_SAVE_REGS 229 292 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_32) 230 293 BS3_SET_BITS TMPL_BITS 294 STRICT_CHECK_REGS 231 295 jmp TMPL_NM(bs3TestCallDoerEpilogue) 232 296 BS3_PROC_END_MODE Bs3TestCallDoerInPE16_32 … … 242 306 243 307 ; Mode switch, make the call, switch back. 308 STRICT_SAVE_REGS 244 309 call TMPL_NM(Bs3SwitchToPE16_V86) 245 310 BS3_SET_BITS 16 311 STRICT_CHECK_REGS 312 246 313 push BS3_MODE_PE16_V86 247 314 call ax 315 316 STRICT_SAVE_REGS 248 317 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_v86) 249 318 BS3_SET_BITS TMPL_BITS 319 STRICT_CHECK_REGS 250 320 jmp TMPL_NM(bs3TestCallDoerEpilogue) 251 321 BS3_PROC_END_MODE Bs3TestCallDoerInPE16_V86 … … 261 331 262 332 ; Mode switch, make the call, switch back. 333 STRICT_SAVE_REGS 263 334 call TMPL_NM(Bs3SwitchToPE32) 264 335 BS3_SET_BITS 32 336 STRICT_CHECK_REGS 337 265 338 push BS3_MODE_PE32 266 339 call eax 340 341 STRICT_SAVE_REGS 267 342 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32) 268 343 BS3_SET_BITS TMPL_BITS 344 STRICT_CHECK_REGS 269 345 jmp TMPL_NM(bs3TestCallDoerEpilogue) 270 346 BS3_PROC_END_MODE Bs3TestCallDoerInPE32 … … 282 358 283 359 ; Mode switch, make the call, switch back. 360 STRICT_SAVE_REGS 284 361 call TMPL_NM(Bs3SwitchToPE32_16) 285 362 BS3_SET_BITS 16 363 STRICT_CHECK_REGS 364 286 365 push BS3_MODE_PE32_16 287 366 call ax 367 368 STRICT_SAVE_REGS 288 369 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32_16) 289 370 BS3_SET_BITS TMPL_BITS 371 STRICT_CHECK_REGS 290 372 jmp TMPL_NM(bs3TestCallDoerEpilogue) 291 373 TMPL_BEGIN_TEXT … … 304 386 305 387 ; Mode switch, make the call, switch back. 388 STRICT_SAVE_REGS 306 389 call TMPL_NM(Bs3SwitchToPEV86) 307 390 BS3_SET_BITS 16 391 STRICT_CHECK_REGS 392 308 393 push BS3_MODE_PEV86 309 394 call ax 395 396 STRICT_SAVE_REGS 310 397 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pev86) 311 398 BS3_SET_BITS TMPL_BITS 399 STRICT_CHECK_REGS 312 400 jmp TMPL_NM(bs3TestCallDoerEpilogue) 313 401 TMPL_BEGIN_TEXT … … 332 420 333 421 ; Mode switch, make the call, switch back. 422 STRICT_SAVE_REGS 334 423 call TMPL_NM(Bs3SwitchToPP16) 335 424 BS3_SET_BITS 16 425 STRICT_CHECK_REGS 426 336 427 push BS3_MODE_PP16 337 428 call ax 429 430 STRICT_SAVE_REGS 338 431 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16) 339 432 BS3_SET_BITS TMPL_BITS 433 STRICT_CHECK_REGS 340 434 jmp TMPL_NM(bs3TestCallDoerEpilogue) 341 435 TMPL_BEGIN_TEXT … … 352 446 353 447 ; Mode switch, make the call, switch back. 448 STRICT_SAVE_REGS 354 449 call TMPL_NM(Bs3SwitchToPP16_32) 355 450 BS3_SET_BITS 32 451 STRICT_CHECK_REGS 452 356 453 push BS3_MODE_PP16_32 357 454 call eax 455 456 STRICT_SAVE_REGS 358 457 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_32) 359 458 BS3_SET_BITS TMPL_BITS 459 STRICT_CHECK_REGS 360 460 jmp TMPL_NM(bs3TestCallDoerEpilogue) 361 461 BS3_PROC_END_MODE Bs3TestCallDoerInPP16_32 … … 371 471 372 472 ; Mode switch, make the call, switch back. 473 STRICT_SAVE_REGS 373 474 call TMPL_NM(Bs3SwitchToPP16_V86) 374 475 BS3_SET_BITS 16 476 STRICT_CHECK_REGS 477 375 478 push BS3_MODE_PP16_V86 376 479 call ax 480 481 STRICT_SAVE_REGS 377 482 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_v86) 378 483 BS3_SET_BITS TMPL_BITS 484 STRICT_CHECK_REGS 379 485 jmp TMPL_NM(bs3TestCallDoerEpilogue) 380 486 BS3_PROC_END_MODE Bs3TestCallDoerInPP16_V86 … … 390 496 391 497 ; Mode switch, make the call, switch back. 498 STRICT_SAVE_REGS 392 499 call TMPL_NM(Bs3SwitchToPP32) 393 500 BS3_SET_BITS 32 501 STRICT_CHECK_REGS 502 394 503 push BS3_MODE_PP32 395 504 call eax 505 506 STRICT_SAVE_REGS 396 507 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32) 397 508 BS3_SET_BITS TMPL_BITS 509 STRICT_CHECK_REGS 398 510 jmp TMPL_NM(bs3TestCallDoerEpilogue) 399 511 BS3_PROC_END_MODE Bs3TestCallDoerInPP32 … … 411 523 412 524 ; Mode switch, make the call, switch back. 525 STRICT_SAVE_REGS 413 526 call TMPL_NM(Bs3SwitchToPP32_16) 414 527 BS3_SET_BITS 16 528 STRICT_CHECK_REGS 529 415 530 push BS3_MODE_PP32_16 416 531 call ax 532 533 STRICT_SAVE_REGS 417 534 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32_16) 418 535 BS3_SET_BITS TMPL_BITS 536 STRICT_CHECK_REGS 419 537 jmp TMPL_NM(bs3TestCallDoerEpilogue) 420 538 TMPL_BEGIN_TEXT … … 433 551 434 552 ; Mode switch, make the call, switch back. 553 STRICT_SAVE_REGS 435 554 call TMPL_NM(Bs3SwitchToPPV86) 436 555 BS3_SET_BITS 16 556 STRICT_CHECK_REGS 557 437 558 push BS3_MODE_PPV86 438 559 call ax 560 561 STRICT_SAVE_REGS 439 562 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_ppv86) 440 563 BS3_SET_BITS TMPL_BITS 564 STRICT_CHECK_REGS 441 565 jmp TMPL_NM(bs3TestCallDoerEpilogue) 442 566 TMPL_BEGIN_TEXT … … 461 585 462 586 ; Mode switch, make the call, switch back. 587 STRICT_SAVE_REGS 463 588 call TMPL_NM(Bs3SwitchToPAE16) 464 589 BS3_SET_BITS 16 590 STRICT_CHECK_REGS 591 465 592 push BS3_MODE_PAE16 466 593 call ax 594 595 STRICT_SAVE_REGS 467 596 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16) 468 597 BS3_SET_BITS TMPL_BITS 598 STRICT_CHECK_REGS 469 599 jmp TMPL_NM(bs3TestCallDoerEpilogue) 470 600 TMPL_BEGIN_TEXT … … 481 611 482 612 ; Mode switch, make the call, switch back. 613 STRICT_SAVE_REGS 483 614 call TMPL_NM(Bs3SwitchToPAE16_32) 484 615 BS3_SET_BITS 32 616 STRICT_CHECK_REGS 617 485 618 push BS3_MODE_PAE16_32 486 619 call eax 620 621 STRICT_SAVE_REGS 487 622 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_32) 488 623 BS3_SET_BITS TMPL_BITS 624 STRICT_CHECK_REGS 489 625 jmp TMPL_NM(bs3TestCallDoerEpilogue) 490 626 BS3_PROC_END_MODE Bs3TestCallDoerInPAE16_32 … … 500 636 501 637 ; Mode switch, make the call, switch back. 638 STRICT_SAVE_REGS 502 639 call TMPL_NM(Bs3SwitchToPAE16_V86) 503 640 BS3_SET_BITS 16 641 STRICT_CHECK_REGS 642 504 643 push BS3_MODE_PAE16_V86 505 644 call ax 645 646 STRICT_SAVE_REGS 506 647 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_v86) 507 648 BS3_SET_BITS TMPL_BITS 649 STRICT_CHECK_REGS 508 650 jmp TMPL_NM(bs3TestCallDoerEpilogue) 509 651 BS3_PROC_END_MODE Bs3TestCallDoerInPAE16_V86 … … 519 661 520 662 ; Mode switch, make the call, switch back. 663 STRICT_SAVE_REGS 521 664 call TMPL_NM(Bs3SwitchToPAE32) 522 665 BS3_SET_BITS 32 666 STRICT_CHECK_REGS 667 523 668 push BS3_MODE_PAE16_32 524 669 call eax 670 671 STRICT_SAVE_REGS 525 672 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32) 526 673 BS3_SET_BITS TMPL_BITS 674 STRICT_CHECK_REGS 527 675 jmp TMPL_NM(bs3TestCallDoerEpilogue) 528 676 BS3_PROC_END_MODE Bs3TestCallDoerInPAE32 … … 540 688 541 689 ; Mode switch, make the call, switch back. 690 STRICT_SAVE_REGS 542 691 call TMPL_NM(Bs3SwitchToPAE32_16) 543 692 BS3_SET_BITS 16 693 STRICT_CHECK_REGS 694 544 695 push BS3_MODE_PAE32_16 545 696 call ax 697 698 STRICT_SAVE_REGS 546 699 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32_16) 547 700 BS3_SET_BITS TMPL_BITS 701 STRICT_CHECK_REGS 548 702 jmp TMPL_NM(bs3TestCallDoerEpilogue) 549 703 TMPL_BEGIN_TEXT … … 562 716 563 717 ; Mode switch, make the call, switch back. 718 STRICT_SAVE_REGS 564 719 call TMPL_NM(Bs3SwitchToPAEV86) 565 720 BS3_SET_BITS 16 721 STRICT_CHECK_REGS 722 566 723 push BS3_MODE_PAEV86 567 724 call ax 725 726 STRICT_SAVE_REGS 568 727 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_paev86) 569 728 BS3_SET_BITS TMPL_BITS 729 STRICT_CHECK_REGS 570 730 jmp TMPL_NM(bs3TestCallDoerEpilogue) 571 731 TMPL_BEGIN_TEXT … … 590 750 591 751 ; Mode switch, make the call, switch back. 752 STRICT_SAVE_REGS 592 753 call TMPL_NM(Bs3SwitchToLM16) 593 754 BS3_SET_BITS 16 755 STRICT_CHECK_REGS 756 594 757 push BS3_MODE_LM16 595 758 call ax 759 760 STRICT_SAVE_REGS 596 761 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm16) 597 762 BS3_SET_BITS TMPL_BITS 763 STRICT_CHECK_REGS 598 764 jmp TMPL_NM(bs3TestCallDoerEpilogue) 599 765 TMPL_BEGIN_TEXT … … 610 776 611 777 ; Mode switch, make the call, switch back. 778 STRICT_SAVE_REGS 612 779 call TMPL_NM(Bs3SwitchToLM32) 613 780 BS3_SET_BITS 32 781 STRICT_CHECK_REGS 782 614 783 and esp, ~03h 615 784 push BS3_MODE_LM32 616 785 call eax 786 787 STRICT_SAVE_REGS 617 788 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm32) 618 789 BS3_SET_BITS TMPL_BITS 790 STRICT_CHECK_REGS 619 791 jmp TMPL_NM(bs3TestCallDoerEpilogue) 620 792 BS3_PROC_END_MODE Bs3TestCallDoerInLM32 … … 630 802 631 803 ; Mode switch, make the call, switch back. 804 STRICT_SAVE_REGS 632 805 call TMPL_NM(Bs3SwitchToLM64) 633 806 BS3_SET_BITS 64 807 STRICT_CHECK_REGS 808 634 809 and rsp, ~0fh 635 810 sub rsp, 18h 636 811 push BS3_MODE_LM64 637 812 BS3_CALL rax, 1 813 814 STRICT_SAVE_REGS 638 815 call RT_CONCAT3(Bs3SwitchTo,TMPL_MODE_UNAME,_lm64) 639 816 BS3_SET_BITS TMPL_BITS 817 STRICT_CHECK_REGS 640 818 jmp TMPL_NM(bs3TestCallDoerEpilogue) 641 819 BS3_PROC_END_MODE Bs3TestCallDoerInLM64 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TrapSystemCallHandler.asm
r60000 r60019 203 203 %endif 204 204 205 ; Print the character. 205 ; Print the character, turning '\n' into '\r\n'. 206 cmp cl, 0ah ; \n 207 je .print_chr_newline 208 mov ah, 0eh 209 mov al, cl 206 210 mov bx, 0ff00h 207 mov al, cl208 mov ah, 0eh209 211 int 10h 210 212 jmp .print_chr_done 213 214 .print_chr_newline: 215 mov ax, 0e0dh ; cmd + \r 216 mov bx, 0ff00h 217 int 10h 218 mov ax, 0e0ah ; cmd + \n 219 mov bx, 0ff00h 220 int 10h 221 222 .print_chr_done: 211 223 %ifndef TMPL_CMN_R86 212 224 ; Switch back (20h param scratch area not required). -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-shutdown.c
r58812 r60019 20 20 Bs3PrintStr("Bs3PrintX32:"); 21 21 Bs3PrintX32(UINT32_C(0xfdb97531)); 22 Bs3PrintStr("\ r\n");22 Bs3PrintStr("\n"); 23 23 24 24 Bs3Printf("Bs3Printf: RX32=%#'RX32 string='%s' d=%d p=%p\n", UINT32_C(0xfdb97531), "my string", 42, Main_pe16); … … 27 27 Bs3PrintStr("pvTmp2="); 28 28 Bs3PrintX32((uintptr_t)pvTmp2); 29 Bs3PrintStr("\ r\n");29 Bs3PrintStr("\n"); 30 30 31 31 pvTmp3 = Bs3MemAlloc(BS3MEMKIND_REAL, _4K); 32 32 Bs3PrintStr("pvTmp3="); 33 33 Bs3PrintX32((uintptr_t)pvTmp3); 34 Bs3PrintStr("\ r\n");34 Bs3PrintStr("\n"); 35 35 Bs3MemFree(pvTmp2, _4K); 36 36 … … 38 38 Bs3PrintStr("pvTmp4="); 39 39 Bs3PrintX32((uintptr_t)pvTmp4); 40 Bs3PrintStr("\ r\n");41 Bs3PrintStr("\ r\n");40 Bs3PrintStr("\n"); 41 Bs3PrintStr("\n"); 42 42 43 43 pvTmp1 = Bs3MemAlloc(BS3MEMKIND_REAL, 31); 44 44 Bs3PrintStr("pvTmp1="); 45 45 Bs3PrintX32((uintptr_t)pvTmp1); 46 Bs3PrintStr("\ r\n");46 Bs3PrintStr("\n"); 47 47 48 48 pvTmp2 = Bs3MemAlloc(BS3MEMKIND_REAL, 17); 49 49 Bs3PrintStr("pvTmp2="); 50 50 Bs3PrintX32((uintptr_t)pvTmp2); 51 Bs3PrintStr("\ r\n");51 Bs3PrintStr("\n"); 52 52 53 53 Bs3MemFree(pvTmp1, 31); … … 55 55 Bs3PrintStr("pvTmp3="); 56 56 Bs3PrintX32((uintptr_t)pvTmp3); 57 Bs3PrintStr("\ r\n");57 Bs3PrintStr("\n"); 58 58 59 59 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-footer.h
r59863 r60019 75 75 #undef TMPL_MODE 76 76 #undef TMPL_MODE_STR 77 #undef TMPL_MODE_LNAME 78 #undef TMPL_MODE_UNAME 77 79 #undef TMPL_16BIT 78 80 #undef TMPL_32BIT -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60002 r60019 1467 1467 * 1468 1468 * @returns 0 on success or directly Bs3TestFailed calls, non-zero to indicate 1469 * where the test when wrong. 1469 * where the test when wrong. Special value BS3TESTDOMODE_SKIPPED 1470 * should be returned to indicate that the test has been skipped. 1470 1471 * @param bMode The current CPU mode. 1471 1472 */ … … 1475 1476 /** Far pointer to a test (for 32-bit and 64-bit code, will be flatten). */ 1476 1477 typedef FNBS3TESTDOMODE BS3_FAR_CODE *FPFNBS3TESTDOMODE; 1478 1479 /** Special FNBS3TESTDOMODE return code for indicating a skipped mode test. */ 1480 #define BS3TESTDOMODE_SKIPPED UINT8_MAX 1477 1481 1478 1482 /** … … 1549 1553 } 1550 1554 1551 /** A set of standard protypes to go with #BS3TESTMODEENTRY_CMN. 1552 * @remark May need to \#pragma alias the c64 variant. */ 1555 /** A set of standard protypes to go with #BS3TESTMODEENTRY_CMN. */ 1553 1556 #define BS3TESTMODE_PROTOTYPES_CMN(a_BaseNm) \ 1554 1557 FNBS3TESTDOMODE RT_CONCAT(a_BaseNm, _c16); \ … … 1584 1587 } 1585 1588 1586 /** A set of standard protypes to go with #BS3TESTMODEENTRY_MODE. 1587 * @remark May need to \#pragma alias the lm64 variant. */ 1589 /** A set of standard protypes to go with #BS3TESTMODEENTRY_MODE. */ 1588 1590 #define BS3TESTMODE_PROTOTYPES_MODE(a_BaseNm) \ 1589 1591 FNBS3TESTDOMODE RT_CONCAT(a_BaseNm, _rm); \
Note:
See TracChangeset
for help on using the changeset viewer.