diff --git a/src/MacMSRDriver/PcmMsr/CMakeLists.txt b/src/MacMSRDriver/PcmMsr/CMakeLists.txt index 8e055d70..3dc25629 100644 --- a/src/MacMSRDriver/PcmMsr/CMakeLists.txt +++ b/src/MacMSRDriver/PcmMsr/CMakeLists.txt @@ -4,6 +4,7 @@ add_executable( PcmMsrDriver MACOSX_BUNDLE PcmMsr.cpp + PcmMSrClient.cpp PcmMsrDriver_info.c PcmMsr-Info.plist ) diff --git a/src/MacMSRDriver/PcmMsr/PcmMsr.cpp b/src/MacMSRDriver/PcmMsr/PcmMsr.cpp index 3fec3c46..f8dcaba9 100644 --- a/src/MacMSRDriver/PcmMsr/PcmMsr.cpp +++ b/src/MacMSRDriver/PcmMsr/PcmMsr.cpp @@ -57,7 +57,7 @@ void cpuWriteMSR(void* pIDatas){ } void cpuGetTopoData(void* pTopos){ - kTopologyEntry* entries = (kTopologyEntry*)pTopos; + topologyEntry* entries = (topologyEntry*)pTopos; volatile uint cpu = cpu_number(); int info[4]; entries[cpu].os_id = cpu; @@ -119,15 +119,17 @@ bool PcmMsrDriverClassName::init(OSDictionary *dict) topologies = 0; if(result && num_cores != 0) { - topologies = (kTopologyEntry*)IOMallocAligned(sizeof(kTopologyEntry)*num_cores, 128); + topologies = (topologyEntry*)IOMallocAligned(sizeof(topologyEntry)*num_cores, 32); } return (result && topologies && num_cores != 0); } void PcmMsrDriverClassName::free() { - if(topologies) - IOFreeAligned(topologies, sizeof(kTopologyEntry)*num_cores); + if (topologies) + { + IOFreeAligned(topologies, sizeof(topologyEntry)*num_cores); + } super::free(); } diff --git a/src/MacMSRDriver/PcmMsr/PcmMsr.h b/src/MacMSRDriver/PcmMsr/PcmMsr.h index fa204fe6..c94ed2ee 100644 --- a/src/MacMSRDriver/PcmMsr/PcmMsr.h +++ b/src/MacMSRDriver/PcmMsr/PcmMsr.h @@ -37,7 +37,7 @@ class PcmMsrDriverClassName : public IOService // number of providers currently using the driver uint32_t num_clients = 0; uint32_t num_cores; - kTopologyEntry *topologies; + topologyEntry *topologies; }; #ifdef DEBUG diff --git a/src/MacMSRDriver/PcmMsr/UserKernelShared.h b/src/MacMSRDriver/PcmMsr/UserKernelShared.h index b077af0f..78b5a619 100644 --- a/src/MacMSRDriver/PcmMsr/UserKernelShared.h +++ b/src/MacMSRDriver/PcmMsr/UserKernelShared.h @@ -21,26 +21,18 @@ typedef struct { } k_pcm_msr_data_t; // The topologyEntry struct that is used by PCM -typedef struct{ +typedef struct +{ uint32_t os_id; uint32_t thread_id; uint32_t core_id; uint32_t tile_id; uint32_t socket; + uint32_t native_cpu_model; + uint32_t core_type; // This is an enum in the userland structure. + uint32_t padding; } topologyEntry; -// A kernel version of the topology entry structure. It has -// an extra unused int to explicitly align the struct on a 64bit -// boundary, preventing the compiler from adding extra padding. -typedef struct{ - uint32_t os_id; - uint32_t thread_id; - uint32_t core_id; - uint32_t tile_id; - uint32_t socket; - char padding[108]; -} kTopologyEntry; - enum { kOpenDriver, kCloseDriver,