linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
To: linux-snps-arc@lists.infradead.org,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
	Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] ARC: pt_regs: remove hardcoded registers offset
Date: Fri, 27 Dec 2019 21:03:43 +0300	[thread overview]
Message-ID: <20191227180347.3579-2-Eugeniy.Paltsev@synopsys.com> (raw)
In-Reply-To: <20191227180347.3579-1-Eugeniy.Paltsev@synopsys.com>

Replace hardcoded registers offset numbers by calculated via
offsetof.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 arch/arc/include/asm/entry-arcv2.h | 8 ++++----
 arch/arc/kernel/asm-offsets.c      | 9 +++++++++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/arch/arc/include/asm/entry-arcv2.h b/arch/arc/include/asm/entry-arcv2.h
index 41b16f21beec..0b8b63d0bec1 100644
--- a/arch/arc/include/asm/entry-arcv2.h
+++ b/arch/arc/include/asm/entry-arcv2.h
@@ -162,7 +162,7 @@
 #endif
 
 #ifdef CONFIG_ARC_HAS_ACCL_REGS
-	ST2	r58, r59, PT_sp + 12
+	ST2	r58, r59, PT_r58
 #endif
 
 .endm
@@ -172,8 +172,8 @@
 
 	LD2	gp, fp, PT_r26		; gp (r26), fp (r27)
 
-	ld	r12, [sp, PT_sp + 4]
-	ld	r30, [sp, PT_sp + 8]
+	ld	r12, [sp, PT_r12]
+	ld	r30, [sp, PT_r30]
 
 	; Restore SP (into AUX_USER_SP) only if returning to U mode
 	;  - for K mode, it will be implicitly restored as stack is unwound
@@ -190,7 +190,7 @@
 #endif
 
 #ifdef CONFIG_ARC_HAS_ACCL_REGS
-	LD2	r58, r59, PT_sp + 12
+	LD2	r58, r59, PT_r58
 #endif
 .endm
 
diff --git a/arch/arc/kernel/asm-offsets.c b/arch/arc/kernel/asm-offsets.c
index 631ebb5d3458..c783bcd35eb8 100644
--- a/arch/arc/kernel/asm-offsets.c
+++ b/arch/arc/kernel/asm-offsets.c
@@ -67,5 +67,14 @@ int main(void)
 	DEFINE(SZ_CALLEE_REGS, sizeof(struct callee_regs));
 	DEFINE(SZ_PT_REGS, sizeof(struct pt_regs));
 
+#ifdef CONFIG_ISA_ARCV2
+	OFFSET(PT_r12, pt_regs, r12);
+	OFFSET(PT_r30, pt_regs, r30);
+#endif
+#ifdef CONFIG_ARC_HAS_ACCL_REGS
+	OFFSET(PT_r58, pt_regs, r58);
+	OFFSET(PT_r59, pt_regs, r59);
+#endif
+
 	return 0;
 }
-- 
2.21.0


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

  reply	other threads:[~2019-12-27 18:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27 18:03 [RFC 0/5] ARC: handle DSP presence in HW Eugeniy Paltsev
2019-12-27 18:03 ` Eugeniy Paltsev [this message]
2019-12-28 21:06   ` [PATCH 1/5] ARC: pt_regs: remove hardcoded registers offset Vineet Gupta
2019-12-27 18:03 ` [PATCH 2/5] ARC: add helpers to sanitize config options Eugeniy Paltsev
2020-01-06 22:47   ` Vineet Gupta
2019-12-27 18:03 ` [PATCH 3/5] ARC: handle DSP presence in HW Eugeniy Paltsev
2020-01-07  1:03   ` Vineet Gupta
2020-01-07  1:30     ` Vineet Gupta
2020-01-10 14:54     ` Eugeniy Paltsev
2020-01-13 16:49       ` Vineet Gupta
2019-12-27 18:03 ` [PATCH 4/5] ARC: add support for DSP-enabled userspace applications Eugeniy Paltsev
2020-01-07 18:25   ` Vineet Gupta
2020-01-09 19:01     ` Eugeniy Paltsev
2020-01-09 22:46       ` Vineet Gupta
2020-03-04 11:51     ` Eugeniy Paltsev
2020-03-04 17:58       ` Vineet Gupta
2019-12-27 18:03 ` [PATCH 5/5] ARC: allow userspace DSP applications to use AGU extensions Eugeniy Paltsev
2020-01-07 18:30   ` Vineet Gupta

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=20191227180347.3579-2-Eugeniy.Paltsev@synopsys.com \
    --to=eugeniy.paltsev@synopsys.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).