mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[PATCH] ppc32: make cur_cpu_spec a single pointer instead of an array
Changed ppc32 so that cur_cpu_spec is just a single pointer for all CPUs. Additionally, made call_setup_cpu check to see if the cpu_setup pointer is NULL or not before calling the function. This lets remove the dummy cpu_setup calls that just return. Signed-off-by: Kumar Gala <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
This commit is contained in:
parent
10b35d9978
commit
400d221274
15 changed files with 43 additions and 88 deletions
|
|
@ -25,11 +25,7 @@
|
|||
struct cpu_spec;
|
||||
struct op_powerpc_model;
|
||||
|
||||
#ifdef __powerpc64__
|
||||
typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec);
|
||||
#else /* __powerpc64__ */
|
||||
typedef void (*cpu_setup_t)(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
|
||||
#endif /* __powerpc64__ */
|
||||
|
||||
struct cpu_spec {
|
||||
/* CPU is matched via (PVR & pvr_mask) == pvr_value */
|
||||
|
|
@ -51,23 +47,15 @@ struct cpu_spec {
|
|||
* BHT, SPD, etc... from head.S before branching to identify_machine
|
||||
*/
|
||||
cpu_setup_t cpu_setup;
|
||||
#ifdef __powerpc64__
|
||||
|
||||
/* Used by oprofile userspace to select the right counters */
|
||||
char *oprofile_cpu_type;
|
||||
|
||||
/* Processor specific oprofile operations */
|
||||
struct op_powerpc_model *oprofile_model;
|
||||
#endif /* __powerpc64__ */
|
||||
};
|
||||
|
||||
extern struct cpu_spec cpu_specs[];
|
||||
|
||||
#ifdef __powerpc64__
|
||||
extern struct cpu_spec *cur_cpu_spec;
|
||||
#else /* __powerpc64__ */
|
||||
extern struct cpu_spec *cur_cpu_spec[];
|
||||
#endif /* __powerpc64__ */
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
|
|
@ -398,11 +386,7 @@ static inline int cpu_has_feature(unsigned long feature)
|
|||
{
|
||||
return (CPU_FTRS_ALWAYS & feature) ||
|
||||
(CPU_FTRS_POSSIBLE
|
||||
#ifndef __powerpc64__
|
||||
& cur_cpu_spec[0]->cpu_features
|
||||
#else
|
||||
& cur_cpu_spec->cpu_features
|
||||
#endif
|
||||
& feature);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -212,15 +212,13 @@ extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
|
|||
/* ELF_HWCAP yields a mask that user programs can use to figure out what
|
||||
instruction set this cpu supports. This could be done in userspace,
|
||||
but it's not easy, and we've already done it here. */
|
||||
#ifdef __powerpc64__
|
||||
# define ELF_HWCAP (cur_cpu_spec->cpu_user_features)
|
||||
#ifdef __powerpc64__
|
||||
# define ELF_PLAT_INIT(_r, load_addr) do { \
|
||||
memset(_r->gpr, 0, sizeof(_r->gpr)); \
|
||||
_r->ctr = _r->link = _r->xer = _r->ccr = 0; \
|
||||
_r->gpr[2] = load_addr; \
|
||||
} while (0)
|
||||
#else
|
||||
# define ELF_HWCAP (cur_cpu_spec[0]->cpu_user_features)
|
||||
#endif /* __powerpc64__ */
|
||||
|
||||
/* This yields a string that ld.so will use to load implementation
|
||||
|
|
|
|||
Loading…
Reference in a new issue