xref: /aosp_15_r20/external/ltp/include/tst_arch.h (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker /* SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Worker  * Copyright (c) 2021 Li Wang <[email protected]>
3*49cdfc7eSAndroid Build Coastguard Worker  */
4*49cdfc7eSAndroid Build Coastguard Worker 
5*49cdfc7eSAndroid Build Coastguard Worker #ifndef TST_ARCH_H__
6*49cdfc7eSAndroid Build Coastguard Worker #define TST_ARCH_H__
7*49cdfc7eSAndroid Build Coastguard Worker 
8*49cdfc7eSAndroid Build Coastguard Worker enum tst_arch_type {
9*49cdfc7eSAndroid Build Coastguard Worker 	TST_UNKNOWN,
10*49cdfc7eSAndroid Build Coastguard Worker 	TST_X86,
11*49cdfc7eSAndroid Build Coastguard Worker 	TST_X86_64,
12*49cdfc7eSAndroid Build Coastguard Worker 	TST_IA64,
13*49cdfc7eSAndroid Build Coastguard Worker 	TST_PPC,
14*49cdfc7eSAndroid Build Coastguard Worker 	TST_PPC64,
15*49cdfc7eSAndroid Build Coastguard Worker 	TST_S390,
16*49cdfc7eSAndroid Build Coastguard Worker 	TST_S390X,
17*49cdfc7eSAndroid Build Coastguard Worker 	TST_ARM,
18*49cdfc7eSAndroid Build Coastguard Worker 	TST_AARCH64,
19*49cdfc7eSAndroid Build Coastguard Worker 	TST_SPARC,
20*49cdfc7eSAndroid Build Coastguard Worker };
21*49cdfc7eSAndroid Build Coastguard Worker 
22*49cdfc7eSAndroid Build Coastguard Worker /*
23*49cdfc7eSAndroid Build Coastguard Worker  * This tst_arch is to save the system architecture for
24*49cdfc7eSAndroid Build Coastguard Worker  * using in the whole testcase.
25*49cdfc7eSAndroid Build Coastguard Worker  */
26*49cdfc7eSAndroid Build Coastguard Worker extern const struct tst_arch {
27*49cdfc7eSAndroid Build Coastguard Worker         char name[16];
28*49cdfc7eSAndroid Build Coastguard Worker         enum tst_arch_type type;
29*49cdfc7eSAndroid Build Coastguard Worker } tst_arch;
30*49cdfc7eSAndroid Build Coastguard Worker 
31*49cdfc7eSAndroid Build Coastguard Worker /*
32*49cdfc7eSAndroid Build Coastguard Worker  * Check if test platform is in the given arch list. If yes return 1,
33*49cdfc7eSAndroid Build Coastguard Worker  * otherwise return 0.
34*49cdfc7eSAndroid Build Coastguard Worker  *
35*49cdfc7eSAndroid Build Coastguard Worker  * @archlist A NULL terminated array of architectures to support.
36*49cdfc7eSAndroid Build Coastguard Worker  */
37*49cdfc7eSAndroid Build Coastguard Worker int tst_is_on_arch(const char *const *archlist);
38*49cdfc7eSAndroid Build Coastguard Worker 
39*49cdfc7eSAndroid Build Coastguard Worker #endif /* TST_ARCH_H__ */
40