VirtualBox

Changeset 87198 in vbox


Ignore:
Timestamp:
Jan 8, 2021 2:58:51 PM (4 years ago)
Author:
vboxsync
Message:

IPRT/mp-darwin.cpp: Added RTMpCpuId implementations for bugref:9898.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/darwin/mp-darwin.cpp

    r82968 r87198  
    115115
    116116
    117 /** @todo RTmpCpuId(). */
     117#if defined(RT_ARCH_ARM64)
     118RTDECL(RTCPUID) RTMpCpuId(void)
     119{
     120    /* xnu-7195.50.7.100.1/osfmk/arm64/start.s and machine_routines.c sets TPIDRRO_EL0
     121       to the cpu_data_t::cpu_id value. */
     122    uint64_t u64Ret;
     123    __asm__ __volatile__("mrs %0,TPIDRRO_EL0\n\t" : "=r" (u64Ret));
     124    return (RTCPUID)u64Ret;
     125}
     126#elif defined(RT_ARCH_ARM32)
     127RTDECL(RTCPUID) RTMpCpuId(void)
     128{
     129    /* xnu-7195.50.7.100.1/osfmk/arm/start.s and machine_routines.c sets TPIDRURO
     130       to the cpu_data_t::cpu_id value. */
     131    uint32_t u32Ret;
     132    __asm__ __volatile__("mrs p15, 0, %0, c13, c0, 3\n\t" : "=r" (u32Ret));
     133    return (RTCPUID)u32Ret;
     134}
     135#endif
     136
    118137
    119138RTDECL(int) RTMpCpuIdToSetIndex(RTCPUID idCpu)
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