diff options
Diffstat (limited to 'arch/blackfin/kernel/process.c')
-rw-r--r-- | arch/blackfin/kernel/process.c | 75 |
1 files changed, 70 insertions, 5 deletions
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index 3eff7439d8d3..5a51dd6ab280 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c | |||
@@ -32,9 +32,10 @@ | |||
32 | #include <linux/unistd.h> | 32 | #include <linux/unistd.h> |
33 | #include <linux/user.h> | 33 | #include <linux/user.h> |
34 | #include <linux/a.out.h> | 34 | #include <linux/a.out.h> |
35 | #include <linux/uaccess.h> | ||
35 | 36 | ||
36 | #include <asm/blackfin.h> | 37 | #include <asm/blackfin.h> |
37 | #include <asm/uaccess.h> | 38 | #include <asm/fixed_code.h> |
38 | 39 | ||
39 | #define LED_ON 0 | 40 | #define LED_ON 0 |
40 | #define LED_OFF 1 | 41 | #define LED_OFF 1 |
@@ -173,8 +174,8 @@ void show_regs(struct pt_regs *regs) | |||
173 | printk(KERN_NOTICE "R4: %08lx R5: %08lx R6: %08lx R7: %08lx\n", | 174 | printk(KERN_NOTICE "R4: %08lx R5: %08lx R6: %08lx R7: %08lx\n", |
174 | regs->r4, regs->r5, regs->r6, regs->r7); | 175 | regs->r4, regs->r5, regs->r6, regs->r7); |
175 | 176 | ||
176 | if (!(regs->ipend)) | 177 | if (!regs->ipend) |
177 | printk("USP: %08lx\n", rdusp()); | 178 | printk(KERN_NOTICE "USP: %08lx\n", rdusp()); |
178 | } | 179 | } |
179 | 180 | ||
180 | /* Fill in the fpu structure for a core dump. */ | 181 | /* Fill in the fpu structure for a core dump. */ |
@@ -322,7 +323,7 @@ asmlinkage int sys_execve(char *name, char **argv, char **envp) | |||
322 | goto out; | 323 | goto out; |
323 | error = do_execve(filename, argv, envp, regs); | 324 | error = do_execve(filename, argv, envp, regs); |
324 | putname(filename); | 325 | putname(filename); |
325 | out: | 326 | out: |
326 | unlock_kernel(); | 327 | unlock_kernel(); |
327 | return error; | 328 | return error; |
328 | } | 329 | } |
@@ -350,13 +351,77 @@ unsigned long get_wchan(struct task_struct *p) | |||
350 | return 0; | 351 | return 0; |
351 | } | 352 | } |
352 | 353 | ||
354 | void finish_atomic_sections (struct pt_regs *regs) | ||
355 | { | ||
356 | if (regs->pc < ATOMIC_SEQS_START || regs->pc >= ATOMIC_SEQS_END) | ||
357 | return; | ||
358 | |||
359 | switch (regs->pc) { | ||
360 | case ATOMIC_XCHG32 + 2: | ||
361 | put_user(regs->r1, (int *)regs->p0); | ||
362 | regs->pc += 2; | ||
363 | break; | ||
364 | |||
365 | case ATOMIC_CAS32 + 2: | ||
366 | case ATOMIC_CAS32 + 4: | ||
367 | if (regs->r0 == regs->r1) | ||
368 | put_user(regs->r2, (int *)regs->p0); | ||
369 | regs->pc = ATOMIC_CAS32 + 8; | ||
370 | break; | ||
371 | case ATOMIC_CAS32 + 6: | ||
372 | put_user(regs->r2, (int *)regs->p0); | ||
373 | regs->pc += 2; | ||
374 | break; | ||
375 | |||
376 | case ATOMIC_ADD32 + 2: | ||
377 | regs->r0 = regs->r1 + regs->r0; | ||
378 | /* fall through */ | ||
379 | case ATOMIC_ADD32 + 4: | ||
380 | put_user(regs->r0, (int *)regs->p0); | ||
381 | regs->pc = ATOMIC_ADD32 + 6; | ||
382 | break; | ||
383 | |||
384 | case ATOMIC_SUB32 + 2: | ||
385 | regs->r0 = regs->r1 - regs->r0; | ||
386 | /* fall through */ | ||
387 | case ATOMIC_SUB32 + 4: | ||
388 | put_user(regs->r0, (int *)regs->p0); | ||
389 | regs->pc = ATOMIC_SUB32 + 6; | ||
390 | break; | ||
391 | |||
392 | case ATOMIC_IOR32 + 2: | ||
393 | regs->r0 = regs->r1 | regs->r0; | ||
394 | /* fall through */ | ||
395 | case ATOMIC_IOR32 + 4: | ||
396 | put_user(regs->r0, (int *)regs->p0); | ||
397 | regs->pc = ATOMIC_IOR32 + 6; | ||
398 | break; | ||
399 | |||
400 | case ATOMIC_AND32 + 2: | ||
401 | regs->r0 = regs->r1 & regs->r0; | ||
402 | /* fall through */ | ||
403 | case ATOMIC_AND32 + 4: | ||
404 | put_user(regs->r0, (int *)regs->p0); | ||
405 | regs->pc = ATOMIC_AND32 + 6; | ||
406 | break; | ||
407 | |||
408 | case ATOMIC_XOR32 + 2: | ||
409 | regs->r0 = regs->r1 ^ regs->r0; | ||
410 | /* fall through */ | ||
411 | case ATOMIC_XOR32 + 4: | ||
412 | put_user(regs->r0, (int *)regs->p0); | ||
413 | regs->pc = ATOMIC_XOR32 + 6; | ||
414 | break; | ||
415 | } | ||
416 | } | ||
417 | |||
353 | #if defined(CONFIG_ACCESS_CHECK) | 418 | #if defined(CONFIG_ACCESS_CHECK) |
354 | int _access_ok(unsigned long addr, unsigned long size) | 419 | int _access_ok(unsigned long addr, unsigned long size) |
355 | { | 420 | { |
356 | 421 | ||
357 | if (addr > (addr + size)) | 422 | if (addr > (addr + size)) |
358 | return 0; | 423 | return 0; |
359 | if (segment_eq(get_fs(),KERNEL_DS)) | 424 | if (segment_eq(get_fs(), KERNEL_DS)) |
360 | return 1; | 425 | return 1; |
361 | #ifdef CONFIG_MTD_UCLINUX | 426 | #ifdef CONFIG_MTD_UCLINUX |
362 | if (addr >= memory_start && (addr + size) <= memory_end) | 427 | if (addr >= memory_start && (addr + size) <= memory_end) |