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;
91extern ppc_cpu_id_t current_ppc_cpu;
93typedef unsigned short ppc_cpu_revision_t;
95extern ppc_cpu_id_t get_ppc_cpu_type (
void);
96extern const char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu);
97extern ppc_cpu_revision_t get_ppc_cpu_revision (
void);
98extern ppc_cpu_revision_t current_ppc_revision;
101#define _PPC_FEAT_DECL(x) \
102static 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)
119static inline ppc_cpu_id_t ppc_cpu_current(
void)
121 return current_ppc_cpu;
124static inline bool ppc_cpu_is_e200(
void)
126 return (ppc_cpu_current() & 0xff80) == 0x8100;
129static inline bool ppc_cpu_is_specific_e200(ppc_cpu_id_t
id)
131 return (ppc_cpu_current() & 0xfff0) == id;
134static 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;
141static inline bool ppc_cpu_is_e500(
void)
143 return ppc_cpu_current() == PPC_8540
144 || ppc_cpu_current() == PPC_e500v2;
147static inline bool ppc_cpu_is(ppc_cpu_id_t cpu)
149 return ppc_cpu_current() == cpu;
Definition: cpuIdent.h:75