All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rashmica Gupta <rashmicy@gmail.com>
To: mpe@ellerman.id.au, benh@kernel.crashing.org,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 3/3] powerpc/asm: Add STACK_INT_OFFSET macro in asm-offsets.c
Date: Thu,  2 Jun 2016 14:29:48 +1000	[thread overview]
Message-ID: <1464841788-17465-3-git-send-email-rashmicy@gmail.com> (raw)
In-Reply-To: <1464841788-17465-1-git-send-email-rashmicy@gmail.com>

There are quite a few entries in asm-offests.c look like this:
DEFINE(REG, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, reg));

So define a local MACRO to clean this up:
STACK_INT_OFFSET(sym, val) DEFINE(sym, STACK_INT_FRAME_SIZE + \
               offsetof(struct exception_regs, val))

Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
---
 arch/powerpc/kernel/asm-offsets.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 3dbd3bd016ba..5efe5e297256 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -70,6 +70,8 @@
 
 #define STACK_OFFSET(sym, val) DEFINE(sym, STACK_FRAME_OVERHEAD + \
 		offsetof(struct pt_regs, val))
+#define STACK_INT_OFFSET(sym, val)	DEFINE(sym, \
+		STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, val))
 
 int main(void)
 {
@@ -308,21 +310,21 @@ int main(void)
 #if defined(CONFIG_PPC32)
 #if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
 	DEFINE(EXC_LVL_SIZE, STACK_EXC_LVL_FRAME_SIZE);
-	DEFINE(MAS0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas0));
+	STACK_INT_OFFSET(MAS0, mas0);
 	/* we overload MMUCR for 44x on MAS0 since they are mutually exclusive */
-	DEFINE(MMUCR, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas0));
-	DEFINE(MAS1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas1));
-	DEFINE(MAS2, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas2));
-	DEFINE(MAS3, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas3));
-	DEFINE(MAS6, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas6));
-	DEFINE(MAS7, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas7));
-	DEFINE(_SRR0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, srr0));
-	DEFINE(_SRR1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, srr1));
-	DEFINE(_CSRR0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, csrr0));
-	DEFINE(_CSRR1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, csrr1));
-	DEFINE(_DSRR0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, dsrr0));
-	DEFINE(_DSRR1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, dsrr1));
-	DEFINE(SAVED_KSP_LIMIT, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, saved_ksp_limit));
+	STACK_INT_OFFSET(MMUCR, mas0);
+	STACK_INT_OFFSET(MAS1, mas1);
+	STACK_INT_OFFSET(MAS2, mas2);
+	STACK_INT_OFFSET(MAS3, mas3);
+	STACK_INT_OFFSET(MAS6, mas6);
+	STACK_INT_OFFSET(MAS7, mas7);
+	STACK_INT_OFFSET(_SRR0, srr0);
+	STACK_INT_OFFSET(_SRR1, srr1);
+	STACK_INT_OFFSET(_CSRR0, csrr0);
+	STACK_INT_OFFSET(_CSRR1, csrr1);
+	STACK_INT_OFFSET(_DSRR0, dsrr0);
+	STACK_INT_OFFSET(_DSRR1, dsrr1);
+	STACK_INT_OFFSET(SAVED_KSP_LIMIT, saved_ksp_limit);
 #endif
 #endif
 
-- 
2.5.0

  parent reply	other threads:[~2016-06-02  4:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02  4:29 [PATCH 1/3] powerpc/asm: Use OFFSET macro in asm-offsets.c Rashmica Gupta
2016-06-02  4:29 ` [PATCH 2/3] powerpc/asm: Define STACK_OFFSET " Rashmica Gupta
2017-02-16  5:59   ` [2/3] " Michael Ellerman
2016-06-02  4:29 ` Rashmica Gupta [this message]
2017-02-16  5:59 ` [1/3] powerpc/asm: Use OFFSET " Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464841788-17465-3-git-send-email-rashmicy@gmail.com \
    --to=rashmicy@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.