2 * Copyright (C) 2006 Atmark Techno, Inc.
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
9 #ifndef _ASM_MICROBLAZE_SYSTEM_H
10 #define _ASM_MICROBLAZE_SYSTEM_H
12 #include <asm/registers.h>
13 #include <asm/setup.h>
14 #include <asm/irqflags.h>
19 extern struct task_struct *_switch_to(struct thread_info *prev,
20 struct thread_info *next);
22 #define switch_to(prev, next, last) \
24 (last) = _switch_to(task_thread_info(prev), \
25 task_thread_info(next)); \
28 #define smp_read_barrier_depends() do {} while (0)
29 #define read_barrier_depends() do {} while (0)
31 #define nop() asm volatile ("nop")
32 #define mb() barrier()
35 #define set_mb(var, value) do { var = value; mb(); } while (0)
36 #define set_wmb(var, value) do { var = value; wmb(); } while (0)
39 #define smp_rmb() rmb()
40 #define smp_wmb() wmb()
42 void show_trace(struct task_struct *task, unsigned long *stack);
43 void __bad_xchg(volatile void *ptr, int size);
45 static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
53 local_irq_save(flags);
54 ret = *(volatile unsigned char *)ptr;
55 *(volatile unsigned char *)ptr = x;
56 local_irq_restore(flags);
60 local_irq_save(flags);
61 ret = *(volatile unsigned long *)ptr;
62 *(volatile unsigned long *)ptr = x;
63 local_irq_restore(flags);
66 __bad_xchg(ptr, size), ret = 0;
73 void disable_hlt(void);
74 void enable_hlt(void);
75 void default_idle(void);
77 #define xchg(ptr, x) \
78 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
80 void free_init_pages(char *what, unsigned long begin, unsigned long end);
81 void free_initmem(void);
83 extern void ret_from_fork(void);
85 #ifdef CONFIG_DEBUG_FS
86 extern struct dentry *of_debugfs_root;
89 #define arch_align_stack(x) (x)
91 #endif /* _ASM_MICROBLAZE_SYSTEM_H */