Changeset 85129 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jul 9, 2020 12:05:45 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139069
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r85128 r85129 112 112 #if defined(IN_SUP_HARDENED_R3) && defined(RT_OS_WINDOWS) 113 113 # define SUP_HARDENED_NEED_CRT_FUNCTIONS 114 DECLHIDDEN(int) suplibHardenedMemComp(void const *pvDst, const void *pvSrc, size_t cbToComp);115 DECLHIDDEN(void *) suplibHardenedMemCopy(void *pvDst, const void *pvSrc, size_t cbToCopy);116 DECLHIDDEN(void *) suplibHardenedMemSet(void *pvDst, int ch, size_t cbToSet);117 DECLHIDDEN(char *) suplibHardenedStrCopy(char *pszDst, const char *pszSrc);118 DECLHIDDEN(size_t) suplibHardenedStrLen(const char *psz);119 DECLHIDDEN(char *) suplibHardenedStrCat(char *pszDst, const char *pszSrc);120 DECLHIDDEN(int) suplibHardenedStrCmp(const char *psz1, const char *psz2);121 DECLHIDDEN(int) suplibHardenedStrNCmp(const char *psz1, const char *psz2, size_t cchMax);114 DECLHIDDEN(int) suplibHardenedMemComp(void const *pvDst, const void *pvSrc, size_t cbToComp); 115 DECLHIDDEN(void *) suplibHardenedMemCopy(void *pvDst, const void *pvSrc, size_t cbToCopy); 116 DECLHIDDEN(void *) suplibHardenedMemSet(void *pvDst, int ch, size_t cbToSet); 117 DECLHIDDEN(char *) suplibHardenedStrCopy(char *pszDst, const char *pszSrc); 118 DECLHIDDEN(size_t) suplibHardenedStrLen(const char *psz); 119 DECLHIDDEN(char *) suplibHardenedStrCat(char *pszDst, const char *pszSrc); 120 DECLHIDDEN(int) suplibHardenedStrCmp(const char *psz1, const char *psz2); 121 DECLHIDDEN(int) suplibHardenedStrNCmp(const char *psz1, const char *psz2, size_t cchMax); 122 122 #else 123 123 # undef SUP_HARDENED_NEED_CRT_FUNCTIONS … … 132 132 #endif 133 133 DECLHIDDEN(DECL_NO_RETURN(void)) suplibHardenedExit(RTEXITCODE rcExit); 134 DECLHIDDEN(void) suplibHardenedPrintF(const char *pszFormat, ...);135 DECLHIDDEN(void) suplibHardenedPrintFV(const char *pszFormat, va_list va);134 DECLHIDDEN(void) suplibHardenedPrintF(const char *pszFormat, ...); 135 DECLHIDDEN(void) suplibHardenedPrintFV(const char *pszFormat, va_list va); 136 136 137 137 /** @} */ … … 357 357 *******************************************************************************/ 358 358 RT_C_DECLS_BEGIN 359 intsuplibOsInstall(void);360 intsuplibOsUninstall(void);361 intsuplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo);362 intsuplibOsTerm(PSUPLIBDATA pThis);363 intsuplibOsHardenedVerifyInit(void);364 intsuplibOsHardenedVerifyTerm(void);365 intsuplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq);366 intsuplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu);367 intsuplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages);368 intsuplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages);369 intsuplibOsQueryVTxSupported(const char **ppszWhy);370 boolsuplibOsIsNemSupportedWhenNoVtxOrAmdV(void);359 DECLHIDDEN(int) suplibOsInstall(void); 360 DECLHIDDEN(int) suplibOsUninstall(void); 361 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo); 362 DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis); 363 DECLHIDDEN(int) suplibOsHardenedVerifyInit(void); 364 DECLHIDDEN(int) suplibOsHardenedVerifyTerm(void); 365 DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq); 366 DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu); 367 DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages); 368 DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages); 369 DECLHIDDEN(int) suplibOsQueryVTxSupported(const char **ppszWhy); 370 DECLHIDDEN(bool) suplibOsIsNemSupportedWhenNoVtxOrAmdV(void); 371 371 372 372 … … 401 401 */ 402 402 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, 403 403 const char *pszMsgFmt, va_list va); 404 404 405 405 /** … … 407 407 */ 408 408 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, 409 409 const char *pszMsgFmt, ...); 410 410 411 411 /** -
trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp
r82968 r85129 187 187 188 188 189 intsuplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)189 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 190 190 { 191 191 RT_NOREF(penmWhat, pErrInfo); … … 221 221 222 222 223 intsuplibOsTerm(PSUPLIBDATA pThis)223 DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis) 224 224 { 225 225 /* … … 254 254 #ifndef IN_SUP_HARDENED_R3 255 255 256 intsuplibOsInstall(void)256 DECLHIDDEN(int) suplibOsInstall(void) 257 257 { 258 258 return VERR_NOT_IMPLEMENTED; … … 260 260 261 261 262 intsuplibOsUninstall(void)262 DECLHIDDEN(int) suplibOsUninstall(void) 263 263 { 264 264 return VERR_NOT_IMPLEMENTED; … … 266 266 267 267 268 intsuplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)268 DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq) 269 269 { 270 270 RT_NOREF(cbReq); … … 275 275 276 276 277 intsuplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)277 DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu) 278 278 { 279 279 int rc = ioctl(pThis->hDevice, uFunction, idCpu); … … 284 284 285 285 286 intsuplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)286 DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages) 287 287 { 288 288 NOREF(pThis); … … 297 297 298 298 299 intsuplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)299 DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */) 300 300 { 301 301 NOREF(pThis); -
trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
r82968 r85129 68 68 69 69 70 intsuplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)70 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 71 71 { 72 72 /* … … 120 120 121 121 122 intsuplibOsTerm(PSUPLIBDATA pThis)122 DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis) 123 123 { 124 124 /* … … 137 137 #ifndef IN_SUP_HARDENED_R3 138 138 139 intsuplibOsInstall(void)139 DECLHIDDEN(int) suplibOsInstall(void) 140 140 { 141 141 return VERR_NOT_IMPLEMENTED; … … 143 143 144 144 145 intsuplibOsUninstall(void)145 DECLHIDDEN(int) suplibOsUninstall(void) 146 146 { 147 147 return VERR_NOT_IMPLEMENTED; … … 149 149 150 150 151 intsuplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)151 DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq) 152 152 { 153 153 if (RT_LIKELY(ioctl(pThis->hDevice, uFunction, pvReq) >= 0)) … … 157 157 158 158 159 intsuplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)159 DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu) 160 160 { 161 161 int rc = ioctl(pThis->hDevice, uFunction, idCpu); … … 166 166 167 167 168 intsuplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)168 DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages) 169 169 { 170 170 NOREF(pThis); … … 176 176 177 177 178 intsuplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)178 DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages) 179 179 { 180 180 NOREF(pThis); -
trunk/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp
r82968 r85129 76 76 77 77 78 intsuplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)78 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 79 79 { 80 80 RT_NOREF2(penmWhat, pErrInfo); … … 146 146 147 147 148 intsuplibOsTerm(PSUPLIBDATA pThis)148 DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis) 149 149 { 150 150 /* … … 164 164 #ifndef IN_SUP_HARDENED_R3 165 165 166 intsuplibOsInstall(void)166 DECLHIDDEN(int) suplibOsInstall(void) 167 167 { 168 168 // nothing to do on Linux … … 171 171 172 172 173 intsuplibOsUninstall(void)173 DECLHIDDEN(int) suplibOsUninstall(void) 174 174 { 175 175 // nothing to do on Linux … … 178 178 179 179 180 intsuplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)180 DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq) 181 181 { 182 182 AssertMsg(pThis->hDevice != (intptr_t)NIL_RTFILE, ("SUPLIB not initiated successfully!\n")); … … 208 208 209 209 210 intsuplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)210 DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu) 211 211 { 212 212 int rc = ioctl(pThis->hDevice, uFunction, idCpu); … … 217 217 218 218 219 intsuplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)219 DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages) 220 220 { 221 221 size_t cbMmap = (pThis->fSysMadviseWorks ? cPages : cPages + 2) << PAGE_SHIFT; … … 252 252 253 253 254 intsuplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)254 DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages) 255 255 { 256 256 NOREF(pThis); … … 269 269 * @param ppszWhy Where to return explanatory message. 270 270 */ 271 intsuplibOsQueryVTxSupported(const char **ppszWhy)271 DECLHIDDEN(int) suplibOsQueryVTxSupported(const char **ppszWhy) 272 272 { 273 273 char szBuf[256]; -
trunk/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp
r82968 r85129 65 65 66 66 67 intsuplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)67 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 68 68 { 69 69 /* … … 105 105 106 106 107 intsuplibOsTerm(PSUPLIBDATA pThis)107 DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis) 108 108 { 109 109 /* … … 123 123 #ifndef IN_SUP_HARDENED_R3 124 124 125 intsuplibOsInstall(void)125 DECLHIDDEN(int) suplibOsInstall(void) 126 126 { 127 127 /** @remark OS/2: Not supported */ … … 130 130 131 131 132 intsuplibOsUninstall(void)132 DECLHIDDEN(int) suplibOsUninstall(void) 133 133 { 134 134 /** @remark OS/2: Not supported */ … … 137 137 138 138 139 intsuplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)139 DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq) 140 140 { 141 141 ULONG cbReturned = sizeof(SUPREQHDR); … … 149 149 150 150 151 intsuplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)151 DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu) 152 152 { 153 153 NOREF(idCpu); … … 164 164 165 165 166 intsuplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)166 DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages) 167 167 { 168 168 NOREF(pThis); … … 179 179 180 180 181 intsuplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)181 DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */) 182 182 { 183 183 NOREF(pThis); -
trunk/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp
r82968 r85129 79 79 80 80 81 intsuplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)81 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 82 82 { 83 83 /* … … 154 154 155 155 156 intsuplibOsTerm(PSUPLIBDATA pThis)156 DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis) 157 157 { 158 158 /* … … 184 184 #ifndef IN_SUP_HARDENED_R3 185 185 186 intsuplibOsInstall(void)186 DECLHIDDEN(int) suplibOsInstall(void) 187 187 { 188 188 return VERR_NOT_IMPLEMENTED; 189 189 } 190 190 191 intsuplibOsUninstall(void)191 DECLHIDDEN(int) suplibOsUninstall(void) 192 192 { 193 193 return VERR_NOT_IMPLEMENTED; … … 195 195 196 196 197 intsuplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)197 DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq) 198 198 { 199 199 if (RT_LIKELY(ioctl(pThis->hDevice, uFunction, pvReq) >= 0)) … … 203 203 204 204 205 intsuplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)205 DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu) 206 206 { 207 207 int rc = ioctl(pThis->hDevice, uFunction, idCpu); … … 212 212 213 213 214 intsuplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)214 DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages) 215 215 { 216 216 NOREF(pThis); … … 225 225 226 226 227 intsuplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)227 DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages) 228 228 { 229 229 NOREF(pThis); -
trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
r84054 r85129 92 92 93 93 94 intsuplibOsHardenedVerifyInit(void)94 DECLHIDDEN(int) suplibOsHardenedVerifyInit(void) 95 95 { 96 96 if (!g_fHardenedVerifyInited) … … 109 109 110 110 111 intsuplibOsHardenedVerifyTerm(void)111 DECLHIDDEN(int) suplibOsHardenedVerifyTerm(void) 112 112 { 113 113 /** @todo free resources... */ … … 116 116 117 117 118 intsuplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)118 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 119 119 { 120 120 /* … … 273 273 #ifndef IN_SUP_HARDENED_R3 274 274 275 intsuplibOsInstall(void)275 DECLHIDDEN(int) suplibOsInstall(void) 276 276 { 277 277 int rc = suplibOsCreateService(); … … 286 286 287 287 288 intsuplibOsUninstall(void)288 DECLHIDDEN(int) suplibOsUninstall(void) 289 289 { 290 290 int rc = suplibOsStopService(); … … 648 648 649 649 650 intsuplibOsTerm(PSUPLIBDATA pThis)650 DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis) 651 651 { 652 652 /* … … 666 666 #ifndef IN_SUP_HARDENED_R3 667 667 668 intsuplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq)668 DECLHIDDEN(int) suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq) 669 669 { 670 670 RT_NOREF1(cbReq); … … 698 698 699 699 700 intsuplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu)700 DECLHIDDEN(int) suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu) 701 701 { 702 702 /* … … 725 725 726 726 727 intsuplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages)727 DECLHIDDEN(int) suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages) 728 728 { 729 729 NOREF(pThis); … … 735 735 736 736 737 intsuplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)737 DECLHIDDEN(int) suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */) 738 738 { 739 739 NOREF(pThis); … … 744 744 745 745 746 boolsuplibOsIsNemSupportedWhenNoVtxOrAmdV(void)746 DECLHIDDEN(bool) suplibOsIsNemSupportedWhenNoVtxOrAmdV(void) 747 747 { 748 748 # if ARCH_BITS == 64
Note:
See TracChangeset
for help on using the changeset viewer.