[Top] [All Lists]

[PATCH] Let gcc align 'struct pt_regs' on 8 bytes boundary

To: Ralf Baechle <>
Subject: [PATCH] Let gcc align 'struct pt_regs' on 8 bytes boundary
From: Franck Bui-Huu <>
Date: Fri, 29 Sep 2006 11:08:59 +0200
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta;; h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:content-type:content-transfer-encoding:from; b=fIZjs0e55e89rzrvV9HdZfbiypR2dO6YN/M7rdu/FsoYT/s/ZVwvq+lyMmSaF1Inw8EUV98HDyQFPpwvOLBddV7l5RpkpATdakuZbz9xX4BcwL0DA1Ap5rWKMD4qM3zeyr/Xe0tWGdVIkcxzjPqiDnHB5l7OABDFpqSW/EpCAe8=
Original-recipient: rfc822;
Reply-to: Franck <>
User-agent: Thunderbird (X11/20060614)
From: Franck Bui-Huu <>

The stack pointer in MIPS/gcc should always 8 bytes aligned on
entry to any routines. Therefore pt_regs structure must be
aligned to 8-byte boundary too.

Instead of creating dummy fields to achieve this alignment, this
patch let gcc doing it. Therefore 'smtc_pad' field can be safely

Signed-off-by: Franck Bui-Huu <>
 include/asm-mips/ptrace.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 4fb0fc4..5f3a907 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -44,9 +44,8 @@ #endif
        unsigned long cp0_epc;
        unsigned long cp0_tcstatus;
-       unsigned long smtc_pad;
 #endif /* CONFIG_MIPS_MT_SMTC */
+} __attribute__ ((aligned (8)));
 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
 #define PTRACE_GETREGS         12

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] Let gcc align 'struct pt_regs' on 8 bytes boundary, Franck Bui-Huu <=