X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-sh%2Fsystem.h;h=24504253720529433225b41abe9fe9647f449492;hb=7616ee95f27a04fd5a6434e9ef4a82cec4b2807c;hp=127af304865febb1d5605412b5c17bfddc7c9624;hpb=02bbc0f09c90cefdb2837605c96a66c5ce4ba2e1;p=linux-2.6 diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index 127af30486..2450425372 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h @@ -8,9 +8,13 @@ #include #include +#include #include #include +struct task_struct *__switch_to(struct task_struct *prev, + struct task_struct *next); + /* * switch_to() should switch tasks to task nr n, first */ @@ -60,16 +64,6 @@ last = __last; \ } while (0) -/* - * On SMP systems, when the scheduler does migration-cost autodetection, - * it needs a way to flush as much of the CPU's caches as possible. - * - * TODO: fill this in! - */ -static inline void sched_cacheflush(void) -{ -} - #ifdef CONFIG_CPU_SH4A #define __icbi() \ { \ @@ -82,16 +76,6 @@ static inline void sched_cacheflush(void) } #endif -static inline unsigned long tas(volatile int *m) -{ - unsigned long retval; - - __asm__ __volatile__ ("tas.b @%1\n\t" - "movt %0" - : "=r" (retval): "r" (m): "t", "memory"); - return retval; -} - /* * A brief note on ctrl_barrier(), the control register write barrier. * @@ -132,7 +116,7 @@ static inline unsigned long tas(volatile int *m) #define smp_read_barrier_depends() do { } while(0) #endif -#define set_mb(var, value) do { xchg(&var, value); } while (0) +#define set_mb(var, value) do { (void)xchg(&var, value); } while (0) /* * Jump to P2 area. @@ -265,6 +249,15 @@ static inline void *set_exception_table_evt(unsigned int evt, void *handler) return set_exception_table_vec(evt >> 5, handler); } +/* + * SH-2A has both 16 and 32-bit opcodes, do lame encoding checks. + */ +#ifdef CONFIG_CPU_SH2A +extern unsigned int instruction_size(unsigned int insn); +#else +#define instruction_size(insn) (2) +#endif + /* XXX * disable hlt during certain critical i/o operations */ @@ -272,6 +265,16 @@ static inline void *set_exception_table_evt(unsigned int evt, void *handler) void disable_hlt(void); void enable_hlt(void); +void default_idle(void); + +asmlinkage void break_point_trap(void); +asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7, + struct pt_regs __regs); +asmlinkage void bug_trap_handler(unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7, + struct pt_regs __regs); + #define arch_align_stack(x) (x) #endif