Changeset 92613 in vbox for trunk/include
- Timestamp:
- Nov 26, 2021 9:53:47 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148505
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r92556 r92613 653 653 654 654 /** @internal */ 655 SUPDECL(PSUPGIPCPU) SUPGetGipCpuPtrForAsyncMode(PSUPGLOBALINFOPAGE pGip); 655 656 SUPDECL(uint64_t) SUPGetCpuHzFromGipForAsyncMode(PSUPGLOBALINFOPAGE pGip); 656 657 SUPDECL(bool) SUPIsTscFreqCompatible(uint64_t uCpuHz, uint64_t *puGipCpuHz, bool fRelax); 657 658 SUPDECL(bool) SUPIsTscFreqCompatibleEx(uint64_t uBaseCpuHz, uint64_t uCpuHz, bool fRelax); 658 659 660 661 /** 662 * Gets CPU entry of the calling CPU. 663 * 664 * @returns Pointer to the CPU entry on success, NULL on failure. 665 * @param pGip The GIP pointer. 666 */ 667 DECLINLINE(PSUPGIPCPU) SUPGetGipCpuPtr(PSUPGLOBALINFOPAGE pGip) 668 { 669 if (RT_LIKELY( pGip 670 && pGip->u32Magic == SUPGLOBALINFOPAGE_MAGIC)) 671 { 672 switch (pGip->u32Mode) 673 { 674 case SUPGIPMODE_INVARIANT_TSC: 675 case SUPGIPMODE_SYNC_TSC: 676 return &pGip->aCPUs[0]; 677 case SUPGIPMODE_ASYNC_TSC: 678 return SUPGetGipCpuPtrForAsyncMode(pGip); 679 default: break; /* shut up gcc */ 680 } 681 } 682 AssertFailed(); 683 return NULL; 684 } 659 685 660 686 /** … … 1202 1228 * @param pszProgName The program name. This will be used to figure out which 1203 1229 * DLL/SO/DYLIB to load and execute. 1204 * @param fFlags Flags.1230 * @param fFlags SUPSECMAIN_FLAGS_XXX. 1205 1231 * @param argc The argument count. 1206 1232 * @param argv The argument vector. … … 1209 1235 DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int argc, char **argv, char **envp); 1210 1236 1211 /** @name SUP R3HardenedMain flags.1237 /** @name SUPSECMAIN_FLAGS_XXX - SUPR3HardenedMain flags. 1212 1238 * @{ */ 1213 1239 /** Don't open the device. (Intended for VirtualBox without -startvm.) */ 1214 #define SUPSECMAIN_FLAGS_DONT_OPEN_DEV RT_BIT_32(0)1240 #define SUPSECMAIN_FLAGS_DONT_OPEN_DEV RT_BIT_32(0) 1215 1241 /** The hardened DLL has a "TrustedError" function (see FNSUPTRUSTEDERROR). */ 1216 #define SUPSECMAIN_FLAGS_TRUSTED_ERROR RT_BIT_32(1)1242 #define SUPSECMAIN_FLAGS_TRUSTED_ERROR RT_BIT_32(1) 1217 1243 /** Hack for making VirtualBoxVM use VirtualBox.dylib on Mac OS X. 1218 1244 * @note Not used since 6.0 */ 1219 #define SUPSECMAIN_FLAGS_OSX_VM_APP RT_BIT_32(2) 1245 #define SUPSECMAIN_FLAGS_OSX_VM_APP RT_BIT_32(2) 1246 /** The first process. 1247 * @internal */ 1248 #define SUPSECMAIN_FLAGS_FIRST_PROCESS RT_BIT_32(3) 1220 1249 /** Program binary location mask. */ 1221 #define SUPSECMAIN_FLAGS_LOC_MASK UINT32_C(0x00000030)1250 #define SUPSECMAIN_FLAGS_LOC_MASK UINT32_C(0x00000030) 1222 1251 /** Default binary location is the application binary directory. Does 1223 1252 * not need to be given explicitly (it's 0). */ 1224 #define SUPSECMAIN_FLAGS_LOC_APP_BIN UINT32_C(0x00000000)1253 #define SUPSECMAIN_FLAGS_LOC_APP_BIN UINT32_C(0x00000000) 1225 1254 /** The binary is located in the testcase directory instead of the 1226 1255 * default application binary directory. */ 1227 #define SUPSECMAIN_FLAGS_LOC_TESTCASE UINT32_C(0x00000010)1256 #define SUPSECMAIN_FLAGS_LOC_TESTCASE UINT32_C(0x00000010) 1228 1257 /** The binary is located in a nested application bundle under Resources/ in the 1229 1258 * main Mac OS X application (think Resources/VirtualBoxVM.app). */ 1230 #define SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP UINT32_C(0x00000020) 1231 /** The first process. 1232 * @internal */ 1233 #define SUPSECMAIN_FLAGS_FIRST_PROCESS UINT32_C(0x00000100) 1259 #define SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP UINT32_C(0x00000020) 1260 /** Driverless IEM-only mode is allowed, so don't fail fatally just because 1261 * the VBox support driver is unavailable. */ 1262 #define SUPSECMAIN_FLAGS_DRIVERLESS_IEM_ALLOWED RT_BIT_32(8) 1263 #ifdef VBOX_WITH_DRIVERLESS_NEM_FALLBACK 1264 /** Driverless NEM is a fallback posibility, so don't fail fatally just 1265 * because the VBox support driver is unavailable. 1266 * This may imply checking NEM requirements, depending on the host. 1267 * @note Not supported on Windows. */ 1268 # define SUPSECMAIN_FLAGS_DRIVERLESS_NEM_FALLBACK RT_BIT_32(9) 1269 #endif 1270 1234 1271 /** @} */ 1235 1272 … … 1252 1289 * 1253 1290 * @returns VBox status code. 1254 * @param f Unrestricted The desired access.1291 * @param fFlags SUPR3INIT_F_XXX 1255 1292 * @param ppSession Where to store the session handle. Defaults to NULL. 1256 1293 */ 1257 SUPR3DECL(int) SUPR3InitEx(bool fUnrestricted, PSUPDRVSESSION *ppSession); 1294 SUPR3DECL(int) SUPR3InitEx(uint32_t fFlags, PSUPDRVSESSION *ppSession); 1295 /** @name SUPR3INIT_F_XXX - Flags for SUPR3InitEx 1296 * @{ */ 1297 /** Unrestricted access. */ 1298 #define SUPR3INIT_F_UNRESTRICTED RT_BIT_32(0) 1299 /** Limited access (for Main). */ 1300 #define SUPR3INIT_F_LIMITED RT_BIT_32(1) 1301 /** Allow driverless IEM mode if the VBox support driver is unavailable. 1302 * @see SUPSECMAIN_FLAGS_DRIVERLESS_IEM_ALLOWED */ 1303 #define SUPR3INIT_F_DRIVERLESS_IEM_ALLOWED RT_BIT_32(2) 1304 #ifdef VBOX_WITH_DRIVERLESS_NEM_FALLBACK 1305 /** Allow driverless NEM mode as fallback if the VBox support driver is unavailable. 1306 * @see SUPSECMAIN_FLAGS_DRIVERLESS_NEM_FALLBACK */ 1307 # define SUPR3INIT_F_DRIVERLESS_NEM_FALLBACK RT_BIT_32(3) 1308 #endif 1309 /** @} */ 1258 1310 1259 1311 /** -
trunk/include/iprt/initterm.h
r92562 r92613 51 51 #ifdef IN_RING3 52 52 53 /** @name RTR3Init flags (RTR3INIT_XXX). 53 /** @name RTR3INIT_FLAGS_XXX - RTR3Init* flags. 54 * @see RTR3InitExeNoArguments, RTR3InitExe, RTR3InitDll, RTR3InitEx 54 55 * @{ */ 55 /** Try initialize SUPLib. */56 # define RTR3INIT_FLAGS_SUPLIB RT_BIT(0)57 56 /** Initializing IPRT from a DLL. */ 58 # define RTR3INIT_FLAGS_DLL RT_BIT(1) 59 /** We are sharing a process space, so we need to behave. */ 60 # define RTR3INIT_FLAGS_UNOBTRUSIVE RT_BIT(2) 57 # define RTR3INIT_FLAGS_DLL RT_BIT(0) 61 58 /** The caller ensures that the argument vector is UTF-8. */ 62 # define RTR3INIT_FLAGS_UTF8_ARGV RT_BIT(3)59 # define RTR3INIT_FLAGS_UTF8_ARGV RT_BIT(1) 63 60 /** Indicates that this is a standalone application without any additional 64 61 * shared libraries in the application directory. Mainly windows loader mess. */ 65 # define RTR3INIT_FLAGS_STANDALONE_APP RT_BIT(4) 62 # define RTR3INIT_FLAGS_STANDALONE_APP RT_BIT(2) 63 /** We are sharing a process space, so we need to behave. */ 64 # define RTR3INIT_FLAGS_UNOBTRUSIVE RT_BIT(3) 65 66 /** Initialize SUPLib (must not fail). */ 67 # define RTR3INIT_FLAGS_SUPLIB RT_BIT(16) 68 /** Try initialize SUPLib and ignore failures. */ 69 # define RTR3INIT_FLAGS_TRY_SUPLIB RT_BIT(17) 70 /** Shift count for passing thru SUPR3INIT_F_XXX flags. */ 71 # define RTR3INIT_FLAGS_SUPLIB_SHIFT 18 72 /** The mask covering the passthru SUPR3INIT_F_XXX flags. */ 73 # define RTR3INIT_FLAGS_SUPLIB_MASK UINT32_C(0xfffc0000) 74 75 /** Valid flag mask. */ 76 # define RTR3INIT_FLAGS_VALID_MASK UINT32_C(0xffff000f) 66 77 /** @} */ 67 78 … … 69 80 * @{ */ 70 81 /** Version 1. */ 71 # define RTR3INIT_VER_1 UINT32_C(1) 82 # define RTR3INIT_VER_1 UINT32_C(1) 83 /** Version 2 - new flags, rearranged a bit. */ 84 # define RTR3INIT_VER_2 UINT32_C(2) 72 85 /** The current version. */ 73 # define RTR3INIT_VER_CUR RTR3INIT_VER_186 # define RTR3INIT_VER_CUR RTR3INIT_VER_2 74 87 /** @} */ 75 88 … … 78 91 * 79 92 * @returns iprt status code. 80 * @param fFlags Flags, see RTR3INIT_ XXX.93 * @param fFlags Flags, see RTR3INIT_FLAGS_XXX. 81 94 */ 82 95 RTR3DECL(int) RTR3InitExeNoArguments(uint32_t fFlags); … … 88 101 * @param cArgs Pointer to the argument count. 89 102 * @param ppapszArgs Pointer to the argument vector pointer. 90 * @param fFlags Flags, see RTR3INIT_ XXX.103 * @param fFlags Flags, see RTR3INIT_FLAGS_XXX. 91 104 */ 92 105 RTR3DECL(int) RTR3InitExe(int cArgs, char ***ppapszArgs, uint32_t fFlags); … … 96 109 * 97 110 * @returns iprt status code. 98 * @param fFlags Flags, see RTR3INIT_ XXX.111 * @param fFlags Flags, see RTR3INIT_FLAGS_XXX. 99 112 */ 100 113 RTR3DECL(int) RTR3InitDll(uint32_t fFlags); … … 107 120 * @returns IPRT status code. 108 121 * @param iVersion The interface version. Must be 0 atm. 109 * @param fFlags Flags, see RTR3INIT_ XXX.122 * @param fFlags Flags, see RTR3INIT_FLAGS_XXX. 110 123 * @param cArgs Pointer to the argument count. 111 124 * @param ppapszArgs Pointer to the argument vector pointer. NULL
Note:
See TracChangeset
for help on using the changeset viewer.