VirtualBox

Changeset 57108 in vbox


Ignore:
Timestamp:
Jul 28, 2015 11:49:23 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101836
Message:

supdrv: Added SUPKERNELFEATURES_SMAP to SUPR0GetKernelFeatures and document the API in the header.

Location:
trunk
Files:
7 edited

Legend:

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

    r57090 r57108  
    102102/** GDT is read-only. */
    103103#define SUPKERNELFEATURES_GDT_READ_ONLY     RT_BIT(0)
     104/** SMAP is possibly enabled. */
     105#define SUPKERNELFEATURES_SMAP              RT_BIT(1)
    104106/** @} */
    105107
     
    17991801SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2);
    18001802SUPR0DECL(SUPPAGINGMODE) SUPR0GetPagingMode(void);
    1801 SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void);
    18021803SUPR0DECL(RTCCUINTREG) SUPR0ChangeCR4(RTCCUINTREG fOrMask, RTCCUINTREG fAndMask);
    18031804SUPR0DECL(int) SUPR0EnableVTx(bool fEnable);
     
    18091810SUPR0DECL(int) SUPR0TscDeltaMeasureBySetIndex(PSUPDRVSESSION pSession, uint32_t iCpuSet, uint32_t fFlags,
    18101811                                              RTMSINTERVAL cMsWaitRetry, RTMSINTERVAL cMsWaitThread, uint32_t cTries);
     1812
     1813/**
     1814 * Returns configuration flags of the host kernel.
     1815 *
     1816 * @returns Combination of SUPKERNELFEATURES_XXX flags.
     1817 */
     1818SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void);
     1819
    18111820
    18121821/** @name Absolute symbols
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r56702 r57108  
    14001400}
    14011401
     1402
    14021403/**
    14031404 * Check if the CPU has SMAP support.
     
    14171418}
    14181419
     1420
    14191421RTDECL(int) SUPR0Printf(const char *pszFormat, ...)
    14201422{
     
    14321434
    14331435
    1434 /**
    1435  * Returns configuration flags of the host kernel.
    1436  */
    14371436SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void)
    14381437{
    1439     return 0;
     1438    uint32_t fFlags = 0;
     1439    if (ASMGetCR4() & X86_CR4_SMAP)
     1440        fFlags |= SUPKERNELFEATURES_SMAP;
     1441    return fFlags;
    14401442}
    14411443
  • trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c

    r54581 r57108  
    627627
    628628
    629 /**
    630  * Returns configuration flags of the host kernel.
    631  */
    632629SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void)
    633630{
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r56293 r57108  
    11071107
    11081108
    1109 /**
    1110  * Returns configuration flags of the host kernel.
    1111  */
    11121109SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void)
    11131110{
     
    11151112#ifdef CONFIG_PAX_KERNEXEC
    11161113    fFlags |= SUPKERNELFEATURES_GDT_READ_ONLY;
     1114#endif
     1115#ifdef CONFIG_X86_SMAP
     1116    if (ASMGetCR4() & X86_CR4_SMAP)
     1117        fFlags |= SUPKERNELFEATURES_SMAP;
    11171118#endif
    11181119    return fFlags;
  • trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp

    r56293 r57108  
    521521
    522522
    523 /**
    524  * Returns configuration flags of the host kernel.
    525  */
    526523SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void)
    527524{
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c

    r56293 r57108  
    12861286
    12871287
    1288 /**
    1289  * Returns configuration flags of the host kernel.
    1290  */
    12911288SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void)
    12921289{
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r56293 r57108  
    22542254
    22552255
    2256 /**
    2257  * Returns configuration flags of the host kernel.
    2258  */
    22592256SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void)
    22602257{
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