aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-01-13 18:11:39 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-13 18:11:39 -0500
commit80f15dc703b3677d0b025bafd215f1f3664c8978 (patch)
treefa60781edcedefe4eb6baa6d213a62bbc6d7803a /include
parent25cd6aa0aa059b48cdcef2a00981b14fafd5161a (diff)
powerpc: Provide a suitable AT_PLATFORM value
The glibc folks want to use AT_PLATFORM to select between possible alternative versions of shared libraries. This commit makes the kernel supply an AT_PLATFORM string that indicates what class of processor we are running on. Processors with the same set of user-level instructions and roughly the same instruction scheduling characteristics are given the same AT_PLATFORM value; for example, 821, 823 and 860 are all reported as "ppc823", and 7447, 7447A, 7448, 7450, 7451, 7455 are all called "ppc7450". The intention is that the AT_PLATFORM values match the values that gcc accepts for the -mcpu= option. For values which are numeric (e.g. -mcpu=750), "ppc" has been prepended. This also adds a PPC_FEATURE_BOOKE bit to the AT_HWCAP value and sets it for the 440 family and the Freescale 85xx family. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-powerpc/cputable.h4
-rw-r--r--include/asm-powerpc/elf.h16
2 files changed, 11 insertions, 9 deletions
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index ef6ead34a773..03017d905704 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -19,6 +19,7 @@
19#define PPC_FEATURE_POWER5 0x00040000 19#define PPC_FEATURE_POWER5 0x00040000
20#define PPC_FEATURE_POWER5_PLUS 0x00020000 20#define PPC_FEATURE_POWER5_PLUS 0x00020000
21#define PPC_FEATURE_CELL 0x00010000 21#define PPC_FEATURE_CELL 0x00010000
22#define PPC_FEATURE_BOOKE 0x00008000
22 23
23#ifdef __KERNEL__ 24#ifdef __KERNEL__
24#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
@@ -64,6 +65,9 @@ struct cpu_spec {
64 65
65 /* Processor specific oprofile operations */ 66 /* Processor specific oprofile operations */
66 enum powerpc_oprofile_type oprofile_type; 67 enum powerpc_oprofile_type oprofile_type;
68
69 /* Name of processor class, for the ELF AT_PLATFORM entry */
70 char *platform;
67}; 71};
68 72
69extern struct cpu_spec *cur_cpu_spec; 73extern struct cpu_spec *cur_cpu_spec;
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index 45f2af6f89c4..94d228f9c6ac 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -221,20 +221,18 @@ extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
221 instruction set this cpu supports. This could be done in userspace, 221 instruction set this cpu supports. This could be done in userspace,
222 but it's not easy, and we've already done it here. */ 222 but it's not easy, and we've already done it here. */
223# define ELF_HWCAP (cur_cpu_spec->cpu_user_features) 223# define ELF_HWCAP (cur_cpu_spec->cpu_user_features)
224#ifdef __powerpc64__
225# define ELF_PLAT_INIT(_r, load_addr) do { \
226 _r->gpr[2] = load_addr; \
227} while (0)
228#endif /* __powerpc64__ */
229 224
230/* This yields a string that ld.so will use to load implementation 225/* This yields a string that ld.so will use to load implementation
231 specific libraries for optimization. This is more specific in 226 specific libraries for optimization. This is more specific in
232 intent than poking at uname or /proc/cpuinfo. 227 intent than poking at uname or /proc/cpuinfo. */
233 228
234 For the moment, we have only optimizations for the Intel generations, 229#define ELF_PLATFORM (cur_cpu_spec->platform)
235 but that could change... */
236 230
237#define ELF_PLATFORM (NULL) 231#ifdef __powerpc64__
232# define ELF_PLAT_INIT(_r, load_addr) do { \
233 _r->gpr[2] = load_addr; \
234} while (0)
235#endif /* __powerpc64__ */
238 236
239#ifdef __KERNEL__ 237#ifdef __KERNEL__
240 238