aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/processor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/processor.h')
-rw-r--r--include/asm-sh/processor.h52
1 files changed, 34 insertions, 18 deletions
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index eeb0f48bb99e..474773853cd1 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -14,6 +14,7 @@
14#include <asm/types.h> 14#include <asm/types.h>
15#include <asm/cache.h> 15#include <asm/cache.h>
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/cpu-features.h>
17 18
18/* 19/*
19 * Default implementation of macro that returns current 20 * Default implementation of macro that returns current
@@ -38,27 +39,30 @@ enum cpu_type {
38 CPU_SH7604, 39 CPU_SH7604,
39 40
40 /* SH-3 types */ 41 /* SH-3 types */
41 CPU_SH7705, CPU_SH7707, CPU_SH7708, CPU_SH7708S, CPU_SH7708R, 42 CPU_SH7705, CPU_SH7706, CPU_SH7707,
42 CPU_SH7709, CPU_SH7709A, CPU_SH7729, CPU_SH7300, 43 CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
44 CPU_SH7709, CPU_SH7709A, CPU_SH7710,
45 CPU_SH7729, CPU_SH7300,
43 46
44 /* SH-4 types */ 47 /* SH-4 types */
45 CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, 48 CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
46 CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, 49 CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501,
47 CPU_SH73180, CPU_SH7770, CPU_SH7780, CPU_SH7781, 50 CPU_SH73180, CPU_SH7343, CPU_SH7770, CPU_SH7780, CPU_SH7781,
48 51
49 /* Unknown subtype */ 52 /* Unknown subtype */
50 CPU_SH_NONE 53 CPU_SH_NONE
51}; 54};
52 55
53struct sh_cpuinfo { 56struct sh_cpuinfo {
54 enum cpu_type type; 57 unsigned int type;
55 unsigned long loops_per_jiffy; 58 unsigned long loops_per_jiffy;
56 59
57 struct cache_info icache; 60 struct cache_info icache; /* Primary I-cache */
58 struct cache_info dcache; 61 struct cache_info dcache; /* Primary D-cache */
62 struct cache_info scache; /* Secondary cache */
59 63
60 unsigned long flags; 64 unsigned long flags;
61}; 65} __attribute__ ((aligned(SMP_CACHE_BYTES)));
62 66
63extern struct sh_cpuinfo boot_cpu_data; 67extern struct sh_cpuinfo boot_cpu_data;
64 68
@@ -125,17 +129,6 @@ union sh_fpu_union {
125 struct sh_fpu_soft_struct soft; 129 struct sh_fpu_soft_struct soft;
126}; 130};
127 131
128/*
129 * Processor flags
130 */
131
132#define CPU_HAS_FPU 0x0001 /* Hardware FPU support */
133#define CPU_HAS_P2_FLUSH_BUG 0x0002 /* Need to flush the cache in P2 area */
134#define CPU_HAS_MMU_PAGE_ASSOC 0x0004 /* SH3: TLB way selection bit support */
135#define CPU_HAS_DSP 0x0008 /* SH-DSP: DSP support */
136#define CPU_HAS_PERF_COUNTER 0x0010 /* Hardware performance counters */
137#define CPU_HAS_PTEA 0x0020 /* PTEA register */
138
139struct thread_struct { 132struct thread_struct {
140 unsigned long sp; 133 unsigned long sp;
141 unsigned long pc; 134 unsigned long pc;
@@ -149,6 +142,10 @@ struct thread_struct {
149 union sh_fpu_union fpu; 142 union sh_fpu_union fpu;
150}; 143};
151 144
145typedef struct {
146 unsigned long seg;
147} mm_segment_t;
148
152/* Count of active tasks with UBC settings */ 149/* Count of active tasks with UBC settings */
153extern int ubc_usercnt; 150extern int ubc_usercnt;
154 151
@@ -266,5 +263,24 @@ extern unsigned long get_wchan(struct task_struct *p);
266#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") 263#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
267#define cpu_relax() barrier() 264#define cpu_relax() barrier()
268 265
266#if defined(CONFIG_CPU_SH2A) || defined(CONFIG_CPU_SH3) || \
267 defined(CONFIG_CPU_SH4)
268#define PREFETCH_STRIDE L1_CACHE_BYTES
269#define ARCH_HAS_PREFETCH
270#define ARCH_HAS_PREFETCHW
271static inline void prefetch(void *x)
272{
273 __asm__ __volatile__ ("pref @%0\n\t" : : "r" (x) : "memory");
274}
275
276#define prefetchw(x) prefetch(x)
277#endif
278
279#ifdef CONFIG_VSYSCALL
280extern int vsyscall_init(void);
281#else
282#define vsyscall_init() do { } while (0)
283#endif
284
269#endif /* __KERNEL__ */ 285#endif /* __KERNEL__ */
270#endif /* __ASM_SH_PROCESSOR_H */ 286#endif /* __ASM_SH_PROCESSOR_H */