aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-12-10 01:50:28 -0500
committerPaul Mundt <lethal@linux-sh.org>2008-01-27 23:18:59 -0500
commitcd01204b82933754a7276838656420477f64d4b8 (patch)
treef9e3b11574bec04cda78c549cdc5c37c3c75c4a5 /include
parentc8c0a1aba9fa8f816dc8fb477ff816a5b700f0ea (diff)
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 'include')
-rw-r--r--include/asm-sh/auxvec.h12
-rw-r--r--include/asm-sh/elf.h19
-rw-r--r--include/asm-sh/system.h2
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 @@
15#define AT_SYSINFO_EHDR 33 15#define AT_SYSINFO_EHDR 33
16#endif 16#endif
17 17
18/*
19 * More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the
20 * value is -1, then the cache doesn't exist. Otherwise:
21 *
22 * bit 0-3: Cache set-associativity; 0 means fully associative.
23 * bit 4-7: Log2 of cacheline size.
24 * bit 8-31: Size of the entire cache >> 8.
25 */
26#define AT_L1I_CACHESHAPE 34
27#define AT_L1D_CACHESHAPE 35
28#define AT_L2_CACHESHAPE 36
29
18#endif /* __ASM_SH_AUXVEC_H */ 30#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;
161#define VDSO_BASE ((unsigned long)current->mm->context.vdso) 161#define VDSO_BASE ((unsigned long)current->mm->context.vdso)
162#define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x)) 162#define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x))
163 163
164#define VSYSCALL_AUX_ENT \
165 if (vdso_enabled) \
166 NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);
167#else
168#define VSYSCALL_AUX_ENT
169#endif /* CONFIG_VSYSCALL */
170
171extern int l1i_cache_shape, l1d_cache_shape, l2_cache_shape;
172
164/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ 173/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
165#define ARCH_DLINFO \ 174#define ARCH_DLINFO \
166do { \ 175do { \
167 if (vdso_enabled) \ 176 /* Optional vsyscall entry */ \
168 NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \ 177 VSYSCALL_AUX_ENT \
178 \
179 /* Cache desc */ \
180 NEW_AUX_ENT(AT_L1I_CACHESHAPE, l1i_cache_shape); \
181 NEW_AUX_ENT(AT_L1D_CACHESHAPE, l1d_cache_shape); \
182 NEW_AUX_ENT(AT_L2_CACHESHAPE, l2_cache_shape); \
169} while (0) 183} while (0)
170#endif /* CONFIG_VSYSCALL */
171 184
172#endif /* __ASM_SH_ELF_H */ 185#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 @@
12#include <asm/types.h> 12#include <asm/types.h>
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14 14
15#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ 15#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */
16 16
17#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5) 17#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
18#define __icbi() \ 18#define __icbi() \