nslu2-kernel_2.6.12.2: add a patch for thumb breakpoints (via a thumb SWI)
authorJohn Bowler <jbowler@nslu2-linux.org>
Thu, 22 Sep 2005 20:02:05 +0000 (20:02 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Thu, 22 Sep 2005 20:02:05 +0000 (20:02 +0000)
packages/linux/nslu2-kernel/2.6/thumb-swi.patch [new file with mode: 0644]
packages/linux/nslu2-kernel_2.6.12.2.bb

diff --git a/packages/linux/nslu2-kernel/2.6/thumb-swi.patch b/packages/linux/nslu2-kernel/2.6/thumb-swi.patch
new file mode 100644 (file)
index 0000000..2e73bb1
--- /dev/null
@@ -0,0 +1,19 @@
+# This patch changes the thumb swi handling for any thumb swi with
+# an immediate value != 0, those swis are mapped into the arm
+# specific swis.  This implements a thumb breakpoint swi.
+--- linux-2.6.12.2/arch/arm/kernel/entry-common.S.orig 2005-09-19 12:48:42.323365573 -0700
++++ linux-2.6.12.2/arch/arm/kernel/entry-common.S      2005-09-19 13:31:19.004247358 -0700
+@@ -137,8 +137,11 @@
+        */
+ #ifdef CONFIG_ARM_THUMB
+       tst     r8, #PSR_T_BIT                  @ this is SPSR from save_user_regs
+-      addne   scno, r7, #__NR_SYSCALL_BASE    @ put OS number in
+-      ldreq   scno, [lr, #-4]
++      ldrneh  ip, [lr, #-2]                   @ thumb swi instruction
++      ldreq   scno, [lr, #-4]                 @ arm swi instruction
++      addne   scno, r7, #__NR_SYSCALL_BASE    @ put OS number in to thumb r7 value
++      bicnes  ip, ip, #0xff00                 @ clear thumb swi bits
++      addne   scno, ip, #__ARM_NR_BASE        @ thumb swi0->r7, swi!0->arm swi
+ #else
+       ldr     scno, [lr, #-4]                 @ get SWI instruction
+ #endif
index e574f86..7e1a6f2 100644 (file)
@@ -25,4 +25,5 @@ N2K_PATCHES = "\
        file://timer.patch;patch=1 \
        file://nslu2-io_rpbutton.patch;patch=1 \
        file://disk_led_blinking.patch;patch=1 \
+       file://thumb-swi.patch;patch=1 \
 "