[PATCH 30/32] sparc: Adjust assembly to improve compability with LLVM

Daniel Hellstrom daniel at gaisler.com
Thu May 11 14:26:15 UTC 2017


From: Jacob Hansen <jacob.hansen at gaisler.com>

- All references of %0 changed to %g0

- 'call label,0' changed to 'call label'. According to the sparc
  specification call does not take any registers

- '.seg "text"' changed to '.section ".text"'

- the synonym stub is replaced with stb

- the synonym stuh is replaced with sth
---
 c/src/lib/libbsp/sparc/shared/irq_asm.S     | 12 ++++++------
 c/src/lib/libbsp/sparc/shared/start/start.S |  4 ++--
 c/src/lib/libcpu/sparc/access/access.S      |  6 +++---
 c/src/lib/libcpu/sparc/reg_win/window.S     |  2 +-
 c/src/lib/libcpu/sparc/syscall/syscall.S    |  2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/shared/irq_asm.S b/c/src/lib/libbsp/sparc/shared/irq_asm.S
index 17a77d6..3d83431 100644
--- a/c/src/lib/libbsp/sparc/shared/irq_asm.S
+++ b/c/src/lib/libbsp/sparc/shared/irq_asm.S
@@ -459,7 +459,7 @@ dont_do_the_window:
 #if defined(RTEMS_PROFILING)
          sethi   %hi(_SPARC_Counter), %o5
         ld       [%o5 + %lo(_SPARC_Counter)], %l4
-        call     %l4, 0
+        call     %l4
          nop
         mov      %o0, %o5
 #else
@@ -542,7 +542,7 @@ pil_fixed:
                                         ! o1 = 2nd arg = address of the ISF
                                         !   WAS LOADED WHEN ISF WAS SAVED!!!
         mov      %l3, %o0               ! o0 = 1st arg = vector number
-        call     %g4, 0
+        call     %g4
 #if defined(RTEMS_PROFILING)
          mov     %o5, %l3               ! save interrupt entry instant
 #else
@@ -560,11 +560,11 @@ pil_fixed:
         cmp      %l7, 0
         bne      profiling_not_outer_most_exit
          nop
-        call     %l4, 0                 ! Call _SPARC_Counter.counter_read
+        call     %l4                    ! Call _SPARC_Counter.counter_read
          mov     %g1, %l4               ! Save previous interrupt status
         mov      %o0, %o2               ! o2 = 3rd arg = interrupt exit instant
         mov      %l3, %o1               ! o1 = 2nd arg = interrupt entry instant
-        call     SYM(_Profiling_Outer_most_interrupt_entry_and_exit), 0
+        call     SYM(_Profiling_Outer_most_interrupt_entry_and_exit)
          mov     %g6, %o0               ! o0 = 1st arg = per-CPU control
 profiling_not_outer_most_exit:
 #endif
@@ -647,7 +647,7 @@ isr_dispatch:
         std     %f28, [%sp + FP_FRAME_OFFSET_F28_F29]
         std     %f30, [%sp + FP_FRAME_OFFSET_F3O_F31]
         st      %fsr, [%sp + FP_FRAME_OFFSET_FSR]
-        call    SYM(_Thread_Do_dispatch), 0
+        call    SYM(_Thread_Do_dispatch)
          mov    %g6, %o0
 
         /*
@@ -677,7 +677,7 @@ isr_dispatch:
 non_fp_thread_dispatch:
 #endif
 
-        call    SYM(_Thread_Do_dispatch), 0
+        call    SYM(_Thread_Do_dispatch)
          mov    %g6, %o0
 
 #if SPARC_HAS_FPU == 1 && defined(SPARC_USE_SAFE_FP_SUPPORT)
diff --git a/c/src/lib/libbsp/sparc/shared/start/start.S b/c/src/lib/libbsp/sparc/shared/start/start.S
index 6a9faaf..d9044b2 100644
--- a/c/src/lib/libbsp/sparc/shared/start/start.S
+++ b/c/src/lib/libbsp/sparc/shared/start/start.S
@@ -74,7 +74,7 @@
 
 #define SOFT_TRAP BAD_TRAP
 
-  .seg    "text"
+  .section    ".text"
   PUBLIC(start)
   .global start, __bsp_mem_init
 
@@ -352,7 +352,7 @@ zerobss:
         bleu,a zerobss
         nop
 
-        mov     %0, %o0                 ! command line
+        mov     %g0, %o0                ! command line
         call    SYM(boot_card)          ! does not return
          sub     %sp, 0x60, %sp         ! room for boot_card to save args
 
diff --git a/c/src/lib/libcpu/sparc/access/access.S b/c/src/lib/libcpu/sparc/access/access.S
index f52e693..cb8693b 100644
--- a/c/src/lib/libcpu/sparc/access/access.S
+++ b/c/src/lib/libcpu/sparc/access/access.S
@@ -24,7 +24,7 @@
 #include <rtems/asm.h>
 
 	.align 4
-	.seg "text"
+	.section ".text"
 	PUBLIC(_ld8)
 	PUBLIC(_ld16)
 	PUBLIC(_ld32)
@@ -61,12 +61,12 @@ SYM(_ld64):
 
 SYM(_st8):
 	retl
-	 stub %o1, [%o0]
+	 stb %o1, [%o0]
 
 SYM(_st_be16):
 SYM(_st16):
 	retl
-	 stuh %o1, [%o0]
+	 sth %o1, [%o0]
 
 SYM(_st_be32):
 SYM(_st32):
diff --git a/c/src/lib/libcpu/sparc/reg_win/window.S b/c/src/lib/libcpu/sparc/reg_win/window.S
index f57fbe1..b874559 100644
--- a/c/src/lib/libcpu/sparc/reg_win/window.S
+++ b/c/src/lib/libcpu/sparc/reg_win/window.S
@@ -23,7 +23,7 @@
 
 #include <rtems/asm.h>
 
-        .seg    "text"
+        .section    ".text"
         /*
          *  Window overflow trap handler.
          *
diff --git a/c/src/lib/libcpu/sparc/syscall/syscall.S b/c/src/lib/libcpu/sparc/syscall/syscall.S
index d00aa03..d5e1f43 100644
--- a/c/src/lib/libcpu/sparc/syscall/syscall.S
+++ b/c/src/lib/libcpu/sparc/syscall/syscall.S
@@ -19,7 +19,7 @@
 #include <rtems/asm.h>
 #include "syscall.h"
 
-	.seg    "text"
+	.section    ".text"
 	/*
 	 *  system call - halt
 	 *
-- 
2.7.4




More information about the devel mailing list