Patchwork sparc32: Put back SPARC_BRANCH.

login
register
mail settings
Submitter David Miller
Date May 12, 2012, 4:03 a.m.
Message ID <20120512.000320.515901108290483706.davem@davemloft.net>
Download mbox | patch
Permalink /patch/158679/
State Accepted
Delegated to: David Miller
Headers show

Comments

David Miller - May 12, 2012, 4:03 a.m.
It's needed for the floppy interrupt trap table patching.

Signed-off-by: David S. Miller <davem@davemloft.net>
---

Tsk tsk, Sam both you and I are naughty for not testing with
BLK_DEV_FD enabled :-)

 arch/sparc/include/asm/traps.h |    7 +++++++
 1 file changed, 7 insertions(+)
Sam Ravnborg - May 12, 2012, 6:22 a.m.
On Sat, May 12, 2012 at 12:03:20AM -0400, David Miller wrote:
> 
> It's needed for the floppy interrupt trap table patching.
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> 
> Tsk tsk, Sam both you and I are naughty for not testing with
> BLK_DEV_FD enabled :-)
Ups - thanks. Dunno how I missed that when I grepped for it.
Will enable BLK_DEV_FD for future builds.

	Sam
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sparc/include/asm/traps.h b/arch/sparc/include/asm/traps.h
index 5fac90f..3aa62dd 100644
--- a/arch/sparc/include/asm/traps.h
+++ b/arch/sparc/include/asm/traps.h
@@ -31,6 +31,13 @@  extern struct tt_entry *sparc_ttable;
 
 #define SPARC_MOV_CONST_L3(const) (0xa6102000 | (const&0xfff))
 
+/* The following assumes that the branch lies before the place we
+ * are branching to.  This is the case for a trap vector...
+ * You have been warned.
+ */
+#define SPARC_BRANCH(dest_addr, inst_addr) \
+          (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
+
 #define SPARC_RD_PSR_L0  (0xa1480000)
 #define SPARC_RD_WIM_L3  (0xa7500000)
 #define SPARC_NOP (0x01000000)