VirtualBox

Changeset 64281 in vbox for trunk/include


Ignore:
Timestamp:
Oct 15, 2016 4:46:29 PM (8 years ago)
Author:
vboxsync
Message:

IPRT,SUP: Major vboxdrv and GIP version change; more flexible processor group handling on Windows.

Location:
trunk/include
Files:
4 edited

Legend:

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

    r64255 r64281  
    272272    /** CPU group number (always zero, except on windows). */
    273273    uint16_t                iCpuGroup;
    274     /** CPU group number (same as iCpuSet, except on windows). */
     274    /** CPU group member number (same as iCpuSet, except on windows). */
    275275    uint16_t                iCpuGroupMember;
    276276    /** The APIC ID of this CPU. */
     
    289289typedef SUPGIPCPU *PSUPGIPCPU;
    290290
     291/**
     292 * CPU group information.
     293 * @remarks Windows only.
     294 */
     295typedef struct SUPGIPCPUGROUP
     296{
     297    /** Current number of CPUs in this group. */
     298    uint16_t volatile       cMembers;
     299    /** Maximum number of CPUs in the group. */
     300    uint16_t                cMaxMembers;
     301    /** The CPU set index of the members. This table has cMaxMembers entries.
     302     * @note For various reasons, entries from cMembers and up to cMaxMembers are
     303     *       may change as the host OS does set dynamic assignments during CPU
     304     *       hotplugging. */
     305    int16_t                 aiCpuSetIdxs[1];
     306} SUPGIPCPUGROUP;
     307/** Pointer to a GIP CPU group structure. */
     308typedef SUPGIPCPUGROUP *PSUPGIPCPUGROUP;
     309/** Pointer to a const GIP CPU group structure. */
     310typedef SUPGIPCPUGROUP const *PCSUPGIPCPUGROUP;
    291311
    292312/**
     
    358378/** @} */
    359379
     380/** @def SUPGIP_MAX_CPU_GROUPS
     381 * Maximum number of CPU groups.  */
     382#if RTCPUSET_MAX_CPUS >= 256
     383# define SUPGIP_MAX_CPU_GROUPS 256
     384#else
     385# define SUPGIP_MAX_CPU_GROUPS 256
     386#endif
    360387
    361388/**
     
    419446    /** CPU set index to CPU table index. */
    420447    uint16_t            aiCpuFromCpuSetIdx[RTCPUSET_MAX_CPUS];
    421     /** Table indexed by CPU group index to get the CPU set index of the first
    422      *  CPU. */
    423     uint16_t            aiFirstCpuSetIdxFromCpuGroup[RTCPUSET_MAX_CPUS];
     448    /** Table indexed by CPU group to containing offsets to SUPGIPCPUGROUP
     449     * structures, invalid entries are set to UINT16_MAX.  The offsets are relative
     450     * to the start of this structure.
     451     * @note Windows only. The other hosts sets all entries to UINT16_MAX! */
     452    uint16_t            aoffCpuGroup[SUPGIP_MAX_CPU_GROUPS];
    424453
    425454    /** Array of per-cpu data.
     
    450479 * Upper 16 bits is the major version. Major version is only changed with
    451480 * incompatible changes in the GIP. */
    452 #define SUPGLOBALINFOPAGE_VERSION   0x00070000
     481#define SUPGLOBALINFOPAGE_VERSION   0x00080000
    453482
    454483/**
  • trunk/include/iprt/mangling.h

    r64255 r64281  
    13031303# define RTMpGetCurFrequency                            RT_MANGLER(RTMpGetCurFrequency)
    13041304# define RTMpGetDescription                             RT_MANGLER(RTMpGetDescription)
     1305# define RTMpGetCpuGroupCounts                          RT_MANGLER(RTMpGetCpuGroupCounts)
     1306# define RTMpGetMaxCpuGroupCount                        RT_MANGLER(RTMpGetMaxCpuGroupCount)
    13051307# define RTMpGetMaxCpuId                                RT_MANGLER(RTMpGetMaxCpuId)
    13061308# define RTMpGetMaxFrequency                            RT_MANGLER(RTMpGetMaxFrequency)
     
    13261328# define RTMpOnSpecific                                 RT_MANGLER(RTMpOnSpecific)             /* r0drv */
    13271329# define RTMpPokeCpu                                    RT_MANGLER(RTMpPokeCpu)                /* r0drv */
     1330# define RTMpSetIndexFromCpuGroupMember                 RT_MANGLER(RTMpSetIndexFromCpuGroupMember)
    13281331# define RTMsgError                                     RT_MANGLER(RTMsgError)
    13291332# define RTMsgErrorExit                                 RT_MANGLER(RTMsgErrorExit)
  • trunk/include/iprt/mp.h

    r62473 r64281  
    8888 */
    8989RTDECL(RTCPUID) RTMpCpuIdFromSetIndex(int iCpu);
     90
     91/**
     92 * Translates an NT process group member to a CPU set index.
     93 *
     94 * @returns CPU set index, -1 if not valid.
     95 * @param   idxGroup        The CPU group.
     96 * @param   idxMember       The CPU group member number.
     97 *
     98 * @remarks Only available on Windows.
     99 */
     100RTDECL(int) RTMpSetIndexFromCpuGroupMember(uint32_t idxGroup, uint32_t idxMember);
     101
     102/**
     103 * Gets the member numbers for a CPU group.
     104 *
     105 * @returns Maximum number of group members.
     106 * @param   idxGroup        The CPU group.
     107 * @param   pcActive        Where to return the number of active members.
     108 *
     109 * @remarks Only available on Windows.
     110 */
     111RTDECL(uint32_t) RTMpGetCpuGroupCounts(uint32_t idxGroup, uint32_t *pcActive);
     112
     113/**
     114 * Get the maximum number of CPU groups.
     115 *
     116 * @returns Maximum number of CPU groups.
     117 *
     118 * @remarks Only available on Windows.
     119 */
     120RTDECL(uint32_t) RTMpGetMaxCpuGroupCount(void);
    90121
    91122/**
  • trunk/include/iprt/nt/nt.h

    r64255 r64281  
    24542454typedef  ULONG   (NTAPI *PFNKEQUERYMAXIMUMPROCESSORCOUNTEX)(USHORT GroupNumber);
    24552455typedef  USHORT  (NTAPI *PFNKEQUERYMAXIMUMGROUPCOUNT)(VOID);
     2456typedef  ULONG   (NTAPI *PFNKEQUERYACTIVEPROCESSORCOUNT)(KAFFINITY *pfActiveProcessors);
     2457typedef  ULONG   (NTAPI *PFNKEQUERYACTIVEPROCESSORCOUNTEX)(USHORT GroupNumber);
    24562458typedef  NTSTATUS (NTAPI *PFNKEQUERYLOGICALPROCESSORRELATIONSHIP)(PROCESSOR_NUMBER *pProcNumber,
    24572459                                                                  LOGICAL_PROCESSOR_RELATIONSHIP RelationShipType,
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