VirtualBox

Changeset 25275 in vbox for trunk


Ignore:
Timestamp:
Dec 9, 2009 3:58:31 PM (15 years ago)
Author:
vboxsync
Message:

SUPDrv: Added SUPGetGIP and added a fNativeLoader indicator to SUPLDROPEN (VBOX_WITH_NATIVE_R0_LOADER).

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/sup.h

    r23725 r25275  
    220220extern DECLEXPORT(PSUPGLOBALINFOPAGE)   g_pSUPGlobalInfoPage;
    221221#elif defined(IN_RING0)
     222# if 0 /* VBOX_WITH_NATIVE_R0_LOADER */
     223#  define g_pSUPGlobalInfoPage          (SUPGetGIP())
     224# else
    222225extern DECLIMPORT(SUPGLOBALINFOPAGE)    g_SUPGlobalInfoPage;
    223 # if defined(__GNUC__) && !defined(RT_OS_DARWIN) && defined(RT_ARCH_AMD64)
     226#  if defined(__GNUC__) && !defined(RT_OS_DARWIN) && defined(RT_ARCH_AMD64)
    224227/** Workaround for ELF+GCC problem on 64-bit hosts.
    225228 * (GCC emits a mov with a R_X86_64_32 reloc, we need R_X86_64_64.) */
    226 DECLINLINE(PSUPGLOBALINFOPAGE) SUPGetGIP(void)
     229DECLINLINE(PSUPGLOBALINFOPAGE) SUPGetGIPHlp(void)
    227230{
    228231    PSUPGLOBALINFOPAGE pGIP;
     
    231234    return pGIP;
    232235}
    233 #  define g_pSUPGlobalInfoPage          (SUPGetGIP())
    234 # else
    235 #  define g_pSUPGlobalInfoPage          (&g_SUPGlobalInfoPage)
     236#   define g_pSUPGlobalInfoPage          (SUPGetGIPHlp())
     237#  else
     238#   define g_pSUPGlobalInfoPage          (&g_SUPGlobalInfoPage)
     239#  endif
    236240# endif
    237241#else
     
    239243#endif
    240244
     245/**
     246 * Gets the GIP pointer.
     247 *
     248 * @returns Pointer to the GIP or NULL.
     249 */
     250SUPDECL(PSUPGLOBALINFOPAGE)             SUPGetGIP(void);
    241251
    242252/**
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r25262 r25275  
    261261*   Global Variables                                                           *
    262262*******************************************************************************/
     263/** Pointer to the global info page for implementing SUPGetGIP(). */
     264static PSUPGLOBALINFOPAGE g_pSUPGlobalInfoPageInternal = NULL;
     265
    263266/**
    264267 * Array of the R0 SUP API.
     
    313316    { "SUPR0GetPagingMode",                     (void *)UNWIND_WRAP(SUPR0GetPagingMode) },
    314317    { "SUPR0EnableVTx",                         (void *)SUPR0EnableVTx },
     318    { "SUPGetGIP",                              (void *)SUPGetGIP },
    315319    { "RTMemAlloc",                             (void *)UNWIND_WRAP(RTMemAlloc) },
    316320    { "RTMemAllocZ",                            (void *)UNWIND_WRAP(RTMemAllocZ) },
     
    30793083
    30803084/**
     3085 * Gets the GIP pointer.
     3086 *
     3087 * @returns Pointer to the GIP or NULL.
     3088 */
     3089SUPDECL(PSUPGLOBALINFOPAGE) SUPGetGIP(void)
     3090{
     3091    return g_pSUPGlobalInfoPageInternal;
     3092}
     3093
     3094
     3095/**
    30813096 * Register a component factory with the support driver.
    30823097 *
     
    34553470            pReq->u.Out.pvImageBase   = pImage->pvImage;
    34563471            pReq->u.Out.fNeedsLoading = pImage->uState == SUP_IOCTL_LDR_OPEN;
     3472#ifdef VBOX_WITH_NATIVE_R0_LOADER
     3473            pReq->u.Out.fNativeLoader = pImage->fNative;
     3474#endif
    34573475            supdrvLdrAddUsage(pSession, pImage);
    34583476            RTSemFastMutexRelease(pDevExt->mtxLdr);
     
    35343552    supdrvLdrAddUsage(pSession, pImage);
    35353553
    3536     pReq->u.Out.pvImageBase = pImage->pvImage;
     3554    pReq->u.Out.pvImageBase   = pImage->pvImage;
    35373555    pReq->u.Out.fNeedsLoading = true;
     3556#ifdef VBOX_WITH_NATIVE_R0_LOADER
     3557    pReq->u.Out.fNativeLoader = pImage->fNative;
     3558#endif
    35383559    RTSemFastMutexRelease(pDevExt->mtxLdr);
    35393560
     
    45434564             */
    45444565            dprintf(("supdrvGipCreate: %ld ns interval.\n", (long)u32Interval));
     4566            g_pSUPGlobalInfoPageInternal = pGip;
    45454567            return VINF_SUCCESS;
    45464568        }
     
    45804602        pDevExt->pGip = NULL;
    45814603    }
     4604    g_pSUPGlobalInfoPageInternal = NULL;
    45824605
    45834606    /*
  • trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h

    r25260 r25275  
    320320            /** Indicate whether or not the image requires loading. */
    321321            bool            fNeedsLoading;
     322#ifdef VBOX_WITH_NATIVE_R0_LOADER
     323            /** Indicates that we're using the native ring-0 loader. */
     324            bool            fNativeLoader;
     325#endif
    322326        } Out;
    323327    } u;
  • trunk/src/VBox/HostDrivers/Support/SUPR0.def

    r25263 r25275  
    3030
    3131LIBRARY SUPR0.dll
    32 ;LIBRARY VBoxDrv.sys - @todo VBOX_WITH_NATIVE_R0_LOADER
     32;LIBRARY VBoxDrv.sys ;- @todo VBOX_WITH_NATIVE_R0_LOADER
    3333
    3434EXPORTS
     
    6969    SUPR0GetPagingMode
    7070    SUPR0EnableVTx
     71    SUPGetGIP
    7172    RTMemAlloc
    7273    RTMemAllocZ
Note: See TracChangeset for help on using the changeset viewer.

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