1 #ifndef _ASM_SCORE_SYSTEM_H
2 #define _ASM_SCORE_SYSTEM_H
4 #include <linux/types.h>
5 #include <linux/irqflags.h>
10 extern void *resume(void *last
, void *next
, void *next_ti
);
12 #define switch_to(prev, next, last) \
14 (last) = resume(prev, next, task_thread_info(next)); \
17 #define finish_arch_switch(prev) do {} while (0)
19 typedef void (*vi_handler_t
)(void);
20 extern unsigned long arch_align_stack(unsigned long sp
);
22 #define mb() barrier()
23 #define rmb() barrier()
24 #define wmb() barrier()
25 #define smp_mb() barrier()
26 #define smp_rmb() barrier()
27 #define smp_wmb() barrier()
29 #define read_barrier_depends() do {} while (0)
30 #define smp_read_barrier_depends() do {} while (0)
32 #define set_mb(var, value) do {var = value; wmb(); } while (0)
34 #define __HAVE_ARCH_CMPXCHG 1
36 #include <asm-generic/cmpxchg-local.h>
40 struct __xchg_dummy
{ unsigned long a
[100]; };
41 #define __xg(x) ((struct __xchg_dummy *)(x))
44 unsigned long __xchg(volatile unsigned long *m
, unsigned long val
)
49 local_irq_save(flags
);
52 local_irq_restore(flags
);
56 #define xchg(ptr, v) \
57 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
60 static inline unsigned long __cmpxchg(volatile unsigned long *m
,
61 unsigned long old
, unsigned long new)
66 local_irq_save(flags
);
70 local_irq_restore(flags
);
74 #define cmpxchg(ptr, o, n) \
75 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
79 extern void __die(const char *, struct pt_regs
*, const char *,
80 const char *, unsigned long) __attribute__((noreturn
));
81 extern void __die_if_kernel(const char *, struct pt_regs
*, const char *,
82 const char *, unsigned long);
84 #define die(msg, regs) \
85 __die(msg, regs, __FILE__ ":", __func__, __LINE__)
86 #define die_if_kernel(msg, regs) \
87 __die_if_kernel(msg, regs, __FILE__ ":", __func__, __LINE__)
89 #endif /* !__ASSEMBLY__ */
90 #endif /* _ASM_SCORE_SYSTEM_H */