mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	core: Separate ARM CPU detection from initialisation
This separate the ARM CPU feature detection code from the initialisation so that we can reuse it in tests, like we did for x86 a while back.
This commit is contained in:
		
							parent
							
								
									2e303b8600
								
							
						
					
					
						commit
						60660a1aec
					
				
					 2 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
					@ -79,7 +79,7 @@ static char *get_cpuinfo(void) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif /* defined (__arm__) && defined (__linux__) */
 | 
					#endif /* defined (__arm__) && defined (__linux__) */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags) {
 | 
					void pa_cpu_get_arm_flags(pa_cpu_arm_flag_t *flags) {
 | 
				
			||||||
#if defined (__arm__)
 | 
					#if defined (__arm__)
 | 
				
			||||||
#if defined (__linux__)
 | 
					#if defined (__linux__)
 | 
				
			||||||
    char *cpuinfo, *line;
 | 
					    char *cpuinfo, *line;
 | 
				
			||||||
| 
						 | 
					@ -89,7 +89,7 @@ pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags) {
 | 
				
			||||||
     * space support to get the CPU features. This only works on linux AFAIK. */
 | 
					     * space support to get the CPU features. This only works on linux AFAIK. */
 | 
				
			||||||
    if (!(cpuinfo = get_cpuinfo())) {
 | 
					    if (!(cpuinfo = get_cpuinfo())) {
 | 
				
			||||||
        pa_log("Can't read cpuinfo");
 | 
					        pa_log("Can't read cpuinfo");
 | 
				
			||||||
        return FALSE;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *flags = 0;
 | 
					    *flags = 0;
 | 
				
			||||||
| 
						 | 
					@ -131,6 +131,14 @@ pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags) {
 | 
				
			||||||
          (*flags & PA_CPU_ARM_EDSP) ? "EDSP " : "",
 | 
					          (*flags & PA_CPU_ARM_EDSP) ? "EDSP " : "",
 | 
				
			||||||
          (*flags & PA_CPU_ARM_NEON) ? "NEON " : "",
 | 
					          (*flags & PA_CPU_ARM_NEON) ? "NEON " : "",
 | 
				
			||||||
          (*flags & PA_CPU_ARM_VFPV3) ? "VFPV3 " : "");
 | 
					          (*flags & PA_CPU_ARM_VFPV3) ? "VFPV3 " : "");
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags) {
 | 
				
			||||||
 | 
					#if defined (__arm__)
 | 
				
			||||||
 | 
					#if defined (__linux__)
 | 
				
			||||||
 | 
					    pa_cpu_get_arm_flags(flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (*flags & PA_CPU_ARM_V6)
 | 
					    if (*flags & PA_CPU_ARM_V6)
 | 
				
			||||||
        pa_volume_func_init_arm(*flags);
 | 
					        pa_volume_func_init_arm(*flags);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,6 +35,7 @@ typedef enum pa_cpu_arm_flag {
 | 
				
			||||||
    PA_CPU_ARM_VFPV3    = (1 << 5)
 | 
					    PA_CPU_ARM_VFPV3    = (1 << 5)
 | 
				
			||||||
} pa_cpu_arm_flag_t;
 | 
					} pa_cpu_arm_flag_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void pa_cpu_get_arm_flags(pa_cpu_arm_flag_t *flags);
 | 
				
			||||||
pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags);
 | 
					pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* some optimized functions */
 | 
					/* some optimized functions */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue