public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] EmbeddedPkg/GdbDebugAgent ARM: use modern dialect for ldm/stm instructions
@ 2018-12-12  9:12 Ard Biesheuvel
  2018-12-12 11:30 ` Leif Lindholm
  0 siblings, 1 reply; 8+ messages in thread
From: Ard Biesheuvel @ 2018-12-12  9:12 UTC (permalink / raw)
  To: edk2-devel

Clang does not like the legacy 32-bit assembler syntax used in the
gdbstub exception handling routines, so update them to something
more fashionable.

So switch the order of the conditional suffix and the increment/decrement
specifier, and use decrement-after (da) and increment-before (ib) as
appropriate for an empty descending stack.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S b/EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S
index df1543a6d242..924578c7af2f 100644
--- a/EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S
+++ b/EmbeddedPkg/Library/GdbDebugAgent/Arm/ExceptionSupport.ARMv6.S
@@ -57,6 +57,7 @@ GCC_ASM_EXPORT(AsmCommonExceptionEntry)
 GCC_ASM_EXPORT(GdbExceptionHandler)
 
 .text
+.syntax unified
 .align 3
 
 
@@ -198,9 +199,9 @@ ASM_PFX(AsmCommonExceptionEntry):
   and       R3, R1, #0x1f           @ Check CPSR to see if User or System Mode
   cmp       R3, #0x1f               @ if ((CPSR == 0x10) || (CPSR == 0x1df))
   cmpne     R3, #0x10               @
-  stmeqed   R2, {lr}^               @   save unbanked lr
+  stmdaeq   R2, {lr}^               @   save unbanked lr
                                     @ else
-  stmneed   R2, {lr}                @   save SVC lr
+  stmdane   R2, {lr}                @   save SVC lr
 
 
   ldr       R5, [SP, #0x58]         @ PC is the LR pushed by srsfd
@@ -245,9 +246,9 @@ GdbExceptionHandler (
   and       R1, R1, #0x1f           @ Check to see if User or System Mode
   cmp       R1, #0x1f               @ if ((CPSR == 0x10) || (CPSR == 0x1f))
   cmpne     R1, #0x10               @
-  ldmeqed   R2, {lr}^               @   restore unbanked lr
+  ldmibeq   R2, {lr}^               @   restore unbanked lr
                                     @ else
-  ldmneed   R3, {lr}                @   restore SVC lr, via ldmfd SP!, {LR}
+  ldmibne   R3, {lr}                @   restore SVC lr, via ldmfd SP!, {LR}
 
   ldmfd     SP!,{R0-R12}            @ Restore general purpose registers
                                     @ Exception handler can not change SP
-- 
2.19.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-12-12 14:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-12  9:12 [PATCH] EmbeddedPkg/GdbDebugAgent ARM: use modern dialect for ldm/stm instructions Ard Biesheuvel
2018-12-12 11:30 ` Leif Lindholm
2018-12-12 11:33   ` Ard Biesheuvel
2018-12-12 12:31     ` Leif Lindholm
2018-12-12 12:45       ` Ard Biesheuvel
2018-12-12 14:41         ` Leif Lindholm
2018-12-12 14:49           ` Ard Biesheuvel
2018-12-12 14:58             ` Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox