diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2021-06-30 12:51:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 12:51:26 +0300 |
commit | b3ef4ef49d8ac3c37f5d60db5f37ee43f433aa2d (patch) | |
tree | 1060132b614fcf2b5710a306bff8706f9fdaabcf /include | |
parent | 001faefdc327e7013a581b99e3cdcbe0ba968277 (diff) |
Avoid leaking internal headers for ppc (#164)
Diffstat (limited to 'include')
-rw-r--r-- | include/cpuinfo_ppc.h | 8 | ||||
-rw-r--r-- | include/internal/hwcaps.h | 15 |
2 files changed, 15 insertions, 8 deletions
diff --git a/include/cpuinfo_ppc.h b/include/cpuinfo_ppc.h index f691194..c3f71a0 100644 --- a/include/cpuinfo_ppc.h +++ b/include/cpuinfo_ppc.h @@ -17,7 +17,6 @@ #include "cpu_features_cache_info.h" #include "cpu_features_macros.h" -#include "internal/hwcaps.h" CPU_FEATURES_START_CPP_NAMESPACE @@ -75,11 +74,16 @@ typedef struct { PPCInfo GetPPCInfo(void); typedef struct { + char platform[64]; // 0 terminated string + char base_platform[64]; // 0 terminated string +} PPCPlatformTypeStrings; + +typedef struct { char platform[64]; // 0 terminated string char model[64]; // 0 terminated string char machine[64]; // 0 terminated string char cpu[64]; // 0 terminated string - PlatformType type; + PPCPlatformTypeStrings type; } PPCPlatformStrings; PPCPlatformStrings GetPPCPlatformStrings(void); diff --git a/include/internal/hwcaps.h b/include/internal/hwcaps.h index 70829c1..d7fc782 100644 --- a/include/internal/hwcaps.h +++ b/include/internal/hwcaps.h @@ -171,16 +171,19 @@ typedef struct { unsigned long hwcaps2; } HardwareCapabilities; +// Retrieves values from auxiliary vector for types AT_HWCAP and AT_HWCAP2. +// First tries to call getauxval(), if not available falls back to reading +// "/proc/self/auxv". HardwareCapabilities CpuFeatures_GetHardwareCapabilities(void); + +// Checks whether value for AT_HWCAP (or AT_HWCAP2) match hwcaps_mask. bool CpuFeatures_IsHwCapsSet(const HardwareCapabilities hwcaps_mask, const HardwareCapabilities hwcaps); -typedef struct { - char platform[64]; // 0 terminated string - char base_platform[64]; // 0 terminated string -} PlatformType; - -PlatformType CpuFeatures_GetPlatformType(void); +// Get pointer for the AT_PLATFORM type. +const char* CpuFeatures_GetPlatformPointer(void); +// Get pointer for the AT_BASE_PLATFORM type. +const char* CpuFeatures_GetBasePlatformPointer(void); CPU_FEATURES_END_CPP_NAMESPACE |