Skip to content

Commit

Permalink
microblaze: Add STATE_SAVE_ARG_SPACE for noMMU kernel too
Browse files Browse the repository at this point in the history
For noMMU kernel this change nothing bring but this change
helps with MMU synchronization.

Signed-off-by: Michal Simek <monstr@monstr.eu>
  • Loading branch information
Michal Simek committed Apr 23, 2009
1 parent 6dfb79a commit 2921e2b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions arch/microblaze/include/asm/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */
DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
# endif /* __ASSEMBLY__ */

/* noMMU hasn't any space for args */
# define STATE_SAVE_ARG_SPACE (0)

#endif /* _ASM_MICROBLAZE_ENTRY_H */
2 changes: 2 additions & 0 deletions arch/microblaze/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <asm/setup.h>
#include <asm/registers.h>
#include <asm/segment.h>
#include <asm/entry.h>
#include <asm/current.h>

# ifndef __ASSEMBLY__
/* from kernel/cpu/mb.c */
Expand Down
14 changes: 10 additions & 4 deletions arch/microblaze/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *rval_p)

asmlinkage int sys_sigreturn(struct pt_regs *regs)
{
struct sigframe *frame = (struct sigframe *)regs->r1;
struct sigframe *frame =
(struct sigframe *)(regs->r1 + STATE_SAVE_ARG_SPACE);

sigset_t set;
int rval;

Expand Down Expand Up @@ -209,7 +211,9 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)

asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
{
struct rt_sigframe *frame = (struct rt_sigframe *)regs->r1;
struct rt_sigframe *frame =
(struct rt_sigframe *)(regs->r1 + STATE_SAVE_ARG_SPACE);

sigset_t set;
stack_t st;
int rval;
Expand Down Expand Up @@ -336,7 +340,8 @@ static void setup_frame(int sig, struct k_sigaction *ka,
goto give_sigsegv;

/* Set up registers for signal handler */
regs->r1 = (unsigned long) frame;
regs->r1 = (unsigned long) frame - STATE_SAVE_ARG_SPACE;

/* Signal handler args: */
regs->r5 = signal; /* Arg 0: signum */
regs->r6 = (unsigned long) &frame->sc; /* arg 1: sigcontext */
Expand Down Expand Up @@ -414,7 +419,8 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
goto give_sigsegv;

/* Set up registers for signal handler */
regs->r1 = (unsigned long) frame;
regs->r1 = (unsigned long) frame - STATE_SAVE_ARG_SPACE;

/* Signal handler args: */
regs->r5 = signal; /* arg 0: signum */
regs->r6 = (unsigned long) &frame->info; /* arg 1: siginfo */
Expand Down

0 comments on commit 2921e2b

Please sign in to comment.