diff options
Diffstat (limited to 'arch/m68k/include/asm/processor.h')
| -rw-r--r-- | arch/m68k/include/asm/processor.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h index f17c42aff7ff..ae700f49e51d 100644 --- a/arch/m68k/include/asm/processor.h +++ b/arch/m68k/include/asm/processor.h | |||
| @@ -100,6 +100,16 @@ struct thread_struct { | |||
| 100 | .fs = __KERNEL_DS, \ | 100 | .fs = __KERNEL_DS, \ |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | /* | ||
| 104 | * ColdFire stack format sbould be 0x4 for an aligned usp (will always be | ||
| 105 | * true on thread creation). We need to set this explicitly. | ||
| 106 | */ | ||
| 107 | #ifdef CONFIG_COLDFIRE | ||
| 108 | #define setframeformat(_regs) do { (_regs)->format = 0x4; } while(0) | ||
| 109 | #else | ||
| 110 | #define setframeformat(_regs) do { } while (0) | ||
| 111 | #endif | ||
| 112 | |||
| 103 | #ifdef CONFIG_MMU | 113 | #ifdef CONFIG_MMU |
| 104 | /* | 114 | /* |
| 105 | * Do necessary setup to start up a newly executed thread. | 115 | * Do necessary setup to start up a newly executed thread. |
| @@ -109,6 +119,7 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc, | |||
| 109 | { | 119 | { |
| 110 | regs->pc = pc; | 120 | regs->pc = pc; |
| 111 | regs->sr &= ~0x2000; | 121 | regs->sr &= ~0x2000; |
| 122 | setframeformat(regs); | ||
| 112 | wrusp(usp); | 123 | wrusp(usp); |
| 113 | } | 124 | } |
| 114 | 125 | ||
| @@ -116,21 +127,11 @@ extern int handle_kernel_fault(struct pt_regs *regs); | |||
| 116 | 127 | ||
| 117 | #else | 128 | #else |
| 118 | 129 | ||
| 119 | /* | ||
| 120 | * Coldfire stacks need to be re-aligned on trap exit, conventional | ||
| 121 | * 68k can handle this case cleanly. | ||
| 122 | */ | ||
| 123 | #ifdef CONFIG_COLDFIRE | ||
| 124 | #define reformat(_regs) do { (_regs)->format = 0x4; } while(0) | ||
| 125 | #else | ||
| 126 | #define reformat(_regs) do { } while (0) | ||
| 127 | #endif | ||
| 128 | |||
| 129 | #define start_thread(_regs, _pc, _usp) \ | 130 | #define start_thread(_regs, _pc, _usp) \ |
| 130 | do { \ | 131 | do { \ |
| 131 | (_regs)->pc = (_pc); \ | 132 | (_regs)->pc = (_pc); \ |
| 132 | ((struct switch_stack *)(_regs))[-1].a6 = 0; \ | 133 | ((struct switch_stack *)(_regs))[-1].a6 = 0; \ |
| 133 | reformat(_regs); \ | 134 | setframeformat(_regs); \ |
| 134 | if (current->mm) \ | 135 | if (current->mm) \ |
| 135 | (_regs)->d5 = current->mm->start_data; \ | 136 | (_regs)->d5 = current->mm->start_data; \ |
| 136 | (_regs)->sr &= ~0x2000; \ | 137 | (_regs)->sr &= ~0x2000; \ |
| @@ -153,8 +154,6 @@ static inline void release_thread(struct task_struct *dead_task) | |||
| 153 | { | 154 | { |
| 154 | } | 155 | } |
| 155 | 156 | ||
| 156 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | ||
| 157 | |||
| 158 | /* | 157 | /* |
| 159 | * Free current thread data structures etc.. | 158 | * Free current thread data structures etc.. |
| 160 | */ | 159 | */ |
