aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m68knommu/processor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-m68knommu/processor.h')
-rw-r--r--include/asm-m68knommu/processor.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h
index 278b00bc60c5..9d3a1bf41231 100644
--- a/include/asm-m68knommu/processor.h
+++ b/include/asm-m68knommu/processor.h
@@ -13,6 +13,7 @@
13 */ 13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15 15
16#include <linux/compiler.h>
16#include <linux/threads.h> 17#include <linux/threads.h>
17#include <asm/types.h> 18#include <asm/types.h>
18#include <asm/segment.h> 19#include <asm/segment.h>
@@ -78,19 +79,31 @@ struct thread_struct {
78} 79}
79 80
80/* 81/*
82 * Coldfire stacks need to be re-aligned on trap exit, conventional
83 * 68k can handle this case cleanly.
84 */
85#if defined(CONFIG_COLDFIRE)
86#define reformat(_regs) do { (_regs)->format = 0x4; } while(0)
87#else
88#define reformat(_regs) do { } while (0)
89#endif
90
91/*
81 * Do necessary setup to start up a newly executed thread. 92 * Do necessary setup to start up a newly executed thread.
82 * 93 *
83 * pass the data segment into user programs if it exists, 94 * pass the data segment into user programs if it exists,
84 * it can't hurt anything as far as I can tell 95 * it can't hurt anything as far as I can tell
85 */ 96 */
86#define start_thread(_regs, _pc, _usp) \ 97#define start_thread(_regs, _pc, _usp) \
87do { \ 98do { \
88 set_fs(USER_DS); /* reads from user space */ \ 99 set_fs(USER_DS); /* reads from user space */ \
89 (_regs)->pc = (_pc); \ 100 (_regs)->pc = (_pc); \
90 if (current->mm) \ 101 ((struct switch_stack *)(_regs))[-1].a6 = 0; \
91 (_regs)->d5 = current->mm->start_data; \ 102 reformat(_regs); \
92 (_regs)->sr &= ~0x2000; \ 103 if (current->mm) \
93 wrusp(_usp); \ 104 (_regs)->d5 = current->mm->start_data; \
105 (_regs)->sr &= ~0x2000; \
106 wrusp(_usp); \
94} while(0) 107} while(0)
95 108
96/* Forward declaration, a strange C thing */ 109/* Forward declaration, a strange C thing */
@@ -125,6 +138,6 @@ unsigned long get_wchan(struct task_struct *p);
125 eip; }) 138 eip; })
126#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 139#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
127 140
128#define cpu_relax() do { } while (0) 141#define cpu_relax() barrier()
129 142
130#endif 143#endif