diff options
author | Kumar Gala <galak@freescale.com> | 2005-09-27 16:13:12 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-09-28 01:42:54 -0400 |
commit | 400d221274426958f1e1c7081a247bea9cede696 (patch) | |
tree | db0907bc14504d827b06b45004152b6610387b40 /include | |
parent | 10b35d9978ac35556aec0d2642055742d8941488 (diff) |
[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 <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/cputable.h | 16 | ||||
-rw-r--r-- | include/asm-powerpc/elf.h | 4 |
2 files changed, 1 insertions, 19 deletions
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index 5f81d44963f1..1e50efab091d 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
@@ -25,11 +25,7 @@ | |||
25 | struct cpu_spec; | 25 | struct cpu_spec; |
26 | struct op_powerpc_model; | 26 | struct op_powerpc_model; |
27 | 27 | ||
28 | #ifdef __powerpc64__ | ||
29 | typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); | 28 | typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); |
30 | #else /* __powerpc64__ */ | ||
31 | typedef void (*cpu_setup_t)(unsigned long offset, int cpu_nr, struct cpu_spec* spec); | ||
32 | #endif /* __powerpc64__ */ | ||
33 | 29 | ||
34 | struct cpu_spec { | 30 | struct cpu_spec { |
35 | /* CPU is matched via (PVR & pvr_mask) == pvr_value */ | 31 | /* CPU is matched via (PVR & pvr_mask) == pvr_value */ |
@@ -51,23 +47,15 @@ struct cpu_spec { | |||
51 | * BHT, SPD, etc... from head.S before branching to identify_machine | 47 | * BHT, SPD, etc... from head.S before branching to identify_machine |
52 | */ | 48 | */ |
53 | cpu_setup_t cpu_setup; | 49 | cpu_setup_t cpu_setup; |
54 | #ifdef __powerpc64__ | ||
55 | 50 | ||
56 | /* Used by oprofile userspace to select the right counters */ | 51 | /* Used by oprofile userspace to select the right counters */ |
57 | char *oprofile_cpu_type; | 52 | char *oprofile_cpu_type; |
58 | 53 | ||
59 | /* Processor specific oprofile operations */ | 54 | /* Processor specific oprofile operations */ |
60 | struct op_powerpc_model *oprofile_model; | 55 | struct op_powerpc_model *oprofile_model; |
61 | #endif /* __powerpc64__ */ | ||
62 | }; | 56 | }; |
63 | 57 | ||
64 | extern struct cpu_spec cpu_specs[]; | ||
65 | |||
66 | #ifdef __powerpc64__ | ||
67 | extern struct cpu_spec *cur_cpu_spec; | 58 | extern struct cpu_spec *cur_cpu_spec; |
68 | #else /* __powerpc64__ */ | ||
69 | extern struct cpu_spec *cur_cpu_spec[]; | ||
70 | #endif /* __powerpc64__ */ | ||
71 | 59 | ||
72 | #endif /* __ASSEMBLY__ */ | 60 | #endif /* __ASSEMBLY__ */ |
73 | 61 | ||
@@ -398,11 +386,7 @@ static inline int cpu_has_feature(unsigned long feature) | |||
398 | { | 386 | { |
399 | return (CPU_FTRS_ALWAYS & feature) || | 387 | return (CPU_FTRS_ALWAYS & feature) || |
400 | (CPU_FTRS_POSSIBLE | 388 | (CPU_FTRS_POSSIBLE |
401 | #ifndef __powerpc64__ | ||
402 | & cur_cpu_spec[0]->cpu_features | ||
403 | #else | ||
404 | & cur_cpu_spec->cpu_features | 389 | & cur_cpu_spec->cpu_features |
405 | #endif | ||
406 | & feature); | 390 | & feature); |
407 | } | 391 | } |
408 | 392 | ||
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index 36b9d5cec50c..f0a6779fbe52 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h | |||
@@ -212,15 +212,13 @@ extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); | |||
212 | /* ELF_HWCAP yields a mask that user programs can use to figure out what | 212 | /* ELF_HWCAP yields a mask that user programs can use to figure out what |
213 | instruction set this cpu supports. This could be done in userspace, | 213 | instruction set this cpu supports. This could be done in userspace, |
214 | but it's not easy, and we've already done it here. */ | 214 | but it's not easy, and we've already done it here. */ |
215 | #ifdef __powerpc64__ | ||
216 | # define ELF_HWCAP (cur_cpu_spec->cpu_user_features) | 215 | # define ELF_HWCAP (cur_cpu_spec->cpu_user_features) |
216 | #ifdef __powerpc64__ | ||
217 | # define ELF_PLAT_INIT(_r, load_addr) do { \ | 217 | # define ELF_PLAT_INIT(_r, load_addr) do { \ |
218 | memset(_r->gpr, 0, sizeof(_r->gpr)); \ | 218 | memset(_r->gpr, 0, sizeof(_r->gpr)); \ |
219 | _r->ctr = _r->link = _r->xer = _r->ccr = 0; \ | 219 | _r->ctr = _r->link = _r->xer = _r->ccr = 0; \ |
220 | _r->gpr[2] = load_addr; \ | 220 | _r->gpr[2] = load_addr; \ |
221 | } while (0) | 221 | } while (0) |
222 | #else | ||
223 | # define ELF_HWCAP (cur_cpu_spec[0]->cpu_user_features) | ||
224 | #endif /* __powerpc64__ */ | 222 | #endif /* __powerpc64__ */ |
225 | 223 | ||
226 | /* This yields a string that ld.so will use to load implementation | 224 | /* This yields a string that ld.so will use to load implementation |