14 #ifndef _LIBCPU_CPUIDENT_H 15 #define _LIBCPU_CPUIDENT_H 76 unsigned has_altivec : 1;
78 unsigned has_hw_ptbl_lkup : 1;
79 #define PPC_BOOKE_405 1 80 #define PPC_BOOKE_STD 2 81 #define PPC_BOOKE_E500 3 82 unsigned is_bookE : 2;
83 unsigned has_16byte_clne : 1;
85 unsigned has_8_bats : 1;
86 unsigned has_epic : 1;
87 unsigned has_shadowed_gprs : 1;
91 extern ppc_cpu_id_t current_ppc_cpu;
93 typedef unsigned short ppc_cpu_revision_t;
95 extern ppc_cpu_id_t get_ppc_cpu_type (
void);
96 extern const char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu);
97 extern ppc_cpu_revision_t get_ppc_cpu_revision (
void);
98 extern ppc_cpu_revision_t current_ppc_revision;
101 #define _PPC_FEAT_DECL(x) \ 102 static inline unsigned ppc_cpu_##x(void) { \ 103 if ( PPC_UNKNOWN == current_ppc_cpu ) \ 104 get_ppc_cpu_type(); \ 105 return current_ppc_features.x; \ 108 _PPC_FEAT_DECL(has_altivec)
110 _PPC_FEAT_DECL(has_hw_ptbl_lkup)
111 _PPC_FEAT_DECL(is_bookE)
112 _PPC_FEAT_DECL(is_60x)
113 _PPC_FEAT_DECL(has_8_bats)
114 _PPC_FEAT_DECL(has_epic)
115 _PPC_FEAT_DECL(has_shadowed_gprs)
117 #undef _PPC_FEAT_DECL 119 static inline ppc_cpu_id_t ppc_cpu_current(
void)
121 return current_ppc_cpu;
124 static inline bool ppc_cpu_is_e200(
void)
126 return (ppc_cpu_current() & 0xff80) == 0x8100;
129 static inline bool ppc_cpu_is_specific_e200(ppc_cpu_id_t
id)
131 return (ppc_cpu_current() & 0xfff0) == id;
134 static inline bool ppc_cpu_is_e300(
void)
136 return ppc_cpu_current() == PPC_e300c1
137 || ppc_cpu_current() == PPC_e300c2
138 || ppc_cpu_current() == PPC_e300c3;
141 static inline bool ppc_cpu_is_e500(
void)
143 return ppc_cpu_current() == PPC_8540
144 || ppc_cpu_current() == PPC_e500v2;
147 static inline bool ppc_cpu_is(ppc_cpu_id_t cpu)
149 return ppc_cpu_current() == cpu;
Definition: cpuIdent.h:75