diff options
Diffstat (limited to 'arch/microblaze/kernel/process.c')
-rw-r--r-- | arch/microblaze/kernel/process.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c index 436f26ccbfa9..07d4fa339eda 100644 --- a/arch/microblaze/kernel/process.c +++ b/arch/microblaze/kernel/process.c | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | void show_regs(struct pt_regs *regs) | 19 | void show_regs(struct pt_regs *regs) |
20 | { | 20 | { |
21 | printk(KERN_INFO " Registers dump: mode=%X\r\n", regs->kernel_mode); | 21 | printk(KERN_INFO " Registers dump: mode=%X\r\n", regs->pt_mode); |
22 | printk(KERN_INFO " r1=%08lX, r2=%08lX, r3=%08lX, r4=%08lX\n", | 22 | printk(KERN_INFO " r1=%08lX, r2=%08lX, r3=%08lX, r4=%08lX\n", |
23 | regs->r1, regs->r2, regs->r3, regs->r4); | 23 | regs->r1, regs->r2, regs->r3, regs->r4); |
24 | printk(KERN_INFO " r5=%08lX, r6=%08lX, r7=%08lX, r8=%08lX\n", | 24 | printk(KERN_INFO " r5=%08lX, r6=%08lX, r7=%08lX, r8=%08lX\n", |
@@ -37,8 +37,6 @@ void show_regs(struct pt_regs *regs) | |||
37 | regs->r29, regs->r30, regs->r31, regs->pc); | 37 | regs->r29, regs->r30, regs->r31, regs->pc); |
38 | printk(KERN_INFO " msr=%08lX, ear=%08lX, esr=%08lX, fsr=%08lX\n", | 38 | printk(KERN_INFO " msr=%08lX, ear=%08lX, esr=%08lX, fsr=%08lX\n", |
39 | regs->msr, regs->ear, regs->esr, regs->fsr); | 39 | regs->msr, regs->ear, regs->esr, regs->fsr); |
40 | while (1) | ||
41 | ; | ||
42 | } | 40 | } |
43 | 41 | ||
44 | void (*pm_idle)(void); | 42 | void (*pm_idle)(void); |
@@ -163,7 +161,6 @@ static void kernel_thread_helper(int (*fn)(void *), void *arg) | |||
163 | int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | 161 | int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) |
164 | { | 162 | { |
165 | struct pt_regs regs; | 163 | struct pt_regs regs; |
166 | int ret; | ||
167 | 164 | ||
168 | memset(®s, 0, sizeof(regs)); | 165 | memset(®s, 0, sizeof(regs)); |
169 | /* store them in non-volatile registers */ | 166 | /* store them in non-volatile registers */ |
@@ -171,12 +168,10 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | |||
171 | regs.r6 = (unsigned long)arg; | 168 | regs.r6 = (unsigned long)arg; |
172 | local_save_flags(regs.msr); | 169 | local_save_flags(regs.msr); |
173 | regs.pc = (unsigned long)kernel_thread_helper; | 170 | regs.pc = (unsigned long)kernel_thread_helper; |
174 | regs.kernel_mode = 1; | 171 | regs.pt_mode = 1; |
175 | 172 | ||
176 | ret = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, | 173 | return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, |
177 | ®s, 0, NULL, NULL); | 174 | ®s, 0, NULL, NULL); |
178 | |||
179 | return ret; | ||
180 | } | 175 | } |
181 | 176 | ||
182 | unsigned long get_wchan(struct task_struct *p) | 177 | unsigned long get_wchan(struct task_struct *p) |
@@ -184,3 +179,12 @@ unsigned long get_wchan(struct task_struct *p) | |||
184 | /* TBD (used by procfs) */ | 179 | /* TBD (used by procfs) */ |
185 | return 0; | 180 | return 0; |
186 | } | 181 | } |
182 | |||
183 | /* Set up a thread for executing a new program */ | ||
184 | void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp) | ||
185 | { | ||
186 | set_fs(USER_DS); | ||
187 | regs->pc = pc; | ||
188 | regs->r1 = usp; | ||
189 | regs->pt_mode = 0; | ||
190 | } | ||