mirror of
				https://github.com/google/cpu_features.git
				synced 2025-10-26 02:40:43 +01:00 
			
		
		
		
	hwcaps: Change uint32_t to unsigned long
getauxval() returns an unsigned long which can be defined to be more than 32 bits so don't force the result into a uint32_t. Signed-off-by: Rashmica Gupta <rashmica.gupta@au1.ibm.com>
This commit is contained in:
		 Rashmica Gupta
					Rashmica Gupta
				
			
				
					committed by
					
						 Rashmica Gupta
						Rashmica Gupta
					
				
			
			
				
	
			
			
			 Rashmica Gupta
						Rashmica Gupta
					
				
			
						parent
						
							3adafbfe66
						
					
				
				
					commit
					1c8bf0ecd8
				
			| @@ -113,8 +113,8 @@ CPU_FEATURES_START_CPP_NAMESPACE | |||||||
| #endif | #endif | ||||||
|  |  | ||||||
| typedef struct { | typedef struct { | ||||||
|   uint32_t hwcaps; |   unsigned long hwcaps; | ||||||
|   uint32_t hwcaps2; |   unsigned long hwcaps2; | ||||||
| } HardwareCapabilities; | } HardwareCapabilities; | ||||||
|  |  | ||||||
| HardwareCapabilities CpuFeatures_GetHardwareCapabilities(void); | HardwareCapabilities CpuFeatures_GetHardwareCapabilities(void); | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ | |||||||
| #if defined(HWCAPS_REGULAR_LINUX) | #if defined(HWCAPS_REGULAR_LINUX) | ||||||
| #include <dlfcn.h> | #include <dlfcn.h> | ||||||
| #include <sys/auxv.h> | #include <sys/auxv.h> | ||||||
| static uint32_t GetElfHwcapFromGetauxval(uint32_t hwcap_type) { | static unsigned long GetElfHwcapFromGetauxval(uint32_t hwcap_type) { | ||||||
|   return getauxval(hwcap_type); |   return getauxval(hwcap_type); | ||||||
| } | } | ||||||
| #endif  // defined(HWCAPS_REGULAR_LINUX) | #endif  // defined(HWCAPS_REGULAR_LINUX) | ||||||
| @@ -136,8 +136,8 @@ static uint32_t GetElfHwcapFromProcSelfAuxv(uint32_t hwcap_type) { | |||||||
|  |  | ||||||
| // Retrieves hardware capabilities by first trying to call getauxval, if not | // Retrieves hardware capabilities by first trying to call getauxval, if not | ||||||
| // available falls back to reading "/proc/self/auxv". | // available falls back to reading "/proc/self/auxv". | ||||||
| static uint32_t GetHardwareCapabilitiesFor(uint32_t type) { | static unsigned long GetHardwareCapabilitiesFor(uint32_t type) { | ||||||
|   uint32_t hwcaps = GetElfHwcapFromGetauxval(type); |   unsigned long hwcaps = GetElfHwcapFromGetauxval(type); | ||||||
|   if (!hwcaps) { |   if (!hwcaps) { | ||||||
|     D("Parsing /proc/self/auxv to extract ELF hwcaps!\n"); |     D("Parsing /proc/self/auxv to extract ELF hwcaps!\n"); | ||||||
|     hwcaps = GetElfHwcapFromProcSelfAuxv(type); |     hwcaps = GetElfHwcapFromProcSelfAuxv(type); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user