diff options
Diffstat (limited to 'include/asm-sh/processor.h')
| -rw-r--r-- | include/asm-sh/processor.h | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index fa5bd2d8803e..474773853cd1 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h | |||
| @@ -9,10 +9,12 @@ | |||
| 9 | #define __ASM_SH_PROCESSOR_H | 9 | #define __ASM_SH_PROCESSOR_H |
| 10 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
| 11 | 11 | ||
| 12 | #include <linux/compiler.h> | ||
| 12 | #include <asm/page.h> | 13 | #include <asm/page.h> |
| 13 | #include <asm/types.h> | 14 | #include <asm/types.h> |
| 14 | #include <asm/cache.h> | 15 | #include <asm/cache.h> |
| 15 | #include <asm/ptrace.h> | 16 | #include <asm/ptrace.h> |
| 17 | #include <asm/cpu-features.h> | ||
| 16 | 18 | ||
| 17 | /* | 19 | /* |
| 18 | * Default implementation of macro that returns current | 20 | * Default implementation of macro that returns current |
| @@ -37,27 +39,30 @@ enum cpu_type { | |||
| 37 | CPU_SH7604, | 39 | CPU_SH7604, |
| 38 | 40 | ||
| 39 | /* SH-3 types */ | 41 | /* SH-3 types */ |
| 40 | CPU_SH7705, CPU_SH7707, CPU_SH7708, CPU_SH7708S, CPU_SH7708R, | 42 | CPU_SH7705, CPU_SH7706, CPU_SH7707, |
| 41 | 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, | ||
| 42 | 46 | ||
| 43 | /* SH-4 types */ | 47 | /* SH-4 types */ |
| 44 | CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, | 48 | CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, |
| 45 | 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, |
| 46 | CPU_SH73180, CPU_SH7770, CPU_SH7780, CPU_SH7781, | 50 | CPU_SH73180, CPU_SH7343, CPU_SH7770, CPU_SH7780, CPU_SH7781, |
| 47 | 51 | ||
| 48 | /* Unknown subtype */ | 52 | /* Unknown subtype */ |
| 49 | CPU_SH_NONE | 53 | CPU_SH_NONE |
| 50 | }; | 54 | }; |
| 51 | 55 | ||
| 52 | struct sh_cpuinfo { | 56 | struct sh_cpuinfo { |
| 53 | enum cpu_type type; | 57 | unsigned int type; |
| 54 | unsigned long loops_per_jiffy; | 58 | unsigned long loops_per_jiffy; |
| 55 | 59 | ||
| 56 | struct cache_info icache; | 60 | struct cache_info icache; /* Primary I-cache */ |
| 57 | struct cache_info dcache; | 61 | struct cache_info dcache; /* Primary D-cache */ |
| 62 | struct cache_info scache; /* Secondary cache */ | ||
| 58 | 63 | ||
| 59 | unsigned long flags; | 64 | unsigned long flags; |
| 60 | }; | 65 | } __attribute__ ((aligned(SMP_CACHE_BYTES))); |
| 61 | 66 | ||
| 62 | extern struct sh_cpuinfo boot_cpu_data; | 67 | extern struct sh_cpuinfo boot_cpu_data; |
| 63 | 68 | ||
| @@ -124,17 +129,6 @@ union sh_fpu_union { | |||
| 124 | struct sh_fpu_soft_struct soft; | 129 | struct sh_fpu_soft_struct soft; |
| 125 | }; | 130 | }; |
| 126 | 131 | ||
| 127 | /* | ||
| 128 | * Processor flags | ||
| 129 | */ | ||
| 130 | |||
| 131 | #define CPU_HAS_FPU 0x0001 /* Hardware FPU support */ | ||
| 132 | #define CPU_HAS_P2_FLUSH_BUG 0x0002 /* Need to flush the cache in P2 area */ | ||
| 133 | #define CPU_HAS_MMU_PAGE_ASSOC 0x0004 /* SH3: TLB way selection bit support */ | ||
| 134 | #define CPU_HAS_DSP 0x0008 /* SH-DSP: DSP support */ | ||
| 135 | #define CPU_HAS_PERF_COUNTER 0x0010 /* Hardware performance counters */ | ||
| 136 | #define CPU_HAS_PTEA 0x0020 /* PTEA register */ | ||
| 137 | |||
| 138 | struct thread_struct { | 132 | struct thread_struct { |
| 139 | unsigned long sp; | 133 | unsigned long sp; |
| 140 | unsigned long pc; | 134 | unsigned long pc; |
| @@ -148,6 +142,10 @@ struct thread_struct { | |||
| 148 | union sh_fpu_union fpu; | 142 | union sh_fpu_union fpu; |
| 149 | }; | 143 | }; |
| 150 | 144 | ||
| 145 | typedef struct { | ||
| 146 | unsigned long seg; | ||
| 147 | } mm_segment_t; | ||
| 148 | |||
| 151 | /* Count of active tasks with UBC settings */ | 149 | /* Count of active tasks with UBC settings */ |
| 152 | extern int ubc_usercnt; | 150 | extern int ubc_usercnt; |
| 153 | 151 | ||
| @@ -263,7 +261,26 @@ extern unsigned long get_wchan(struct task_struct *p); | |||
| 263 | #define KSTK_ESP(tsk) ((tsk)->thread.sp) | 261 | #define KSTK_ESP(tsk) ((tsk)->thread.sp) |
| 264 | 262 | ||
| 265 | #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") | 263 | #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") |
| 266 | #define cpu_relax() do { } while (0) | 264 | #define cpu_relax() barrier() |
| 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 | ||
| 271 | static 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 | ||
| 280 | extern int vsyscall_init(void); | ||
| 281 | #else | ||
| 282 | #define vsyscall_init() do { } while (0) | ||
| 283 | #endif | ||
| 267 | 284 | ||
| 268 | #endif /* __KERNEL__ */ | 285 | #endif /* __KERNEL__ */ |
| 269 | #endif /* __ASM_SH_PROCESSOR_H */ | 286 | #endif /* __ASM_SH_PROCESSOR_H */ |
