654155da2a8ea32e6b438a519f47bfd1ffb509e1
[iec.git] / src / type3_AndroidCloud / anbox-master / external / cpu_features / include / cpuinfo_ppc.h
1 // Copyright 2018 IBM
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef CPU_FEATURES_INCLUDE_CPUINFO_PPC_H_
16 #define CPU_FEATURES_INCLUDE_CPUINFO_PPC_H_
17
18 #include "cpu_features_macros.h"
19 #include "internal/hwcaps.h"
20
21 CPU_FEATURES_START_CPP_NAMESPACE
22
23 typedef struct {
24   int ppc32 : 1;
25   int ppc64 : 1;
26   int ppc601 : 1;
27   int altivec : 1;
28   int fpu : 1;
29   int mmu : 1;
30   int mac_4xx : 1;
31   int unifiedcache : 1;
32   int spe : 1;
33   int efpsingle : 1;
34   int efpdouble : 1;
35   int no_tb : 1;
36   int power4 : 1;
37   int power5 : 1;
38   int power5plus : 1;
39   int cell : 1;
40   int booke : 1;
41   int smt : 1;
42   int icachesnoop : 1;
43   int arch205 : 1;
44   int pa6t : 1;
45   int dfp : 1;
46   int power6ext : 1;
47   int arch206 : 1;
48   int vsx : 1;
49   int pseries_perfmon_compat : 1;
50   int truele : 1;
51   int ppcle : 1;
52   int arch207 : 1;
53   int htm : 1;
54   int dscr : 1;
55   int ebb : 1;
56   int isel : 1;
57   int tar : 1;
58   int vcrypto : 1;
59   int htm_nosc : 1;
60   int arch300 : 1;
61   int ieee128 : 1;
62   int darn : 1;
63   int scv : 1;
64   int htm_no_suspend : 1;
65
66   // Make sure to update PPCFeaturesEnum below if you add a field here.
67 } PPCFeatures;
68
69 typedef struct {
70   PPCFeatures features;
71 } PPCInfo;
72
73 // This function is guaranteed to be malloc, memset and memcpy free.
74 PPCInfo GetPPCInfo(void);
75
76 typedef struct {
77   char platform[64];  // 0 terminated string
78   char model[64];     // 0 terminated string
79   char machine[64];   // 0 terminated string
80   char cpu[64];       // 0 terminated string
81   PlatformType type;
82 } PPCPlatformStrings;
83
84 PPCPlatformStrings GetPPCPlatformStrings(void);
85
86 ////////////////////////////////////////////////////////////////////////////////
87 // Introspection functions
88
89 typedef enum {
90   PPC_32,          /* 32 bit mode execution */
91   PPC_64,          /* 64 bit mode execution */
92   PPC_601_INSTR,   /* Old POWER ISA */
93   PPC_HAS_ALTIVEC, /* SIMD Unit*/
94   PPC_HAS_FPU,     /* Floating Point Unit */
95   PPC_HAS_MMU,     /* Memory management unit */
96   PPC_HAS_4xxMAC,
97   PPC_UNIFIED_CACHE,  /* Unified instruction and data cache */
98   PPC_HAS_SPE,        /* Signal processing extention unit */
99   PPC_HAS_EFP_SINGLE, /* SPE single precision fpu */
100   PPC_HAS_EFP_DOUBLE, /* SPE double precision fpu */
101   PPC_NO_TB,          /* No timebase */
102   PPC_POWER4,
103   PPC_POWER5,
104   PPC_POWER5_PLUS,
105   PPC_CELL,  /* Cell broadband engine */
106   PPC_BOOKE, /* Embedded ISA */
107   PPC_SMT,   /* Simultaneous multi-threading */
108   PPC_ICACHE_SNOOP,
109   PPC_ARCH_2_05, /* ISA 2.05 - POWER6 */
110   PPC_PA6T,      /* PA Semi 6T core ISA */
111   PPC_HAS_DFP,   /* Decimal floating point unit */
112   PPC_POWER6_EXT,
113   PPC_ARCH_2_06,              /* ISA 2.06 - POWER7 */
114   PPC_HAS_VSX,                /* Vector-scalar extension */
115   PPC_PSERIES_PERFMON_COMPAT, /* Set of backwards compatibile performance
116                                  monitoring events */
117   PPC_TRUE_LE,
118   PPC_PPC_LE,
119   PPC_ARCH_2_07,      /* ISA 2.07 - POWER8 */
120   PPC_HTM,            /* Hardware Transactional Memory */
121   PPC_DSCR,           /* Data stream control register */
122   PPC_EBB,            /* Event base branching */
123   PPC_ISEL,           /* Integer select instructions */
124   PPC_TAR,            /* Target address register */
125   PPC_VEC_CRYPTO,     /* Vector cryptography instructions */
126   PPC_HTM_NOSC,       /* Transactions aborted when syscall made*/
127   PPC_ARCH_3_00,      /* ISA 3.00 - POWER9 */
128   PPC_HAS_IEEE128,    /* VSX IEEE Binary Float 128-bit */
129   PPC_DARN,           /* Deliver a random number instruction */
130   PPC_SCV,            /* scv syscall */
131   PPC_HTM_NO_SUSPEND, /* TM w/out suspended state */
132   PPC_LAST_,
133 } PPCFeaturesEnum;
134
135 int GetPPCFeaturesEnumValue(const PPCFeatures* features, PPCFeaturesEnum value);
136
137 const char* GetPPCFeaturesEnumName(PPCFeaturesEnum);
138
139 CPU_FEATURES_END_CPP_NAMESPACE
140
141 #endif  // CPU_FEATURES_INCLUDE_CPUINFO_PPC_H_