29#ifndef _LIBCPU_CPUIDENT_H
30#define _LIBCPU_CPUIDENT_H
91 unsigned has_altivec : 1;
93 unsigned has_hw_ptbl_lkup : 1;
94#define PPC_BOOKE_405 1
95#define PPC_BOOKE_STD 2
96#define PPC_BOOKE_E500 3
97 unsigned is_bookE : 2;
98 unsigned has_16byte_clne : 1;
100 unsigned has_8_bats : 1;
101 unsigned has_epic : 1;
102 unsigned has_shadowed_gprs : 1;
106extern ppc_cpu_id_t current_ppc_cpu;
108typedef unsigned short ppc_cpu_revision_t;
110extern ppc_cpu_id_t get_ppc_cpu_type (
void);
111extern const char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu);
112extern ppc_cpu_revision_t get_ppc_cpu_revision (
void);
113extern ppc_cpu_revision_t current_ppc_revision;
116#define _PPC_FEAT_DECL(x) \
117static inline unsigned ppc_cpu_##x(void) { \
118 if ( PPC_UNKNOWN == current_ppc_cpu ) \
119 get_ppc_cpu_type(); \
120 return current_ppc_features.x; \
123_PPC_FEAT_DECL(has_altivec)
125_PPC_FEAT_DECL(has_hw_ptbl_lkup)
126_PPC_FEAT_DECL(is_bookE)
127_PPC_FEAT_DECL(is_60x)
128_PPC_FEAT_DECL(has_8_bats)
129_PPC_FEAT_DECL(has_epic)
130_PPC_FEAT_DECL(has_shadowed_gprs)
134static inline ppc_cpu_id_t ppc_cpu_current(
void)
136 return current_ppc_cpu;
139static inline bool ppc_cpu_is_e200(
void)
141 return (ppc_cpu_current() & 0xff80) == 0x8100;
144static inline bool ppc_cpu_is_specific_e200(ppc_cpu_id_t
id)
146 return (ppc_cpu_current() & 0xfff0) == id;
149static inline bool ppc_cpu_is_e300(
void)
151 return ppc_cpu_current() == PPC_e300c1
152 || ppc_cpu_current() == PPC_e300c2
153 || ppc_cpu_current() == PPC_e300c3;
156static inline bool ppc_cpu_is_e500(
void)
158 return ppc_cpu_current() == PPC_8540
159 || ppc_cpu_current() == PPC_e500v2;
162static inline bool ppc_cpu_is(ppc_cpu_id_t cpu)
164 return ppc_cpu_current() == cpu;
Definition: cpuIdent.h:90