diff options
Diffstat (limited to 'arch/microblaze/kernel/process.c')
-rw-r--r-- | arch/microblaze/kernel/process.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c index 60e9ed7d3132..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); |
@@ -115,8 +113,7 @@ void flush_thread(void) | |||
115 | { | 113 | { |
116 | } | 114 | } |
117 | 115 | ||
118 | /* FIXME - here will be a proposed change -> remove nr parameter */ | 116 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
119 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | ||
120 | unsigned long unused, | 117 | unsigned long unused, |
121 | struct task_struct *p, struct pt_regs *regs) | 118 | struct task_struct *p, struct pt_regs *regs) |
122 | { | 119 | { |
@@ -164,7 +161,6 @@ static void kernel_thread_helper(int (*fn)(void *), void *arg) | |||
164 | int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | 161 | int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) |
165 | { | 162 | { |
166 | struct pt_regs regs; | 163 | struct pt_regs regs; |
167 | int ret; | ||
168 | 164 | ||
169 | memset(®s, 0, sizeof(regs)); | 165 | memset(®s, 0, sizeof(regs)); |
170 | /* store them in non-volatile registers */ | 166 | /* store them in non-volatile registers */ |
@@ -172,12 +168,10 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | |||
172 | regs.r6 = (unsigned long)arg; | 168 | regs.r6 = (unsigned long)arg; |
173 | local_save_flags(regs.msr); | 169 | local_save_flags(regs.msr); |
174 | regs.pc = (unsigned long)kernel_thread_helper; | 170 | regs.pc = (unsigned long)kernel_thread_helper; |
175 | regs.kernel_mode = 1; | 171 | regs.pt_mode = 1; |
176 | 172 | ||
177 | ret = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, | 173 | return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, |
178 | ®s, 0, NULL, NULL); | 174 | ®s, 0, NULL, NULL); |
179 | |||
180 | return ret; | ||
181 | } | 175 | } |
182 | 176 | ||
183 | unsigned long get_wchan(struct task_struct *p) | 177 | unsigned long get_wchan(struct task_struct *p) |
@@ -185,3 +179,12 @@ unsigned long get_wchan(struct task_struct *p) | |||
185 | /* TBD (used by procfs) */ | 179 | /* TBD (used by procfs) */ |
186 | return 0; | 180 | return 0; |
187 | } | 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 | } | ||