Changeset 59935 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModesHlp.asm
- Timestamp:
- Mar 5, 2016 12:46:48 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModesHlp.asm
r59881 r59935 28 28 29 29 30 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInRM)(uint16_t offCallback);31 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16)(uint16_t offCallback);32 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_32)(uint32_t offCallback);33 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_V86)(uint16_t offCallback);34 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE32)(uint32_t offCallback);35 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPE32_16)(uint16_t offCallback);36 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPEV86)(uint16_t offCallback);37 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16)(uint16_t offCallback);38 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_32)(uint32_t offCallback);39 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_V86)(uint16_t offCallback);40 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP32)(uint32_t offCallback);41 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPP32_16)(uint16_t offCallback);42 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPPV86)(uint16_t offCallback);43 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16)(uint16_t offCallback);44 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_32)(uint32_t offCallback);45 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_V86)(uint16_t offCallback);46 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32)(uint32_t offCallback);47 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32_16)(uint16_t offCallback);48 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInPAEV86)(uint16_t offCallback);49 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM16)(uint16_t offCallback);50 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM32)(uint32_t offCallback);51 ;BS3_DECL(uint8_t) TMPL_NM(Bs3TestCallDoerInLM64)(uint32_t offCallback);52 53 30 ;********************************************************************************************************************************* 54 31 ;* External Symbols * … … 57 34 extern TMPL_NM(Bs3SwitchToPE16) 58 35 extern TMPL_NM(Bs3SwitchToPE16_32) 36 extern TMPL_NM(Bs3SwitchToPE16_V86) 37 extern TMPL_NM(Bs3SwitchToPE32) 38 extern TMPL_NM(Bs3SwitchToPE32_16) 39 extern TMPL_NM(Bs3SwitchToPEV86) 40 extern TMPL_NM(Bs3SwitchToPP16) 41 extern TMPL_NM(Bs3SwitchToPP16_32) 42 extern TMPL_NM(Bs3SwitchToPP16_V86) 43 extern TMPL_NM(Bs3SwitchToPP32) 44 extern TMPL_NM(Bs3SwitchToPP32_16) 45 extern TMPL_NM(Bs3SwitchToPPV86) 46 extern TMPL_NM(Bs3SwitchToPAE16) 47 extern TMPL_NM(Bs3SwitchToPAE16_32) 48 extern TMPL_NM(Bs3SwitchToPAE16_V86) 49 extern TMPL_NM(Bs3SwitchToPAE32) 50 extern TMPL_NM(Bs3SwitchToPAE32_16) 51 extern TMPL_NM(Bs3SwitchToPAEV86) 52 extern TMPL_NM(Bs3SwitchToLM16) 53 extern TMPL_NM(Bs3SwitchToLM32) 54 extern TMPL_NM(Bs3SwitchToLM64) 59 55 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_rm) 60 56 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16) 61 57 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_32) 62 ;extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_v86) 63 ;extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_) 64 65 66 ;; 67 ; 68 ; @param %1 Non-zero if 16-bit target. 69 ; 70 %macro MyProlog 1 58 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_v86) 59 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32) 60 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32_16) 61 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pev86) 62 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16) 63 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_32) 64 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_v86) 65 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32) 66 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32_16) 67 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_ppv86) 68 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16) 69 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_32) 70 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_v86) 71 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32) 72 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32_16) 73 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_paev86) 74 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm16) 75 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm32) 76 extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm64) 77 78 79 ;; 80 ; Shared prologue code. 81 ; @param xAX Where to jump to for the main event. 82 ; 83 TMPL_NM(bs3TestCallDoerPrologue): 71 84 BS3_CALL_CONV_PROLOG 1 72 85 push xBP … … 99 112 %endif 100 113 101 %if TMPL_BITS != 16 && %1 != 0 102 ; Change to 16-bit segment 103 jmp .sixteen_bit_segment 104 BS3_BEGIN_TEXT16 105 BS3_SET_BITS TMPL_BITS 106 .sixteen_bit_segment: 107 %endif 108 109 ; Load the call address into ax or eax. 110 %if %1 != 0 111 mov ax, [xBP + xCB*2] 112 %else 113 mov eax, [xBP + xCB*2] 114 %endif 115 116 %endmacro 117 118 119 ;; 120 ; 121 ; @param %1 Non-zero if 16-bit target. 122 ; 123 %macro MyEpilog 1 124 %if TMPL_BITS != 16 125 ; Change back to the default template segment. 126 jmp .template_segment 127 TMPL_BEGIN_TEXT 128 BS3_SET_BITS TMPL_BITS 129 .template_segment: 130 %endif 131 114 ; Jump to the main code. 115 jmp xAX 116 117 ;; 118 ; Shared epilogue code. 119 ; @param xAX Return code. 120 ; 121 TMPL_NM(bs3TestCallDoerEpilogue): 132 122 ; Restore registers. 133 123 %if TMPL_BITS == 16 … … 162 152 pop xBX 163 153 pop xBP 164 %endmacro 154 ret 165 155 166 156 … … 169 159 ; @uses rax 170 160 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInRM 171 MyProlog 16 161 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 162 jmp TMPL_NM(bs3TestCallDoerPrologue) 163 BS3_BEGIN_TEXT16 164 BS3_SET_BITS TMPL_BITS 165 .doit: 166 mov ax, [xBP + xCB*2] ; Load function pointer. 172 167 173 168 ; Mode switch, make the call, switch back. … … 177 172 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_rm) 178 173 BS3_SET_BITS TMPL_BITS 179 180 MyEpilog 16 181 ret 174 jmp TMPL_NM(bs3TestCallDoerEpilogue) 175 TMPL_BEGIN_TEXT 182 176 BS3_PROC_END_MODE Bs3TestCallDoerInRM 183 177 184 178 179 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 180 ;; Unpage protection mode. 181 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 182 185 183 ;; 186 184 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16(uint16_t offBs3Text16); 187 185 ; @uses rax 188 186 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16 189 MyProlog 16 187 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 188 jmp TMPL_NM(bs3TestCallDoerPrologue) 189 BS3_BEGIN_TEXT16 190 BS3_SET_BITS TMPL_BITS 191 .doit: 192 mov ax, [xBP + xCB*2] ; Load function pointer. 190 193 191 194 ; Mode switch, make the call, switch back. … … 195 198 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16) 196 199 BS3_SET_BITS TMPL_BITS 197 198 MyEpilog 16 199 ret 200 jmp TMPL_NM(bs3TestCallDoerEpilogue) 201 TMPL_BEGIN_TEXT 200 202 BS3_PROC_END_MODE Bs3TestCallDoerInPE16 201 203 … … 204 206 ; @uses rax 205 207 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_32 206 MyProlog 0 208 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 209 jmp TMPL_NM(bs3TestCallDoerPrologue) 210 .doit: 211 mov eax, [xBP + xCB*2] ; Load function pointer. 207 212 208 213 ; Mode switch, make the call, switch back. … … 212 217 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_32) 213 218 BS3_SET_BITS TMPL_BITS 214 215 MyEpilog 0 216 ret 219 jmp TMPL_NM(bs3TestCallDoerEpilogue) 217 220 BS3_PROC_END_MODE Bs3TestCallDoerInPE16_32 218 221 222 ;; 223 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16_V86(uint16_t offBs3Text16); 224 ; @uses rax 225 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_V86 226 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 227 jmp TMPL_NM(bs3TestCallDoerPrologue) 228 .doit: 229 mov eax, [xBP + xCB*2] ; Load function pointer. 230 231 ; Mode switch, make the call, switch back. 232 call TMPL_NM(Bs3SwitchToPE16_V86) 233 BS3_SET_BITS 32 234 call eax 235 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_v86) 236 BS3_SET_BITS TMPL_BITS 237 jmp TMPL_NM(bs3TestCallDoerEpilogue) 238 BS3_PROC_END_MODE Bs3TestCallDoerInPE16_V86 239 240 ;; 241 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE32(uint16_t offBs3Text16); 242 ; @uses rax 243 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32 244 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 245 jmp TMPL_NM(bs3TestCallDoerPrologue) 246 .doit: 247 mov eax, [xBP + xCB*2] ; Load function pointer. 248 249 ; Mode switch, make the call, switch back. 250 call TMPL_NM(Bs3SwitchToPE32) 251 BS3_SET_BITS 32 252 call eax 253 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32) 254 BS3_SET_BITS TMPL_BITS 255 jmp TMPL_NM(bs3TestCallDoerEpilogue) 256 BS3_PROC_END_MODE Bs3TestCallDoerInPE32 257 258 ;; 259 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE32_16(uint16_t offBs3Text16); 260 ; @uses rax 261 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32_16 262 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 263 jmp TMPL_NM(bs3TestCallDoerPrologue) 264 BS3_BEGIN_TEXT16 265 BS3_SET_BITS TMPL_BITS 266 .doit: 267 mov ax, [xBP + xCB*2] ; Load function pointer. 268 269 ; Mode switch, make the call, switch back. 270 call TMPL_NM(Bs3SwitchToPE32_16) 271 BS3_SET_BITS 16 272 call ax 273 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32_16) 274 BS3_SET_BITS TMPL_BITS 275 jmp TMPL_NM(bs3TestCallDoerEpilogue) 276 TMPL_BEGIN_TEXT 277 BS3_PROC_END_MODE Bs3TestCallDoerInPE32_16 278 279 ;; 280 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPEV86(uint16_t offBs3Text16); 281 ; @uses rax 282 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPEV86 283 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 284 jmp TMPL_NM(bs3TestCallDoerPrologue) 285 BS3_BEGIN_TEXT16 286 BS3_SET_BITS TMPL_BITS 287 .doit: 288 mov ax, [xBP + xCB*2] ; Load function pointer. 289 290 ; Mode switch, make the call, switch back. 291 call TMPL_NM(Bs3SwitchToPEV86) 292 BS3_SET_BITS 16 293 call ax 294 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pev86) 295 BS3_SET_BITS TMPL_BITS 296 jmp TMPL_NM(bs3TestCallDoerEpilogue) 297 TMPL_BEGIN_TEXT 298 BS3_PROC_END_MODE Bs3TestCallDoerInPEV86 299 300 301 302 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 303 ;; Page protection mode. 304 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 305 306 ;; 307 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16(uint16_t offBs3Text16); 308 ; @uses rax 309 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16 310 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 311 jmp TMPL_NM(bs3TestCallDoerPrologue) 312 BS3_BEGIN_TEXT16 313 BS3_SET_BITS TMPL_BITS 314 .doit: 315 mov ax, [xBP + xCB*2] ; Load function pointer. 316 317 ; Mode switch, make the call, switch back. 318 call TMPL_NM(Bs3SwitchToPP16) 319 BS3_SET_BITS 16 320 call ax 321 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16) 322 BS3_SET_BITS TMPL_BITS 323 jmp TMPL_NM(bs3TestCallDoerEpilogue) 324 TMPL_BEGIN_TEXT 325 BS3_PROC_END_MODE Bs3TestCallDoerInPP16 326 327 ;; 328 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16_32(uint16_t offBs3Text16); 329 ; @uses rax 330 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_32 331 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 332 jmp TMPL_NM(bs3TestCallDoerPrologue) 333 .doit: 334 mov eax, [xBP + xCB*2] ; Load function pointer. 335 336 ; Mode switch, make the call, switch back. 337 call TMPL_NM(Bs3SwitchToPP16_32) 338 BS3_SET_BITS 32 339 call eax 340 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_32) 341 BS3_SET_BITS TMPL_BITS 342 jmp TMPL_NM(bs3TestCallDoerEpilogue) 343 BS3_PROC_END_MODE Bs3TestCallDoerInPP16_32 344 345 ;; 346 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16_V86(uint16_t offBs3Text16); 347 ; @uses rax 348 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_V86 349 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 350 jmp TMPL_NM(bs3TestCallDoerPrologue) 351 .doit: 352 mov eax, [xBP + xCB*2] ; Load function pointer. 353 354 ; Mode switch, make the call, switch back. 355 call TMPL_NM(Bs3SwitchToPP16_V86) 356 BS3_SET_BITS 32 357 call eax 358 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_v86) 359 BS3_SET_BITS TMPL_BITS 360 jmp TMPL_NM(bs3TestCallDoerEpilogue) 361 BS3_PROC_END_MODE Bs3TestCallDoerInPP16_V86 362 363 ;; 364 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP32(uint16_t offBs3Text16); 365 ; @uses rax 366 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32 367 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 368 jmp TMPL_NM(bs3TestCallDoerPrologue) 369 .doit: 370 mov eax, [xBP + xCB*2] ; Load function pointer. 371 372 ; Mode switch, make the call, switch back. 373 call TMPL_NM(Bs3SwitchToPP32) 374 BS3_SET_BITS 32 375 call eax 376 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32) 377 BS3_SET_BITS TMPL_BITS 378 jmp TMPL_NM(bs3TestCallDoerEpilogue) 379 BS3_PROC_END_MODE Bs3TestCallDoerInPP32 380 381 ;; 382 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP32_16(uint16_t offBs3Text16); 383 ; @uses rax 384 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32_16 385 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 386 jmp TMPL_NM(bs3TestCallDoerPrologue) 387 BS3_BEGIN_TEXT16 388 BS3_SET_BITS TMPL_BITS 389 .doit: 390 mov ax, [xBP + xCB*2] ; Load function pointer. 391 392 ; Mode switch, make the call, switch back. 393 call TMPL_NM(Bs3SwitchToPP32_16) 394 BS3_SET_BITS 16 395 call ax 396 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32_16) 397 BS3_SET_BITS TMPL_BITS 398 jmp TMPL_NM(bs3TestCallDoerEpilogue) 399 TMPL_BEGIN_TEXT 400 BS3_PROC_END_MODE Bs3TestCallDoerInPP32_16 401 402 ;; 403 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPPV86(uint16_t offBs3Text16); 404 ; @uses rax 405 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPPV86 406 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 407 jmp TMPL_NM(bs3TestCallDoerPrologue) 408 BS3_BEGIN_TEXT16 409 BS3_SET_BITS TMPL_BITS 410 .doit: 411 mov ax, [xBP + xCB*2] ; Load function pointer. 412 413 ; Mode switch, make the call, switch back. 414 call TMPL_NM(Bs3SwitchToPPV86) 415 BS3_SET_BITS 16 416 call ax 417 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_ppv86) 418 BS3_SET_BITS TMPL_BITS 419 jmp TMPL_NM(bs3TestCallDoerEpilogue) 420 TMPL_BEGIN_TEXT 421 BS3_PROC_END_MODE Bs3TestCallDoerInPPV86 422 423 424 425 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 426 ;; PAE paged protection mode. 427 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 428 429 ;; 430 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16(uint16_t offBs3Text16); 431 ; @uses rax 432 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16 433 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 434 jmp TMPL_NM(bs3TestCallDoerPrologue) 435 BS3_BEGIN_TEXT16 436 BS3_SET_BITS TMPL_BITS 437 .doit: 438 mov ax, [xBP + xCB*2] ; Load function pointer. 439 440 ; Mode switch, make the call, switch back. 441 call TMPL_NM(Bs3SwitchToPAE16) 442 BS3_SET_BITS 16 443 call ax 444 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16) 445 BS3_SET_BITS TMPL_BITS 446 jmp TMPL_NM(bs3TestCallDoerEpilogue) 447 TMPL_BEGIN_TEXT 448 BS3_PROC_END_MODE Bs3TestCallDoerInPAE16 449 450 ;; 451 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16_32(uint16_t offBs3Text16); 452 ; @uses rax 453 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_32 454 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 455 jmp TMPL_NM(bs3TestCallDoerPrologue) 456 .doit: 457 mov eax, [xBP + xCB*2] ; Load function pointer. 458 459 ; Mode switch, make the call, switch back. 460 call TMPL_NM(Bs3SwitchToPAE16_32) 461 BS3_SET_BITS 32 462 call eax 463 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_32) 464 BS3_SET_BITS TMPL_BITS 465 jmp TMPL_NM(bs3TestCallDoerEpilogue) 466 BS3_PROC_END_MODE Bs3TestCallDoerInPAE16_32 467 468 ;; 469 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16_V86(uint16_t offBs3Text16); 470 ; @uses rax 471 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_V86 472 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 473 jmp TMPL_NM(bs3TestCallDoerPrologue) 474 .doit: 475 mov eax, [xBP + xCB*2] ; Load function pointer. 476 477 ; Mode switch, make the call, switch back. 478 call TMPL_NM(Bs3SwitchToPAE16_V86) 479 BS3_SET_BITS 32 480 call eax 481 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_v86) 482 BS3_SET_BITS TMPL_BITS 483 jmp TMPL_NM(bs3TestCallDoerEpilogue) 484 BS3_PROC_END_MODE Bs3TestCallDoerInPAE16_V86 485 486 ;; 487 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE32(uint16_t offBs3Text16); 488 ; @uses rax 489 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32 490 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 491 jmp TMPL_NM(bs3TestCallDoerPrologue) 492 .doit: 493 mov eax, [xBP + xCB*2] ; Load function pointer. 494 495 ; Mode switch, make the call, switch back. 496 call TMPL_NM(Bs3SwitchToPAE32) 497 BS3_SET_BITS 32 498 call eax 499 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32) 500 BS3_SET_BITS TMPL_BITS 501 jmp TMPL_NM(bs3TestCallDoerEpilogue) 502 BS3_PROC_END_MODE Bs3TestCallDoerInPAE32 503 504 ;; 505 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE32_16(uint16_t offBs3Text16); 506 ; @uses rax 507 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32_16 508 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 509 jmp TMPL_NM(bs3TestCallDoerPrologue) 510 BS3_BEGIN_TEXT16 511 BS3_SET_BITS TMPL_BITS 512 .doit: 513 mov ax, [xBP + xCB*2] ; Load function pointer. 514 515 ; Mode switch, make the call, switch back. 516 call TMPL_NM(Bs3SwitchToPAE32_16) 517 BS3_SET_BITS 16 518 call ax 519 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32_16) 520 BS3_SET_BITS TMPL_BITS 521 jmp TMPL_NM(bs3TestCallDoerEpilogue) 522 TMPL_BEGIN_TEXT 523 BS3_PROC_END_MODE Bs3TestCallDoerInPAE32_16 524 525 ;; 526 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAEV86(uint16_t offBs3Text16); 527 ; @uses rax 528 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAEV86 529 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 530 jmp TMPL_NM(bs3TestCallDoerPrologue) 531 BS3_BEGIN_TEXT16 532 BS3_SET_BITS TMPL_BITS 533 .doit: 534 mov ax, [xBP + xCB*2] ; Load function pointer. 535 536 ; Mode switch, make the call, switch back. 537 call TMPL_NM(Bs3SwitchToPAEV86) 538 BS3_SET_BITS 16 539 call ax 540 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_paev86) 541 BS3_SET_BITS TMPL_BITS 542 jmp TMPL_NM(bs3TestCallDoerEpilogue) 543 TMPL_BEGIN_TEXT 544 BS3_PROC_END_MODE Bs3TestCallDoerInPAEV86 545 546 547 548 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 549 ;; Long mode 550 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 551 552 ;; 553 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM16(uint16_t offBs3Text16); 554 ; @uses rax 555 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM16 556 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 557 jmp TMPL_NM(bs3TestCallDoerPrologue) 558 BS3_BEGIN_TEXT16 559 BS3_SET_BITS TMPL_BITS 560 .doit: 561 mov ax, [xBP + xCB*2] ; Load function pointer. 562 563 ; Mode switch, make the call, switch back. 564 call TMPL_NM(Bs3SwitchToLM16) 565 BS3_SET_BITS 16 566 call ax 567 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm16) 568 BS3_SET_BITS TMPL_BITS 569 jmp TMPL_NM(bs3TestCallDoerEpilogue) 570 TMPL_BEGIN_TEXT 571 BS3_PROC_END_MODE Bs3TestCallDoerInLM16 572 573 ;; 574 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM32(uint16_t offBs3Text16); 575 ; @uses rax 576 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM32 577 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 578 jmp TMPL_NM(bs3TestCallDoerPrologue) 579 .doit: 580 mov eax, [xBP + xCB*2] ; Load function pointer. 581 582 ; Mode switch, make the call, switch back. 583 call TMPL_NM(Bs3SwitchToLM32) 584 BS3_SET_BITS 32 585 call eax 586 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm32) 587 BS3_SET_BITS TMPL_BITS 588 jmp TMPL_NM(bs3TestCallDoerEpilogue) 589 BS3_PROC_END_MODE Bs3TestCallDoerInLM32 590 591 ;; 592 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM64(uint16_t offBs3Text16); 593 ; @uses rax 594 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM64 595 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 596 jmp TMPL_NM(bs3TestCallDoerPrologue) 597 .doit: 598 mov eax, [xBP + xCB*2] ; Load function pointer. 599 600 ; Mode switch, make the call, switch back. 601 call TMPL_NM(Bs3SwitchToLM64) 602 BS3_SET_BITS 64 603 call rax 604 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm64) 605 BS3_SET_BITS TMPL_BITS 606 jmp TMPL_NM(bs3TestCallDoerEpilogue) 607 BS3_PROC_END_MODE Bs3TestCallDoerInLM64 608
Note:
See TracChangeset
for help on using the changeset viewer.