summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-22 21:54:54 +0000
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-22 21:54:54 +0000
commit6632aeb54aba709529fa8786746a56c5fddee740 (patch)
treeb17af8bc15dd72895015c9d2f27f9e5d7955b384
parent6276c4d1d13024880ab6ade815733bbc7e1e713f (diff)
downloadgcc-6632aeb54aba709529fa8786746a56c5fddee740.tar.gz
* config/rs6000/linux-unwind.h (get_regs): Remove type
puns. Change the type of `pc' to an array of unsigned ints and update all users. Constify frame24. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146615 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/rs6000/linux-unwind.h23
2 files changed, 16 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index af6b9572c91..34f80811911 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-23 Ben Elliston <bje@au.ibm.com>
+
+ * config/rs6000/linux-unwind.h (get_regs): Remove type
+ puns. Change the type of `pc' to an array of unsigned ints and
+ update all users. Constify frame24.
+
2009-04-22 DJ Delorie <dj@redhat.com>
* config/m32c/m32c.c (m32c_special_page_vector_p): Move
diff --git a/gcc/config/rs6000/linux-unwind.h b/gcc/config/rs6000/linux-unwind.h
index ba573ae7eda..a16df97e97e 100644
--- a/gcc/config/rs6000/linux-unwind.h
+++ b/gcc/config/rs6000/linux-unwind.h
@@ -91,14 +91,13 @@ enum { SIGNAL_FRAMESIZE = 128 };
static struct gcc_regs *
get_regs (struct _Unwind_Context *context)
{
- const unsigned char *pc = context->ra;
+ const unsigned int *pc = context->ra;
/* addi r1, r1, 128; li r0, 0x0077; sc (sigreturn) */
/* addi r1, r1, 128; li r0, 0x00AC; sc (rt_sigreturn) */
- if (*(unsigned int *) (pc + 0) != 0x38210000 + SIGNAL_FRAMESIZE
- || *(unsigned int *) (pc + 8) != 0x44000002)
+ if (pc[0] != 0x38210000 + SIGNAL_FRAMESIZE || pc[2] != 0x44000002)
return NULL;
- if (*(unsigned int *) (pc + 4) == 0x38000077)
+ if (pc[1] == 0x38000077)
{
struct sigframe {
char gap[SIGNAL_FRAMESIZE];
@@ -107,17 +106,17 @@ get_regs (struct _Unwind_Context *context)
} *frame = (struct sigframe *) context->cfa;
return frame->regs;
}
- else if (*(unsigned int *) (pc + 4) == 0x380000AC)
+ else if (pc[1] == 0x380000AC)
{
/* This works for 2.4 kernels, but not for 2.6 kernels with vdso
because pc isn't pointing into the stack. Can be removed when
no one is running 2.4.19 or 2.4.20, the first two ppc64
kernels released. */
- struct rt_sigframe_24 {
+ const struct rt_sigframe_24 {
int tramp[6];
void *pinfo;
struct gcc_ucontext *puc;
- } *frame24 = (struct rt_sigframe_24 *) pc;
+ } *frame24 = (const struct rt_sigframe_24 *) context->ra;
/* Test for magic value in *puc of vdso. */
if ((long) frame24->puc != -21 * 8)
@@ -146,16 +145,15 @@ enum { SIGNAL_FRAMESIZE = 64 };
static struct gcc_regs *
get_regs (struct _Unwind_Context *context)
{
- const unsigned char *pc = context->ra;
+ const unsigned int *pc = context->ra;
/* li r0, 0x7777; sc (sigreturn old) */
/* li r0, 0x0077; sc (sigreturn new) */
/* li r0, 0x6666; sc (rt_sigreturn old) */
/* li r0, 0x00AC; sc (rt_sigreturn new) */
- if (*(const unsigned int *) (pc + 4) != 0x44000002)
+ if (pc[1] != 0x44000002)
return NULL;
- if (*(const unsigned int *) (pc + 0) == 0x38007777
- || *(const unsigned int *) (pc + 0) == 0x38000077)
+ if (pc[0] == 0x38007777 || pc[0] == 0x38000077)
{
struct sigframe {
char gap[SIGNAL_FRAMESIZE];
@@ -164,8 +162,7 @@ get_regs (struct _Unwind_Context *context)
} *frame = (struct sigframe *) context->cfa;
return frame->regs;
}
- else if (*(const unsigned int *) (pc + 0) == 0x38006666
- || *(const unsigned int *) (pc + 0) == 0x380000AC)
+ else if (pc[0] == 0x38006666 || pc[0] == 0x380000AC)
{
struct rt_sigframe {
char gap[SIGNAL_FRAMESIZE + 16];