Changeset 60585 in vbox for trunk/src/VBox
- Timestamp:
- Apr 20, 2016 9:48:09 AM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 2 added
- 12 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/Config.kmk
r60578 r60585 75 75 76 76 ## 77 # Macro for generating near-call aliases for zero or more 16-bit C functions.77 # Macro for generating near-call aliases for one 16-bit C function. 78 78 # @param 1 The target name. 79 # @param 2 List of functions.80 BS3KIT_FN_GEN_CMN_NEARSTUB S = $(foreach fn,$2,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$(fn)_c16,_$(fn)_f16))79 # @param 2 The common function. 80 BS3KIT_FN_GEN_CMN_NEARSTUB = $(evalcall2 def_Bs3KitGenNearStubSource,$1,_$2_c16,_$2_f16) 81 81 82 82 ## 83 # Macro for generating near-call aliases for zero or more 16-bit C mode functions.83 # Macro for generating near-call aliases for one 16-bit C mode function. 84 84 # @param 1 The target name. 85 # @param 2 List of mode functions.86 BS3KIT_FN_GEN_MODE_NEARSTUB S = $(foreach fn,$2,$(foreach suff, \85 # @param 2 The mode function. 86 BS3KIT_FN_GEN_MODE_NEARSTUB = $(foreach suff, \ 87 87 _rm \ 88 88 _pe16 \ … … 99 99 _paev86 \ 100 100 _lm16 \ 101 ,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$ (fn)$(suff),_$(fn)$(suff)_far)))101 ,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$2$(suff),_$2$(suff)_far)) 102 102 103 103 # @param 1 The target name. … … 124 124 # Macro for generating far-call aliases for zero or more 16-bit C or assembly functions. 125 125 # @param 1 The target name. 126 # @param 2 List of functions. 127 BS3KIT_FN_GEN_CMN_FARSTUBS = $(foreach fn,$2,$(evalcall2 def_Bs3KitGenFarStubSource,$1,$(fn),_f16,_c16)) 126 # @param 2 The common function. 127 # @param 3 The parameter size in bytes. 128 BS3KIT_FN_GEN_CMN_FARSTUB = $(evalcall2 def_Bs3KitGenFarStubSource,$1,$2,_f16,_c16,$3) 128 129 129 130 ## 130 131 # Macro for generating far-call aliases for zero or more 16-bit C mode functions. 131 132 # @param 1 The target name. 132 # @param 2 List of mode functions. 133 BS3KIT_FN_GEN_MODE_FARSTUBS = $(foreach fn,$2,$(foreach suff, \ 133 # @param 2 The mode function. 134 # @param 3 The parameter size in bytes. 135 BS3KIT_FN_GEN_MODE_FARSTUB = $(foreach suff, \ 134 136 _rm \ 135 137 _pe16 \ … … 146 148 _paev86 \ 147 149 _lm16 \ 148 ,$(evalcall2 def_Bs3KitGenFarStubSource,$1,$ (fn),$(suff)_far,$(suff))150 ,$(evalcall2 def_Bs3KitGenFarStubSource,$1,$2,$(suff)_far,$(suff),$3)) 149 151 150 152 # @param 1 The target name. 151 # @param 2 The function and amount of parameters.153 # @param 2 The function name. 152 154 # @param 3 The far function suffix. 153 155 # @param 4 The near function suffix. 156 # @param 5 The parameter size in bytes. 154 157 define def_Bs3KitGenFarStubSource 155 $(eval local fn2 = $(firstword $(subst :, $(SP), $2))) 156 $(eval local cbParam = $(lastword $(subst :, $(SP), $2))) 157 158 $1_SOURCES += $$($1_0_OUTDIR)/stub_$(fn2)$3.asm 159 $1_CLEAN += $$($1_0_OUTDIR)/stub_$(fn2)$3.asm 160 $$$$($1_0_OUTDIR)/stub_$(fn2)$3.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@) 158 $1_SOURCES += $$($1_0_OUTDIR)/stub_$2$3.asm 159 $1_CLEAN += $$($1_0_OUTDIR)/stub_$2$3.asm 160 $$$$($1_0_OUTDIR)/stub_$2$3.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@) 161 161 $(QUIET)$(APPEND) -tn $$@ \ 162 162 '%include "bs3kit.mac"' \ 163 163 'BS3_BEGIN_TEXT16' \ 164 ' extern _$ (fn2)$4' \164 ' extern _$2$4' \ 165 165 'BS3_BEGIN_TEXT16_FARSTUBS' \ 166 'BS3_PROC_BEGIN _$ (fn2)$3' \166 'BS3_PROC_BEGIN _$2$3' \ 167 167 ' CPU 8086' \ 168 168 ' inc bp' \ 169 169 ' push bp' \ 170 170 ' mov bp, sp' \ 171 '%assign offParam $ (cbParam)' \172 '%rep $ (cbParam)/ 2' \171 '%assign offParam $5' \ 172 '%rep $5 / 2' \ 173 173 ' push word [bp + 2 + 4 + offParam - 2]' \ 174 174 '%assign offParam offParam - 2' \ 175 175 '%endrep' \ 176 ' call _$ (fn2)$4' \177 ' add sp, $ (cbParam)' \176 ' call _$2$4' \ 177 ' add sp, $5' \ 178 178 ' pop bp' \ 179 179 ' dec bp' \ 180 180 ' retf' \ 181 'BS3_PROC_END _$ (fn2)$3' \181 'BS3_PROC_END _$2$3' \ 182 182 '' 183 183 endef -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c
r60578 r60585 1528 1528 * Re-initialize the IDT. 1529 1529 */ 1530 TMPL_FAR_NM(Bs3TrapInit)();1530 Bs3TrapInit(); 1531 1531 return bRet; 1532 1532 } … … 1554 1554 * Re-initialize the IDT. 1555 1555 */ 1556 TMPL_FAR_NM(Bs3TrapInit)();1556 Bs3TrapInit(); 1557 1557 return 0; 1558 1558 #elif TMPL_MODE == BS3_MODE_RM … … 1600 1600 * Re-initialize the IDT. 1601 1601 */ 1602 TMPL_FAR_NM(Bs3TrapInit)();1602 Bs3TrapInit(); 1603 1603 return 0; 1604 1604 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r60578 r60585 157 157 ../../../Runtime/common/asm/ASMSerializeInstruction-rdtscp.asm \ 158 158 159 #160 # We generate a list of files with 16-bit far functions for which we generate161 # near jump stubs.162 #163 #$(PATH_OUT_OBJ)/bs3kit-common-16-near-to-far.kmk.ts \164 #+| $(PATH_OUT_OBJ)/bs3kit-common-16-near-to-far.kmk: $(VBOX_PATH_BS3KIT_SRC)/bs3kit.h165 # $(SED) \166 # -n -e '/no-near-stub/d' \167 # -e 's/^ *BS3_DECL(.*) *\([a-zA-Z][a-zA-Z0-9_]*\)(.*[;,][^;]*$/\1/p' \168 # --output $@ \169 # bs3kit.h170 # .$(CP_CHANGED) --changed -f -- $@ $(PATH_OUT_OBJ)/bs3kit-common-16-near-to-far.kmk171 #include $(PATH)172 173 174 159 # The 16-bit BS3Kit library. 175 160 LIBRARIES += bs3kit-common-16 … … 199 184 bs3-wc16-I4D.asm \ 200 185 bs3-c16-Trap16Generic.asm \ 186 bs3-c16-TrapRmV86Generic.asm \ 187 bs3-c16-Trap16RmV86Data.asm \ 188 bs3-c16-TrapRmV86Data.c \ 201 189 bs3-c16-CreateHybridFarRet.asm 202 190 bs3kit-common-16_bs3-cmn-UInt64Div.c_CFLAGS = -oh -d0 # -d1+ vs -d0 saves 0x6a3-0x577 = 0x12C (300)! 203 bs3kit-common-16_VBOX_NEAR_TO_FAR_CMN_FUNCTIONS := \ 204 $(sort $(subst bs3-cmn-,Bs3,$(basename $(filter-out \ 205 %Data.c \ 206 bs3-rm-% \ 207 bs3-cmn-hexdigits.c \ 208 ,$(filter %.c,$(bs3kit-common-16_SOURCES)))))) \ 209 Bs3PrintfV \ 210 Bs3StrPrintfV \ 211 Bs3TestPrintfV \ 212 Bs3TestFailedF \ 213 Bs3TestFailedV \ 214 Bs3TestSkippedF \ 215 Bs3TestSkippedV \ 216 Bs3TestSubF \ 217 Bs3TestSubV \ 218 Bs3Trap16InitEx \ 219 220 bs3kit-common-16_VBOX_NEAR_TO_FAR_MODE_FUNCTIONS := \ 221 Bs3TrapInit \ 222 223 bs3kit-common-16_VBOX_FAR_TO_NEAR_CMN_FUNCTIONS := \ 224 ASMMemFirstMismatchingU8:8 \ 225 ASMMemFirstNonZero:6 \ 226 227 $(call BS3KIT_FN_GEN_CMN_NEARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_NEAR_TO_FAR_CMN_FUNCTIONS)) 228 $(call BS3KIT_FN_GEN_MODE_NEARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_NEAR_TO_FAR_MODE_FUNCTIONS)) 229 $(call BS3KIT_FN_GEN_CMN_FARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_FAR_TO_NEAR_CMN_FUNCTIONS)) 191 192 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMMemFirstMismatchingU8,8) 193 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMMemFirstNonZero,6) 194 -include $(PATH_SUB_CURRENT)/bs3kit-autostubs.kmk # manually generated from headers, see bottom of this file. 230 195 231 196 # The 32-bit BS3Kit library. … … 488 453 bs3kit-mangling-code-undef.h: $(PATH_SUB_CURRENT)/bs3kit-mangling-code-define.h 489 454 $(SED) \ 490 -e 's/# define \([a-zA-Z_][a-zA-Z0-9_]*\) .*$(DOLLAR)/#undef \1/' \491 -e 's/Function needing mangling \./Undefining function mangling - automatically generated by the $@ makefile rule./' \455 -e 's/#\( *\)define \([a-zA-Z_][a-zA-Z0-9_]*\) .*$(DOLLAR)/#\1undef \2/' \ 456 -e 's/Function needing mangling.*$(DOLLAR)/Undefining function mangling - automatically generated by the $@ makefile rule./' \ 492 457 --output $(dir $<)bs3kit-mangling-code-undef.h \ 493 458 $< 494 459 460 # 461 # Rule for regenerating bs3kit-mangling-functions-define.h. 462 # 463 bs3kit-mangling-code-define.h: \ 464 $(PATH_SUB_CURRENT)/bs3kit.h \ 465 $(PATH_SUB_CURRENT)/bs3-cmn-paging.h \ 466 $(PATH_SUB_CURRENT)/bs3-cmn-test.h 467 $(APPEND) -tn "$(dir $<)$@" \ 468 '/* $(DOLLAR)Id: $(DOLLAR) */' \ 469 '/** @file' \ 470 ' * BS3Kit - Function needing mangling - generated by the $@ makefile rule.' \ 471 ' */' \ 472 '' \ 473 '/*' \ 474 ' * Copyright (C) 2007-2016 Oracle Corporation' \ 475 ' *' \ 476 ' * This file is part of VirtualBox Open Source Edition (OSE), as' \ 477 ' * available from http://www.virtualbox.org. This file is free software;' \ 478 ' * you can redistribute it and/or modify it under the terms of the GNU' \ 479 ' * General Public License (GPL) as published by the Free Software' \ 480 ' * Foundation, in version 2 as it comes in the "COPYING" file of the' \ 481 ' * VirtualBox OSE distribution. VirtualBox OSE is distributed in the' \ 482 ' * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.' \ 483 ' *' \ 484 ' * The contents of this file may alternatively be used under the terms' \ 485 ' * of the Common Development and Distribution License Version 1.0' \ 486 ' * (CDDL) only, as it comes in the "COPYING.CDDL" file of the' \ 487 ' * VirtualBox OSE distribution, in which case the provisions of the' \ 488 ' * CDDL are applicable instead of those of the GPL.' \ 489 ' *' \ 490 ' * You may elect to license modified versions of this file under the' \ 491 ' * terms and conditions of either the GPL or the CDDL or both.' \ 492 ' */' \ 493 '' 494 $(SED) -n \ 495 -e 's/^ *BS3_CMN_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/#define \1 BS3_CMN_MANGLER(\1)/p' \ 496 -e 's/^ *BS3_CMN_PROTO_NOSB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/#define \1 BS3_CMN_MANGLER(\1)/p' \ 497 -e 's/^ *BS3_CMN_PROTO_FARSTUB([^,]*,[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/#define \1 BS3_CMN_MANGLER(\1)/p' \ 498 $< | sort >> "$(dir $<)bs3kit-mangling-code-define.h" 499 $(APPEND) -n "$(dir $<)$@" '#ifndef BS3_CMN_ONLY' 500 $(SED) -n \ 501 -e 's/^ *BS3_MODE_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/# define \1 BS3_MODE_MANGLER(\1)/p' \ 502 -e 's/^ *BS3_MODE_PROTO_NOSB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/# define \1 BS3_MODE_MANGLER(\1)/p' \ 503 -e 's/^ *BS3_MODE_PROTO_FARSTUB([^,]*,[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/# define \1 BS3_MODE_MANGLER(\1)/p' \ 504 $< | sort >> "$(dir $<)bs3kit-mangling-code-define.h" 505 $(APPEND) -n "$(dir $<)$@" '#endif /* !BS3_CMN_ONLY */' 506 507 # 508 # Rule for regenerating bs3kit-autostubs.kmk. 509 # 510 bs3kit-autostubs.kmk: \ 511 $(PATH_SUB_CURRENT)/bs3kit.h \ 512 $(PATH_SUB_CURRENT)/bs3-cmn-memory.h \ 513 $(PATH_SUB_CURRENT)/bs3-cmn-paging.h \ 514 $(PATH_SUB_CURRENT)/bs3-cmn-test.h 515 $(APPEND) -tn "$(dir $<)$@" \ 516 '# $(DOLLAR)Id: $(DOLLAR)' \ 517 '## @file' \ 518 '# BS3Kit - Automatic near/far stubs - generated by the $@ makefile rule.' \ 519 '#' \ 520 '' \ 521 '#' \ 522 '# Copyright (C) 2007-2016 Oracle Corporation' \ 523 '#' \ 524 '# This file is part of VirtualBox Open Source Edition (OSE), as' \ 525 '# available from http://www.virtualbox.org. This file is free software;' \ 526 '# you can redistribute it and/or modify it under the terms of the GNU' \ 527 '# General Public License (GPL) as published by the Free Software' \ 528 '# Foundation, in version 2 as it comes in the "COPYING" file of the' \ 529 '# VirtualBox OSE distribution. VirtualBox OSE is distributed in the' \ 530 '# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.' \ 531 '#' \ 532 '# The contents of this file may alternatively be used under the terms' \ 533 '# of the Common Development and Distribution License Version 1.0' \ 534 '# (CDDL) only, as it comes in the "COPYING.CDDL" file of the' \ 535 '# VirtualBox OSE distribution, in which case the provisions of the' \ 536 '# CDDL are applicable instead of those of the GPL.' \ 537 '#' \ 538 '# You may elect to license modified versions of this file under the' \ 539 '# terms and conditions of either the GPL or the CDDL or both.' \ 540 '#' \ 541 '' 542 $(SED) -n \ 543 -e '/^ *BS3_CMN_PROTO_STUB/p' \ 544 -e '/^ *BS3_CMD_PROTO_FARSTUB/p' \ 545 -e '/^ *BS3_MODE_PROTO_STUB/p' \ 546 -e '/^ *BS3_MODE_PROTO_FARSTUB/p' \ 547 $< \ 548 | sort \ 549 | $(SED) -n \ 550 -e 's/^ *BS3_CMN_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,\1)/p' \ 551 -e 's/^ *BS3_MODE_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,\1)/p' \ 552 -e 's/^ *BS3_CMN_PROTO_FARSTUB( *\([^,]*\),[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,\2,\1)/p' \ 553 -e 's/^ *BS3_MODE_PROTO_FARSTUB( *\([^,]*\),[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_MODE_FARSTUB,bs3kit-common-16,\2,\1)/p' \ 554 --append "$(dir $<)$@" 555 556 bs3kit-update:: bs3kit-autostubs.kmk bs3kit-mangling-code-define.h bs3kit-mangling-code-undef.h 557 .NOTPARALLEL: bs3kit-autostubs.kmk bs3kit-mangling-code-define.h bs3kit-mangling-code-undef.h 558 495 559 496 560 include $(FILE_KBUILD_SUB_FOOTER) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-c16-Trap16Generic.asm
r60439 r60585 41 41 BS3_EXTERN_DATA16 g_uBs3TrapEipHint 42 42 BS3_EXTERN_DATA16 g_uBs3CpuDetected 43 BS3_EXTERN_DATA16 g_apfnBs3TrapHandlers_c16 43 44 BS3_EXTERN_SYSTEM16 Bs3Gdt 44 45 TMPL_BEGIN_TEXT … … 47 48 TMPL_BEGIN_TEXT 48 49 49 50 ;*********************************************************************************************************************************51 ;* Global Variables *52 ;*********************************************************************************************************************************53 BS3_BEGIN_DATA1654 ;; Pointer C trap handlers (BS3TEXT16).55 BS3_GLOBAL_DATA g_apfnBs3TrapHandlers_c16, 51256 resw 25657 58 59 TMPL_BEGIN_TEXT60 50 61 51 ;; … … 181 171 182 172 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], eax 183 mov edx, [bp - 12h] 184 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], edx 185 mov [ss:bx + BS3TRAPFRAME.uHandlerRsp], edx 173 mov edx, [bp - 12h] ; This isn't quite right for wrap arounds, but close enough for now 174 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], edx ; high bits 175 mov [ss:bx + BS3TRAPFRAME.uHandlerRsp], edx ; high bits 186 176 mov dx, [bp - 0eh] 187 177 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], dx … … 190 180 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], edx 191 181 mov edx, [bp - 8] 192 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], edx ; high bits182 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], edx ; high bits 193 183 mov [ss:bx + BS3TRAPFRAME.fHandlerRfl], edx 194 184 mov edx, [bp - 4] … … 212 202 int3 213 203 %endif 214 jmp .stack_ load_bx_into_ss204 jmp .stack_esp_out_of_bounds 215 205 BS3_PROC_END bs3Trap16GenericTrapErrCode 216 206 … … 310 300 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], ds 311 301 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.es], es 302 mov [ss:bx + BS3TRAPFRAME.uHandlerCs], cs 312 303 313 304 ; 314 305 ; Load 16-bit data selector for the DPL we're executing at into DS and ES. 315 ; Save the handler SS and CS values first. 316 ; 317 mov ax, cs 318 mov [ss:bx + BS3TRAPFRAME.uHandlerCs], ax 306 ; 319 307 mov ax, ss 320 308 and ax, 3 … … 368 356 jmp .iret_frame_seed_high_eip_word 369 357 370 .iret_frame_same_cpl: 371 mov cx, ss 372 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx 358 .iret_frame_same_cpl: ; (ss and high bits was saved by CPU specific part) 373 359 lea cx, [bp + 8] 374 360 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-c16-TrapRmV86Generic.asm
r60581 r60585 1 1 ; $Id$ 2 2 ;; @file 3 ; BS3Kit - Trap, 16-bit assembly handlers .3 ; BS3Kit - Trap, 16-bit assembly handlers for real mode and v8086. 4 4 ; 5 5 … … 41 41 BS3_EXTERN_DATA16 g_uBs3TrapEipHint 42 42 BS3_EXTERN_DATA16 g_uBs3CpuDetected 43 BS3_EXTERN_ SYSTEM16 Bs3Gdt43 BS3_EXTERN_DATA16 g_apfnBs3TrapHandlers_c16 44 44 TMPL_BEGIN_TEXT 45 45 BS3_EXTERN_CMN Bs3TrapDefaultHandler … … 48 48 49 49 50 ;*********************************************************************************************************************************51 ;* Global Variables *52 ;*********************************************************************************************************************************53 BS3_BEGIN_DATA1654 ;; Pointer C trap handlers (BS3TEXT16).55 BS3_GLOBAL_DATA g_apfnBs3TrapHandlers_c16, 51256 resw 25657 58 59 TMPL_BEGIN_TEXT60 61 50 ;; 62 51 ; Generic entry points for IDT handlers, 8 byte spacing. 63 52 ; 64 BS3_PROC_BEGIN _Bs3Trap 16GenericEntries65 BS3_PROC_BEGIN Bs3Trap 16GenericEntries66 %macro Bs3Trap 16GenericEntryNoErr 153 BS3_PROC_BEGIN _Bs3TrapRmV86GenericEntries 54 BS3_PROC_BEGIN Bs3TrapRmV86GenericEntries 55 %macro Bs3TrapRmV86GenericEntryNoErr 1 67 56 push byte 0 ; 2 byte: fake error code 68 57 db 06ah, i ; 2 byte: push imm8 - note that this is a signextended value. … … 72 61 %endmacro 73 62 74 %macro Bs3Trap 16GenericEntryErrCd 163 %macro Bs3TrapRmV86GenericEntryErrCd 1 75 64 db 06ah, i ; 2 byte: push imm8 - note that this is a signextended value. 76 65 jmp %1 ; 3 byte … … 80 69 81 70 %assign i 0 ; start counter. 82 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 083 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 184 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 285 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 386 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 487 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 588 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 689 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 790 Bs3Trap 16GenericEntryErrCd bs3Trap16GenericTrapOrInt ; 891 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 992 Bs3Trap 16GenericEntryErrCd bs3Trap16GenericTrapOrInt ; a93 Bs3Trap 16GenericEntryErrCd bs3Trap16GenericTrapOrInt ; b94 Bs3Trap 16GenericEntryErrCd bs3Trap16GenericTrapOrInt ; c95 Bs3Trap 16GenericEntryErrCd bs3Trap16GenericTrapOrInt ; d96 Bs3Trap 16GenericEntryErrCd bs3Trap16GenericTrapOrInt ; e97 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; f (reserved)98 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 1099 Bs3Trap 16GenericEntryErrCd bs3Trap16GenericTrapOrInt ; 11100 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 12101 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 13102 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 14103 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 15 (reserved)104 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 16 (reserved)105 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 17 (reserved)106 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 18 (reserved)107 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 19 (reserved)108 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 1a (reserved)109 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 1b (reserved)110 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 1c (reserved)111 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 1d (reserved)112 Bs3Trap 16GenericEntryErrCd bs3Trap16GenericTrapOrInt ; 1e113 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt ; 1f (reserved)71 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 0 72 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 1 73 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 2 74 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 3 75 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 4 76 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 5 77 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 6 78 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 7 79 Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt ; 8 80 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 9 81 Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt ; a 82 Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt ; b 83 Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt ; c 84 Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt ; d 85 Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt ; e 86 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; f (reserved) 87 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 10 88 Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt ; 11 89 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 12 90 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 13 91 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 14 92 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 15 (reserved) 93 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 16 (reserved) 94 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 17 (reserved) 95 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 18 (reserved) 96 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 19 (reserved) 97 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 1a (reserved) 98 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 1b (reserved) 99 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 1c (reserved) 100 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 1d (reserved) 101 Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt ; 1e 102 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt ; 1f (reserved) 114 103 %rep 224 115 Bs3Trap 16GenericEntryNoErr bs3Trap16GenericTrapOrInt104 Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt 116 105 %endrep 117 BS3_PROC_END Bs3Trap 16GenericEntries118 AssertCompile(Bs3Trap 16GenericEntries_EndProc - Bs3Trap16GenericEntries == 8*256)106 BS3_PROC_END Bs3TrapRmV86GenericEntries 107 AssertCompile(Bs3TrapRmV86GenericEntries_EndProc - Bs3TrapRmV86GenericEntries == 8*256) 119 108 120 109 … … 124 113 ; Note! This code is going to "misbehave" if the high word of ESP is not cleared. 125 114 ; 126 BS3_PROC_BEGIN _bs3Trap 16GenericTrapOrInt127 BS3_PROC_BEGIN bs3Trap 16GenericTrapOrInt115 BS3_PROC_BEGIN _bs3TrapRmV86GenericTrapOrInt 116 BS3_PROC_BEGIN bs3TrapRmV86GenericTrapOrInt 128 117 CPU 386 129 jmp near bs3Trap 16GenericTrapErrCode80286 ; Bs3Trap16Init adjusts this on 80386+118 jmp near bs3TrapRmV86GenericTrapErrCode8086 ; Bs3TrapRmV86Init adjusts this on 80386+ 130 119 push ebp 131 120 movzx ebp, sp … … 136 125 push ss ; BP - 0eh 137 126 push esp ; BP - 12h 138 139 ;140 ; We may be comming from 32-bit code where SS is flat and ESP has a non-141 ; zero high word. We need to thunk it for C code to work correctly with142 ; [BP+xx] and [SS:BX+xx] style addressing that leaves out the high word.143 ;144 ; Note! Require ring-0 handler for non-standard stacks (SS.DPL must equal CPL).145 ;146 mov bx, ss147 lar ebx, bx148 test ebx, X86LAR_F_D149 jz .stack_fine150 test esp, 0ffff0000h151 jnz .stack_thunk152 .stack_load_r0_ss16:153 mov bx, ss154 and bl, 3155 AssertCompile(BS3_SEL_RING_SHIFT == 8)156 mov bh, bl157 add bx, BS3_SEL_R0_SS16158 jmp .stack_load_bx_into_ss159 .stack_thunk:160 mov ebx, esp161 shr ebx, 16162 shl ebx, X86_SEL_SHIFT163 add ebx, BS3_SEL_TILED_R0164 cmp ebx, BS3_SEL_TILED_R0_LAST165 ja .stack_esp_out_of_bounds166 .stack_load_bx_into_ss:167 mov ss, bx168 .stack_fine:169 movzx esp, sp170 127 171 128 ; Reserve space for the the register and trap frame. … … 181 138 182 139 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], eax 183 mov edx, [bp - 12h] 184 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], edx 185 mov [ss:bx + BS3TRAPFRAME.uHandlerRsp], edx 140 mov edx, [bp - 12h] ; This isn't quite right for wrap arounds, but close enough for now 141 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], edx ; high bits 142 mov [ss:bx + BS3TRAPFRAME.uHandlerRsp], edx ; high bits 186 143 mov dx, [bp - 0eh] 187 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], dx144 ;mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], dx - share this here 188 145 mov [ss:bx + BS3TRAPFRAME.uHandlerSs], dx 189 146 mov edx, [bp - 0ch] 190 147 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], edx 191 148 mov edx, [bp - 8] 192 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], edx ; high bits149 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], edx ; high bits 193 150 mov [ss:bx + BS3TRAPFRAME.fHandlerRfl], edx 194 151 mov edx, [bp - 4] … … 206 163 add bp, 6 ; adjust so it points to the word before the iret frame. 207 164 xor dx, dx 208 jmp bs3Trap16GenericCommon 209 210 .stack_esp_out_of_bounds: 211 %ifdef BS3_STRICT 212 int3 213 %endif 214 jmp .stack_load_bx_into_ss 215 BS3_PROC_END bs3Trap16GenericTrapErrCode 165 jmp bs3TrapRmV86GenericCommon 166 BS3_PROC_END bs3TrapRmV86GenericTrapErrCode 216 167 217 168 ;; 218 ; Trap with error code - 80 286 code variant.219 ; 220 BS3_PROC_BEGIN bs3Trap 16GenericTrapErrCode80286221 CPU 286169 ; Trap with error code - 8086/V20/80186/80286 code variant. 170 ; 171 BS3_PROC_BEGIN bs3TrapRmV86GenericTrapErrCode8086 172 CPU 8086 222 173 push bp 223 174 mov bp, sp 224 175 push bx 225 176 pushf 177 push ax 226 178 cld 227 179 228 180 ; Reserve space for the the register and trap frame. 229 181 mov bx, (BS3TRAPFRAME_size + 7) / 8 182 xor ax, ax 230 183 .more_zeroed_space: 231 push 0232 push 0233 push 0234 push 0184 push ax 185 push ax 186 push ax 187 push ax 235 188 dec bx 236 189 jnz .more_zeroed_space … … 238 191 239 192 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], ax 240 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], ss193 ;mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], ss - share this here 241 194 mov [ss:bx + BS3TRAPFRAME.uHandlerSs], ss 242 195 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], dx … … 257 210 add bp, 4 ; adjust so it points to the word before the iret frame. 258 211 mov dl, 1 259 jmp bs3Trap 16GenericCommon260 BS3_PROC_END bs3Trap 16GenericTrapErrCode80286212 jmp bs3TrapRmV86GenericCommon 213 BS3_PROC_END bs3TrapRmV86GenericTrapErrCode8086 261 214 262 215 … … 275 228 ; - Ctx.rflags - high bits only. 276 229 ; - Ctx.esp - high bits only. 277 ; - Ctx.ss - for same cpl frames278 230 ; - All other bytes are zeroed. 279 231 ; … … 282 234 ; @param dx One (1) if 286, zero (0) if 386+. 283 235 ; 284 BS3_PROC_BEGIN bs3Trap 16GenericCommon285 CPU 286236 BS3_PROC_BEGIN bs3TrapRmV86GenericCommon 237 CPU 8086 286 238 ; 287 239 ; Fake EBP frame. … … 303 255 jmp .save_segment_registers 304 256 .save_word_grps: 305 CPU 286257 CPU 8086 306 258 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rcx], cx 307 259 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], di … … 310 262 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], ds 311 263 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.es], es 312 313 ; 314 ; Load 16-bit data selector for the DPL we're executing at into DS and ES. 315 ; Save the handler SS and CS values first. 316 ; 317 mov ax, cs 318 mov [ss:bx + BS3TRAPFRAME.uHandlerCs], ax 319 mov ax, ss 320 and ax, 3 321 mov cx, ax 322 shl ax, BS3_SEL_RING_SHIFT 323 or ax, cx 324 add ax, BS3_SEL_R0_DS16 264 mov [ss:bx + BS3TRAPFRAME.uHandlerCs], cs 265 266 ; 267 ; Load 16-bit BS3KIT_GRPNM_DATA16 into DS and ES so we can access globals. 268 ; 269 mov ax, BS3KIT_GRPNM_DATA16 325 270 mov ds, ax 326 271 mov es, ax 327 272 328 273 ; 329 ; Copy and update the mode now that we've got a flat DS. 274 ; Copy the mode now that we've got a flat DS. We don't need to update 275 ; it as it didn't change. 330 276 ; 331 277 mov al, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 332 278 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], al 333 mov cl, al334 and cl, ~BS3_MODE_CODE_MASK335 or cl, BS3_MODE_CODE_16336 mov [BS3_DATA16_WRT(g_bBs3CurrentMode)], cl337 279 338 280 ; … … 347 289 mov cx, [bp + 4] 348 290 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cs], cx 349 350 test al, BS3_MODE_CODE_V86351 jnz .iret_frame_v8086352 353 mov ax, ss354 and al, 3355 and cl, 3356 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], cl357 cmp cl, al358 je .iret_frame_same_cpl359 360 .ret_frame_different_cpl:361 mov cx, [bp + 10]362 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx363 mov cx, [bp + 8]364 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx365 mov byte [ss:bx + BS3TRAPFRAME.cbIretFrame], 5*2366 test dx, dx367 jnz .iret_frame_done368 jmp .iret_frame_seed_high_eip_word369 370 .iret_frame_same_cpl:371 291 mov cx, ss 372 292 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx … … 374 294 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx 375 295 mov byte [ss:bx + BS3TRAPFRAME.cbIretFrame], 3*2 376 test dx, dx 377 jnz .iret_frame_done 378 jmp .iret_frame_seed_high_eip_word 379 380 .iret_frame_v8086: 381 CPU 386 382 or dword [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], X86_EFL_VM 383 mov byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], 3 384 or byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], BS3_MODE_CODE_V86 ; paranoia ^ 2 385 %if 0 ;; @todo testcase: high ESP word from V86 mode, 16-bit TSS. 386 movzx ecx, word [bp + 8] 387 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], ecx 388 %else 389 mov cx, word [bp + 8] 390 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx 391 %endif 392 mov cx, [bp + 10] 393 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx 394 mov cx, [bp + 12] 395 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.es], cx 396 mov cx, [bp + 14] 397 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], cx 398 mov cx, [bp + 16] 399 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fs], cx 400 mov cx, [bp + 18] 401 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.gs], cx 402 mov byte [ss:bx + BS3TRAPFRAME.cbIretFrame], 9*2 403 jmp .iret_frame_done 404 405 ; 406 ; For 386 we do special tricks to supply the high word of EIP when 407 ; arriving here from 32-bit code. (ESP was seeded earlier.) 408 ; 409 .iret_frame_seed_high_eip_word: 410 lar eax, [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cs] 411 jnz .iret_frame_done 412 test eax, X86LAR_F_D 413 jz .iret_frame_done 414 mov ax, [g_uBs3TrapEipHint+2] 415 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rip + 2], ax 416 417 .iret_frame_done: 296 418 297 ; 419 298 ; Control registers. 420 299 ; 300 cmp byte [BS3_DATA16_WRT(g_uBs3CpuDetected)], BS3CPU_80286 301 jb .skip_control_regsiters_because_80186_or_older 302 303 ; The 286 ones. 304 CPU 286 421 305 str [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.tr] 422 306 sldt [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ldtr] 307 smsw ax 308 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0], ax 309 423 310 test dx, dx 424 jnz .s ave_286_control_registers311 jnz .set_flags 425 312 .save_386_control_registers: 426 313 CPU 386 427 mov ax, ss428 test al, 3429 jnz .skip_crX_because_ cpl_not_0314 ; 386 control registers are not accessible from virtual 8086 mode. 315 test al, X86_CR0_PE 316 jnz .skip_crX_because_v8086 430 317 mov eax, cr0 431 318 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0], eax … … 445 332 jmp .set_flags 446 333 447 .skip_crX_because_cpl_not_0: 334 CPU 8086 335 .skip_control_regsiters_because_80186_or_older: 336 .skip_crX_because_v8086: 448 337 or byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR 449 jmp .set_flags450 451 CPU 286452 .save_286_control_registers:453 smsw [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0]454 455 338 .set_flags: ; The double fault code joins us here. 456 339 or byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_AMD64 … … 476 359 ; Resume execution using trap frame. 477 360 ; 478 push 0 361 xor ax, ax 362 push ax 479 363 push ss 480 364 add di, BS3TRAPFRAME.Ctx … … 484 368 hlt 485 369 jmp .panic 486 BS3_PROC_END bs3Trap16GenericCommon 487 488 489 ;; 490 ; Helper. 491 ; 492 ; @retruns Flat address in es:di. 493 ; @param di 494 ; @uses eax 495 ; 496 bs3Trap16TssInDiToFar1616InEsDi: 497 CPU 286 498 push ax 499 500 ; ASSUME Bs3Gdt is being used. 501 push BS3_SEL_SYSTEM16 502 pop es 503 and di, 0fff8h 504 add di, Bs3Gdt wrt BS3SYSTEM16 505 506 ; Load the TSS base into ax:di (di is low, ax high) 507 mov al, [es:di + (X86DESCGENERIC_BIT_OFF_BASE_HIGH1 / 8)] 508 mov ah, [es:di + (X86DESCGENERIC_BIT_OFF_BASE_HIGH2 / 8)] 509 mov di, [es:di + (X86DESCGENERIC_BIT_OFF_BASE_LOW / 8)] 510 511 ; Convert ax to tiled selector, if not within the tiling area we read 512 ; random BS3SYSTEM16 bits as that's preferable to #GP'ing. 513 shl ax, X86_SEL_SHIFT 514 cmp ax, BS3_SEL_TILED_LAST - BS3_SEL_TILED 515 %ifdef BS3_STRICT 516 jbe .tiled 517 int3 518 %endif 519 ja .return ; don't crash again. 520 .tiled: 521 add ax, BS3_SEL_TILED 522 mov es, ax 523 .return: 524 pop ax 525 ret 526 527 528 ;; 529 ; Double fault handler. 530 ; 531 ; We don't have to load any selectors or clear anything in EFLAGS because the 532 ; TSS specified sane values which got loaded during the task switch. 533 ; 534 ; @param dx Zero (0) for indicating 386+ to the common code. 535 ; 536 BS3_PROC_BEGIN _Bs3Trap16DoubleFaultHandler80386 537 BS3_PROC_BEGIN Bs3Trap16DoubleFaultHandler80386 538 CPU 386 539 push 0 ; We'll copy the rip from the other TSS here later to create a more sensible call chain. 540 push ebp 541 mov bp, sp 542 pushfd ; Handler flags. 543 544 ; Reserve space for the the register and trap frame. 545 mov bx, (BS3TRAPFRAME_size + 15) / 16 546 .more_zeroed_space: 547 push dword 0 548 push dword 0 549 push dword 0 550 push dword 0 551 dec bx 552 jz .more_zeroed_space 553 mov bx, sp 554 555 ; 556 ; Fill in the high GRP register words before we mess them up. 557 ; 558 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], eax 559 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rbx], ebx 560 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rcx], ecx 561 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], edx 562 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], esi 563 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], edi 564 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp], ebp 565 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], esp 566 567 ; 568 ; FS and GS are not part of the 16-bit TSS because they are 386+ specfic. 569 ; 570 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fs], fs 571 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.gs], gs 572 573 ; 574 ; Fill in the non-context trap frame bits. 575 ; 576 mov ecx, [bp - 4] 577 mov [ss:bx + BS3TRAPFRAME.fHandlerRfl], ecx 578 mov byte [ss:bx + BS3TRAPFRAME.bXcpt], X86_XCPT_DF 579 mov [ss:bx + BS3TRAPFRAME.uHandlerCs], cs 580 mov [ss:bx + BS3TRAPFRAME.uHandlerSs], ss 581 mov ecx, esp 582 lea cx, [bp + 8] 583 mov [ss:bx + BS3TRAPFRAME.uHandlerRsp], ecx 584 mov cx, [bp + 6] 585 mov [ss:bx + BS3TRAPFRAME.uErrCd], cx 586 587 ; 588 ; Copy 80386+ control registers. 589 ; 590 mov ecx, cr0 591 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0], ecx 592 mov ecx, cr2 593 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr2], ecx 594 mov ecx, cr3 595 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr3], ecx 596 597 test byte [1 + BS3_DATA16_WRT(g_uBs3CpuDetected)], (BS3CPU_F_CPUID >> 8) ; CR4 first appeared in later 486es. 598 jz .skip_cr4_because_not_there 599 mov ecx, cr4 600 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr4], ecx 601 jmp .common 602 603 .skip_cr4_because_not_there: 604 mov byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR4 605 606 ; 607 ; Copy the register state from the previous task segment. 608 ; The 80286 code with join us here. 609 ; 610 .common: 611 CPU 286 612 ; Find our TSS. 613 str di 614 call bs3Trap16TssInDiToFar1616InEsDi 615 616 ; Find the previous TSS. 617 mov di, [es:di + X86TSS32.selPrev] 618 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.tr], ax 619 call bs3Trap16TssInDiToFar1616InEsDi 620 621 ; Do the copying. 622 mov cx, [es:di + X86TSS16.ax] 623 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], cx 624 mov cx, [es:di + X86TSS16.cx] 625 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rcx], cx 626 mov cx, [es:di + X86TSS16.dx] 627 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], cx 628 mov cx, [es:di + X86TSS16.bx] 629 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rbx], cx 630 mov cx, [es:di + X86TSS16.sp] 631 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx 632 mov cx, [es:di + X86TSS16.bp] 633 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp], cx 634 mov [bp], cx ; For better call stacks. 635 mov cx, [es:di + X86TSS16.si] 636 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], cx 637 mov cx, [es:di + X86TSS16.di] 638 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], cx 639 mov cx, [es:di + X86TSS16.si] 640 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], cx 641 mov cx, [es:di + X86TSS16.flags] 642 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], cx 643 mov cx, [es:di + X86TSS16.ip] 644 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rip], cx 645 mov [bp + 2], cx ; For better call stacks. 646 mov cx, [es:di + X86TSS16.cs] 647 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cs], cx 648 mov cx, [es:di + X86TSS16.ds] 649 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], cx 650 mov cx, [es:di + X86TSS16.es] 651 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.es], cx 652 mov cx, [es:di + X86TSS16.ss] 653 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx 654 mov cx, [es:di + X86TSS16.selLdt] ; Note! This isn't necessarily the ldtr at the time of the fault. 655 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ldtr], cx 656 657 ; 658 ; Set CPL; copy and update mode. 659 ; 660 mov cl, [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss] 661 and cl, 3 662 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], cl 663 664 mov cl, [BS3_DATA16_WRT(g_bBs3CurrentMode)] 665 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], cl 666 and cl, ~BS3_MODE_CODE_MASK 667 or cl, BS3_MODE_CODE_16 668 mov [BS3_DATA16_WRT(g_bBs3CurrentMode)], cl 669 670 ; 671 ; Join code paths with the generic handler code. 672 ; 673 jmp bs3Trap16GenericCommon.set_flags 674 BS3_PROC_END Bs3Trap16DoubleFaultHandler 675 676 677 ;; 678 ; Double fault handler. 679 ; 680 ; We don't have to load any selectors or clear anything in EFLAGS because the 681 ; TSS specified sane values which got loaded during the task switch. 682 ; 683 ; @param dx One (1) for indicating 386+ to the common code. 684 ; 685 BS3_PROC_BEGIN _Bs3Trap16DoubleFaultHandler80286 686 BS3_PROC_BEGIN Bs3Trap16DoubleFaultHandler80286 687 CPU 286 688 push 0 ; We'll copy the rip from the other TSS here later to create a more sensible call chain. 689 push bp 690 mov bp, sp 691 pushf ; Handler flags. 692 693 ; Reserve space for the the register and trap frame. 694 mov bx, (BS3TRAPFRAME_size + 7) / 8 695 .more_zeroed_space: 696 push 0 697 push 0 698 push 0 699 push 0 700 dec bx 701 jz .more_zeroed_space 702 mov bx, sp 703 704 ; 705 ; Fill in the non-context trap frame bits. 706 ; 707 mov cx, [bp - 2] 708 mov [ss:bx + BS3TRAPFRAME.fHandlerRfl], cx 709 mov byte [ss:bx + BS3TRAPFRAME.bXcpt], X86_XCPT_DF 710 mov [ss:bx + BS3TRAPFRAME.uHandlerCs], cs 711 mov [ss:bx + BS3TRAPFRAME.uHandlerSs], ss 712 lea cx, [bp + 8] 713 mov [ss:bx + BS3TRAPFRAME.uHandlerRsp], cx 714 mov cx, [bp + 6] 715 mov [ss:bx + BS3TRAPFRAME.uErrCd], cx 716 717 ; 718 ; Copy 80286 specific control register. 719 ; 720 smsw [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0] 721 722 jmp Bs3Trap16DoubleFaultHandler80386.common 723 BS3_PROC_END Bs3Trap16DoubleFaultHandler80286 724 725 370 BS3_PROC_END bs3TrapRmV86GenericCommon 371 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapRmV86Init.c
r60527 r60585 37 37 flat address matches. Also, these symbols are defined both with 38 38 and without underscore prefixes. */ 39 extern BS3_DECL(void) BS3_FAR_CODE Bs3Trap 16GenericEntries(void);39 extern BS3_DECL(void) BS3_FAR_CODE Bs3TrapRmV86GenericEntries(void); 40 40 41 41 /* These two are ugly. Need data access for patching purposes. */ 42 extern uint8_t BS3_FAR_DATA bs3Trap 16GenericTrapOrInt[];42 extern uint8_t BS3_FAR_DATA bs3TrapRmV86GenericTrapOrInt[]; 43 43 44 44 /* bs3-cmn-TrapRmV86Data.c: */ … … 74 74 if (f386Plus) 75 75 { 76 uint8_t BS3_FAR_DATA *pbFunction = &bs3Trap 16GenericTrapOrInt[0];76 uint8_t BS3_FAR_DATA *pbFunction = &bs3TrapRmV86GenericTrapOrInt[0]; 77 77 #if ARCH_BITS == 16 78 78 if (g_bBs3CurrentMode != BS3_MODE_RM) … … 93 93 if (iIvt != 0x10 && iIvt != BS3_TRAP_SYSCALL) 94 94 { 95 paIvt[iIvt].off = (uint16_t)(uintptr_t)Bs3Trap 16GenericEntries + iIvt * 8;95 paIvt[iIvt].off = (uint16_t)(uintptr_t)Bs3TrapRmV86GenericEntries + iIvt * 8; 96 96 paIvt[iIvt].sel = BS3_SEL_TEXT16; 97 97 } … … 99 99 100 100 101 #undef Bs3TrapRmV86Init Ex101 #undef Bs3TrapRmV86Init 102 102 BS3_CMN_DEF(void, Bs3TrapRmV86Init,(void)) 103 103 { -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModes.c
r60578 r60585 181 181 } 182 182 183 183 #undef Bs3TestDoModes 184 184 BS3_MODE_DEF(void, Bs3TestDoModes,(PCBS3TESTMODEENTRY paEntries, size_t cEntries)) 185 185 { -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TrapInit.c
r60554 r60585 32 32 33 33 34 #undef Bs3TrapInit 34 35 BS3_MODE_DEF(void, Bs3TrapInit,(void)) 35 36 { 36 #if BS3_MODE_IS_16BIT_SYS(TMPL_MODE) 37 #if BS3_MODE_IS_RM_SYS(TMPL_MODE) 38 Bs3TrapRmV86Init(); 39 #elif BS3_MODE_IS_16BIT_SYS(TMPL_MODE) 40 Bs3TrapRmV86Init(); 37 41 Bs3Trap16Init(); 38 42 #elif BS3_MODE_IS_32BIT_SYS(TMPL_MODE) 43 Bs3TrapRmV86Init(); 39 44 Bs3Trap32Init(); 40 45 #elif BS3_MODE_IS_64BIT_SYS(TMPL_MODE) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c
r60578 r60585 50 50 if ((g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80286) 51 51 Bs3Trap16Init(); 52 Bs3TrapRmV86Init(); 52 53 } 53 54 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
r60554 r60585 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - Function needing mangling .3 * BS3Kit - Function needing mangling - generated by the bs3kit-mangling-code-define.h makefile rule. 4 4 */ 5 5 … … 25 25 */ 26 26 27 28 #define Bs3A20Disable BS3_CMN_MANGLER(Bs3A20Disable) 29 #define Bs3A20DisableViaKbd BS3_CMN_MANGLER(Bs3A20DisableViaKbd) 30 #define Bs3A20DisableViaPortA BS3_CMN_MANGLER(Bs3A20DisableViaPortA) 31 #define Bs3A20Enable BS3_CMN_MANGLER(Bs3A20Enable) 32 #define Bs3A20EnableViaKbd BS3_CMN_MANGLER(Bs3A20EnableViaKbd) 33 #define Bs3A20EnableViaPortA BS3_CMN_MANGLER(Bs3A20EnableViaPortA) 34 #define Bs3KbdRead BS3_CMN_MANGLER(Bs3KbdRead) 35 #define Bs3KbdWait BS3_CMN_MANGLER(Bs3KbdWait) 36 #define Bs3KbdWrite BS3_CMN_MANGLER(Bs3KbdWrite) 37 #define Bs3MemAlloc BS3_CMN_MANGLER(Bs3MemAlloc) 38 #define Bs3MemAllocZ BS3_CMN_MANGLER(Bs3MemAllocZ) 39 #define Bs3MemCpy BS3_CMN_MANGLER(Bs3MemCpy) 40 #define Bs3MemFree BS3_CMN_MANGLER(Bs3MemFree) 41 #define Bs3MemMove BS3_CMN_MANGLER(Bs3MemMove) 42 #define Bs3MemPCpy BS3_CMN_MANGLER(Bs3MemPCpy) 43 #define Bs3MemZero BS3_CMN_MANGLER(Bs3MemZero) 44 #define Bs3PagingInitRootForLM BS3_CMN_MANGLER(Bs3PagingInitRootForLM) 45 #define Bs3PagingInitRootForPAE BS3_CMN_MANGLER(Bs3PagingInitRootForPAE) 46 #define Bs3PagingInitRootForPP BS3_CMN_MANGLER(Bs3PagingInitRootForPP) 47 #define Bs3PagingProtect BS3_CMN_MANGLER(Bs3PagingProtect) 48 #define Bs3PagingProtectPtr BS3_CMN_MANGLER(Bs3PagingProtectPtr) 49 #define Bs3Panic BS3_CMN_MANGLER(Bs3Panic) 50 #define Bs3PicMaskAll BS3_CMN_MANGLER(Bs3PicMaskAll) 51 #define Bs3PrintChr BS3_CMN_MANGLER(Bs3PrintChr) 52 #define Bs3Printf BS3_CMN_MANGLER(Bs3Printf) 53 #define Bs3PrintfV BS3_CMN_MANGLER(Bs3PrintfV) 54 #define Bs3PrintStr BS3_CMN_MANGLER(Bs3PrintStr) 55 #define Bs3PrintStrN BS3_CMN_MANGLER(Bs3PrintStrN) 56 #define Bs3PrintU32 BS3_CMN_MANGLER(Bs3PrintU32) 57 #define Bs3PrintX32 BS3_CMN_MANGLER(Bs3PrintX32) 58 #define Bs3RegCtxConvertToRingX BS3_CMN_MANGLER(Bs3RegCtxConvertToRingX) 59 #define Bs3RegCtxPrint BS3_CMN_MANGLER(Bs3RegCtxPrint) 60 #define Bs3RegCtxRestore BS3_CMN_MANGLER(Bs3RegCtxRestore) 61 #define Bs3RegCtxSave BS3_CMN_MANGLER(Bs3RegCtxSave) 62 #define Bs3SelFlatCodeToRealMode BS3_CMN_MANGLER(Bs3SelFlatCodeToRealMode) 63 #define Bs3SelFlatCodeToProtFar16 BS3_CMN_MANGLER(Bs3SelFlatCodeToProtFar16) 64 #define Bs3SelFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelFar32ToFlat32) 65 #define Bs3SelProtFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelProtFar32ToFlat32) 66 #define Bs3SelProtModeCodeToRealMode BS3_CMN_MANGLER(Bs3SelProtModeCodeToRealMode) 67 #define Bs3SelRealModeCodeToProtMode BS3_CMN_MANGLER(Bs3SelRealModeCodeToProtMode) 68 #define Bs3Shutdown BS3_CMN_MANGLER(Bs3Shutdown) 69 #define Bs3SlabAlloc BS3_CMN_MANGLER(Bs3SlabAlloc) 70 #define Bs3SlabAllocEx BS3_CMN_MANGLER(Bs3SlabAllocEx) 71 #define Bs3SlabFree BS3_CMN_MANGLER(Bs3SlabFree) 72 #define Bs3SlabInit BS3_CMN_MANGLER(Bs3SlabInit) 73 #define Bs3SlabListAdd BS3_CMN_MANGLER(Bs3SlabListAdd) 74 #define Bs3SlabListAlloc BS3_CMN_MANGLER(Bs3SlabListAlloc) 75 #define Bs3SlabListAllocEx BS3_CMN_MANGLER(Bs3SlabListAllocEx) 76 #define Bs3SlabListFree BS3_CMN_MANGLER(Bs3SlabListFree) 77 #define Bs3SlabListInit BS3_CMN_MANGLER(Bs3SlabListInit) 78 #define Bs3StrCpy BS3_CMN_MANGLER(Bs3StrCpy) 79 #define Bs3StrFormatV BS3_CMN_MANGLER(Bs3StrFormatV) 80 #define Bs3StrLen BS3_CMN_MANGLER(Bs3StrLen) 81 #define Bs3StrNLen BS3_CMN_MANGLER(Bs3StrNLen) 82 #define Bs3StrPrintf BS3_CMN_MANGLER(Bs3StrPrintf) 83 #define Bs3StrPrintfV BS3_CMN_MANGLER(Bs3StrPrintfV) 84 #define Bs3TestCheckRegCtxEx BS3_CMN_MANGLER(Bs3TestCheckRegCtxEx) 85 #define Bs3TestFailed BS3_CMN_MANGLER(Bs3TestFailed) 86 #define Bs3TestFailedF BS3_CMN_MANGLER(Bs3TestFailedF) 87 #define Bs3TestFailedV BS3_CMN_MANGLER(Bs3TestFailedV) 88 #define Bs3TestInit BS3_CMN_MANGLER(Bs3TestInit) 89 #define Bs3TestPrintf BS3_CMN_MANGLER(Bs3TestPrintf) 90 #define Bs3TestPrintfV BS3_CMN_MANGLER(Bs3TestPrintfV) 91 #define Bs3TestSkipped BS3_CMN_MANGLER(Bs3TestSkipped) 92 #define Bs3TestSkippedF BS3_CMN_MANGLER(Bs3TestSkippedF) 93 #define Bs3TestSkippedV BS3_CMN_MANGLER(Bs3TestSkippedV) 94 #define Bs3TestSub BS3_CMN_MANGLER(Bs3TestSub) 95 #define Bs3TestSubDone BS3_CMN_MANGLER(Bs3TestSubDone) 96 #define Bs3TestSubErrorCount BS3_CMN_MANGLER(Bs3TestSubErrorCount) 97 #define Bs3TestSubF BS3_CMN_MANGLER(Bs3TestSubF) 98 #define Bs3TestSubV BS3_CMN_MANGLER(Bs3TestSubV) 99 #define Bs3TestTerm BS3_CMN_MANGLER(Bs3TestTerm) 100 #define Bs3Trap16Init BS3_CMN_MANGLER(Bs3Trap16Init) 101 #define Bs3Trap16InitEx BS3_CMN_MANGLER(Bs3Trap16InitEx) 102 #define Bs3Trap16SetGate BS3_CMN_MANGLER(Bs3Trap16SetGate) 103 #define Bs3Trap32Init BS3_CMN_MANGLER(Bs3Trap32Init) 104 #define Bs3Trap32SetGate BS3_CMN_MANGLER(Bs3Trap32SetGate) 105 #define Bs3Trap64Init BS3_CMN_MANGLER(Bs3Trap64Init) 106 #define Bs3Trap64SetGate BS3_CMN_MANGLER(Bs3Trap64SetGate) 107 #define Bs3TrapDefaultHandler BS3_CMN_MANGLER(Bs3TrapDefaultHandler) 108 #define Bs3TrapPrintFrame BS3_CMN_MANGLER(Bs3TrapPrintFrame) 109 #define Bs3TrapRmV86SetGate BS3_CMN_MANGLER(Bs3TrapRmV86SetGate) 110 #define Bs3TrapSetHandler BS3_CMN_MANGLER(Bs3TrapSetHandler) 111 #define Bs3TrapSetJmp BS3_CMN_MANGLER(Bs3TrapSetJmp) 112 #define Bs3TrapSetJmpAndRestore BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore) 113 #define Bs3TrapUnsetJmp BS3_CMN_MANGLER(Bs3TrapUnsetJmp) 114 27 #define Bs3A20Disable BS3_CMN_MANGLER(Bs3A20Disable) 28 #define Bs3A20DisableViaKbd BS3_CMN_MANGLER(Bs3A20DisableViaKbd) 29 #define Bs3A20DisableViaPortA BS3_CMN_MANGLER(Bs3A20DisableViaPortA) 30 #define Bs3A20Enable BS3_CMN_MANGLER(Bs3A20Enable) 31 #define Bs3A20EnableViaKbd BS3_CMN_MANGLER(Bs3A20EnableViaKbd) 32 #define Bs3A20EnableViaPortA BS3_CMN_MANGLER(Bs3A20EnableViaPortA) 33 #define Bs3KbdRead BS3_CMN_MANGLER(Bs3KbdRead) 34 #define Bs3KbdWait BS3_CMN_MANGLER(Bs3KbdWait) 35 #define Bs3KbdWrite BS3_CMN_MANGLER(Bs3KbdWrite) 36 #define Bs3MemAlloc BS3_CMN_MANGLER(Bs3MemAlloc) 37 #define Bs3MemAllocZ BS3_CMN_MANGLER(Bs3MemAllocZ) 38 #define Bs3MemCpy BS3_CMN_MANGLER(Bs3MemCpy) 39 #define Bs3MemFree BS3_CMN_MANGLER(Bs3MemFree) 40 #define Bs3MemMove BS3_CMN_MANGLER(Bs3MemMove) 41 #define Bs3MemPCpy BS3_CMN_MANGLER(Bs3MemPCpy) 42 #define Bs3MemZero BS3_CMN_MANGLER(Bs3MemZero) 43 #define Bs3PagingInitRootForLM BS3_CMN_MANGLER(Bs3PagingInitRootForLM) 44 #define Bs3PagingInitRootForPAE BS3_CMN_MANGLER(Bs3PagingInitRootForPAE) 45 #define Bs3PagingInitRootForPP BS3_CMN_MANGLER(Bs3PagingInitRootForPP) 46 #define Bs3PagingProtect BS3_CMN_MANGLER(Bs3PagingProtect) 47 #define Bs3PagingProtectPtr BS3_CMN_MANGLER(Bs3PagingProtectPtr) 48 #define Bs3Panic BS3_CMN_MANGLER(Bs3Panic) 49 #define Bs3PicMaskAll BS3_CMN_MANGLER(Bs3PicMaskAll) 50 #define Bs3PrintChr BS3_CMN_MANGLER(Bs3PrintChr) 51 #define Bs3Printf BS3_CMN_MANGLER(Bs3Printf) 52 #define Bs3PrintfV BS3_CMN_MANGLER(Bs3PrintfV) 53 #define Bs3PrintStr BS3_CMN_MANGLER(Bs3PrintStr) 54 #define Bs3PrintStrN BS3_CMN_MANGLER(Bs3PrintStrN) 55 #define Bs3PrintU32 BS3_CMN_MANGLER(Bs3PrintU32) 56 #define Bs3PrintX32 BS3_CMN_MANGLER(Bs3PrintX32) 57 #define Bs3RegCtxConvertToRingX BS3_CMN_MANGLER(Bs3RegCtxConvertToRingX) 58 #define Bs3RegCtxPrint BS3_CMN_MANGLER(Bs3RegCtxPrint) 59 #define Bs3RegCtxRestore BS3_CMN_MANGLER(Bs3RegCtxRestore) 60 #define Bs3RegCtxSave BS3_CMN_MANGLER(Bs3RegCtxSave) 61 #define Bs3SelFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelFar32ToFlat32) 62 #define Bs3SelFlatCodeToProtFar16 BS3_CMN_MANGLER(Bs3SelFlatCodeToProtFar16) 63 #define Bs3SelFlatCodeToRealMode BS3_CMN_MANGLER(Bs3SelFlatCodeToRealMode) 64 #define Bs3SelProtFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelProtFar32ToFlat32) 65 #define Bs3SelProtModeCodeToRealMode BS3_CMN_MANGLER(Bs3SelProtModeCodeToRealMode) 66 #define Bs3SelRealModeCodeToProtMode BS3_CMN_MANGLER(Bs3SelRealModeCodeToProtMode) 67 #define Bs3Shutdown BS3_CMN_MANGLER(Bs3Shutdown) 68 #define Bs3SlabAlloc BS3_CMN_MANGLER(Bs3SlabAlloc) 69 #define Bs3SlabAllocEx BS3_CMN_MANGLER(Bs3SlabAllocEx) 70 #define Bs3SlabFree BS3_CMN_MANGLER(Bs3SlabFree) 71 #define Bs3SlabInit BS3_CMN_MANGLER(Bs3SlabInit) 72 #define Bs3SlabListAdd BS3_CMN_MANGLER(Bs3SlabListAdd) 73 #define Bs3SlabListAlloc BS3_CMN_MANGLER(Bs3SlabListAlloc) 74 #define Bs3SlabListAllocEx BS3_CMN_MANGLER(Bs3SlabListAllocEx) 75 #define Bs3SlabListFree BS3_CMN_MANGLER(Bs3SlabListFree) 76 #define Bs3SlabListInit BS3_CMN_MANGLER(Bs3SlabListInit) 77 #define Bs3StrCpy BS3_CMN_MANGLER(Bs3StrCpy) 78 #define Bs3StrFormatV BS3_CMN_MANGLER(Bs3StrFormatV) 79 #define Bs3StrLen BS3_CMN_MANGLER(Bs3StrLen) 80 #define Bs3StrNLen BS3_CMN_MANGLER(Bs3StrNLen) 81 #define Bs3StrPrintf BS3_CMN_MANGLER(Bs3StrPrintf) 82 #define Bs3StrPrintfV BS3_CMN_MANGLER(Bs3StrPrintfV) 83 #define Bs3TestCheckRegCtxEx BS3_CMN_MANGLER(Bs3TestCheckRegCtxEx) 84 #define Bs3TestFailed BS3_CMN_MANGLER(Bs3TestFailed) 85 #define Bs3TestFailedF BS3_CMN_MANGLER(Bs3TestFailedF) 86 #define Bs3TestFailedV BS3_CMN_MANGLER(Bs3TestFailedV) 87 #define Bs3TestInit BS3_CMN_MANGLER(Bs3TestInit) 88 #define Bs3TestPrintf BS3_CMN_MANGLER(Bs3TestPrintf) 89 #define Bs3TestPrintfV BS3_CMN_MANGLER(Bs3TestPrintfV) 90 #define Bs3TestSkipped BS3_CMN_MANGLER(Bs3TestSkipped) 91 #define Bs3TestSkippedF BS3_CMN_MANGLER(Bs3TestSkippedF) 92 #define Bs3TestSkippedV BS3_CMN_MANGLER(Bs3TestSkippedV) 93 #define Bs3TestSub BS3_CMN_MANGLER(Bs3TestSub) 94 #define Bs3TestSubDone BS3_CMN_MANGLER(Bs3TestSubDone) 95 #define Bs3TestSubErrorCount BS3_CMN_MANGLER(Bs3TestSubErrorCount) 96 #define Bs3TestSubF BS3_CMN_MANGLER(Bs3TestSubF) 97 #define Bs3TestSubV BS3_CMN_MANGLER(Bs3TestSubV) 98 #define Bs3TestTerm BS3_CMN_MANGLER(Bs3TestTerm) 99 #define Bs3Trap16Init BS3_CMN_MANGLER(Bs3Trap16Init) 100 #define Bs3Trap16InitEx BS3_CMN_MANGLER(Bs3Trap16InitEx) 101 #define Bs3Trap16SetGate BS3_CMN_MANGLER(Bs3Trap16SetGate) 102 #define Bs3Trap32Init BS3_CMN_MANGLER(Bs3Trap32Init) 103 #define Bs3Trap32SetGate BS3_CMN_MANGLER(Bs3Trap32SetGate) 104 #define Bs3Trap64Init BS3_CMN_MANGLER(Bs3Trap64Init) 105 #define Bs3Trap64SetGate BS3_CMN_MANGLER(Bs3Trap64SetGate) 106 #define Bs3TrapDefaultHandler BS3_CMN_MANGLER(Bs3TrapDefaultHandler) 107 #define Bs3TrapPrintFrame BS3_CMN_MANGLER(Bs3TrapPrintFrame) 108 #define Bs3TrapRmV86Init BS3_CMN_MANGLER(Bs3TrapRmV86Init) 109 #define Bs3TrapRmV86InitEx BS3_CMN_MANGLER(Bs3TrapRmV86InitEx) 110 #define Bs3TrapRmV86SetGate BS3_CMN_MANGLER(Bs3TrapRmV86SetGate) 111 #define Bs3TrapSetHandler BS3_CMN_MANGLER(Bs3TrapSetHandler) 112 #define Bs3TrapSetJmp BS3_CMN_MANGLER(Bs3TrapSetJmp) 113 #define Bs3TrapSetJmpAndRestore BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore) 114 #define Bs3TrapUnsetJmp BS3_CMN_MANGLER(Bs3TrapUnsetJmp) 115 #define Bs3UInt32Div BS3_CMN_MANGLER(Bs3UInt32Div) 116 #define Bs3UInt64Div BS3_CMN_MANGLER(Bs3UInt64Div) 117 #ifndef BS3_CMN_ONLY 118 # define Bs3CpuDetect BS3_MODE_MANGLER(Bs3CpuDetect) 119 # define Bs3TestDoModes BS3_MODE_MANGLER(Bs3TestDoModes) 120 # define Bs3TrapInit BS3_MODE_MANGLER(Bs3TrapInit) 121 #endif /* !BS3_CMN_ONLY */ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r60554 r60585 24 24 * terms and conditions of either the GPL or the CDDL or both. 25 25 */ 26 27 26 28 27 #undef Bs3A20Disable … … 60 59 #undef Bs3RegCtxRestore 61 60 #undef Bs3RegCtxSave 61 #undef Bs3SelFar32ToFlat32 62 #undef Bs3SelFlatCodeToProtFar16 62 63 #undef Bs3SelFlatCodeToRealMode 63 #undef Bs3SelFlatCodeToProtFar1664 #undef Bs3SelFar32ToFlat3265 64 #undef Bs3SelProtFar32ToFlat32 66 65 #undef Bs3SelProtModeCodeToRealMode … … 107 106 #undef Bs3TrapDefaultHandler 108 107 #undef Bs3TrapPrintFrame 108 #undef Bs3TrapRmV86Init 109 #undef Bs3TrapRmV86InitEx 109 110 #undef Bs3TrapRmV86SetGate 110 111 #undef Bs3TrapSetHandler … … 112 113 #undef Bs3TrapSetJmpAndRestore 113 114 #undef Bs3TrapUnsetJmp 114 115 #undef Bs3UInt32Div 116 #undef Bs3UInt64Div 117 #ifndef BS3_CMN_ONLY 118 # undef Bs3CpuDetect 119 # undef Bs3TestDoModes 120 # undef Bs3TrapInit 121 #endif /* !BS3_CMN_ONLY */ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code.h
r60578 r60585 30 30 */ 31 31 #undef BS3_CMN_MANGLER 32 #undef BS3_MODE_MANGLER 32 33 #if ARCH_BITS != 16 || !defined(BS3_USE_ALT_16BIT_TEXT_SEG) 33 34 # define BS3_CMN_MANGLER(a_Function) BS3_CMN_NM(a_Function) 35 # define BS3_MODE_MANGLER(a_Function) TMPL_NM(a_Function) 34 36 #else 35 37 # define BS3_CMN_MANGLER(a_Function) BS3_CMN_FAR_NM(a_Function) 38 # define BS3_MODE_MANGLER(a_Function) TMPL_FAR_NM(a_Function) 36 39 #endif 37 40 #include "bs3kit-mangling-code-undef.h" -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60578 r60585 1269 1269 */ 1270 1270 1271 /** @def BS3_CMN_PROTO 1272 * Macro for prototyping all the variations of a common function.1271 /** @def BS3_CMN_PROTO_INT 1272 * Internal macro for prototyping all the variations of a common function. 1273 1273 * @param a_RetType The return type. 1274 1274 * @param a_Name The function basename. 1275 1275 * @param a_Params The parameter list (in parentheses). 1276 * @param a_fAutoStub Whether to autogenerate a 16-bit near -> 16-bit far stub 1277 * function. Either 'true' for stub or 'false' for no stub. 1276 * @sa BS3_CMN_PROTO_STUB, BS3_CMN_PROTO_NOSB 1278 1277 */ 1279 1278 #if ARCH_BITS == 16 1280 # define BS3_CMN_PROTO (a_RetType, a_Name, a_Params, a_fAutoStub) \1279 # define BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params) \ 1281 1280 BS3_DECL_NEAR(a_RetType) BS3_CMN_NM(a_Name) a_Params; \ 1282 1281 BS3_DECL_FAR(a_RetType) BS3_CMN_FAR_NM(a_Name) a_Params 1283 1282 #else 1284 # define BS3_CMN_PROTO (a_RetType, a_Name, a_Params, a_fAutoStub) \1283 # define BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params) \ 1285 1284 BS3_DECL_NEAR(a_RetType) BS3_CMN_NM(a_Name) a_Params 1286 1285 #endif 1286 1287 /** @BS3_CMN_PROTO_STUB 1288 * Macro for prototyping all the variations of a common function with automatic 1289 * near -> far stub. 1290 * 1291 * @param a_RetType The return type. 1292 * @param a_Name The function basename. 1293 * @param a_Params The parameter list (in parentheses). 1294 * @sa BS3_CMN_PROTO_NOSB 1295 */ 1296 #define BS3_CMN_PROTO_STUB(a_RetType, a_Name, a_Params) BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params) 1297 1298 /** @BS3_CMN_PROTO_NOSB 1299 * Macro for prototyping all the variations of a common function without any 1300 * near > far stub. 1301 * 1302 * @param a_RetType The return type. 1303 * @param a_Name The function basename. 1304 * @param a_Params The parameter list (in parentheses). 1305 * @sa BS3_CMN_PROTO_STUB 1306 */ 1307 #define BS3_CMN_PROTO_NOSB(a_RetType, a_Name, a_Params) BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params) 1308 1309 /** @BS3_CMN_PROTO_FRST 1310 * Macro for prototyping all the variations of a common function with automatic 1311 * far -> near stub. 1312 * 1313 * @param a_cbParam16 The size of the 16-bit parameter list in bytes. 1314 * @param a_RetType The return type. 1315 * @param a_Name The function basename. 1316 * @param a_Params The parameter list (in parentheses). 1317 * @sa BS3_CMN_PROTO_STUB 1318 */ 1319 #define BS3_CMN_PROTO_FARSTUB(a_cbParam16, a_RetType, a_Name, a_Params) BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params) 1320 1287 1321 1288 1322 /** @def BS3_CMN_DEF … … 1319 1353 * The current implementation will only halt the CPU. 1320 1354 */ 1321 BS3_CMN_PROTO (DECL_NO_RETURN(void), Bs3Panic,(void), false);1355 BS3_CMN_PROTO_NOSB(DECL_NO_RETURN(void), Bs3Panic,(void)); 1322 1356 #if !defined(BS3_KIT_WITH_NO_RETURN) && defined(__WATCOMC__) 1323 1357 # pragma aux Bs3Panic_c16 __aborts … … 1332 1366 * just halt the CPU. 1333 1367 */ 1334 BS3_CMN_PROTO (void, Bs3Shutdown,(void), false);1368 BS3_CMN_PROTO_NOSB(void, Bs3Shutdown,(void)); 1335 1369 1336 1370 /** … … 1339 1373 * @param uValue The 32-bit value. 1340 1374 */ 1341 BS3_CMN_PROTO (void, Bs3PrintU32,(uint32_t uValue), false);1375 BS3_CMN_PROTO_NOSB(void, Bs3PrintU32,(uint32_t uValue)); 1342 1376 1343 1377 /** … … 1346 1380 * @param uValue The 32-bit value. 1347 1381 */ 1348 BS3_CMN_PROTO (void, Bs3PrintX32,(uint32_t uValue), false);1382 BS3_CMN_PROTO_NOSB(void, Bs3PrintX32,(uint32_t uValue)); 1349 1383 1350 1384 /** … … 1356 1390 * @param ... Format arguments. 1357 1391 */ 1358 BS3_CMN_PROTO (size_t, Bs3Printf,(const char BS3_FAR *pszFormat, ...), true);1392 BS3_CMN_PROTO_STUB(size_t, Bs3Printf,(const char BS3_FAR *pszFormat, ...)); 1359 1393 1360 1394 /** … … 1366 1400 * @param va Format arguments. 1367 1401 */ 1368 BS3_CMN_PROTO (size_t, Bs3PrintfV,(const char BS3_FAR *pszFormat, va_list va), true);1402 BS3_CMN_PROTO_STUB(size_t, Bs3PrintfV,(const char BS3_FAR *pszFormat, va_list va)); 1369 1403 1370 1404 /** … … 1373 1407 * @param pszString The string to print. 1374 1408 */ 1375 BS3_CMN_PROTO (void, Bs3PrintStr,(const char BS3_FAR *pszString), true);1409 BS3_CMN_PROTO_STUB(void, Bs3PrintStr,(const char BS3_FAR *pszString)); 1376 1410 1377 1411 /** … … 1381 1415 * @param cchString The exact number of characters to print. 1382 1416 */ 1383 BS3_CMN_PROTO (void, Bs3PrintStrN,(const char BS3_FAR *pszString, size_t cchString), false);1417 BS3_CMN_PROTO_NOSB(void, Bs3PrintStrN,(const char BS3_FAR *pszString, size_t cchString)); 1384 1418 1385 1419 /** … … 1388 1422 * @param ch The character to print. 1389 1423 */ 1390 BS3_CMN_PROTO (void, Bs3PrintChr,(char ch), false);1424 BS3_CMN_PROTO_NOSB(void, Bs3PrintChr,(char ch)); 1391 1425 1392 1426 … … 1422 1456 * @param pvUser The user argument for the output function. 1423 1457 */ 1424 BS3_CMN_PROTO (size_t, Bs3StrFormatV,(const char BS3_FAR *pszFormat, va_list va,1425 PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser), true);1458 BS3_CMN_PROTO_STUB(size_t, Bs3StrFormatV,(const char BS3_FAR *pszFormat, va_list va, 1459 PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser)); 1426 1460 1427 1461 /** … … 1437 1471 * @param va Format arguments. 1438 1472 */ 1439 BS3_CMN_PROTO (size_t, Bs3StrPrintfV,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, va_list va), true);1473 BS3_CMN_PROTO_STUB(size_t, Bs3StrPrintfV,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, va_list va)); 1440 1474 1441 1475 /** … … 1451 1485 * @param ... Format arguments. 1452 1486 */ 1453 BS3_CMN_PROTO (size_t, Bs3StrPrintf,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, ...), true);1487 BS3_CMN_PROTO_STUB(size_t, Bs3StrPrintf,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, ...)); 1454 1488 1455 1489 … … 1460 1494 * @param pszString The string to examine. 1461 1495 */ 1462 BS3_CMN_PROTO (size_t, Bs3StrLen,(const char BS3_FAR *pszString), true);1496 BS3_CMN_PROTO_STUB(size_t, Bs3StrLen,(const char BS3_FAR *pszString)); 1463 1497 1464 1498 /** … … 1470 1504 * @param cchMax The max length to examine. 1471 1505 */ 1472 BS3_CMN_PROTO (size_t, Bs3StrNLen,(const char BS3_FAR *pszString, size_t cchMax), true);1506 BS3_CMN_PROTO_STUB(size_t, Bs3StrNLen,(const char BS3_FAR *pszString, size_t cchMax)); 1473 1507 1474 1508 /** … … 1480 1514 * @param pszSrc The source string. 1481 1515 */ 1482 BS3_CMN_PROTO (char BS3_FAR *, Bs3StrCpy,(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc), true);1516 BS3_CMN_PROTO_STUB(char BS3_FAR *, Bs3StrCpy,(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc)); 1483 1517 1484 1518 /** … … 1490 1524 * @param cbCopy The number of bytes to copy. 1491 1525 */ 1492 BS3_CMN_PROTO (void BS3_FAR *, Bs3MemCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy), true);1526 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)); 1493 1527 1494 1528 /** … … 1500 1534 * @param cbCopy The number of bytes to copy. 1501 1535 */ 1502 BS3_CMN_PROTO (void BS3_FAR *, Bs3MemPCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy), true);1536 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemPCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)); 1503 1537 1504 1538 /** … … 1510 1544 * @param cbCopy The number of bytes to copy. 1511 1545 */ 1512 BS3_CMN_PROTO (void BS3_FAR *, Bs3MemMove,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy), true);1546 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemMove,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)); 1513 1547 1514 1548 /** … … 1518 1552 * @param cbDst The number of bytes to zero. 1519 1553 */ 1520 BS3_CMN_PROTO(void, Bs3MemZero,(void BS3_FAR *pvDst, size_t cbDst), false); 1554 BS3_CMN_PROTO_NOSB(void, Bs3MemZero,(void BS3_FAR *pvDst, size_t cbDst)); 1555 1556 1557 BS3_CMN_PROTO_STUB(void, Bs3UInt64Div,(RTUINT64U uDividend, RTUINT64U uDivisor, RTUINT64U BS3_FAR *paQuotientReminder)); 1558 BS3_CMN_PROTO_STUB(void, Bs3UInt32Div,(RTUINT32U uDividend, RTUINT32U uDivisor, RTUINT32U BS3_FAR *paQuotientReminder)); 1521 1559 1522 1560 … … 1528 1566 * @param uSel The protected mode segment selector. 1529 1567 */ 1530 BS3_CMN_PROTO (uint32_t, Bs3SelProtFar32ToFlat32,(uint32_t off, uint16_t uSel), true);1568 BS3_CMN_PROTO_STUB(uint32_t, Bs3SelProtFar32ToFlat32,(uint32_t off, uint16_t uSel)); 1531 1569 1532 1570 /** … … 1537 1575 * @param uSel The current mode segment selector. 1538 1576 */ 1539 BS3_CMN_PROTO (uint32_t, Bs3SelFar32ToFlat32,(uint32_t off, uint16_t uSel), true);1577 BS3_CMN_PROTO_STUB(uint32_t, Bs3SelFar32ToFlat32,(uint32_t off, uint16_t uSel)); 1540 1578 1541 1579 /** … … 1545 1583 * @param uRealSeg Real mode code segment. 1546 1584 */ 1547 BS3_CMN_PROTO (uint16_t, Bs3SelRealModeCodeToProtMode,(uint16_t uRealSeg), false);1585 BS3_CMN_PROTO_NOSB(uint16_t, Bs3SelRealModeCodeToProtMode,(uint16_t uRealSeg)); 1548 1586 1549 1587 /** … … 1553 1591 * @param uProtSel Real mode code segment. 1554 1592 */ 1555 BS3_CMN_PROTO (uint16_t, Bs3SelProtModeCodeToRealMode,(uint16_t uProtSel), false);1593 BS3_CMN_PROTO_NOSB(uint16_t, Bs3SelProtModeCodeToRealMode,(uint16_t uProtSel)); 1556 1594 1557 1595 /** … … 1561 1599 * @param uFlatAddr Flat code address. 1562 1600 */ 1563 BS3_CMN_PROTO (uint32_t, Bs3SelFlatCodeToRealMode,(uint32_t uFlatAddr), false);1601 BS3_CMN_PROTO_NOSB(uint32_t, Bs3SelFlatCodeToRealMode,(uint32_t uFlatAddr)); 1564 1602 1565 1603 /** … … 1570 1608 * @param uFlatAddr Flat code address. 1571 1609 */ 1572 BS3_CMN_PROTO (uint32_t, Bs3SelFlatCodeToProtFar16,(uint32_t uFlatAddr), false);1610 BS3_CMN_PROTO_NOSB(uint32_t, Bs3SelFlatCodeToProtFar16,(uint32_t uFlatAddr)); 1573 1611 1574 1612 /** … … 1651 1689 * @param cbChunk The chunk size. 1652 1690 */ 1653 BS3_CMN_PROTO (void, Bs3SlabInit,(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr,1654 uint32_t cbSlab, uint16_t cbChunk), true);1691 BS3_CMN_PROTO_STUB(void, Bs3SlabInit,(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, 1692 uint32_t cbSlab, uint16_t cbChunk)); 1655 1693 1656 1694 /** … … 1660 1698 * @param pSlabCtl The slab constrol structure to allocate from. 1661 1699 */ 1662 BS3_CMN_PROTO (void BS3_FAR *, Bs3SlabAlloc,(PBS3SLABCTL pSlabCtl), true);1700 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3SlabAlloc,(PBS3SLABCTL pSlabCtl)); 1663 1701 1664 1702 /** … … 1671 1709 * @param fFlags Flags, see BS3_SLAB_ALLOC_F_XXX 1672 1710 */ 1673 BS3_CMN_PROTO (void BS3_FAR *, Bs3SlabAllocEx,(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags), true);1711 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3SlabAllocEx,(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags)); 1674 1712 1675 1713 /** … … 1682 1720 * @param cChunks The number of contiguous chunks to free. 1683 1721 */ 1684 BS3_CMN_PROTO (uint16_t, Bs3SlabFree,(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks), true);1722 BS3_CMN_PROTO_STUB(uint16_t, Bs3SlabFree,(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks)); 1685 1723 1686 1724 … … 1691 1729 * @param cbChunk The chunk size. 1692 1730 */ 1693 BS3_CMN_PROTO (void, Bs3SlabListInit,(PBS3SLABHEAD pHead, uint16_t cbChunk), true);1731 BS3_CMN_PROTO_STUB(void, Bs3SlabListInit,(PBS3SLABHEAD pHead, uint16_t cbChunk)); 1694 1732 1695 1733 /** … … 1699 1737 * @param pSlabCtl The slab control structure to add. 1700 1738 */ 1701 BS3_CMN_PROTO (void, Bs3SlabListAdd,(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl), true);1739 BS3_CMN_PROTO_STUB(void, Bs3SlabListAdd,(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl)); 1702 1740 1703 1741 /** … … 1707 1745 * @param pHead The slab list to allocate from. 1708 1746 */ 1709 BS3_CMN_PROTO (void BS3_FAR *, Bs3SlabListAlloc,(PBS3SLABHEAD pHead), true);1747 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3SlabListAlloc,(PBS3SLABHEAD pHead)); 1710 1748 1711 1749 /** … … 1718 1756 * @param fFlags Flags, see BS3_SLAB_ALLOC_F_XXX 1719 1757 */ 1720 BS3_CMN_PROTO (void BS3_FAR *, Bs3SlabListAllocEx,(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags), true);1758 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3SlabListAllocEx,(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags)); 1721 1759 1722 1760 /** … … 1727 1765 * @param cChunks The number of contiguous chunks to free. 1728 1766 */ 1729 BS3_CMN_PROTO (void, Bs3SlabListFree,(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks), true);1767 BS3_CMN_PROTO_STUB(void, Bs3SlabListFree,(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks)); 1730 1768 1731 1769 /** … … 1756 1794 * @param cb How much to allocate. Must be 4KB or less. 1757 1795 */ 1758 BS3_CMN_PROTO (void BS3_FAR *, Bs3MemAlloc,(BS3MEMKIND enmKind, size_t cb), true);1796 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemAlloc,(BS3MEMKIND enmKind, size_t cb)); 1759 1797 1760 1798 /** … … 1765 1803 * @param cb How much to allocate. Must be 4KB or less. 1766 1804 */ 1767 BS3_CMN_PROTO (void BS3_FAR *, Bs3MemAllocZ,(BS3MEMKIND enmKind, size_t cb), true);1805 BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemAllocZ,(BS3MEMKIND enmKind, size_t cb)); 1768 1806 1769 1807 /** … … 1774 1812 * @param cb The size of the allocation. 1775 1813 */ 1776 BS3_CMN_PROTO (void, Bs3MemFree,(void BS3_FAR *pv, size_t cb), true);1814 BS3_CMN_PROTO_STUB(void, Bs3MemFree,(void BS3_FAR *pv, size_t cb)); 1777 1815 1778 1816 … … 1780 1818 * Enables the A20 gate. 1781 1819 */ 1782 BS3_CMN_PROTO (void, Bs3A20Enable,(void), false);1820 BS3_CMN_PROTO_NOSB(void, Bs3A20Enable,(void)); 1783 1821 1784 1822 /** 1785 1823 * Enables the A20 gate via the keyboard controller 1786 1824 */ 1787 BS3_CMN_PROTO (void, Bs3A20EnableViaKbd,(void), false);1825 BS3_CMN_PROTO_NOSB(void, Bs3A20EnableViaKbd,(void)); 1788 1826 1789 1827 /** 1790 1828 * Enables the A20 gate via the PS/2 control port A. 1791 1829 */ 1792 BS3_CMN_PROTO (void, Bs3A20EnableViaPortA,(void), false);1830 BS3_CMN_PROTO_NOSB(void, Bs3A20EnableViaPortA,(void)); 1793 1831 1794 1832 /** 1795 1833 * Disables the A20 gate. 1796 1834 */ 1797 BS3_CMN_PROTO (void, Bs3A20Disable,(void), false);1835 BS3_CMN_PROTO_NOSB(void, Bs3A20Disable,(void)); 1798 1836 1799 1837 /** 1800 1838 * Disables the A20 gate via the keyboard controller 1801 1839 */ 1802 BS3_CMN_PROTO (void, Bs3A20DisableViaKbd,(void), false);1840 BS3_CMN_PROTO_NOSB(void, Bs3A20DisableViaKbd,(void)); 1803 1841 1804 1842 /** 1805 1843 * Disables the A20 gate via the PS/2 control port A. 1806 1844 */ 1807 BS3_CMN_PROTO (void, Bs3A20DisableViaPortA,(void), false);1845 BS3_CMN_PROTO_NOSB(void, Bs3A20DisableViaPortA,(void)); 1808 1846 1809 1847 … … 1814 1852 * @remarks Must not be called in real-mode! 1815 1853 */ 1816 BS3_CMN_PROTO (int, Bs3PagingInitRootForPP,(void), true);1854 BS3_CMN_PROTO_STUB(int, Bs3PagingInitRootForPP,(void)); 1817 1855 1818 1856 /** … … 1823 1861 * @remarks Must not be called in real-mode! 1824 1862 */ 1825 BS3_CMN_PROTO (int, Bs3PagingInitRootForPAE,(void), true);1863 BS3_CMN_PROTO_STUB(int, Bs3PagingInitRootForPAE,(void)); 1826 1864 1827 1865 /** … … 1832 1870 * @remarks Must not be called in real-mode! 1833 1871 */ 1834 BS3_CMN_PROTO (int, Bs3PagingInitRootForLM,(void), true);1872 BS3_CMN_PROTO_STUB(int, Bs3PagingInitRootForLM,(void)); 1835 1873 1836 1874 /** … … 1850 1888 * @param fClear Mask of zero or more X86_PTE_XXX values to clear for the range. 1851 1889 */ 1852 BS3_CMN_PROTO (int, Bs3PagingProtect,(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear), true);1890 BS3_CMN_PROTO_STUB(int, Bs3PagingProtect,(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear)); 1853 1891 1854 1892 /** … … 1868 1906 * @param fClear Mask of zero or more X86_PTE_XXX values to clear for the range. 1869 1907 */ 1870 BS3_CMN_PROTO (int, Bs3PagingProtectPtr,(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear), true);1908 BS3_CMN_PROTO_STUB(int, Bs3PagingProtectPtr,(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear)); 1871 1909 1872 1910 /** 1873 1911 * Waits for the keyboard controller to become ready. 1874 1912 */ 1875 BS3_CMN_PROTO (void, Bs3KbdWait,(void), false);1913 BS3_CMN_PROTO_NOSB(void, Bs3KbdWait,(void)); 1876 1914 1877 1915 /** … … 1884 1922 * @param bCmd The read command. 1885 1923 */ 1886 BS3_CMN_PROTO (uint8_t, Bs3KbdRead,(uint8_t bCmd), false);1924 BS3_CMN_PROTO_NOSB(uint8_t, Bs3KbdRead,(uint8_t bCmd)); 1887 1925 1888 1926 /** … … 1895 1933 * @param bData The data to write. 1896 1934 */ 1897 BS3_CMN_PROTO (void, Bs3KbdWrite,(uint8_t bCmd, uint8_t bData), false);1935 BS3_CMN_PROTO_NOSB(void, Bs3KbdWrite,(uint8_t bCmd, uint8_t bData)); 1898 1936 1899 1937 … … 1901 1939 * Disables all IRQs on the PIC. 1902 1940 */ 1903 BS3_CMN_PROTO (void, Bs3PicMaskAll,(void), true);1941 BS3_CMN_PROTO_STUB(void, Bs3PicMaskAll,(void)); 1904 1942 1905 1943 … … 2001 2039 * @param pRegCtx Where to store the register context. 2002 2040 */ 2003 BS3_CMN_PROTO (void, Bs3RegCtxSave,(PCBS3REGCTX pRegCtx), false);2041 BS3_CMN_PROTO_NOSB(void, Bs3RegCtxSave,(PCBS3REGCTX pRegCtx)); 2004 2042 2005 2043 /** … … 2009 2047 * @param bRing The target ring (0..3). 2010 2048 */ 2011 BS3_CMN_PROTO (void, Bs3RegCtxConvertToRingX,(PBS3REGCTX pRegCtx, uint8_t bRing), true);2049 BS3_CMN_PROTO_STUB(void, Bs3RegCtxConvertToRingX,(PBS3REGCTX pRegCtx, uint8_t bRing)); 2012 2050 2013 2051 /** … … 2020 2058 * @remarks Does not return. 2021 2059 */ 2022 BS3_CMN_PROTO (DECL_NO_RETURN(void), Bs3RegCtxRestore,(PCBS3REGCTX pRegCtx, uint16_t fFlags), false);2060 BS3_CMN_PROTO_NOSB(DECL_NO_RETURN(void), Bs3RegCtxRestore,(PCBS3REGCTX pRegCtx, uint16_t fFlags)); 2023 2061 #if !defined(BS3_KIT_WITH_NO_RETURN) && defined(__WATCOMC__) 2024 2062 # pragma aux Bs3RegCtxRestore_c16 "_Bs3RegCtxRestore_aborts_c16" __aborts … … 2035 2073 * @param pRegCtx The register context to be printed. 2036 2074 */ 2037 BS3_CMN_PROTO (void, Bs3RegCtxPrint,(PCBS3REGCTX pRegCtx), true);2075 BS3_CMN_PROTO_STUB(void, Bs3RegCtxPrint,(PCBS3REGCTX pRegCtx)); 2038 2076 2039 2077 … … 2069 2107 2070 2108 2071 2072 /** 2073 * Initializes 16-bit (protected mode) trap handling. 2074 * 2075 * @remarks Does not install 16-bit trap handling, just initializes the 2109 /** 2110 * Initializes real mode and v8086 trap handling. 2111 * 2112 * @remarks Does not install RM/V86 trap handling, just initializes the 2076 2113 * structures. 2077 2114 */ 2078 BS3_CMN_PROTO (void, Bs3Trap16Init,(void), true);2079 2080 /** 2081 * Initializes 16-bit (protected mode)trap handling, extended version.2115 BS3_CMN_PROTO_STUB(void, Bs3TrapRmV86Init,(void)); 2116 2117 /** 2118 * Initializes real mode and v8086 trap handling, extended version. 2082 2119 * 2083 2120 * @param f386Plus Set if the CPU is 80386 or later and … … 2086 2123 * reversed. 2087 2124 * 2125 * @remarks Does not install RM/V86 trap handling, just initializes the 2126 * structures. 2127 */ 2128 BS3_CMN_PROTO_STUB(void, Bs3TrapRmV86InitEx,(bool f386Plus)); 2129 2130 /** 2131 * Initializes 16-bit (protected mode) trap handling. 2132 * 2088 2133 * @remarks Does not install 16-bit trap handling, just initializes the 2089 2134 * structures. 2090 2135 */ 2091 BS3_CMN_PROTO(void, Bs3Trap16InitEx,(bool f386Plus), true); 2136 BS3_CMN_PROTO_STUB(void, Bs3Trap16Init,(void)); 2137 2138 /** 2139 * Initializes 16-bit (protected mode) trap handling, extended version. 2140 * 2141 * @param f386Plus Set if the CPU is 80386 or later and 2142 * extended registers should be saved. Once initialized 2143 * with this parameter set to @a true, the effect cannot be 2144 * reversed. 2145 * 2146 * @remarks Does not install 16-bit trap handling, just initializes the 2147 * structures. 2148 */ 2149 BS3_CMN_PROTO_STUB(void, Bs3Trap16InitEx,(bool f386Plus)); 2092 2150 2093 2151 /** … … 2097 2155 * structures. 2098 2156 */ 2099 BS3_CMN_PROTO (void, Bs3Trap32Init,(void), true);2157 BS3_CMN_PROTO_STUB(void, Bs3Trap32Init,(void)); 2100 2158 2101 2159 /** … … 2105 2163 * structures. 2106 2164 */ 2107 BS3_CMN_PROTO (void, Bs3Trap64Init,(void), true);2165 BS3_CMN_PROTO_STUB(void, Bs3Trap64Init,(void)); 2108 2166 2109 2167 /** … … 2114 2172 * @param off The handler offset. 2115 2173 */ 2116 BS3_CMN_PROTO (void, Bs3TrapRmV86SetGate,(uint8_t iIvt, uint16_t uSeg, uint16_t off), true);2174 BS3_CMN_PROTO_STUB(void, Bs3TrapRmV86SetGate,(uint8_t iIvt, uint16_t uSeg, uint16_t off)); 2117 2175 2118 2176 /** … … 2126 2184 * @param cParams The parameter count (for call gates). 2127 2185 */ 2128 BS3_CMN_PROTO (void, Bs3Trap16SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl,2129 uint16_t uSel, uint16_t off, uint8_t cParams), true);2186 BS3_CMN_PROTO_STUB(void, Bs3Trap16SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, 2187 uint16_t uSel, uint16_t off, uint8_t cParams)); 2130 2188 2131 2189 /** The address of Bs3Trap16GenericEntries. … … 2145 2203 * @param cParams The parameter count (for call gates). 2146 2204 */ 2147 BS3_CMN_PROTO (void, Bs3Trap32SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl,2148 uint16_t uSel, uint32_t off, uint8_t cParams), true);2205 BS3_CMN_PROTO_STUB(void, Bs3Trap32SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, 2206 uint16_t uSel, uint32_t off, uint8_t cParams)); 2149 2207 2150 2208 /** The address of Bs3Trap32GenericEntries. … … 2164 2222 * @param bIst The interrupt stack to use. 2165 2223 */ 2166 BS3_CMN_PROTO(void, Bs3Trap64SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, 2167 uint16_t uSel, uint64_t off, uint8_t bIst), true); 2224 BS3_CMN_PROTO_STUB(void, Bs3Trap64SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint64_t off, uint8_t bIst)); 2168 2225 2169 2226 /** The address of Bs3Trap64GenericEntries. … … 2202 2259 * @param pfnHandler Pointer to the handler. 2203 2260 */ 2204 BS3_CMN_PROTO (PFNBS3TRAPHANDLER, Bs3TrapSetHandler,(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler), true);2261 BS3_CMN_PROTO_STUB(PFNBS3TRAPHANDLER, Bs3TrapSetHandler,(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler)); 2205 2262 2206 2263 /** … … 2211 2268 * @param pTrapFrame Trap frame of the trap to handle. 2212 2269 */ 2213 BS3_CMN_PROTO (void, Bs3TrapDefaultHandler,(PBS3TRAPFRAME pTrapFrame), true);2270 BS3_CMN_PROTO_STUB(void, Bs3TrapDefaultHandler,(PBS3TRAPFRAME pTrapFrame)); 2214 2271 2215 2272 /** … … 2217 2274 * @param pTrapFrame Trap frame to print. 2218 2275 */ 2219 BS3_CMN_PROTO (void, Bs3TrapPrintFrame,(PCBS3TRAPFRAME pTrapFrame), true);2276 BS3_CMN_PROTO_STUB(void, Bs3TrapPrintFrame,(PCBS3TRAPFRAME pTrapFrame)); 2220 2277 2221 2278 /** … … 2231 2288 * @sa #Bs3TrapUnsetJmp 2232 2289 */ 2233 BS3_CMN_PROTO (DECL_RETURNS_TWICE(bool),Bs3TrapSetJmp,(PBS3TRAPFRAME pTrapFrame), false);2290 BS3_CMN_PROTO_NOSB(DECL_RETURNS_TWICE(bool),Bs3TrapSetJmp,(PBS3TRAPFRAME pTrapFrame)); 2234 2291 2235 2292 /** … … 2239 2296 * @param pTrapFrame Where to store the trap information. 2240 2297 */ 2241 BS3_CMN_PROTO (void, Bs3TrapSetJmpAndRestore,(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame), true);2298 BS3_CMN_PROTO_STUB(void, Bs3TrapSetJmpAndRestore,(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame)); 2242 2299 2243 2300 /** 2244 2301 * Disables a previous #Bs3TrapSetJmp call. 2245 2302 */ 2246 BS3_CMN_PROTO (void, Bs3TrapUnsetJmp,(void), true);2303 BS3_CMN_PROTO_STUB(void, Bs3TrapUnsetJmp,(void)); 2247 2304 2248 2305 … … 2257 2314 * @param pszTest The test name. 2258 2315 */ 2259 BS3_CMN_PROTO (void, Bs3TestInit,(const char BS3_FAR *pszTest), true);2316 BS3_CMN_PROTO_STUB(void, Bs3TestInit,(const char BS3_FAR *pszTest)); 2260 2317 2261 2318 … … 2263 2320 * Equivalent to RTTestSummaryAndDestroy. 2264 2321 */ 2265 BS3_CMN_PROTO (void, Bs3TestTerm,(void), true);2322 BS3_CMN_PROTO_STUB(void, Bs3TestTerm,(void)); 2266 2323 2267 2324 /** 2268 2325 * Equivalent to RTTestISub. 2269 2326 */ 2270 BS3_CMN_PROTO (void, Bs3TestSub,(const char BS3_FAR *pszSubTest), true);2327 BS3_CMN_PROTO_STUB(void, Bs3TestSub,(const char BS3_FAR *pszSubTest)); 2271 2328 2272 2329 /** 2273 2330 * Equivalent to RTTestIFailedF. 2274 2331 */ 2275 BS3_CMN_PROTO (void, Bs3TestSubF,(const char BS3_FAR *pszFormat, ...), true);2332 BS3_CMN_PROTO_STUB(void, Bs3TestSubF,(const char BS3_FAR *pszFormat, ...)); 2276 2333 2277 2334 /** 2278 2335 * Equivalent to RTTestISubV. 2279 2336 */ 2280 BS3_CMN_PROTO (void, Bs3TestSubV,(const char BS3_FAR *pszFormat, va_list va), true);2337 BS3_CMN_PROTO_STUB(void, Bs3TestSubV,(const char BS3_FAR *pszFormat, va_list va)); 2281 2338 2282 2339 /** 2283 2340 * Equivalent to RTTestISubDone. 2284 2341 */ 2285 BS3_CMN_PROTO (void, Bs3TestSubDone,(void), true);2342 BS3_CMN_PROTO_STUB(void, Bs3TestSubDone,(void)); 2286 2343 2287 2344 /** 2288 2345 * Equivalent to RTTestSubErrorCount. 2289 2346 */ 2290 BS3_CMN_PROTO (uint16_t, Bs3TestSubErrorCount,(void), true);2347 BS3_CMN_PROTO_STUB(uint16_t, Bs3TestSubErrorCount,(void)); 2291 2348 2292 2349 /** … … 2296 2353 * @param ... String format arguments. 2297 2354 */ 2298 BS3_CMN_PROTO (void, Bs3TestPrintf,(const char BS3_FAR *pszFormat, ...), true);2355 BS3_CMN_PROTO_STUB(void, Bs3TestPrintf,(const char BS3_FAR *pszFormat, ...)); 2299 2356 2300 2357 /** … … 2304 2361 * @param va String format arguments. 2305 2362 */ 2306 BS3_CMN_PROTO (void, Bs3TestPrintfV,(const char BS3_FAR *pszFormat, va_list va), true);2363 BS3_CMN_PROTO_STUB(void, Bs3TestPrintfV,(const char BS3_FAR *pszFormat, va_list va)); 2307 2364 2308 2365 /** 2309 2366 * Equivalent to RTTestIFailed. 2310 2367 */ 2311 BS3_CMN_PROTO (void, Bs3TestFailed,(const char BS3_FAR *pszMessage), true);2368 BS3_CMN_PROTO_STUB(void, Bs3TestFailed,(const char BS3_FAR *pszMessage)); 2312 2369 2313 2370 /** 2314 2371 * Equivalent to RTTestIFailedF. 2315 2372 */ 2316 BS3_CMN_PROTO (void, Bs3TestFailedF,(const char BS3_FAR *pszFormat, ...), true);2373 BS3_CMN_PROTO_STUB(void, Bs3TestFailedF,(const char BS3_FAR *pszFormat, ...)); 2317 2374 2318 2375 /** 2319 2376 * Equivalent to RTTestIFailedV. 2320 2377 */ 2321 BS3_CMN_PROTO (void, Bs3TestFailedV,(const char BS3_FAR *pszFormat, va_list va), true);2378 BS3_CMN_PROTO_STUB(void, Bs3TestFailedV,(const char BS3_FAR *pszFormat, va_list va)); 2322 2379 2323 2380 /** … … 2326 2383 * @param pszWhy Optional reason why it's being skipped. 2327 2384 */ 2328 BS3_CMN_PROTO (void, Bs3TestSkipped,(const char BS3_FAR *pszWhy), true);2385 BS3_CMN_PROTO_STUB(void, Bs3TestSkipped,(const char BS3_FAR *pszWhy)); 2329 2386 2330 2387 /** … … 2334 2391 * @param ... Format arguments. 2335 2392 */ 2336 BS3_CMN_PROTO (void, Bs3TestSkippedF,(const char BS3_FAR *pszFormat, ...), true);2393 BS3_CMN_PROTO_STUB(void, Bs3TestSkippedF,(const char BS3_FAR *pszFormat, ...)); 2337 2394 2338 2395 /** … … 2342 2399 * @param va Format arguments. 2343 2400 */ 2344 BS3_CMN_PROTO (void, Bs3TestSkippedV,(const char BS3_FAR *pszFormat, va_list va), true);2401 BS3_CMN_PROTO_STUB(void, Bs3TestSkippedV,(const char BS3_FAR *pszFormat, va_list va)); 2345 2402 2346 2403 /** … … 2358 2415 * @param idTestStep Test step identifier. 2359 2416 */ 2360 BS3_CMN_PROTO (bool, Bs3TestCheckRegCtxEx,(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust,2361 int16_t cbSpAdjust, uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep), true);2417 BS3_CMN_PROTO_STUB(bool, Bs3TestCheckRegCtxEx,(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust, 2418 int16_t cbSpAdjust, uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep)); 2362 2419 2363 2420 /** … … 2545 2602 2546 2603 2547 /** @def BS3_MODE_PROTO 2548 * Macro for reducing typing. 2549 * 2550 * Doxygen knows how to expand this, well, kind of. 2604 /** @def BS3_MODE_PROTO_INT 2605 * Internal macro for emitting prototypes for mode functions. 2551 2606 * 2552 2607 * @param a_RetType The return type. 2553 2608 * @param a_Name The function basename. 2554 2609 * @param a_Params The parameter list (in parentheses). 2555 * @param a_fAutoStub Whether to autogenerate a 16-bit near -> 16-bit far stub 2556 * function. Either 'true' for stub or 'false' for no stub. 2557 */ 2558 #define BS3_MODE_PROTO(a_RetType, a_Name, a_Params, a_fAutoStub) \ 2610 * @sa BS3_MODE_PROTO_STUB, BS3_MODE_PROTO_NOSB 2611 */ 2612 #define BS3_MODE_PROTO_INT(a_RetType, a_Name, a_Params) \ 2559 2613 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_rm) a_Params; \ 2560 2614 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pe16) a_Params; \ … … 2594 2648 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_lm16_far) a_Params 2595 2649 2650 /** @def BS3_MODE_PROTO_STUB 2651 * Macro for prototyping all the variations of a mod function with automatic 2652 * near -> far stub. 2653 * 2654 * @param a_RetType The return type. 2655 * @param a_Name The function basename. 2656 * @param a_Params The parameter list (in parentheses). 2657 * @sa BS3_MODE_PROTO_STUB, BS3_MODE_PROTO_NOSB 2658 */ 2659 #define BS3_MODE_PROTO_STUB(a_RetType, a_Name, a_Params) BS3_MODE_PROTO_INT(a_RetType, a_Name, a_Params) 2660 2661 /** @def BS3_MODE_PROTO_STUB 2662 * Macro for prototyping all the variations of a mod function without any 2663 * near -> far stub. 2664 * 2665 * @param a_RetType The return type. 2666 * @param a_Name The function basename. 2667 * @param a_Params The parameter list (in parentheses). 2668 * @sa BS3_MODE_PROTO_STUB, BS3_MODE_PROTO_NOSB 2669 */ 2670 #define BS3_MODE_PROTO_NOSB(a_RetType, a_Name, a_Params) BS3_MODE_PROTO_INT(a_RetType, a_Name, a_Params) 2671 2672 2596 2673 /** 2597 2674 * Macro for reducing typing. … … 2641 2718 * capabilities. 2642 2719 */ 2643 BS3_MODE_PROTO (uint8_t, Bs3CpuDetect,(void), false);2720 BS3_MODE_PROTO_NOSB(uint8_t, Bs3CpuDetect,(void)); 2644 2721 2645 2722 /** @name BS3CPU_XXX - CPU detected by BS3CpuDetect_c16() and friends. … … 2677 2754 * Calls the appropriate Bs3Trap16Init, Bs3Trap32Init or Bs3Trap64Init function. 2678 2755 */ 2679 BS3_MODE_PROTO (void, Bs3TrapInit,(void), true);2756 BS3_MODE_PROTO_STUB(void, Bs3TrapInit,(void)); 2680 2757 2681 2758 /** … … 2685 2762 * @param cEntries The number of sub-test entries. 2686 2763 */ 2687 BS3_MODE_PROTO (void, Bs3TestDoModes,(PCBS3TESTMODEENTRY paEntries, size_t cEntries), true);2764 BS3_MODE_PROTO_NOSB(void, Bs3TestDoModes,(PCBS3TESTMODEENTRY paEntries, size_t cEntries)); 2688 2765 2689 2766
Note:
See TracChangeset
for help on using the changeset viewer.