diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-12-10 07:50:28 +0100 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-28 05:18:59 +0100 |
commit | cd01204b82933754a7276838656420477f64d4b8 (patch) | |
tree | f9e3b11574bec04cda78c549cdc5c37c3c75c4a5 /include | |
parent | sh: Support denormalization on SH-4 FPU. (diff) | |
download | linux-cd01204b82933754a7276838656420477f64d4b8.tar.xz linux-cd01204b82933754a7276838656420477f64d4b8.zip |
sh: Encode L1/L2 cache shape in auxvt.
This adds in the L1I/L1D/L2 cache shape support to their respective
entries in the ELF auxvt, based on the Alpha implementation. We use
this on the userspace libc side for calculating a tightly packed
SHMLBA amongst other things.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to '')
-rw-r--r-- | include/asm-sh/auxvec.h | 12 | ||||
-rw-r--r-- | include/asm-sh/elf.h | 19 | ||||
-rw-r--r-- | include/asm-sh/system.h | 2 |
3 files changed, 29 insertions, 4 deletions
diff --git a/include/asm-sh/auxvec.h b/include/asm-sh/auxvec.h index 1b6916e63e90..4069858f8131 100644 --- a/include/asm-sh/auxvec.h +++ b/include/asm-sh/auxvec.h @@ -15,4 +15,16 @@ #define AT_SYSINFO_EHDR 33 #endif +/* + * More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the + * value is -1, then the cache doesn't exist. Otherwise: + * + * bit 0-3: Cache set-associativity; 0 means fully associative. + * bit 4-7: Log2 of cacheline size. + * bit 8-31: Size of the entire cache >> 8. + */ +#define AT_L1I_CACHESHAPE 34 +#define AT_L1D_CACHESHAPE 35 +#define AT_L2_CACHESHAPE 36 + #endif /* __ASM_SH_AUXVEC_H */ diff --git a/include/asm-sh/elf.h b/include/asm-sh/elf.h index 5a1e920f0598..61960408e6ef 100644 --- a/include/asm-sh/elf.h +++ b/include/asm-sh/elf.h @@ -161,12 +161,25 @@ extern void __kernel_vsyscall; #define VDSO_BASE ((unsigned long)current->mm->context.vdso) #define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x)) +#define VSYSCALL_AUX_ENT \ + if (vdso_enabled) \ + NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); +#else +#define VSYSCALL_AUX_ENT +#endif /* CONFIG_VSYSCALL */ + +extern int l1i_cache_shape, l1d_cache_shape, l2_cache_shape; + /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ #define ARCH_DLINFO \ do { \ - if (vdso_enabled) \ - NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \ + /* Optional vsyscall entry */ \ + VSYSCALL_AUX_ENT \ + \ + /* Cache desc */ \ + NEW_AUX_ENT(AT_L1I_CACHESHAPE, l1i_cache_shape); \ + NEW_AUX_ENT(AT_L1D_CACHESHAPE, l1d_cache_shape); \ + NEW_AUX_ENT(AT_L2_CACHESHAPE, l2_cache_shape); \ } while (0) -#endif /* CONFIG_VSYSCALL */ #endif /* __ASM_SH_ELF_H */ diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index 9bda8d063ecf..84592555ba2a 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h @@ -12,7 +12,7 @@ #include <asm/types.h> #include <asm/ptrace.h> -#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ +#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */ #if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5) #define __icbi() \ |