- Timestamp:
- Apr 18, 2016 9:11:04 AM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 6 added
- 2 deleted
- 96 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/Config.kmk
r60439 r60527 70 70 endif 71 71 72 73 ## 74 # Macro for generating near-call aliases for zero or more 16-bit C functions. 75 # @param 1 The target name. 76 # @param 2 List of functions. 77 BS3KIT_FN_GEN_NEARSTUBS = $(foreach fn,$2,$(evalcall2 def_Bs3KitGenNearStubSource,$1,$(fn))) 78 define def_Bs3KitGenNearStubSource 79 $1_SOURCES += $$($1_0_OUTDIR)/near-call-to-$2_f16.asm 80 $1_CLEAN += $$($1_0_OUTDIR)/near-call-to-$2_f16.asm 81 $$$$($1_0_OUTDIR)/near-call-to-$2_f16.asm: | $$$$(dir $$$$@) 82 $(QUIET)$(APPEND) -tn $$@ \ 83 '%include "bs3kit.mac"' \ 84 'BS3_BEGIN_TEXT16' \ 85 ' extern _$2_f16' \ 86 'BS3_BEGIN_TEXT16_NEARSTUBS' \ 87 'GROUP CGROUP16 BS3TEXT16 BS3TEXT16_NEARSTUBS' \ 88 'BS3_GLOBAL_NAME_EX _$2_c16, function, 6' \ 89 ' pop ax' \ 90 ' push cs' \ 91 ' push ax' \ 92 ' jmp _$2_f16 wrt CGROUP16' 93 endef 94 95 96 # 97 # Tools Tools Tools 98 # Tools Tools Tools 99 # Tools Tools Tools 100 # 72 101 73 102 # Dummy CP "linker" tool. … … 530 559 clname $(BS3KIT_CLASS_CODE16) segaddr=0x1000 \ 531 560 segment BS3TEXT16 \ 561 segment BS3TEXT16_NEARSTUBS \ 562 segment BS3TEXT16_FARSTUBS \ 532 563 segment BS3TEXT16_END \ 533 564 clname BS3SYSTEM16 segaddr=0x2000 \ … … 571 602 segment BS3DATA64_BSS \ 572 603 segment BS3DATA64_END \ 604 clname BS3CLASS16RMCODE \ 605 segment BS3RMCODE16_START \ 606 segment BS3RMCODE16 \ 607 segment BS3RMCODE16_END \ 573 608 clname BS3CLASS32CODE \ 609 segment BS3TEXT32_START \ 574 610 segment BS3TEXT32 \ 611 segment BS3TEXT32_END \ 575 612 clname BS3CLASS64CODE \ 576 segment BS3TEXT64 613 segment BS3TEXT64_START \ 614 segment BS3TEXT64 \ 615 segment BS3TEXT64_END 577 616 578 617 TEMPLATE_VBoxBS3KitImg_LNK_DEPS = \ … … 705 744 segment BS3TEXT16 \ 706 745 segment _TEXT \ 746 segment BS3TEXT16_NEARSTUBS \ 747 segment BS3TEXT16_FARSTUBS \ 707 748 segment BS3TEXT16_END \ 708 749 clname BS3SYSTEM16 \ … … 764 805 segment BS3DATA64_BSS \ 765 806 segment BS3DATA64_END \ 807 clname BS3CLASS16RMCODE \ 808 segment BS3RMCODE16_START \ 809 segment BS3RMCODE16 \ 810 segment BS3RMCODE16_END \ 766 811 clname BS3CLASS32CODE \ 767 812 segment BS3TEXT32 \ 813 segment BS3TEXT32_END \ 768 814 clname BS3CLASS64CODE \ 769 segment BS3TEXT64 815 segment BS3TEXT64 \ 816 segment BS3TEXT64_END 770 817 # clname BS3FLAT segaddr=0x0000 \ 771 818 # segment BS3FLAT segaddr=0x0000 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-c.c
r60445 r60527 49 49 { 50 50 //BS3TESTMODEENTRY_MODE("tss / gate / esp", bs3CpuBasic2_TssGateEsp), 51 //BS3TESTMODEENTRY_MODE("raise xcpt #1", bs3CpuBasic2_RaiseXcpt1),51 BS3TESTMODEENTRY_MODE("raise xcpt #1", bs3CpuBasic2_RaiseXcpt1), 52 52 //BS3TESTMODEENTRY_CMN("iret", bs3CpuBasic2_iret), 53 //BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret),54 BS3TESTMODEENTRY_MODE("sidt", bs3CpuBasic2_sidt),53 // BS3TESTMODEENTRY_MODE("iret", bs3CpuBasic2_iret), 54 // BS3TESTMODEENTRY_MODE("sidt", bs3CpuBasic2_sidt), 55 55 }; 56 56 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c
r60445 r60527 351 351 # if TMPL_BITS == 16 352 352 bool const f386Plus = (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386; 353 bool const f286 = (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80286;353 bool const f286 = (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) == BS3CPU_80286; 354 354 # else 355 355 bool const f286 = false; … … 1571 1571 g_f16BitSys = BS3_MODE_IS_16BIT_SYS(TMPL_MODE); 1572 1572 1573 Bs3PrintStrN(RT_STR_TUPLE("Hello world!\n")); 1574 #if !BS3_MODE_IS_V86(TMPL_MODE) 1575 Bs3TestPrintf(RT_STR_TUPLE("Hi there!\n")); 1576 #endif 1573 1577 return BS3TESTDOMODE_SKIPPED; 1574 1578 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r60485 r60527 66 66 bs3-cmn-PrintStr.c \ 67 67 bs3-cmn-PrintStrN.asm \ 68 bs3-cmn-PrintStrColonSpaces.asm \69 bs3-cmn-PrintStrSpacesColonSpace.c \70 68 bs3-cmn-StrFormatV.c \ 71 69 bs3-cmn-StrPrintf.c \ … … 124 122 bs3-cmn-TestCheckRegCtxEx.c \ 125 123 bs3-cmn-TestPrintf.c \ 124 bs3-cmn-TrapRmV86Init.c \ 125 bs3-cmn-TrapRmV86SetGate.c \ 126 126 bs3-cmn-Trap16Init.c \ 127 127 bs3-cmn-Trap16SetGate.c \ … … 151 151 ../../../Runtime/common/asm/ASMSerializeInstruction-rdtscp.asm \ 152 152 153 # 154 # We generate a list of files with 16-bit far functions for which we generate 155 # near jump stubs. 156 # 157 #$(PATH_OUT_OBJ)/bs3kit-common-16-near-to-far.kmk.ts \ 158 #+| $(PATH_OUT_OBJ)/bs3kit-common-16-near-to-far.kmk: $(VBOX_PATH_BS3KIT_SRC)/bs3kit.h 159 # $(SED) \ 160 # -n -e '/no-near-stub/d' \ 161 # -e 's/^ *BS3_DECL(.*) *\([a-zA-Z][a-zA-Z0-9_]*\)(.*[;,][^;]*$/\1/p' \ 162 # --output $@ \ 163 # bs3kit.h 164 # .$(CP_CHANGED) --changed -f -- $@ $(PATH_OUT_OBJ)/bs3kit-common-16-near-to-far.kmk 165 #include $(PATH) 166 167 153 168 # The 16-bit BS3Kit library. 154 169 LIBRARIES += bs3kit-common-16 … … 176 191 bs3-wc16-U4D.asm \ 177 192 bs3-wc16-I4D.asm \ 178 bs3-c16-Trap16Generic.asm 193 bs3-c16-Trap16Generic.asm \ 194 bs3-c16-CreateHybridFarRet.asm 179 195 bs3kit-common-16_bs3-cmn-UInt64Div.c_CFLAGS = -oh -d0 # -d1+ vs -d0 saves 0x6a3-0x577 = 0x12C (300)! 196 bs3kit-common-16_VBOX_NEAR_TO_FAR_FUNCTIONS := \ 197 $(sort $(subst bs3-cmn-,Bs3,$(basename $(filter-out \ 198 %Data.c \ 199 bs3-rm-% \ 200 bs3-cmn-hexdigits.c \ 201 ,$(filter %.c,$(bs3kit-common-16_SOURCES)))))) \ 202 Bs3PrintfV \ 203 Bs3StrPrintfV \ 204 Bs3TestPrintfV \ 205 Bs3TestFailedF \ 206 Bs3TestFailedV \ 207 Bs3TestSkippedF \ 208 Bs3TestSkippedV \ 209 Bs3TestSubF \ 210 Bs3TestSubV \ 211 Bs3Trap16InitEx 212 $(call BS3KIT_FN_GEN_NEARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_NEAR_TO_FAR_FUNCTIONS)) 180 213 181 214 # The 32-bit BS3Kit library. … … 431 464 432 465 466 # 467 # Rule for regenerating bs3kit-mangling-functions-undef.h. 468 # 469 bs3kit-mangling-code-undef.h: $(PATH_SUB_CURRENT)/bs3kit-mangling-code-define.h 470 $(SED) \ 471 -e 's/#define \([a-zA-Z_][a-zA-Z0-9_]*\) .*$(DOLLAR)/#undef \1/' \ 472 -e 's/Function needing mangling\./Undefining function mangling - automatically generated by the $@ makefile rule./' \ 473 --output $(dir $<)bs3kit-mangling-code-undef.h \ 474 $< 475 476 433 477 include $(FILE_KBUILD_SUB_FOOTER) 434 478 435 .PRECIOUS: $(PATH_OBJ)/bs3-shutdown/bs3-shutdown.map -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/VBoxBs3ObjConverter.cpp
r60462 r60527 56 56 # define ELF_FMT_D64 "lld" 57 57 #endif 58 59 /** Compares an OMF string with a constant string. */ 60 #define IS_OMF_STR_EQUAL_EX(a_cch1, a_pch1, a_szConst2) \ 61 ( (a_cch1) == sizeof(a_szConst2) - 1 && memcmp(a_pch1, a_szConst2, sizeof(a_szConst2) - 1) == 0 ) 62 63 /** Compares an OMF string with a constant string. */ 64 #define IS_OMF_STR_EQUAL(a_pchZeroPrefixed, a_szConst2) \ 65 IS_OMF_STR_EQUAL_EX((uint8_t)((a_pchZeroPrefixed)[0]), &((a_pchZeroPrefixed)[1]), a_szConst2) 58 66 59 67 … … 3594 3602 3595 3603 /** 3604 * Segment definition. 3605 */ 3606 typedef struct OMFSEGDEF 3607 { 3608 uint32_t cbSeg; 3609 uint8_t bSegAttr; 3610 uint16_t idxName; 3611 uint16_t idxClass; 3612 uint16_t idxOverlay; 3613 uint8_t cchName; 3614 uint8_t cchClass; 3615 uint8_t cchOverlay; 3616 const char *pchName; 3617 const char *pchClass; 3618 const char *pchOverlay; 3619 bool fUse32; 3620 } OMFSEGDEF; 3621 typedef OMFSEGDEF *POMFSEGDEF; 3622 3623 /** 3624 * Group definition. 3625 */ 3626 typedef struct OMFGRPDEF 3627 { 3628 const char *pchName; 3629 uint16_t idxName; 3630 uint8_t cchName; 3631 uint16_t cSegDefs; 3632 uint16_t *pidxSegDefs; 3633 } OMFGRPDEF; 3634 typedef OMFGRPDEF *POMFGRPDEF; 3635 3636 /** 3596 3637 * Records line number information for a file in a segment (for CV8 debug info). 3597 3638 */ … … 3620 3661 /** The segment index. */ 3621 3662 uint16_t idxSeg; 3663 /** The group index for this segment. This is zero if not yet determined and 3664 * UINT16_MAX if no group applicable to this segment. */ 3665 uint16_t idxGrp; 3622 3666 /** File table. */ 3623 3667 POMFFILEINES paFiles; … … 3638 3682 /** Set if this module may need mangling. */ 3639 3683 bool fMayNeedMangling; 3640 /** Number of SEGDEFs records. */3641 uint32_t cSegDefs;3684 /** Set if this module needs CGROUP16 for line number fixupes. */ 3685 bool fNeedsCGroup16; 3642 3686 /** The LNAME index of '$$SYMBOLS' or UINT16_MAX it not found. */ 3643 3687 uint16_t iSymbolsNm; … … 3646 3690 /** The '$$SYMBOLS' segment index. */ 3647 3691 uint16_t iSymbolsSeg; 3692 /** The LNAME index of 'CGROUP16' or UINT16_MAX it not found. */ 3693 uint16_t iCGroup16Nm; 3694 /** The 'CGROUP16' group definition index or UINT16_MAX it not found. */ 3695 uint16_t iCGroup16Grp; 3696 3697 /** Number of SEGDEFs records. */ 3698 uint16_t cSegDefs; 3699 /** Number of GRPDEFs records. */ 3700 uint16_t cGrpDefs; 3701 /** Number of listed names. */ 3702 uint16_t cLNames; 3703 3704 /** Segment defintions. */ 3705 POMFSEGDEF paSegDefs; 3706 /** Group defintions. */ 3707 POMFGRPDEF paGrpDefs; 3708 /** Name list. Points to the size repfix. */ 3709 char **papchLNames; 3648 3710 3649 3711 /** CV8: Filename string table size. */ … … 3667 3729 typedef OMFDETAILS const *PCOMFDETAILS; 3668 3730 3731 /** Grows a table to a given size (a_cNewEntries). */ 3732 #define OMF_GROW_TABLE_EX_RET_ERR(a_EntryType, a_paTable, a_cEntries, a_cNewEntries) \ 3733 do\ 3734 { \ 3735 size_t cbOld = (a_cEntries) * sizeof(a_EntryType); \ 3736 size_t cbNew = (a_cNewEntries) * sizeof(a_EntryType); \ 3737 void *pvNew = realloc(a_paTable, cbNew); \ 3738 if (pvNew) \ 3739 { \ 3740 memset((uint8_t *)pvNew + cbOld, 0, cbNew - cbOld); \ 3741 (a_paTable) = (a_EntryType *)pvNew; \ 3742 } \ 3743 else return error("???", "Out of memory!\n"); \ 3744 } while (0) 3745 3746 /** Grows a table. */ 3747 #define OMF_GROW_TABLE_RET_ERR(a_EntryType, a_paTable, a_cEntries, a_cEvery) \ 3748 if ((a_cEntries) % (a_cEvery) != 0) { /* likely */ } \ 3749 else do\ 3750 { \ 3751 size_t cbOld = (a_cEntries) * sizeof(a_EntryType); \ 3752 size_t cbNew = cbOld + (a_cEvery) * sizeof(a_EntryType); \ 3753 void *pvNew = realloc(a_paTable, cbNew); \ 3754 if (pvNew) \ 3755 { \ 3756 memset((uint8_t *)pvNew + cbOld, 0, (a_cEvery) * sizeof(a_EntryType)); \ 3757 (a_paTable) = (a_EntryType *)pvNew; \ 3758 } \ 3759 else return error("???", "Out of memory!\n"); \ 3760 } while (0) 3761 3669 3762 3670 3763 /** … … 3756 3849 if (idxSeg >= pOmfStuff->cSegLines) 3757 3850 { 3758 void *pvNew = realloc(pOmfStuff->paSegLines, (idxSeg + 1) * sizeof(pOmfStuff->paSegLines[0])); 3759 if (!pvNew) 3760 return error("???", "out of memory"); 3761 pOmfStuff->paSegLines = (POMFSEGLINES)pvNew; 3762 3763 memset(&pOmfStuff->paSegLines[pOmfStuff->cSegLines], 0, 3764 (idxSeg + 1 - pOmfStuff->cSegLines) * sizeof(pOmfStuff->paSegLines[0])); 3851 OMF_GROW_TABLE_EX_RET_ERR(OMFSEGLINES, pOmfStuff->paSegLines, pOmfStuff->cSegLines, idxSeg + 1); 3765 3852 for (uint32_t i = pOmfStuff->cSegLines; i <= idxSeg; i++) 3766 3853 { 3767 3854 pOmfStuff->paSegLines[i].idxSeg = i; 3855 pOmfStuff->paSegLines[i].idxGrp = UINT16_MAX; 3768 3856 pOmfStuff->paSegLines[i].cb = sizeof(RTCV8LINESHDR); 3769 3857 } … … 3786 3874 { 3787 3875 i = pSegLines->cFiles; 3788 if ((i % 4) == 0) 3789 { 3790 void *pvNew = realloc(pSegLines->paFiles, (i + 4) * sizeof(pSegLines->paFiles[0])); 3791 if (!pvNew) 3792 return error("???", "out of memory"); 3793 pSegLines->paFiles = (POMFFILEINES)pvNew; 3794 } 3795 3876 OMF_GROW_TABLE_RET_ERR(OMFFILEINES, pSegLines->paFiles, pSegLines->cFiles, 4); 3796 3877 pSegLines->cFiles = i + 1; 3797 3878 pSegLines->cb += sizeof(RTCV8LINESSRCMAP); … … 3802 3883 pFileLines->cPairsAlloc = 0; 3803 3884 pFileLines->paPairs = NULL; 3885 3886 /* 3887 * Check for segment group requirements the first time a segment is used. 3888 */ 3889 if (i == 0) 3890 { 3891 if (idxSeg >= pOmfStuff->cSegDefs) 3892 return error("???", "collectOmfAddLine: idxSeg=%#x is out of bounds (%#x)!\n", idxSeg, pOmfStuff->cSegDefs); 3893 POMFSEGDEF pSegDef = &pOmfStuff->paSegDefs[idxSeg]; 3894 if ( IS_OMF_STR_EQUAL_EX(pSegDef->cchClass, pSegDef->pchClass, "BS3CLASS16CODE") 3895 || IS_OMF_STR_EQUAL_EX(pSegDef->cchClass, pSegDef->pchClass, "CODE")) 3896 { 3897 pOmfStuff->fNeedsCGroup16 = true; 3898 pSegLines->idxGrp = 0; /* We'll replace zeros by the actual CGROUP16 index later. */ 3899 } 3900 } 3804 3901 } 3805 3902 … … 3852 3949 static bool collectOmfDetails(const char *pszFile, uint8_t const *pbFile, size_t cbFile, POMFDETAILS pOmfStuff) 3853 3950 { 3854 uint32_t cLNames = 0;3855 3951 uint32_t cExtDefs = 0; 3856 3952 uint32_t cPubDefs = 0; … … 3861 3957 3862 3958 memset(pOmfStuff, 0, sizeof(*pOmfStuff)); 3863 pOmfStuff->iDebSymNm = UINT16_MAX; 3864 pOmfStuff->iSymbolsNm = UINT16_MAX; 3865 pOmfStuff->iSymbolsSeg = UINT16_MAX; 3866 3959 pOmfStuff->iDebSymNm = UINT16_MAX; 3960 pOmfStuff->iSymbolsNm = UINT16_MAX; 3961 pOmfStuff->iSymbolsSeg = UINT16_MAX; 3962 pOmfStuff->iCGroup16Nm = UINT16_MAX; 3963 pOmfStuff->iCGroup16Grp = UINT16_MAX; 3964 3965 /* Dummy entries. */ 3966 OMF_GROW_TABLE_RET_ERR(char *, pOmfStuff->papchLNames, pOmfStuff->cLNames, 16); 3967 pOmfStuff->papchLNames[0] = (char *)""; 3968 pOmfStuff->cLNames = 1; 3969 3970 OMF_GROW_TABLE_RET_ERR(OMFSEGDEF, pOmfStuff->paSegDefs, pOmfStuff->cSegDefs, 16); 3971 pOmfStuff->cSegDefs = 1; 3972 3973 OMF_GROW_TABLE_RET_ERR(OMFGRPDEF, pOmfStuff->paGrpDefs, pOmfStuff->cGrpDefs, 16); 3974 pOmfStuff->cGrpDefs = 1; 3975 3976 /* 3977 * Process the OMF records. 3978 */ 3867 3979 while (off + 3 < cbFile) 3868 3980 { … … 3888 4000 } while (0) 3889 4001 4002 #define OMF_READ_U16(a_u16, a_Name) \ 4003 do { \ 4004 OMF_CHECK_RET(4, a_Name); \ 4005 a_u16 = RT_MAKE_U16(pbRec[offRec], pbRec[offRec + 1]); \ 4006 offRec += 2; \ 4007 } while (0) 4008 #define OMF_READ_U32(a_u32, a_Name) \ 4009 do { \ 4010 OMF_CHECK_RET(4, a_Name); \ 4011 a_u32 = RT_MAKE_U32_FROM_U8(pbRec[offRec], pbRec[offRec + 1], pbRec[offRec + 2], pbRec[offRec + 3]); \ 4012 offRec += 4; \ 4013 } while (0) 4014 #define OMF_EXPLODE_LNAME(a_idxName, a_pchName, a_cchName, a_Name) \ 4015 do { \ 4016 if ((a_idxName) < pOmfStuff->cLNames) \ 4017 { \ 4018 a_cchName = (uint8_t)*pOmfStuff->papchLNames[(a_idxName)]; \ 4019 a_pchName = pOmfStuff->papchLNames[(a_idxName)] + 1; \ 4020 } \ 4021 else return error(pszFile, "Invalid LNAME reference %#x in " #a_Name "!\n", a_idxName); \ 4022 } while (0) 4023 3890 4024 switch (bRecType) 3891 4025 { … … 3901 4035 off, offRec, cch, (unsigned long)cbFile); 3902 4036 3903 cLNames++;3904 4037 if (g_cVerbose > 2) 3905 printf(" LNAME[%u]: %-*.*s\n", cLNames, cch, cch, &pbRec[offRec + 1]); 3906 3907 if (cch == 4 && memcmp(&pbRec[offRec + 1], "FLAT", 4) == 0) 4038 printf(" LNAME[%u]: %-*.*s\n", pOmfStuff->cLNames, cch, cch, &pbRec[offRec + 1]); 4039 4040 OMF_GROW_TABLE_RET_ERR(char *, pOmfStuff->papchLNames, pOmfStuff->cLNames, 16); 4041 pOmfStuff->papchLNames[pOmfStuff->cLNames] = (char *)&pbRec[offRec]; 4042 4043 if (IS_OMF_STR_EQUAL_EX(cch, &pbRec[offRec + 1], "FLAT")) 3908 4044 pOmfStuff->fProbably32bit = true; 3909 4045 3910 if ( cch == 6 3911 && pOmfStuff->iDebSymNm == UINT16_MAX 3912 && memcmp(&pbRec[offRec + 1], "DEBSYM", 6) == 0) 3913 pOmfStuff->iDebSymNm = cLNames; 3914 if ( cch == 9 3915 && pOmfStuff->iSymbolsNm == UINT16_MAX 3916 && memcmp(&pbRec[offRec + 1], "$$SYMBOLS", 9) == 0) 3917 pOmfStuff->iSymbolsNm = cLNames; 3918 4046 if (IS_OMF_STR_EQUAL_EX(cch, &pbRec[offRec + 1], "DEBSYM")) 4047 pOmfStuff->iDebSymNm = pOmfStuff->cLNames; 4048 if (IS_OMF_STR_EQUAL_EX(cch, &pbRec[offRec + 1], "$$SYMBOLS")) 4049 pOmfStuff->iSymbolsNm = pOmfStuff->cLNames; 4050 if (IS_OMF_STR_EQUAL_EX(cch, &pbRec[offRec + 1], "CGROUP16")) 4051 pOmfStuff->iCGroup16Nm = pOmfStuff->cLNames; 4052 4053 pOmfStuff->cLNames++; 3919 4054 offRec += cch + 1; 3920 4055 } … … 3922 4057 3923 4058 /* 3924 * Display external defi tions if -v is specified, also check if anything needs mangling.4059 * Display external definitions if -v is specified, also check if anything needs mangling. 3925 4060 */ 3926 4061 case OMF_EXTDEF: … … 4024 4159 4025 4160 /* 4026 * Must count segment defi tions to figure the index of our segment.4161 * Must count segment definitions to figure the index of our segment. 4027 4162 */ 4028 4163 case OMF_SEGDEF16: 4029 4164 case OMF_SEGDEF32: 4030 pOmfStuff->cSegDefs++; 4165 { 4166 OMF_GROW_TABLE_RET_ERR(OMFSEGDEF, pOmfStuff->paSegDefs, pOmfStuff->cSegDefs, 16); 4167 POMFSEGDEF pSegDef = &pOmfStuff->paSegDefs[pOmfStuff->cSegDefs++]; 4168 4169 OMF_CHECK_RET(1 + (bRecType == OMF_SEGDEF16 ? 2 : 4) + 1 + 1 + 1, SEGDEF); 4170 pSegDef->bSegAttr = pbRec[offRec++]; 4171 pSegDef->fUse32 = pSegDef->bSegAttr & 1; 4172 if ((pSegDef->bSegAttr >> 5) == 0) 4173 { 4174 /* A=0: skip frame number of offset. */ 4175 OMF_CHECK_RET(3, SEGDEF); 4176 offRec += 3; 4177 } 4178 if (bRecType == OMF_SEGDEF16) 4179 OMF_READ_U16(pSegDef->cbSeg, SEGDEF16); 4180 else 4181 OMF_READ_U32(pSegDef->cbSeg, SEGDEF32); 4182 OMF_READ_IDX(pSegDef->idxName, SEGDEF); 4183 OMF_READ_IDX(pSegDef->idxClass, SEGDEF); 4184 OMF_READ_IDX(pSegDef->idxOverlay, SEGDEF); 4185 OMF_EXPLODE_LNAME(pSegDef->idxName, pSegDef->pchName, pSegDef->cchName, SEGDEF); 4186 OMF_EXPLODE_LNAME(pSegDef->idxClass, pSegDef->pchClass, pSegDef->cchClass, SEGDEF); 4187 OMF_EXPLODE_LNAME(pSegDef->idxOverlay, pSegDef->pchOverlay, pSegDef->cchOverlay, SEGDEF); 4031 4188 break; 4189 } 4190 4191 /* 4192 * Must count segment definitions to figure the index of our segment. 4193 */ 4194 case OMF_GRPDEF: 4195 { 4196 OMF_GROW_TABLE_RET_ERR(OMFGRPDEF, pOmfStuff->paGrpDefs, pOmfStuff->cGrpDefs, 8); 4197 POMFGRPDEF pGrpDef = &pOmfStuff->paGrpDefs[pOmfStuff->cGrpDefs]; 4198 4199 OMF_READ_IDX(pGrpDef->idxName, GRPDEF); 4200 OMF_EXPLODE_LNAME(pGrpDef->idxName, pGrpDef->pchName, pGrpDef->cchName, GRPDEF); 4201 if (pGrpDef->idxName == pOmfStuff->iCGroup16Grp) 4202 pOmfStuff->iCGroup16Grp = pOmfStuff->cGrpDefs; 4203 4204 pGrpDef->cSegDefs = 0; 4205 pGrpDef->pidxSegDefs = NULL; 4206 while (offRec + 2 + 1 < cbRec) 4207 { 4208 if (pbRec[offRec] != 0xff) 4209 return error(pszFile, "Unsupported GRPDEF member type: %#x\n", pbRec[offRec]); 4210 offRec++; 4211 OMF_GROW_TABLE_RET_ERR(uint16_t, pGrpDef->pidxSegDefs, pGrpDef->cSegDefs, 16); 4212 OMF_READ_IDX(pGrpDef->pidxSegDefs[pGrpDef->cSegDefs], GRPDEF); 4213 pGrpDef->cSegDefs++; 4214 } 4215 pOmfStuff->cGrpDefs++; 4216 break; 4217 } 4032 4218 4033 4219 /* … … 4149 4335 4150 4336 /* 4151 * Emit the segment defi tions.4152 */ 4153 pOmfStuff->iSymbolsSeg = ++pOmfStuff->cSegDefs;4337 * Emit the segment definitions. 4338 */ 4339 pOmfStuff->iSymbolsSeg = pOmfStuff->cSegDefs++; 4154 4340 4155 4341 uint8_t bSegAttr = 0; … … 4172 4358 4173 4359 /** 4360 * Writes additional segment group definitions. 4361 * 4362 * @returns success indicator. 4363 * @param pThis The OMF writer. 4364 * @param pOmfStuff The OMF stuff with CV8 line number info. 4365 */ 4366 static bool convertOmfWriteDebugGrpDefs(POMFWRITER pThis, POMFDETAILS pOmfStuff) 4367 { 4368 if ( pOmfStuff->cSegLines == 0 4369 || !pOmfStuff->fNeedsCGroup16) 4370 return true; 4371 4372 if (pOmfStuff->iCGroup16Grp == UINT16_MAX) 4373 { 4374 if (pOmfStuff->iCGroup16Nm == UINT16_MAX) 4375 if ( !omfWriter_LNamesBegin(pThis, true) 4376 || !omfWriter_LNamesAdd(pThis, "CGROUP16", &pOmfStuff->iCGroup16Nm) 4377 || !omfWriter_LNamesEnd(pThis)) 4378 return false; 4379 4380 if ( !omfWriter_GrpDefBegin(pThis, pOmfStuff->iCGroup16Nm) 4381 || !omfWriter_GrpDefEnd(pThis)) 4382 return false; 4383 pOmfStuff->iCGroup16Grp = pOmfStuff->cGrpDefs; 4384 } 4385 4386 for (unsigned i = 0; i < pOmfStuff->cSegLines; i++) 4387 if (pOmfStuff->paSegLines[i].idxGrp == 0) 4388 pOmfStuff->paSegLines[i].idxGrp = pOmfStuff->iCGroup16Grp; 4389 return true; 4390 } 4391 4392 4393 /** 4174 4394 * Writes the debug segment data. 4175 4395 * … … 4237 4457 return false; 4238 4458 4459 /* Default to the segment (BS3TEXT32, BS3TEXT64) or the group (CGROUP16, 4460 RMGROUP16, etc). The important thing is that we're framing the fixups 4461 using a segment or group which ends up in the codeview segment map. */ 4462 uint16_t idxFrame = pSegLines->idxSeg; 4463 uint8_t bFrame = OMF_FIX_F_SEGDEF; 4464 if (pSegLines->idxGrp != UINT16_MAX) 4465 { 4466 idxFrame = pSegLines->idxGrp; 4467 bFrame = OMF_FIX_F_GRPDEF; 4468 } 4469 4239 4470 /* Fixup #1: segment offset - IMAGE_REL_AMD64_SECREL. */ 4240 4471 if (!omfWriter_LEDataAddFixupNoDisp(pThis, 4 + 4 + RT_OFFSETOF(RTCV8LINESHDR, offSection), OMF_FIX_LOC_32BIT_OFFSET, 4241 OMF_FIX_F_SEGDEF, pSegLines->idxSeg, 4242 OMF_FIX_T_SEGDEF_NO_DISP, pSegLines->idxSeg)) 4472 bFrame, idxFrame, OMF_FIX_T_SEGDEF_NO_DISP, pSegLines->idxSeg)) 4243 4473 return false; 4244 4474 … … 4246 4476 /* Fixup #2: segment number - IMAGE_REL_AMD64_SECTION. */ 4247 4477 if (!omfWriter_LEDataAddFixupNoDisp(pThis, 4 + 4 + RT_OFFSETOF(RTCV8LINESHDR, iSection), OMF_FIX_LOC_16BIT_SEGMENT, 4248 OMF_FIX_F_SEGDEF, pSegLines->idxSeg, 4249 OMF_FIX_T_SEGDEF_NO_DISP, pSegLines->idxSeg)) 4478 bFrame, idxFrame, OMF_FIX_T_SEGDEF_NO_DISP, pSegLines->idxSeg)) 4250 4479 return false; 4251 4480 … … 4387 4616 fSkip = pbRec[1] == OMF_CCLS_BORLAND_SRC_FILE; 4388 4617 if (pbRec[1] == OMF_CCLS_LINK_PASS_SEP) 4389 if (!convertOmfWriteDebugSegDefs(pThis, pOmfStuff)) 4618 if ( !convertOmfWriteDebugSegDefs(pThis, pOmfStuff) 4619 || !convertOmfWriteDebugGrpDefs(pThis, pOmfStuff)) 4390 4620 return false; 4391 4621 } … … 4420 4650 { 4421 4651 if ( convertOmfWriteDebugSegDefs(pThis, pOmfStuff) 4652 && convertOmfWriteDebugGrpDefs(pThis, pOmfStuff) 4422 4653 && convertOmfWriteDebugData(pThis, pOmfStuff)) 4423 4654 { /* likely */ } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/asmdefs-first.mac
r58750 r60527 34 34 %include "bs3kit-template-header.mac" 35 35 36 ; 36 37 ; Redefine some macros to suite us. 38 ; 39 ; We do near 16-bit code and produce far stubs separately as needed. 40 ; 37 41 %define BEGINCODE TMPL_BEGIN_TEXT 38 %define BEGINPROC_EXPORTED BS3_ PROC_BEGIN_CMN42 %define BEGINPROC_EXPORTED BS3_BEGINPROC_EXPORTED_WRAPPER 39 43 %define ENDPROC BS3_PROC_END_CMN 40 44 %undef NAME 41 45 %define NAME(a) BS3_CMN_NM(a) 42 46 47 %macro BS3_BEGINPROC_EXPORTED_WRAPPER 1 48 BS3_PROC_BEGIN_CMN %1, BS3_PBC_NEAR 49 %endmacro 50 43 51 %endif 44 52 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-A20Disable.asm
r59287 r60527 5 5 6 6 ; 7 ; Copyright (C) 2007-201 5Oracle Corporation7 ; Copyright (C) 2007-2016 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 38 38 ; @uses Nothing. 39 39 ; 40 BS3_PROC_BEGIN_CMN Bs3A20Disable 40 BS3_PROC_BEGIN_CMN Bs3A20Disable, BS3_PBC_HYBRID_0_ARGS 41 41 ; Must call both because they may be ORed together on real HW. 42 42 BS3_ONLY_64BIT_STMT sub rsp, 20h … … 44 44 call BS3_CMN_NM(Bs3A20DisableViaPortA) 45 45 BS3_ONLY_64BIT_STMT add rsp, 20h 46 ret46 BS3_HYBRID_RET 47 47 BS3_PROC_END_CMN Bs3A20Disable 48 48 … … 53 53 ; @uses Nothing. 54 54 ; 55 BS3_PROC_BEGIN_CMN Bs3A20DisableViaPortA 55 BS3_PROC_BEGIN_CMN Bs3A20DisableViaPortA, BS3_PBC_HYBRID_0_ARGS 56 56 push xAX 57 57 … … 65 65 .done: 66 66 pop xAX 67 ret67 BS3_HYBRID_RET 68 68 BS3_PROC_END_CMN Bs3A20DisableViaPortA 69 69 … … 74 74 ; @uses Nothing. 75 75 ; 76 BS3_PROC_BEGIN_CMN Bs3A20DisableViaKbd 76 BS3_PROC_BEGIN_CMN Bs3A20DisableViaKbd, BS3_PBC_HYBRID_0_ARGS 77 77 push xBP 78 78 mov xBP, xSP … … 100 100 popf 101 101 pop xAX 102 leave103 ret102 pop xBP 103 BS3_HYBRID_RET 104 104 BS3_PROC_END_CMN Bs3A20DisableViaKbd 105 105 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-A20Enable.asm
r59287 r60527 38 38 ; @uses Nothing. 39 39 ; 40 BS3_PROC_BEGIN_CMN Bs3A20Enable 40 BS3_PROC_BEGIN_CMN Bs3A20Enable, BS3_PBC_HYBRID_0_ARGS 41 41 push xBP 42 42 mov xBP, xSP … … 47 47 ; call TMPL_NM_CMN(Bs3A20EnableViaKbd) 48 48 49 leave50 ret49 pop xBP 50 BS3_HYBRID_RET 51 51 BS3_PROC_END_CMN Bs3A20Enable 52 52 … … 57 57 ; @uses Nothing. 58 58 ; 59 BS3_PROC_BEGIN_CMN Bs3A20EnableViaKbd 59 BS3_PROC_BEGIN_CMN Bs3A20EnableViaKbd, BS3_PBC_HYBRID_0_ARGS 60 60 push xBP 61 61 mov xBP, xSP … … 83 83 popf 84 84 pop xAX 85 leave86 ret85 pop xBP 86 BS3_HYBRID_RET 87 87 BS3_PROC_END_CMN Bs3A20EnableViaKbd 88 88 … … 93 93 ; @uses Nothing. 94 94 ; 95 BS3_PROC_BEGIN_CMN Bs3A20EnableViaPortA 95 BS3_PROC_BEGIN_CMN Bs3A20EnableViaPortA, BS3_PBC_HYBRID_0_ARGS 96 96 push xBP 97 97 mov xBP, xSP … … 107 107 .done: 108 108 pop xAX 109 leave110 ret109 pop xBP 110 BS3_HYBRID_RET 111 111 BS3_PROC_END_CMN Bs3A20EnableViaPortA 112 112 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ConvertRMStackToP16UsingCxReturnToAx.asm
r59242 r60527 43 43 ; @uses cx, ss, esp 44 44 ; 45 BS3_PROC_BEGIN_CMN Bs3ConvertRMStackToP16UsingCxReturnToAx 45 BS3_PROC_BEGIN_CMN Bs3ConvertRMStackToP16UsingCxReturnToAx, BS3_PBC_NEAR 46 46 47 47 ; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-KbdRead.asm
r59239 r60527 40 40 ; @cproto BS3_DECL(uint8_t) Bs3KbdRead_c16(uint8_t bCmd); 41 41 ; 42 BS3_PROC_BEGIN_CMN Bs3KbdRead 42 BS3_PROC_BEGIN_CMN Bs3KbdRead, BS3_PBC_NEAR 43 43 push xBP 44 44 mov xBP, xSP … … 54 54 in al, 60h ; Read the data. 55 55 56 leave57 ret56 pop xBP 57 BS3_HYBRID_RET 58 58 BS3_PROC_END_CMN Bs3KbdRead 59 59 60 ; 61 ; We may be using the near code in some critical code paths, so don't 62 ; penalize it. 63 ; 64 BS3_CMN_FAR_STUB Bs3KbdRead, 2 65 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-KbdWait.asm
r59239 r60527 32 32 ; @cproto BS3_DECL(void) Bs3KbdWait_c16(void); 33 33 ; 34 BS3_PROC_BEGIN_CMN Bs3KbdWait 34 BS3_PROC_BEGIN_CMN Bs3KbdWait, BS3_PBC_HYBRID_0_ARGS 35 35 push xBP 36 36 mov xBP, xSP … … 45 45 46 46 pop xAX 47 leave48 ret47 pop xBP 48 BS3_HYBRID_RET 49 49 50 50 .read_data_and_status: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-KbdWrite.asm
r59287 r60527 45 45 ; @cproto BS3_DECL(void) Bs3KbdWait_c16(uint8_t bCmd, uint8_t bData); 46 46 ; 47 BS3_PROC_BEGIN_CMN Bs3KbdWrite 47 BS3_PROC_BEGIN_CMN Bs3KbdWrite, BS3_PBC_NEAR 48 48 push xBP 49 49 mov xBP, xSP … … 61 61 BS3_ONLY_64BIT_STMT add rsp, 20h 62 62 pop xAX 63 leave64 ret63 pop xBP 64 BS3_HYBRID_RET 65 65 BS3_PROC_END_CMN Bs3KbdWrite 66 66 67 ; 68 ; We may be using the near code in some critical code paths, so don't 69 ; penalize it. 70 ; 71 BS3_CMN_FAR_STUB Bs3KbdWrite, 4 72 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemAlloc.c
r60311 r60527 33 33 34 34 35 BS3_DECL(void BS3_FAR *) Bs3MemAlloc(BS3MEMKIND enmKind, size_t cb) 35 #undef Bs3MemAlloc 36 BS3_CMN_DEF(void BS3_FAR *, Bs3MemAlloc,(BS3MEMKIND enmKind, size_t cb)) 36 37 { 37 38 void BS3_FAR *pvRet; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemAllocZ.c
r59286 r60527 32 32 33 33 34 BS3_DECL(void BS3_FAR *) Bs3MemAllocZ(BS3MEMKIND enmKind, size_t cb) 34 #undef Bs3MemAllocZ 35 BS3_CMN_DEF(void BS3_FAR *, Bs3MemAllocZ,(BS3MEMKIND enmKind, size_t cb)) 35 36 { 36 37 void BS3_FAR *pvRet = Bs3MemAlloc(enmKind, cb); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemCpy.c
r60088 r60527 28 28 29 29 #undef Bs3MemCpy 30 BS3_ DECL(void BS3_FAR *) BS3_CMN_NM(Bs3MemCpy)(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)30 BS3_CMN_DEF(void BS3_FAR *, Bs3MemCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)) 31 31 { 32 32 #if 1 … … 74 74 } 75 75 76 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemFree.c
r60311 r60527 32 32 33 33 34 BS3_DECL(void) Bs3MemFree(void BS3_FAR *pv, size_t cb) 34 #undef Bs3MemFree 35 BS3_CMN_DEF(void, Bs3MemFree,(void BS3_FAR *pv, size_t cb)) 35 36 { 36 37 if (pv != NULL) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemMove.c
r58667 r60527 28 28 29 29 #undef Bs3MemMove 30 BS3_ DECL(void BS3_FAR *) BS3_CMN_NM(Bs3MemMove)(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)30 BS3_CMN_DEF(void BS3_FAR *, Bs3MemMove,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)) 31 31 { 32 32 size_t cLargeRounds; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemPCpy.c
r58667 r60527 28 28 29 29 #undef Bs3MemPCpy 30 BS3_ DECL(void BS3_FAR *) BS3_CMN_NM(Bs3MemPCpy)(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)30 BS3_CMN_DEF(void BS3_FAR *, Bs3MemPCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy)) 31 31 { 32 32 size_t cLargeRounds; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemZero.asm
r60366 r60527 30 30 ; @cproto BS3_DECL(void) Bs3MemZero_c16(void BS3_FAR *pvDst, size_t cbDst); 31 31 ; 32 BS3_PROC_BEGIN_CMN Bs3MemZero 32 BS3_PROC_BEGIN_CMN Bs3MemZero, BS3_PBC_HYBRID 33 33 %ifdef RT_ARCH_AMD64 34 34 push rdi … … 46 46 47 47 pop rdi 48 ret48 BS3_HYBRID_RET 49 49 50 50 %elif ARCH_BITS == 16 … … 54 54 push es 55 55 56 mov di, [bp + 4]; pvDst.off57 mov dx, [bp + 4 + 2]; pvDst.sel56 mov di, [bp + 2 + cbCurRetAddr] ; pvDst.off 57 mov dx, [bp + 2 + cbCurRetAddr + 2] ; pvDst.sel 58 58 mov es, dx 59 mov cx, [bp + 4 + 4]; cbDst60 shr cx, 1 ; calc dword count.59 mov cx, [bp + 2 + cbCurRetAddr + 4] ; cbDst 60 shr cx, 1 ; calc dword count. 61 61 xor ax, ax 62 62 rep stosw 63 63 64 mov cx, [bp + 4 + 4]; cbDst65 and cx, 1 ; calc tailing byte count.64 mov cx, [bp + 2 + cbCurRetAddr + 4] ; cbDst 65 and cx, 1 ; calc tailing byte count. 66 66 rep stosb 67 67 … … 69 69 pop di 70 70 pop bp 71 ret71 BS3_HYBRID_RET 72 72 73 73 %elif ARCH_BITS == 32 … … 85 85 86 86 pop edi 87 ret87 BS3_HYBRID_RET 88 88 89 89 %else -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingInitRootForLM.c
r60311 r60527 32 32 33 33 34 BS3_DECL(int) Bs3PagingInitRootForLM(void) 34 #undef Bs3PagingInitRootForLM 35 BS3_CMN_DEF(int, Bs3PagingInitRootForLM,(void)) 35 36 { 36 37 X86PML4 BS3_FAR *pPml4; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingInitRootForPAE.c
r60311 r60527 32 32 33 33 34 BS3_DECL(int) Bs3PagingInitRootForPAE(void) 34 #undef Bs3PagingInitRootForPAE 35 BS3_CMN_DEF(int, Bs3PagingInitRootForPAE,(void)) 35 36 { 36 37 X86PDPT BS3_FAR *pPdPtr; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingInitRootForPP.c
r60321 r60527 68 68 69 69 70 BS3_DECL(int) Bs3PagingInitRootForPP(void) 70 #undef Bs3PagingInitRootForPP 71 BS3_CMN_DEF(int, Bs3PagingInitRootForPP,(void)) 71 72 { 72 73 X86PD BS3_FAR *pPgDir; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingProtect.c
r60321 r60527 59 59 60 60 61 BS3_DECL(X86PTE BS3_FAR *) bs3PagingGetLegacyPte(RTCCUINTXREG cr3, uint32_t uFlat, bool fUseInvlPg, int *prc) 61 #undef bs3PagingGetLegacyPte 62 BS3_CMN_DEF(X86PTE BS3_FAR *, bs3PagingGetLegacyPte,(RTCCUINTXREG cr3, uint32_t uFlat, bool fUseInvlPg, int *prc)) 62 63 { 63 64 X86PTE BS3_FAR *pPTE = NULL; … … 120 121 121 122 122 BS3_DECL(X86PTEPAE BS3_FAR *) bs3PagingGetPte(RTCCUINTXREG cr3, uint64_t uFlat, bool fUseInvlPg, int *prc) 123 #undef bs3PagingGetPte 124 BS3_CMN_DEF(X86PTEPAE BS3_FAR *, bs3PagingGetPte,(RTCCUINTXREG cr3, uint64_t uFlat, bool fUseInvlPg, int *prc)) 123 125 { 124 126 X86PTEPAE BS3_FAR *pPTE = NULL; … … 212 214 213 215 214 BS3_DECL(int) Bs3PagingProtect(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear) 216 #undef Bs3PagingProtect 217 BS3_CMN_DEF(int, Bs3PagingProtect,(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear)) 215 218 { 216 219 RTCCUINTXREG const cr3 = ASMGetCR3(); … … 242 245 while ((uint32_t)cb > 0) 243 246 { 244 PX86PTE pPte = bs3PagingGetLegacyPte(cr3, (uint32_t)uFlat, fUseInvlPg, &rc);247 PX86PTE pPte = BS3_CMN_NM(bs3PagingGetLegacyPte)(cr3, (uint32_t)uFlat, fUseInvlPg, &rc); 245 248 if (!pPte) 246 249 return rc; … … 267 270 while (cb > 0) 268 271 { 269 PX86PTEPAE pPte = bs3PagingGetPte(cr3, uFlat, fUseInvlPg, &rc);272 PX86PTEPAE pPte = BS3_CMN_NM(bs3PagingGetPte)(cr3, uFlat, fUseInvlPg, &rc); 270 273 if (!pPte) 271 274 return rc; … … 298 301 299 302 300 BS3_DECL(int) Bs3PagingProtectPtr(void *pv, size_t cb, uint64_t fSet, uint64_t fClear) 303 #undef Bs3PagingProtectPtr 304 BS3_CMN_DEF(int, Bs3PagingProtectPtr,(void *pv, size_t cb, uint64_t fSet, uint64_t fClear)) 301 305 { 302 306 #if ARCH_BITS == 16 303 return B s3PagingProtect(Bs3SelPtrToFlat(pv), cb, fSet, fClear);307 return BS3_CMN_NM(Bs3PagingProtect)(Bs3SelPtrToFlat(pv), cb, fSet, fClear); 304 308 #else 305 return B s3PagingProtect((uintptr_t)pv, cb, fSet, fClear);309 return BS3_CMN_NM(Bs3PagingProtect)((uintptr_t)pv, cb, fSet, fClear); 306 310 #endif 307 311 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Panic.asm
r59244 r60527 28 28 29 29 30 BS3_PROC_BEGIN_CMN Bs3Panic 30 BS3_PROC_BEGIN_CMN Bs3Panic, BS3_PBC_HYBRID_0_ARGS 31 31 push xBP 32 32 mov xBP, xSP -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PicMaskAll.c
r60302 r60527 33 33 34 34 35 BS3_DECL(void) Bs3PicMaskAll(void) 35 #undef Bs3PicMaskAll 36 BS3_CMN_DEF(void, Bs3PicMaskAll,(void)) 36 37 { 37 38 ASMOutU8(0xa1, 0xff); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PrintChr.asm
r60218 r60527 46 46 ; @cproto BS3_DECL(void) Bs3PrintChr_c16(char ch); 47 47 ; 48 BS3_PROC_BEGIN_CMN Bs3PrintChr 48 BS3_PROC_BEGIN_CMN Bs3PrintChr, BS3_PBC_NEAR 49 49 BS3_CALL_CONV_PROLOG 1 50 50 push xBP … … 87 87 mov cl, [xBP + xCB*2] ; Load the char 88 88 mov ax, BS3_SYSCALL_PRINT_CHR 89 call Bs3Syscall ; (no BS3_CALL!)89 call Bs3Syscall ; near! no BS3_CALL! 90 90 91 91 .return: … … 93 93 pop xCX 94 94 pop xAX 95 leave95 pop xBP 96 96 BS3_CALL_CONV_EPILOG 1 97 97 ret 98 98 BS3_PROC_END_CMN Bs3PrintChr 99 99 100 ; 101 ; Generate 16-bit far stub. 102 ; Peformance critical, so don't penalize near calls. 103 ; 104 BS3_CMN_FAR_STUB Bs3PrintChr, 2 105 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PrintStr.c
r60291 r60527 27 27 #include "bs3kit-template-header.h" 28 28 29 BS3_DECL(void) Bs3PrintStr(const char BS3_FAR *pszString) 29 #undef Bs3PrintStr 30 BS3_CMN_DEF(void, Bs3PrintStr,(const char BS3_FAR *pszString)) 30 31 { 31 32 Bs3PrintStrN(pszString, Bs3StrLen(pszString)); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PrintStrN.asm
r60439 r60527 48 48 ; ASSUMES cchString < 64KB! 49 49 ; 50 BS3_PROC_BEGIN_CMN Bs3PrintStrN 50 BS3_PROC_BEGIN_CMN Bs3PrintStrN, BS3_PBC_NEAR 51 51 BS3_CALL_CONV_PROLOG 2 52 52 push xBP … … 74 74 .do_bios_call: 75 75 push ds 76 lds si, [xBP + xCB *2]; DS:SI -> string.76 lds si, [xBP + xCB + cbCurRetAddr] ; DS:SI -> string. 77 77 cld 78 mov cx, [xBP + xCB *2 + sCB]; Use CX for counting down.78 mov cx, [xBP + xCB + cbCurRetAddr + sCB] ; Use CX for counting down. 79 79 call Bs3PrintStrN_c16_CX_Bytes_At_DS_SI 80 80 pop ds … … 92 92 .do_system_call: 93 93 %if TMPL_BITS == 16 94 mov cx, [xBP + xCB *2+ 2]94 mov cx, [xBP + xCB + cbCurRetAddr + 2] 95 95 %else 96 96 mov cx, ds 97 97 %endif 98 mov xSI, [xBP + xCB *2]99 mov dx, [xBP + xCB*2+ sCB]98 mov xSI, [xBP + xCB + cbCurRetAddr] 99 mov dx, [xBP + xCB + cbCurRetAddr + sCB] 100 100 %if TMPL_BITS == 16 101 101 … … 105 105 %endif 106 106 mov ax, BS3_SYSCALL_PRINT_STR 107 call Bs3Syscall ; (no BS3_CALL!)107 call Bs3Syscall ; near! no BS3_CALL! 108 108 109 109 .return: … … 112 112 pop xCX 113 113 pop xAX 114 leave114 pop xBP 115 115 BS3_CALL_CONV_EPILOG 2 116 ret116 BS3_HYBRID_RET 117 117 118 118 ; … … 130 130 mov ax, BS3_SYSCALL_PRINT_CHR 131 131 mov cl, [BS3_ONLY_16BIT(es:) xSI] 132 call Bs3Syscall ; (no BS3_CALL!)132 call Bs3Syscall ; near! no BS3_CALL! 133 133 inc xSI 134 134 dec xDX … … 183 183 jmp .bios_loop_int10h 184 184 BS3_PROC_END Bs3PrintStrN_c16_CX_Bytes_At_DS_SI 185 186 187 ; 188 ; Generate 16-bit far stub. 189 ; Peformance critical, so don't penalize near calls. 190 ; 191 BS3_CMN_FAR_STUB Bs3PrintStrN, 6 192 185 193 %endif 186 194 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PrintU32.asm
r59287 r60527 35 35 ; @param [xBP + xCB*2] 32-bit value to format and print. 36 36 ; 37 BS3_PROC_BEGIN_CMN Bs3PrintU32 37 BS3_PROC_BEGIN_CMN Bs3PrintU32, BS3_PBC_HYBRID 38 38 BS3_CALL_CONV_PROLOG 1 39 39 push xBP … … 45 45 BS3_ONLY_16BIT_STMT push ds 46 46 47 mov eax, [xBP + xCB *2]47 mov eax, [xBP + xCB + cbCurRetAddr] 48 48 49 49 ; Allocate a stack buffer and terminate it. ds:bx points ot the end. … … 79 79 leave 80 80 BS3_CALL_CONV_EPILOG 1 81 ret81 BS3_HYBRID_RET 82 82 BS3_PROC_END_CMN Bs3PrintU32 83 83 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PrintX32.asm
r59287 r60527 35 35 ; @param [xBP + xCB*2] 32-bit value to format and print. 36 36 ; 37 BS3_PROC_BEGIN_CMN Bs3PrintX32 37 BS3_PROC_BEGIN_CMN Bs3PrintX32, BS3_PBC_HYBRID 38 38 BS3_CALL_CONV_PROLOG 1 39 39 push xBP … … 45 45 BS3_ONLY_16BIT_STMT push ds 46 46 47 mov eax, [xBP + xCB *2]47 mov eax, [xBP + xCB + cbCurRetAddr] 48 48 49 49 ; Allocate a stack buffer and terminate it. ds:bx points ot the end. … … 83 83 leave 84 84 BS3_CALL_CONV_EPILOG 1 85 ret85 BS3_HYBRID_RET 86 86 BS3_PROC_END_CMN Bs3PrintX32 87 87 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Printf.c
r60291 r60527 64 64 65 65 66 BS3_DECL(size_t) Bs3PrintfV(const char BS3_FAR *pszFormat, va_list va) 66 #undef Bs3PrintfV 67 BS3_CMN_DEF(size_t, Bs3PrintfV,(const char BS3_FAR *pszFormat, va_list va)) 67 68 { 68 69 BS3PRINTBUF Buf; … … 72 73 73 74 74 BS3_DECL(size_t) Bs3Printf(const char BS3_FAR *pszFormat, ...) 75 #undef Bs3Printf 76 BS3_CMN_DEF(size_t, Bs3Printf,(const char BS3_FAR *pszFormat, ...)) 75 77 { 76 78 size_t cchRet; 77 79 va_list va; 78 80 va_start(va, pszFormat); 79 cchRet = B s3PrintfV(pszFormat, va);81 cchRet = BS3_CMN_NM(Bs3PrintfV)(pszFormat, va); 80 82 va_end(va); 81 83 return cchRet; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxConvertToRingX.c
r60311 r60527 139 139 * @param bRing The target ring (0..3). 140 140 */ 141 BS3_DECL(void) Bs3RegCtxConvertToRingX(PBS3REGCTX pRegCtx, uint8_t bRing) 141 #undef Bs3RegCtxConvertToRingX 142 BS3_CMN_DEF(void, Bs3RegCtxConvertToRingX,(PBS3REGCTX pRegCtx, uint8_t bRing)) 142 143 { 143 144 if ( (pRegCtx->rflags.u32 & X86_EFL_VM) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxPrint.c
r60216 r60527 31 31 32 32 33 BS3_DECL(void) Bs3RegCtxPrint(PCBS3REGCTX pRegCtx) 33 #undef Bs3RegCtxPrint 34 BS3_CMN_DEF(void, Bs3RegCtxPrint,(PCBS3REGCTX pRegCtx)) 34 35 { 35 36 //if (BS3_MODE_IS_64BIT_CODE(pRegCtx->bMode)) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxRestore.asm
r60439 r60527 47 47 ; @note Only respects the BS3_MODE_CODE_MASK part of pRegCtx->bMode. 48 48 ; 49 %if TMPL_BITS == 16 || TMPL_BITS == 3250 BS3_PROC_BEGIN_CMN Bs3RegCtxRestore_aborts ; special entry point for when watcom applies __aborts51 %if TMPL_BITS == 16 49 %if TMPL_BITS == 16 50 BS3_PROC_BEGIN_CMN Bs3RegCtxRestore_aborts, BS3_PBC_FAR ; special entry point for when watcom applies __aborts 51 BS3_PROC_BEGIN_CMN Bs3RegCtxRestore_aborts, BS3_PBC_NEAR ; special entry point for when watcom applies __aborts 52 52 CPU 8086 53 53 xor xAX, xAX 54 54 push xAX ; fake return address. 55 %else 55 push xAX 56 jmp _Bs3RegCtxRestore_f16 57 %elif TMPL_BITS == 32 58 BS3_PROC_BEGIN_CMN Bs3RegCtxRestore_aborts, BS3_PBC_NEAR ; special entry point for when watcom applies __aborts 56 59 push 0feedfaceh ; fake return address. 57 %endif 58 %endif 59 BS3_PROC_BEGIN_CMN Bs3RegCtxRestore 60 %endif 61 BS3_PROC_BEGIN_CMN Bs3RegCtxRestore, BS3_PBC_HYBRID 60 62 BS3_CALL_CONV_PROLOG 2 61 63 push xBP … … 71 73 jz .in_ring0 72 74 %if TMPL_BITS == 16 73 mov si, [bp + 4]74 mov cx, [bp + 4+2]75 mov dx, [bp + 8]75 mov si, [bp + xCB + cbCurRetAddr] 76 mov cx, [bp + xCB + cbCurRetAddr + 2] 77 mov dx, [bp + xCB + cbCurRetAddr + sCB] 76 78 mov ax, BS3_SYSCALL_RESTORE_CTX 77 79 %else … … 91 93 mov ax, BS3_SEL_DATA16 92 94 mov es, ax 93 lds bx, [bp + 4]94 mov cx, [bp + 8]95 lds bx, [bp + xCB + cbCurRetAddr] 96 mov cx, [bp + xCB + cbCurRetAddr + sCB] 95 97 %elif TMPL_BITS == 32 96 98 mov ax, BS3_SEL_R0_DS32 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxSave.asm
r60439 r60527 38 38 39 39 ;; 40 ; Restores the givenregister context.40 ; Saves the current register context. 41 41 ; 42 42 ; @param pRegCtx 43 43 ; @uses None. 44 44 ; 45 BS3_PROC_BEGIN_CMN Bs3RegCtxSave 45 BS3_PROC_BEGIN_CMN Bs3RegCtxSave, BS3_PBC_HYBRID_SAFE 46 46 TMPL_ONLY_16BIT_STMT CPU 8086 47 47 BS3_CALL_CONV_PROLOG 1 … … 56 56 57 57 ; 58 ; Prologue. Load ES:xDI with pRegCtx.59 ; (ASSUMES ds is BS3KIT_GRPNM_DATA16/FLAT of course.)60 ;61 %if TMPL_BITS == 1662 les di, [bp + 4]63 %else64 mov xDI, [xBP + xCB*2]65 %endif66 67 ;68 58 ; Clear the whole structure first. 69 59 ; … … 72 62 AssertCompileSizeAlignment(BS3REGCTX, 4) 73 63 %if TMPL_BITS == 16 74 les xDI, [xBP + xCB *2]64 les xDI, [xBP + xCB + cbCurRetAddr] 75 65 mov xCX, BS3REGCTX_size / 2 76 66 rep stosw 77 67 %else 78 mov xDI, [xBP + xCB *2]68 mov xDI, [xBP + xCB + cbCurRetAddr] 79 69 mov xCX, BS3REGCTX_size / 4 80 70 rep stosd 81 71 %endif 82 mov xDI, [xBP + xCB *2]72 mov xDI, [xBP + xCB + cbCurRetAddr] 83 73 84 74 ; … … 201 191 .common_80286: 202 192 TMPL_ONLY_16BIT_STMT CPU 286 193 cmp cl, BS3_MODE_RM 194 je .common_ancient 203 195 str [xDI + BS3REGCTX.tr] 204 196 sldt [xDI + BS3REGCTX.ldtr] … … 219 211 mov xAX, [xBP + xCB] 220 212 mov [xDI + BS3REGCTX.rip], xAX 221 lea xAX, [xBP + xCB *2]213 lea xAX, [xBP + xCB + cbCurRetAddr] 222 214 mov [xDI + BS3REGCTX.rsp], xAX 223 215 224 mov [xDI + BS3REGCTX.cs], cs 225 %if TMPL_BITS == 16 216 %if TMPL_BITS == 16 217 mov ax, [xBP + xCB + 2] 218 mov [xDI + BS3REGCTX.cs], ax 226 219 mov ax, [xBP - xCB*6] 227 220 mov [xDI + BS3REGCTX.ds], ax … … 229 222 mov [xDI + BS3REGCTX.es], ax 230 223 %else 224 mov [xDI + BS3REGCTX.cs], cs 231 225 mov [xDI + BS3REGCTX.ds], ds 232 226 mov [xDI + BS3REGCTX.es], es … … 245 239 xPOPF 246 240 pop xBP 247 ret241 BS3_HYBRID_RET 248 242 BS3_PROC_END_CMN Bs3RegCtxSave 249 243 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SelFar32ToFlat32.c
r60311 r60527 28 28 29 29 30 BS3_DECL(uint32_t) Bs3SelFar32ToFlat32(uint32_t off, uint16_t uSel) 30 #undef Bs3SelFar32ToFlat32 31 BS3_CMN_DEF(uint32_t, Bs3SelFar32ToFlat32,(uint32_t off, uint16_t uSel)) 31 32 { 32 33 if (g_bBs3CurrentMode == BS3_MODE_RM) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SelProtFar32ToFlat32.c
r60311 r60527 28 28 29 29 30 BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32(uint32_t off, uint16_t uSel) 30 #undef Bs3SelProtFar32ToFlat32 31 BS3_CMN_DEF(uint32_t, Bs3SelProtFar32ToFlat32,(uint32_t off, uint16_t uSel)) 31 32 { 32 33 uint32_t uRet; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Shutdown.asm
r58628 r60527 29 29 BS3_EXTERN_CMN Bs3Panic 30 30 31 BS3_PROC_BEGIN_CMN Bs3Shutdown 31 BS3_PROC_BEGIN_CMN Bs3Shutdown, BS3_PBC_HYBRID_0_ARGS 32 32 cli 33 33 mov bl, 64 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabAlloc.c
r59286 r60527 32 32 33 33 34 BS3_DECL(void BS3_FAR *) Bs3SlabAlloc(PBS3SLABCTL pSlabCtl) 34 #undef Bs3SlabAlloc 35 BS3_CMN_DEF(void BS3_FAR *, Bs3SlabAlloc,(PBS3SLABCTL pSlabCtl)) 35 36 { 36 37 if (pSlabCtl->cFreeChunks) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabAllocEx.c
r59941 r60527 32 32 33 33 34 BS3_DECL(void BS3_FAR *) Bs3SlabAllocEx(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags) 34 #undef Bs3SlabAllocEx 35 BS3_CMN_DEF(void BS3_FAR *, Bs3SlabAllocEx,(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags)) 35 36 { 36 37 BS3_ASSERT(cChunks > 0); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabFree.c
r59286 r60527 32 32 33 33 34 BS3_DECL(uint16_t) Bs3SlabFree(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks) 34 #undef Bs3SlabFree 35 BS3_CMN_DEF(uint16_t, Bs3SlabFree,(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks)) 35 36 { 36 37 uint16_t cFreed = 0; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabInit.c
r59286 r60527 32 32 33 33 34 BS3_DECL(void) Bs3SlabInit(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, uint32_t cbSlab, uint16_t cbChunk) 34 #undef Bs3SlabInit 35 BS3_CMN_DEF(void, Bs3SlabInit,(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, uint32_t cbSlab, uint16_t cbChunk)) 35 36 { 36 37 uint16_t cBits; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListAdd.c
r58789 r60527 28 28 29 29 30 BS3_DECL(void) Bs3SlabListAdd(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl) 30 #undef Bs3SlabListAdd 31 BS3_CMN_DEF(void, Bs3SlabListAdd,(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl)) 31 32 { 32 33 BS3_ASSERT(pHead->cbChunk == pSlabCtl->cbChunk); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListAlloc.c
r59286 r60527 31 31 32 32 33 BS3_DECL(void BS3_FAR *) Bs3SlabListAlloc(PBS3SLABHEAD pHead) 33 #undef Bs3SlabListAlloc 34 BS3_CMN_DEF(void BS3_FAR *, Bs3SlabListAlloc,(PBS3SLABHEAD pHead)) 34 35 { 35 36 if (pHead->cFreeChunks) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListAllocEx.c
r59286 r60527 31 31 32 32 33 BS3_DECL(void BS3_FAR *) Bs3SlabListAllocEx(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags) 33 #undef Bs3SlabListAllocEx 34 BS3_CMN_DEF(void BS3_FAR *, Bs3SlabListAllocEx,(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags)) 34 35 { 35 36 BS3_ASSERT(!(fFlags & ~BS3_SLAB_ALLOC_F_SAME_TILE)); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListFree.c
r58789 r60527 28 28 29 29 30 BS3_DECL(void) Bs3SlabListFree(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks) 30 #undef Bs3SlabListFree 31 BS3_CMN_DEF(void, Bs3SlabListFree,(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks)) 31 32 { 32 33 BS3_ASSERT(cChunks > 0); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListInit.c
r58789 r60527 28 28 29 29 30 BS3_DECL(void) Bs3SlabListInit(PBS3SLABHEAD pHead, uint16_t cbChunk) 30 #undef Bs3SlabListInit 31 BS3_CMN_DEF(void, Bs3SlabListInit,(PBS3SLABHEAD pHead, uint16_t cbChunk)) 31 32 { 32 33 BS3_ASSERT(RT_IS_POWER_OF_TWO(cbChunk)); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-StrCpy.c
r58666 r60527 28 28 29 29 #undef Bs3StrCpy 30 BS3_ DECL(char BS3_FAR *) BS3_CMN_NM(Bs3StrCpy)(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc)30 BS3_CMN_DEF(char BS3_FAR *, Bs3StrCpy,(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc)) 31 31 { 32 32 char BS3_FAR *pszRet = pszDst; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-StrFormatV.c
r60311 r60527 359 359 360 360 361 BS3_DECL(size_t) Bs3StrFormatV(const char BS3_FAR *pszFormat, va_list va, 362 PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser) 361 #undef Bs3StrFormatV 362 BS3_CMN_DEF(size_t, Bs3StrFormatV,(const char BS3_FAR *pszFormat, va_list va, 363 PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser)) 363 364 { 364 365 BS3FMTSTATE State; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-StrLen.c
r58666 r60527 28 28 29 29 #undef Bs3StrLen 30 BS3_ DECL(size_t) BS3_CMN_NM(Bs3StrLen)(const char BS3_FAR *pszString)30 BS3_CMN_DEF(size_t, Bs3StrLen,(const char BS3_FAR *pszString)) 31 31 { 32 32 size_t cch = 0; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-StrNLen.c
r58666 r60527 28 28 29 29 #undef Bs3StrNLen 30 BS3_ DECL(size_t) BS3_CMN_NM(Bs3StrNLen)(const char BS3_FAR *pszString, size_t cchMax)30 BS3_CMN_DEF(size_t, Bs3StrNLen,(const char BS3_FAR *pszString, size_t cchMax)) 31 31 { 32 32 size_t cch = 0; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-StrPrintf.c
r58812 r60527 73 73 74 74 75 BS3_DECL(size_t) Bs3StrPrintfV(char BS3_FAR *pszBuf, size_t cchBuf, const char BS3_FAR *pszFormat, va_list va) 75 #undef Bs3StrPrintfV 76 BS3_CMN_DEF(size_t, Bs3StrPrintfV,(char BS3_FAR *pszBuf, size_t cchBuf, const char BS3_FAR *pszFormat, va_list va)) 76 77 { 77 78 BS3STRPRINTFSTATE State; … … 82 83 83 84 84 BS3_DECL(size_t) Bs3StrPrintf(char BS3_FAR *pszBuf, size_t cchBuf, const char BS3_FAR *pszFormat, ...) 85 #undef Bs3StrPrintf 86 BS3_CMN_DEF(size_t, Bs3StrPrintf,(char BS3_FAR *pszBuf, size_t cchBuf, const char BS3_FAR *pszFormat, ...)) 85 87 { 86 88 size_t cchRet; 87 89 va_list va; 88 90 va_start(va, pszFormat); 89 cchRet = B s3StrPrintfV(pszBuf, cchBuf, pszFormat, va);91 cchRet = BS3_CMN_NM(Bs3StrPrintfV)(pszBuf, cchBuf, pszFormat, va); 90 92 va_end(va); 91 93 return cchRet; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo16Bit.asm
r60218 r60527 38 38 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 39 39 ; 40 BS3_PROC_BEGIN_CMN Bs3SwitchTo16Bit 40 BS3_PROC_BEGIN_CMN Bs3SwitchTo16Bit, BS3_PBC_NEAR 41 41 %if TMPL_BITS == 16 42 42 push ax … … 117 117 BS3_PROC_END_CMN Bs3SwitchTo16Bit 118 118 119 ;; @todo far 16-bit variant. 120 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo16BitV86.asm
r60439 r60527 40 40 ; values and the stack register converted to real mode (not ebp). 41 41 ; 42 BS3_PROC_BEGIN_CMN Bs3SwitchTo16BitV86 42 BS3_PROC_BEGIN_CMN Bs3SwitchTo16BitV86, BS3_PBC_NEAR 43 43 ; Construct basic v8086 return frame. 44 44 BS3_ONLY_16BIT_STMT movzx esp, sp … … 118 118 BS3_PROC_END_CMN Bs3SwitchTo16BitV86 119 119 120 ;; @todo far 16-bit variant. 121 120 122 %endif ; ! 64-bit 121 123 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo32Bit.asm
r60218 r60527 43 43 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 44 44 ; 45 BS3_PROC_BEGIN_CMN Bs3SwitchTo32Bit 45 BS3_PROC_BEGIN_CMN Bs3SwitchTo32Bit, BS3_PBC_NEAR 46 46 %if TMPL_BITS == 32 47 47 ret … … 148 148 BS3_PROC_END_CMN Bs3SwitchTo32Bit 149 149 150 ;; @todo far 16-bit variant. 151 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo64Bit.asm
r59949 r60527 37 37 ; 38 38 ; @remarks Does not require 20h of parameter scratch space in 64-bit mode. 39 ; @uses No GPRs. 39 40 ; 40 BS3_PROC_BEGIN_CMN Bs3SwitchTo64Bit 41 BS3_PROC_BEGIN_CMN Bs3SwitchTo64Bit, BS3_PBC_NEAR 41 42 %if TMPL_BITS == 64 42 43 ret … … 105 106 BS3_PROC_END_CMN Bs3SwitchTo64Bit 106 107 108 109 ;; @todo far 16-bit variant. 110 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRing0.asm
r60001 r60527 34 34 ;* External Symbols * 35 35 ;********************************************************************************************************************************* 36 BS3_EXTERN_CMN Bs3SwitchToRingX36 BS3_EXTERN_CMN_FAR Bs3SwitchToRingX 37 37 TMPL_BEGIN_TEXT 38 38 … … 44 44 ; @uses No GPRs. 45 45 ; 46 BS3_PROC_BEGIN_CMN Bs3SwitchToRing0 46 BS3_PROC_BEGIN_CMN Bs3SwitchToRing0, BS3_PBC_HYBRID_0_ARGS 47 47 %if TMPL_BITS == 64 48 48 push rcx … … 55 55 %else 56 56 push 0 57 TMPL_ONLY_16BIT_STMT push cs 57 58 call Bs3SwitchToRingX 58 59 add xSP, xCB 59 60 %endif 60 ret61 BS3_HYBRID_RET 61 62 BS3_PROC_END_CMN Bs3SwitchToRing0 62 63 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRing1.asm
r60001 r60527 34 34 ;* External Symbols * 35 35 ;********************************************************************************************************************************* 36 BS3_EXTERN_CMN Bs3SwitchToRingX36 BS3_EXTERN_CMN_FAR Bs3SwitchToRingX 37 37 TMPL_BEGIN_TEXT 38 38 … … 44 44 ; @uses No GPRs. 45 45 ; 46 BS3_PROC_BEGIN_CMN Bs3SwitchToRing1 46 BS3_PROC_BEGIN_CMN Bs3SwitchToRing1, BS3_PBC_HYBRID_0_ARGS 47 47 %if TMPL_BITS == 64 48 48 push rcx … … 55 55 %else 56 56 push 1 57 TMPL_ONLY_16BIT_STMT push cs 57 58 call Bs3SwitchToRingX 58 59 add xSP, xCB 59 60 %endif 60 ret61 BS3_HYBRID_RET 61 62 BS3_PROC_END_CMN Bs3SwitchToRing1 62 63 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRing2.asm
r60001 r60527 34 34 ;* External Symbols * 35 35 ;********************************************************************************************************************************* 36 BS3_EXTERN_CMN Bs3SwitchToRingX36 BS3_EXTERN_CMN_FAR Bs3SwitchToRingX 37 37 TMPL_BEGIN_TEXT 38 38 … … 44 44 ; @uses No GPRs. 45 45 ; 46 BS3_PROC_BEGIN_CMN Bs3SwitchToRing2 46 BS3_PROC_BEGIN_CMN Bs3SwitchToRing2, BS3_PBC_HYBRID_0_ARGS 47 47 %if TMPL_BITS == 64 48 48 push rcx … … 55 55 %else 56 56 push 2 57 TMPL_ONLY_16BIT_STMT push cs 57 58 call Bs3SwitchToRingX 58 59 add xSP, xCB 59 60 %endif 60 ret61 BS3_HYBRID_RET 61 62 BS3_PROC_END_CMN Bs3SwitchToRing2 62 63 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRing3.asm
r60001 r60527 34 34 ;* External Symbols * 35 35 ;********************************************************************************************************************************* 36 BS3_EXTERN_CMN Bs3SwitchToRingX36 BS3_EXTERN_CMN_FAR Bs3SwitchToRingX 37 37 TMPL_BEGIN_TEXT 38 38 … … 44 44 ; @uses No GPRs. 45 45 ; 46 BS3_PROC_BEGIN_CMN Bs3SwitchToRing3 46 BS3_PROC_BEGIN_CMN Bs3SwitchToRing3, BS3_PBC_HYBRID_0_ARGS 47 47 %if TMPL_BITS == 64 48 48 push rcx … … 55 55 %else 56 56 push 3 57 TMPL_ONLY_16BIT_STMT push cs 57 58 call Bs3SwitchToRingX 58 59 add xSP, xCB 59 60 %endif 60 ret61 BS3_HYBRID_RET 61 62 BS3_PROC_END_CMN Bs3SwitchToRing3 62 63 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchToRingX.asm
r60218 r60527 43 43 ; @uses No GPRs. 44 44 ; 45 BS3_PROC_BEGIN_CMN Bs3SwitchToRingX 45 BS3_PROC_BEGIN_CMN Bs3SwitchToRingX, BS3_PBC_HYBRID_SAFE 46 46 BS3_CALL_CONV_PROLOG 1 47 47 push xBP … … 65 65 mov ax, cs 66 66 and al, 3 67 cmp al, byte [xBP + xCB *2]67 cmp al, byte [xBP + xCB + cbCurRetAddr] 68 68 je .return 69 69 70 70 .just_do_it: 71 71 mov xAX, BS3_SYSCALL_TO_RING0 72 add al, [xBP + xCB *2]72 add al, [xBP + xCB + cbCurRetAddr] 73 73 call Bs3Syscall 74 74 … … 80 80 pop xBP 81 81 BS3_CALL_CONV_EPILOG 1 82 ret82 BS3_HYBRID_RET 83 83 84 84 %ifdef BS3_STRICT 85 85 ; In real mode, only ring-0 makes any sense. 86 86 .return_real_mode: 87 cmp byte [xBP + xCB *2], 087 cmp byte [xBP + xCB + cbCurRetAddr], 0 88 88 je .return 89 89 int3 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Syscall.asm
r60218 r60527 51 51 ; @uses Whatever the syscall modified (xBX and XBP are always saved). 52 52 ; 53 BS3_PROC_BEGIN_CMN Bs3Syscall 53 BS3_PROC_BEGIN_CMN Bs3Syscall, BS3_PBC_HYBRID_0_ARGS ; (all parameters are in registers) 54 54 push xBP 55 55 mov xBP, xSP … … 80 80 pop xBX 81 81 pop xBP 82 ret82 BS3_HYBRID_RET 83 83 BS3_PROC_END_CMN Bs3Syscall 84 84 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestCheckRegCtxEx.c
r60216 r60527 32 32 33 33 34 BS3_DECL(bool) Bs3TestCheckRegCtxEx(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust, int16_t cbSpAcjust, 35 uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep) 34 #undef Bs3TestCheckRegCtxEx 35 BS3_CMN_DEF(bool, Bs3TestCheckRegCtxEx,(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust, int16_t cbSpAcjust, 36 uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep)) 36 37 { 37 38 uint16_t cErrorsBefore = Bs3TestSubErrorCount(); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestFailed.c
r60439 r60527 95 95 * Equivalent to RTTestIFailedV. 96 96 */ 97 BS3_DECL(void) Bs3TestFailedV(const char *pszFormat, va_list va) 97 #undef Bs3TestFailedV 98 BS3_CMN_DEF(void, Bs3TestFailedV,(const char *pszFormat, va_list va)) 98 99 { 99 100 BS3TESTFAILEDBUF Buf; … … 118 119 * Equivalent to RTTestIFailedF. 119 120 */ 120 BS3_DECL(void) Bs3TestFailedF(const char *pszFormat, ...) 121 #undef Bs3TestFailedF 122 BS3_CMN_DEF(void, Bs3TestFailedF,(const char *pszFormat, ...)) 121 123 { 122 124 va_list va; 123 125 va_start(va, pszFormat); 124 B s3TestFailedV(pszFormat, va);126 BS3_CMN_NM(Bs3TestFailedV)(pszFormat, va); 125 127 va_end(va); 126 128 } … … 130 132 * Equivalent to RTTestIFailed. 131 133 */ 132 BS3_DECL(void) Bs3TestFailed(const char *pszMessage) 134 #undef Bs3TestFailed 135 BS3_CMN_DEF(void, Bs3TestFailed,(const char *pszMessage)) 133 136 { 134 B s3TestFailedF("%s", pszMessage);137 BS3_CMN_NM(Bs3TestFailedF)("%s", pszMessage); 135 138 } 136 139 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestInit.c
r60311 r60527 38 38 * @param pszTest The test name. 39 39 */ 40 BS3_DECL(void) Bs3TestInit(const char BS3_FAR *pszTest) 40 #undef Bs3TestInit 41 BS3_CMN_DEF(void, Bs3TestInit,(const char BS3_FAR *pszTest)) 41 42 { 42 43 /* -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestIsVmmDevTestingPresent.asm
r60367 r60527 38 38 ; @cproto BS3_DECL(bool) bs3TestIsVmmDevTestingPresent_c16(void); 39 39 ; 40 BS3_PROC_BEGIN_CMN bs3TestIsVmmDevTestingPresent 40 BS3_PROC_BEGIN_CMN bs3TestIsVmmDevTestingPresent, BS3_PBC_HYBRID_0_ARGS 41 41 BS3_CALL_CONV_PROLOG 2 42 42 push xBP … … 59 59 pop xBP 60 60 BS3_CALL_CONV_EPILOG 2 61 ret61 BS3_HYBRID_RET 62 62 63 63 .ancient_cpu: -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestPrintf.c
r60439 r60527 115 115 116 116 117 BS3_DECL(void) Bs3TestPrintfV(const char BS3_FAR *pszFormat, va_list va) 117 #undef Bs3TestPrintfV 118 BS3_CMN_DEF(void, Bs3TestPrintfV,(const char BS3_FAR *pszFormat, va_list va)) 118 119 { 119 120 BS3TESTPRINTBUF Buf; … … 125 126 126 127 127 BS3_DECL(void) Bs3TestPrintf(const char BS3_FAR *pszFormat, ...) 128 #undef Bs3TestPrintf 129 BS3_CMN_DEF(void, Bs3TestPrintf,(const char BS3_FAR *pszFormat, ...)) 128 130 { 129 131 va_list va; 130 132 va_start(va, pszFormat); 131 B s3TestPrintfV(pszFormat, va);133 BS3_CMN_NM(Bs3TestPrintfV)(pszFormat, va); 132 134 va_end(va); 133 135 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSendCmdWithStr.asm
r60439 r60527 34 34 ; @cproto BS3_DECL(void) bs3TestSendCmdWithStr_c16(uint32_t uCmd, const char BS3_FAR *pszString); 35 35 ; 36 BS3_PROC_BEGIN_CMN bs3TestSendCmdWithStr 36 BS3_PROC_BEGIN_CMN bs3TestSendCmdWithStr, BS3_PBC_HYBRID 37 37 BS3_CALL_CONV_PROLOG 2 38 38 push xBP … … 49 49 mov dx, VMMDEV_TESTING_IOPORT_CMD 50 50 %if TMPL_BITS == 16 51 mov ax, [xBP + xCB *2]; We ignore the top bits in 16-bit mode.51 mov ax, [xBP + xCB + cbCurRetAddr] ; We ignore the top bits in 16-bit mode. 52 52 out dx, ax 53 53 %else 54 mov eax, [xBP + xCB *2]54 mov eax, [xBP + xCB + cbCurRetAddr] 55 55 out dx, eax 56 56 %endif … … 59 59 mov dx, VMMDEV_TESTING_IOPORT_DATA 60 60 %if TMPL_BITS == 16 61 lds si, [xBP + xCB*2+ sCB]61 lds si, [xBP + xCB + cbCurRetAddr + sCB] 62 62 %else 63 mov xSI, [xBP + xCB *2+ sCB]63 mov xSI, [xBP + xCB + cbCurRetAddr + sCB] 64 64 %endif 65 65 .next_char: … … 74 74 pop xDX 75 75 pop xAX 76 leave76 pop xBP 77 77 BS3_CALL_CONV_EPILOG 2 78 ret78 BS3_HYBRID_RET 79 79 BS3_PROC_END_CMN bs3TestSendCmdWithStr 80 80 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSendCmdWithU32.asm
r60439 r60527 34 34 ; @cproto BS3_DECL(void) bs3TestSendCmdWithU32_c16(uint32_t uCmd, uint32_t uValue); 35 35 ; 36 BS3_PROC_BEGIN_CMN bs3TestSendCmdWithU32 36 BS3_PROC_BEGIN_CMN bs3TestSendCmdWithU32, BS3_PBC_HYBRID 37 37 BS3_CALL_CONV_PROLOG 2 38 38 push xBP … … 48 48 mov dx, VMMDEV_TESTING_IOPORT_CMD 49 49 %if TMPL_BITS == 16 50 mov ax, [xBP + xCB *2]; We ignore the top bits in 16-bit mode.50 mov ax, [xBP + xCB + cbCurRetAddr] ; We ignore the top bits in 16-bit mode. 51 51 out dx, ax 52 52 %else … … 59 59 mov dx, VMMDEV_TESTING_IOPORT_DATA 60 60 %if TMPL_BITS == 16 61 mov ax, [xBP + xCB *2+ sCB]61 mov ax, [xBP + xCB + cbCurRetAddr + sCB] 62 62 out dx, ax 63 mov ax, [xBP + xCB *2+ sCB + 2]63 mov ax, [xBP + xCB + cbCurRetAddr + sCB + 2] 64 64 out dx, ax 65 65 %else … … 75 75 pop xDX 76 76 pop xAX 77 leave77 pop xBP 78 78 BS3_CALL_CONV_EPILOG 2 79 ret79 BS3_HYBRID_RET 80 80 BS3_PROC_END_CMN bs3TestSendCmdWithU32 81 81 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSkipped.c
r60439 r60527 37 37 * Equivalent to RTTestSkippedV. 38 38 */ 39 BS3_DECL(void) Bs3TestSkippedV(const char *pszFormat, va_list va) 39 #undef Bs3TestSkippedV 40 BS3_CMN_DEF(void, Bs3TestSkippedV,(const char *pszFormat, va_list va)) 40 41 { 41 42 if (g_cusBs3TestErrors == g_cusBs3SubTestAtErrors) … … 69 70 * Equivalent to RTTestSkipped. 70 71 */ 71 BS3_DECL(void) Bs3TestSkippedF(const char *pszFormat, ...) 72 #undef Bs3TestSkippedF 73 BS3_CMN_DEF(void, Bs3TestSkippedF,(const char *pszFormat, ...)) 72 74 { 73 75 va_list va; 74 76 va_start(va, pszFormat); 75 B s3TestSkippedV(pszFormat, va);77 BS3_CMN_NM(Bs3TestSkippedV)(pszFormat, va); 76 78 va_end(va); 77 79 } … … 81 83 * Equivalent to RTTestSkipped. 82 84 */ 83 BS3_DECL(void) Bs3TestSkipped(const char *pszWhy) 85 #undef Bs3TestSkipped 86 BS3_CMN_DEF(void, Bs3TestSkipped,(const char *pszWhy)) 84 87 { 85 B s3TestSkippedF(pszWhy ? "%s" : NULL, pszWhy);88 BS3_CMN_NM(Bs3TestSkippedF)(pszWhy ? "%s" : NULL, pszWhy); 86 89 } 87 90 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSub.c
r60311 r60527 37 37 * Equivalent to RTTestISubV. 38 38 */ 39 BS3_DECL(void) Bs3TestSubV(const char *pszFormat, va_list va) 39 #undef Bs3TestSubV 40 BS3_CMN_DEF(void, Bs3TestSubV,(const char *pszFormat, va_list va)) 40 41 { 41 42 size_t cch; … … 70 71 * Equivalent to RTTestIFailedF. 71 72 */ 72 BS3_DECL(void) Bs3TestSubF(const char *pszFormat, ...) 73 #undef Bs3TestSubF 74 BS3_CMN_DEF(void, Bs3TestSubF,(const char *pszFormat, ...)) 73 75 { 74 76 va_list va; 75 77 va_start(va, pszFormat); 76 B s3TestSubV(pszFormat, va);78 BS3_CMN_NM(Bs3TestSubV)(pszFormat, va); 77 79 va_end(va); 78 80 } … … 82 84 * Equivalent to RTTestISub. 83 85 */ 84 BS3_DECL(void) Bs3TestSub(const char *pszMessage) 86 #undef Bs3TestSub 87 BS3_CMN_DEF(void, Bs3TestSub,(const char *pszMessage)) 85 88 { 86 B s3TestSubF("%s", pszMessage);89 BS3_CMN_NM(Bs3TestSubF)("%s", pszMessage); 87 90 } 88 91 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSubDone.c
r59865 r60527 37 37 * Equivalent to RTTestISubDone. 38 38 */ 39 BS3_DECL(void) Bs3TestSubDone(void) 39 #undef Bs3TestSubDone 40 BS3_CMN_DEF(void, Bs3TestSubDone,(void)) 40 41 { 41 42 bs3TestSubCleanup(); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSubErrorCount.c
r60311 r60527 37 37 * Equivalent to RTTestSubErrorCount. 38 38 */ 39 BS3_DECL(uint16_t) Bs3TestSubErrorCount(void) 39 #undef Bs3TestSubErrorCount 40 BS3_CMN_DEF(uint16_t, Bs3TestSubErrorCount,(void)) 40 41 { 41 42 return g_cusBs3TestErrors - g_cusBs3SubTestAtErrors; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestTerm.c
r60311 r60527 77 77 * Equivalent to RTTestSummaryAndDestroy. 78 78 */ 79 BS3_DECL(void) Bs3TestTerm(void) 79 #undef Bs3TestTerm 80 BS3_CMN_DEF(void, Bs3TestTerm,(void)) 80 81 { 81 82 /* -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Trap16Init.c
r60311 r60527 45 45 46 46 47 BS3_DECL(void) Bs3Trap16InitEx(bool f386Plus) 47 #undef Bs3Trap16InitEx 48 BS3_CMN_DEF(void, Bs3Trap16InitEx,(bool f386Plus)) 48 49 { 49 50 X86TSS16 BS3_FAR *pTss; … … 68 69 * IDT entries, except the system call gate. 69 70 */ 70 for (iIdt = 0; iIdt < BS3_TRAP_SYSCALL; iIdt++) 71 Bs3Trap16SetGate(iIdt, X86_SEL_TYPE_SYS_286_INT_GATE, 0 /*bDpl*/, 72 BS3_SEL_R0_CS16, (uint16_t)(uintptr_t)Bs3Trap16GenericEntries + iIdt * 8, 0 /*cParams*/); 73 for (iIdt = BS3_TRAP_SYSCALL + 1; iIdt < 256; iIdt++) 74 Bs3Trap16SetGate(iIdt, X86_SEL_TYPE_SYS_286_INT_GATE, 0 /*bDpl*/, 75 BS3_SEL_R0_CS16, (uint16_t)(uintptr_t)Bs3Trap16GenericEntries + iIdt * 8, 0 /*cParams*/); 71 for (iIdt = 0; iIdt < 256; iIdt++) 72 if (iIdt != BS3_TRAP_SYSCALL) 73 Bs3Trap16SetGate(iIdt, X86_SEL_TYPE_SYS_286_INT_GATE, 0 /*bDpl*/, 74 BS3_SEL_R0_CS16, (uint16_t)(uintptr_t)Bs3Trap16GenericEntries + iIdt * 8, 0 /*cParams*/); 76 75 77 76 /* … … 112 111 113 112 114 BS3_DECL(void) Bs3Trap16Init(void) 113 #undef Bs3Trap16Init 114 BS3_CMN_DEF(void, Bs3Trap16Init,(void)) 115 115 { 116 B s3Trap16InitEx((g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386);116 BS3_CMN_NM(Bs3Trap16InitEx)((g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386); 117 117 } 118 118 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Trap16SetGate.c
r60311 r60527 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - Bs3Trap 32SetGate3 * BS3Kit - Bs3Trap16SetGate 4 4 */ 5 5 … … 31 31 32 32 33 BS3_DECL(void) Bs3Trap16SetGate(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint16_t off, uint8_t cParams) 33 #undef Bs3Trap16SetGate 34 BS3_CMN_DEF(void, Bs3Trap16SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint16_t off, uint8_t cParams)) 34 35 { 35 36 X86DESC BS3_FAR *pIdte = &Bs3Idt16[iIdt]; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Trap32Init.c
r60311 r60527 38 38 39 39 40 BS3_DECL(void) Bs3Trap32Init(void) 40 #undef Bs3Trap32Init 41 BS3_CMN_DEF(void, Bs3Trap32Init,(void)) 41 42 { 42 43 X86TSS32 BS3_FAR *pTss; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Trap32SetGate.c
r60311 r60527 31 31 32 32 33 BS3_DECL(void) Bs3Trap32SetGate(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint32_t off, uint8_t cParams) 33 #undef Bs3Trap32SetGate 34 BS3_CMN_DEF(void, Bs3Trap32SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint32_t off, uint8_t cParams)) 34 35 { 35 36 X86DESC BS3_FAR *pIdte = &Bs3Idt32[iIdt]; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Trap64Init.c
r60311 r60527 31 31 32 32 33 BS3_DECL(void) Bs3Trap64Init(void) 33 #undef Bs3Trap64Init 34 BS3_CMN_DEF(void, Bs3Trap64Init,(void)) 34 35 { 35 36 X86TSS64 BS3_FAR *pTss; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-Trap64SetGate.c
r60311 r60527 31 31 32 32 33 BS3_DECL(void) Bs3Trap64SetGate(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint64_t off, uint8_t bIst) 33 #undef Bs3Trap64SetGate 34 BS3_CMN_DEF(void, Bs3Trap64SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint64_t off, uint8_t bIst)) 34 35 { 35 36 X86DESC64 BS3_FAR *pIdte = &Bs3Idt64[iIdt]; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapDefaultHandler.c
r60311 r60527 48 48 Bs3PrintChr(pTrapFrame->Ctx.rcx.u8); 49 49 else if (pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_PRINT_STR) 50 Bs3PrintStrN(Bs3XptrFlatToCurrent((pTrapFrame->Ctx.rcx.u16 << 4) + pTrapFrame->Ctx.rsi.u16), pTrapFrame->Ctx.rdx.u16); 50 Bs3PrintStrN(Bs3XptrFlatToCurrent(((uint32_t)pTrapFrame->Ctx.rcx.u16 << 4) + pTrapFrame->Ctx.rsi.u16), 51 pTrapFrame->Ctx.rdx.u16); 51 52 else if (pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_RESTORE_CTX) 52 Bs3RegCtxRestore(Bs3XptrFlatToCurrent((pTrapFrame->Ctx.rcx.u16 << 4) + pTrapFrame->Ctx.rsi.u16), pTrapFrame->Ctx.rdx.u16); 53 Bs3RegCtxRestore(Bs3XptrFlatToCurrent(((uint32_t)pTrapFrame->Ctx.rcx.u16 << 4) + pTrapFrame->Ctx.rsi.u16), 54 pTrapFrame->Ctx.rdx.u16); 53 55 else if ( pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING0 54 56 || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING1 … … 63 65 #endif 64 66 65 BS3_DECL(void) Bs3TrapDefaultHandler(PBS3TRAPFRAME pTrapFrame) 67 #undef Bs3TrapDefaultHandler 68 BS3_CMN_DEF(void, Bs3TrapDefaultHandler,(PBS3TRAPFRAME pTrapFrame)) 66 69 { 67 70 #if TMPL_BITS != 64 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapPrintFrame.c
r60439 r60527 31 31 32 32 33 BS3_DECL(void) Bs3TrapPrintFrame(PCBS3TRAPFRAME pTrapFrame) 33 #undef Bs3TrapPrintFrame 34 BS3_CMN_DEF(void, Bs3TrapPrintFrame,(PCBS3TRAPFRAME pTrapFrame)) 34 35 { 35 36 #if 1 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapRmV86Init.c
r60511 r60527 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - Bs3Trap 16Init3 * BS3Kit - Bs3TrapRmV86Init 4 4 */ 5 5 … … 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 Bs3Trap16DoubleFaultHandler80386(void);40 extern BS3_DECL(void) BS3_FAR_CODE Bs3Trap16DoubleFaultHandler80286(void);41 39 extern BS3_DECL(void) BS3_FAR_CODE Bs3Trap16GenericEntries(void); 42 40 … … 44 42 extern uint8_t BS3_FAR_DATA bs3Trap16GenericTrapOrInt[]; 45 43 44 /* bs3-cmn-TrapRmV86Data.c: */ 45 #define g_fBs3RmIvtCopied BS3_DATA_NM(g_fBs3RmIvtCopied) 46 extern bool g_fBs3RmIvtCopied; 46 47 47 BS3_DECL(void) Bs3Trap16InitEx(bool f386Plus) 48 49 #undef Bs3TrapRmV86InitEx 50 BS3_CMN_DEF(void, Bs3TrapRmV86InitEx,(bool f386Plus)) 48 51 { 49 X86TSS16 BS3_FAR *pTss; 50 unsigned iIdt; 52 RTFAR16 BS3_FAR *paIvt = Bs3XptrFlatToCurrent(0); 53 unsigned iIvt; 54 55 /* 56 * Copy the real mode IVT the first time we are here. 57 */ 58 if (!g_fBs3RmIvtCopied) 59 { 60 Bs3MemCpy(g_aBs3RmIvtOriginal, paIvt, sizeof(g_aBs3RmIvtOriginal)); 61 g_fBs3RmIvtCopied = true; 62 } 63 /* 64 * The rest of the times, we copy back the original and modify it. 65 */ 66 else 67 Bs3MemCpy(paIvt, g_aBs3RmIvtOriginal, sizeof(g_aBs3RmIvtOriginal)); 68 51 69 52 70 /* … … 66 84 67 85 /* 68 * IDT entries, except the system call gate. 86 * Since we want to play with V86 mode as well as 8086 and 186 CPUs, we 87 * cannot move the IVT from its default location. So, modify it in place. 88 * 89 * Note! We must keep int 10h working, which is easy since the CPU does 90 * use it (well, it's been reserved for 30+ years). 69 91 */ 70 for (iIdt = 0; iIdt < BS3_TRAP_SYSCALL; iIdt++) 71 Bs3Trap16SetGate(iIdt, X86_SEL_TYPE_SYS_286_INT_GATE, 0 /*bDpl*/, 72 BS3_SEL_R0_CS16, (uint16_t)(uintptr_t)Bs3Trap16GenericEntries + iIdt * 8, 0 /*cParams*/); 73 for (iIdt = BS3_TRAP_SYSCALL + 1; iIdt < 256; iIdt++) 74 Bs3Trap16SetGate(iIdt, X86_SEL_TYPE_SYS_286_INT_GATE, 0 /*bDpl*/, 75 BS3_SEL_R0_CS16, (uint16_t)(uintptr_t)Bs3Trap16GenericEntries + iIdt * 8, 0 /*cParams*/); 76 77 /* 78 * Initialize the normal TSS so we can do ring transitions via the IDT. 79 */ 80 pTss = &Bs3Tss16; 81 Bs3MemZero(pTss, sizeof(*pTss)); 82 pTss->sp0 = BS3_ADDR_STACK_R0; 83 pTss->ss0 = BS3_SEL_R0_SS16; 84 pTss->sp1 = BS3_ADDR_STACK_R1; 85 pTss->ss1 = BS3_SEL_R1_SS16 | 1; 86 pTss->sp2 = BS3_ADDR_STACK_R2; 87 pTss->ss2 = BS3_SEL_R2_SS16 | 2; 88 89 /* 90 * Initialize the double fault TSS. 91 * cr3 is filled in by switcher code, when needed. 92 */ 93 pTss = &Bs3Tss16DoubleFault; 94 Bs3MemZero(pTss, sizeof(*pTss)); 95 pTss->sp0 = BS3_ADDR_STACK_R0; 96 pTss->ss0 = BS3_SEL_R0_SS16; 97 pTss->sp1 = BS3_ADDR_STACK_R1; 98 pTss->ss1 = BS3_SEL_R1_SS16 | 1; 99 pTss->sp2 = BS3_ADDR_STACK_R2; 100 pTss->ss2 = BS3_SEL_R2_SS16 | 2; 101 pTss->ip = (uint16_t)(uintptr_t)(f386Plus ? &Bs3Trap16DoubleFaultHandler80386 : &Bs3Trap16DoubleFaultHandler80286); 102 pTss->flags = X86_EFL_1; 103 pTss->sp = BS3_ADDR_STACK_R0_IST1; 104 pTss->es = BS3_SEL_R0_DS16; 105 pTss->ds = BS3_SEL_R0_DS16; 106 pTss->cs = BS3_SEL_R0_CS16; 107 pTss->ss = BS3_SEL_R0_SS16; 108 pTss->dx = f386Plus; 109 110 Bs3Trap16SetGate(X86_XCPT_DF, X86_SEL_TYPE_SYS_TASK_GATE, 0 /*bDpl*/, BS3_SEL_TSS16_DF, 0, 0 /*cParams*/); 92 for (iIvt = 0; iIvt < 256; iIvt++) 93 if (iIvt != 0x10 && iIvt != BS3_TRAP_SYSCALL) 94 { 95 paIvt[iIvt].off = (uint16_t)(uintptr_t)Bs3Trap16GenericEntries + iIvt * 8; 96 paIvt[iIvt].sel = BS3_SEL_TEXT16; 97 } 111 98 } 112 99 113 100 114 BS3_DECL(void) Bs3Trap16Init(void) 101 #undef Bs3TrapRmV86InitEx 102 BS3_CMN_DEF(void, Bs3TrapRmV86Init,(void)) 115 103 { 116 B s3Trap16InitEx((g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386);104 BS3_CMN_NM(Bs3TrapRmV86InitEx)((g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386); 117 105 } 118 106 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapRmV86SetGate.c
r60511 r60527 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - Bs3Trap 32SetGate3 * BS3Kit - Bs3TrapRmV86SetGate 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2007-201 5Oracle Corporation7 * Copyright (C) 2007-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 31 31 32 32 33 BS3_DECL(void) Bs3Trap16SetGate(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint16_t off, uint8_t cParams) 33 #undef Bs3TrapRmV86SetGate 34 BS3_CMN_DEF(void, Bs3TrapRmV86SetGate,(uint8_t iIvt, uint16_t uSeg, uint16_t off)) 34 35 { 35 X86DESC BS3_FAR *pIdte = &Bs3Idt16[iIdt]; 36 37 BS3_ASSERT(bDpl <= 3); 38 BS3_ASSERT(bType <= 15); 39 BS3_ASSERT(cParams <= 15); 40 pIdte->Gate.u16OffsetLow = (uint16_t)off; 41 pIdte->Gate.u16OffsetHigh = 0; 42 pIdte->Gate.u16Sel = uSel; 43 pIdte->Gate.u4ParmCount = cParams; 44 pIdte->Gate.u4Type = bType; 45 pIdte->Gate.u2Dpl = bDpl; 46 pIdte->Gate.u4Reserved = 0; 47 pIdte->Gate.u1DescType = 0; /* system */ 48 pIdte->Gate.u1Present = 1; 36 RTFAR16 BS3_FAR *paIvt = Bs3XptrFlatToCurrent(0); 37 paIvt[iIvt].off = off; 38 paIvt[iIvt].sel = uSeg; 49 39 } 50 40 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapSetHandler.c
r60311 r60527 37 37 38 38 39 BS3_DECL(PFNBS3TRAPHANDLER) Bs3TrapSetHandler(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler) 39 #undef Bs3TrapSetHandler 40 BS3_CMN_DEF(PFNBS3TRAPHANDLER, Bs3TrapSetHandler,(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler)) 40 41 { 41 42 PFNBS3TRAPHANDLER pfnOld = BS3_DATA_NM(BS3_CMN_NM(g_apfnBs3TrapHandlers))[iIdt]; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapSetJmp.asm
r60194 r60527 37 37 BS3_EXTERN_CMN Bs3RegCtxSave 38 38 %if TMPL_BITS == 16 39 BS3_EXTERN_CMN Bs3SelFar32ToFlat3239 BS3_EXTERN_CMN_FAR Bs3SelFar32ToFlat32 40 40 %endif 41 41 BS3_EXTERN_DATA16 g_Bs3TrapSetJmpCtx … … 49 49 ; @uses See, applicable C calling convention. 50 50 ; 51 BS3_PROC_BEGIN_CMN Bs3TrapSetJmp 51 BS3_PROC_BEGIN_CMN Bs3TrapSetJmp, BS3_PBC_HYBRID 52 52 BS3_CALL_CONV_PROLOG 1 53 53 push xBP … … 71 71 mov xAX, [xBP + xCB] ; The return address of this function 72 72 mov [xBX + BS3REGCTX.rip], xAX 73 %if TMPL_BITS == 16 74 mov xAX, [xBP + xCB+2] ; The return address CS of this function. 75 mov [xBX + BS3REGCTX.cs], xAX 76 %endif 73 77 mov xAX, [xBP] 74 78 mov [xBX + BS3REGCTX.rbp], xAX 75 lea xAX, [xBP + xCB *2]79 lea xAX, [xBP + xCB + cbCurRetAddr] 76 80 mov [xBX + BS3REGCTX.rsp], xAX 77 81 mov xAX, [xBP - xCB] … … 86 90 %if TMPL_BITS == 16 87 91 push es 88 les di, [xBP + xCB *2]92 les di, [xBP + xCB + cbCurRetAddr] 89 93 mov cx, BS3TRAPFRAME_size / 2 90 94 mov ax, 0faceh … … 104 108 %if TMPL_BITS == 16 105 109 xor ax, ax 106 push word [xBP + xCB *2+ 2]110 push word [xBP + xCB + cbCurRetAddr + 2] 107 111 push ax 108 push word [xBP + xCB*2] 112 push word [xBP + xCB + cbCurRetAddr] 113 push cs 109 114 call Bs3SelFar32ToFlat32 110 115 add sp, 6h … … 124 129 pop xBP 125 130 BS3_CALL_CONV_EPILOG 1 126 ret131 BS3_HYBRID_RET 127 132 BS3_PROC_END_CMN Bs3TrapSetJmp 128 133 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapSetJmpAndRestore.c
r60311 r60527 31 31 32 32 33 BS3_DECL(void) Bs3TrapSetJmpAndRestore(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame) 33 #undef Bs3TrapSetJmpAndRestore 34 BS3_CMN_DEF(void, Bs3TrapSetJmpAndRestore,(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame)) 34 35 { 35 36 if (Bs3TrapSetJmp(pTrapFrame)) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapUnsetJmp.c
r60311 r60527 40 40 41 41 42 BS3_DECL(void) Bs3TrapUnsetJmp(void) 42 #undef Bs3TrapUnsetJmp 43 BS3_CMN_DEF(void, Bs3TrapUnsetJmp,(void)) 43 44 { 44 45 g_pBs3TrapSetJmpFrame = 0; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-UInt32Div.c
r60485 r60527 33 33 34 34 35 36 void BS3_CMN_NM(Bs3UInt32Div)(RTUINT32U uDividend, RTUINT32U uDivisor, RTUINT32U BS3_FAR *paQuotientReminder)35 #undef Bs3UInt32Div 36 BS3_CMN_DEF(void, Bs3UInt32Div,(RTUINT32U uDividend, RTUINT32U uDivisor, RTUINT32U BS3_FAR *paQuotientReminder)) 37 37 { 38 38 RTUInt32DivRem(&paQuotientReminder[0], &paQuotientReminder[1], &uDividend, &uDivisor); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-UInt64Div.c
r60485 r60527 33 33 34 34 35 36 void BS3_CMN_NM(Bs3UInt64Div)(RTUINT64U uDividend, RTUINT64U uDivisor, RTUINT64U BS3_FAR *paQuotientReminder)35 #undef Bs3UInt64Div 36 BS3_CMN_DEF(void, Bs3UInt64Div,(RTUINT64U uDividend, RTUINT64U uDivisor, RTUINT64U BS3_FAR *paQuotientReminder)) 37 37 { 38 38 RTUInt64DivRem(&paQuotientReminder[0], &paQuotientReminder[1], &uDividend, &uDivisor); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-test.h
r60439 r60527 100 100 * @param pszString The string. 101 101 */ 102 BS3_DECL(void) bs3TestSendCmdWithStr_c16(uint32_t uCmd, const char BS3_FAR *pszString); 103 BS3_DECL(void) bs3TestSendCmdWithStr_c32(uint32_t uCmd, const char BS3_FAR *pszString); /**< @copydoc bs3TestSendCmdWithStr_c16 */ 104 BS3_DECL(void) bs3TestSendCmdWithStr_c64(uint32_t uCmd, const char BS3_FAR *pszString); /**< @copydoc bs3TestSendCmdWithStr_c16 */ 105 #define bs3TestSendCmdWithStr BS3_CMN_NM(bs3TestSendCmdWithStr) /**< Selects #bs3TestSendCmdWithStr_c16, #bs3TestSendCmdWithStr_c32 or #bs3TestSendCmdWithStr_c64. */ 102 #ifndef DOXYGEN_RUNNING 103 # define bs3TestSendCmdWithStr BS3_CMN_NM(bs3TestSendCmdWithStr) 104 #endif 105 BS3_DECL(void) bs3TestSendCmdWithStr(uint32_t uCmd, const char BS3_FAR *pszString); 106 106 107 107 /** … … 114 114 * @param uValue The value. 115 115 */ 116 BS3_DECL(void) bs3TestSendCmdWithU32_c16(uint32_t uCmd, uint32_t uValue); 117 BS3_DECL(void) bs3TestSendCmdWithU32_c32(uint32_t uCmd, uint32_t uValue); /**< @copydoc bs3TestSendCmdWithU32_c16 */ 118 BS3_DECL(void) bs3TestSendCmdWithU32_c64(uint32_t uCmd, uint32_t uValue); /**< @copydoc bs3TestSendCmdWithU32_c16 */ 119 #define bs3TestSendCmdWithU32 BS3_CMN_NM(bs3TestSendCmdWithU32) /**< Selects #bs3TestSendCmdWithU32_c16, #bs3TestSendCmdWithU32_c32 or #bs3TestSendCmdWithU32_c64. */ 116 #ifndef DOXYGEN_RUNNING 117 # define bs3TestSendCmdWithU32 BS3_CMN_NM(bs3TestSendCmdWithU32) 118 #endif 119 BS3_DECL(void) bs3TestSendCmdWithU32(uint32_t uCmd, uint32_t uValue); 120 120 121 121 /** … … 124 124 * @returns true / false. 125 125 */ 126 BS3_DECL(bool) bs3TestIsVmmDevTestingPresent_c16(void); 127 BS3_DECL(bool) bs3TestIsVmmDevTestingPresent_c32(void); /**< @copydoc bs3TestIsVmmDevTestingPresent_c16 */ 128 BS3_DECL(bool) bs3TestIsVmmDevTestingPresent_c64(void); /**< @copydoc bs3TestIsVmmDevTestingPresent_c16 */ 129 #define bs3TestIsVmmDevTestingPresent BS3_CMN_NM(bs3TestIsVmmDevTestingPresent) /**< Selects #bs3TestIsVmmDevTestingPresent_c16, #bs3TestIsVmmDevTestingPresent_c32 or #bs3TestIsVmmDevTestingPresent_c64. */ 126 #ifndef DOXYGEN_RUNNING 127 # define bs3TestIsVmmDevTestingPresent BS3_CMN_NM(bs3TestIsVmmDevTestingPresent) 128 #endif 129 BS3_DECL(bool) bs3TestIsVmmDevTestingPresent(void); 130 130 131 131 /** 132 132 * Similar to rtTestSubCleanup. 133 133 */ 134 BS3_DECL(void) bs3TestSubCleanup_c16(void); 135 BS3_DECL(void) bs3TestSubCleanup_c32(void); /**< @copydoc bs3TestSubCleanup_c16 */ 136 BS3_DECL(void) bs3TestSubCleanup_c64(void); /**< @copydoc bs3TestSubCleanup_c16 */ 137 #define bs3TestSubCleanup BS3_CMN_NM(bs3TestSubCleanup) /**< Selects #bs3TestSubCleanup_c16, #bs3TestSubCleanup_c32 or #bs3TestSubCleanup_c64. */ 134 #ifndef DOXYGEN_RUNNING 135 # define bs3TestSubCleanup BS3_CMN_NM(bs3TestSubCleanup) 136 #endif 137 BS3_DECL(void) bs3TestSubCleanup(void); 138 138 139 139 /** … … 143 143 * The @a pvUser parameter must point a BS3TESTFAILEDBUF structure. } 144 144 */ 145 BS3_DECL_CALLBACK(size_t) bs3TestFailedStrOutput_c16(char ch, void BS3_FAR *pvUser); 146 BS3_DECL_CALLBACK(size_t) bs3TestFailedStrOutput_c32(char ch, void BS3_FAR *pvUser); 147 BS3_DECL_CALLBACK(size_t) bs3TestFailedStrOutput_c64(char ch, void BS3_FAR *pvUser); 148 #define bs3TestFailedStrOutput BS3_CMN_NM(bs3TestFailedStrOutput) /**< Selects #bs3TestFailedStrOutput_c16, #bs3TestFailedStrOutput_c32 or #bs3TestFailedStrOutput_c64. */ 145 #ifndef DOXYGEN_RUNNING 146 # define bs3TestFailedStrOutput BS3_CMN_NM(bs3TestFailedStrOutput) 147 #endif 148 BS3_DECL_CALLBACK(size_t) bs3TestFailedStrOutput(char ch, void BS3_FAR *pvUser); 149 149 150 150 /** -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-common.mac
r60439 r60527 65 65 66 66 %ifdef ASM_FORMAT_ELF 67 section BS3TEXT16_END align=2 progbits alloc exec nowrite 68 %else 69 section _TEXT align=2 CLASS=BS3CLASS16CODE PUBLIC USE16 70 section BS3TEXT16_END align=2 CLASS=BS3CLASS16CODE PUBLIC USE16 67 section BS3TEXT16_NEARSTUBS align=1 progbits alloc exec nowrite 68 section BS3TEXT16_FARSTUBS align=1 progbits alloc exec nowrite 69 section BS3TEXT16_END align=1 progbits alloc exec nowrite 70 %else 71 section _TEXT align=2 CLASS=BS3CLASS16CODE PUBLIC USE16 72 section BS3TEXT16_NEARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 73 section BS3TEXT16_FARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 74 section BS3TEXT16_END align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 71 75 %endif 72 76 … … 75 79 %ifndef ASM_FORMAT_ELF 76 80 %ifndef BS3_IS_DOS_EXE 77 GROUP CGROUP16 BS3TEXT16 BS3TEXT16_END81 GROUP CGROUP16 BS3TEXT16 _TEXT BS3TEXT16_NEARSTUBS BS3TEXT16_FARSTUBS BS3TEXT16_END 78 82 %else 79 GROUP CGROUP16 BEGTEXT BS3TEXT16 _TEXT BS3TEXT16_ END83 GROUP CGROUP16 BEGTEXT BS3TEXT16 _TEXT BS3TEXT16_NEARSTUBS BS3TEXT16_FARSTUBS BS3TEXT16_END 80 84 %endif 81 85 %endif … … 148 152 %endif 149 153 154 ; 155 ; 16-bit real-mode text 156 ; 157 %ifdef ASM_FORMAT_ELF 158 section BS3RMTEXT16_START align=16 progbits alloc exec nowrite 159 %else 160 section BS3RMTEXT16_START align=16 CLASS=BS3CLASS16RMCODE PUBLIC USE16 161 %endif 162 BS3_GLOBAL_DATA Bs3RmText16_StartOfSegment, 0 163 db 10,13,'eye-catcher: BS3RMTEXT16',10,13 164 165 BS3_BEGIN_RMTEXT16 166 167 %ifdef ASM_FORMAT_ELF 168 section BS3RMTEXT16_END align=1 progbits alloc exec nowrite 169 %else 170 section BS3RMTEXT16_END align=1 CLASS=BS3CLASS16RMCODE PUBLIC USE16 171 %endif 172 173 BS3_GLOBAL_DATA Bs3RmText16_EndOfSegment, 0 174 150 175 151 176 ; … … 161 186 section BS3TEXT32_END align=1 CLASS=BS3CLASS32CODE PUBLIC USE32 FLAT 162 187 %endif 163 164 188 BS3_GLOBAL_DATA Bs3Text32_EndOfSegment, 0 165 189 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-EnteredMode.asm
r60000 r60527 262 262 .return_stack_ok: 263 263 %endif 264 leave264 pop xBP 265 265 ret 266 .dbg_str:267 db 'CurrentMode=%#x', 0ah, 0268 266 BS3_PROC_END_MODE Bs3EnteredMode 269 267 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c
r60311 r60527 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 //#define BS3_USE_RM_TEXT_SEG 1 31 32 #include "bs3kit-template-header.h" 32 33 #include "bs3-cmn-test.h" 33 34 #include <iprt/asm-amd64-x86.h> 35 36 //#ifdef __WATCOMC__ 37 //# pragma code_seg("BS3RMTEXT16", "BS3CLASS16RMCODE") 38 //#endif 34 39 35 40 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitMemory.c
r60321 r60527 28 28 * Header Files * 29 29 *********************************************************************************************************************************/ 30 #define BS3_USE_RM_TEXT_SEG 1 30 31 #include "bs3kit-template-header.h" 31 32 #include "bs3-cmn-memory.h" 32 33 #include <iprt/asm.h> 34 35 #ifdef __WATCOMC__ 36 # pragma code_seg("BS3RMTEXT16", "BS3CLASS16RMCODE") 37 #endif 33 38 34 39 … … 234 239 235 240 236 BS3_DECL(void) B s3InitMemory_rm(void)241 BS3_DECL(void) BS3_FAR_CODE Bs3InitMemory_rm(void) 237 242 { 238 243 uint16_t i; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-header.h
r59863 r60527 138 138 #else /* !DOXYGEN_RUNNING */ 139 139 140 #undef BS3_CMN_NM 140 //#undef BS3_CMN_NM 141 //#undef BS3_CMN_FAR_NM 141 142 142 143 … … 205 206 # define TMPL_BITS 16 206 207 # define TMPL_UNDERSCORE _ 207 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 208 //# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 209 //# define BS3_CMN_FAR_NM(Name) RT_CONCAT(Name,_f16) 210 208 211 209 212 #elif (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_32 … … 214 217 # define TMPL_BITS 32 215 218 # define TMPL_UNDERSCORE _ 216 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32) 219 //# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32) 220 //# define BS3_CMN_FAR_NM(a_Name) RT_CONCAT(Name,_c32) 217 221 218 222 #elif (TMPL_MODE & BS3_MODE_CODE_MASK) == BS3_MODE_CODE_V86 … … 223 227 # define TMPL_BITS 16 224 228 # define TMPL_UNDERSCORE _ 225 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 229 //# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16) 230 //# define BS3_CMN_FAR_NM(Name) RT_CONCAT(Name,_f16) 226 231 # define TMPL_CMN_R86 227 232 # define TMPL_CMN_V86 … … 234 239 # define TMPL_BITS 64 235 240 # define TMPL_UNDERSCORE 236 # define BS3_CMN_NM(Name) RT_CONCAT(Name,_c64) 241 //# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c64) 242 //# define BS3_CMN_FAR_NM(a_Name) RT_CONCAT(Name,_c64) 237 243 238 244 #else -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60439 r60527 55 55 * declarations before we can define it. Thus the duplciate effort.) 56 56 */ 57 #define RT_MANGLER(a_Name) RT_CONCAT3(a_Name,_c,ARCH_BITS) 57 #if ARCH_BITS != 16 || !defined(BS3_USE_RM_TEXT_SEG) 58 # define RT_MANGLER(a_Name) RT_CONCAT3(a_Name,_c,ARCH_BITS) 59 #else 60 # define RT_MANGLER(a_Name) RT_CONCAT(a_Name,_f16) 61 #endif 58 62 #include <iprt/mangling.h> 59 63 #include <iprt/x86.h> 60 64 #include <iprt/err.h> 61 65 66 /* 67 * Include data symbol mangling (function mangling/mapping must be done 68 * after the protypes). 69 */ 70 #include "bs3kit-mangling-data.h" 62 71 63 72 … … 492 501 493 502 /** @def BS3_DECL 494 * Declares a BS3Kit function. 503 * Declares a BS3Kit function with default far/near. 504 * 505 * Until we outgrow BS3TEXT16, we use all near functions in 16-bit. 506 * 507 * @param a_Type The return type. */ 508 #if ARCH_BITS != 16 || !defined(BS3_USE_RM_TEXT_SEG) 509 # define BS3_DECL(a_Type) BS3_DECL_NEAR(a_Type) 510 #else 511 # define BS3_DECL(a_Type) BS3_DECL_FAR(a_Type) 512 #endif 513 514 /** @def BS3_DECL_NEAR 515 * Declares a BS3Kit function, always near everywhere. 495 516 * 496 517 * Until we outgrow BS3TEXT16, we use all near functions in 16-bit. … … 498 519 * @param a_Type The return type. */ 499 520 #ifdef IN_BS3KIT 500 # define BS3_DECL (a_Type)DECLEXPORT(a_Type) BS3_NEAR_CODE BS3_CALL521 # define BS3_DECL_NEAR(a_Type) DECLEXPORT(a_Type) BS3_NEAR_CODE BS3_CALL 501 522 #else 502 # define BS3_DECL(a_Type) DECLIMPORT(a_Type) BS3_NEAR_CODE BS3_CALL 523 # define BS3_DECL_NEAR(a_Type) DECLIMPORT(a_Type) BS3_NEAR_CODE BS3_CALL 524 #endif 525 526 /** @def BS3_DECL_FAR 527 * Declares a BS3Kit function, far 16-bit, otherwise near. 528 * 529 * Until we outgrow BS3TEXT16, we use all near functions in 16-bit. 530 * 531 * @param a_Type The return type. */ 532 #ifdef IN_BS3KIT 533 # define BS3_DECL_FAR(a_Type) DECLEXPORT(a_Type) BS3_FAR_CODE BS3_CALL 534 #else 535 # define BS3_DECL_FAR(a_Type) DECLIMPORT(a_Type) BS3_FAR_CODE BS3_CALL 503 536 #endif 504 537 … … 521 554 * 522 555 * @param a_Name The name of the function or global variable. 523 */ 524 #define BS3_CMN_NM(a_Name) RT_CONCAT3(a_Name,_c,ARCH_BITS) 556 * @todo fix code vs data issue with _f16 557 */ 558 #define BS3_CMN_NM(a_Name) RT_CONCAT3(a_Name,_c,ARCH_BITS) 559 560 /** 561 * Constructs a common function name, far in 16-bit code. 562 * 563 * Example: BS3_CMN_FAR_NM(Bs3Shutdown) 564 * 565 * @param a_Name The name of the function. 566 */ 567 #if ARCH_BITS == 16 568 # define BS3_CMN_FAR_NM(a_Name) RT_CONCAT(a_Name,_f16) 569 #else 570 # define BS3_CMN_FAR_NM(a_Name) RT_CONCAT3(a_Name,_c,ARCH_BITS) 571 #endif 572 573 /** 574 * Constructs a common function name, far or near as defined by the source. 575 * 576 * Which to use in 16-bit mode is defined by BS3_USE_RM_TEXT_SEG. In 32-bit and 577 * 64-bit mode there are no far symbols, only near ones. 578 * 579 * Example: BS3_CMN_FN_NM(Bs3Shutdown) 580 * 581 * @param a_Name The name of the function. 582 */ 583 #if ARCH_BITS != 16 || !defined(BS3_USE_RM_TEXT_SEG) 584 # define BS3_CMN_FN_NM(a_Name) BS3_CMN_NM(a_Name) 585 #else 586 # define BS3_CMN_FN_NM(a_Name) BS3_CMN_FAR_NM(a_Name) 587 #endif 588 525 589 526 590 /** 527 591 * Constructs a data name. 592 * 593 * This glosses over the underscore prefix usage of our 16-bit, 32-bit and 594 * 64-bit compilers. 528 595 * 529 596 * Example: @code{.c} … … 533 600 * 534 601 * @param a_Name The name of the global variable. 602 * @remarks Mainly used in bs3kit-mangling.h, internal headers and templates. 535 603 */ 536 604 #if ARCH_BITS == 64 … … 618 686 /** @defgroup grp_bs3kit_system System structures 619 687 * @{ */ 620 #if ARCH_BITS == 64 && !defined(DOXYGEN_RUNNING)621 # define Bs3Gdt BS3_DATA_NM(Bs3Gdt)622 # define Bs3Gdt_Ldt BS3_DATA_NM(Bs3Gdt_Ldt)623 # define Bs3Gdte_Tss16 BS3_DATA_NM(Bs3Gdte_Tss16)624 # define Bs3Gdte_Tss16DoubleFault BS3_DATA_NM(Bs3Gdte_Tss16DoubleFault)625 # define Bs3Gdte_Tss16Spare0 BS3_DATA_NM(Bs3Gdte_Tss16Spare0)626 # define Bs3Gdte_Tss16Spare1 BS3_DATA_NM(Bs3Gdte_Tss16Spare1)627 # define Bs3Gdte_Tss32 BS3_DATA_NM(Bs3Gdte_Tss32)628 # define Bs3Gdte_Tss32DoubleFault BS3_DATA_NM(Bs3Gdte_Tss32DoubleFault)629 # define Bs3Gdte_Tss32Spare0 BS3_DATA_NM(Bs3Gdte_Tss32Spare0)630 # define Bs3Gdte_Tss32Spare1 BS3_DATA_NM(Bs3Gdte_Tss32Spare1)631 # define Bs3Gdte_Tss32IobpIntRedirBm BS3_DATA_NM(Bs3Gdte_Tss32IobpIntRedirBm)632 # define Bs3Gdte_Tss32IntRedirBm BS3_DATA_NM(Bs3Gdte_Tss32IntRedirBm)633 # define Bs3Gdte_Tss64 BS3_DATA_NM(Bs3Gdte_Tss64)634 # define Bs3Gdte_Tss64Spare0 BS3_DATA_NM(Bs3Gdte_Tss64Spare0)635 # define Bs3Gdte_Tss64Spare1 BS3_DATA_NM(Bs3Gdte_Tss64Spare1)636 # define Bs3Gdte_Tss64Iobp BS3_DATA_NM(Bs3Gdte_Tss64Iobp)637 # define Bs3Gdte_R0_MMIO16 BS3_DATA_NM(Bs3Gdte_R0_MMIO16)638 639 # define Bs3Gdte_R0_First BS3_DATA_NM(Bs3Gdte_R0_First)640 # define Bs3Gdte_R0_CS16 BS3_DATA_NM(Bs3Gdte_R0_CS16)641 # define Bs3Gdte_R0_DS16 BS3_DATA_NM(Bs3Gdte_R0_DS16)642 # define Bs3Gdte_R0_SS16 BS3_DATA_NM(Bs3Gdte_R0_SS16)643 # define Bs3Gdte_R0_CS32 BS3_DATA_NM(Bs3Gdte_R0_CS32)644 # define Bs3Gdte_R0_DS32 BS3_DATA_NM(Bs3Gdte_R0_DS32)645 # define Bs3Gdte_R0_SS32 BS3_DATA_NM(Bs3Gdte_R0_SS32)646 # define Bs3Gdte_R0_CS64 BS3_DATA_NM(Bs3Gdte_R0_CS64)647 # define Bs3Gdte_R0_DS64 BS3_DATA_NM(Bs3Gdte_R0_DS64)648 # define Bs3Gdte_R0_CS16_EO BS3_DATA_NM(Bs3Gdte_R0_CS16_EO)649 # define Bs3Gdte_R0_CS16_CNF BS3_DATA_NM(Bs3Gdte_R0_CS16_CNF)650 # define Bs3Gdte_R0_CS16_CND_EO BS3_DATA_NM(Bs3Gdte_R0_CS16_CND_EO)651 # define Bs3Gdte_R0_CS32_EO BS3_DATA_NM(Bs3Gdte_R0_CS32_EO)652 # define Bs3Gdte_R0_CS32_CNF BS3_DATA_NM(Bs3Gdte_R0_CS32_CNF)653 # define Bs3Gdte_R0_CS32_CNF_EO BS3_DATA_NM(Bs3Gdte_R0_CS32_CNF_EO)654 # define Bs3Gdte_R0_CS64_EO BS3_DATA_NM(Bs3Gdte_R0_CS64_EO)655 # define Bs3Gdte_R0_CS64_CNF BS3_DATA_NM(Bs3Gdte_R0_CS64_CNF)656 # define Bs3Gdte_R0_CS64_CNF_EO BS3_DATA_NM(Bs3Gdte_R0_CS64_CNF_EO)657 658 # define Bs3Gdte_R1_First BS3_DATA_NM(Bs3Gdte_R1_First)659 # define Bs3Gdte_R1_CS16 BS3_DATA_NM(Bs3Gdte_R1_CS16)660 # define Bs3Gdte_R1_DS16 BS3_DATA_NM(Bs3Gdte_R1_DS16)661 # define Bs3Gdte_R1_SS16 BS3_DATA_NM(Bs3Gdte_R1_SS16)662 # define Bs3Gdte_R1_CS32 BS3_DATA_NM(Bs3Gdte_R1_CS32)663 # define Bs3Gdte_R1_DS32 BS3_DATA_NM(Bs3Gdte_R1_DS32)664 # define Bs3Gdte_R1_SS32 BS3_DATA_NM(Bs3Gdte_R1_SS32)665 # define Bs3Gdte_R1_CS64 BS3_DATA_NM(Bs3Gdte_R1_CS64)666 # define Bs3Gdte_R1_DS64 BS3_DATA_NM(Bs3Gdte_R1_DS64)667 # define Bs3Gdte_R1_CS16_EO BS3_DATA_NM(Bs3Gdte_R1_CS16_EO)668 # define Bs3Gdte_R1_CS16_CNF BS3_DATA_NM(Bs3Gdte_R1_CS16_CNF)669 # define Bs3Gdte_R1_CS16_CND_EO BS3_DATA_NM(Bs3Gdte_R1_CS16_CND_EO)670 # define Bs3Gdte_R1_CS32_EO BS3_DATA_NM(Bs3Gdte_R1_CS32_EO)671 # define Bs3Gdte_R1_CS32_CNF BS3_DATA_NM(Bs3Gdte_R1_CS32_CNF)672 # define Bs3Gdte_R1_CS32_CNF_EO BS3_DATA_NM(Bs3Gdte_R1_CS32_CNF_EO)673 # define Bs3Gdte_R1_CS64_EO BS3_DATA_NM(Bs3Gdte_R1_CS64_EO)674 # define Bs3Gdte_R1_CS64_CNF BS3_DATA_NM(Bs3Gdte_R1_CS64_CNF)675 # define Bs3Gdte_R1_CS64_CNF_EO BS3_DATA_NM(Bs3Gdte_R1_CS64_CNF_EO)676 677 # define Bs3Gdte_R2_First BS3_DATA_NM(Bs3Gdte_R2_First)678 # define Bs3Gdte_R2_CS16 BS3_DATA_NM(Bs3Gdte_R2_CS16)679 # define Bs3Gdte_R2_DS16 BS3_DATA_NM(Bs3Gdte_R2_DS16)680 # define Bs3Gdte_R2_SS16 BS3_DATA_NM(Bs3Gdte_R2_SS16)681 # define Bs3Gdte_R2_CS32 BS3_DATA_NM(Bs3Gdte_R2_CS32)682 # define Bs3Gdte_R2_DS32 BS3_DATA_NM(Bs3Gdte_R2_DS32)683 # define Bs3Gdte_R2_SS32 BS3_DATA_NM(Bs3Gdte_R2_SS32)684 # define Bs3Gdte_R2_CS64 BS3_DATA_NM(Bs3Gdte_R2_CS64)685 # define Bs3Gdte_R2_DS64 BS3_DATA_NM(Bs3Gdte_R2_DS64)686 # define Bs3Gdte_R2_CS16_EO BS3_DATA_NM(Bs3Gdte_R2_CS16_EO)687 # define Bs3Gdte_R2_CS16_CNF BS3_DATA_NM(Bs3Gdte_R2_CS16_CNF)688 # define Bs3Gdte_R2_CS16_CND_EO BS3_DATA_NM(Bs3Gdte_R2_CS16_CND_EO)689 # define Bs3Gdte_R2_CS32_EO BS3_DATA_NM(Bs3Gdte_R2_CS32_EO)690 # define Bs3Gdte_R2_CS32_CNF BS3_DATA_NM(Bs3Gdte_R2_CS32_CNF)691 # define Bs3Gdte_R2_CS32_CNF_EO BS3_DATA_NM(Bs3Gdte_R2_CS32_CNF_EO)692 # define Bs3Gdte_R2_CS64_EO BS3_DATA_NM(Bs3Gdte_R2_CS64_EO)693 # define Bs3Gdte_R2_CS64_CNF BS3_DATA_NM(Bs3Gdte_R2_CS64_CNF)694 # define Bs3Gdte_R2_CS64_CNF_EO BS3_DATA_NM(Bs3Gdte_R2_CS64_CNF_EO)695 696 # define Bs3Gdte_R3_First BS3_DATA_NM(Bs3Gdte_R3_First)697 # define Bs3Gdte_R3_CS16 BS3_DATA_NM(Bs3Gdte_R3_CS16)698 # define Bs3Gdte_R3_DS16 BS3_DATA_NM(Bs3Gdte_R3_DS16)699 # define Bs3Gdte_R3_SS16 BS3_DATA_NM(Bs3Gdte_R3_SS16)700 # define Bs3Gdte_R3_CS32 BS3_DATA_NM(Bs3Gdte_R3_CS32)701 # define Bs3Gdte_R3_DS32 BS3_DATA_NM(Bs3Gdte_R3_DS32)702 # define Bs3Gdte_R3_SS32 BS3_DATA_NM(Bs3Gdte_R3_SS32)703 # define Bs3Gdte_R3_CS64 BS3_DATA_NM(Bs3Gdte_R3_CS64)704 # define Bs3Gdte_R3_DS64 BS3_DATA_NM(Bs3Gdte_R3_DS64)705 # define Bs3Gdte_R3_CS16_EO BS3_DATA_NM(Bs3Gdte_R3_CS16_EO)706 # define Bs3Gdte_R3_CS16_CNF BS3_DATA_NM(Bs3Gdte_R3_CS16_CNF)707 # define Bs3Gdte_R3_CS16_CND_EO BS3_DATA_NM(Bs3Gdte_R3_CS16_CND_EO)708 # define Bs3Gdte_R3_CS32_EO BS3_DATA_NM(Bs3Gdte_R3_CS32_EO)709 # define Bs3Gdte_R3_CS32_CNF BS3_DATA_NM(Bs3Gdte_R3_CS32_CNF)710 # define Bs3Gdte_R3_CS32_CNF_EO BS3_DATA_NM(Bs3Gdte_R3_CS32_CNF_EO)711 # define Bs3Gdte_R3_CS64_EO BS3_DATA_NM(Bs3Gdte_R3_CS64_EO)712 # define Bs3Gdte_R3_CS64_CNF BS3_DATA_NM(Bs3Gdte_R3_CS64_CNF)713 # define Bs3Gdte_R3_CS64_CNF_EO BS3_DATA_NM(Bs3Gdte_R3_CS64_CNF_EO)714 715 # define Bs3GdteSpare00 BS3_DATA_NM(Bs3GdteSpare00)716 # define Bs3GdteSpare01 BS3_DATA_NM(Bs3GdteSpare01)717 # define Bs3GdteSpare02 BS3_DATA_NM(Bs3GdteSpare02)718 # define Bs3GdteSpare03 BS3_DATA_NM(Bs3GdteSpare03)719 # define Bs3GdteSpare04 BS3_DATA_NM(Bs3GdteSpare04)720 # define Bs3GdteSpare05 BS3_DATA_NM(Bs3GdteSpare05)721 # define Bs3GdteSpare06 BS3_DATA_NM(Bs3GdteSpare06)722 # define Bs3GdteSpare07 BS3_DATA_NM(Bs3GdteSpare07)723 # define Bs3GdteSpare08 BS3_DATA_NM(Bs3GdteSpare08)724 # define Bs3GdteSpare09 BS3_DATA_NM(Bs3GdteSpare09)725 # define Bs3GdteSpare0a BS3_DATA_NM(Bs3GdteSpare0a)726 # define Bs3GdteSpare0b BS3_DATA_NM(Bs3GdteSpare0b)727 # define Bs3GdteSpare0c BS3_DATA_NM(Bs3GdteSpare0c)728 # define Bs3GdteSpare0d BS3_DATA_NM(Bs3GdteSpare0d)729 # define Bs3GdteSpare0e BS3_DATA_NM(Bs3GdteSpare0e)730 # define Bs3GdteSpare0f BS3_DATA_NM(Bs3GdteSpare0f)731 # define Bs3GdteSpare10 BS3_DATA_NM(Bs3GdteSpare10)732 # define Bs3GdteSpare11 BS3_DATA_NM(Bs3GdteSpare11)733 # define Bs3GdteSpare12 BS3_DATA_NM(Bs3GdteSpare12)734 # define Bs3GdteSpare13 BS3_DATA_NM(Bs3GdteSpare13)735 # define Bs3GdteSpare14 BS3_DATA_NM(Bs3GdteSpare14)736 # define Bs3GdteSpare15 BS3_DATA_NM(Bs3GdteSpare15)737 # define Bs3GdteSpare16 BS3_DATA_NM(Bs3GdteSpare16)738 # define Bs3GdteSpare17 BS3_DATA_NM(Bs3GdteSpare17)739 # define Bs3GdteSpare18 BS3_DATA_NM(Bs3GdteSpare18)740 # define Bs3GdteSpare19 BS3_DATA_NM(Bs3GdteSpare19)741 # define Bs3GdteSpare1a BS3_DATA_NM(Bs3GdteSpare1a)742 # define Bs3GdteSpare1b BS3_DATA_NM(Bs3GdteSpare1b)743 # define Bs3GdteSpare1c BS3_DATA_NM(Bs3GdteSpare1c)744 # define Bs3GdteSpare1d BS3_DATA_NM(Bs3GdteSpare1d)745 # define Bs3GdteSpare1e BS3_DATA_NM(Bs3GdteSpare1e)746 # define Bs3GdteSpare1f BS3_DATA_NM(Bs3GdteSpare1f)747 748 # define Bs3GdteTiled BS3_DATA_NM(Bs3GdteTiled)749 # define Bs3GdteFreePart1 BS3_DATA_NM(Bs3GdteFreePart1)750 # define Bs3Gdte_CODE16 BS3_DATA_NM(Bs3Gdte_CODE16)751 # define Bs3GdteFreePart2 BS3_DATA_NM(Bs3GdteFreePart2)752 # define Bs3Gdte_SYSTEM16 BS3_DATA_NM(Bs3Gdte_SYSTEM16)753 # define Bs3GdteFreePart3 BS3_DATA_NM(Bs3GdteFreePart3)754 # define Bs3Gdte_DATA16 BS3_DATA_NM(Bs3Gdte_DATA16)755 756 # define Bs3GdteFreePart4 BS3_DATA_NM(Bs3GdteFreePart4)757 # define Bs3GdtePreTestPage08 BS3_DATA_NM(Bs3GdtePreTestPage08)758 # define Bs3GdtePreTestPage07 BS3_DATA_NM(Bs3GdtePreTestPage07)759 # define Bs3GdtePreTestPage06 BS3_DATA_NM(Bs3GdtePreTestPage06)760 # define Bs3GdtePreTestPage05 BS3_DATA_NM(Bs3GdtePreTestPage05)761 # define Bs3GdtePreTestPage04 BS3_DATA_NM(Bs3GdtePreTestPage04)762 # define Bs3GdtePreTestPage03 BS3_DATA_NM(Bs3GdtePreTestPage03)763 # define Bs3GdtePreTestPage02 BS3_DATA_NM(Bs3GdtePreTestPage02)764 # define Bs3GdtePreTestPage01 BS3_DATA_NM(Bs3GdtePreTestPage01)765 # define Bs3GdteTestPage BS3_DATA_NM(Bs3GdteTestPage)766 # define Bs3GdteTestPage00 BS3_DATA_NM(Bs3GdteTestPage00)767 # define Bs3GdteTestPage01 BS3_DATA_NM(Bs3GdteTestPage01)768 # define Bs3GdteTestPage02 BS3_DATA_NM(Bs3GdteTestPage02)769 # define Bs3GdteTestPage03 BS3_DATA_NM(Bs3GdteTestPage03)770 # define Bs3GdteTestPage04 BS3_DATA_NM(Bs3GdteTestPage04)771 # define Bs3GdteTestPage05 BS3_DATA_NM(Bs3GdteTestPage05)772 # define Bs3GdteTestPage06 BS3_DATA_NM(Bs3GdteTestPage06)773 # define Bs3GdteTestPage07 BS3_DATA_NM(Bs3GdteTestPage07)774 775 # define Bs3GdtEnd BS3_DATA_NM(Bs3GdtEnd)776 777 # define Bs3Tss16 BS3_DATA_NM(Bs3Tss16)778 # define Bs3Tss16DoubleFault BS3_DATA_NM(Bs3Tss16DoubleFault)779 # define Bs3Tss16Spare0 BS3_DATA_NM(Bs3Tss16Spare0)780 # define Bs3Tss16Spare1 BS3_DATA_NM(Bs3Tss16Spare1)781 # define Bs3Tss32 BS3_DATA_NM(Bs3Tss32)782 # define Bs3Tss32DoubleFault BS3_DATA_NM(Bs3Tss32DoubleFault)783 # define Bs3Tss32Spare0 BS3_DATA_NM(Bs3Tss32Spare0)784 # define Bs3Tss32Spare1 BS3_DATA_NM(Bs3Tss32Spare1)785 # define Bs3Tss64 BS3_DATA_NM(Bs3Tss64)786 # define Bs3Tss64Spare0 BS3_DATA_NM(Bs3Tss64Spare0)787 # define Bs3Tss64Spare1 BS3_DATA_NM(Bs3Tss64Spare1)788 # define Bs3Tss64WithIopb BS3_DATA_NM(Bs3Tss64WithIopb)789 # define Bs3Tss32WithIopb BS3_DATA_NM(Bs3Tss32WithIopb)790 # define Bs3SharedIntRedirBm BS3_DATA_NM(Bs3SharedIntRedirBm)791 # define Bs3SharedIobp BS3_DATA_NM(Bs3SharedIobp)792 # define Bs3SharedIobpEnd BS3_DATA_NM(Bs3SharedIobpEnd)793 # define Bs3Idt16 BS3_DATA_NM(Bs3Idt16)794 # define Bs3Idt32 BS3_DATA_NM(Bs3Idt32)795 # define Bs3Idt64 BS3_DATA_NM(Bs3Idt64)796 # define Bs3Lidt_Idt16 BS3_DATA_NM(Bs3Lidt_Idt16)797 # define Bs3Lidt_Idt32 BS3_DATA_NM(Bs3Lidt_Idt32)798 # define Bs3Lidt_Idt64 BS3_DATA_NM(Bs3Lidt_Idt64)799 # define Bs3Lidt_Ivt BS3_DATA_NM(Bs3Lidt_Ivt)800 # define Bs3Lgdt_Gdt BS3_DATA_NM(Bs3Lgdt_Gdt)801 # define Bs3Ldt BS3_DATA_NM(Bs3Ldt)802 # define Bs3LdtEnd BS3_DATA_NM(Bs3LdtEnd)803 #endif /* ARCH_BITS == 64 && !DOXYGEN_RUNNING*/804 805 688 /** The GDT, indexed by BS3_SEL_XXX shifted by 3. */ 806 689 extern X86DESC BS3_FAR_DATA Bs3Gdt[(BS3_SEL_GDT_LIMIT + 1) / 8]; … … 1024 907 * @{ */ 1025 908 /** Start of the BS3TEXT16 segment. */ 1026 #ifndef DOXYGEN_RUNNING1027 # define Bs3Text16_StartOfSegment BS3_DATA_NM(Bs3Text16_StartOfSegment)1028 #endif1029 909 extern uint8_t BS3_FAR_DATA Bs3Text16_StartOfSegment; 1030 910 /** End of the BS3TEXT16 segment. */ 1031 #ifndef DOXYGEN_RUNNING1032 # define Bs3Text16_EndOfSegment BS3_DATA_NM(Bs3Text16_EndOfSegment)1033 #endif1034 911 extern uint8_t BS3_FAR_DATA Bs3Text16_EndOfSegment; 1035 912 /** The size of the BS3TEXT16 segment. */ 1036 #ifndef DOXYGEN_RUNNING1037 # define Bs3Text16_Size BS3_DATA_NM(Bs3Text16_Size)1038 #endif1039 913 extern uint16_t BS3_FAR_DATA Bs3Text16_Size; 1040 914 1041 915 /** Start of the BS3SYSTEM16 segment. */ 1042 #ifndef DOXYGEN_RUNNING1043 # define Bs3System16_StartOfSegment BS3_DATA_NM(Bs3System16_StartOfSegment)1044 #endif1045 916 extern uint8_t BS3_FAR_DATA Bs3System16_StartOfSegment; 1046 917 /** End of the BS3SYSTEM16 segment. */ 1047 #ifndef DOXYGEN_RUNNING1048 # define Bs3System16_EndOfSegment BS3_DATA_NM(Bs3System16_EndOfSegment)1049 #endif1050 918 extern uint8_t BS3_FAR_DATA Bs3System16_EndOfSegment; 1051 919 1052 920 /** Start of the BS3DATA16/BS3KIT_GRPNM_DATA16 segment. */ 1053 #ifndef DOXYGEN_RUNNING1054 # define Bs3Data16_StartOfSegment BS3_DATA_NM(Bs3Data16_StartOfSegment)1055 #endif1056 921 extern uint8_t BS3_FAR_DATA Bs3Data16_StartOfSegment; 1057 922 /** End of the BS3DATA16/BS3KIT_GRPNM_DATA16 segment. */ 1058 #ifndef DOXYGEN_RUNNING1059 # define Bs3Data16_EndOfSegment BS3_DATA_NM(Bs3Data16_EndOfSegment)1060 #endif1061 923 extern uint8_t BS3_FAR_DATA Bs3Data16_EndOfSegment; 1062 924 1063 925 /** Start of the BS3TEXT32 segment. */ 1064 #ifndef DOXYGEN_RUNNING1065 # define Bs3Text32_StartOfSegment BS3_DATA_NM(Bs3Text32_StartOfSegment)1066 #endif1067 926 extern uint8_t BS3_FAR_DATA Bs3Text32_StartOfSegment; 1068 927 /** Start of the BS3TEXT32 segment. */ 1069 #ifndef DOXYGEN_RUNNING1070 # define Bs3Text32_EndOfSegment BS3_DATA_NM(Bs3Text32_EndOfSegment)1071 #endif1072 928 extern uint8_t BS3_FAR_DATA Bs3Text32_EndOfSegment; 1073 929 1074 930 /** Start of the BS3DATA32 segment. */ 1075 #ifndef DOXYGEN_RUNNING1076 # define Bs3Data32_StartOfSegment BS3_DATA_NM(Bs3Data32_StartOfSegment)1077 #endif1078 931 extern uint8_t BS3_FAR_DATA Bs3Data32_StartOfSegment; 1079 932 /** Start of the BS3DATA32 segment. */ 1080 #ifndef DOXYGEN_RUNNING1081 # define Bs3Data32_EndOfSegment BS3_DATA_NM(Bs3Data32_EndOfSegment)1082 #endif1083 933 extern uint8_t BS3_FAR_DATA Bs3Data32_EndOfSegment; 1084 934 1085 935 /** Start of the BS3TEXT64 segment. */ 1086 #ifndef DOXYGEN_RUNNING1087 # define Bs3Text64_StartOfSegment BS3_DATA_NM(Bs3Text64_StartOfSegment)1088 #endif1089 936 extern uint8_t BS3_FAR_DATA Bs3Text64_StartOfSegment; 1090 937 /** Start of the BS3TEXT64 segment. */ 1091 #ifndef DOXYGEN_RUNNING1092 # define Bs3Text64_EndOfSegment BS3_DATA_NM(Bs3Text64_EndOfSegment)1093 #endif1094 938 extern uint8_t BS3_FAR_DATA Bs3Text64_EndOfSegment; 1095 939 1096 940 /** Start of the BS3DATA64 segment. */ 1097 #ifndef DOXYGEN_RUNNING1098 # define Bs3Data64_StartOfSegment BS3_DATA_NM(Bs3Data64_StartOfSegment)1099 #endif1100 941 extern uint8_t BS3_FAR_DATA Bs3Data64_StartOfSegment; 1101 942 /** Start of the BS3DATA64 segment. */ 1102 #ifndef DOXYGEN_RUNNING1103 # define Bs3Data64_EndOfSegment BS3_DATA_NM(Bs3Data64_EndOfSegment)1104 #endif1105 943 extern uint8_t BS3_FAR_DATA Bs3Data64_EndOfSegment; 1106 944 1107 945 /** The size of the Data16, Text32, Text64, Data32 and Data64 blob. */ 1108 #ifndef DOXYGEN_RUNNING1109 # define Bs3Data16Thru64Text32And64_TotalSize BS3_DATA_NM(Bs3Data16Thru64Text32And64_TotalSize)1110 #endif1111 946 extern uint32_t BS3_FAR_DATA Bs3Data16Thru64Text32And64_TotalSize; 1112 947 /** The total image size (from Text16 thu Data64). */ 1113 #ifndef DOXYGEN_RUNNING1114 # define Bs3TotalImageSize BS3_DATA_NM(Bs3TotalImageSize)1115 #endif1116 948 extern uint32_t BS3_FAR_DATA Bs3TotalImageSize; 1117 949 /** @} */ … … 1119 951 1120 952 /** Lower case hex digits. */ 1121 #ifndef DOXYGEN_RUNNING1122 # define g_achBs3HexDigits BS3_DATA_NM(g_achBs3HexDigits)1123 #endif1124 953 extern char const g_achBs3HexDigits[16+1]; 1125 954 /** Upper case hex digits. */ 1126 #ifndef DOXYGEN_RUNNING1127 # define g_achBs3HexDigitsUpper BS3_DATA_NM(g_achBs3HexDigitsUpper)1128 #endif1129 955 extern char const g_achBs3HexDigitsUpper[16+1]; 1130 956 1131 957 1132 958 /** The current mode (BS3_MODE_XXX) of CPU \#0. */ 1133 #ifndef DOXYGEN_RUNNING1134 # define g_bBs3CurrentMode BS3_DATA_NM(g_bBs3CurrentMode)1135 #endif1136 959 extern uint8_t g_bBs3CurrentMode; 1137 960 1138 961 /** Hint for 16-bit trap handlers regarding the high word of EIP. */ 1139 #ifndef DOXYGEN_RUNNING1140 # define g_uBs3TrapEipHint BS3_DATA_NM(g_uBs3TrapEipHint)1141 #endif1142 962 extern uint32_t g_uBs3TrapEipHint; 963 964 /** Copy of the original real-mode interrupt vector table. */ 965 extern RTFAR16 g_aBs3RmIvtOriginal[256]; 1143 966 1144 967 … … 1403 1226 */ 1404 1227 1228 /** @def BS3_CMN_PROTO 1229 * Macro for prototyping all the variations of a common function. 1230 * @param a_RetType The return type. 1231 * @param a_Name The function basename. 1232 * @param a_Params The parameter list (in parentheses). 1233 * @param a_fAutoStub Whether to autogenerate a 16-bit near -> 16-bit far stub 1234 * function. Either 'true' for stub or 'false' for no stub. 1235 */ 1236 #if ARCH_BITS == 16 1237 # define BS3_CMN_PROTO(a_RetType, a_Name, a_Params, a_fAutoStub) \ 1238 BS3_DECL_NEAR(a_RetType) BS3_CMN_NM(a_Name) a_Params; \ 1239 BS3_DECL_FAR(a_RetType) BS3_CMN_FAR_NM(a_Name) a_Params 1240 #else 1241 # define BS3_CMN_PROTO(a_RetType, a_Name, a_Params, a_fAutoStub) \ 1242 BS3_DECL_NEAR(a_RetType) BS3_CMN_NM(a_Name) a_Params 1243 #endif 1244 1245 /** @def BS3_CMN_DEF 1246 * Macro for defining a common function. 1247 * 1248 * This makes 16-bit common function far, while 32-bit and 64-bit are near. 1249 * 1250 * @param a_RetType The return type. 1251 * @param a_Name The function basename. 1252 * @param a_Params The parameter list (in parentheses). 1253 */ 1254 #if ARCH_BITS == 16 1255 # define BS3_CMN_DEF(a_RetType, a_Name, a_Params) \ 1256 BS3_DECL_FAR(a_RetType) BS3_CMN_FAR_NM(a_Name) a_Params 1257 #else 1258 # define BS3_CMN_DEF(a_RetType, a_Name, a_Params) \ 1259 BS3_DECL_NEAR(a_RetType) BS3_CMN_NM(a_Name) a_Params 1260 #endif 1261 1262 /** @def BS3_ASSERT 1263 * Assert that an expression is true. 1264 * 1265 * Calls Bs3Panic if false and it's a strict build. Does nothing in 1266 * non-strict builds. */ 1405 1267 #ifdef BS3_STRICT 1406 1268 # define BS3_ASSERT(a_Expr) do { if (!!(a_Expr)) { /* likely */ } else { Bs3Panic(); } } while (0) /**< @todo later */ … … 1414 1276 * The current implementation will only halt the CPU. 1415 1277 */ 1416 BS3_DECL(DECL_NO_RETURN(void)) Bs3Panic_c16(void); 1417 BS3_DECL(DECL_NO_RETURN(void)) Bs3Panic_c32(void); /**< @copydoc Bs3Panic_c16 */ 1418 BS3_DECL(DECL_NO_RETURN(void)) Bs3Panic_c64(void); /**< @copydoc Bs3Panic_c16 */ 1419 #define Bs3Panic BS3_CMN_NM(Bs3Panic) /**< Selects #Bs3Panic_c16, #Bs3Panic_c32 or #Bs3Panic_c64. */ 1278 BS3_CMN_PROTO(DECL_NO_RETURN(void), Bs3Panic,(void), false); 1420 1279 #if !defined(BS3_KIT_WITH_NO_RETURN) && defined(__WATCOMC__) 1421 1280 # pragma aux Bs3Panic_c16 __aborts 1281 # pragma aux Bs3Panic_f16 __aborts 1422 1282 # pragma aux Bs3Panic_c32 __aborts 1423 1283 #endif … … 1429 1289 * just halt the CPU. 1430 1290 */ 1431 BS3_DECL(void) Bs3Shutdown_c16(void); 1432 BS3_DECL(void) Bs3Shutdown_c32(void); /**< @copydoc Bs3Shutdown_c16 */ 1433 BS3_DECL(void) Bs3Shutdown_c64(void); /**< @copydoc Bs3Shutdown_c16 */ 1434 #define Bs3Shutdown BS3_CMN_NM(Bs3Shutdown) /**< Selects #Bs3Shutdown_c16, #Bs3Shutdown_c32 or #Bs3Shutdown_c64. */ 1291 BS3_CMN_PROTO(void, Bs3Shutdown,(void), false); 1435 1292 1436 1293 /** … … 1439 1296 * @param uValue The 32-bit value. 1440 1297 */ 1441 BS3_DECL(void) Bs3PrintU32_c16(uint32_t uValue); 1442 BS3_DECL(void) Bs3PrintU32_c32(uint32_t uValue); /**< @copydoc Bs3PrintU32_c16 */ 1443 BS3_DECL(void) Bs3PrintU32_c64(uint32_t uValue); /**< @copydoc Bs3PrintU32_c16 */ 1444 #define Bs3PrintU32 BS3_CMN_NM(Bs3PrintU32) /**< Selects #Bs3PrintU32_c16, #Bs3PrintU32_c32 or #Bs3PrintU32_c64. */ 1298 BS3_CMN_PROTO(void, Bs3PrintU32,(uint32_t uValue), false); 1445 1299 1446 1300 /** … … 1449 1303 * @param uValue The 32-bit value. 1450 1304 */ 1451 BS3_DECL(void) Bs3PrintX32_c16(uint32_t uValue); 1452 BS3_DECL(void) Bs3PrintX32_c32(uint32_t uValue); /**< @copydoc Bs3PrintX32_c16 */ 1453 BS3_DECL(void) Bs3PrintX32_c64(uint32_t uValue); /**< @copydoc Bs3PrintX32_c16 */ 1454 #define Bs3PrintX32 BS3_CMN_NM(Bs3PrintX32) /**< Selects #Bs3PrintX32_c16, #Bs3PrintX32_c32 or #Bs3PrintX32_c64. */ 1305 BS3_CMN_PROTO(void, Bs3PrintX32,(uint32_t uValue), false); 1455 1306 1456 1307 /** … … 1462 1313 * @param ... Format arguments. 1463 1314 */ 1464 BS3_DECL(size_t) Bs3Printf_c16(const char BS3_FAR *pszFormat, ...); 1465 BS3_DECL(size_t) Bs3Printf_c32(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3Printf_c16 */ 1466 BS3_DECL(size_t) Bs3Printf_c64(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3Printf_c16 */ 1467 #define Bs3Printf BS3_CMN_NM(Bs3Printf) /**< Selects #Bs3Printf_c16, #Bs3Printf_c32 or #Bs3Printf_c64. */ 1315 BS3_CMN_PROTO(size_t, Bs3Printf,(const char BS3_FAR *pszFormat, ...), true); 1468 1316 1469 1317 /** … … 1475 1323 * @param va Format arguments. 1476 1324 */ 1477 BS3_DECL(size_t) Bs3PrintfV_c16(const char BS3_FAR *pszFormat, va_list va); 1478 BS3_DECL(size_t) Bs3PrintfV_c32(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3PrintfV_c16 */ 1479 BS3_DECL(size_t) Bs3PrintfV_c64(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3PrintfV_c16 */ 1480 #define Bs3PrintfV BS3_CMN_NM(Bs3PrintfV) /**< Selects #Bs3PrintfV_c16, #Bs3PrintfV_c32 or #Bs3PrintfV_c64. */ 1325 BS3_CMN_PROTO(size_t, Bs3PrintfV,(const char BS3_FAR *pszFormat, va_list va), true); 1481 1326 1482 1327 /** … … 1485 1330 * @param pszString The string to print. 1486 1331 */ 1487 BS3_DECL(void) Bs3PrintStr_c16(const char BS3_FAR *pszString); 1488 BS3_DECL(void) Bs3PrintStr_c32(const char BS3_FAR *pszString); /**< @copydoc Bs3PrintStr_c16 */ 1489 BS3_DECL(void) Bs3PrintStr_c64(const char BS3_FAR *pszString); /**< @copydoc Bs3PrintStr_c16 */ 1490 #define Bs3PrintStr BS3_CMN_NM(Bs3PrintStr) /**< Selects #Bs3PrintStr_c16, #Bs3PrintStr_c32 or #Bs3PrintStr_c64. */ 1332 BS3_CMN_PROTO(void, Bs3PrintStr,(const char BS3_FAR *pszString), true); 1491 1333 1492 1334 /** … … 1496 1338 * @param cchString The exact number of characters to print. 1497 1339 */ 1498 BS3_DECL(void) Bs3PrintStrN_c16(const char BS3_FAR *pszString, size_t cchString); 1499 BS3_DECL(void) Bs3PrintStrN_c32(const char BS3_FAR *pszString, size_t cchString); /**< @copydoc Bs3PrintStrN_c16 */ 1500 BS3_DECL(void) Bs3PrintStrN_c64(const char BS3_FAR *pszString, size_t cchString); /**< @copydoc Bs3PrintStrN_c16 */ 1501 #define Bs3PrintStrN BS3_CMN_NM(Bs3PrintStrN) /**< Selects #Bs3PrintStrN_c16, #Bs3PrintStrN_c32 or #Bs3PrintStrN_c64. */ 1340 BS3_CMN_PROTO(void, Bs3PrintStrN,(const char BS3_FAR *pszString, size_t cchString), false); 1502 1341 1503 1342 /** … … 1506 1345 * @param ch The character to print. 1507 1346 */ 1508 BS3_DECL(void) Bs3PrintChr_c16(char ch); 1509 BS3_DECL(void) Bs3PrintChr_c32(char ch); /**< @copydoc Bs3PrintChr_c16 */ 1510 BS3_DECL(void) Bs3PrintChr_c64(char ch); /**< @copydoc Bs3PrintChr_c16 */ 1511 #define Bs3PrintChr BS3_CMN_NM(Bs3PrintChr) /**< Selects #Bs3PrintChr_c16, #Bs3PrintChr_c32 or #Bs3PrintChr_c64. */ 1347 BS3_CMN_PROTO(void, Bs3PrintChr,(char ch), false); 1512 1348 1513 1349 … … 1543 1379 * @param pvUser The user argument for the output function. 1544 1380 */ 1545 BS3_DECL(size_t) Bs3StrFormatV_c16(const char BS3_FAR *pszFormat, va_list va, 1546 PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser); 1547 /** @copydoc Bs3StrFormatV_c16 */ 1548 BS3_DECL(size_t) Bs3StrFormatV_c32(const char BS3_FAR *pszFormat, va_list va, 1549 PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser); 1550 /** @copydoc Bs3StrFormatV_c16 */ 1551 BS3_DECL(size_t) Bs3StrFormatV_c64(const char BS3_FAR *pszFormat, va_list va, 1552 PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser); 1553 #define Bs3StrFormatV BS3_CMN_NM(Bs3StrFormatV) /**< Selects #Bs3StrFormatV_c16, #Bs3StrFormatV_c32 or #Bs3StrFormatV_c64. */ 1381 BS3_CMN_PROTO(size_t, Bs3StrFormatV,(const char BS3_FAR *pszFormat, va_list va, 1382 PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser), true); 1554 1383 1555 1384 /** … … 1565 1394 * @param va Format arguments. 1566 1395 */ 1567 BS3_DECL(size_t) Bs3StrPrintfV_c16(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, va_list va); 1568 /** @copydoc Bs3StrPrintfV_c16 */ 1569 BS3_DECL(size_t) Bs3StrPrintfV_c32(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, va_list va); 1570 /** @copydoc Bs3StrPrintfV_c16 */ 1571 BS3_DECL(size_t) Bs3StrPrintfV_c64(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, va_list va); 1572 #define Bs3StrPrintfV BS3_CMN_NM(Bs3StrPrintfV) /**< Selects #Bs3StrPrintfV_c16, #Bs3StrPrintfV_c32 or #Bs3StrPrintfV_c64. */ 1396 BS3_CMN_PROTO(size_t, Bs3StrPrintfV,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, va_list va), true); 1573 1397 1574 1398 /** … … 1584 1408 * @param ... Format arguments. 1585 1409 */ 1586 BS3_DECL(size_t) Bs3StrPrintf_c16(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, ...); 1587 /** @copydoc Bs3StrPrintf_c16 */ 1588 BS3_DECL(size_t) Bs3StrPrintf_c32(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, ...); 1589 /** @copydoc Bs3StrPrintf_c16 */ 1590 BS3_DECL(size_t) Bs3StrPrintf_c64(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, ...); 1591 #define Bs3StrPrintf BS3_CMN_NM(Bs3StrPrintf) /**< Selects #Bs3StrPrintf_c16, #Bs3StrPrintf_c32 or #Bs3StrPrintf_c64. */ 1410 BS3_CMN_PROTO(size_t, Bs3StrPrintf,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, ...), true); 1592 1411 1593 1412 … … 1598 1417 * @param pszString The string to examine. 1599 1418 */ 1600 BS3_DECL(size_t) Bs3StrLen_c16(const char BS3_FAR *pszString); 1601 BS3_DECL(size_t) Bs3StrLen_c32(const char BS3_FAR *pszString); /** @copydoc Bs3StrLen_c16 */ 1602 BS3_DECL(size_t) Bs3StrLen_c64(const char BS3_FAR *pszString); /** @copydoc Bs3StrLen_c16 */ 1603 #define Bs3StrLen BS3_CMN_NM(Bs3StrLen) /**< Selects #Bs3StrLen_c16, #Bs3StrLen_c32 or #Bs3StrLen_c64. */ 1419 BS3_CMN_PROTO(size_t, Bs3StrLen,(const char BS3_FAR *pszString), true); 1604 1420 1605 1421 /** … … 1611 1427 * @param cchMax The max length to examine. 1612 1428 */ 1613 BS3_DECL(size_t) Bs3StrNLen_c16(const char BS3_FAR *pszString, size_t cchMax); 1614 BS3_DECL(size_t) Bs3StrNLen_c32(const char BS3_FAR *pszString, size_t cchMax); /** @copydoc Bs3StrNLen_c16 */ 1615 BS3_DECL(size_t) Bs3StrNLen_c64(const char BS3_FAR *pszString, size_t cchMax); /** @copydoc Bs3StrNLen_c16 */ 1616 #define Bs3StrNLen BS3_CMN_NM(Bs3StrNLen) /**< Selects #Bs3StrNLen_c16, #Bs3StrNLen_c32 or #Bs3StrNLen_c64. */ 1429 BS3_CMN_PROTO(size_t, Bs3StrNLen,(const char BS3_FAR *pszString, size_t cchMax), true); 1617 1430 1618 1431 /** … … 1624 1437 * @param pszSrc The source string. 1625 1438 */ 1626 BS3_DECL(char BS3_FAR *) Bs3StrCpy_c16(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc); 1627 BS3_DECL(char BS3_FAR *) Bs3StrCpy_c32(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc); /** @copydoc Bs3StrCpy_c16 */ 1628 BS3_DECL(char BS3_FAR *) Bs3StrCpy_c64(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc); /** @copydoc Bs3StrCpy_c16 */ 1629 #define Bs3StrCpy BS3_CMN_NM(Bs3StrCpy) /**< Selects #Bs3StrCpy_c16, #Bs3StrCpy_c32 or #Bs3StrCpy_c64. */ 1439 BS3_CMN_PROTO(char BS3_FAR *, Bs3StrCpy,(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc), true); 1630 1440 1631 1441 /** … … 1637 1447 * @param cbCopy The number of bytes to copy. 1638 1448 */ 1639 BS3_DECL(void BS3_FAR *) Bs3MemCpy_c16(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); 1640 BS3_DECL(void BS3_FAR *) Bs3MemCpy_c32(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemCpy_c16 */ 1641 BS3_DECL(void BS3_FAR *) Bs3MemCpy_c64(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemCpy_c16 */ 1642 #define Bs3MemCpy BS3_CMN_NM(Bs3MemCpy) /**< Selects #Bs3MemCpy_c16, #Bs3MemCpy_c32 or #Bs3MemCpy_c64. */ 1449 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy), true); 1643 1450 1644 1451 /** … … 1650 1457 * @param cbCopy The number of bytes to copy. 1651 1458 */ 1652 BS3_DECL(void BS3_FAR *) Bs3MemPCpy_c16(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); 1653 BS3_DECL(void BS3_FAR *) Bs3MemPCpy_c32(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemPCpy_c16 */ 1654 BS3_DECL(void BS3_FAR *) Bs3MemPCpy_c64(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemPCpy_c16 */ 1655 #define Bs3MemPCpy BS3_CMN_NM(Bs3MemPCpy) /**< Selects #Bs3MemPCpy_c16, #Bs3MemPCpy_c32 or #Bs3MemPCpy_c64. */ 1459 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemPCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy), true); 1656 1460 1657 1461 /** … … 1663 1467 * @param cbCopy The number of bytes to copy. 1664 1468 */ 1665 BS3_DECL(void BS3_FAR *) Bs3MemMove_c16(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); 1666 BS3_DECL(void BS3_FAR *) Bs3MemMove_c32(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemMove_c16 */ 1667 BS3_DECL(void BS3_FAR *) Bs3MemMove_c64(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemMove_c16 */ 1668 #define Bs3MemMove BS3_CMN_NM(Bs3MemMove) /**< Selects #Bs3MemMove_c16, #Bs3MemMove_c32 or #Bs3MemMove_c64. */ 1469 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemMove,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy), true); 1669 1470 1670 1471 /** … … 1674 1475 * @param cbDst The number of bytes to zero. 1675 1476 */ 1676 BS3_DECL(void) Bs3MemZero_c16(void BS3_FAR *pvDst, size_t cbDst); 1677 BS3_DECL(void) Bs3MemZero_c32(void BS3_FAR *pvDst, size_t cbDst); /** @copydoc Bs3MemZero_c16 */ 1678 BS3_DECL(void) Bs3MemZero_c64(void BS3_FAR *pvDst, size_t cbDst); /** @copydoc Bs3MemZero_c16 */ 1679 #define Bs3MemZero BS3_CMN_NM(Bs3MemZero) /**< Selects #Bs3MemZero_c16, #Bs3MemZero_c32 or #Bs3MemZero_c64. */ 1477 BS3_CMN_PROTO(void, Bs3MemZero,(void BS3_FAR *pvDst, size_t cbDst), false); 1680 1478 1681 1479 … … 1687 1485 * @param uSel The protected mode segment selector. 1688 1486 */ 1689 BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32_c16(uint32_t off, uint16_t uSel); 1690 BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32_c32(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelProtFar32ToFlat32_c16 */ 1691 BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32_c64(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelProtFar32ToFlat32_c16 */ 1692 #define Bs3SelProtFar32ToFlat32 BS3_CMN_NM(Bs3SelProtFar32ToFlat32) /**< Selects #Bs3SelProtFar32ToFlat32_c16, #Bs3SelProtFar32ToFlat32_c32 or #Bs3SelProtFar32ToFlat32_c64. */ 1487 BS3_CMN_PROTO(uint32_t, Bs3SelProtFar32ToFlat32,(uint32_t off, uint16_t uSel), true); 1693 1488 1694 1489 … … 1700 1495 * @param uSel The current mode segment selector. 1701 1496 */ 1702 BS3_DECL(uint32_t) Bs3SelFar32ToFlat32_c16(uint32_t off, uint16_t uSel); 1703 BS3_DECL(uint32_t) Bs3SelFar32ToFlat32_c32(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelFar32ToFlat32_c16 */ 1704 BS3_DECL(uint32_t) Bs3SelFar32ToFlat32_c64(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelFar32ToFlat32_c16 */ 1705 #define Bs3SelFar32ToFlat32 BS3_CMN_NM(Bs3SelFar32ToFlat32) /**< Selects #Bs3SelFar32ToFlat32_c16, #Bs3SelFar32ToFlat32_c32 or #Bs3SelFar32ToFlat32_c64. */ 1497 BS3_CMN_PROTO(uint32_t, Bs3SelFar32ToFlat32,(uint32_t off, uint16_t uSel), true); 1706 1498 1707 1499 /** … … 1714 1506 { 1715 1507 #if ARCH_BITS == 16 1716 return B s3SelFar32ToFlat32(BS3_FP_OFF(pv), BS3_FP_SEG(pv));1508 return BS3_CMN_FN_NM(Bs3SelFar32ToFlat32)(BS3_FP_OFF(pv), BS3_FP_SEG(pv)); 1717 1509 #else 1718 1510 return (uintptr_t)pv; … … 1784 1576 * @param cbChunk The chunk size. 1785 1577 */ 1786 BS3_DECL(void) Bs3SlabInit_c16(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, uint32_t cbSlab, uint16_t cbChunk); 1787 /** @copydoc Bs3SlabInit_c16 */ 1788 BS3_DECL(void) Bs3SlabInit_c32(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, uint32_t cbSlab, uint16_t cbChunk); 1789 /** @copydoc Bs3SlabInit_c16 */ 1790 BS3_DECL(void) Bs3SlabInit_c64(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, uint32_t cbSlab, uint16_t cbChunk); 1791 #define Bs3SlabInit BS3_CMN_NM(Bs3SlabInit) /**< Selects #Bs3SlabInit_c16, #Bs3SlabInit_c32 or #Bs3SlabInit_c64. */ 1578 BS3_CMN_PROTO(void, Bs3SlabInit,(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, 1579 uint32_t cbSlab, uint16_t cbChunk), true); 1792 1580 1793 1581 /** … … 1797 1585 * @param pSlabCtl The slab constrol structure to allocate from. 1798 1586 */ 1799 BS3_DECL(void BS3_FAR *) Bs3SlabAlloc_c16(PBS3SLABCTL pSlabCtl); 1800 BS3_DECL(void BS3_FAR *) Bs3SlabAlloc_c32(PBS3SLABCTL pSlabCtl); /**< @copydoc Bs3SlabAlloc_c16 */ 1801 BS3_DECL(void BS3_FAR *) Bs3SlabAlloc_c64(PBS3SLABCTL pSlabCtl); /**< @copydoc Bs3SlabAlloc_c16 */ 1802 #define Bs3SlabAlloc BS3_CMN_NM(Bs3SlabAlloc) /**< Selects #Bs3SlabAlloc_c16, #Bs3SlabAlloc_c32 or #Bs3SlabAlloc_c64. */ 1587 BS3_CMN_PROTO(void BS3_FAR *, Bs3SlabAlloc,(PBS3SLABCTL pSlabCtl), true); 1803 1588 1804 1589 /** … … 1811 1596 * @param fFlags Flags, see BS3_SLAB_ALLOC_F_XXX 1812 1597 */ 1813 BS3_DECL(void BS3_FAR *) Bs3SlabAllocEx_c16(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags); 1814 BS3_DECL(void BS3_FAR *) Bs3SlabAllocEx_c32(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags); /**< @copydoc Bs3SlabAllocEx_c16 */ 1815 BS3_DECL(void BS3_FAR *) Bs3SlabAllocEx_c64(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags); /**< @copydoc Bs3SlabAllocEx_c16 */ 1816 #define Bs3SlabAllocEx BS3_CMN_NM(Bs3SlabAllocEx) /**< Selects #Bs3SlabAllocEx_c16, #Bs3SlabAllocEx_c32 or #Bs3SlabAllocEx_c64. */ 1598 BS3_CMN_PROTO(void BS3_FAR *, Bs3SlabAllocEx,(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags), true); 1817 1599 1818 1600 /** … … 1825 1607 * @param cChunks The number of contiguous chunks to free. 1826 1608 */ 1827 BS3_DECL(uint16_t) Bs3SlabFree_c16(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks); 1828 BS3_DECL(uint16_t) Bs3SlabFree_c32(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks); /**< @copydoc Bs3SlabFree_c16 */ 1829 BS3_DECL(uint16_t) Bs3SlabFree_c64(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks); /**< @copydoc Bs3SlabFree_c16 */ 1830 #define Bs3SlabFree BS3_CMN_NM(Bs3SlabFree) /**< Selects #Bs3SlabFree_c16, #Bs3SlabFree_c32 or #Bs3SlabFree_c64. */ 1609 BS3_CMN_PROTO(uint16_t, Bs3SlabFree,(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks), true); 1831 1610 1832 1611 … … 1837 1616 * @param cbChunk The chunk size. 1838 1617 */ 1839 BS3_DECL(void) Bs3SlabListInit_c16(PBS3SLABHEAD pHead, uint16_t cbChunk); 1840 BS3_DECL(void) Bs3SlabListInit_c32(PBS3SLABHEAD pHead, uint16_t cbChunk); /**< @copydoc Bs3SlabListInit_c16 */ 1841 BS3_DECL(void) Bs3SlabListInit_c64(PBS3SLABHEAD pHead, uint16_t cbChunk); /**< @copydoc Bs3SlabListInit_c16 */ 1842 #define Bs3SlabListInit BS3_CMN_NM(Bs3SlabListInit) /**< Selects #Bs3SlabListInit_c16, #Bs3SlabListInit_c32 or #Bs3SlabListInit_c64. */ 1618 BS3_CMN_PROTO(void, Bs3SlabListInit,(PBS3SLABHEAD pHead, uint16_t cbChunk), true); 1843 1619 1844 1620 /** … … 1848 1624 * @param pSlabCtl The slab control structure to add. 1849 1625 */ 1850 BS3_DECL(void) Bs3SlabListAdd_c16(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl); 1851 /** @copydoc Bs3SlabListAdd_c16 */ 1852 BS3_DECL(void) Bs3SlabListAdd_c32(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl); 1853 /** @copydoc Bs3SlabListAdd_c16 */ 1854 BS3_DECL(void) Bs3SlabListAdd_c64(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl); 1855 #define Bs3SlabListAdd BS3_CMN_NM(Bs3SlabListAdd) /**< Selects #Bs3SlabListAdd_c16, #Bs3SlabListAdd_c32 or #Bs3SlabListAdd_c64. */ 1626 BS3_CMN_PROTO(void, Bs3SlabListAdd,(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl), true); 1856 1627 1857 1628 /** … … 1861 1632 * @param pHead The slab list to allocate from. 1862 1633 */ 1863 BS3_DECL(void BS3_FAR *) Bs3SlabListAlloc_c16(PBS3SLABHEAD pHead); 1864 BS3_DECL(void BS3_FAR *) Bs3SlabListAlloc_c32(PBS3SLABHEAD pHead); /**< @copydoc Bs3SlabListAlloc_c16 */ 1865 BS3_DECL(void BS3_FAR *) Bs3SlabListAlloc_c64(PBS3SLABHEAD pHead); /**< @copydoc Bs3SlabListAlloc_c16 */ 1866 #define Bs3SlabListAlloc BS3_CMN_NM(Bs3SlabListAlloc) /**< Selects #Bs3SlabListAlloc_c16, #Bs3SlabListAlloc_c32 or #Bs3SlabListAlloc_c64. */ 1634 BS3_CMN_PROTO(void BS3_FAR *, Bs3SlabListAlloc,(PBS3SLABHEAD pHead), true); 1867 1635 1868 1636 /** … … 1875 1643 * @param fFlags Flags, see BS3_SLAB_ALLOC_F_XXX 1876 1644 */ 1877 BS3_DECL(void BS3_FAR *) Bs3SlabListAllocEx_c16(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags); 1878 BS3_DECL(void BS3_FAR *) Bs3SlabListAllocEx_c32(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags); /**< @copydoc Bs3SlabListAllocEx_c16 */ 1879 BS3_DECL(void BS3_FAR *) Bs3SlabListAllocEx_c64(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags); /**< @copydoc Bs3SlabListAllocEx_c16 */ 1880 #define Bs3SlabListAllocEx BS3_CMN_NM(Bs3SlabListAllocEx) /**< Selects #Bs3SlabListAllocEx_c16, #Bs3SlabListAllocEx_c32 or #Bs3SlabListAllocEx_c64. */ 1645 BS3_CMN_PROTO(void BS3_FAR *, Bs3SlabListAllocEx,(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags), true); 1881 1646 1882 1647 /** … … 1887 1652 * @param cChunks The number of contiguous chunks to free. 1888 1653 */ 1889 BS3_DECL(void) Bs3SlabListFree_c16(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks); 1890 BS3_DECL(void) Bs3SlabListFree_c32(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks); /**< @copydoc Bs3SlabListFree_c16 */ 1891 BS3_DECL(void) Bs3SlabListFree_c64(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks); /**< @copydoc Bs3SlabListFree_c16 */ 1892 #define Bs3SlabListFree BS3_CMN_NM(Bs3SlabListFree) /**< Selects #Bs3SlabListFree_c16, #Bs3SlabListFree_c32 or #Bs3SlabListFree_c64. */ 1654 BS3_CMN_PROTO(void, Bs3SlabListFree,(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks), true); 1893 1655 1894 1656 /** … … 1919 1681 * @param cb How much to allocate. Must be 4KB or less. 1920 1682 */ 1921 BS3_DECL(void BS3_FAR *) Bs3MemAlloc_c16(BS3MEMKIND enmKind, size_t cb); 1922 BS3_DECL(void BS3_FAR *) Bs3MemAlloc_c32(BS3MEMKIND enmKind, size_t cb); /**< @copydoc Bs3MemAlloc_c16 */ 1923 BS3_DECL(void BS3_FAR *) Bs3MemAlloc_c64(BS3MEMKIND enmKind, size_t cb); /**< @copydoc Bs3MemAlloc_c16 */ 1924 #define Bs3MemAlloc BS3_CMN_NM(Bs3MemAlloc) /**< Selects #Bs3MemAlloc_c16, #Bs3MemAlloc_c32 or #Bs3MemAlloc_c64. */ 1683 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemAlloc,(BS3MEMKIND enmKind, size_t cb), true); 1925 1684 1926 1685 /** … … 1931 1690 * @param cb How much to allocate. Must be 4KB or less. 1932 1691 */ 1933 BS3_DECL(void BS3_FAR *) Bs3MemAllocZ_c16(BS3MEMKIND enmKind, size_t cb); 1934 BS3_DECL(void BS3_FAR *) Bs3MemAllocZ_c32(BS3MEMKIND enmKind, size_t cb); /**< @copydoc Bs3MemAllocZ_c16 */ 1935 BS3_DECL(void BS3_FAR *) Bs3MemAllocZ_c64(BS3MEMKIND enmKind, size_t cb); /**< @copydoc Bs3MemAllocZ_c16 */ 1936 #define Bs3MemAllocZ BS3_CMN_NM(Bs3MemAllocZ) /**< Selects #Bs3MemAllocZ_c16, #Bs3MemAllocZ_c32 or #Bs3MemAllocZ_c64. */ 1692 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemAllocZ,(BS3MEMKIND enmKind, size_t cb), true); 1937 1693 1938 1694 /** … … 1943 1699 * @param cb The size of the allocation. 1944 1700 */ 1945 BS3_DECL(void) Bs3MemFree_c16(void BS3_FAR *pv, size_t cb); 1946 BS3_DECL(void) Bs3MemFree_c32(void BS3_FAR *pv, size_t cb); /**< @copydoc Bs3MemFree_c16 */ 1947 BS3_DECL(void) Bs3MemFree_c64(void BS3_FAR *pv, size_t cb); /**< @copydoc Bs3MemFree_c16 */ 1948 #define Bs3MemFree BS3_CMN_NM(Bs3MemFree) /**< Selects #Bs3MemFree_c16, #Bs3MemFree_c32 or #Bs3MemFree_c64. */ 1701 BS3_CMN_PROTO(void, Bs3MemFree,(void BS3_FAR *pv, size_t cb), true); 1949 1702 1950 1703 … … 1952 1705 * Enables the A20 gate. 1953 1706 */ 1954 BS3_DECL(void) Bs3A20Enable_c16(void); 1955 BS3_DECL(void) Bs3A20Enable_c32(void); /**< @copydoc Bs3A20Enable_c16 */ 1956 BS3_DECL(void) Bs3A20Enable_c64(void); /**< @copydoc Bs3A20Enable_c16 */ 1957 #define Bs3A20Enable BS3_CMN_NM(Bs3A20Enable) /**< Selects #Bs3A20Enable_c16, #Bs3A20Enable_c32 or #Bs3A20Enable_c64. */ 1707 BS3_CMN_PROTO(void, Bs3A20Enable,(void), false); 1958 1708 1959 1709 /** 1960 1710 * Enables the A20 gate via the keyboard controller 1961 1711 */ 1962 BS3_DECL(void) Bs3A20EnableViaKbd_c16(void); 1963 BS3_DECL(void) Bs3A20EnableViaKbd_c32(void); /**< @copydoc Bs3A20EnableViaKbd_c16 */ 1964 BS3_DECL(void) Bs3A20EnableViaKbd_c64(void); /**< @copydoc Bs3A20EnableViaKbd_c16 */ 1965 #define Bs3A20EnableViaKbd BS3_CMN_NM(Bs3A20EnableViaKbd) /**< Selects #Bs3A20EnableViaKbd_c16, #Bs3A20EnableViaKbd_c32 or #Bs3A20EnableViaKbd_c64. */ 1712 BS3_CMN_PROTO(void, Bs3A20EnableViaKbd,(void), false); 1966 1713 1967 1714 /** 1968 1715 * Enables the A20 gate via the PS/2 control port A. 1969 1716 */ 1970 BS3_DECL(void) Bs3A20EnableViaPortA_c16(void); 1971 BS3_DECL(void) Bs3A20EnableViaPortA_c32(void); /**< @copydoc Bs3A20EnableViaPortA_c16 */ 1972 BS3_DECL(void) Bs3A20EnableViaPortA_c64(void); /**< @copydoc Bs3A20EnableViaPortA_c16 */ 1973 #define Bs3A20EnableViaPortA BS3_CMN_NM(Bs3A20EnableViaPortA) /**< Selects #Bs3A20EnableViaPortA_c16, #Bs3A20EnableViaPortA_c32 or #Bs3A20EnableViaPortA_c64. */ 1717 BS3_CMN_PROTO(void, Bs3A20EnableViaPortA,(void), false); 1974 1718 1975 1719 /** 1976 1720 * Disables the A20 gate. 1977 1721 */ 1978 BS3_DECL(void) Bs3A20Disable_c16(void); 1979 BS3_DECL(void) Bs3A20Disable_c32(void); /**< @copydoc Bs3A20Disable_c16 */ 1980 BS3_DECL(void) Bs3A20Disable_c64(void); /**< @copydoc Bs3A20Disable_c16 */ 1981 #define Bs3A20Disable BS3_CMN_NM(Bs3A20Disable) /**< Selects #Bs3A20Disable_c16, #Bs3A20Disable_c32 or #Bs3A20Disable_c64. */ 1722 BS3_CMN_PROTO(void, Bs3A20Disable,(void), false); 1982 1723 1983 1724 /** 1984 1725 * Disables the A20 gate via the keyboard controller 1985 1726 */ 1986 BS3_DECL(void) Bs3A20DisableViaKbd_c16(void); 1987 BS3_DECL(void) Bs3A20DisableViaKbd_c32(void); /**< @copydoc Bs3A20DisableViaKbd_c16 */ 1988 BS3_DECL(void) Bs3A20DisableViaKbd_c64(void); /**< @copydoc Bs3A20DisableViaKbd_c16 */ 1989 #define Bs3A20DisableViaKbd BS3_CMN_NM(Bs3A20DisableViaKbd) /**< Selects #Bs3A20DisableViaKbd_c16, #Bs3A20DisableViaKbd_c32 or #Bs3A20DisableViaKbd_c64. */ 1727 BS3_CMN_PROTO(void, Bs3A20DisableViaKbd,(void), false); 1990 1728 1991 1729 /** 1992 1730 * Disables the A20 gate via the PS/2 control port A. 1993 1731 */ 1994 BS3_DECL(void) Bs3A20DisableViaPortA_c16(void); 1995 BS3_DECL(void) Bs3A20DisableViaPortA_c32(void); /**< @copydoc Bs3A20DisableViaPortA_c16 */ 1996 BS3_DECL(void) Bs3A20DisableViaPortA_c64(void); /**< @copydoc Bs3A20DisableViaPortA_c16 */ 1997 #define Bs3A20DisableViaPortA BS3_CMN_NM(Bs3A20DisableViaPortA) /**< Selects #Bs3A20DisableViaPortA_c16, #Bs3A20DisableViaPortA_c32 or #Bs3A20DisableViaPortA_c64. */ 1732 BS3_CMN_PROTO(void, Bs3A20DisableViaPortA,(void), false); 1998 1733 1999 1734 … … 2004 1739 * @remarks Must not be called in real-mode! 2005 1740 */ 2006 BS3_DECL(int) Bs3PagingInitRootForPP_c16(void); 2007 BS3_DECL(int) Bs3PagingInitRootForPP_c32(void); /**< @copydoc Bs3PagingInitRootForPP_c16 */ 2008 BS3_DECL(int) Bs3PagingInitRootForPP_c64(void); /**< @copydoc Bs3PagingInitRootForPP_c16 */ 2009 #define Bs3PagingInitRootForPP BS3_CMN_NM(Bs3PagingInitRootForPP) /**< Selects #Bs3PagingInitRootForPP_c16, #Bs3PagingInitRootForPP_c32 or #Bs3PagingInitRootForPP_c64. */ 1741 BS3_CMN_PROTO(int, Bs3PagingInitRootForPP,(void), true); 2010 1742 2011 1743 /** … … 2016 1748 * @remarks Must not be called in real-mode! 2017 1749 */ 2018 BS3_DECL(int) Bs3PagingInitRootForPAE_c16(void); 2019 BS3_DECL(int) Bs3PagingInitRootForPAE_c32(void); /**< @copydoc Bs3PagingInitRootForPAE_c16 */ 2020 BS3_DECL(int) Bs3PagingInitRootForPAE_c64(void); /**< @copydoc Bs3PagingInitRootForPAE_c16 */ 2021 #define Bs3PagingInitRootForPAE BS3_CMN_NM(Bs3PagingInitRootForPAE) /**< Selects #Bs3PagingInitRootForPAE_c16, #Bs3PagingInitRootForPAE_c32 or #Bs3PagingInitRootForPAE_c64. */ 1750 BS3_CMN_PROTO(int, Bs3PagingInitRootForPAE,(void), true); 2022 1751 2023 1752 /** … … 2028 1757 * @remarks Must not be called in real-mode! 2029 1758 */ 2030 BS3_DECL(int) Bs3PagingInitRootForLM_c16(void); 2031 BS3_DECL(int) Bs3PagingInitRootForLM_c32(void); /**< @copydoc Bs3PagingInitRootForLM_c16 */ 2032 BS3_DECL(int) Bs3PagingInitRootForLM_c64(void); /**< @copydoc Bs3PagingInitRootForLM_c16 */ 2033 #define Bs3PagingInitRootForLM BS3_CMN_NM(Bs3PagingInitRootForLM) /**< Selects #Bs3PagingInitRootForLM_c16, #Bs3PagingInitRootForLM_c32 or #Bs3PagingInitRootForLM_c64. */ 1759 BS3_CMN_PROTO(int, Bs3PagingInitRootForLM,(void), true); 2034 1760 2035 1761 /** … … 2049 1775 * @param fClear Mask of zero or more X86_PTE_XXX values to clear for the range. 2050 1776 */ 2051 BS3_DECL(int) Bs3PagingProtect_c16(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear); 2052 BS3_DECL(int) Bs3PagingProtect_c32(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear); /**< @copydoc Bs3PagingProtect_c16 */ 2053 BS3_DECL(int) Bs3PagingProtect_c64(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear); /**< @copydoc Bs3PagingProtect_c16 */ 2054 #define Bs3PagingProtect BS3_CMN_NM(Bs3PagingProtect) /**< Selects #Bs3PagingProtect_c16, #Bs3PagingProtect_c32 or #Bs3PagingProtect_c64. */ 1777 BS3_CMN_PROTO(int, Bs3PagingProtect,(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear), true); 2055 1778 2056 1779 /** … … 2070 1793 * @param fClear Mask of zero or more X86_PTE_XXX values to clear for the range. 2071 1794 */ 2072 BS3_DECL(int) Bs3PagingProtectPtr_c16(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear); 2073 BS3_DECL(int) Bs3PagingProtectPtr_c32(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear); /**< @copydoc Bs3PagingProtectPtr_c16 */ 2074 BS3_DECL(int) Bs3PagingProtectPtr_c64(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear); /**< @copydoc Bs3PagingProtectPtr_c16 */ 2075 #define Bs3PagingProtectPtr BS3_CMN_NM(Bs3PagingProtectPtr) /**< Selects #Bs3PagingProtectPtr_c16, #Bs3PagingProtectPtr_c32 or #Bs3PagingProtectPtr_c64. */ 1795 BS3_CMN_PROTO(int, Bs3PagingProtectPtr,(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear), true); 2076 1796 2077 1797 /** 2078 1798 * Waits for the keyboard controller to become ready. 2079 1799 */ 2080 BS3_DECL(void) Bs3KbdWait_c16(void); 2081 BS3_DECL(void) Bs3KbdWait_c32(void); /**< @copydoc Bs3KbdWait_c16 */ 2082 BS3_DECL(void) Bs3KbdWait_c64(void); /**< @copydoc Bs3KbdWait_c16 */ 2083 #define Bs3KbdWait BS3_CMN_NM(Bs3KbdWait) /**< Selects #Bs3KbdWait_c16, #Bs3KbdWait_c32 or #Bs3KbdWait_c64. */ 1800 BS3_CMN_PROTO(void, Bs3KbdWait,(void), false); 2084 1801 2085 1802 /** … … 2092 1809 * @param bCmd The read command. 2093 1810 */ 2094 BS3_DECL(uint8_t) Bs3KbdRead_c16(uint8_t bCmd); 2095 BS3_DECL(uint8_t) Bs3KbdRead_c32(uint8_t bCmd); /**< @copydoc Bs3KbdRead_c16 */ 2096 BS3_DECL(uint8_t) Bs3KbdRead_c64(uint8_t bCmd); /**< @copydoc Bs3KbdRead_c16 */ 2097 #define Bs3KbdRead BS3_CMN_NM(Bs3KbdRead) /**< Selects #Bs3KbdRead_c16, #Bs3KbdRead_c32 or #Bs3KbdRead_c64. */ 1811 BS3_CMN_PROTO(uint8_t, Bs3KbdRead,(uint8_t bCmd), false); 2098 1812 2099 1813 /** … … 2106 1820 * @param bData The data to write. 2107 1821 */ 2108 BS3_DECL(void) Bs3KbdWrite_c16(uint8_t bCmd, uint8_t bData); 2109 BS3_DECL(void) Bs3KbdWrite_c32(uint8_t bCmd, uint8_t bData); /**< @copydoc Bs3KbdWrite_c16 */ 2110 BS3_DECL(void) Bs3KbdWrite_c64(uint8_t bCmd, uint8_t bData); /**< @copydoc Bs3KbdWrite_c16 */ 2111 #define Bs3KbdWrite BS3_CMN_NM(Bs3KbdWrite) /**< Selects #Bs3KbdWrite_c16, #Bs3KbdWrite_c32 or #Bs3KbdWrite_c64. */ 1822 BS3_CMN_PROTO(void, Bs3KbdWrite,(uint8_t bCmd, uint8_t bData), false); 2112 1823 2113 1824 … … 2115 1826 * Disables all IRQs on the PIC. 2116 1827 */ 2117 BS3_DECL(void) Bs3PicMaskAll_c16(void); 2118 BS3_DECL(void) Bs3PicMaskAll_c32(void); /**< @copydoc Bs3PicMaskAll_c16 */ 2119 BS3_DECL(void) Bs3PicMaskAll_c64(void); /**< @copydoc Bs3PicMaskAll_c16 */ 2120 #define Bs3PicMaskAll BS3_CMN_NM(Bs3PicMaskAll) /**< Selects #Bs3PicMaskAll_c16, #Bs3PicMaskAll_c32 or #Bs3PicMaskAll_c64. */ 1828 BS3_CMN_PROTO(void, Bs3PicMaskAll,(void), true); 2121 1829 2122 1830 … … 2218 1926 * @param pRegCtx Where to store the register context. 2219 1927 */ 2220 BS3_DECL(void) Bs3RegCtxSave_c16(PCBS3REGCTX pRegCtx); 2221 BS3_DECL(void) Bs3RegCtxSave_c32(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxSave_c16 */ 2222 BS3_DECL(void) Bs3RegCtxSave_c64(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxSave_c16 */ 2223 #define Bs3RegCtxSave BS3_CMN_NM(Bs3RegCtxSave) /**< Selects #Bs3RegCtxSave_c16, #Bs3RegCtxSave_c32 or #Bs3RegCtxSave_c64. */ 1928 BS3_CMN_PROTO(void, Bs3RegCtxSave,(PCBS3REGCTX pRegCtx), false); 2224 1929 2225 1930 /** … … 2229 1934 * @param bRing The target ring (0..3). 2230 1935 */ 2231 BS3_DECL(void) Bs3RegCtxConvertToRingX_c16(PBS3REGCTX pRegCtx, uint8_t bRing); 2232 BS3_DECL(void) Bs3RegCtxConvertToRingX_c32(PBS3REGCTX pRegCtx, uint8_t bRing); /**< @copydoc Bs3RegCtxConvertToRingX_c16 */ 2233 BS3_DECL(void) Bs3RegCtxConvertToRingX_c64(PBS3REGCTX pRegCtx, uint8_t bRing); /**< @copydoc Bs3RegCtxConvertToRingX_c16 */ 2234 #define Bs3RegCtxConvertToRingX BS3_CMN_NM(Bs3RegCtxConvertToRingX) /**< Selects #Bs3RegCtxConvertToRingX_c16, #Bs3RegCtxConvertToRingX_c32 or #Bs3RegCtxConvertToRingX_c64. */ 1936 BS3_CMN_PROTO(void, Bs3RegCtxConvertToRingX,(PBS3REGCTX pRegCtx, uint8_t bRing), true); 2235 1937 2236 1938 /** … … 2243 1945 * @remarks Does not return. 2244 1946 */ 2245 BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c16(PCBS3REGCTX pRegCtx, uint16_t fFlags); 2246 BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c32(PCBS3REGCTX pRegCtx, uint16_t fFlags); /**< @copydoc Bs3RegCtxRestore_c16 */ 2247 BS3_DECL(DECL_NO_RETURN(void)) Bs3RegCtxRestore_c64(PCBS3REGCTX pRegCtx, uint16_t fFlags); /**< @copydoc Bs3RegCtxRestore_c16 */ 2248 #define Bs3RegCtxRestore BS3_CMN_NM(Bs3RegCtxRestore) /**< Selects #Bs3RegCtxRestore_c16, #Bs3RegCtxRestore_c32 or #Bs3RegCtxRestore_c64. */ 1947 BS3_CMN_PROTO(DECL_NO_RETURN(void), Bs3RegCtxRestore,(PCBS3REGCTX pRegCtx, uint16_t fFlags), false); 2249 1948 #if !defined(BS3_KIT_WITH_NO_RETURN) && defined(__WATCOMC__) 2250 1949 # pragma aux Bs3RegCtxRestore_c16 "_Bs3RegCtxRestore_aborts_c16" __aborts 1950 # pragma aux Bs3RegCtxRestore_f16 "_Bs3RegCtxRestore_aborts_f16" __aborts 2251 1951 # pragma aux Bs3RegCtxRestore_c32 "_Bs3RegCtxRestore_aborts_c32" __aborts 2252 1952 #endif … … 2260 1960 * @param pRegCtx The register context to be printed. 2261 1961 */ 2262 BS3_DECL(void) Bs3RegCtxPrint_c16(PCBS3REGCTX pRegCtx); 2263 BS3_DECL(void) Bs3RegCtxPrint_c32(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxPrint_c16 */ 2264 BS3_DECL(void) Bs3RegCtxPrint_c64(PCBS3REGCTX pRegCtx); /**< @copydoc Bs3RegCtxPrint_c16 */ 2265 #define Bs3RegCtxPrint BS3_CMN_NM(Bs3RegCtxPrint) /**< Selects #Bs3RegCtxPrint_c16, #Bs3RegCtxPrint_c32 or #Bs3RegCtxPrint_c64. */ 1962 BS3_CMN_PROTO(void, Bs3RegCtxPrint,(PCBS3REGCTX pRegCtx), true); 2266 1963 2267 1964 … … 2304 2001 * structures. 2305 2002 */ 2306 BS3_DECL(void) Bs3Trap16Init_c16(void); 2307 BS3_DECL(void) Bs3Trap16Init_c32(void); /**< @copydoc Bs3Trap16Init_c16 */ 2308 BS3_DECL(void) Bs3Trap16Init_c64(void); /**< @copydoc Bs3Trap16Init_c16 */ 2309 #define Bs3Trap16Init BS3_CMN_NM(Bs3Trap16Init) /**< Selects #Bs3Trap16Init_c16, #Bs3Trap16Init_c32 or #Bs3Trap16Init_c64. */ 2003 BS3_CMN_PROTO(void, Bs3Trap16Init,(void), true); 2310 2004 2311 2005 /** … … 2320 2014 * structures. 2321 2015 */ 2322 BS3_DECL(void) Bs3Trap16InitEx_c16(bool f386Plus); 2323 BS3_DECL(void) Bs3Trap16InitEx_c32(bool f386Plus); /**< @copydoc Bs3Trap16InitEx_c16 */ 2324 BS3_DECL(void) Bs3Trap16InitEx_c64(bool f386Plus); /**< @copydoc Bs3Trap16InitEx_c16 */ 2325 #define Bs3Trap16InitEx BS3_CMN_NM(Bs3Trap16InitEx) /**< Selects #Bs3Trap16InitEx_c16, #Bs3Trap16InitEx_c32 or #Bs3Trap16InitEx_c64. */ 2016 BS3_CMN_PROTO(void, Bs3Trap16InitEx,(bool f386Plus), true); 2326 2017 2327 2018 /** … … 2331 2022 * structures. 2332 2023 */ 2333 BS3_DECL(void) Bs3Trap32Init_c16(void); 2334 BS3_DECL(void) Bs3Trap32Init_c32(void); /**< @copydoc Bs3Trap32Init_c16 */ 2335 BS3_DECL(void) Bs3Trap32Init_c64(void); /**< @copydoc Bs3Trap32Init_c16 */ 2336 #define Bs3Trap32Init BS3_CMN_NM(Bs3Trap32Init) /**< Selects #Bs3Trap32Init_c16, #Bs3Trap32Init_c32 or #Bs3Trap32Init_c64. */ 2024 BS3_CMN_PROTO(void, Bs3Trap32Init,(void), true); 2337 2025 2338 2026 /** … … 2342 2030 * structures. 2343 2031 */ 2344 BS3_DECL(void) Bs3Trap64Init_c16(void); 2345 BS3_DECL(void) Bs3Trap64Init_c32(void); /**< @copydoc Bs3Trap64Init_c16 */ 2346 BS3_DECL(void) Bs3Trap64Init_c64(void); /**< @copydoc Bs3Trap64Init_c16 */ 2347 #define Bs3Trap64Init BS3_CMN_NM(Bs3Trap64Init) /**< Selects #Bs3Trap64Init_c16, #Bs3Trap64Init_c32 or #Bs3Trap64Init_c64. */ 2032 BS3_CMN_PROTO(void, Bs3Trap64Init,(void), true); 2033 2034 /** 2035 * Modifies the real-mode / V86 IVT entry specified by @a iIvt. 2036 * 2037 * @param iIvt The index of the IDT entry to set. 2038 * @param uSel The handler real-mode segment. 2039 * @param off The handler offset. 2040 */ 2041 BS3_CMN_PROTO(void, Bs3TrapRmV86SetGate,(uint8_t iIvt, uint16_t uSeg, uint16_t off), true); 2348 2042 2349 2043 /** … … 2357 2051 * @param cParams The parameter count (for call gates). 2358 2052 */ 2359 BS3_DECL(void) Bs3Trap16SetGate_c16(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint16_t off, uint8_t cParams); 2360 BS3_DECL(void) Bs3Trap16SetGate_c32(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint16_t off, uint8_t cParams); /**< @copydoc Bs3Trap16SetGate_c16 */ 2361 BS3_DECL(void) Bs3Trap16SetGate_c64(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint16_t off, uint8_t cParams); /**< @copydoc Bs3Trap16SetGate_c16 */ 2362 #define Bs3Trap16SetGate BS3_CMN_NM(Bs3Trap16SetGate) /**< Selects #Bs3Trap16SetGate_c16, #Bs3Trap16SetGate_c32 or #Bs3Trap16SetGate_c64. */ 2053 BS3_CMN_PROTO(void, Bs3Trap16SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, 2054 uint16_t uSel, uint16_t off, uint8_t cParams), true); 2363 2055 2364 2056 /** The address of Bs3Trap16GenericEntries. … … 2366 2058 * points, 8 bytes each, that will create a register frame and call the generic 2367 2059 * C compatible trap handlers. */ 2368 #ifndef DOXYGEN_RUNNING2369 # define g_Bs3Trap16GenericEntriesFlatAddr BS3_DATA_NM(g_Bs3Trap16GenericEntriesFlatAddr)2370 #endif2371 2060 extern uint32_t g_Bs3Trap16GenericEntriesFlatAddr; 2372 2061 … … 2381 2070 * @param cParams The parameter count (for call gates). 2382 2071 */ 2383 BS3_DECL(void) Bs3Trap32SetGate_c16(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint32_t off, uint8_t cParams); 2384 BS3_DECL(void) Bs3Trap32SetGate_c32(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint32_t off, uint8_t cParams); /**< @copydoc Bs3Trap32SetGate_c16 */ 2385 BS3_DECL(void) Bs3Trap32SetGate_c64(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint32_t off, uint8_t cParams); /**< @copydoc Bs3Trap32SetGate_c16 */ 2386 #define Bs3Trap32SetGate BS3_CMN_NM(Bs3Trap32SetGate) /**< Selects #Bs3Trap32SetGate_c16, #Bs3Trap32SetGate_c32 or #Bs3Trap32SetGate_c64. */ 2072 BS3_CMN_PROTO(void, Bs3Trap32SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, 2073 uint16_t uSel, uint32_t off, uint8_t cParams), true); 2387 2074 2388 2075 /** The address of Bs3Trap32GenericEntries. … … 2390 2077 * points, 10 bytes each, that will create a register frame and call the generic 2391 2078 * C compatible trap handlers. */ 2392 #ifndef DOXYGEN_RUNNING2393 # define g_Bs3Trap32GenericEntriesFlatAddr BS3_DATA_NM(g_Bs3Trap32GenericEntriesFlatAddr)2394 #endif2395 2079 extern uint32_t g_Bs3Trap32GenericEntriesFlatAddr; 2396 2080 … … 2405 2089 * @param bIst The interrupt stack to use. 2406 2090 */ 2407 BS3_DECL(void) Bs3Trap64SetGate_c16(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint64_t off, uint8_t bIst); 2408 BS3_DECL(void) Bs3Trap64SetGate_c32(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint64_t off, uint8_t bIst); /**< @copydoc Bs3Trap64SetGate_c16 */ 2409 BS3_DECL(void) Bs3Trap64SetGate_c64(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint64_t off, uint8_t bIst); /**< @copydoc Bs3Trap64SetGate_c16 */ 2410 #define Bs3Trap64SetGate BS3_CMN_NM(Bs3Trap64SetGate) /**< Selects #Bs3Trap64SetGate_c16, #Bs3Trap64SetGate_c32 or #Bs3Trap64SetGate_c64. */ 2091 BS3_CMN_PROTO(void, Bs3Trap64SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, 2092 uint16_t uSel, uint64_t off, uint8_t bIst), true); 2411 2093 2412 2094 /** The address of Bs3Trap64GenericEntries. … … 2414 2096 * points, 8 bytes each, that will create a register frame and call the generic 2415 2097 * C compatible trap handlers. */ 2416 #ifndef DOXYGEN_RUNNING2417 # define g_Bs3Trap64GenericEntriesFlatAddr BS3_DATA_NM(g_Bs3Trap64GenericEntriesFlatAddr)2418 #endif2419 2098 extern uint32_t g_Bs3Trap64GenericEntriesFlatAddr; 2420 2099 … … 2448 2127 * @param pfnHandler Pointer to the handler. 2449 2128 */ 2450 BS3_DECL(PFNBS3TRAPHANDLER) Bs3TrapSetHandler_c16(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler); 2451 BS3_DECL(PFNBS3TRAPHANDLER) Bs3TrapSetHandler_c32(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler); /**< @copydoc Bs3Trap32SetHandler_c16 */ 2452 BS3_DECL(PFNBS3TRAPHANDLER) Bs3TrapSetHandler_c64(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler); /**< @copydoc Bs3Trap32SetHandler_c16 */ 2453 #define Bs3Trap32SetHandler BS3_CMN_NM(Bs3Trap32SetHandler) /**< Selects #Bs3Trap32SetHandler_c16, #Bs3Trap32SetHandler_c32 or #Bs3Trap32SetHandler_c64. */ 2129 BS3_CMN_PROTO(PFNBS3TRAPHANDLER, Bs3TrapSetHandler,(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler), true); 2454 2130 2455 2131 /** … … 2460 2136 * @param pTrapFrame Trap frame of the trap to handle. 2461 2137 */ 2462 BS3_DECL(void) Bs3TrapDefaultHandler_c16(PBS3TRAPFRAME pTrapFrame); 2463 BS3_DECL(void) Bs3TrapDefaultHandler_c32(PBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapDefaultHandler_c16 */ 2464 BS3_DECL(void) Bs3TrapDefaultHandler_c64(PBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapDefaultHandler_c16 */ 2465 #define Bs3TrapDefaultHandler BS3_CMN_NM(Bs3TrapDefaultHandler) /**< Selects #Bs3TrapDefaultHandler_c16, #Bs3TrapDefaultHandler_c32 or #Bs3TrapDefaultHandler_c64. */ 2138 BS3_CMN_PROTO(void, Bs3TrapDefaultHandler,(PBS3TRAPFRAME pTrapFrame), true); 2466 2139 2467 2140 /** … … 2469 2142 * @param pTrapFrame Trap frame to print. 2470 2143 */ 2471 BS3_DECL(void) Bs3TrapPrintFrame_c16(PCBS3TRAPFRAME pTrapFrame); 2472 BS3_DECL(void) Bs3TrapPrintFrame_c32(PCBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapPrintFrame_c16 */ 2473 BS3_DECL(void) Bs3TrapPrintFrame_c64(PCBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapPrintFrame_c16 */ 2474 #define Bs3TrapPrintFrame BS3_CMN_NM(Bs3TrapPrintFrame) /**< Selects #Bs3TrapPrintFrame_c16, #Bs3TrapPrintFrame_c32 or #Bs3TrapPrintFrame_c64. */ 2144 BS3_CMN_PROTO(void, Bs3TrapPrintFrame,(PCBS3TRAPFRAME pTrapFrame), true); 2475 2145 2476 2146 /** … … 2486 2156 * @sa #Bs3TrapUnsetJmp 2487 2157 */ 2488 BS3_DECL(DECL_RETURNS_TWICE(bool)) Bs3TrapSetJmp_c16(PBS3TRAPFRAME pTrapFrame); 2489 BS3_DECL(DECL_RETURNS_TWICE(bool)) Bs3TrapSetJmp_c32(PBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapSetJmp_c16 */ 2490 BS3_DECL(DECL_RETURNS_TWICE(bool)) Bs3TrapSetJmp_c64(PBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapSetJmp_c16 */ 2491 #define Bs3TrapSetJmp BS3_CMN_NM(Bs3TrapSetJmp) /**< Selects #Bs3TrapSetJmp_c16, #Bs3TrapSetJmp_c32 or #Bs3TrapSetJmp_c64. */ 2158 BS3_CMN_PROTO(DECL_RETURNS_TWICE(bool),Bs3TrapSetJmp,(PBS3TRAPFRAME pTrapFrame), false); 2492 2159 2493 2160 /** … … 2497 2164 * @param pTrapFrame Where to store the trap information. 2498 2165 */ 2499 BS3_DECL(void) Bs3TrapSetJmpAndRestore_c16(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame); 2500 BS3_DECL(void) Bs3TrapSetJmpAndRestore_c32(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapSetJmpAndRestore_c16 */ 2501 BS3_DECL(void) Bs3TrapSetJmpAndRestore_c64(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame); /**< @copydoc Bs3TrapSetJmpAndRestore_c16 */ 2502 #define Bs3TrapSetJmpAndRestore BS3_CMN_NM(Bs3TrapSetJmpAndRestore) /**< Selects #Bs3TrapSetJmpAndRestore_c16, #Bs3TrapSetJmpAndRestore_c32 or #Bs3TrapSetJmpAndRestore_c64. */ 2166 BS3_CMN_PROTO(void, Bs3TrapSetJmpAndRestore,(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame), true); 2503 2167 2504 2168 /** 2505 2169 * Disables a previous #Bs3TrapSetJmp call. 2506 2170 */ 2507 BS3_DECL(void) Bs3TrapUnsetJmp_c16(void); 2508 BS3_DECL(void) Bs3TrapUnsetJmp_c32(void); /**< @copydoc Bs3TrapUnsetJmp_c16 */ 2509 BS3_DECL(void) Bs3TrapUnsetJmp_c64(void); /**< @copydoc Bs3TrapUnsetJmp_c16 */ 2510 #define Bs3TrapUnsetJmp BS3_CMN_NM(Bs3TrapUnsetJmp) /**< Selects #Bs3TrapUnsetJmp_c16, #Bs3TrapUnsetJmp_c32 or #Bs3TrapUnsetJmp_c64. */ 2171 BS3_CMN_PROTO(void, Bs3TrapUnsetJmp,(void), true); 2511 2172 2512 2173 … … 2514 2175 * The current test step. 2515 2176 */ 2516 #ifndef DOXYGEN_RUNNING2517 # define g_usBs3TestStep BS3_DATA_NM(g_usBs3TestStep)2518 #endif2519 2177 extern uint16_t g_usBs3TestStep; 2520 #ifndef DOXYGEN_RUNNING2521 # define g_usBs3TestStep BS3_DATA_NM(g_usBs3TestStep)2522 #endif2523 2178 2524 2179 /** … … 2527 2182 * @param pszTest The test name. 2528 2183 */ 2529 BS3_DECL(void) Bs3TestInit_c16(const char BS3_FAR *pszTest); 2530 BS3_DECL(void) Bs3TestInit_c32(const char BS3_FAR *pszTest); /**< @copydoc Bs3TestInit_c16 */ 2531 BS3_DECL(void) Bs3TestInit_c64(const char BS3_FAR *pszTest); /**< @copydoc Bs3TestInit_c16 */ 2532 #define Bs3TestInit BS3_CMN_NM(Bs3TestInit) /**< Selects #Bs3TestInit_c16, #Bs3TestInit_c32 or #Bs3TestInit_c64. */ 2184 BS3_CMN_PROTO(void, Bs3TestInit,(const char BS3_FAR *pszTest), true); 2533 2185 2534 2186 … … 2536 2188 * Equivalent to RTTestSummaryAndDestroy. 2537 2189 */ 2538 BS3_DECL(void) Bs3TestTerm_c16(void); 2539 BS3_DECL(void) Bs3TestTerm_c32(void); /**< @copydoc Bs3TestTerm_c16 */ 2540 BS3_DECL(void) Bs3TestTerm_c64(void); /**< @copydoc Bs3TestTerm_c16 */ 2541 #define Bs3TestTerm BS3_CMN_NM(Bs3TestTerm) /**< Selects #Bs3TestTerm_c16, #Bs3TestTerm_c32 or #Bs3TestTerm_c64. */ 2190 BS3_CMN_PROTO(void, Bs3TestTerm,(void), true); 2542 2191 2543 2192 /** 2544 2193 * Equivalent to RTTestISub. 2545 2194 */ 2546 BS3_DECL(void) Bs3TestSub_c16(const char BS3_FAR *pszSubTest); 2547 BS3_DECL(void) Bs3TestSub_c32(const char BS3_FAR *pszSubTest); /**< @copydoc Bs3TestSub_c16 */ 2548 BS3_DECL(void) Bs3TestSub_c64(const char BS3_FAR *pszSubTest); /**< @copydoc Bs3TestSub_c16 */ 2549 #define Bs3TestSub BS3_CMN_NM(Bs3TestSub) /**< Selects #Bs3TestSub_c16, #Bs3TestSub_c32 or #Bs3TestSub_c64. */ 2195 BS3_CMN_PROTO(void, Bs3TestSub,(const char BS3_FAR *pszSubTest), true); 2550 2196 2551 2197 /** 2552 2198 * Equivalent to RTTestIFailedF. 2553 2199 */ 2554 BS3_DECL(void) Bs3TestSubF_c16(const char BS3_FAR *pszFormat, ...); 2555 BS3_DECL(void) Bs3TestSubF_c32(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3TestSubF_c16 */ 2556 BS3_DECL(void) Bs3TestSubF_c64(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3TestSubF_c16 */ 2557 #define Bs3TestSubF BS3_CMN_NM(Bs3TestSubF) /**< Selects #Bs3TestSubF_c16, #Bs3TestSubF_c32 or #Bs3TestSubF_c64. */ 2200 BS3_CMN_PROTO(void, Bs3TestSubF,(const char BS3_FAR *pszFormat, ...), true); 2558 2201 2559 2202 /** 2560 2203 * Equivalent to RTTestISubV. 2561 2204 */ 2562 BS3_DECL(void) Bs3TestSubV_c16(const char BS3_FAR *pszFormat, va_list va); 2563 BS3_DECL(void) Bs3TestSubV_c32(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3TestSubV_c16 */ 2564 BS3_DECL(void) Bs3TestSubV_c64(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3TestSubV_c16 */ 2565 #define Bs3TestSubV BS3_CMN_NM(Bs3TestSubV) /**< Selects #Bs3TestSubV_c16, #Bs3TestSubV_c32 or #Bs3TestSubV_c64. */ 2205 BS3_CMN_PROTO(void, Bs3TestSubV,(const char BS3_FAR *pszFormat, va_list va), true); 2566 2206 2567 2207 /** 2568 2208 * Equivalent to RTTestISubDone. 2569 2209 */ 2570 BS3_DECL(void) Bs3TestSubDone_c16(void); 2571 BS3_DECL(void) Bs3TestSubDone_c32(void); /**< @copydoc Bs3TestSubDone_c16 */ 2572 BS3_DECL(void) Bs3TestSubDone_c64(void); /**< @copydoc Bs3TestSubDone_c16 */ 2573 #define Bs3TestSubDone BS3_CMN_NM(Bs3TestSubDone) /**< Selects #Bs3TestSubDone_c16, #Bs3TestSubDone_c32 or #Bs3TestSubDone_c64. */ 2210 BS3_CMN_PROTO(void, Bs3TestSubDone,(void), true); 2574 2211 2575 2212 /** 2576 2213 * Equivalent to RTTestSubErrorCount. 2577 2214 */ 2578 BS3_DECL(uint16_t) Bs3TestSubErrorCount_c16(void); 2579 BS3_DECL(uint16_t) Bs3TestSubErrorCount_c32(void); /**< @copydoc Bs3TestSubErrorCount_c16 */ 2580 BS3_DECL(uint16_t) Bs3TestSubErrorCount_c64(void); /**< @copydoc Bs3TestSubErrorCount_c16 */ 2581 #define Bs3TestSubErrorCount BS3_CMN_NM(Bs3TestSubErrorCount) /**< Selects #Bs3TestSubErrorCount_c16, #Bs3TestSubErrorCount_c32 or #Bs3TestSubErrorCount_c64. */ 2215 BS3_CMN_PROTO(uint16_t, Bs3TestSubErrorCount,(void), true); 2582 2216 2583 2217 /** … … 2587 2221 * @param ... String format arguments. 2588 2222 */ 2589 BS3_DECL(void) Bs3TestPrintf_c16(const char BS3_FAR *pszFormat, ...); 2590 BS3_DECL(void) Bs3TestPrintf_c32(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3TestPrintf_c16 */ 2591 BS3_DECL(void) Bs3TestPrintf_c64(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3TestPrintf_c16 */ 2592 #define Bs3TestPrintf BS3_CMN_NM(Bs3TestPrintf) /**< Selects #Bs3TestPrintf_c16, #Bs3TestPrintf_c32 or #Bs3TestPrintf_c64. */ 2223 BS3_CMN_PROTO(void, Bs3TestPrintf,(const char BS3_FAR *pszFormat, ...), true); 2593 2224 2594 2225 /** … … 2598 2229 * @param va String format arguments. 2599 2230 */ 2600 BS3_DECL(void) Bs3TestPrintfV_c16(const char BS3_FAR *pszFormat, va_list va); 2601 BS3_DECL(void) Bs3TestPrintfV_c32(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3TestPrintfV_c16 */ 2602 BS3_DECL(void) Bs3TestPrintfV_c64(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3TestPrintfV_c16 */ 2603 #define Bs3TestPrintfV BS3_CMN_NM(Bs3TestPrintfV) /**< Selects #Bs3TestPrintfV_c16, #Bs3TestPrintfV_c32 or #Bs3TestPrintfV_c64. */ 2231 BS3_CMN_PROTO(void, Bs3TestPrintfV,(const char BS3_FAR *pszFormat, va_list va), true); 2604 2232 2605 2233 /** 2606 2234 * Equivalent to RTTestIFailed. 2607 2235 */ 2608 BS3_DECL(void) Bs3TestFailed_c16(const char BS3_FAR *pszMessage); 2609 BS3_DECL(void) Bs3TestFailed_c32(const char BS3_FAR *pszMessage); /**< @copydoc Bs3TestFailed_c16 */ 2610 BS3_DECL(void) Bs3TestFailed_c64(const char BS3_FAR *pszMessage); /**< @copydoc Bs3TestFailed_c16 */ 2611 #define Bs3TestFailed BS3_CMN_NM(Bs3TestFailed) /**< Selects #Bs3TestFailed_c16, #Bs3TestFailed_c32 or #Bs3TestFailed_c64. */ 2236 BS3_CMN_PROTO(void, Bs3TestFailed,(const char BS3_FAR *pszMessage), true); 2612 2237 2613 2238 /** 2614 2239 * Equivalent to RTTestIFailedF. 2615 2240 */ 2616 BS3_DECL(void) Bs3TestFailedF_c16(const char BS3_FAR *pszFormat, ...); 2617 BS3_DECL(void) Bs3TestFailedF_c32(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3TestFailedF_c16 */ 2618 BS3_DECL(void) Bs3TestFailedF_c64(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3TestFailedF_c16 */ 2619 #define Bs3TestFailedF BS3_CMN_NM(Bs3TestFailedF) /**< Selects #Bs3TestFailedF_c16, #Bs3TestFailedF_c32 or #Bs3TestFailedF_c64. */ 2241 BS3_CMN_PROTO(void, Bs3TestFailedF,(const char BS3_FAR *pszFormat, ...), true); 2620 2242 2621 2243 /** 2622 2244 * Equivalent to RTTestIFailedV. 2623 2245 */ 2624 BS3_DECL(void) Bs3TestFailedV_c16(const char BS3_FAR *pszFormat, va_list va); 2625 BS3_DECL(void) Bs3TestFailedV_c32(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3TestFailedV_c16 */ 2626 BS3_DECL(void) Bs3TestFailedV_c64(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3TestFailedV_c16 */ 2627 #define Bs3TestFailedV BS3_CMN_NM(Bs3TestFailedV) /**< Selects #Bs3TestFailedV_c16, #Bs3TestFailedV_c32 or #Bs3TestFailedV_c64. */ 2246 BS3_CMN_PROTO(void, Bs3TestFailedV,(const char BS3_FAR *pszFormat, va_list va), true); 2628 2247 2629 2248 /** … … 2632 2251 * @param pszWhy Optional reason why it's being skipped. 2633 2252 */ 2634 BS3_DECL(void) Bs3TestSkipped_c16(const char BS3_FAR *pszWhy); 2635 BS3_DECL(void) Bs3TestSkipped_c32(const char BS3_FAR *pszWhy); /**< @copydoc Bs3TestSkipped_c16 */ 2636 BS3_DECL(void) Bs3TestSkipped_c64(const char BS3_FAR *pszWhy); /**< @copydoc Bs3TestSkipped_c16 */ 2637 #define Bs3TestSkipped BS3_CMN_NM(Bs3TestSkipped) /**< Selects #Bs3TestSkipped_c16, #Bs3TestSkipped_c32 or #Bs3TestSkipped_c64. */ 2253 BS3_CMN_PROTO(void, Bs3TestSkipped,(const char BS3_FAR *pszWhy), true); 2638 2254 2639 2255 /** … … 2643 2259 * @param ... Format arguments. 2644 2260 */ 2645 BS3_DECL(void) Bs3TestSkippedF_c16(const char BS3_FAR *pszFormat, ...); 2646 BS3_DECL(void) Bs3TestSkippedF_c32(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3TestSkippedF_c16 */ 2647 BS3_DECL(void) Bs3TestSkippedF_c64(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3TestSkippedF_c16 */ 2648 #define Bs3TestSkippedF BS3_CMN_NM(Bs3TestSkippedF) /**< Selects #Bs3TestSkippedF_c16, #Bs3TestSkippedF_c32 or #Bs3TestSkippedF_c64. */ 2261 BS3_CMN_PROTO(void, Bs3TestSkippedF,(const char BS3_FAR *pszFormat, ...), true); 2649 2262 2650 2263 /** … … 2654 2267 * @param va Format arguments. 2655 2268 */ 2656 BS3_DECL(void) Bs3TestSkippedV_c16(const char BS3_FAR *pszFormat, va_list va); 2657 BS3_DECL(void) Bs3TestSkippedV_c32(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3TestSkippedV_c16 */ 2658 BS3_DECL(void) Bs3TestSkippedV_c64(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3TestSkippedV_c16 */ 2659 #define Bs3TestSkippedV BS3_CMN_NM(Bs3TestSkippedV) /**< Selects #Bs3TestSkippedV_c16, #Bs3TestSkippedV_c32 or #Bs3TestSkippedV_c64. */ 2269 BS3_CMN_PROTO(void, Bs3TestSkippedV,(const char BS3_FAR *pszFormat, va_list va), true); 2660 2270 2661 2271 /** … … 2673 2283 * @param idTestStep Test step identifier. 2674 2284 */ 2675 BS3_DECL(bool) Bs3TestCheckRegCtxEx_c16(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust, int16_t cbSpAdjust, 2676 uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep); 2677 BS3_DECL(bool) Bs3TestCheckRegCtxEx_c32(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust, int16_t cbSpAdjust, 2678 uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep); /** @copydoc Bs3TestCheckRegCtxEx_c16 */ 2679 BS3_DECL(bool) Bs3TestCheckRegCtxEx_c64(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust, int16_t cbSpAdjust, 2680 uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep); /** @copydoc Bs3TestCheckRegCtxEx_c16 */ 2681 #define Bs3TestCheckRegCtxEx BS3_CMN_NM(Bs3TestCheckRegCtxEx) /**< Selects #Bs3TestCheckRegCtxEx_c16, #Bs3TestCheckRegCtxEx_c32 or #Bs3TestCheckRegCtxEx_c64. */ 2285 BS3_CMN_PROTO(bool, Bs3TestCheckRegCtxEx,(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust, 2286 int16_t cbSpAdjust, uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep), true); 2682 2287 2683 2288 /** … … 2845 2450 * For proper operation on OLDer CPUs, call #Bs3CpuDetect_mmm first. 2846 2451 */ 2847 BS3_DECL (void) Bs3InitMemory_rm(void);2452 BS3_DECL_FAR(void) Bs3InitMemory_rm(void); 2848 2453 2849 2454 … … 2866 2471 */ 2867 2472 #define BS3_MODE_EXPAND_PROTOTYPES(a_RetType, a_BaseFnNm, a_Parameters) \ 2868 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_rm) a_Parameters; \ 2869 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pe16) a_Parameters; \ 2870 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pe16_32) a_Parameters; \ 2871 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pe16_v86) a_Parameters; \ 2872 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pe32) a_Parameters; \ 2873 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pe32_16) a_Parameters; \ 2874 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pev86) a_Parameters; \ 2875 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pp16) a_Parameters; \ 2876 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pp16_32) a_Parameters; \ 2877 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pp16_v86) a_Parameters; \ 2878 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pp32) a_Parameters; \ 2879 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pp32_16) a_Parameters; \ 2880 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_ppv86) a_Parameters; \ 2881 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16) a_Parameters; \ 2882 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16_32) a_Parameters; \ 2883 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16_v86)a_Parameters; \ 2884 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae32) a_Parameters; \ 2885 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_pae32_16) a_Parameters; \ 2886 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_paev86) a_Parameters; \ 2887 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_lm16) a_Parameters; \ 2888 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_lm32) a_Parameters; \ 2889 BS3_DECL(a_RetType) RT_CONCAT(a_BaseFnNm,_lm64) a_Parameters 2473 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_rm) a_Parameters; \ 2474 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_rm_far) a_Parameters; \ 2475 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe16) a_Parameters; \ 2476 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe16_32) a_Parameters; \ 2477 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe16_v86) a_Parameters; \ 2478 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe32) a_Parameters; \ 2479 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pe32_16) a_Parameters; \ 2480 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pev86) a_Parameters; \ 2481 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp16) a_Parameters; \ 2482 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp16_32) a_Parameters; \ 2483 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp16_v86) a_Parameters; \ 2484 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp32) a_Parameters; \ 2485 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pp32_16) a_Parameters; \ 2486 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_ppv86) a_Parameters; \ 2487 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16) a_Parameters; \ 2488 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16_32) a_Parameters; \ 2489 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae16_v86)a_Parameters; \ 2490 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae32) a_Parameters; \ 2491 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_pae32_16) a_Parameters; \ 2492 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_paev86) a_Parameters; \ 2493 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_lm16) a_Parameters; \ 2494 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_lm32) a_Parameters; \ 2495 BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_BaseFnNm,_lm64) a_Parameters 2890 2496 2891 2497 /** … … 2965 2571 2966 2572 /** The return value of #Bs3CpuDetect_mmm. (Initial value is BS3CPU_TYPE_MASK.) */ 2967 #ifndef DOXYGEN_RUNNING2968 # define g_uBs3CpuDetected BS3_DATA_NM(g_uBs3CpuDetected)2969 #endif2970 2573 extern uint16_t g_uBs3CpuDetected; 2971 2574 … … 2991 2594 2992 2595 2993 #endif 2994 2596 /* 2597 * Include default function symbol mangling. 2598 */ 2599 #include "bs3kit-mangling-code.h" 2600 2601 2602 #endif 2603 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r60439 r60527 138 138 %endmacro 139 139 140 ; Default to register aliases for ARCH_BITS. 141 BS3_SET_REG_ALIASES ARCH_BITS 142 143 144 ;; Wrapper around BITS. 145 ; Updates __BITS__ (built-in variable in nasm, we work it for yasm) as well 146 ; a number of convenient macros and register aliases. 147 ; 148 ; @param %1 The CPU bit count: 16, 32 or 64 149 ; @remarks ARCH_BITS is not modified and will remain what it was on the 150 ; assembler command line. 151 %macro BS3_SET_BITS 1 152 BITS %1 153 140 ;; 141 ; Redefines macros that follows __BITS__. 142 %macro BS3_SET_BITS_MACROS 1 143 ;; Emulate the __BITS__ macro in NASM 2.0+. Follows BS3_SET_BITS. 154 144 %ifdef __YASM__ 155 145 %undef __BITS__ … … 157 147 %endif 158 148 149 ;; Mostly internal macro. Follows BS3_SET_BITS. 159 150 %undef BS3_NAME_UNDERSCORE 160 151 %if %1 == 64 … … 164 155 %endif 165 156 157 ;; For segment overrides and stuff. Follows BS3_SET_BITS. 166 158 %undef BS3_ONLY_16BIT 167 159 %if %1 == 16 … … 171 163 %endif 172 164 165 ;; For odd 64-bit stuff. Follows BS3_SET_BITS. 173 166 %undef BS3_ONLY_64BIT 174 167 %if %1 == 64 … … 178 171 %endif 179 172 173 ;; For segment overrides and stuff. Follows BS3_SET_BITS. 180 174 %undef BS3_NOT_64BIT 181 175 %if %1 == 64 … … 185 179 %endif 186 180 181 ;; For stack cleanups and similar where each bit mode is different. Follows BS3_SET_BITS. 187 182 %undef BS3_IF_16_32_64BIT 188 183 %if %1 == 16 … … 194 189 %endif 195 190 191 ;; For RIP relative addressing in 64-bit mode and absolute addressing in 192 ; other modes. Follows BS3_SET_BITS. 196 193 %undef BS3_WRT_RIP 197 194 %if %1 == 64 … … 241 238 %endif 242 239 240 ;; 241 ; Same as BS3_CMN_NM except in 16-bit mode, it will generate the far name. 242 ; (16-bit code generally have both near and far callable symbols, so we won't 243 ; be restricted to 64KB test code.) 244 %if %1 == 16 245 %define BS3_CMN_NM_FAR(a_Name) BS3_NAME_UNDERSCORE %+ a_Name %+ _f %+ __BITS__ 246 %else 247 %define BS3_CMN_NM_FAR(a_Name) BS3_CMN_NM(a_Name) 248 %endif 249 250 %endmacro 251 252 ; Default to register aliases for ARCH_BITS. 253 BS3_SET_REG_ALIASES ARCH_BITS 254 255 ; Define macros for ARCH_BITS. 256 BS3_SET_BITS_MACROS ARCH_BITS 257 258 259 ;; Wrapper around BITS. 260 ; Updates __BITS__ (built-in variable in nasm, we work it for yasm) as well 261 ; a number of convenient macros and register aliases. 262 ; 263 ; @param %1 The CPU bit count: 16, 32 or 64 264 ; @remarks ARCH_BITS is not modified and will remain what it was on the 265 ; assembler command line. 266 %macro BS3_SET_BITS 1 267 BITS %1 268 BS3_SET_BITS_MACROS %1 243 269 BS3_SET_REG_ALIASES %1 244 270 %endmacro 245 246 247 ;; Emulate the __BITS__ macro in NASM 2.0+. Follows BS3_SET_BITS.248 %ifdef __YASM__249 %define __BITS__ ARCH_BITS250 %endif251 252 ;; Mostly internal macro. Follows BS3_SET_BITS.253 %if ARCH_BITS == 64254 %define BS3_NAME_UNDERSCORE255 %else256 %define BS3_NAME_UNDERSCORE _257 %endif258 259 ;; For RIP relative addressing in 64-bit mode and absolute addressing in260 ; other modes. Follows BS3_SET_BITS.261 %if ARCH_BITS == 64262 %ifdef __YASM__263 %define BS3_WRT_RIP(a_Sym) a_Sym wrt rip264 %else265 %define BS3_WRT_RIP(a_Sym) rel a_Sym ; Baka! Why couldn't they do 'wrt rip' like yasm?266 %endif267 %else268 %define BS3_WRT_RIP(a_Sym) a_Sym269 %endif270 271 ;; For segment overrides and stuff. Follows BS3_SET_BITS.272 %if ARCH_BITS == 16273 %define BS3_ONLY_16BIT(a_Expr) a_Expr274 %else275 %define BS3_ONLY_16BIT(a_Expr)276 %endif277 278 ;; For odd 64-bit stuff. Follows BS3_SET_BITS.279 %if ARCH_BITS == 64280 %define BS3_ONLY_64BIT(a_Expr) a_Expr281 %else282 %define BS3_ONLY_64BIT(a_Expr)283 %endif284 285 ;; For segment overrides and stuff. Follows BS3_SET_BITS.286 %if ARCH_BITS == 64287 %define BS3_NOT_64BIT(a_Expr)288 %else289 %define BS3_NOT_64BIT(a_Expr) a_Expr290 %endif291 292 ;; For stack cleanups and similar where each bit mode is different. Follows BS3_SET_BITS.293 %if ARCH_BITS == 16294 %define BS3_IF_16_32_64BIT(a_16BitExpr, a_32BitExpr, a_64BitExpr) a_16BitExpr295 %elif ARCH_BITS == 32296 %define BS3_IF_16_32_64BIT(a_16BitExpr, a_32BitExpr, a_64BitExpr) a_32BitExpr297 %else298 %define BS3_IF_16_32_64BIT(a_16BitExpr, a_32BitExpr, a_64BitExpr) a_64BitExpr299 %endif300 301 271 302 272 ;; … … 358 328 section BS3TEXT16 359 329 %endif 330 %undef BS3_CUR_SEG_BEGIN_MACRO 331 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_TEXT16 332 BS3_SET_BITS 16 333 %endmacro 334 335 %macro BS3_BEGIN_TEXT16_NEARSTUBS 0 336 %ifndef BS3_BEGIN_TEXT16_NEARSTUBS_NOT_FIRST 337 %define BS3_BEGIN_TEXT16_NEARSTUBS_NOT_FIRST 338 %ifdef ASM_FORMAT_ELF 339 section BS3TEXT16_NEARSTUBS align=1 progbits alloc exec nowrite 340 %else 341 section BS3TEXT16_NEARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 342 %endif 343 %else 344 section BS3TEXT16_NEARSTUBS 345 %endif 346 %undef BS3_CUR_SEG_BEGIN_MACRO 347 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_TEXT16_NEARSTUBS 348 BS3_SET_BITS 16 349 %endmacro 350 351 %macro BS3_BEGIN_TEXT16_FARSTUBS 0 352 %ifndef BS3_BEGIN_TEXT16_FARSTUBS_NOT_FIRST 353 %define BS3_BEGIN_TEXT16_FARSTUBS_NOT_FIRST 354 %ifdef ASM_FORMAT_ELF 355 section BS3TEXT16_FARSTUBS align=1 progbits alloc exec nowrite 356 %else 357 section BS3TEXT16_FARSTUBS align=1 CLASS=BS3CLASS16CODE PUBLIC USE16 358 %endif 359 %else 360 section BS3TEXT16_FARSTUBS 361 %endif 362 %undef BS3_CUR_SEG_BEGIN_MACRO 363 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_TEXT16_FARSTUBS 364 BS3_SET_BITS 16 365 %endmacro 366 367 %macro BS3_BEGIN_RMTEXT16 0 368 %ifndef BS3_BEGIN_RMTEXT16_NOT_FIRST 369 %define BS3_BEGIN_RMTEXT16_NOT_FIRST 370 %ifdef ASM_FORMAT_ELF 371 section BS3RMTEXT16 align=2 progbits alloc exec nowrite 372 %else 373 section BS3RMTEXT16 align=2 CLASS=BS3CLASS16RMCODE PUBLIC USE16 374 %endif 375 %else 376 section BS3RMTEXT16 377 %endif 378 %undef BS3_CUR_SEG_BEGIN_MACRO 379 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_RMTEXT16 360 380 BS3_SET_BITS 16 361 381 %endmacro … … 375 395 section BS3DATA16 376 396 %endif 397 %undef BS3_CUR_SEG_BEGIN_MACRO 398 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_DATA16 377 399 BS3_SET_BITS 16 378 400 %endmacro … … 389 411 section BS3TEXT32 390 412 %endif 413 %undef BS3_CUR_SEG_BEGIN_MACRO 414 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_TEXT32 391 415 BS3_SET_BITS 32 392 416 %endmacro … … 403 427 section BS3DATA32 404 428 %endif 429 %undef BS3_CUR_SEG_BEGIN_MACRO 430 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_DATA32 405 431 BS3_SET_BITS 32 406 432 %endmacro … … 417 443 section BS3TEXT64 418 444 %endif 445 %undef BS3_CUR_SEG_BEGIN_MACRO 446 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_TEXT64 419 447 BS3_SET_BITS 64 420 448 %endmacro … … 431 459 section BS3DATA64 432 460 %endif 461 %undef BS3_CUR_SEG_BEGIN_MACRO 462 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_DATA64 433 463 BS3_SET_BITS 64 434 464 %endmacro … … 446 476 section BS3SYSTEM16 447 477 %endif 478 %undef BS3_CUR_SEG_BEGIN_MACRO 479 %xdefine BS3_CUR_SEG_BEGIN_MACRO BS3_BEGIN_SYSTEM16 448 480 BS3_SET_BITS 16 449 481 %endmacro … … 515 547 %endmacro 516 548 549 ;; 550 ; Same as BS3_EXTERN_CMN except it picks the far variant in 16-bit code. 551 ; 552 ; @param %1 The unmangled common name. 553 ; 554 ; @remarks Must enter the segment in which this name is defined. 555 ; 556 %macro BS3_EXTERN_CMN_FAR 1 557 extern BS3_CMN_NM_FAR(%1) 558 %undef %1 559 %define %1 BS3_CMN_NM_FAR(%1) 560 %endmacro 561 517 562 ;; @def BS3_EXTERN_TMPL 518 563 ; Mangles the given name into a template specific one. For ease of use, the … … 629 674 630 675 676 ;; @name BS3_PBC_XXX - For use as the 2nd parameter to BS3_PROC_BEGIN_CMN. 677 ;; @{ 678 %define BS3_PBC_NEAR 0 ;;< Only near. 679 %define BS3_PBC_FAR 1 ;;< Only far. 680 %define BS3_PBC_HYBRID 2 ;;< Hybrid near/far procedure, trashing AX 681 %define BS3_PBC_HYBRID_SAFE 3 ;;< Hybrid near/far procedure, no trashing but slower. 682 %define BS3_PBC_HYBRID_0_ARGS 4 ;;< Hybrid near/far procedure, no parameters so separate far stub, no trashing, fast near calls. 683 ;; @} 684 631 685 ;; Convenience macro for defining common procedures. 632 %macro BS3_PROC_BEGIN_CMN 1 633 BS3_PROC_BEGIN BS3_CMN_NM(%1) 686 ; This will emit both near and far 16-bit symbols according to parameter %2 (BS3_PBC_XXX). 687 %macro BS3_PROC_BEGIN_CMN 2 688 %undef BS3_CUR_PROC_FLAGS 689 %if __BITS__ == 16 690 %if %2 == BS3_PBC_NEAR 691 %define BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 692 %xdefine cbCurRetAddr 2 693 BS3_PROC_BEGIN BS3_CMN_NM(%1) 694 695 %elif %2 == BS3_PBC_FAR 696 %define BS3_CUR_PROC_FLAGS BS3_PBC_FAR 697 %xdefine cbCurRetAddr 4 698 BS3_PROC_BEGIN BS3_CMN_NM_FAR(%1) 699 700 %elif %2 == BS3_PBC_HYBRID 701 %define BS3_CUR_PROC_FLAGS BS3_PBC_HYBRID 702 %xdefine cbCurRetAddr 4 703 BS3_GLOBAL_NAME_EX BS3_CMN_NM(%1), function, 3 704 pop ax 705 push cs 706 push ax 707 BS3_PROC_BEGIN BS3_CMN_NM_FAR(%1) 708 709 %elif %2 == BS3_PBC_HYBRID_SAFE 710 %define BS3_CUR_PROC_FLAGS BS3_PBC_HYBRID_SAFE 711 %xdefine cbCurRetAddr 4 712 BS3_GLOBAL_NAME_EX BS3_CMN_NM(%1), function, 3 713 extern Bs3CreateHybridFarRet_c16 714 call Bs3CreateHybridFarRet_c16 715 BS3_PROC_BEGIN BS3_CMN_NM_FAR(%1) 716 717 %elif %2 == BS3_PBC_HYBRID_0_ARGS 718 %define BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 719 %xdefine cbCurRetAddr 2 720 %undef TMP_BEGIN_PREV_SEG 721 %xdefine TMP_BEGIN_PREV_SEG BS3_CUR_SEG_BEGIN_MACRO 722 723 BS3_BEGIN_TEXT16_FARSTUBS 724 BS3_PROC_BEGIN BS3_CMN_NM_FAR(%1) 725 call BS3_CMN_NM(%1) 726 retf 727 BS3_PROC_END BS3_CMN_NM_FAR(%1) 728 729 TMP_BEGIN_PREV_SEG 730 BS3_PROC_BEGIN BS3_CMN_NM(%1) 731 732 %else 733 %error BS3_PROC_BEGIN_CMN parameter 2 value %2 is not recognized. 734 735 %define BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 736 %xdefine cbCurRetAddr 4 737 BS3_PROC_BEGIN BS3_CMN_NM(%1) 738 %endif 739 %else 740 %define BS3_CUR_PROC_FLAGS BS3_PBC_NEAR 741 %xdefine cbCurRetAddr xCB 742 BS3_PROC_BEGIN BS3_CMN_NM(%1) 743 %endif 634 744 %endmacro 635 745 636 746 ;; Convenience macro for defining common procedures. 637 747 %macro BS3_PROC_END_CMN 1 638 BS3_PROC_END BS3_CMN_NM(%1) 639 %endmacro 640 748 %if __BITS__ == 16 749 %if BS3_CUR_PROC_FLAGS == BS3_PBC_NEAR 750 BS3_PROC_END BS3_CMN_NM(%1) 751 %else 752 BS3_PROC_END BS3_CMN_NM_FAR(%1) 753 %endif 754 %else 755 BS3_PROC_END BS3_CMN_NM(%1) 756 %endif 757 %undef cbCurRetAddr 758 %endmacro 759 760 ;; Does a far return in 16-bit code, near return in 32-bit and 64-bit. 761 ; This is for use with BS3_PBC_XXX 762 %macro BS3_HYBRID_RET 0-1 763 %if __BITS__ == 16 764 %if %0 > 0 765 %if BS3_CUR_PROC_FLAGS == BS3_PBC_NEAR || BS3_CUR_PROC_FLAGS == BS3_PBC_HYBRID_0_ARGS 766 ret %1 767 %else 768 retf %1 769 %endif 770 %else 771 %if BS3_CUR_PROC_FLAGS == BS3_PBC_NEAR || BS3_CUR_PROC_FLAGS == BS3_PBC_HYBRID_0_ARGS 772 ret 773 %else 774 retf 775 %endif 776 %endif 777 %else 778 %if BS3_CUR_PROC_FLAGS != BS3_PBC_NEAR 779 %error Expected BS3_CUR_PROC_FLAGS to be BS3_PBC_NEAR in non-16-bit code. 780 %endif 781 %if %0 > 0 782 ret %1 783 %else 784 ret 785 %endif 786 %endif 787 %endmacro 788 789 ;; 790 ; Generate a safe 16-bit far stub for function %1, shuffling %2 bytes of parameters. 791 ; 792 ; This does absolutely nothing in 32-bit and 64-bit mode. 793 ; 794 ; @param 1 The function basename. 795 ; @param 2 The number of bytes of parameters on the stack, must be a multiple of 2. 796 ; @remarks Changes the segment to TEXT16. 797 ; 798 %macro BS3_CMN_FAR_STUB 2 799 %if %2 <= 1 || (%2 & 1) 800 %error Invalid parameter frame size passed to BS3_CMN_FAR_STUB: %2 801 %endif 802 %if __BITS__ == 16 803 BS3_BEGIN_TEXT16_FARSTUBS 804 BS3_PROC_BEGIN_CMN %1, BS3_PBC_FAR 805 CPU 8086 806 push bp 807 mov bp, sp 808 %assign offParam %2 809 %rep %2/2 810 push word [bp + xCB + cbCurRetAddr + offParam - 2] 811 %assign offParam offParam - 2 812 %endrep 813 call BS3_CMN_NM(%1) 814 add sp, %2 815 pop bp 816 retf 817 BS3_PROC_END_CMN %1 818 BS3_BEGIN_TEXT16 819 %endif 820 %endmacro 641 821 642 822 ;; Convenience macro for defining mode specific procedures.
Note:
See TracChangeset
for help on using the changeset viewer.