Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138584
b: refs/heads/master
c: efbda86
h: refs/heads/master
v: v3
  • Loading branch information
Josh Boyer authored and Benjamin Herrenschmidt committed Mar 27, 2009
1 parent 9711032 commit 77e0614
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 82631f5dd114e52239fb3d1e270a49d37c088b46
refs/heads/master: efbda86098455da014be849713df6498cefc5a2a
19 changes: 19 additions & 0 deletions trunk/arch/powerpc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,25 @@ static inline void prefetchw(const void *x)
#define HAVE_ARCH_PICK_MMAP_LAYOUT
#endif

#ifdef CONFIG_PPC64
static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32)
{
unsigned long sp;

if (is_32)
sp = regs->gpr[1] & 0x0ffffffffUL;
else
sp = regs->gpr[1];

return sp;
}
#else
static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32)
{
return regs->gpr[1];
}
#endif

#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
#endif /* _ASM_POWERPC_PROCESSOR_H */
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ int show_unhandled_signals = 0;
* Allocate space for the signal frame
*/
void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
size_t frame_size)
size_t frame_size, int is_32)
{
unsigned long oldsp, newsp;

/* Default to using normal stack */
oldsp = regs->gpr[1];
oldsp = get_clean_sp(regs, is_32);

/* Check for alt stack */
if ((ka->sa.sa_flags & SA_ONSTACK) &&
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags);

extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
size_t frame_size);
size_t frame_size, int is_32);
extern void restore_sigmask(sigset_t *set);

extern int handle_signal32(unsigned long sig, struct k_sigaction *ka,
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,

/* Set up Signal Frame */
/* Put a Real Time Context onto stack */
rt_sf = get_sigframe(ka, regs, sizeof(*rt_sf));
rt_sf = get_sigframe(ka, regs, sizeof(*rt_sf), 1);
addr = rt_sf;
if (unlikely(rt_sf == NULL))
goto badframe;
Expand Down Expand Up @@ -1182,7 +1182,7 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka,
unsigned long newsp = 0;

/* Set up Signal Frame */
frame = get_sigframe(ka, regs, sizeof(*frame));
frame = get_sigframe(ka, regs, sizeof(*frame), 1);
if (unlikely(frame == NULL))
goto badframe;
sc = (struct sigcontext __user *) &frame->sctx;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
unsigned long newsp = 0;
long err = 0;

frame = get_sigframe(ka, regs, sizeof(*frame));
frame = get_sigframe(ka, regs, sizeof(*frame), 0);
if (unlikely(frame == NULL))
goto badframe;

Expand Down

0 comments on commit 77e0614

Please sign in to comment.