- Timestamp:
- Apr 18, 2016 7:11:32 PM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 3 added
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/Config.kmk
r60540 r60554 78 78 # @param 1 The target name. 79 79 # @param 2 List of functions. 80 BS3KIT_FN_GEN_NEARSTUBS = $(foreach fn,$2,$(evalcall2 def_Bs3KitGenNearStubSource,$1,$(fn))) 80 BS3KIT_FN_GEN_NEARSTUBS = $(foreach fn,$2,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$(fn)_c16,_$(fn)_f16)) 81 82 ## 83 # Macro for generating near-call aliases for zero or more 16-bit C mode functions. 84 # @param 1 The target name. 85 # @param 2 List of mode functions. 86 BS3KIT_FN_GEN_MODE_NEARSTUBS = $(foreach fn,$2,$(foreach suff, \ 87 _rm \ 88 _pe16 \ 89 _pe16_v86 \ 90 _pe32_16 \ 91 _pev86 \ 92 _pp16 \ 93 _pp16_v86 \ 94 _pp32_16 \ 95 _ppv86 \ 96 _pae16 \ 97 _pae16_v86 \ 98 _pae32_16 \ 99 _paev86 \ 100 _lm16 \ 101 ,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$(fn)$(suff),_$(fn)$(suff)_far))) 102 103 # @param 1 The target name. 104 # @param 2 The near function name. 105 # @param 3 The far function name. 81 106 define def_Bs3KitGenNearStubSource 82 $1_SOURCES += $$($1_0_OUTDIR)/ near-call-to-$2_f16.asm83 $1_CLEAN += $$($1_0_OUTDIR)/ near-call-to-$2_f16.asm84 $$$$($1_0_OUTDIR)/ near-call-to-$2_f16.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@)107 $1_SOURCES += $$($1_0_OUTDIR)/stub$2.asm 108 $1_CLEAN += $$($1_0_OUTDIR)/stub$2.asm 109 $$$$($1_0_OUTDIR)/stub$2.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@) 85 110 $(QUIET)$(APPEND) -tn $$@ \ 86 111 '%include "bs3kit.mac"' \ 87 112 'BS3_BEGIN_TEXT16' \ 88 ' extern _$2_f16' \113 ' extern $3' \ 89 114 'BS3_BEGIN_TEXT16_NEARSTUBS' \ 90 'BS3_GLOBAL_NAME_EX _$2_c16, function, 6' \115 'BS3_GLOBAL_NAME_EX $2, function, 6' \ 91 116 ' pop ax' \ 92 117 ' push cs' \ 93 118 ' push ax' \ 94 ' jmp _$2_f16wrt CGROUP16'119 ' jmp $3 wrt CGROUP16' 95 120 endef 96 121 … … 631 656 ,,$(QUIET)$(MV_EXT) -f -- "$(out)" "$(out).tmp" \ 632 657 $$(NLTAB)$(QUIET)$(VBoxBs3Linker_1_TARGET) -o $(out) $(bs3-bootsector_1_TARGET) $(out).tmp \ 633 $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp") 658 $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp") \ 659 $(eval .PRECIOUS: $(outbase).map) # ugly hack! 660 634 661 635 662 TEMPLATE_VBoxBS3KitImg_LIBS = \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.mac
r60445 r60554 40 40 41 41 %if 0 ; Will be doing the testing in C, I think. 42 BS3_PROC_BEGIN_MODE bs3CpuBasic2_iret 42 BS3_PROC_BEGIN_MODE bs3CpuBasic2_iret, BS3_PBC_FAR 43 43 BS3_CALL_CONV_PROLOG 1 44 44 push xBP … … 79 79 80 80 81 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int80 81 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int80, BS3_PBC_NEAR 82 82 int 80h 83 83 .again: ud2 … … 86 86 87 87 88 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int81 88 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int81, BS3_PBC_NEAR 89 89 int 81h 90 90 .again: ud2 … … 93 93 94 94 95 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int82 95 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int82, BS3_PBC_NEAR 96 96 int 82h 97 97 .again: ud2 … … 100 100 101 101 102 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int83 102 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int83, BS3_PBC_NEAR 103 103 int 83h 104 104 .again: ud2 … … 107 107 108 108 109 BS3_PROC_BEGIN_MODE bs3CpuBasic2_sidt_bx_ud2 109 BS3_PROC_BEGIN_MODE bs3CpuBasic2_sidt_bx_ud2, BS3_PBC_NEAR 110 110 sidt [xBX] 111 111 .again: ud2 … … 114 114 115 115 116 BS3_PROC_BEGIN_MODE bs3CpuBasic2_lidt_bx_ud2 116 BS3_PROC_BEGIN_MODE bs3CpuBasic2_lidt_bx_ud2, BS3_PBC_NEAR 117 117 lidt [xBX] 118 118 .again: ud2 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r60539 r60554 90 90 bs3-cmn-SelFar32ToFlat32.c \ 91 91 bs3-cmn-SelProtFar32ToFlat32.c \ 92 bs3-cmn-SelProtModeCodeToRealMode.asm \ 92 93 bs3-cmn-SelRealModeCodeToProtMode.asm \ 93 94 bs3-cmn-SelFlatCodeToRealMode.asm \ … … 102 103 bs3-cmn-SlabListAllocEx.c \ 103 104 bs3-cmn-SlabListFree.c \ 105 bs3-cmn-SwitchHlpConvRealModeRetfPopBpDecBpAndReturn.asm \ 106 bs3-cmn-SwitchHlpConvProtModeRetfPopBpDecBpAndReturn.asm \ 104 107 bs3-cmn-SwitchToRing0.asm \ 105 108 bs3-cmn-SwitchToRing1.asm \ … … 213 216 Bs3TestSubF \ 214 217 Bs3TestSubV \ 215 Bs3Trap16InitEx 218 Bs3Trap16InitEx \ 219 220 bs3kit-common-16_VBOX_NEAR_TO_FAR_MODE_FUNCTIONS := \ 221 Bs3TestDoModes \ 222 Bs3TrapInit \ 223 216 224 $(call BS3KIT_FN_GEN_NEARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_NEAR_TO_FAR_FUNCTIONS)) 225 $(call BS3KIT_FN_GEN_MODE_NEARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_NEAR_TO_FAR_MODE_FUNCTIONS)) 217 226 218 227 # The 32-bit BS3Kit library. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-A20Enable.asm
r60527 r60554 45 45 call BS3_CMN_NM(Bs3A20EnableViaPortA) 46 46 ;; @todo real 286 support 47 ; call TMPL_NM_CMN(Bs3A20EnableViaKbd)47 ; call BS3_CMN_NM(Bs3A20EnableViaKbd) 48 48 49 49 pop xBP -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SelRealModeCodeToProtMode.asm
r60539 r60554 38 38 ;; 39 39 ; @cproto BS3_CMN_PROTO(uint16_t, Bs3SelRealModeCodeToProtMode,(uint16_t uRealSel), false); 40 ; @uses ax (return register) 40 41 ; 41 42 BS3_PROC_BEGIN_CMN Bs3SelRealModeCodeToProtMode, BS3_PBC_NEAR -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-common.mac
r60539 r60554 157 157 section BS3RMTEXT16_END align=1 CLASS=BS3CLASS16RMCODE PUBLIC USE16 158 158 BS3_GLOBAL_DATA Bs3RmText16_EndOfSegment, 0 159 GROUP BS3GROUPRMTEXT16 BS3RMTEXT16_START BS3RMTEXT16 BS3RMTEXT16_END 159 160 160 161 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-CpuDetect.asm
r60365 r60554 42 42 ; @remarks ASSUMES we're in ring-0 when not in some kind of real mode. 43 43 ; 44 BS3_PROC_BEGIN_MODE Bs3CpuDetect 44 BS3_PROC_BEGIN_MODE Bs3CpuDetect, BS3_PBC_HYBRID_0_ARGS 45 45 CPU 8086 46 46 push xBP … … 293 293 popf 294 294 pop xBP 295 ret295 BS3_HYBRID_RET 296 296 297 297 BS3_PROC_END_MODE Bs3CpuDetect -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-EnteredMode.asm
r60527 r60554 40 40 ; @remarks ASSUMES we're in ring-0 when not in some kind of real mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3EnteredMode 42 BS3_PROC_BEGIN_MODE Bs3EnteredMode, BS3_PBC_NEAR ; won't need this outside the switchers, so always near. 43 43 push xBP 44 44 mov xBP, xSP -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForLM64.asm
r60291 r60554 51 51 ; @remarks returns value in EAX, not dx:ax! 52 52 ; 53 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForLM64 53 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForLM64, BS3_PBC_NEAR ; Internal function, no far variant necessary. 54 54 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootLM)] 55 55 cmp eax, 0ffffffffh -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForPAE16.asm
r59941 r60554 40 40 ; @remarks returns value in EAX, not dx:ax! 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPAE16 42 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPAE16, BS3_PBC_NEAR ; Internal function, no far variant necessary. 43 43 jmp TMPL_NM(Bs3PagingGetRootForPAE32) 44 44 BS3_PROC_END_MODE Bs3PagingGetRootForPAE16 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForPAE32.asm
r60019 r60554 51 51 ; @remarks returns value in EAX, not dx:ax! 52 52 ; 53 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPAE32 53 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPAE32, BS3_PBC_NEAR ; Internal function, no far variant necessary. 54 54 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPAE)] 55 55 cmp eax, 0ffffffffh -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForPP16.asm
r59941 r60554 40 40 ; @remarks returns value in EAX, not dx:ax! 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPP16 42 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPP16, BS3_PBC_NEAR ; Internal function, no far variant necessary. 43 43 jmp TMPL_NM(Bs3PagingGetRootForPP32) 44 44 BS3_PROC_END_MODE Bs3PagingGetRootForPP16 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-PagingGetRootForPP32.asm
r60291 r60554 51 51 ; @remarks returns value in EAX, not dx:ax! 52 52 ; 53 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPP32 53 BS3_PROC_BEGIN_MODE Bs3PagingGetRootForPP32, BS3_PBC_NEAR ; Internal function, no far variant necessary. 54 54 mov eax, [BS3_DATA16_WRT(g_PhysPagingRootPP)] 55 55 cmp eax, 0ffffffffh -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToLM16.asm
r60291 r60554 41 41 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 42 42 ; 43 BS3_PROC_BEGIN_MODE Bs3SwitchToLM16 43 BS3_PROC_BEGIN_MODE Bs3SwitchToLM16, BS3_PBC_NEAR 44 44 %ifdef TMPL_LM16 45 45 extern BS3_CMN_NM(Bs3SwitchToRing0) … … 83 83 BS3_PROC_END_MODE Bs3SwitchToLM16 84 84 85 86 %if TMPL_BITS == 16 87 ;; 88 ; Custom far stub. 89 BS3_BEGIN_TEXT16_FARSTUBS 90 BS3_PROC_BEGIN_MODE Bs3SwitchToLM16, BS3_PBC_FAR 91 inc bp 92 push bp 93 mov bp, sp 94 95 ; Call the real thing. 96 call TMPL_NM(Bs3SwitchToLM16) 97 98 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 99 ; Jmp to common code for the tedious conversion. 100 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 101 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 102 %else 103 pop bp 104 dec bp 105 retf 106 %endif 107 BS3_PROC_END_MODE Bs3SwitchToLM16 108 %endif 109 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToLM32.asm
r59950 r60554 44 44 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 45 45 ; 46 BS3_PROC_BEGIN_MODE Bs3SwitchToLM32 46 BS3_PROC_BEGIN_MODE Bs3SwitchToLM32, BS3_PBC_NEAR 47 47 %ifdef TMPL_LM32 48 48 ret … … 152 152 BS3_PROC_END_MODE Bs3SwitchToLM32 153 153 154 155 %if TMPL_BITS == 16 156 ;; 157 ; Custom far stub. 158 BS3_BEGIN_TEXT16_FARSTUBS 159 BS3_PROC_BEGIN_MODE Bs3SwitchToLM32, BS3_PBC_FAR 160 inc bp 161 push bp 162 mov bp, sp 163 164 ; Call the real thing. 165 call TMPL_NM(Bs3SwitchToLM32) 166 BS3_SET_BITS 32 167 168 ; Jmp to common code for the tedious conversion. 169 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 170 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 171 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 172 %else 173 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 174 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 175 %endif 176 BS3_SET_BITS 16 177 BS3_PROC_END_MODE Bs3SwitchToLM32 178 %endif 179 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToLM64.asm
r59287 r60554 41 41 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 42 42 ; 43 BS3_PROC_BEGIN_MODE Bs3SwitchToLM64 43 BS3_PROC_BEGIN_MODE Bs3SwitchToLM64, BS3_PBC_NEAR 44 44 %ifdef TMPL_LM64 45 45 ret … … 76 76 BS3_PROC_END_MODE Bs3SwitchToLM64 77 77 78 79 %if TMPL_BITS == 16 80 ;; 81 ; Custom far stub. 82 BS3_BEGIN_TEXT16_FARSTUBS 83 BS3_PROC_BEGIN_MODE Bs3SwitchToLM64, BS3_PBC_FAR 84 inc bp 85 push bp 86 mov bp, sp 87 88 ; Call the real thing. 89 call TMPL_NM(Bs3SwitchToLM64) 90 BS3_SET_BITS 64 91 92 ; Jmp to common code for the tedious conversion. 93 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 94 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 95 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 96 %else 97 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 98 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 99 %endif 100 BS3_SET_BITS 16 101 BS3_PROC_END_MODE Bs3SwitchToLM64 102 %endif 103 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAE16.asm
r60291 r60554 47 47 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 48 48 ; 49 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE16 49 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE16, BS3_PBC_NEAR 50 50 %ifdef TMPL_PAE16 51 51 extern BS3_CMN_NM(Bs3SwitchToRing0) … … 166 166 BS3_PROC_END_MODE Bs3SwitchToPAE16 167 167 168 169 %if TMPL_BITS == 16 170 ;; 171 ; Custom far stub. 172 BS3_BEGIN_TEXT16_FARSTUBS 173 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE16, BS3_PBC_FAR 174 inc bp 175 push bp 176 mov bp, sp 177 178 ; Call the real thing. 179 call TMPL_NM(Bs3SwitchToPAE16) 180 181 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 182 ; Jmp to common code for the tedious conversion. 183 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 184 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 185 %else 186 pop bp 187 dec bp 188 retf 189 %endif 190 BS3_PROC_END_MODE Bs3SwitchToPAE16 191 %endif 192 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAE16_32.asm
r59934 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE16_32 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE16_32, BS3_PBC_NEAR 43 43 %ifdef TMPL_PAE16_32 44 44 ret … … 76 76 BS3_PROC_END_MODE Bs3SwitchToPAE16_32 77 77 78 79 %if TMPL_BITS == 16 80 ;; 81 ; Custom far stub. 82 BS3_BEGIN_TEXT16_FARSTUBS 83 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE16_32, BS3_PBC_FAR 84 inc bp 85 push bp 86 mov bp, sp 87 88 ; Call the real thing. 89 call TMPL_NM(Bs3SwitchToPAE16_32) 90 BS3_SET_BITS 32 91 92 ; Jmp to common code for the tedious conversion. 93 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 94 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 95 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 96 %else 97 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 98 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 99 %endif 100 BS3_SET_BITS 16 101 BS3_PROC_END_MODE Bs3SwitchToPAE16_32 102 %endif 103 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAE16_V86.asm
r59938 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE16_V86 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE16_V86, BS3_PBC_NEAR 43 43 %ifdef TMPL_PAE16_V86 44 44 ret … … 72 72 BS3_PROC_END_MODE Bs3SwitchToPAE16_V86 73 73 74 75 %if TMPL_BITS == 16 76 ;; 77 ; Custom far stub. 78 BS3_BEGIN_TEXT16_FARSTUBS 79 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE16_V86, BS3_PBC_FAR 80 inc bp 81 push bp 82 mov bp, sp 83 84 ; Call the real thing. 85 call TMPL_NM(Bs3SwitchToPAE16_V86) 86 87 %if !BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 88 ; Jmp to common code for the tedious conversion. 89 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 90 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 91 %else 92 pop bp 93 dec bp 94 retf 95 %endif 96 BS3_PROC_END_MODE Bs3SwitchToPAE16_V86 97 %endif 98 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAE32.asm
r59950 r60554 42 42 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 43 43 ; 44 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE32 44 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE32, BS3_PBC_NEAR 45 45 %ifdef TMPL_PAE32 46 46 ret … … 158 158 BS3_PROC_END_MODE Bs3SwitchToPAE32 159 159 160 161 %if TMPL_BITS == 16 162 ;; 163 ; Custom far stub. 164 BS3_BEGIN_TEXT16_FARSTUBS 165 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE32, BS3_PBC_FAR 166 inc bp 167 push bp 168 mov bp, sp 169 170 ; Call the real thing. 171 call TMPL_NM(Bs3SwitchToPAE32) 172 BS3_SET_BITS 32 173 174 ; Jmp to common code for the tedious conversion. 175 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 176 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 177 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 178 %else 179 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 180 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 181 %endif 182 BS3_SET_BITS 16 183 BS3_PROC_END_MODE Bs3SwitchToPAE32 184 %endif 185 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAE32_16.asm
r59934 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE32_16 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE32_16, BS3_PBC_NEAR 43 43 %if TMPL_MODE == BS3_MODE_PAE32_16 44 44 ret … … 80 80 BS3_PROC_END_MODE Bs3SwitchToPAE32_16 81 81 82 %if TMPL_BITS == 16 83 ;; 84 ; Custom far stub. 85 BS3_BEGIN_TEXT16_FARSTUBS 86 BS3_PROC_BEGIN_MODE Bs3SwitchToPAE32_16, BS3_PBC_FAR 87 inc bp 88 push bp 89 mov bp, sp 90 91 ; Call the real thing. 92 call TMPL_NM(Bs3SwitchToPAE32_16) 93 94 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 95 ; Jmp to common code for the tedious conversion. 96 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 97 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 98 %else 99 pop bp 100 dec bp 101 retf 102 %endif 103 BS3_PROC_END_MODE Bs3SwitchToPAE32_16 104 %endif 105 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPAEV86.asm
r60019 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPAEV86 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPAEV86, BS3_PBC_NEAR 43 43 %if TMPL_MODE == BS3_MODE_PAEV86 44 44 ret … … 66 66 BS3_PROC_END_MODE Bs3SwitchToPAEV86 67 67 68 69 %if TMPL_BITS == 16 70 ;; 71 ; Custom far stub. 72 BS3_BEGIN_TEXT16_FARSTUBS 73 BS3_PROC_BEGIN_MODE Bs3SwitchToPAEV86, BS3_PBC_FAR 74 inc bp 75 push bp 76 mov bp, sp 77 78 ; Call the real thing. 79 call TMPL_NM(Bs3SwitchToPAEV86) 80 81 %if !BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 82 ; Jmp to common code for the tedious conversion. 83 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 84 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 85 %else 86 pop bp 87 dec bp 88 retf 89 %endif 90 BS3_PROC_END_MODE Bs3SwitchToPAEV86 91 %endif 92 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPE16.asm
r60291 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPE16 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPE16, BS3_PBC_NEAR 43 43 %ifdef TMPL_PE16 44 44 extern BS3_CMN_NM(Bs3SwitchToRing0) … … 125 125 BS3_PROC_END_MODE Bs3SwitchToPE16 126 126 127 128 %if TMPL_BITS == 16 129 ;; 130 ; Custom far stub. 131 BS3_BEGIN_TEXT16_FARSTUBS 132 BS3_PROC_BEGIN_MODE Bs3SwitchToPE16, BS3_PBC_FAR 133 inc bp 134 push bp 135 mov bp, sp 136 137 ; Call the real thing. 138 call TMPL_NM(Bs3SwitchToPE16) 139 140 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 141 ; Jmp to common code for the tedious conversion. 142 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 143 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 144 %else 145 pop bp 146 dec bp 147 retf 148 %endif 149 BS3_PROC_END_MODE Bs3SwitchToPE16 150 %endif 151 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPE16_32.asm
r59934 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPE16_32 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPE16_32, BS3_PBC_NEAR 43 43 %ifdef TMPL_PE16_32 44 44 ret … … 76 76 BS3_PROC_END_MODE Bs3SwitchToPE16_32 77 77 78 79 %if TMPL_BITS == 16 80 ;; 81 ; Custom far stub. 82 BS3_BEGIN_TEXT16_FARSTUBS 83 BS3_PROC_BEGIN_MODE Bs3SwitchToPE16_32, BS3_PBC_FAR 84 inc bp 85 push bp 86 mov bp, sp 87 88 ; Call the real thing. 89 call TMPL_NM(Bs3SwitchToPE16_32) 90 BS3_SET_BITS 32 91 92 ; Jmp to common code for the tedious conversion. 93 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 94 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 95 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 96 %else 97 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 98 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 99 %endif 100 BS3_SET_BITS 16 101 BS3_PROC_END_MODE Bs3SwitchToPE16_32 102 %endif 103 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPE16_V86.asm
r60002 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPE16_V86 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPE16_V86, BS3_PBC_NEAR 43 43 %ifdef TMPL_PE16_V86 44 44 ret … … 72 72 BS3_PROC_END_MODE Bs3SwitchToPE16_V86 73 73 74 75 %if TMPL_BITS == 16 76 ;; 77 ; Custom far stub. 78 BS3_BEGIN_TEXT16_FARSTUBS 79 BS3_PROC_BEGIN_MODE Bs3SwitchToPE16_V86, BS3_PBC_FAR 80 inc bp 81 push bp 82 mov bp, sp 83 84 ; Call the real thing. 85 call TMPL_NM(Bs3SwitchToPE16_V86) 86 87 %if !BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 88 ; Jmp to common code for the tedious conversion. 89 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 90 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 91 %else 92 pop bp 93 dec bp 94 retf 95 %endif 96 BS3_PROC_END_MODE Bs3SwitchToPE16_V86 97 %endif 98 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPE32.asm
r59950 r60554 41 41 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 42 42 ; 43 BS3_PROC_BEGIN_MODE Bs3SwitchToPE32 43 BS3_PROC_BEGIN_MODE Bs3SwitchToPE32, BS3_PBC_NEAR 44 44 %ifdef TMPL_PE32 45 45 ret … … 136 136 BS3_PROC_END_MODE Bs3SwitchToPE32 137 137 138 139 %if TMPL_BITS == 16 140 ;; 141 ; Custom far stub. 142 BS3_BEGIN_TEXT16_FARSTUBS 143 BS3_PROC_BEGIN_MODE Bs3SwitchToPE32, BS3_PBC_FAR 144 inc bp 145 push bp 146 mov bp, sp 147 148 ; Call the real thing. 149 call TMPL_NM(Bs3SwitchToPE32) 150 BS3_SET_BITS 32 151 152 ; Jmp to common code for the tedious conversion. 153 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 154 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 155 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 156 %else 157 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 158 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 159 %endif 160 BS3_SET_BITS 16 161 BS3_PROC_END_MODE Bs3SwitchToPE32 162 %endif 163 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPE32_16.asm
r59934 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPE32_16 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPE32_16, BS3_PBC_NEAR 43 43 %if TMPL_MODE == BS3_MODE_PE32_16 44 44 ret … … 80 80 BS3_PROC_END_MODE Bs3SwitchToPE32_16 81 81 82 83 %if TMPL_BITS == 16 84 ;; 85 ; Custom far stub. 86 BS3_BEGIN_TEXT16_FARSTUBS 87 BS3_PROC_BEGIN_MODE Bs3SwitchToPE32_16, BS3_PBC_FAR 88 inc bp 89 push bp 90 mov bp, sp 91 92 ; Call the real thing. 93 call TMPL_NM(Bs3SwitchToPE32_16) 94 95 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 96 ; Jmp to common code for the tedious conversion. 97 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 98 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 99 %else 100 pop bp 101 dec bp 102 retf 103 %endif 104 BS3_PROC_END_MODE Bs3SwitchToPE32_16 105 %endif 106 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPEV86.asm
r60019 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPEV86 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPEV86, BS3_PBC_NEAR 43 43 %if TMPL_MODE == BS3_MODE_PEV86 44 44 ret … … 66 66 BS3_PROC_END_MODE Bs3SwitchToPEV86 67 67 68 69 %if TMPL_BITS == 16 70 ;; 71 ; Custom far stub. 72 BS3_BEGIN_TEXT16_FARSTUBS 73 BS3_PROC_BEGIN_MODE Bs3SwitchToPEV86, BS3_PBC_FAR 74 inc bp 75 push bp 76 mov bp, sp 77 78 ; Call the real thing. 79 call TMPL_NM(Bs3SwitchToPEV86) 80 81 %if !BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 82 ; Jmp to common code for the tedious conversion. 83 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 84 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 85 %else 86 pop bp 87 dec bp 88 retf 89 %endif 90 BS3_PROC_END_MODE Bs3SwitchToPEV86 91 %endif 92 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPP16.asm
r60321 r60554 47 47 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 48 48 ; 49 BS3_PROC_BEGIN_MODE Bs3SwitchToPP16 49 BS3_PROC_BEGIN_MODE Bs3SwitchToPP16, BS3_PBC_NEAR 50 50 %ifdef TMPL_PP16 51 51 extern BS3_CMN_NM(Bs3SwitchToRing0) … … 182 182 BS3_PROC_END_MODE Bs3SwitchToPP16 183 183 184 185 %if TMPL_BITS == 16 186 ;; 187 ; Custom far stub. 188 BS3_BEGIN_TEXT16_FARSTUBS 189 BS3_PROC_BEGIN_MODE Bs3SwitchToPP16, BS3_PBC_FAR 190 inc bp 191 push bp 192 mov bp, sp 193 194 ; Call the real thing. 195 call TMPL_NM(Bs3SwitchToPP16) 196 197 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 198 ; Jmp to common code for the tedious conversion. 199 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 200 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 201 %else 202 pop bp 203 dec bp 204 retf 205 %endif 206 BS3_PROC_END_MODE Bs3SwitchToPP16 207 %endif 208 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPP16_32.asm
r59934 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPP16_32 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPP16_32, BS3_PBC_NEAR 43 43 %ifdef TMPL_PP16_32 44 44 ret … … 76 76 BS3_PROC_END_MODE Bs3SwitchToPP16_32 77 77 78 79 %if TMPL_BITS == 16 80 ;; 81 ; Custom far stub. 82 BS3_BEGIN_TEXT16_FARSTUBS 83 BS3_PROC_BEGIN_MODE Bs3SwitchToPP16_32, BS3_PBC_FAR 84 inc bp 85 push bp 86 mov bp, sp 87 88 ; Call the real thing. 89 call TMPL_NM(Bs3SwitchToPP16_32) 90 BS3_SET_BITS 32 91 92 ; Jmp to common code for the tedious conversion. 93 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 94 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 95 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 96 %else 97 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 98 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 99 %endif 100 BS3_SET_BITS 16 101 BS3_PROC_END_MODE Bs3SwitchToPP16_32 102 %endif 103 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPP16_V86.asm
r59938 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPP16_V86 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPP16_V86, BS3_PBC_NEAR 43 43 %ifdef TMPL_PP16_V86 44 44 ret … … 72 72 BS3_PROC_END_MODE Bs3SwitchToPP16_V86 73 73 74 75 %if TMPL_BITS == 16 76 ;; 77 ; Custom far stub. 78 BS3_BEGIN_TEXT16_FARSTUBS 79 BS3_PROC_BEGIN_MODE Bs3SwitchToPP16_V86, BS3_PBC_FAR 80 inc bp 81 push bp 82 mov bp, sp 83 84 ; Call the real thing. 85 call TMPL_NM(Bs3SwitchToPP16_V86) 86 87 %if !BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 88 ; Jmp to common code for the tedious conversion. 89 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 90 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 91 %else 92 pop bp 93 dec bp 94 retf 95 %endif 96 BS3_PROC_END_MODE Bs3SwitchToPP16_V86 97 %endif 98 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPP32.asm
r60319 r60554 42 42 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 43 43 ; 44 BS3_PROC_BEGIN_MODE Bs3SwitchToPP32 44 BS3_PROC_BEGIN_MODE Bs3SwitchToPP32, BS3_PBC_NEAR 45 45 %ifdef TMPL_PP32 46 46 ret … … 166 166 BS3_PROC_END_MODE Bs3SwitchToPP32 167 167 168 169 %if TMPL_BITS == 16 170 ;; 171 ; Custom far stub. 172 BS3_BEGIN_TEXT16_FARSTUBS 173 BS3_PROC_BEGIN_MODE Bs3SwitchToPP32, BS3_PBC_FAR 174 inc bp 175 push bp 176 mov bp, sp 177 178 ; Call the real thing. 179 call TMPL_NM(Bs3SwitchToPP32) 180 BS3_SET_BITS 32 181 182 ; Jmp to common code for the tedious conversion. 183 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 184 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 185 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 186 %else 187 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 188 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 189 %endif 190 BS3_SET_BITS 16 191 BS3_PROC_END_MODE Bs3SwitchToPP32 192 %endif 193 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPP32_16.asm
r59934 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPP32_16 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPP32_16, BS3_PBC_NEAR 43 43 %if TMPL_MODE == BS3_MODE_PP32_16 44 44 ret … … 80 80 BS3_PROC_END_MODE Bs3SwitchToPP32_16 81 81 82 83 %if TMPL_BITS == 16 84 ;; 85 ; Custom far stub. 86 BS3_BEGIN_TEXT16_FARSTUBS 87 BS3_PROC_BEGIN_MODE Bs3SwitchToPP32_16, BS3_PBC_FAR 88 inc bp 89 push bp 90 mov bp, sp 91 92 ; Call the real thing. 93 call TMPL_NM(Bs3SwitchToPP32_16) 94 95 %if BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 96 ; Jmp to common code for the tedious conversion. 97 BS3_EXTERN_CMN Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 98 jmp Bs3SwitchHlpConvRealModeRetfPopBpDecBpAndReturn 99 %else 100 pop bp 101 dec bp 102 retf 103 %endif 104 BS3_PROC_END_MODE Bs3SwitchToPP32_16 105 %endif 106 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToPPV86.asm
r60019 r60554 40 40 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 41 41 ; 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPPV86 42 BS3_PROC_BEGIN_MODE Bs3SwitchToPPV86, BS3_PBC_NEAR 43 43 %if TMPL_MODE == BS3_MODE_PPV86 44 44 ret … … 66 66 BS3_PROC_END_MODE Bs3SwitchToPPV86 67 67 68 69 %if TMPL_BITS == 16 70 ;; 71 ; Custom far stub. 72 BS3_BEGIN_TEXT16_FARSTUBS 73 BS3_PROC_BEGIN_MODE Bs3SwitchToPPV86, BS3_PBC_FAR 74 inc bp 75 push bp 76 mov bp, sp 77 78 ; Call the real thing. 79 call TMPL_NM(Bs3SwitchToPPV86) 80 81 %if !BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 82 ; Jmp to common code for the tedious conversion. 83 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 84 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 85 %else 86 pop bp 87 dec bp 88 retf 89 %endif 90 BS3_PROC_END_MODE Bs3SwitchToPPV86 91 %endif 92 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToRM.asm
r60439 r60554 65 65 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 66 66 ; 67 BS3_PROC_BEGIN_MODE Bs3SwitchToRM 67 BS3_PROC_BEGIN_MODE Bs3SwitchToRM, BS3_PBC_NEAR 68 68 %ifdef TMPL_RM 69 69 push ax … … 338 338 BS3_PROC_END_MODE Bs3SwitchToRM 339 339 340 341 %if TMPL_BITS == 16 342 ;; 343 ; Custom far stub. 344 BS3_BEGIN_TEXT16_FARSTUBS 345 BS3_PROC_BEGIN_MODE Bs3SwitchToRM, BS3_PBC_FAR 346 inc bp 347 push bp 348 mov bp, sp 349 350 ; Call the real thing. 351 call TMPL_NM(Bs3SwitchToRM) 352 353 %if !BS3_MODE_IS_RM_OR_V86(TMPL_MODE) 354 ; Jmp to common code for the tedious conversion. 355 BS3_EXTERN_CMN Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 356 jmp Bs3SwitchHlpConvProtModeRetfPopBpDecBpAndReturn 357 %else 358 pop bp 359 dec bp 360 retf 361 %endif 362 BS3_PROC_END_MODE Bs3SwitchToRM 363 %endif 364 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModes.c
r60539 r60554 25 25 */ 26 26 27 /** @todo get this mess into the RM segment! */ 28 27 29 28 30 /********************************************************************************************************************************* … … 61 63 * Assembly Symbols * 62 64 *********************************************************************************************************************************/ 63 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInRM)(uint32_t uCallbackFarPtr);64 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPE16)(uint32_t uCallbackFarPtr);65 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_32)(uint32_t uFlatAddrCallback);66 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPE16_V86)(uint32_t uCallbackFarPtr);67 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPE32)(uint32_t uFlatAddrCallback);68 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPE32_16)(uint32_t uCallbackFarPtr);69 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPEV86)(uint32_t uCallbackFarPtr);70 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPP16)(uint32_t uCallbackFarPtr);71 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_32)(uint32_t uFlatAddrCallback);72 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPP16_V86)(uint32_t uCallbackFarPtr);73 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPP32)(uint32_t uFlatAddrCallback);74 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPP32_16)(uint32_t uCallbackFarPtr);75 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPPV86)(uint32_t uCallbackFarPtr);76 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16)(uint32_t uCallbackFarPtr);77 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_32)(uint32_t uFlatAddrCallback);78 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPAE16_V86)(uint32_t uCallbackFarPtr);79 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32)(uint32_t uFlatAddrCallback);80 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPAE32_16)(uint32_t uCallbackFarPtr);81 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInPAEV86)(uint32_t uCallbackFarPtr);82 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInLM16)(uint32_t uCallbackFarPtr);83 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInLM32)(uint32_t uFlatAddrCallback);84 BS3_DECL (uint8_t) TMPL_NM(Bs3TestCallDoerInLM64)(uint32_t uFlatAddrCallback);65 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInRM)(uint32_t uCallbackFarPtr); 66 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPE16)(uint32_t uCallbackFarPtr); 67 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPE16_32)(uint32_t uFlatAddrCallback); 68 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPE16_V86)(uint32_t uCallbackFarPtr); 69 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPE32)(uint32_t uFlatAddrCallback); 70 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPE32_16)(uint32_t uCallbackFarPtr); 71 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPEV86)(uint32_t uCallbackFarPtr); 72 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPP16)(uint32_t uCallbackFarPtr); 73 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPP16_32)(uint32_t uFlatAddrCallback); 74 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPP16_V86)(uint32_t uCallbackFarPtr); 75 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPP32)(uint32_t uFlatAddrCallback); 76 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPP32_16)(uint32_t uCallbackFarPtr); 77 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPPV86)(uint32_t uCallbackFarPtr); 78 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPAE16)(uint32_t uCallbackFarPtr); 79 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPAE16_32)(uint32_t uFlatAddrCallback); 80 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPAE16_V86)(uint32_t uCallbackFarPtr); 81 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPAE32)(uint32_t uFlatAddrCallback); 82 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPAE32_16)(uint32_t uCallbackFarPtr); 83 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInPAEV86)(uint32_t uCallbackFarPtr); 84 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInLM16)(uint32_t uCallbackFarPtr); 85 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInLM32)(uint32_t uFlatAddrCallback); 86 BS3_DECL_FAR(uint8_t) TMPL_FAR_NM(Bs3TestCallDoerInLM64)(uint32_t uFlatAddrCallback); 85 87 86 88 … … 174 176 } 175 177 176 BS3_DECL(void) TMPL_NM(Bs3TestDoModes)(PCBS3TESTMODEENTRY paEntries, size_t cEntries) 178 179 BS3_MODE_DEF(void, Bs3TestDoModes,(PCBS3TESTMODEENTRY paEntries, size_t cEntries)) 177 180 { 178 181 bool const fVerbose = true; … … 215 218 { 216 219 PRE_DO_CALL(g_szBs3ModeName_rm); 217 bErrNo = TMPL_ NM(Bs3TestCallDoerInRM)(CONV_TO_RM_FAR16(paEntries[i].pfnDoRM));220 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInRM)(CONV_TO_RM_FAR16(paEntries[i].pfnDoRM)); 218 221 CHECK_RESULT(g_szBs3ModeName_rm); 219 222 } … … 232 235 { 233 236 PRE_DO_CALL(g_szBs3ModeName_pe16); 234 bErrNo = TMPL_ NM(Bs3TestCallDoerInPE16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPE16));237 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPE16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPE16)); 235 238 CHECK_RESULT(g_szBs3ModeName_pe16); 236 239 } … … 245 248 { 246 249 PRE_DO_CALL(g_szBs3ModeName_pe16_32); 247 bErrNo = TMPL_ NM(Bs3TestCallDoerInPE16_32)(CONV_TO_FLAT(paEntries[i].pfnDoPE16_32));250 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPE16_32)(CONV_TO_FLAT(paEntries[i].pfnDoPE16_32)); 248 251 CHECK_RESULT(g_szBs3ModeName_pe16_32); 249 252 } … … 252 255 { 253 256 PRE_DO_CALL(g_szBs3ModeName_pe16_v86); 254 bErrNo = TMPL_ NM(Bs3TestCallDoerInPE16_V86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPE16_V86));257 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPE16_V86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPE16_V86)); 255 258 CHECK_RESULT(g_szBs3ModeName_pe16_v86); 256 259 } … … 259 262 { 260 263 PRE_DO_CALL(g_szBs3ModeName_pe32); 261 bErrNo = TMPL_ NM(Bs3TestCallDoerInPE32)(CONV_TO_FLAT(paEntries[i].pfnDoPE32));264 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPE32)(CONV_TO_FLAT(paEntries[i].pfnDoPE32)); 262 265 CHECK_RESULT(g_szBs3ModeName_pe32); 263 266 } … … 266 269 { 267 270 PRE_DO_CALL(g_szBs3ModeName_pe32_16); 268 bErrNo = TMPL_ NM(Bs3TestCallDoerInPE32_16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPE32_16));271 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPE32_16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPE32_16)); 269 272 CHECK_RESULT(g_szBs3ModeName_pe32_16); 270 273 } … … 273 276 { 274 277 PRE_DO_CALL(g_szBs3ModeName_pev86); 275 bErrNo = TMPL_ NM(Bs3TestCallDoerInPEV86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPEV86));278 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPEV86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPEV86)); 276 279 CHECK_RESULT(g_szBs3ModeName_pev86); 277 280 } … … 283 286 { 284 287 PRE_DO_CALL(g_szBs3ModeName_pp16); 285 bErrNo = TMPL_ NM(Bs3TestCallDoerInPP16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPP16));288 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPP16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPP16)); 286 289 CHECK_RESULT(g_szBs3ModeName_pp16); 287 290 } … … 290 293 { 291 294 PRE_DO_CALL(g_szBs3ModeName_pp16_32); 292 bErrNo = TMPL_ NM(Bs3TestCallDoerInPP16_32)(CONV_TO_FLAT(paEntries[i].pfnDoPP16_32));295 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPP16_32)(CONV_TO_FLAT(paEntries[i].pfnDoPP16_32)); 293 296 CHECK_RESULT(g_szBs3ModeName_pp16_32); 294 297 } … … 297 300 { 298 301 PRE_DO_CALL(g_szBs3ModeName_pp16_v86); 299 bErrNo = TMPL_ NM(Bs3TestCallDoerInPP16_V86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPP16_V86));302 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPP16_V86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPP16_V86)); 300 303 CHECK_RESULT(g_szBs3ModeName_pp16_v86); 301 304 } … … 304 307 { 305 308 PRE_DO_CALL(g_szBs3ModeName_pp32); 306 bErrNo = TMPL_ NM(Bs3TestCallDoerInPP32)(CONV_TO_FLAT(paEntries[i].pfnDoPP32));309 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPP32)(CONV_TO_FLAT(paEntries[i].pfnDoPP32)); 307 310 CHECK_RESULT(g_szBs3ModeName_pp32); 308 311 } … … 311 314 { 312 315 PRE_DO_CALL(g_szBs3ModeName_pp32_16); 313 bErrNo = TMPL_ NM(Bs3TestCallDoerInPP32_16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPP32_16));316 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPP32_16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPP32_16)); 314 317 CHECK_RESULT(g_szBs3ModeName_pp32_16); 315 318 } … … 318 321 { 319 322 PRE_DO_CALL(g_szBs3ModeName_ppv86); 320 bErrNo = TMPL_ NM(Bs3TestCallDoerInPPV86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPPV86));323 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPPV86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPPV86)); 321 324 CHECK_RESULT(g_szBs3ModeName_ppv86); 322 325 } … … 335 338 { 336 339 PRE_DO_CALL(g_szBs3ModeName_pae16); 337 bErrNo = TMPL_ NM(Bs3TestCallDoerInPAE16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPAE16));340 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPAE16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPAE16)); 338 341 CHECK_RESULT(g_szBs3ModeName_pae16); 339 342 } … … 342 345 { 343 346 PRE_DO_CALL(g_szBs3ModeName_pae16_32); 344 bErrNo = TMPL_ NM(Bs3TestCallDoerInPAE16_32)(CONV_TO_FLAT(paEntries[i].pfnDoPAE16_32));347 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPAE16_32)(CONV_TO_FLAT(paEntries[i].pfnDoPAE16_32)); 345 348 CHECK_RESULT(g_szBs3ModeName_pae16_32); 346 349 } … … 349 352 { 350 353 PRE_DO_CALL(g_szBs3ModeName_pae16_v86); 351 bErrNo = TMPL_ NM(Bs3TestCallDoerInPAE16_V86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPAE16_V86));354 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPAE16_V86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPAE16_V86)); 352 355 CHECK_RESULT(g_szBs3ModeName_pae16_v86); 353 356 } … … 356 359 { 357 360 PRE_DO_CALL(g_szBs3ModeName_pae32); 358 bErrNo = TMPL_ NM(Bs3TestCallDoerInPAE32)(CONV_TO_FLAT(paEntries[i].pfnDoPAE32));361 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPAE32)(CONV_TO_FLAT(paEntries[i].pfnDoPAE32)); 359 362 CHECK_RESULT(g_szBs3ModeName_pae32); 360 363 } … … 363 366 { 364 367 PRE_DO_CALL(g_szBs3ModeName_pae32_16); 365 bErrNo = TMPL_ NM(Bs3TestCallDoerInPAE32_16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPAE32_16));368 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPAE32_16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoPAE32_16)); 366 369 CHECK_RESULT(g_szBs3ModeName_pae32_16); 367 370 } … … 370 373 { 371 374 PRE_DO_CALL(g_szBs3ModeName_paev86); 372 bErrNo = TMPL_ NM(Bs3TestCallDoerInPAEV86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPAEV86));375 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInPAEV86)(CONV_TO_RM_FAR16(paEntries[i].pfnDoPAEV86)); 373 376 CHECK_RESULT(g_szBs3ModeName_paev86); 374 377 } … … 387 390 { 388 391 PRE_DO_CALL(g_szBs3ModeName_lm16); 389 bErrNo = TMPL_ NM(Bs3TestCallDoerInLM16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoLM16));392 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInLM16)(CONV_TO_PROT_FAR16(paEntries[i].pfnDoLM16)); 390 393 CHECK_RESULT(g_szBs3ModeName_lm16); 391 394 } … … 394 397 { 395 398 PRE_DO_CALL(g_szBs3ModeName_lm32); 396 bErrNo = TMPL_ NM(Bs3TestCallDoerInLM32)(CONV_TO_FLAT(paEntries[i].pfnDoLM32));399 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInLM32)(CONV_TO_FLAT(paEntries[i].pfnDoLM32)); 397 400 CHECK_RESULT(g_szBs3ModeName_lm32); 398 401 } … … 401 404 { 402 405 PRE_DO_CALL(g_szBs3ModeName_lm64); 403 bErrNo = TMPL_ NM(Bs3TestCallDoerInLM64)(CONV_TO_FLAT(paEntries[i].pfnDoLM64));406 bErrNo = TMPL_FAR_NM(Bs3TestCallDoerInLM64)(CONV_TO_FLAT(paEntries[i].pfnDoLM64)); 404 407 CHECK_RESULT(g_szBs3ModeName_lm64); 405 408 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModesHlp.asm
r60539 r60554 154 154 xPOPF 155 155 pop xBP 156 %if TMPL_BITS == 16 157 retf 158 %else 156 159 ret 160 %endif 157 161 158 162 ; … … 213 217 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInRM(uint16_t offBs3Text16); 214 218 ; @uses rax 215 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInRM 216 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 217 jmp TMPL_NM(bs3TestCallDoerPrologue) 218 BS3_BEGIN_TEXT16 219 BS3_SET_BITS TMPL_BITS 220 .doit: 221 mov ax, [xBP + xCB *2]; Load far function pointer.222 mov dx, [xBP + xCB *2+ 2]219 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInRM, BS3_PBC_FAR 220 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 221 jmp TMPL_NM(bs3TestCallDoerPrologue) 222 BS3_BEGIN_TEXT16 223 BS3_SET_BITS TMPL_BITS 224 .doit: 225 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 226 mov dx, [xBP + xCB + cbCurRetAddr + 2] 223 227 224 228 ; Mode switch, make the call, switch back. … … 254 258 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16(uint16_t offBs3Text16); 255 259 ; @uses rax 256 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16 257 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 258 jmp TMPL_NM(bs3TestCallDoerPrologue) 259 BS3_BEGIN_TEXT16 260 BS3_SET_BITS TMPL_BITS 261 .doit: 262 mov ax, [xBP + xCB *2]; Load far function pointer.263 mov dx, [xBP + xCB *2+ 2]260 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16, BS3_PBC_FAR 261 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 262 jmp TMPL_NM(bs3TestCallDoerPrologue) 263 BS3_BEGIN_TEXT16 264 BS3_SET_BITS TMPL_BITS 265 .doit: 266 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 267 mov dx, [xBP + xCB + cbCurRetAddr + 2] 264 268 265 269 ; Mode switch, make the call, switch back. … … 287 291 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16_32(uint16_t offBs3Text16); 288 292 ; @uses rax 289 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_32 290 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 291 jmp TMPL_NM(bs3TestCallDoerPrologue) 292 .doit: 293 mov eax, [xBP + xCB *2] ; Load function pointer.293 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_32, BS3_PBC_FAR 294 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 295 jmp TMPL_NM(bs3TestCallDoerPrologue) 296 .doit: 297 mov eax, [xBP + xCB + cbCurRetAddr] ; Load function pointer. 294 298 295 299 ; Mode switch, make the call, switch back. … … 312 316 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16_V86(uint16_t offBs3Text16); 313 317 ; @uses rax 314 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_V86 315 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 316 jmp TMPL_NM(bs3TestCallDoerPrologue) 317 .doit: 318 mov ax, [xBP + xCB *2]; Load far function pointer.319 mov dx, [xBP + xCB *2+ 2]318 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_V86, BS3_PBC_FAR 319 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 320 jmp TMPL_NM(bs3TestCallDoerPrologue) 321 .doit: 322 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 323 mov dx, [xBP + xCB + cbCurRetAddr + 2] 320 324 321 325 ; Mode switch, make the call, switch back. … … 343 347 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE32(uint16_t offBs3Text16); 344 348 ; @uses rax 345 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32 346 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 347 jmp TMPL_NM(bs3TestCallDoerPrologue) 348 .doit: 349 mov eax, [xBP + xCB *2] ; Load function pointer.349 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32, BS3_PBC_FAR 350 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 351 jmp TMPL_NM(bs3TestCallDoerPrologue) 352 .doit: 353 mov eax, [xBP + xCB + cbCurRetAddr] ; Load function pointer. 350 354 351 355 ; Mode switch, make the call, switch back. … … 368 372 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE32_16(uint16_t offBs3Text16); 369 373 ; @uses rax 370 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32_16 371 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 372 jmp TMPL_NM(bs3TestCallDoerPrologue) 373 BS3_BEGIN_TEXT16 374 BS3_SET_BITS TMPL_BITS 375 .doit: 376 mov ax, [xBP + xCB *2]; Load far function pointer.377 mov dx, [xBP + xCB *2+ 2]374 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32_16, BS3_PBC_FAR 375 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 376 jmp TMPL_NM(bs3TestCallDoerPrologue) 377 BS3_BEGIN_TEXT16 378 BS3_SET_BITS TMPL_BITS 379 .doit: 380 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 381 mov dx, [xBP + xCB + cbCurRetAddr + 2] 378 382 379 383 ; Mode switch, make the call, switch back. … … 402 406 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPEV86(uint16_t offBs3Text16); 403 407 ; @uses rax 404 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPEV86 405 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 406 jmp TMPL_NM(bs3TestCallDoerPrologue) 407 BS3_BEGIN_TEXT16 408 BS3_SET_BITS TMPL_BITS 409 .doit: 410 mov ax, [xBP + xCB *2]; Load far function pointer.411 mov dx, [xBP + xCB *2+ 2]408 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPEV86, BS3_PBC_FAR 409 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 410 jmp TMPL_NM(bs3TestCallDoerPrologue) 411 BS3_BEGIN_TEXT16 412 BS3_SET_BITS TMPL_BITS 413 .doit: 414 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 415 mov dx, [xBP + xCB + cbCurRetAddr + 2] 412 416 413 417 ; Mode switch, make the call, switch back. … … 442 446 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16(uint16_t offBs3Text16); 443 447 ; @uses rax 444 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16 445 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 446 jmp TMPL_NM(bs3TestCallDoerPrologue) 447 BS3_BEGIN_TEXT16 448 BS3_SET_BITS TMPL_BITS 449 .doit: 450 mov ax, [xBP + xCB *2]; Load far function pointer.451 mov dx, [xBP + xCB *2+ 2]448 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16, BS3_PBC_FAR 449 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 450 jmp TMPL_NM(bs3TestCallDoerPrologue) 451 BS3_BEGIN_TEXT16 452 BS3_SET_BITS TMPL_BITS 453 .doit: 454 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 455 mov dx, [xBP + xCB + cbCurRetAddr + 2] 452 456 453 457 ; Mode switch, make the call, switch back. … … 476 480 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16_32(uint16_t offBs3Text16); 477 481 ; @uses rax 478 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_32 479 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 480 jmp TMPL_NM(bs3TestCallDoerPrologue) 481 .doit: 482 mov eax, [xBP + xCB *2] ; Load function pointer.482 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_32, BS3_PBC_FAR 483 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 484 jmp TMPL_NM(bs3TestCallDoerPrologue) 485 .doit: 486 mov eax, [xBP + xCB + cbCurRetAddr] ; Load function pointer. 483 487 484 488 ; Mode switch, make the call, switch back. … … 501 505 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16_V86(uint16_t offBs3Text16); 502 506 ; @uses rax 503 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_V86 504 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 505 jmp TMPL_NM(bs3TestCallDoerPrologue) 506 .doit: 507 mov ax, [xBP + xCB *2]; Load far function pointer.508 mov dx, [xBP + xCB *2+ 2]507 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_V86, BS3_PBC_FAR 508 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 509 jmp TMPL_NM(bs3TestCallDoerPrologue) 510 .doit: 511 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 512 mov dx, [xBP + xCB + cbCurRetAddr + 2] 509 513 510 514 ; Mode switch, make the call, switch back. … … 532 536 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP32(uint16_t offBs3Text16); 533 537 ; @uses rax 534 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32 535 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 536 jmp TMPL_NM(bs3TestCallDoerPrologue) 537 .doit: 538 mov eax, [xBP + xCB *2] ; Load function pointer.538 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32, BS3_PBC_FAR 539 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 540 jmp TMPL_NM(bs3TestCallDoerPrologue) 541 .doit: 542 mov eax, [xBP + xCB + cbCurRetAddr] ; Load function pointer. 539 543 540 544 ; Mode switch, make the call, switch back. … … 557 561 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP32_16(uint16_t offBs3Text16); 558 562 ; @uses rax 559 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32_16 560 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 561 jmp TMPL_NM(bs3TestCallDoerPrologue) 562 BS3_BEGIN_TEXT16 563 BS3_SET_BITS TMPL_BITS 564 .doit: 565 mov ax, [xBP + xCB *2]; Load far function pointer.566 mov dx, [xBP + xCB *2+ 2]563 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32_16, BS3_PBC_FAR 564 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 565 jmp TMPL_NM(bs3TestCallDoerPrologue) 566 BS3_BEGIN_TEXT16 567 BS3_SET_BITS TMPL_BITS 568 .doit: 569 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 570 mov dx, [xBP + xCB + cbCurRetAddr + 2] 567 571 568 572 ; Mode switch, make the call, switch back. … … 591 595 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPPV86(uint16_t offBs3Text16); 592 596 ; @uses rax 593 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPPV86 594 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 595 jmp TMPL_NM(bs3TestCallDoerPrologue) 596 BS3_BEGIN_TEXT16 597 BS3_SET_BITS TMPL_BITS 598 .doit: 599 mov ax, [xBP + xCB *2]; Load far function pointer.600 mov dx, [xBP + xCB *2+ 2]597 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPPV86, BS3_PBC_FAR 598 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 599 jmp TMPL_NM(bs3TestCallDoerPrologue) 600 BS3_BEGIN_TEXT16 601 BS3_SET_BITS TMPL_BITS 602 .doit: 603 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 604 mov dx, [xBP + xCB + cbCurRetAddr + 2] 601 605 602 606 ; Mode switch, make the call, switch back. … … 631 635 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16(uint16_t offBs3Text16); 632 636 ; @uses rax 633 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16 634 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 635 jmp TMPL_NM(bs3TestCallDoerPrologue) 636 BS3_BEGIN_TEXT16 637 BS3_SET_BITS TMPL_BITS 638 .doit: 639 mov ax, [xBP + xCB *2]; Load far function pointer.640 mov dx, [xBP + xCB *2+ 2]637 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16, BS3_PBC_FAR 638 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 639 jmp TMPL_NM(bs3TestCallDoerPrologue) 640 BS3_BEGIN_TEXT16 641 BS3_SET_BITS TMPL_BITS 642 .doit: 643 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 644 mov dx, [xBP + xCB + cbCurRetAddr + 2] 641 645 642 646 ; Mode switch, make the call, switch back. … … 665 669 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16_32(uint16_t offBs3Text16); 666 670 ; @uses rax 667 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_32 668 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 669 jmp TMPL_NM(bs3TestCallDoerPrologue) 670 .doit: 671 mov eax, [xBP + xCB *2] ; Load function pointer.671 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_32, BS3_PBC_FAR 672 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 673 jmp TMPL_NM(bs3TestCallDoerPrologue) 674 .doit: 675 mov eax, [xBP + xCB + cbCurRetAddr] ; Load function pointer. 672 676 673 677 ; Mode switch, make the call, switch back. … … 690 694 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16_V86(uint16_t offBs3Text16); 691 695 ; @uses rax 692 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_V86 693 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 694 jmp TMPL_NM(bs3TestCallDoerPrologue) 695 .doit: 696 mov ax, [xBP + xCB *2]; Load far function pointer.697 mov dx, [xBP + xCB *2+ 2]696 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_V86, BS3_PBC_FAR 697 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 698 jmp TMPL_NM(bs3TestCallDoerPrologue) 699 .doit: 700 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 701 mov dx, [xBP + xCB + cbCurRetAddr + 2] 698 702 699 703 ; Mode switch, make the call, switch back. … … 721 725 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE32(uint16_t offBs3Text16); 722 726 ; @uses rax 723 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32 724 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 725 jmp TMPL_NM(bs3TestCallDoerPrologue) 726 .doit: 727 mov eax, [xBP + xCB *2] ; Load function pointer.727 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32, BS3_PBC_FAR 728 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 729 jmp TMPL_NM(bs3TestCallDoerPrologue) 730 .doit: 731 mov eax, [xBP + xCB + cbCurRetAddr] ; Load function pointer. 728 732 729 733 ; Mode switch, make the call, switch back. … … 746 750 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE32_16(uint16_t offBs3Text16); 747 751 ; @uses rax 748 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32_16 749 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 750 jmp TMPL_NM(bs3TestCallDoerPrologue) 751 BS3_BEGIN_TEXT16 752 BS3_SET_BITS TMPL_BITS 753 .doit: 754 mov ax, [xBP + xCB *2]; Load far function pointer.755 mov dx, [xBP + xCB *2+ 2]752 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32_16, BS3_PBC_FAR 753 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 754 jmp TMPL_NM(bs3TestCallDoerPrologue) 755 BS3_BEGIN_TEXT16 756 BS3_SET_BITS TMPL_BITS 757 .doit: 758 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 759 mov dx, [xBP + xCB + cbCurRetAddr + 2] 756 760 757 761 ; Mode switch, make the call, switch back. … … 780 784 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAEV86(uint16_t offBs3Text16); 781 785 ; @uses rax 782 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAEV86 783 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 784 jmp TMPL_NM(bs3TestCallDoerPrologue) 785 BS3_BEGIN_TEXT16 786 BS3_SET_BITS TMPL_BITS 787 .doit: 788 mov ax, [xBP + xCB *2]; Load far function pointer.789 mov dx, [xBP + xCB *2+ 2]786 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAEV86, BS3_PBC_FAR 787 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 788 jmp TMPL_NM(bs3TestCallDoerPrologue) 789 BS3_BEGIN_TEXT16 790 BS3_SET_BITS TMPL_BITS 791 .doit: 792 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 793 mov dx, [xBP + xCB + cbCurRetAddr + 2] 790 794 791 795 ; Mode switch, make the call, switch back. … … 820 824 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM16(uint16_t offBs3Text16); 821 825 ; @uses rax 822 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM16 823 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 824 jmp TMPL_NM(bs3TestCallDoerPrologue) 825 BS3_BEGIN_TEXT16 826 BS3_SET_BITS TMPL_BITS 827 .doit: 828 mov ax, [xBP + xCB *2]; Load far function pointer.829 mov dx, [xBP + xCB *2+ 2]826 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM16, BS3_PBC_FAR 827 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 828 jmp TMPL_NM(bs3TestCallDoerPrologue) 829 BS3_BEGIN_TEXT16 830 BS3_SET_BITS TMPL_BITS 831 .doit: 832 mov ax, [xBP + xCB + cbCurRetAddr] ; Load far function pointer. 833 mov dx, [xBP + xCB + cbCurRetAddr + 2] 830 834 831 835 ; Mode switch, make the call, switch back. … … 854 858 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM32(uint16_t offBs3Text16); 855 859 ; @uses rax 856 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM32 857 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 858 jmp TMPL_NM(bs3TestCallDoerPrologue) 859 .doit: 860 mov eax, [xBP + xCB *2] ; Load function pointer.860 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM32, BS3_PBC_FAR 861 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 862 jmp TMPL_NM(bs3TestCallDoerPrologue) 863 .doit: 864 mov eax, [xBP + xCB + cbCurRetAddr] ; Load function pointer. 861 865 862 866 ; Mode switch, make the call, switch back. … … 880 884 ; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM64(uint16_t offBs3Text16); 881 885 ; @uses rax 882 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM64 883 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 884 jmp TMPL_NM(bs3TestCallDoerPrologue) 885 .doit: 886 mov eax, [xBP + xCB *2] ; Load function pointer.886 BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM64, BS3_PBC_FAR 887 BS3_LEA_MOV_WRT_RIP(xAX, .doit) 888 jmp TMPL_NM(bs3TestCallDoerPrologue) 889 .doit: 890 mov eax, [xBP + xCB + cbCurRetAddr] ; Load function pointer. 887 891 888 892 ; Mode switch, make the call, switch back. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TrapInit.c
r60194 r60554 32 32 33 33 34 BS3_ DECL(void) TMPL_NM(Bs3TrapInit)(void)34 BS3_MODE_DEF(void, Bs3TrapInit,(void)) 35 35 { 36 36 #if BS3_MODE_IS_16BIT_SYS(TMPL_MODE) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TrapSystemCallHandler.asm
r60439 r60554 67 67 ; CPUs too! 68 68 ; 69 BS3_PROC_BEGIN_MODE Bs3TrapSystemCallHandler 69 BS3_PROC_BEGIN_MODE Bs3TrapSystemCallHandler, BS3_PBC_NEAR ; Near because we'll probably only ever need this from BS3TEXT16. 70 70 ; 71 71 ; This prologue is kind of complicated because of 80286 and older CPUs -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
r60539 r60554 64 64 #define Bs3SelFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelFar32ToFlat32) 65 65 #define Bs3SelProtFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelProtFar32ToFlat32) 66 #define Bs3SelProtModeCodeToRealMode BS3_CMN_MANGLER(Bs3SelProtModeCodeToRealMode) 66 67 #define Bs3SelRealModeCodeToProtMode BS3_CMN_MANGLER(Bs3SelRealModeCodeToProtMode) 67 68 #define Bs3Shutdown BS3_CMN_MANGLER(Bs3Shutdown) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r60539 r60554 64 64 #undef Bs3SelFar32ToFlat32 65 65 #undef Bs3SelProtFar32ToFlat32 66 #undef Bs3SelProtModeCodeToRealMode 66 67 #undef Bs3SelRealModeCodeToProtMode 67 68 #undef Bs3Shutdown -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-footer.h
r60019 r60554 72 72 73 73 #undef TMPL_NM 74 #undef TMPL_ NM_CMN74 #undef TMPL_FAR_NM 75 75 #undef TMPL_MODE 76 76 #undef TMPL_MODE_STR -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-footer.mac
r59977 r60554 83 83 %undef TMPL_NM 84 84 %undef TMPL_NM_U 85 %undef TMPL_FAR_NM 85 86 %undef BS3_CMN_NM 86 87 %undef TMPL_UNDESCORE -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-header.h
r60527 r60554 107 107 * 108 108 * @param Name The function or variable name to mangle. 109 * @sa #TMPL_FAR_NM, #BS3_CMN_NM, #BS3_CMN_FAR_NM 109 110 */ 110 111 # define TMPL_NM(Name) RT_CONCAT(Name,_mode) 112 113 /** @def TMPL_FAR_NM 114 * Name mangling macro for the current mode into a far function name. 115 * 116 * In 32-bit and 64-bit code this does not differ from #TMPL_NM. 117 * 118 * Example: TMPL_FAR_NM(PrintChr) 119 * 120 * @param Name The function or variable name to mangle. 121 * @sa #TMPL_NM, #BS3_CMN_FAR_NM, #BS3_CMN_NM 122 */ 123 # define TMPL_FAR_NM(Name) RT_CONCAT3(Name,_mode,_far) 111 124 112 125 /** @def TMPL_MODE_STR … … 473 486 474 487 488 #if TMPL_MODE & (BS3_MODE_CODE_16 | BS3_MODE_CODE_V86) 489 # define TMPL_FAR_NM(Name) RT_CONCAT3(TMPL_NM(Name),_f,ar) /* _far and far may be #defined already. */ 490 #else 491 # define TMPL_FAR_NM(Name) TMPL_NM(Name) 492 #endif 493 494 495 /** @def BS3_MODE_DEF 496 * Macro for defining a mode specific function. 497 * 498 * This makes 16-bit mode functions far, while 32-bit and 64-bit are near. 499 * You need to update the make file to generate near->far wrappers in most 500 * cases. 501 * 502 * @param a_RetType The return type. 503 * @param a_Name The function basename. 504 * @param a_Params The parameter list (in parentheses). 505 * 506 * @sa BS3_MODE_PROTO 507 */ 508 #if ARCH_BITS == 16 509 # define BS3_MODE_DEF(a_RetType, a_Name, a_Params) BS3_DECL_FAR(a_RetType) TMPL_FAR_NM(a_Name) a_Params 510 #else 511 # define BS3_MODE_DEF(a_RetType, a_Name, a_Params) BS3_DECL_NEAR(a_RetType) TMPL_NM(a_Name) a_Params 512 #endif 513 514 515 475 516 #ifndef TMPL_MODE_STR 476 517 # error "internal error" -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-header.mac
r60439 r60554 388 388 %endif 389 389 390 ; TMPL_FAR_NM 391 %if TMPL_MODE & (BS3_MODE_CODE_16 | BS3_MODE_CODE_V86) 392 %define TMPL_FAR_NM(Name) TMPL_NM(Name) %+ _far 393 %else 394 %define TMPL_FAR_NM(Name) TMPL_NM(Name) 395 %endif 396 390 397 391 398 ;; @def TMPL_WRT_FLAT -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60539 r60554 1528 1528 * @param uRealSeg Real mode code segment. 1529 1529 */ 1530 BS3_CMN_PROTO(uint16_t, Bs3SelRealModeCodeToProtMode,(uint16_t uRealSel), false); 1530 BS3_CMN_PROTO(uint16_t, Bs3SelRealModeCodeToProtMode,(uint16_t uRealSeg), false); 1531 1532 /** 1533 * Converts a real mode code segment to a protected mode code segment selector. 1534 * 1535 * @returns protected mode segment selector. 1536 * @param uProtSel Real mode code segment. 1537 */ 1538 BS3_CMN_PROTO(uint16_t, Bs3SelProtModeCodeToRealMode,(uint16_t uProtSel), false); 1531 1539 1532 1540 /** … … 2520 2528 2521 2529 2522 /** 2530 /** @def BS3_MODE_PROTO 2523 2531 * Macro for reducing typing. 2524 2532 * 2525 2533 * Doxygen knows how to expand this, well, kind of. 2526 */ 2527 #define BS3_MODE_EXPAND_PROTOTYPES(a_RetType, a_BaseFnNm, a_Parameters) \ 2528 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_rm) a_Parameters; \ 2529 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_rm_far) a_Parameters; \ 2530 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe16) a_Parameters; \ 2531 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe16_32) a_Parameters; \ 2532 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe16_v86) a_Parameters; \ 2533 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe32) a_Parameters; \ 2534 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe32_16) a_Parameters; \ 2535 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pev86) a_Parameters; \ 2536 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp16) a_Parameters; \ 2537 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp16_32) a_Parameters; \ 2538 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp16_v86) a_Parameters; \ 2539 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp32) a_Parameters; \ 2540 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp32_16) a_Parameters; \ 2541 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_ppv86) a_Parameters; \ 2542 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16) a_Parameters; \ 2543 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16_32) a_Parameters; \ 2544 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16_v86)a_Parameters; \ 2545 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae32) a_Parameters; \ 2546 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae32_16) a_Parameters; \ 2547 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_paev86) a_Parameters; \ 2548 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_lm16) a_Parameters; \ 2549 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_lm32) a_Parameters; \ 2550 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_lm64) a_Parameters 2534 * 2535 * @param a_RetType The return type. 2536 * @param a_Name The function basename. 2537 * @param a_Params The parameter list (in parentheses). 2538 * @param a_fAutoStub Whether to autogenerate a 16-bit near -> 16-bit far stub 2539 * function. Either 'true' for stub or 'false' for no stub. 2540 */ 2541 #define BS3_MODE_PROTO(a_RetType, a_Name, a_Params, a_fAutoStub) \ 2542 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_rm) a_Params; \ 2543 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pe16) a_Params; \ 2544 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pe16_32) a_Params; \ 2545 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pe16_v86) a_Params; \ 2546 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pe32) a_Params; \ 2547 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pe32_16) a_Params; \ 2548 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pev86) a_Params; \ 2549 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pp16) a_Params; \ 2550 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pp16_32) a_Params; \ 2551 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pp16_v86) a_Params; \ 2552 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pp32) a_Params; \ 2553 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pp32_16) a_Params; \ 2554 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_ppv86) a_Params; \ 2555 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pae16) a_Params; \ 2556 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pae16_32) a_Params; \ 2557 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pae16_v86) a_Params; \ 2558 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pae32) a_Params; \ 2559 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pae32_16) a_Params; \ 2560 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_paev86) a_Params; \ 2561 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_lm16) a_Params; \ 2562 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_lm32) a_Params; \ 2563 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_lm64) a_Params; \ 2564 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_rm_far) a_Params; \ 2565 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pe16_far) a_Params; \ 2566 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pe16_v86_far) a_Params; \ 2567 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pe32_16_far) a_Params; \ 2568 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pev86_far) a_Params; \ 2569 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pp16_far) a_Params; \ 2570 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pp16_v86_far) a_Params; \ 2571 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pp32_16_far) a_Params; \ 2572 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_ppv86_far) a_Params; \ 2573 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pae16_far) a_Params; \ 2574 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pae16_v86_far)a_Params; \ 2575 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_pae32_16_far) a_Params; \ 2576 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_paev86_far) a_Params; \ 2577 BS3_DECL_FAR(a_RetType) RT_CONCAT(a_Name,_lm16_far) a_Params 2551 2578 2552 2579 /** … … 2597 2624 * capabilities. 2598 2625 */ 2599 BS3_MODE_ EXPAND_PROTOTYPES(uint8_t, Bs3CpuDetect,(void));2626 BS3_MODE_PROTO(uint8_t, Bs3CpuDetect,(void), false); 2600 2627 2601 2628 /** @name BS3CPU_XXX - CPU detected by BS3CpuDetect_c16() and friends. … … 2633 2660 * Calls the appropriate Bs3Trap16Init, Bs3Trap32Init or Bs3Trap64Init function. 2634 2661 */ 2635 BS3_MODE_ EXPAND_PROTOTYPES(void, Bs3TrapInit,(void));2662 BS3_MODE_PROTO(void, Bs3TrapInit,(void), true); 2636 2663 2637 2664 /** … … 2641 2668 * @param cEntries The number of sub-test entries. 2642 2669 */ 2643 BS3_MODE_ EXPAND_PROTOTYPES(void, Bs3TestDoModes, (PCBS3TESTMODEENTRY paEntries, size_t cEntries));2670 BS3_MODE_PROTO(void, Bs3TestDoModes,(PCBS3TESTMODEENTRY paEntries, size_t cEntries), true); 2644 2671 2645 2672 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r60539 r60554 680 680 681 681 682 ;; @name BS3_PBC_XXX - For use as the 2nd parameter to BS3_PROC_BEGIN_CMN .682 ;; @name BS3_PBC_XXX - For use as the 2nd parameter to BS3_PROC_BEGIN_CMN and BS3_PROC_BEGIN_MODE. 683 683 ;; @{ 684 %define BS3_PBC_NEAR 0;;< Only near.685 %define BS3_PBC_FAR 1;;< Only far.686 %define BS3_PBC_HYBRID 2;;< Hybrid near/far procedure, trashing AX687 %define BS3_PBC_HYBRID_SAFE 3;;< Hybrid near/far procedure, no trashing but slower.688 %define BS3_PBC_HYBRID_0_ARGS 4;;< Hybrid near/far procedure, no parameters so separate far stub, no trashing, fast near calls.684 %define BS3_PBC_NEAR 1 ;;< Only near. 685 %define BS3_PBC_FAR 2 ;;< Only far. 686 %define BS3_PBC_HYBRID 3 ;;< Hybrid near/far procedure, trashing AX 687 %define BS3_PBC_HYBRID_SAFE 4 ;;< Hybrid near/far procedure, no trashing but slower. 688 %define BS3_PBC_HYBRID_0_ARGS 5 ;;< Hybrid near/far procedure, no parameters so separate far stub, no trashing, fast near calls. 689 689 ;; @} 690 691 ;; Internal begin procedure macro. 692 ; 693 ; @param 1 The near name. 694 ; @param 2 The far name 695 ; @param 3 BS3_PBC_XXX. 696 %macro BS3_PROC_BEGIN_INT 3 697 ;%warning "BS3_PROC_BEGIN_INT:" 1=%1 2=%2 3=%3 698 %undef BS3_CUR_PROC_FLAGS 699 %if __BITS__ == 16 700 %if %3 == BS3_PBC_NEAR 701 %xdefine BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 702 %xdefine cbCurRetAddr 2 703 BS3_PROC_BEGIN %1 704 705 %elif %3 == BS3_PBC_FAR 706 %xdefine BS3_CUR_PROC_FLAGS BS3_PBC_FAR 707 %xdefine cbCurRetAddr 4 708 BS3_PROC_BEGIN %2 709 710 %elif %3 == BS3_PBC_HYBRID 711 %xdefine BS3_CUR_PROC_FLAGS BS3_PBC_HYBRID 712 %xdefine cbCurRetAddr 4 713 BS3_GLOBAL_NAME_EX %1, function, 3 714 pop ax 715 push cs 716 push ax 717 BS3_PROC_BEGIN %2 718 719 %elif %3 == BS3_PBC_HYBRID_SAFE 720 %xdefine BS3_CUR_PROC_FLAGS BS3_PBC_HYBRID_SAFE 721 %xdefine cbCurRetAddr 4 722 BS3_GLOBAL_NAME_EX %1, function, 3 723 extern Bs3CreateHybridFarRet_c16 724 call Bs3CreateHybridFarRet_c16 725 BS3_PROC_BEGIN %2 726 727 %elif %3 == BS3_PBC_HYBRID_0_ARGS 728 %xdefine BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 729 %xdefine cbCurRetAddr 2 730 %xdefine TMP_BEGIN_PREV_SEG BS3_CUR_SEG_BEGIN_MACRO 731 732 BS3_BEGIN_TEXT16_FARSTUBS 733 BS3_PROC_BEGIN %2 734 call %1 735 retf 736 BS3_PROC_END %2 737 738 TMP_BEGIN_PREV_SEG 739 BS3_PROC_BEGIN %1 740 %undef TMP_BEGIN_PREV_SEG 741 742 %else 743 %error BS3_PROC_BEGIN_CMN parameter 2 value %3 is not recognized. 744 745 %xdefine BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 746 %xdefine cbCurRetAddr 4 747 BS3_PROC_BEGIN %1 748 %endif 749 %else 750 %xdefine BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 751 %xdefine cbCurRetAddr xCB 752 BS3_PROC_BEGIN %1 753 %endif 754 %endmacro 755 756 ;; Internal end procedure macro 757 ; 758 ; @param 1 The near name. 759 ; @param 2 The far name 760 ; 761 %macro BS3_PROC_END_INT 2 762 %if __BITS__ == 16 763 %if BS3_CUR_PROC_FLAGS == BS3_PBC_NEAR 764 BS3_PROC_END %1 765 %else 766 BS3_PROC_END %2 767 %endif 768 %else 769 BS3_PROC_END %1 770 %endif 771 %undef BS3_CUR_PROC_FLAGS 772 %undef cbCurRetAddr 773 %endmacro 774 690 775 691 776 ;; Convenience macro for defining common procedures. 692 777 ; This will emit both near and far 16-bit symbols according to parameter %2 (BS3_PBC_XXX). 693 778 %macro BS3_PROC_BEGIN_CMN 2 694 %undef BS3_CUR_PROC_FLAGS 695 %if __BITS__ == 16 696 %if %2 == BS3_PBC_NEAR 697 %define BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 698 %xdefine cbCurRetAddr 2 699 BS3_PROC_BEGIN BS3_CMN_NM(%1) 700 701 %elif %2 == BS3_PBC_FAR 702 %define BS3_CUR_PROC_FLAGS BS3_PBC_FAR 703 %xdefine cbCurRetAddr 4 704 BS3_PROC_BEGIN BS3_CMN_NM_FAR(%1) 705 706 %elif %2 == BS3_PBC_HYBRID 707 %define BS3_CUR_PROC_FLAGS BS3_PBC_HYBRID 708 %xdefine cbCurRetAddr 4 709 BS3_GLOBAL_NAME_EX BS3_CMN_NM(%1), function, 3 710 pop ax 711 push cs 712 push ax 713 BS3_PROC_BEGIN BS3_CMN_NM_FAR(%1) 714 715 %elif %2 == BS3_PBC_HYBRID_SAFE 716 %define BS3_CUR_PROC_FLAGS BS3_PBC_HYBRID_SAFE 717 %xdefine cbCurRetAddr 4 718 BS3_GLOBAL_NAME_EX BS3_CMN_NM(%1), function, 3 719 extern Bs3CreateHybridFarRet_c16 720 call Bs3CreateHybridFarRet_c16 721 BS3_PROC_BEGIN BS3_CMN_NM_FAR(%1) 722 723 %elif %2 == BS3_PBC_HYBRID_0_ARGS 724 %define BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 725 %xdefine cbCurRetAddr 2 726 %undef TMP_BEGIN_PREV_SEG 727 %xdefine TMP_BEGIN_PREV_SEG BS3_CUR_SEG_BEGIN_MACRO 728 729 BS3_BEGIN_TEXT16_FARSTUBS 730 BS3_PROC_BEGIN BS3_CMN_NM_FAR(%1) 731 call BS3_CMN_NM(%1) 732 retf 733 BS3_PROC_END BS3_CMN_NM_FAR(%1) 734 735 TMP_BEGIN_PREV_SEG 736 BS3_PROC_BEGIN BS3_CMN_NM(%1) 737 738 %else 739 %error BS3_PROC_BEGIN_CMN parameter 2 value %2 is not recognized. 740 741 %define BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 742 %xdefine cbCurRetAddr 4 743 BS3_PROC_BEGIN BS3_CMN_NM(%1) 744 %endif 745 %else 746 %define BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 747 %xdefine cbCurRetAddr xCB 748 BS3_PROC_BEGIN BS3_CMN_NM(%1) 749 %endif 779 BS3_PROC_BEGIN_INT BS3_CMN_NM(%1), BS3_CMN_NM_FAR(%1), %2 750 780 %endmacro 751 781 752 782 ;; Convenience macro for defining common procedures. 753 783 %macro BS3_PROC_END_CMN 1 754 %if __BITS__ == 16 755 %if BS3_CUR_PROC_FLAGS == BS3_PBC_NEAR 756 BS3_PROC_END BS3_CMN_NM(%1) 757 %else 758 BS3_PROC_END BS3_CMN_NM_FAR(%1) 759 %endif 760 %else 761 BS3_PROC_END BS3_CMN_NM(%1) 762 %endif 763 %undef cbCurRetAddr 764 %endmacro 765 766 ;; Does a far return in 16-bit code, near return in 32-bit and 64-bit. 767 ; This is for use with BS3_PBC_XXX 768 %macro BS3_HYBRID_RET 0-1 769 %if __BITS__ == 16 770 %if %0 > 0 771 %if BS3_CUR_PROC_FLAGS == BS3_PBC_NEAR || BS3_CUR_PROC_FLAGS == BS3_PBC_HYBRID_0_ARGS 772 ret %1 773 %else 774 retf %1 775 %endif 776 %else 777 %if BS3_CUR_PROC_FLAGS == BS3_PBC_NEAR || BS3_CUR_PROC_FLAGS == BS3_PBC_HYBRID_0_ARGS 778 ret 779 %else 780 retf 781 %endif 782 %endif 783 %else 784 %if BS3_CUR_PROC_FLAGS != BS3_PBC_NEAR 785 %error Expected BS3_CUR_PROC_FLAGS to be BS3_PBC_NEAR in non-16-bit code. 786 %endif 787 %if %0 > 0 788 ret %1 789 %else 790 ret 791 %endif 792 %endif 784 BS3_PROC_END_INT BS3_CMN_NM(%1), BS3_CMN_NM_FAR(%1) 793 785 %endmacro 794 786 … … 828 820 %endmacro 829 821 822 830 823 ;; Convenience macro for defining mode specific procedures. 831 %macro BS3_PROC_BEGIN_MODE 1 832 BS3_PROC_BEGIN TMPL_NM(%1) 824 %macro BS3_PROC_BEGIN_MODE 2 825 ;%warning "BS3_PROC_BEGIN_MODE: 1=" %1 "2=" %2 826 BS3_PROC_BEGIN_INT TMPL_NM(%1), TMPL_FAR_NM(%1), %2 833 827 %endmacro 834 828 835 829 ;; Convenience macro for defining mode specific procedures. 836 830 %macro BS3_PROC_END_MODE 1 837 BS3_PROC_END TMPL_NM(%1) 831 BS3_PROC_END_INT TMPL_NM(%1), TMPL_FAR_NM(%1) 832 %endmacro 833 834 ;; Does a far return in 16-bit code, near return in 32-bit and 64-bit. 835 ; This is for use with BS3_PBC_XXX 836 %macro BS3_HYBRID_RET 0-1 837 %if __BITS__ == 16 838 %if %0 > 0 839 %if BS3_CUR_PROC_FLAGS == BS3_PBC_NEAR || BS3_CUR_PROC_FLAGS == BS3_PBC_HYBRID_0_ARGS 840 ret %1 841 %else 842 retf %1 843 %endif 844 %else 845 %if BS3_CUR_PROC_FLAGS == BS3_PBC_NEAR || BS3_CUR_PROC_FLAGS == BS3_PBC_HYBRID_0_ARGS 846 ret 847 %else 848 retf 849 %endif 850 %endif 851 %else 852 %if BS3_CUR_PROC_FLAGS != BS3_PBC_NEAR 853 %error Expected BS3_CUR_PROC_FLAGS to be BS3_PBC_NEAR in non-16-bit code. 854 %endif 855 %if %0 > 0 856 ret %1 857 %else 858 ret 859 %endif 860 %endif 838 861 %endmacro 839 862
Note:
See TracChangeset
for help on using the changeset viewer.