Changeset 37249 in vbox for trunk/src/VBox
- Timestamp:
- May 30, 2011 10:03:45 AM (14 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r37230 r37249 4065 4065 4066 4066 if (pImage->fNative) 4067 rc = supdrvOSLdrLoad(pDevExt, pImage, pReq->u.In.abImage );4067 rc = supdrvOSLdrLoad(pDevExt, pImage, pReq->u.In.abImage, pReq); 4068 4068 else 4069 4069 memcpy(pImage->pvImage, &pReq->u.In.abImage[0], pImage->cbImageBits); -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r37228 r37249 577 577 * @returns IPRT status code. 578 578 * @param pDevExt The device globals. 579 * @param pImage The image data (up to date except for some580 * entry point pointers).579 * @param pImage The image data (up to date). Adjust entrypoints 580 * and exports if necessary. 581 581 * @param pbImageBits The image bits as loaded by ring-3. 582 */ 583 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits); 582 * @param pReq Pointer to the request packet so that the VMMR0 583 * entry points can be adjusted. 584 */ 585 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq); 584 586 585 587 -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r37116 r37249 776 776 777 777 778 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits )779 { 780 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 778 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) 779 { 780 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); 781 781 return VERR_NOT_SUPPORTED; 782 782 } -
trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
r29501 r37249 616 616 617 617 618 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits )619 { 620 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 618 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) 619 { 620 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); 621 621 return VERR_NOT_SUPPORTED; 622 622 } -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r35495 r37249 740 740 741 741 742 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits )743 { 744 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 742 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) 743 { 744 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); 745 745 return VERR_NOT_SUPPORTED; 746 746 } -
trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
r28854 r37249 397 397 398 398 399 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits )400 { 401 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 399 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) 400 { 401 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); 402 402 return VERR_NOT_SUPPORTED; 403 403 } -
trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
r37228 r37249 36 36 #include <sys/modctl.h> 37 37 #include <sys/kobj.h> 38 #include <sys/kobj_impl.h> 38 39 #include <sys/open.h> 39 40 #include <sys/conf.h> … … 952 953 /* 953 954 * Get the module info. 955 * 956 * Note! The text section is actually not at mi_base, but and the next 957 * alignment boundrary and there seems to be no easy way of 958 * getting at this address. This sabotages supdrvOSLdrLoad. 959 * Bastards! 954 960 */ 955 961 struct modinfo ModInfo; … … 960 966 961 967 mod_release_mod(pImage->pSolModCtl); 962 LogRel(("supdrvOSLdrOpen: succeeded for '%s' (mi_base=%p mi_ base=%#x), id=%d ctl=%p\n",968 LogRel(("supdrvOSLdrOpen: succeeded for '%s' (mi_base=%p mi_size=%#x), id=%d ctl=%p\n", 963 969 pszFilename, ModInfo.mi_base, ModInfo.mi_size, idMod, pModCtl)); 964 970 return VINF_SUCCESS; … … 975 981 976 982 977 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) 978 { 983 /** 984 * Resolves a module entry point address. 985 * 986 * @returns VBox status code. 987 * @param pImage The image. 988 * @param pszSymbol The symbol name. 989 * @param ppvValue Where to store the value. On input this holds 990 * the symbol value SUPLib calculated. 991 */ 992 static int supdrvSolLdrResolvEp(PSUPDRVLDRIMAGE pImage, const char *pszSymbol, void **ppvValue) 993 { 994 /* Don't try resolve symbols which, according to SUPLib, aren't there. */ 995 if (!*ppvValue) 996 return VINF_SUCCESS; 997 998 uintptr_t uValue = modlookup_by_modctl(pImage->pSolModCtl, pszSymbol); 999 if (!uValue) 1000 { 1001 LogRel(("supdrvOSLdrLoad on %s failed to resolve %s\n", pImage->szName, pszSymbol)); 1002 return VERR_SYMBOL_NOT_FOUND; 1003 } 1004 *ppvValue = (void *)uValue; 1005 return VINF_SUCCESS; 1006 } 1007 1008 1009 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) 1010 { 1011 #if 0 /* This doesn't work because of text alignment. */ 979 1012 /* 980 1013 * Comparing is very very difficult since text and data may be allocated … … 984 1017 if (memcmp(pImage->pvImage, pbImageBits, cbCompare)) 985 1018 { 986 LogRel(("Image mismatch: %s \n", pImage->szName));1019 LogRel(("Image mismatch: %s (%p)\n", pImage->szName, pImage->pvImage)); 987 1020 LogRel(("Native: %.*Rhxs\n", cbCompare, pImage->pvImage)); 988 1021 LogRel(("SUPLib: %.*Rhxs\n", cbCompare, pbImageBits)); 989 1022 return VERR_LDR_MISMATCH_NATIVE; 990 1023 } 991 992 993 /* 994 * Get the symbol addresses.1024 #endif 1025 1026 /* 1027 * Get the exported symbol addresses. 995 1028 */ 996 1029 int rc; … … 1018 1051 1019 1052 rc = iSym == UINT32_MAX ? VINF_SUCCESS : VERR_LDR_GENERAL_FAILURE; 1053 1054 /* 1055 * Get the standard module entry points. 1056 */ 1057 if (RT_SUCCESS(rc)) 1058 { 1059 rc = supdrvSolLdrResolvEp(pImage, "ModuleInit", (void **)&pImage->pfnModuleInit); 1060 if (RT_SUCCESS(rc)) 1061 rc = supdrvSolLdrResolvEp(pImage, "ModuleTerm", (void **)&pImage->pfnModuleTerm); 1062 1063 switch (pReq->u.In.eEPType) 1064 { 1065 case SUPLDRLOADEP_VMMR0: 1066 { 1067 if (RT_SUCCESS(rc)) 1068 rc = supdrvSolLdrResolvEp(pImage, "VMMR0EntryInt", (void **)&pReq->u.In.EP.VMMR0.pvVMMR0EntryInt); 1069 if (RT_SUCCESS(rc)) 1070 rc = supdrvSolLdrResolvEp(pImage, "VMMR0EntryFast", (void **)&pReq->u.In.EP.VMMR0.pvVMMR0EntryFast); 1071 if (RT_SUCCESS(rc)) 1072 rc = supdrvSolLdrResolvEp(pImage, "VMMR0EntryEx", (void **)&pReq->u.In.EP.VMMR0.pvVMMR0EntryEx); 1073 break; 1074 } 1075 1076 case SUPLDRLOADEP_SERVICE: 1077 { 1078 /** @todo we need the name of the entry point. */ 1079 return VERR_NOT_SUPPORTED; 1080 } 1081 } 1082 } 1083 1020 1084 mod_release_mod(pImage->pSolModCtl); 1021 1085 } … … 1059 1123 1060 1124 1061 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits )1062 { 1063 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); 1125 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) 1126 { 1127 NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); 1064 1128 return VERR_NOT_SUPPORTED; 1065 1129 } -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r30360 r37249 766 766 } 767 767 768 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits )769 { 770 NOREF(pDevExt); NOREF(p Image); NOREF(pbImageBits);768 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) 769 { 770 NOREF(pDevExt); NOREF(pReq); 771 771 if (pImage->pvNtSectionObj) 772 772 {
Note:
See TracChangeset
for help on using the changeset viewer.