VirtualBox

Changeset 26151 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 2, 2010 4:00:15 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57164
Message:

PDM: In the processes of adding PDMR3LdrGetInterface + DrvHlps & DevHlps.

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r26112 r26151  
    269269
    270270
    271 /** @copydoc PDMDRVREGCB::pfnRegister */
     271/** @interface_method_impl{PDMDRVREGCB,pfnRegister} */
    272272static DECLCALLBACK(int) pdmR3DrvRegister(PCPDMDRVREGCB pCallbacks, PCPDMDRVREG pDrvReg)
    273273{
     
    687687 */
    688688
    689 /** @copydoc PDMDRVHLP::pfnAttach */
     689/** @interface_method_impl{PDMDRVHLP,pfnAttach} */
    690690static DECLCALLBACK(int) pdmR3DrvHlp_Attach(PPDMDRVINS pDrvIns, uint32_t fFlags, PPDMIBASE *ppBaseInterface)
    691691{
     
    725725
    726726
    727 /** @copydoc PDMDRVHLP::pfnDetach */
     727/** @interface_method_impl{PDMDRVHLP,pfnDetach} */
    728728static DECLCALLBACK(int) pdmR3DrvHlp_Detach(PPDMDRVINS pDrvIns, uint32_t fFlags)
    729729{
     
    751751
    752752
    753 /** @copydoc PDMDRVHLP::pfnDetachSelf */
     753/** @interface_method_impl{PDMDRVHLP,pfnDetachSelf} */
    754754static DECLCALLBACK(int) pdmR3DrvHlp_DetachSelf(PPDMDRVINS pDrvIns, uint32_t fFlags)
    755755{
     
    766766
    767767
    768 /** @copydoc PDMDRVHLP::pfnMountPrepare */
     768/** @interface_method_impl{PDMDRVHLP,pfnMountPrepare} */
    769769static DECLCALLBACK(int) pdmR3DrvHlp_MountPrepare(PPDMDRVINS pDrvIns, const char *pszFilename, const char *pszCoreDriver)
    770770{
     
    840840
    841841
    842 /** @copydoc PDMDRVHLP::pfnAssertEMT */
     842/** @interface_method_impl{PDMDRVHLP,pfnAssertEMT} */
    843843static DECLCALLBACK(bool) pdmR3DrvHlp_AssertEMT(PPDMDRVINS pDrvIns, const char *pszFile, unsigned iLine, const char *pszFunction)
    844844{
     
    856856
    857857
    858 /** @copydoc PDMDRVHLP::pfnAssertOther */
     858/** @interface_method_impl{PDMDRVHLP,pfnAssertOther} */
    859859static DECLCALLBACK(bool) pdmR3DrvHlp_AssertOther(PPDMDRVINS pDrvIns, const char *pszFile, unsigned iLine, const char *pszFunction)
    860860{
     
    872872
    873873
    874 /** @copydoc PDMDRVHLP::pfnVMSetError */
     874/** @interface_method_impl{PDMDRVHLP,pfnVMSetError} */
    875875static DECLCALLBACK(int) pdmR3DrvHlp_VMSetError(PPDMDRVINS pDrvIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
    876876{
     
    884884
    885885
    886 /** @copydoc PDMDRVHLP::pfnVMSetErrorV */
     886/** @interface_method_impl{PDMDRVHLP,pfnVMSetErrorV} */
    887887static DECLCALLBACK(int) pdmR3DrvHlp_VMSetErrorV(PPDMDRVINS pDrvIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
    888888{
     
    893893
    894894
    895 /** @copydoc PDMDRVHLP::pfnVMSetRuntimeError */
     895/** @interface_method_impl{PDMDRVHLP,pfnVMSetRuntimeError} */
    896896static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeError(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)
    897897{
     
    905905
    906906
    907 /** @copydoc PDMDRVHLP::pfnVMSetRuntimeErrorV */
     907/** @interface_method_impl{PDMDRVHLP,pfnVMSetRuntimeErrorV} */
    908908static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeErrorV(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)
    909909{
     
    914914
    915915
    916 /** @copydoc PDMDEVHLPR3::pfnVMState */
     916/** @interface_method_impl{PDMDEVHLPR3,pfnVMState} */
    917917static DECLCALLBACK(VMSTATE) pdmR3DrvHlp_VMState(PPDMDRVINS pDrvIns)
    918918{
     
    927927
    928928
    929 /** @copydoc PDMDEVHLPR3::pfnVMTeleportedAndNotFullyResumedYet */
     929/** @interface_method_impl{PDMDEVHLPR3,pfnVMTeleportedAndNotFullyResumedYet} */
    930930static DECLCALLBACK(bool) pdmR3DrvHlp_VMTeleportedAndNotFullyResumedYet(PPDMDRVINS pDrvIns)
    931931{
     
    940940
    941941
    942 /** @copydoc PDMDRVHLP::pfnPDMQueueCreate */
     942/** @interface_method_impl{PDMDRVHLP,pfnPDMQueueCreate} */
    943943static DECLCALLBACK(int) pdmR3DrvHlp_PDMQueueCreate(PPDMDRVINS pDrvIns, uint32_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
    944944                                                    PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue)
     
    963963
    964964
    965 /** @copydoc PDMDRVHLP::pfnTMGetVirtualFreq */
     965/** @interface_method_impl{PDMDRVHLP,pfnTMGetVirtualFreq} */
    966966static DECLCALLBACK(uint64_t) pdmR3DrvHlp_TMGetVirtualFreq(PPDMDRVINS pDrvIns)
    967967{
     
    972972
    973973
    974 /** @copydoc PDMDRVHLP::pfnTMGetVirtualTime */
     974/** @interface_method_impl{PDMDRVHLP,pfnTMGetVirtualTime} */
    975975static DECLCALLBACK(uint64_t) pdmR3DrvHlp_TMGetVirtualTime(PPDMDRVINS pDrvIns)
    976976{
     
    981981
    982982
    983 /** @copydoc PDMDRVHLP::pfnTMTimerCreate */
     983/** @interface_method_impl{PDMDRVHLP,pfnTMTimerCreate} */
    984984static DECLCALLBACK(int) pdmR3DrvHlp_TMTimerCreate(PPDMDRVINS pDrvIns, TMCLOCK enmClock, PFNTMTIMERDRV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer)
    985985{
     
    996996
    997997
    998 /** @copydoc PDMDRVHLP::pfnSSMRegister */
     998/** @interface_method_impl{PDMDRVHLP,pfnSSMRegister} */
    999999static DECLCALLBACK(int) pdmR3DrvHlp_SSMRegister(PPDMDRVINS pDrvIns, uint32_t uVersion, size_t cbGuess,
    10001000                                                 PFNSSMDRVLIVEPREP pfnLivePrep, PFNSSMDRVLIVEEXEC pfnLiveExec, PFNSSMDRVLIVEVOTE pfnLiveVote,
     
    10211021
    10221022
    1023 /** @copydoc PDMDRVHLP::pfnSSMDeregister */
     1023/** @interface_method_impl{PDMDRVHLP,pfnSSMDeregister} */
    10241024static DECLCALLBACK(int) pdmR3DrvHlp_SSMDeregister(PPDMDRVINS pDrvIns, const char *pszName, uint32_t u32Instance)
    10251025{
     
    10361036
    10371037
    1038 /** @copydoc PDMDRVHLP::pfnSTAMRegister */
     1038/** @interface_method_impl{PDMDRVHLP,pfnSTAMRegister} */
    10391039static DECLCALLBACK(void) pdmR3DrvHlp_STAMRegister(PPDMDRVINS pDrvIns, void *pvSample, STAMTYPE enmType, const char *pszName, STAMUNIT enmUnit, const char *pszDesc)
    10401040{
     
    10481048
    10491049
    1050 /** @copydoc PDMDRVHLP::pfnSTAMRegisterF */
     1050/** @interface_method_impl{PDMDRVHLP,pfnSTAMRegisterF} */
    10511051static DECLCALLBACK(void) pdmR3DrvHlp_STAMRegisterF(PPDMDRVINS pDrvIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
    10521052                                                    STAMUNIT enmUnit, const char *pszDesc, const char *pszName, ...)
     
    10631063
    10641064
    1065 /** @copydoc PDMDRVHLP::pfnSTAMRegisterV */
     1065/** @interface_method_impl{PDMDRVHLP,pfnSTAMRegisterV} */
    10661066static DECLCALLBACK(void) pdmR3DrvHlp_STAMRegisterV(PPDMDRVINS pDrvIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
    10671067                                                    STAMUNIT enmUnit, const char *pszDesc, const char *pszName, va_list args)
     
    10751075
    10761076
    1077 /** @copydoc PDMDRVHLP::pfnSTAMDeregister */
     1077/** @interface_method_impl{PDMDRVHLP,pfnSTAMDeregister} */
    10781078static DECLCALLBACK(int) pdmR3DrvHlp_STAMDeregister(PPDMDRVINS pDrvIns, void *pvSample)
    10791079{
     
    10871087
    10881088
    1089 /** @copydoc PDMDRVHLP::pfnSUPCallVMMR0Ex */
     1089/** @interface_method_impl{PDMDRVHLP,pfnSUPCallVMMR0Ex} */
    10901090static DECLCALLBACK(int) pdmR3DrvHlp_SUPCallVMMR0Ex(PPDMDRVINS pDrvIns, unsigned uOperation, void *pvArg, unsigned cbArg)
    10911091{
     
    11081108
    11091109
    1110 /** @copydoc PDMDRVHLP::pfnUSBRegisterHub */
     1110/** @interface_method_impl{PDMDRVHLP,pfnUSBRegisterHub} */
    11111111static DECLCALLBACK(int) pdmR3DrvHlp_USBRegisterHub(PPDMDRVINS pDrvIns, uint32_t fVersions, uint32_t cPorts, PCPDMUSBHUBREG pUsbHubReg, PPCPDMUSBHUBHLP ppUsbHubHlp)
    11121112{
     
    11271127
    11281128
    1129 /** @copydoc PDMDRVHLP::pfnSetAsyncNotification */
     1129/** @interface_method_impl{PDMDRVHLP,pfnSetAsyncNotification} */
    11301130static DECLCALLBACK(int) pdmR3DrvHlp_SetAsyncNotification(PPDMDRVINS pDrvIns, PFNPDMDRVASYNCNOTIFY pfnAsyncNotify)
    11311131{
     
    11561156
    11571157
    1158 /** @copydoc PDMDRVHLP::pfnAsyncNotificationCompleted */
     1158/** @interface_method_impl{PDMDRVHLP,pfnAsyncNotificationCompleted} */
    11591159static DECLCALLBACK(void) pdmR3DrvHlp_AsyncNotificationCompleted(PPDMDRVINS pDrvIns)
    11601160{
     
    11791179
    11801180
    1181 /** @copydoc PDMDRVHLP::pfnPDMThreadCreate */
     1181/** @interface_method_impl{PDMDRVHLP,pfnPDMThreadCreate} */
    11821182static DECLCALLBACK(int) pdmR3DrvHlp_PDMThreadCreate(PPDMDRVINS pDrvIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDRV pfnThread,
    11831183                                                     PFNPDMTHREADWAKEUPDRV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName)
     
    11961196
    11971197
    1198 #ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
    1199 /** @copydoc PDMDRVHLP::pfnPDMAsyncCompletionTemplateCreate */
     1198/** @interface_method_impl{PDMDRVHLP,pfnPDMAsyncCompletionTemplateCreate} */
    12001199static DECLCALLBACK(int) pdmR3DrvHlp_PDMAsyncCompletionTemplateCreate(PPDMDRVINS pDrvIns, PPPDMASYNCCOMPLETIONTEMPLATE ppTemplate,
    12011200                                                                      PFNPDMASYNCCOMPLETEDRV pfnCompleted, void *pvTemplateUser,
     
    12131212    return rc;
    12141213}
    1215 #endif
     1214
     1215
     1216/** @interface_method_impl{PDMDRVHLP,pfnPDMLdrGetRCInterfaceSymbols} */
     1217static DECLCALLBACK(int) pdmR3DrvHlp_PDMLdrGetRCInterfaceSymbols(PPDMDRVINS pDrvIns, void *pvInterface, size_t cbInterface,
     1218                                                                 const char *pszSymPrefix, const char *pszSymList)
     1219{
     1220    PDMDRV_ASSERT_DRVINS(pDrvIns);
     1221    VM_ASSERT_EMT(pDrvIns->Internal.s.pVMR3);
     1222    LogFlow(("pdmR3DrvHlp_PDMLdrGetRCInterfaceSymbols: caller='%s'/%d: pvInterface=%p cbInterface=%zu pszSymPrefix=%p:{%s} pszSymList=%p:{%s}\n",
     1223             pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, pvInterface, cbInterface, pszSymPrefix, pszSymPrefix, pszSymList, pszSymList));
     1224
     1225    int rc;
     1226    if (   strncmp(pszSymPrefix, "drv", 3) == 0
     1227        && RTStrIStr(pszSymPrefix + 3, pDrvIns->pDrvReg->szDriverName) != NULL)
     1228    {
     1229        if (pDrvIns->pDrvReg->fFlags & PDM_DRVREG_FLAGS_RC)
     1230            rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface,
     1231                                             pDrvIns->pDrvReg->szDriverName, pszSymPrefix, pszSymList,
     1232                                             false /*fRing0OrRC*/);
     1233        else
     1234        {
     1235            AssertMsgFailed(("Not a raw-mode enabled driver\n"));
     1236            rc = VERR_PERMISSION_DENIED;
     1237        }
     1238    }
     1239    else
     1240    {
     1241        AssertMsgFailed(("Invalid prefix '%s' for '%s'; must start with 'drv' and contain the driver name!\n",
     1242                         pszSymPrefix, pDrvIns->pDrvReg->szDriverName));
     1243        rc = VERR_INVALID_NAME;
     1244    }
     1245
     1246    LogFlow(("pdmR3DrvHlp_PDMLdrGetRCInterfaceSymbols: caller='%s'/%d: returns %Rrc\n", pDrvIns->pDrvReg->szDriverName,
     1247             pDrvIns->iInstance, rc));
     1248    return rc;
     1249}
     1250
     1251
     1252/** @interface_method_impl{PDMDRVHLP,pfnPDMLdrGetR0InterfaceSymbols} */
     1253static DECLCALLBACK(int) pdmR3DrvHlp_PDMLdrGetR0InterfaceSymbols(PPDMDRVINS pDrvIns, void *pvInterface, size_t cbInterface,
     1254                                                                 const char *pszSymPrefix, const char *pszSymList)
     1255{
     1256    PDMDRV_ASSERT_DRVINS(pDrvIns);
     1257    VM_ASSERT_EMT(pDrvIns->Internal.s.pVMR3);
     1258    LogFlow(("pdmR3DrvHlp_PDMLdrGetR0InterfaceSymbols: caller='%s'/%d: pvInterface=%p cbInterface=%zu pszSymPrefix=%p:{%s} pszSymList=%p:{%s}\n",
     1259             pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, pvInterface, cbInterface, pszSymPrefix, pszSymPrefix, pszSymList, pszSymList));
     1260
     1261    int rc;
     1262    if (   strncmp(pszSymPrefix, "drv", 3) == 0
     1263        && RTStrIStr(pszSymPrefix + 3, pDrvIns->pDrvReg->szDriverName) != NULL)
     1264    {
     1265        if (pDrvIns->pDrvReg->fFlags & PDM_DRVREG_FLAGS_R0)
     1266            rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface,
     1267                                             pDrvIns->pDrvReg->szDriverName, pszSymPrefix, pszSymList,
     1268                                             true /*fRing0OrRC*/);
     1269        else
     1270        {
     1271            AssertMsgFailed(("Not a ring-0 enabled driver\n"));
     1272            rc = VERR_PERMISSION_DENIED;
     1273        }
     1274    }
     1275    else
     1276    {
     1277        AssertMsgFailed(("Invalid prefix '%s' for '%s'; must start with 'drv' and contain the driver name!\n",
     1278                         pszSymPrefix, pDrvIns->pDrvReg->szDriverName));
     1279        rc = VERR_INVALID_NAME;
     1280    }
     1281
     1282    LogFlow(("pdmR3DrvHlp_PDMLdrGetR0InterfaceSymbols: caller='%s'/%d: returns %Rrc\n", pDrvIns->pDrvReg->szDriverName,
     1283             pDrvIns->iInstance, rc));
     1284    return rc;
     1285}
    12161286
    12171287
     
    12491319    pdmR3DrvHlp_AsyncNotificationCompleted,
    12501320    pdmR3DrvHlp_PDMThreadCreate,
    1251 #ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
    12521321    pdmR3DrvHlp_PDMAsyncCompletionTemplateCreate,
    1253 #endif
     1322    pdmR3DrvHlp_PDMLdrGetRCInterfaceSymbols,
     1323    pdmR3DrvHlp_PDMLdrGetR0InterfaceSymbols,
    12541324    PDM_DRVHLPR3_VERSION /* u32TheEnd */
    12551325};
  • trunk/src/VBox/VMM/PDMLdr.cpp

    r25015 r26151  
    11591159}
    11601160
     1161
     1162/**
     1163 * Locates a module.
     1164 *
     1165 * @returns Pointer to the module if found.
     1166 * @param   pUVM            Pointer to the user mode VM structure.
     1167 * @param   pszModule       The module name.
     1168 * @param   enmType         The module type.
     1169 * @param   fLazy           Lazy loading the module if set.
     1170 */
     1171static PPDMMOD pdmR3LdrFindModule(PUVM pUVM, const char *pszModule, PDMMODTYPE enmType, bool fLazy)
     1172{
     1173    for (PPDMMOD pModule = pUVM->pdm.s.pModules; pModule; pModule = pModule->pNext)
     1174        if (    pModule->eType == enmType
     1175            &&  !strcmp(pModule->szName, pszModule))
     1176            return pModule;
     1177    if (fLazy)
     1178    {
     1179        switch (enmType)
     1180        {
     1181            case PDMMOD_TYPE_RC:
     1182            {
     1183                char *pszFilename = pdmR3FileRC(pszModule);
     1184                if (pszFilename)
     1185                {
     1186                    int rc = PDMR3LdrLoadRC(pUVM->pVM, pszFilename, pszModule);
     1187                    RTMemTmpFree(pszFilename);
     1188                    if (RT_SUCCESS(rc))
     1189                        return pdmR3LdrFindModule(pUVM, pszModule, enmType, false);
     1190                }
     1191                break;
     1192            }
     1193
     1194            case PDMMOD_TYPE_R0:
     1195            {
     1196                int rc = pdmR3LoadR0U(pUVM, NULL, pszModule);
     1197                if (RT_SUCCESS(rc))
     1198                    return pdmR3LdrFindModule(pUVM, pszModule, enmType, false);
     1199                break;
     1200            }
     1201
     1202            default:
     1203                AssertFailed();
     1204        }
     1205    }
     1206    return NULL;
     1207}
     1208
     1209
     1210/**
     1211 * Resolves a ring-0 or raw-mode context interface.
     1212 *
     1213 * @returns VBox status code.
     1214 * @param   pVM             The VM handle.
     1215 * @param   pvInterface     Pointer to the interface structure.  The symbol list
     1216 *                          describes the layout.
     1217 * @param   cbInterface     The size of the structure pvInterface is pointing
     1218 *                          to.  For bounds checking.
     1219 * @param   pszModule       The module name.  If NULL we assume it's the default
     1220 *                          R0 or RC module (@a fRing0OrRC).  We'll attempt to
     1221 *                          load the module if it isn't found in the module
     1222 *                          list.
     1223 * @param   pszSymPrefix    What to prefix the symbols in the list with.  The
     1224 *                          idea is that you define a list that goes with an
     1225 *                          interface (INTERFACE_SYM_LIST) and reuse it with
     1226 *                          each implementation.
     1227 * @param   pszSymList      The symbol list for the interface.  This is a
     1228 *                          semi-colon separated list of symbol base names.  As
     1229 *                          mentioned above, each is prefixed with @a
     1230 *                          pszSymPrefix before resolving.  There are a couple
     1231 *                          of special symbol names that will cause us to skip
     1232 *                          ahead a little bit:
     1233 *                              - U8:whatever,
     1234 *                              - U16:whatever,
     1235 *                              - U32:whatever,
     1236 *                              - U64:whatever,
     1237 *                              - RCPTR:whatever,
     1238 *                              - R3PTR:whatever,
     1239 *                              - R0PTR:whatever,
     1240 *                              - GCPHYS:whatever,
     1241 *                              - HCPHYS:whatever.
     1242 * @param   fRing0OrRC      Set if it's a ring-0 context interface, clear if
     1243 *                          it's raw-mode context interface.
     1244 */
     1245VMMR3DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface,
     1246                                           const char *pszModule, const char *pszSymPrefix,
     1247                                           const char *pszSymList, bool fRing0OrRC)
     1248{
     1249    /*
     1250     * Find the module.
     1251     */
     1252    int rc;
     1253    PPDMMOD pModule = pdmR3LdrFindModule(pVM->pUVM,
     1254                                         pszModule ? pszModule : fRing0OrRC ? "VMMR0.r0" : "VMMGC.gc",
     1255                                         fRing0OrRC ? PDMMOD_TYPE_R0 : PDMMOD_TYPE_RC,
     1256                                         true /*fLazy*/);
     1257    if (pModule)
     1258    {
     1259        /* Prep the symbol name. */
     1260        char            szSymbol[256];
     1261        size_t const    cchSymPrefix = strlen(pszSymPrefix);
     1262        AssertReturn(cchSymPrefix + 5 >= sizeof(szSymbol), VERR_SYMBOL_NOT_FOUND);
     1263        memcpy(szSymbol, pszSymPrefix, cchSymPrefix);
     1264
     1265        /*
     1266         * Iterate the symbol list.
     1267         */
     1268        uint32_t        offInterface = 0;
     1269        const char     *pszCur       = pszSymList;
     1270        while (pszCur)
     1271        {
     1272            /* Find the end of the current symbol name. */
     1273            size_t      cchSym;
     1274            const char *pszNext = strchr(pszCur, ';');
     1275            if (pszNext)
     1276            {
     1277                cchSym = pszNext - pszCur;
     1278                pszNext++;
     1279            }
     1280            else
     1281                cchSym = strlen(pszCur);
     1282            AssertReturn(cchSym > 0, VERR_INVALID_PARAMETER);
     1283
     1284            /* check for skip instructions */
     1285            const char *pszColon = (const char *)memchr(pszCur, ':', cchSym);
     1286            if (pszColon)
     1287            {
     1288#define IS_SKIP_INSTR(szInstr) \
     1289                (   cchSkip == sizeof(szInstr) - 1 \
     1290                 && !memcmp(pszCur, szInstr, sizeof(szInstr) - 1) )
     1291
     1292                size_t const cchSkip = pszColon - pszCur;
     1293                if (IS_SKIP_INSTR("U8"))
     1294                    offInterface += sizeof(uint8_t);
     1295                else if (IS_SKIP_INSTR("U16"))
     1296                    offInterface += sizeof(uint16_t);
     1297                else if (IS_SKIP_INSTR("U32"))
     1298                    offInterface += sizeof(uint32_t);
     1299                else if (IS_SKIP_INSTR("U64"))
     1300                    offInterface += sizeof(uint64_t);
     1301                else if (IS_SKIP_INSTR("RCPTR"))
     1302                    offInterface += sizeof(RTRCPTR);
     1303                else if (IS_SKIP_INSTR("R3PTR"))
     1304                    offInterface += sizeof(RTR3PTR);
     1305                else if (IS_SKIP_INSTR("R0PTR"))
     1306                    offInterface += sizeof(RTR0PTR);
     1307                else if (IS_SKIP_INSTR("HCPHYS"))
     1308                    offInterface += sizeof(RTHCPHYS);
     1309                else if (IS_SKIP_INSTR("GCPHYS"))
     1310                    offInterface += sizeof(RTGCPHYS);
     1311                else
     1312                    AssertMsgFailedReturn(("Invalid skip instruction %.*s (prefix=%s)\n", cchSym, pszCur, pszSymPrefix),
     1313                                          VERR_INVALID_PARAMETER);
     1314                AssertMsgReturn(offInterface <= cbInterface,
     1315                                ("off=%#x cb=%#x (sym=%.*s prefix=%s)\n", offInterface, cbInterface, cchSym, pszCur, pszSymPrefix),
     1316                                VERR_BUFFER_OVERFLOW);
     1317#undef IS_SKIP_INSTR
     1318            }
     1319            else
     1320            {
     1321                AssertReturn(cchSymPrefix + cchSym >= sizeof(szSymbol), VERR_SYMBOL_NOT_FOUND);
     1322                memcmp(&szSymbol[cchSymPrefix], pszCur, cchSym);
     1323                szSymbol[cchSymPrefix + cchSym] = '\0';
     1324
     1325//                rc = resume coding here...
     1326            }
     1327
     1328            /* advance */
     1329            pszCur = pszNext;
     1330        }
     1331
     1332    }
     1333    else
     1334        rc = VERR_MODULE_NOT_FOUND;
     1335    return rc;
     1336}
     1337
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette