1 /*
2  *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_FEATURES_WRAPPER_H_
12 #define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_FEATURES_WRAPPER_H_
13 
14 #if defined(__cplusplus) || defined(c_plusplus)
15 extern "C" {
16 #endif
17 
18 #include <typedefs.h>
19 
20 // List of features in x86.
21 typedef enum {
22   kSSE2,
23   kSSE3
24 } CPUFeature;
25 
26 // List of features in ARM.
27 enum {
28   kCPUFeatureARMv7       = (1 << 0),
29   kCPUFeatureVFPv3       = (1 << 1),
30   kCPUFeatureNEON        = (1 << 2),
31   kCPUFeatureLDREXSTREX  = (1 << 3)
32 };
33 
34 typedef int (*WebRtc_CPUInfo)(CPUFeature feature);
35 // returns true if the CPU supports the feature.
36 extern WebRtc_CPUInfo WebRtc_GetCPUInfo;
37 // No CPU feature is available => straight C path.
38 extern WebRtc_CPUInfo WebRtc_GetCPUInfoNoASM;
39 
40 // Return the features in an ARM device.
41 // It detects the features in the hardware platform, and returns supported
42 // values in the above enum definition as a bitmask.
43 extern uint64_t WebRtc_GetCPUFeaturesARM(void);
44 
45 #if defined(__cplusplus) || defined(c_plusplus)
46 }    // extern "C"
47 #endif
48 
49 #endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_FEATURES_WRAPPER_H_
50