xref: /aosp_15_r20/external/libaom/aom_ports/aarch64_cpudetect.c (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1*77c1e3ccSAndroid Build Coastguard Worker /*
2*77c1e3ccSAndroid Build Coastguard Worker  * Copyright (c) 2023, Alliance for Open Media. All rights reserved.
3*77c1e3ccSAndroid Build Coastguard Worker  *
4*77c1e3ccSAndroid Build Coastguard Worker  * This source code is subject to the terms of the BSD 2 Clause License and
5*77c1e3ccSAndroid Build Coastguard Worker  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6*77c1e3ccSAndroid Build Coastguard Worker  * was not distributed with this source code in the LICENSE file, you can
7*77c1e3ccSAndroid Build Coastguard Worker  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8*77c1e3ccSAndroid Build Coastguard Worker  * Media Patent License 1.0 was not distributed with this source code in the
9*77c1e3ccSAndroid Build Coastguard Worker  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10*77c1e3ccSAndroid Build Coastguard Worker  */
11*77c1e3ccSAndroid Build Coastguard Worker 
12*77c1e3ccSAndroid Build Coastguard Worker #include "config/aom_config.h"
13*77c1e3ccSAndroid Build Coastguard Worker 
14*77c1e3ccSAndroid Build Coastguard Worker #include "arm_cpudetect.h"
15*77c1e3ccSAndroid Build Coastguard Worker 
16*77c1e3ccSAndroid Build Coastguard Worker #include "aom_ports/arm.h"
17*77c1e3ccSAndroid Build Coastguard Worker 
18*77c1e3ccSAndroid Build Coastguard Worker #if defined(__APPLE__)
19*77c1e3ccSAndroid Build Coastguard Worker #include <sys/sysctl.h>
20*77c1e3ccSAndroid Build Coastguard Worker #endif
21*77c1e3ccSAndroid Build Coastguard Worker 
22*77c1e3ccSAndroid Build Coastguard Worker #if !CONFIG_RUNTIME_CPU_DETECT
23*77c1e3ccSAndroid Build Coastguard Worker 
arm_get_cpu_caps(void)24*77c1e3ccSAndroid Build Coastguard Worker static int arm_get_cpu_caps(void) {
25*77c1e3ccSAndroid Build Coastguard Worker   // This function should actually be a no-op. There is no way to adjust any of
26*77c1e3ccSAndroid Build Coastguard Worker   // these because the RTCD tables do not exist: the functions are called
27*77c1e3ccSAndroid Build Coastguard Worker   // statically.
28*77c1e3ccSAndroid Build Coastguard Worker   int flags = 0;
29*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON
30*77c1e3ccSAndroid Build Coastguard Worker   flags |= HAS_NEON;
31*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON
32*77c1e3ccSAndroid Build Coastguard Worker   return flags;
33*77c1e3ccSAndroid Build Coastguard Worker }
34*77c1e3ccSAndroid Build Coastguard Worker 
35*77c1e3ccSAndroid Build Coastguard Worker #elif defined(__APPLE__)  // end !CONFIG_RUNTIME_CPU_DETECT
36*77c1e3ccSAndroid Build Coastguard Worker 
37*77c1e3ccSAndroid Build Coastguard Worker // sysctlbyname() parameter documentation for instruction set characteristics:
38*77c1e3ccSAndroid Build Coastguard Worker // https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics
have_feature(const char * feature)39*77c1e3ccSAndroid Build Coastguard Worker static inline bool have_feature(const char *feature) {
40*77c1e3ccSAndroid Build Coastguard Worker   int64_t feature_present = 0;
41*77c1e3ccSAndroid Build Coastguard Worker   size_t size = sizeof(feature_present);
42*77c1e3ccSAndroid Build Coastguard Worker   if (sysctlbyname(feature, &feature_present, &size, NULL, 0) != 0) {
43*77c1e3ccSAndroid Build Coastguard Worker     return false;
44*77c1e3ccSAndroid Build Coastguard Worker   }
45*77c1e3ccSAndroid Build Coastguard Worker   return feature_present;
46*77c1e3ccSAndroid Build Coastguard Worker }
47*77c1e3ccSAndroid Build Coastguard Worker 
arm_get_cpu_caps(void)48*77c1e3ccSAndroid Build Coastguard Worker static int arm_get_cpu_caps(void) {
49*77c1e3ccSAndroid Build Coastguard Worker   int flags = 0;
50*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON
51*77c1e3ccSAndroid Build Coastguard Worker   flags |= HAS_NEON;
52*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON
53*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_ARM_CRC32
54*77c1e3ccSAndroid Build Coastguard Worker   if (have_feature("hw.optional.armv8_crc32")) flags |= HAS_ARM_CRC32;
55*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_ARM_CRC32
56*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON_DOTPROD
57*77c1e3ccSAndroid Build Coastguard Worker   if (have_feature("hw.optional.arm.FEAT_DotProd")) flags |= HAS_NEON_DOTPROD;
58*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON_DOTPROD
59*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON_I8MM
60*77c1e3ccSAndroid Build Coastguard Worker   if (have_feature("hw.optional.arm.FEAT_I8MM")) flags |= HAS_NEON_I8MM;
61*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON_I8MM
62*77c1e3ccSAndroid Build Coastguard Worker   return flags;
63*77c1e3ccSAndroid Build Coastguard Worker }
64*77c1e3ccSAndroid Build Coastguard Worker 
65*77c1e3ccSAndroid Build Coastguard Worker #elif defined(_WIN32)  // end __APPLE__
66*77c1e3ccSAndroid Build Coastguard Worker 
arm_get_cpu_caps(void)67*77c1e3ccSAndroid Build Coastguard Worker static int arm_get_cpu_caps(void) {
68*77c1e3ccSAndroid Build Coastguard Worker   int flags = 0;
69*77c1e3ccSAndroid Build Coastguard Worker // IsProcessorFeaturePresent() parameter documentation:
70*77c1e3ccSAndroid Build Coastguard Worker // https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent#parameters
71*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON
72*77c1e3ccSAndroid Build Coastguard Worker   flags |= HAS_NEON;  // Neon is mandatory in Armv8.0-A.
73*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON
74*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_ARM_CRC32
75*77c1e3ccSAndroid Build Coastguard Worker   if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE)) {
76*77c1e3ccSAndroid Build Coastguard Worker     flags |= HAS_ARM_CRC32;
77*77c1e3ccSAndroid Build Coastguard Worker   }
78*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_ARM_CRC32
79*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON_DOTPROD
80*77c1e3ccSAndroid Build Coastguard Worker // Support for PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE was added in Windows SDK
81*77c1e3ccSAndroid Build Coastguard Worker // 20348, supported by Windows 11 and Windows Server 2022.
82*77c1e3ccSAndroid Build Coastguard Worker #if defined(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)
83*77c1e3ccSAndroid Build Coastguard Worker   if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)) {
84*77c1e3ccSAndroid Build Coastguard Worker     flags |= HAS_NEON_DOTPROD;
85*77c1e3ccSAndroid Build Coastguard Worker   }
86*77c1e3ccSAndroid Build Coastguard Worker #endif  // defined(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)
87*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON_DOTPROD
88*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON_I8MM
89*77c1e3ccSAndroid Build Coastguard Worker // Support for PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE was added in Windows SDK
90*77c1e3ccSAndroid Build Coastguard Worker // 26100.
91*77c1e3ccSAndroid Build Coastguard Worker #if defined(PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE)
92*77c1e3ccSAndroid Build Coastguard Worker   // There's no PF_* flag that indicates whether plain I8MM is available
93*77c1e3ccSAndroid Build Coastguard Worker   // or not. But if SVE_I8MM is available, that also implies that
94*77c1e3ccSAndroid Build Coastguard Worker   // regular I8MM is available.
95*77c1e3ccSAndroid Build Coastguard Worker   if (IsProcessorFeaturePresent(PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE)) {
96*77c1e3ccSAndroid Build Coastguard Worker     flags |= HAS_NEON_I8MM;
97*77c1e3ccSAndroid Build Coastguard Worker   }
98*77c1e3ccSAndroid Build Coastguard Worker #endif  // defined(PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE)
99*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON_I8MM
100*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SVE
101*77c1e3ccSAndroid Build Coastguard Worker // Support for PF_ARM_SVE_INSTRUCTIONS_AVAILABLE was added in Windows SDK 26100.
102*77c1e3ccSAndroid Build Coastguard Worker #if defined(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE)
103*77c1e3ccSAndroid Build Coastguard Worker   if (IsProcessorFeaturePresent(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE)) {
104*77c1e3ccSAndroid Build Coastguard Worker     flags |= HAS_SVE;
105*77c1e3ccSAndroid Build Coastguard Worker   }
106*77c1e3ccSAndroid Build Coastguard Worker #endif  // defined(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE)
107*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SVE
108*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SVE2
109*77c1e3ccSAndroid Build Coastguard Worker // Support for PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE was added in Windows SDK
110*77c1e3ccSAndroid Build Coastguard Worker // 26100.
111*77c1e3ccSAndroid Build Coastguard Worker #if defined(PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE)
112*77c1e3ccSAndroid Build Coastguard Worker   if (IsProcessorFeaturePresent(PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE)) {
113*77c1e3ccSAndroid Build Coastguard Worker     flags |= HAS_SVE2;
114*77c1e3ccSAndroid Build Coastguard Worker   }
115*77c1e3ccSAndroid Build Coastguard Worker #endif  // defined(PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE)
116*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SVE2
117*77c1e3ccSAndroid Build Coastguard Worker   return flags;
118*77c1e3ccSAndroid Build Coastguard Worker }
119*77c1e3ccSAndroid Build Coastguard Worker 
120*77c1e3ccSAndroid Build Coastguard Worker #elif defined(AOM_USE_ANDROID_CPU_FEATURES)
121*77c1e3ccSAndroid Build Coastguard Worker 
arm_get_cpu_caps(void)122*77c1e3ccSAndroid Build Coastguard Worker static int arm_get_cpu_caps(void) {
123*77c1e3ccSAndroid Build Coastguard Worker   int flags = 0;
124*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON
125*77c1e3ccSAndroid Build Coastguard Worker   flags |= HAS_NEON;  // Neon is mandatory in Armv8.0-A.
126*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON
127*77c1e3ccSAndroid Build Coastguard Worker   return flags;
128*77c1e3ccSAndroid Build Coastguard Worker }
129*77c1e3ccSAndroid Build Coastguard Worker 
130*77c1e3ccSAndroid Build Coastguard Worker #elif defined(__linux__)  // end defined(AOM_USE_ANDROID_CPU_FEATURES)
131*77c1e3ccSAndroid Build Coastguard Worker 
132*77c1e3ccSAndroid Build Coastguard Worker #include <sys/auxv.h>
133*77c1e3ccSAndroid Build Coastguard Worker 
134*77c1e3ccSAndroid Build Coastguard Worker // Define hwcap values ourselves: building with an old auxv header where these
135*77c1e3ccSAndroid Build Coastguard Worker // hwcap values are not defined should not prevent features from being enabled.
136*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AARCH64_HWCAP_CRC32 (1 << 7)
137*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AARCH64_HWCAP_ASIMDDP (1 << 20)
138*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AARCH64_HWCAP_SVE (1 << 22)
139*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AARCH64_HWCAP2_SVE2 (1 << 1)
140*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AARCH64_HWCAP2_I8MM (1 << 13)
141*77c1e3ccSAndroid Build Coastguard Worker 
arm_get_cpu_caps(void)142*77c1e3ccSAndroid Build Coastguard Worker static int arm_get_cpu_caps(void) {
143*77c1e3ccSAndroid Build Coastguard Worker   int flags = 0;
144*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_ARM_CRC32 || HAVE_NEON_DOTPROD || HAVE_SVE
145*77c1e3ccSAndroid Build Coastguard Worker   unsigned long hwcap = getauxval(AT_HWCAP);
146*77c1e3ccSAndroid Build Coastguard Worker #endif
147*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON_I8MM || HAVE_SVE2
148*77c1e3ccSAndroid Build Coastguard Worker   unsigned long hwcap2 = getauxval(AT_HWCAP2);
149*77c1e3ccSAndroid Build Coastguard Worker #endif
150*77c1e3ccSAndroid Build Coastguard Worker 
151*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON
152*77c1e3ccSAndroid Build Coastguard Worker   flags |= HAS_NEON;  // Neon is mandatory in Armv8.0-A.
153*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON
154*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_ARM_CRC32
155*77c1e3ccSAndroid Build Coastguard Worker   if (hwcap & AOM_AARCH64_HWCAP_CRC32) flags |= HAS_ARM_CRC32;
156*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_ARM_CRC32
157*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON_DOTPROD
158*77c1e3ccSAndroid Build Coastguard Worker   if (hwcap & AOM_AARCH64_HWCAP_ASIMDDP) flags |= HAS_NEON_DOTPROD;
159*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON_DOTPROD
160*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON_I8MM
161*77c1e3ccSAndroid Build Coastguard Worker   if (hwcap2 & AOM_AARCH64_HWCAP2_I8MM) flags |= HAS_NEON_I8MM;
162*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON_I8MM
163*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SVE
164*77c1e3ccSAndroid Build Coastguard Worker   if (hwcap & AOM_AARCH64_HWCAP_SVE) flags |= HAS_SVE;
165*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SVE
166*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SVE2
167*77c1e3ccSAndroid Build Coastguard Worker   if (hwcap2 & AOM_AARCH64_HWCAP2_SVE2) flags |= HAS_SVE2;
168*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SVE2
169*77c1e3ccSAndroid Build Coastguard Worker   return flags;
170*77c1e3ccSAndroid Build Coastguard Worker }
171*77c1e3ccSAndroid Build Coastguard Worker 
172*77c1e3ccSAndroid Build Coastguard Worker #elif defined(__Fuchsia__)  // end __linux__
173*77c1e3ccSAndroid Build Coastguard Worker 
174*77c1e3ccSAndroid Build Coastguard Worker #include <zircon/features.h>
175*77c1e3ccSAndroid Build Coastguard Worker #include <zircon/syscalls.h>
176*77c1e3ccSAndroid Build Coastguard Worker 
177*77c1e3ccSAndroid Build Coastguard Worker // Added in https://fuchsia-review.googlesource.com/c/fuchsia/+/894282.
178*77c1e3ccSAndroid Build Coastguard Worker #ifndef ZX_ARM64_FEATURE_ISA_I8MM
179*77c1e3ccSAndroid Build Coastguard Worker #define ZX_ARM64_FEATURE_ISA_I8MM ((uint32_t)(1u << 19))
180*77c1e3ccSAndroid Build Coastguard Worker #endif
181*77c1e3ccSAndroid Build Coastguard Worker // Added in https://fuchsia-review.googlesource.com/c/fuchsia/+/895083.
182*77c1e3ccSAndroid Build Coastguard Worker #ifndef ZX_ARM64_FEATURE_ISA_SVE
183*77c1e3ccSAndroid Build Coastguard Worker #define ZX_ARM64_FEATURE_ISA_SVE ((uint32_t)(1u << 20))
184*77c1e3ccSAndroid Build Coastguard Worker #endif
185*77c1e3ccSAndroid Build Coastguard Worker 
arm_get_cpu_caps(void)186*77c1e3ccSAndroid Build Coastguard Worker static int arm_get_cpu_caps(void) {
187*77c1e3ccSAndroid Build Coastguard Worker   int flags = 0;
188*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON
189*77c1e3ccSAndroid Build Coastguard Worker   flags |= HAS_NEON;  // Neon is mandatory in Armv8.0-A.
190*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON
191*77c1e3ccSAndroid Build Coastguard Worker   uint32_t features;
192*77c1e3ccSAndroid Build Coastguard Worker   zx_status_t status = zx_system_get_features(ZX_FEATURE_KIND_CPU, &features);
193*77c1e3ccSAndroid Build Coastguard Worker   if (status != ZX_OK) return flags;
194*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_ARM_CRC32
195*77c1e3ccSAndroid Build Coastguard Worker   if (features & ZX_ARM64_FEATURE_ISA_CRC32) flags |= HAS_ARM_CRC32;
196*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_ARM_CRC32
197*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON_DOTPROD
198*77c1e3ccSAndroid Build Coastguard Worker   if (features & ZX_ARM64_FEATURE_ISA_DP) flags |= HAS_NEON_DOTPROD;
199*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON_DOTPROD
200*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON_I8MM
201*77c1e3ccSAndroid Build Coastguard Worker   if (features & ZX_ARM64_FEATURE_ISA_I8MM) flags |= HAS_NEON_I8MM;
202*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON_I8MM
203*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_SVE
204*77c1e3ccSAndroid Build Coastguard Worker   if (features & ZX_ARM64_FEATURE_ISA_SVE) flags |= HAS_SVE;
205*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_SVE
206*77c1e3ccSAndroid Build Coastguard Worker   return flags;
207*77c1e3ccSAndroid Build Coastguard Worker }
208*77c1e3ccSAndroid Build Coastguard Worker 
209*77c1e3ccSAndroid Build Coastguard Worker #else  // end __Fuchsia__
210*77c1e3ccSAndroid Build Coastguard Worker #error \
211*77c1e3ccSAndroid Build Coastguard Worker     "Runtime CPU detection selected, but no CPU detection method " \
212*77c1e3ccSAndroid Build Coastguard Worker "available for your platform. Rerun cmake with -DCONFIG_RUNTIME_CPU_DETECT=0."
213*77c1e3ccSAndroid Build Coastguard Worker #endif
214*77c1e3ccSAndroid Build Coastguard Worker 
aom_arm_cpu_caps(void)215*77c1e3ccSAndroid Build Coastguard Worker int aom_arm_cpu_caps(void) {
216*77c1e3ccSAndroid Build Coastguard Worker   int flags = 0;
217*77c1e3ccSAndroid Build Coastguard Worker   if (!arm_cpu_env_flags(&flags)) {
218*77c1e3ccSAndroid Build Coastguard Worker     flags = arm_get_cpu_caps() & arm_cpu_env_mask();
219*77c1e3ccSAndroid Build Coastguard Worker   }
220*77c1e3ccSAndroid Build Coastguard Worker 
221*77c1e3ccSAndroid Build Coastguard Worker   // Restrict flags: FEAT_I8MM assumes that FEAT_DotProd is available.
222*77c1e3ccSAndroid Build Coastguard Worker   if (!(flags & HAS_NEON_DOTPROD)) flags &= ~HAS_NEON_I8MM;
223*77c1e3ccSAndroid Build Coastguard Worker 
224*77c1e3ccSAndroid Build Coastguard Worker   // Restrict flags: SVE assumes that FEAT_{DotProd,I8MM} are available.
225*77c1e3ccSAndroid Build Coastguard Worker   if (!(flags & HAS_NEON_DOTPROD)) flags &= ~HAS_SVE;
226*77c1e3ccSAndroid Build Coastguard Worker   if (!(flags & HAS_NEON_I8MM)) flags &= ~HAS_SVE;
227*77c1e3ccSAndroid Build Coastguard Worker 
228*77c1e3ccSAndroid Build Coastguard Worker   // Restrict flags: SVE2 assumes that FEAT_SVE is available.
229*77c1e3ccSAndroid Build Coastguard Worker   if (!(flags & HAS_SVE)) flags &= ~HAS_SVE2;
230*77c1e3ccSAndroid Build Coastguard Worker 
231*77c1e3ccSAndroid Build Coastguard Worker   return flags;
232*77c1e3ccSAndroid Build Coastguard Worker }
233