Changeset 60578 in vbox
- Timestamp:
- Apr 19, 2016 3:26:34 PM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 11 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/Config.kmk
r60572 r60578 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)_c16,_$(fn)_f16))80 BS3KIT_FN_GEN_CMN_NEARSTUBS = $(foreach fn,$2,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$(fn)_c16,_$(fn)_f16)) 81 81 82 82 ## … … 118 118 ' push ax' \ 119 119 ' jmp $3 wrt CGROUP16' 120 endef 121 122 123 ## 124 # Macro for generating far-call aliases for zero or more 16-bit C or assembly functions. 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)) 128 129 ## 130 # Macro for generating far-call aliases for zero or more 16-bit C mode functions. 131 # @param 1 The target name. 132 # @param 2 List of mode functions. 133 BS3KIT_FN_GEN_MODE_FARSTUBS = $(foreach fn,$2,$(foreach suff, \ 134 _rm \ 135 _pe16 \ 136 _pe16_v86 \ 137 _pe32_16 \ 138 _pev86 \ 139 _pp16 \ 140 _pp16_v86 \ 141 _pp32_16 \ 142 _ppv86 \ 143 _pae16 \ 144 _pae16_v86 \ 145 _pae32_16 \ 146 _paev86 \ 147 _lm16 \ 148 ,$(evalcall2 def_Bs3KitGenFarStubSource,$1,$(fn),$(suff)_far,$(suff)) 149 150 # @param 1 The target name. 151 # @param 2 The function and amount of parameters. 152 # @param 3 The far function suffix. 153 # @param 4 The near function suffix. 154 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 $$$$@) 161 $(QUIET)$(APPEND) -tn $$@ \ 162 '%include "bs3kit.mac"' \ 163 'BS3_BEGIN_TEXT16' \ 164 ' extern _$(fn2)$4' \ 165 'BS3_BEGIN_TEXT16_FARSTUBS' \ 166 'BS3_PROC_BEGIN _$(fn2)$3' \ 167 ' CPU 8086' \ 168 ' inc bp' \ 169 ' push bp' \ 170 ' mov bp, sp' \ 171 '%assign offParam $(cbParam)' \ 172 '%rep $(cbParam) / 2' \ 173 ' push word [bp + 2 + 4 + offParam - 2]' \ 174 '%assign offParam offParam - 2' \ 175 '%endrep' \ 176 ' call _$(fn2)$4' \ 177 ' add sp, $(cbParam)' \ 178 ' pop bp' \ 179 ' dec bp' \ 180 ' retf' \ 181 'BS3_PROC_END _$(fn2)$3' \ 182 '' 120 183 endef 121 184 -
trunk/src/VBox/ValidationKit/bootsectors/Makefile.kmk
r60194 r60578 241 241 bs3-cpu-basic-2-c.c \ 242 242 bs3-cpu-basic-2.asm \ 243 bs3kit/bs3-cmn-instantiate .c16 \243 bs3kit/bs3-cmn-instantiate-x0.c16 \ 244 244 bs3kit/bs3-cmn-instantiate.c32 \ 245 245 bs3kit/bs3-cmn-instantiate.c64 246 bs3-cpu-basic-2-template.o:: $$(addprefix $$(bs3-cpu-basic-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate,.o16 .o32 .o64) 246 bs3-cpu-basic-2-template.o:: \ 247 $$(bs3-cpu-basic-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate-x0.o16 \ 248 $$(bs3-cpu-basic-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o32 \ 249 $$(bs3-cpu-basic-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o64 247 250 endif 248 251 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c
r60539 r60578 258 258 else 259 259 fExtraEfl = X86_EFL_RF; 260 #if 0 /** @todo Running on an AMD Phenom II X6 1100T under AMD-V I'm not getting good X86_EFL_RF results. Enable this to get on with other work. */ 261 fExtraEfl = pTrapCtx->Ctx.rflags.u32 & X86_EFL_RF; 262 #endif 260 263 Bs3TestCheckRegCtxEx(&pTrapCtx->Ctx, pStartCtx, 0 /*cbIpAdjust*/, 0 /*cbSpAdjust*/, fExtraEfl, g_pszTestMode, g_usBs3TestStep); 261 264 if (Bs3TestSubErrorCount() != cErrorsBefore) … … 404 407 Ctx80.rsp.u -= 0x300; 405 408 Ctx80.rip.u = (uintptr_t)BS3_FP_OFF(&TMPL_NM(bs3CpuBasic2_Int80)); 406 # if TMPL_BITS == 32 409 # if TMPL_BITS == 16 410 Ctx80.cs = BS3_MODE_IS_RM_OR_V86(g_bTestMode) ? BS3_SEL_TEXT16 : BS3_SEL_R0_CS16; 411 # elif TMPL_BITS == 32 407 412 g_uBs3TrapEipHint = Ctx80.rip.u32; 408 413 # endif … … 1523 1528 * Re-initialize the IDT. 1524 1529 */ 1525 TMPL_ NM(Bs3TrapInit)();1530 TMPL_FAR_NM(Bs3TrapInit)(); 1526 1531 return bRet; 1527 1532 } … … 1549 1554 * Re-initialize the IDT. 1550 1555 */ 1551 TMPL_ NM(Bs3TrapInit)();1556 TMPL_FAR_NM(Bs3TrapInit)(); 1552 1557 return 0; 1553 1558 #elif TMPL_MODE == BS3_MODE_RM … … 1595 1600 * Re-initialize the IDT. 1596 1601 */ 1597 TMPL_ NM(Bs3TrapInit)();1602 TMPL_FAR_NM(Bs3TrapInit)(); 1598 1603 return 0; 1599 1604 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r60557 r60578 201 201 bs3-c16-CreateHybridFarRet.asm 202 202 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_ FUNCTIONS := \203 bs3kit-common-16_VBOX_NEAR_TO_FAR_CMN_FUNCTIONS := \ 204 204 $(sort $(subst bs3-cmn-,Bs3,$(basename $(filter-out \ 205 205 %Data.c \ … … 221 221 Bs3TrapInit \ 222 222 223 $(call BS3KIT_FN_GEN_NEARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_NEAR_TO_FAR_FUNCTIONS)) 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)) 224 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)) 225 230 226 231 # The 32-bit BS3Kit library. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-instantiate-x0.c16
r60566 r60578 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - 16-bit common C template instantiator .3 * BS3Kit - 16-bit common C template instantiator, using the BS3X0TEXT16 segment. 4 4 */ 5 5 … … 25 25 */ 26 26 27 27 #define BS3_USE_X0_TEXT_SEG 1 28 28 #include "bs3-cmn-instantiate-common.h" 29 29 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-instantiate-x1.c16
r60566 r60578 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - 16-bit common C template instantiator .3 * BS3Kit - 16-bit common C template instantiator, using the BS3X1TEXT16 segment. 4 4 */ 5 5 … … 25 25 */ 26 26 27 27 #define BS3_USE_X1_TEXT_SEG 1 28 28 #include "bs3-cmn-instantiate-common.h" 29 29 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-SwitchToLM64.asm
r60557 r60578 41 41 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 42 42 ; 43 BS3_GLOBAL_NAME_EX TMPL_NM(Bs3SwitchToLM 16_Safe), function, 043 BS3_GLOBAL_NAME_EX TMPL_NM(Bs3SwitchToLM64_Safe), function, 0 44 44 BS3_PROC_BEGIN_MODE Bs3SwitchToLM64, BS3_PBC_NEAR 45 45 %ifdef TMPL_LM64 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModes.c
r60557 r60578 25 25 */ 26 26 27 /** @todo get this mess into the RM segment! */28 29 27 30 28 /********************************************************************************************************************************* 31 29 * Header Files * 32 30 *********************************************************************************************************************************/ 33 #if defined(__WATCOMC__) && TMPL_MODE == BS3_MODE_RM 34 /* In real mode we move this blob of code to the RMTEXT16 segment to save space. */ 35 # define BS3_USE_RM_TEXT_SEG 1 31 #if TMPL_MODE == BS3_MODE_RM 32 # define BS3_USE_RM_TEXT_SEG 1 /* Real mode version in RMTEXT16 segment to save space. */ 36 33 # include "bs3kit-template-header.h" 37 34 # include "bs3-cmn-test.h" 38 # pragma code_seg("BS3RMTEXT16", "BS3CLASS16RMCODE")39 35 #else 40 36 # include "bs3kit-template-header.h" -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c
r60556 r60578 34 34 #include <iprt/asm-amd64-x86.h> 35 35 36 //#ifdef __WATCOMC__37 //# pragma code_seg("BS3RMTEXT16", "BS3CLASS16RMCODE")38 //#endif39 40 36 41 37 BS3_DECL(void) Bs3InitAll_rm(void) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitGdt.c
r60557 r60578 32 32 #include <iprt/asm.h> 33 33 34 #ifdef __WATCOMC__35 # pragma code_seg("BS3RMTEXT16", "BS3CLASS16RMCODE")36 #endif37 38 34 39 35 /********************************************************************************************************************************* -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitMemory.c
r60556 r60578 32 32 #include "bs3-cmn-memory.h" 33 33 #include <iprt/asm.h> 34 35 #ifdef __WATCOMC__36 # pragma code_seg("BS3RMTEXT16", "BS3CLASS16RMCODE")37 #endif38 34 39 35 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code.h
r60527 r60578 30 30 */ 31 31 #undef BS3_CMN_MANGLER 32 #if ARCH_BITS != 16 || !defined(BS3_USE_ RM_TEXT_SEG)32 #if ARCH_BITS != 16 || !defined(BS3_USE_ALT_16BIT_TEXT_SEG) 33 33 # define BS3_CMN_MANGLER(a_Function) BS3_CMN_NM(a_Function) 34 34 #else -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60557 r60578 49 49 #endif 50 50 51 /** @def BS3_USE_ALT_16BIT_TEXT_SEG 52 * Combines the BS3_USE_RM_TEXT_SEG, BS3_USE_X0_TEXT_SEG, and 53 * BS3_USE_X1_TEXT_SEG indicators into a single one. */ 54 #if defined(BS3_USE_RM_TEXT_SEG) || defined(BS3_USE_X0_TEXT_SEG) || defined(BS3_USE_X1_TEXT_SEG) 55 # define BS3_USE_ALT_16BIT_TEXT_SEG 56 #else 57 # undef BS3_USE_ALT_16BIT_TEXT_SEG 58 #endif 59 51 60 /* 52 61 * We may want to reuse some IPRT code in the common name space, so we … … 55 64 * declarations before we can define it. Thus the duplciate effort.) 56 65 */ 57 #if ARCH_BITS != 16 || !defined(BS3_USE_ RM_TEXT_SEG)66 #if ARCH_BITS != 16 || !defined(BS3_USE_ALT_16BIT_TEXT_SEG) 58 67 # define RT_MANGLER(a_Name) RT_CONCAT3(a_Name,_c,ARCH_BITS) 59 68 #else 60 69 # define RT_MANGLER(a_Name) RT_CONCAT(a_Name,_f16) 70 # undef RTCALL 71 # define RTCALL __cdecl __far 61 72 #endif 62 73 #include <iprt/mangling.h> … … 509 520 * 510 521 * @param a_Type The return type. */ 511 #if ARCH_BITS != 16 || !defined(BS3_USE_ RM_TEXT_SEG)522 #if ARCH_BITS != 16 || !defined(BS3_USE_ALT_16BIT_TEXT_SEG) 512 523 # define BS3_DECL(a_Type) BS3_DECL_NEAR(a_Type) 513 524 #else … … 576 587 * Constructs a common function name, far or near as defined by the source. 577 588 * 578 * Which to use in 16-bit mode is defined by BS3_USE_ RM_TEXT_SEG. In 32-bit and579 * 64-bit mode there are no far symbols, only near ones.589 * Which to use in 16-bit mode is defined by BS3_USE_ALT_16BIT_TEXT_SEG. In 590 * 32-bit and 64-bit mode there are no far symbols, only near ones. 580 591 * 581 592 * Example: BS3_CMN_FN_NM(Bs3Shutdown) … … 583 594 * @param a_Name The name of the function. 584 595 */ 585 #if ARCH_BITS != 16 || !defined(BS3_USE_ RM_TEXT_SEG)596 #if ARCH_BITS != 16 || !defined(BS3_USE_ALT_16BIT_TEXT_SEG) 586 597 # define BS3_CMN_FN_NM(a_Name) BS3_CMN_NM(a_Name) 587 598 #else … … 2687 2698 #include "bs3kit-mangling-code.h" 2688 2699 2689 2690 #endif 2691 2700 /* 2701 * Change 16-bit text segment if requested. 2702 */ 2703 #if defined(BS3_USE_ALT_16BIT_TEXT_SEG) && ARCH_BITS == 16 && !defined(BS3_DONT_CHANGE_TEXT_SEG) 2704 # if (defined(BS3_USE_RM_TEXT_SEG) + defined(BS3_USE_X0_TEXT_SEG) + defined(BS3_USE_X1_TEXT_SEG)) != 1 2705 # error "Cannot set more than one alternative 16-bit text segment!" 2706 # elif defined(BS3_USE_RM_TEXT_SEG) 2707 # pragma code_seg("BS3RMTEXT16", "BS3CLASS16RMCODE") 2708 # elif defined(BS3_USE_X0_TEXT_SEG) 2709 # pragma code_seg("BS3X0TEXT16", "BS3CLASS16X0CODE") 2710 # elif defined(BS3_USE_X1_TEXT_SEG) 2711 # pragma code_seg("BS3X1TEXT16", "BS3CLASS16X1CODE") 2712 # else 2713 # error "Huh? Which alternative text segment did you want again?" 2714 # endif 2715 #endif 2716 2717 #endif 2718
Note:
See TracChangeset
for help on using the changeset viewer.