diff options
Diffstat (limited to 'arch/microblaze/kernel/entry.S')
-rw-r--r-- | arch/microblaze/kernel/entry.S | 57 |
1 files changed, 9 insertions, 48 deletions
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index 03f7b8ce6b6b..c217367dfc7b 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S | |||
@@ -293,24 +293,6 @@ C_ENTRY(_user_exception): | |||
293 | swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */ | 293 | swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */ |
294 | addi r14, r14, 4 /* return address is 4 byte after call */ | 294 | addi r14, r14, 4 /* return address is 4 byte after call */ |
295 | 295 | ||
296 | mfs r1, rmsr | ||
297 | nop | ||
298 | andi r1, r1, MSR_UMS | ||
299 | bnei r1, 1f | ||
300 | |||
301 | /* Kernel-mode state save - kernel execve */ | ||
302 | lwi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)); /* Reload kernel stack-ptr*/ | ||
303 | tophys(r1,r1); | ||
304 | |||
305 | addik r1, r1, -PT_SIZE; /* Make room on the stack. */ | ||
306 | SAVE_REGS | ||
307 | |||
308 | swi r1, r1, PT_MODE; /* pt_regs -> kernel mode */ | ||
309 | brid 2f; | ||
310 | nop; /* Fill delay slot */ | ||
311 | |||
312 | /* User-mode state save. */ | ||
313 | 1: | ||
314 | lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */ | 296 | lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); /* get saved current */ |
315 | tophys(r1,r1); | 297 | tophys(r1,r1); |
316 | lwi r1, r1, TS_THREAD_INFO; /* get stack from task_struct */ | 298 | lwi r1, r1, TS_THREAD_INFO; /* get stack from task_struct */ |
@@ -460,18 +442,6 @@ TRAP_return: /* Make global symbol for debugging */ | |||
460 | nop; | 442 | nop; |
461 | 443 | ||
462 | 444 | ||
463 | /* These syscalls need access to the struct pt_regs on the stack, so we | ||
464 | implement them in assembly (they're basically all wrappers anyway). */ | ||
465 | |||
466 | C_ENTRY(sys_fork_wrapper): | ||
467 | addi r5, r0, SIGCHLD /* Arg 0: flags */ | ||
468 | lwi r6, r1, PT_R1 /* Arg 1: child SP (use parent's) */ | ||
469 | addik r7, r1, 0 /* Arg 2: parent context */ | ||
470 | add r8, r0, r0 /* Arg 3: (unused) */ | ||
471 | add r9, r0, r0; /* Arg 4: (unused) */ | ||
472 | brid do_fork /* Do real work (tail-call) */ | ||
473 | add r10, r0, r0; /* Arg 5: (unused) */ | ||
474 | |||
475 | /* This the initial entry point for a new child thread, with an appropriate | 445 | /* This the initial entry point for a new child thread, with an appropriate |
476 | stack in place that makes it look the the child is in the middle of an | 446 | stack in place that makes it look the the child is in the middle of an |
477 | syscall. This function is actually `returned to' from switch_thread | 447 | syscall. This function is actually `returned to' from switch_thread |
@@ -479,28 +449,19 @@ C_ENTRY(sys_fork_wrapper): | |||
479 | saved context). */ | 449 | saved context). */ |
480 | C_ENTRY(ret_from_fork): | 450 | C_ENTRY(ret_from_fork): |
481 | bralid r15, schedule_tail; /* ...which is schedule_tail's arg */ | 451 | bralid r15, schedule_tail; /* ...which is schedule_tail's arg */ |
482 | add r3, r5, r0; /* switch_thread returns the prev task */ | 452 | add r5, r3, r0; /* switch_thread returns the prev task */ |
483 | /* ( in the delay slot ) */ | 453 | /* ( in the delay slot ) */ |
484 | brid ret_from_trap; /* Do normal trap return */ | 454 | brid ret_from_trap; /* Do normal trap return */ |
485 | add r3, r0, r0; /* Child's fork call should return 0. */ | 455 | add r3, r0, r0; /* Child's fork call should return 0. */ |
486 | 456 | ||
487 | C_ENTRY(sys_vfork): | 457 | C_ENTRY(ret_from_kernel_thread): |
488 | brid microblaze_vfork /* Do real work (tail-call) */ | 458 | bralid r15, schedule_tail; /* ...which is schedule_tail's arg */ |
489 | addik r5, r1, 0 | 459 | add r5, r3, r0; /* switch_thread returns the prev task */ |
490 | 460 | /* ( in the delay slot ) */ | |
491 | C_ENTRY(sys_clone): | 461 | brald r15, r20 /* fn was left in r20 */ |
492 | bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */ | 462 | addk r5, r0, r19 /* ... and argument - in r19 */ |
493 | lwi r6, r1, PT_R1; /* If so, use paret's stack ptr */ | 463 | brid ret_from_trap |
494 | 1: addik r7, r1, 0; /* Arg 2: parent context */ | 464 | add r3, r0, r0 |
495 | lwi r9, r1, PT_R8; /* parent tid. */ | ||
496 | lwi r10, r1, PT_R9; /* child tid. */ | ||
497 | /* do_fork will pick up TLS from regs->r10. */ | ||
498 | brid do_fork /* Do real work (tail-call) */ | ||
499 | add r8, r0, r0; /* Arg 3: (unused) */ | ||
500 | |||
501 | C_ENTRY(sys_execve): | ||
502 | brid microblaze_execve; /* Do real work (tail-call).*/ | ||
503 | addik r8, r1, 0; /* add user context as 4th arg */ | ||
504 | 465 | ||
505 | C_ENTRY(sys_rt_sigreturn_wrapper): | 466 | C_ENTRY(sys_rt_sigreturn_wrapper): |
506 | brid sys_rt_sigreturn /* Do real work */ | 467 | brid sys_rt_sigreturn /* Do real work */ |