[J-core] [PATCH 4/4] Compile boot rom with regular sh2eb-linux-musl toolchain.
Christopher Friedt
chrisfriedt at gmail.com
Wed May 11 08:20:35 EDT 2016
Previously, we had to download and use a separate bare metal toolchain to
compile the boot rom sources, due to symbol prefix inconsistency.
This change represents the minimal subset of prefix modifications required to
compile the boot rom sources with the regular sh2eb-linux-musl-gcc toolchain
(or any other normal toolchain).
Note, that there are still a number of hard-coded underscore-prefixed variable
names in assembly source and in inline assembly in c files. A separate patch
will address the remaining underscore-prefixed symbol names.
Signed-off-by: Christopher Friedt <chrisfriedt at gmail.com>
---
boot/Makefile | 2 +-
boot/entry.c | 140 +++++++++++++++++++++++------------------------
boot/gdb/sh2.c | 7 +--
boot/linker/sh32.x | 6 +-
boot/tests/testalu.s | 12 ++--
boot/tests/testbra.s | 10 ++--
boot/tests/testmov.s | 88 ++++++++++++++---------------
boot/tests/testmov2.s | 46 ++++++++--------
boot/tests/testmulconf.s | 132 ++++++++++++++++++++++----------------------
tools/soc.mk | 4 +-
10 files changed, 224 insertions(+), 223 deletions(-)
diff --git a/boot/Makefile b/boot/Makefile
index 13e16c1..cc8dbd3 100644
--- a/boot/Makefile
+++ b/boot/Makefile
@@ -111,7 +111,7 @@ AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
LDFLAGS = -T linker/sh32.x
LIBGCC := $(shell $(CC) -print-libgcc-file-name)
-LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a)
+#LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a)
CFLAGS := -m2 -g -Os -Wall -Werror
CFLAGS += -std=gnu99
diff --git a/boot/entry.c b/boot/entry.c
index a737058..415b429 100644
--- a/boot/entry.c
+++ b/boot/entry.c
@@ -55,85 +55,85 @@ __asm__(
" .long _stack+0x2fc\n"
" .long _start /* 2: manual reset */\n"
" .long _stack+0x2fc\n"
-" .long _gdb_illegalinst_isr /* 4: general illegal instruction */\n"
-" .long _gdb_unhandled_isr /* 5: (reserved) */\n"
-" .long _gdb_illegalinst_isr /* 6: slot illegal instruction */\n"
-" .long _gdb_unhandled_isr /* 7: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 8: (reserved) */\n"
-" .long _gdb_addresserr_isr /* 9: CPU address error */\n"
-" .long _gdb_addresserr_isr /* 10: DMAC/DTC address error */\n"
+" .long gdb_illegalinst_isr /* 4: general illegal instruction */\n"
+" .long gdb_unhandled_isr /* 5: (reserved) */\n"
+" .long gdb_illegalinst_isr /* 6: slot illegal instruction */\n"
+" .long gdb_unhandled_isr /* 7: (reserved) */\n"
+" .long gdb_unhandled_isr /* 8: (reserved) */\n"
+" .long gdb_addresserr_isr /* 9: CPU address error */\n"
+" .long gdb_addresserr_isr /* 10: DMAC/DTC address error */\n"
-" .long _gdb_nmi_isr /* 11: NMI */\n"
-" .long _gdb_unhandled_isr /* 12: UBC */\n"
-" .long _gdb_unhandled_isr /* 13: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 14: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 15: (reserved) */\n"
+" .long gdb_nmi_isr /* 11: NMI */\n"
+" .long gdb_unhandled_isr /* 12: UBC */\n"
+" .long gdb_unhandled_isr /* 13: (reserved) */\n"
+" .long gdb_unhandled_isr /* 14: (reserved) */\n"
+" .long gdb_unhandled_isr /* 15: (reserved) */\n"
#if 0 /* using sh2i.c for interrupts test */
-" .long _gdb_pit_isr /* 16: PIT */\n"
-" .long _gdb_ihandler_emac /* 0x11: (EMAC interface) */\n"
-" .long _gdb_unhandled_isr /* 0x12: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 0x13: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 0x14: (reserved) */\n"
+" .long gdb_pit_isr /* 16: PIT */\n"
+" .long gdb_ihandler_emac /* 0x11: (EMAC interface) */\n"
+" .long gdb_unhandled_isr /* 0x12: (reserved) */\n"
+" .long gdb_unhandled_isr /* 0x13: (reserved) */\n"
+" .long gdb_unhandled_isr /* 0x14: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 0x15: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 0x16: (reserved) */\n"
-" .long _gdb_ihandler_uart1 /* 0x17: (UART Console) */\n"
-" .long _gdb_unhandled_isr /* 0x18: (reserved) */\n"
+" .long gdb_unhandled_isr /* 0x15: (reserved) */\n"
+" .long gdb_unhandled_isr /* 0x16: (reserved) */\n"
+" .long gdb_ihandler_uart1 /* 0x17: (UART Console) */\n"
+" .long gdb_unhandled_isr /* 0x18: (reserved) */\n"
#else /* interrupts default to save space */
-" .long _gdb_unhandled_isr /* 16: PIT */\n"
-" .long _gdb_unhandled_isr /* 0x11: (EMAC interface) */\n"
-" .long _gdb_unhandled_isr /* 0x12: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 0x13: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 0x14: (reserved) */\n"
+" .long gdb_unhandled_isr /* 16: PIT */\n"
+" .long gdb_unhandled_isr /* 0x11: (EMAC interface) */\n"
+" .long gdb_unhandled_isr /* 0x12: (reserved) */\n"
+" .long gdb_unhandled_isr /* 0x13: (reserved) */\n"
+" .long gdb_unhandled_isr /* 0x14: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 0x15: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 0x16: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 0x17: (UART Console) */\n"
-" .long _gdb_unhandled_isr /* 0x18: (reserved) */\n"
+" .long gdb_unhandled_isr /* 0x15: (reserved) */\n"
+" .long gdb_unhandled_isr /* 0x16: (reserved) */\n"
+" .long gdb_unhandled_isr /* 0x17: (UART Console) */\n"
+" .long gdb_unhandled_isr /* 0x18: (reserved) */\n"
#endif
-" .long _gdb_unhandled_isr /* 25: (when AIC countdown reach 0) */\n"
-" .long _gdb_unhandled_isr /* 26: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 27: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 28: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 29: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 30: (reserved) */\n"
+" .long gdb_unhandled_isr /* 25: (when AIC countdown reach 0) */\n"
+" .long gdb_unhandled_isr /* 26: (reserved) */\n"
+" .long gdb_unhandled_isr /* 27: (reserved) */\n"
+" .long gdb_unhandled_isr /* 28: (reserved) */\n"
+" .long gdb_unhandled_isr /* 29: (reserved) */\n"
+" .long gdb_unhandled_isr /* 30: (reserved) */\n"
-" .long _gdb_unhandled_isr /* 31: (reserved) */\n"
-" .long _gdb_trapa32_isr /* 32: trap 32 instruction */\n"
-" .long _gdb_trapa33_isr /* 33: trap 33 instruction */\n"
-" .long _gdb_trapa34_isr /* 34: trap 34 instruction */\n"
-" .long _gdb_unhandled_isr /* */\n"
-" .long _gdb_unhandled_isr /* */\n"
-" .long _gdb_unhandled_isr /* */\n"
-" .long _gdb_unhandled_isr /* */\n"
-" .long _gdb_unhandled_isr /* */\n"
+" .long gdb_unhandled_isr /* 31: (reserved) */\n"
+" .long gdb_trapa32_isr /* 32: trap 32 instruction */\n"
+" .long gdb_trapa33_isr /* 33: trap 33 instruction */\n"
+" .long gdb_trapa34_isr /* 34: trap 34 instruction */\n"
+" .long gdb_unhandled_isr /* */\n"
+" .long gdb_unhandled_isr /* */\n"
+" .long gdb_unhandled_isr /* */\n"
+" .long gdb_unhandled_isr /* */\n"
+" .long gdb_unhandled_isr /* */\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
-" .long _gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
+" .long gdb_unhandled_isr\n"
#if CONFIG_CPU_TESTS == 1
".section .text\n"
".align 2\n"
@@ -232,7 +232,7 @@ __asm__(
" trapa #32\n"
" nop\n"
".align 2\n"
-"startup_k: .long _main_sh\n"
+"startup_k: .long main_sh\n"
#if CONFIG_CPU_TESTS == 1
"testjsr_k: .long _testjsr\n"
"testbra_k: .long _testbra\n"
diff --git a/boot/gdb/sh2.c b/boot/gdb/sh2.c
index 668d9fa..8e9f912 100644
--- a/boot/gdb/sh2.c
+++ b/boot/gdb/sh2.c
@@ -580,7 +580,7 @@ __asm__ (
".global gdb_return_from_exception\n"
"gdb_return_from_exception:\n"
/* find register_file */
-" mov.l %0, r0\n"
+" mov.l p_register_file, r0\n"
" lds.l @r0+, pr\n"
" ldc.l @r0+, gbr\n"
" ldc.l @r0+, vbr\n"
@@ -621,9 +621,7 @@ __asm__ (
" rte\n"
" nop\n"
".align 2\n"
-#if 0
-" register_file: .long _register_file\n"
-#endif
+" p_register_file: .long register_file\n"
/* "kill" and "detach" try to simulate a reset */
".section .text\n"
@@ -637,5 +635,4 @@ __asm__ (
" mov.l @r0, r0\n"
" jmp @r0\n"
" nop\n"
-
);
diff --git a/boot/linker/sh32.x b/boot/linker/sh32.x
index 17e3fbe..9e363cd 100644
--- a/boot/linker/sh32.x
+++ b/boot/linker/sh32.x
@@ -2,7 +2,8 @@
SuperH (SH-2) C Compiler Linker Script
**************************************/
-OUTPUT_FORMAT("elf32-sh")
+/* OUTPUT_FORMAT("elf32-sh") */
+OUTPUT_FORMAT("elf32-shbig-linux")
OUTPUT_ARCH(sh)
MEMORY
@@ -37,7 +38,10 @@ __idata_start = ADDR(.text) + SIZEOF(.text) + SIZEOF(.tors) + SIZEOF(.rodata);
.data : AT(__idata_start) {
__idata_start = .;
_sdata = . ;
+ *(.got)
+ *(.got.*)
*(.data)
+ *(.data.*)
_edata = . ;
} > ram
__idata_end = __idata_start + SIZEOF(.data);
diff --git a/boot/tests/testalu.s b/boot/tests/testalu.s
index 4590fe6..b61d42c 100644
--- a/boot/tests/testalu.s
+++ b/boot/tests/testalu.s
@@ -159,7 +159,7 @@ _negpass :
/*********
TAS.B @Rn
*********/
- mov.l _pram0, r1
+ mov.l pram0, r1
mov #0x55, r0
mov.b r0, @r1
tas.b @r1
@@ -418,7 +418,7 @@ _loop_dt:
/**********************
XOR.B #imm, @(R0, GBR)
**********************/
- mov.l _pram0, r1
+ mov.l pram0, r1
ldc r1, gbr
mov #0xaa, r0
@@ -484,7 +484,7 @@ _loop_dt:
/**********************
TST.B #imm, @(R0, GBR)
**********************/
- mov.l _pram0, r1
+ mov.l pram0, r1
ldc r1, gbr
mov #0xaa, r0
@@ -561,7 +561,7 @@ _loop_dt:
/**********************
AND.B #imm, @(R0, GBR)
**********************/
- mov.l _pram0, r1
+ mov.l pram0, r1
ldc r1, gbr
mov #0x00, r0
@@ -650,7 +650,7 @@ _loop_dt:
/*********************
OR.B #imm, @(R0, GBR)
*********************/
- mov.l _pram0, r1
+ mov.l pram0, r1
ldc r1, gbr
mov #0x00, r0
@@ -707,7 +707,7 @@ _loop_dt:
bra _constantend
nop
.align 4
-_pram0 : .long _ram0+128
+pram0 : .long ram0+128
_p7fffffff : .long 0x7fffffff
_p80000000 : .long 0x80000000
_p00112233 : .long 0x00112233
diff --git a/boot/tests/testbra.s b/boot/tests/testbra.s
index 49974be..757ce21 100644
--- a/boot/tests/testbra.s
+++ b/boot/tests/testbra.s
@@ -15,7 +15,7 @@ _testgo:
BRA and load contention
***********************/
mov #0x8b, r0
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.l r0, @r1
nop
@@ -173,7 +173,7 @@ _endjmpjsr:
BT/S disp
BF/S disp
*********/
- mov.l _pram0, r1
+ mov.l pram0, r1
mov #0xa0, r0
mov.b r0, @(0, r1)
add #1, r0
@@ -223,7 +223,7 @@ _btspass:
*********************/
mov #(target_bsrf - origin_bsrf), r0
mov #0xab, r1
- mov.l _pram0, r2
+ mov.l pram0, r2
bsrf r0
mov.l r1, @r2
origin_bsrf:
@@ -249,7 +249,7 @@ _bsrfend:
**********/
mov #(target_braf - origin_braf), r0
mov #0xab, r1
- mov.l _pram0, r2
+ mov.l pram0, r2
braf r0
mov.l r1, @r2
origin_braf:
@@ -518,7 +518,7 @@ _pabcdef78: .long 0xabcdef78
_pabcdef01: .long 0xabcdef01
_p00000001: .long 0x00000001
_pffffffff: .long 0xffffffff
-_pram0 : .long _ram0+128
+pram0 : .long ram0+128
.align 2
_constantend:
diff --git a/boot/tests/testmov.s b/boot/tests/testmov.s
index 7dd0cad..6f8c384 100644
--- a/boot/tests/testmov.s
+++ b/boot/tests/testmov.s
@@ -79,8 +79,8 @@ _ldssts:
****************/
_ldslstsl:
clrmac
- mov.l _pram0, r1
- mov.l _pram0_16, r2
+ mov.l pram0, r1
+ mov.l pram0_16, r2
mov.l _p01234567, r0
mov.l r0, @r1
!----
@@ -99,13 +99,13 @@ _ldslstsl:
jmp @r13
nop
!----
- mov.l _pram0_4, r4
+ mov.l pram0_4, r4
cmp/eq r4, r1
bt .+6
jmp @r13
nop
!----
- mov.l _pram0_12, r5 !_pram0+16-4
+ mov.l pram0_12, r5 !pram0+16-4
cmp/eq r5, r2
bt .+6
jmp @r13
@@ -116,8 +116,8 @@ _ldslstsl:
STS.L MACL, @-Rn
****************/
clrmac
- mov.l _pram0, r1
- mov.l _pram0_16, r2
+ mov.l pram0, r1
+ mov.l pram0_16, r2
mov.l _p89abcdef, r0
mov.l r0, @r1
!----
@@ -136,13 +136,13 @@ _ldslstsl:
jmp @r13
nop
!----
- mov.l _pram0_4, r4
+ mov.l pram0_4, r4
cmp/eq r4, r1
bt .+6
jmp @r13
nop
!----
- mov.l _pram0_12, r5 !_pram0+16-4
+ mov.l pram0_12, r5 !pram0+16-4
cmp/eq r5, r2
bt .+6
jmp @r13
@@ -152,8 +152,8 @@ _ldslstsl:
LDS.L @Rm+, PR
STS.L PR, @-Rn
**************/
- mov.l _pram0, r1
- mov.l _pram0_16, r2
+ mov.l pram0, r1
+ mov.l pram0_16, r2
mov.l _p11223344, r0
mov.l r0, @r1
!----
@@ -172,13 +172,13 @@ _ldslstsl:
jmp @r13
nop
!----
- mov.l _pram0_4, r4
+ mov.l pram0_4, r4
cmp/eq r4, r1
bt .+6
jmp @r13
nop
!----
- mov.l _pram0_12, r5 !_pram0+16-4
+ mov.l pram0_12, r5 !pram0+16-4
cmp/eq r5, r2
bt .+6
jmp @r13
@@ -191,8 +191,8 @@ _ldslstsl:
_ldclstcl:
mov #0, r0
ldc r0, sr
- mov.l _pram0, r1
- mov.l _pram0_16, r2
+ mov.l pram0, r1
+ mov.l pram0_16, r2
mov #0xff, r0
mov.l r0, @r1
mov.l _p000003f3, r0
@@ -212,13 +212,13 @@ _ldclstcl:
jmp @r13
nop
!----
- mov.l _pram0_4, r4
+ mov.l pram0_4, r4
cmp/eq r4, r1
bt .+6
jmp @r13
nop
!----
- mov.l _pram0_12, r5 !_pram0+16-4
+ mov.l pram0_12, r5 !pram0+16-4
cmp/eq r5, r2
bt .+6
jmp @r13
@@ -230,8 +230,8 @@ _ldclstcl:
***************/
mov #0, r0
ldc r0, gbr
- mov.l _pram0, r1
- mov.l _pram0_16, r2
+ mov.l pram0, r1
+ mov.l pram0_16, r2
mov.l _p11223344, r0
mov.l r0, @r1
!----
@@ -250,13 +250,13 @@ _ldclstcl:
jmp @r13
nop
!----
- mov.l _pram0_4, r4
+ mov.l pram0_4, r4
cmp/eq r4, r1
bt .+6
jmp @r13
nop
!----
- mov.l _pram0_12, r5 !_pram0+16-4
+ mov.l pram0_12, r5 !pram0+16-4
cmp/eq r5, r2
bt .+6
jmp @r13
@@ -268,8 +268,8 @@ _ldclstcl:
***************/
mov #0, r0
ldc r0, vbr
- mov.l _pram0, r1
- mov.l _pram0_16, r2
+ mov.l pram0, r1
+ mov.l pram0_16, r2
mov.l _p89abcdef, r0
mov.l r0, @r1
!----
@@ -288,13 +288,13 @@ _ldclstcl:
jmp @r13
nop
!----
- mov.l _pram0_4, r4
+ mov.l pram0_4, r4
cmp/eq r4, r1
bt .+6
jmp @r13
nop
!----
- mov.l _pram0_12, r5 !_pram0+16-4
+ mov.l pram0_12, r5 !pram0+16-4
cmp/eq r5, r2
bt .+6
jmp @r13
@@ -304,7 +304,7 @@ _ldclstcl:
MOV.L Rm, @-Rn
**************/
_movlramr:
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.l _paabbccdd, r0
!----
mov r1, r2
@@ -326,7 +326,7 @@ _movlramr:
MOV.W Rm, @-Rn
**************/
_movwramr:
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.w _paabb, r0
!----
mov r1, r2
@@ -348,7 +348,7 @@ _movwramr:
MOV.B Rm, @-Rn
**************/
_movbramr:
- mov.l _pram0, r1
+ mov.l pram0, r1
mov #0xaa, r0
!----
mov r1, r2
@@ -370,7 +370,7 @@ _movbramr:
MOV.L @Rm+, Rn
**************/
_movlarpr:
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.l _paabbccdd, r0
mov.l r0, @r1
!----
@@ -392,7 +392,7 @@ _movlarpr:
MOV.W @Rm+, Rn
**************/
_movwarpr:
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.w _paabb, r0
mov.w r0, @r1
!----
@@ -414,7 +414,7 @@ _movwarpr:
MOV.B @Rm+, Rn
**************/
_movbarpr:
- mov.l _pram0, r1
+ mov.l pram0, r1
mov #0xaa, r0
mov.b r0, @r1
!----
@@ -436,7 +436,7 @@ _movbarpr:
MOV.L @Rm+, Rm
**************/
_movlarpr2:
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.l _paabbccdd, r0
mov.l r0, @r1
!----
@@ -451,7 +451,7 @@ _movlarpr2:
MOV.W @Rm+, Rm
**************/
_movwarpr2:
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.w _paabb, r0
mov.w r0, @r1
!----
@@ -466,7 +466,7 @@ _movwarpr2:
MOV.B @Rm+, Rm
**************/
_movbarpr2:
- mov.l _pram0, r1
+ mov.l pram0, r1
mov #0xaa, r0
mov.b r0, @r1
!----
@@ -482,7 +482,7 @@ _movbarpr2:
MOV.L/W/B Rm, @Rn
*****************/
_movlwb:
- mov.l _pram0, r2
+ mov.l pram0, r2
mov.l _p11223344, r1
mov.l r1, @r2
!----
@@ -508,7 +508,7 @@ _movlwb:
jmp @r13
nop
!----
- mov.l _pram0, r0
+ mov.l pram0, r0
mov #0xaa, r1
mov.b r1, @r0
add #1, r0
@@ -522,7 +522,7 @@ _movlwb:
mov.l _pffffaabb, r9
mov.l _pffffffaa, r10
!----
- mov.l _pram0, r0
+ mov.l pram0, r0
mov.l @r0, r2
cmp/eq r2, r8
bt .+6
@@ -547,10 +547,10 @@ _movlwb:
bra _constantend
nop
.align 4
-_pram0 : .long _ram0+128
-_pram0_4 : .long _ram0+128+4
-_pram0_12 : .long _ram0+128+16-4
-_pram0_16 : .long _ram0+128+16
+pram0 : .long ram0+128
+pram0_4 : .long ram0+128+4
+pram0_12 : .long ram0+128+16-4
+pram0_16 : .long ram0+128+16
_p01234567: .long 0x01234567
_p89abcdef: .long 0x89abcdef
_p55aa55aa: .long 0x55aa55aa
@@ -573,13 +573,13 @@ _constantend:
CAS Rm, Rn, @R0
*****************/
_cas_r:
- mov.l _pram0_cas, r0
+ mov.l pram0_cas, r0
mov.l _p11223344_cas, r1
mov.l _p00001122_cas, r2
mov.l _p55aa55aa_cas, r3
mov.l r1, @r0
- mov.l _pram0_4_cas, r4
+ mov.l pram0_4_cas, r4
mov.l _paabbccdd_cas, r5
mov.l r5, @r4
!----
@@ -695,8 +695,8 @@ _cas_r:
bra _constantend_cas
nop
.align 4
-_pram0_cas : .long _ram0+128
-_pram0_4_cas : .long _ram0+128+4
+pram0_cas : .long ram0+128
+pram0_4_cas : .long ram0+128+4
_p55aa55aa_cas: .long 0x55aa55aa
_p11223344_cas: .long 0x11223344
_p00001122_cas: .long 0x00001122
diff --git a/boot/tests/testmov2.s b/boot/tests/testmov2.s
index 4ec3fce..056b9b6 100644
--- a/boot/tests/testmov2.s
+++ b/boot/tests/testmov2.s
@@ -50,7 +50,7 @@ _mova_target4:
MOV.W @(disp, GBR), R0
MOV.B @(disp, GBR), R0
**********************/
- mov.l _pram0, r1
+ mov.l pram0, r1
ldc r1, gbr
mov.l _p11223344, r0
@@ -111,9 +111,9 @@ _mova_target4:
MOV.W R0, @(disp, Rn)
MOV.B R0, @(disp, Rn)
*********************/
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.l _p11223344, r2
- mov.l _pram0_16, r3
+ mov.l pram0_16, r3
mov.l r2, @(16, r1)
mov.l @r3, r0
@@ -171,10 +171,10 @@ _mova_target4:
MOV.W @(disp, Rm), R0
MOV.B @(disp, Rm), R0
*********************/
- mov.l _pram0_16, r1
+ mov.l pram0_16, r1
mov.l _p11223344, r2
mov.l r2, @r1
- mov.l _pram0, r3
+ mov.l pram0, r3
mov.l @(16, r3), r4
cmp/eq r4, r2
@@ -200,14 +200,14 @@ _mova_target4:
/*******************
MOV.B @(R0, Rm), Rn
*******************/
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.l _p04050607, r0
mov.l _p11223344, r2
mov.l r0, @(0, r1)
mov.l r2, @(4, r1)
mov.b @(0, r1), r0
- mov.l _pram0, r3
+ mov.l pram0, r3
mov.b @(r0, r3), r4
mov.l _p00000011, r0
cmp/eq r4, r0
@@ -218,14 +218,14 @@ _mova_target4:
/*******************
MOV.W @(R0, Rm), Rn
*******************/
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.l _p04050607, r0
mov.l _p11223344, r2
mov.l r0, @(0, r1)
mov.l r2, @(4, r1)
mov.b @(0, r1), r0
- mov.l _pram0, r3
+ mov.l pram0, r3
mov.w @(r0, r3), r4
mov.l _p00001122, r0
cmp/eq r4, r0
@@ -236,14 +236,14 @@ _mova_target4:
/*******************
MOV.L @(R0, Rm), Rn
*******************/
- mov.l _pram0, r1
+ mov.l pram0, r1
mov.l _p04050607, r0
mov.l _p11223344, r2
mov.l r0, @(0, r1)
mov.l r2, @(4, r1)
mov.b @(0, r1), r0
- mov.l _pram0, r3
+ mov.l pram0, r3
mov.l @(r0, r3), r4
mov.l _p11223344, r0
cmp/eq r4, r0
@@ -251,7 +251,7 @@ _mova_target4:
jmp @r13
nop
- mov.l _pram0, r3
+ mov.l pram0, r3
mov.b @(0, r1), r0
mov.l @(r0, r3), r4
mov.l _p11223344, r0
@@ -263,8 +263,8 @@ _mova_target4:
/*******************
MOV.B Rm, @(R0, Rn)
*******************/
- mov.l _pram0, r1
- mov.l _pram0_16, r3
+ mov.l pram0, r1
+ mov.l pram0_16, r3
mov.l _p00010203, r0
mov.l _p04050607, r2
mov.l r0, @(0, r1)
@@ -296,8 +296,8 @@ _mova_target4:
/*******************
MOV.W Rm, @(R0, Rn)
*******************/
- mov.l _pram0, r1
- mov.l _pram0_16, r3
+ mov.l pram0, r1
+ mov.l pram0_16, r3
mov.l _p00010203, r0
mov.l _p04050607, r2
mov.l r0, @(0, r1)
@@ -329,8 +329,8 @@ _mova_target4:
/***********************
MOV.L Rm, @(R0, Rn)
***********************/
- mov.l _pram0, r1
- mov.l _pram0_16, r3
+ mov.l pram0, r1
+ mov.l pram0_16, r3
mov.l _p00010203, r0
mov.l _p04050607, r2
mov.l r0, @(0, r1)
@@ -362,7 +362,7 @@ _mova_target4:
mov.l _p01234567, r2
mov.b @(4, r1), r0 ! r0=4
- mov.l _pram0_16, r3
+ mov.l pram0_16, r3
mov.l r2, @(r0, r3)
mov r3, r5
add #4, r5
@@ -378,10 +378,10 @@ _mova_target4:
bra _constantend
nop
.align 4
-_pram0 : .long _ram0+128
-_pram0_4 : .long _ram0+128+4
-_pram0_12 : .long _ram0+128+16-4
-_pram0_16 : .long _ram0+128+16
+pram0 : .long ram0+128
+pram0_4 : .long ram0+128+4
+pram0_12 : .long ram0+128+16-4
+pram0_16 : .long ram0+128+16
_p01234567: .long 0x01234567
_p89abcdef: .long 0x89abcdef
_p55aa55aa: .long 0x55aa55aa
diff --git a/boot/tests/testmulconf.s b/boot/tests/testmulconf.s
index 264a658..82fed13 100644
--- a/boot/tests/testmulconf.s
+++ b/boot/tests/testmulconf.s
@@ -42,8 +42,8 @@ _testgo:
!---------------------
!===[5]===============
!---------------------
- mov.l _pram20, r4
- mov.l _pram21, r5
+ mov.l pram20, r4
+ mov.l pram21, r5
mov #3, r0
mov.w r0, @r4
add #2, r4
@@ -66,8 +66,8 @@ _testgo:
jmp @r13
nop
!----
- mov.l _pram20, r4
- mov.l _pram21, r5
+ mov.l pram20, r4
+ mov.l pram21, r5
mov #4, r0
mov.w r0, @r4
add #2, r4
@@ -90,7 +90,7 @@ _testgo:
jmp @r13
nop
!---------------------
- mov.l _pram20, r4
+ mov.l pram20, r4
mov #4, r0
mov.w r0, @r4
add #2, r4
@@ -110,7 +110,7 @@ _testgo:
jmp @r13
nop
!----
- mov.l _pram20, r4
+ mov.l pram20, r4
mov #7, r0
mov.w r0, @r4
add #2, r4
@@ -133,14 +133,14 @@ _testgo:
bra skip3
nop
.align 4
-_pram20: .long _ram0+128
-_pram21: .long _ram0+128+0x10
+pram20: .long ram0+128
+pram21: .long ram0+128+0x10
skip3:
!---------------------
!===[4]===============
!---------------------
mov #0x55, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
mov #8, r1
mov #9, r2
@@ -160,7 +160,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
mov #7, r1
mov #-8, r2
@@ -180,7 +180,7 @@ skip3:
nop
!---------------------
mov #0x55, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
mov #6, r1
mov #7, r2
@@ -200,7 +200,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
mov #5, r1
mov #6, r2
lds r0, mach
@@ -219,7 +219,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
mov #5, r1
mov #-6, r2
lds r0, mach
@@ -238,7 +238,7 @@ skip3:
nop
!---------------------
mov #0xff, r1
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
mov.l r1, @r4
lds r1, mach
@@ -259,7 +259,7 @@ skip3:
nop
!---------------------
mov #0xff, r1
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r1, mach
mov #0, r0 ! S=0
@@ -279,7 +279,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r0, macl
mov r4, r5
@@ -305,7 +305,7 @@ skip3:
!---------------------
mov #0xaa, r0
mov #0x55, r1
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r0, macl
sts.l macl, @-r4 ! <--------
@@ -322,7 +322,7 @@ skip3:
nop
!---------------------
mov #0x55, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r0, macl
sts.l macl, @-r4 ! <--------
@@ -339,7 +339,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #8, r4
lds r0, macl
sts.l macl, @-r4 ! <--------
@@ -361,7 +361,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r0, macl
sts.l macl, @-r4 ! <--------
@@ -379,7 +379,7 @@ skip3:
!===[3]===============
!---------------------
mov #0x55, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
mov #8, r1
mov #9, r2
@@ -398,7 +398,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
mov #7, r1
mov #-8, r2
@@ -417,7 +417,7 @@ skip3:
nop
!---------------------
mov #0x55, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
mov #6, r1
mov #7, r2
@@ -436,7 +436,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
mov #5, r1
mov #6, r2
lds r0, mach
@@ -454,7 +454,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
mov #5, r1
mov #-6, r2
lds r0, mach
@@ -472,7 +472,7 @@ skip3:
nop
!---------------------
mov #0xff, r1
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
mov.l r1, @r4
lds r1, mach
@@ -493,7 +493,7 @@ skip3:
nop
!---------------------
mov #0xff, r1
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r1, mach
mov #0, r0 ! S=0
@@ -513,7 +513,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r0, mach
mov r4, r5
@@ -539,7 +539,7 @@ skip3:
!---------------------
mov #0xaa, r0
mov #0x55, r1
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r0, mach
sts.l mach, @-r4 ! <--------
@@ -556,7 +556,7 @@ skip3:
nop
!---------------------
mov #0x55, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r0, mach
sts.l mach, @-r4 ! <--------
@@ -573,7 +573,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #8, r4
lds r0, mach
sts.l mach, @-r4 ! <--------
@@ -595,7 +595,7 @@ skip3:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram10, r4
+ mov.l pram10, r4
add #4, r4
lds r0, mach
sts.l mach, @-r4 ! <--------
@@ -614,14 +614,14 @@ skip3:
bra skip2
nop
.align 4
-_pram10: .long _ram0+128
-_pram11: .long _ram0+128+0x10
+pram10: .long ram0+128
+pram11: .long ram0+128+0x10
skip2:
!---------------------
!===[2]===============
!---------------------
mov #0x55, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #8, r1
mov #9, r2
@@ -640,7 +640,7 @@ skip2:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #7, r1
mov #-8, r2
@@ -659,7 +659,7 @@ skip2:
nop
!---------------------
mov #0x55, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #6, r1
mov #7, r2
@@ -678,7 +678,7 @@ skip2:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #5, r1
mov #6, r2
@@ -697,7 +697,7 @@ skip2:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #5, r1
mov #-6, r2
@@ -718,13 +718,13 @@ skip2:
mov #0, r0
mov #4, r1
mov #5, r2
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
add #4, r4
mov.l r1, @r4
add #4, r4
mov.l r2, @r4
- mov.l _pram00, r4
+ mov.l pram00, r4
lds r0, mach ! R0=0
ldc r0, sr ! S=0
lds.l @r4+, macl ! <--------
@@ -743,13 +743,13 @@ skip2:
mov #0, r0
mov #4, r1
mov #5, r2
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
add #4, r4
mov.w r1, @r4
add #2, r4
mov.w r2, @r4
- mov.l _pram00, r4
+ mov.l pram00, r4
lds r0, mach ! R0=0
ldc r0, sr ! S=0
lds.l @r4+, macl ! <--------
@@ -765,7 +765,7 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0xaa, r0
mov.l r0, @r4
mov r4, r5
@@ -780,7 +780,7 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0x55, r0
mov.l r0, @r4
mov #0xaa, r1
@@ -792,7 +792,7 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0x55, r0
mov.l r0, @r4
mov #0x00, r1
@@ -804,10 +804,10 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0x55, r0
mov.l r0, @r4
- mov.l _pram01, r5
+ mov.l pram01, r5
lds.l @r4+, macl ! <--------
sts.l macl, @-r5 ! <--------
mov.l @r5+, r0
@@ -816,7 +816,7 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0xaa, r0
mov.l r0, @r4
lds.l @r4+, macl ! <--------
@@ -829,7 +829,7 @@ skip2:
!===[1]===============
!---------------------
mov #0x55, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #8, r1
mov #9, r2
@@ -847,7 +847,7 @@ skip2:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #7, r1
mov #-8, r2
@@ -865,7 +865,7 @@ skip2:
nop
!---------------------
mov #0x55, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #6, r1
mov #7, r2
@@ -883,7 +883,7 @@ skip2:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #5, r1
mov #6, r2
@@ -901,7 +901,7 @@ skip2:
nop
!---------------------
mov #0xaa, r0
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
mov #5, r1
mov #-6, r2
@@ -921,13 +921,13 @@ skip2:
mov #0, r0
mov #4, r1
mov #5, r2
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
add #4, r4
mov.l r1, @r4
add #4, r4
mov.l r2, @r4
- mov.l _pram00, r4
+ mov.l pram00, r4
lds r0, macl ! R0=0
ldc r0, sr ! S=0
lds.l @r4+, mach ! <--------
@@ -946,13 +946,13 @@ skip2:
mov #0, r0
mov #4, r1
mov #5, r2
- mov.l _pram00, r4
+ mov.l pram00, r4
mov.l r0, @r4
add #4, r4
mov.w r1, @r4
add #2, r4
mov.w r2, @r4
- mov.l _pram00, r4
+ mov.l pram00, r4
lds r0, macl ! R0=0
ldc r0, sr ! S=0
lds.l @r4+, mach ! <--------
@@ -968,7 +968,7 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0xaa, r0
mov.l r0, @r4
mov r4, r5
@@ -983,7 +983,7 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0x55, r0
mov.l r0, @r4
mov #0xaa, r1
@@ -995,7 +995,7 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0x55, r0
mov.l r0, @r4
mov #0x00, r1
@@ -1007,10 +1007,10 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0x55, r0
mov.l r0, @r4
- mov.l _pram01, r5
+ mov.l pram01, r5
lds.l @r4+, mach ! <--------
sts.l mach, @-r5 ! <--------
mov.l @r5+, r0
@@ -1019,7 +1019,7 @@ skip2:
jmp @r13
nop
!---------------------
- mov.l _pram00, r4
+ mov.l pram00, r4
mov #0xaa, r0
mov.l r0, @r4
lds.l @r4+, mach ! <--------
@@ -1034,8 +1034,8 @@ skip2:
nop
!-----------------------------
.align 4
-_pram00: .long _ram0+128
-_pram01: .long _ram0+128+0x10
+pram00: .long ram0+128
+pram01: .long ram0+128+0x10
!-----------------------------
_testfinish:
diff --git a/tools/soc.mk b/tools/soc.mk
index 553b219..e8873fe 100644
--- a/tools/soc.mk
+++ b/tools/soc.mk
@@ -64,10 +64,10 @@ config/config.vhd: force
# a reliable indicator of change.
ROM_BIN ?= boot.elf
main.srec: $(ROM_BIN) force
- sh2-elf-objcopy -v -O srec --srec-forceS3 $< $@
+ $(CROSS_COMPILE)objcopy -v -O srec --srec-forceS3 $< $@
boot.bin: $(ROM_BIN) force
- sh2-elf-objcopy -v -O binary $< $@
+ $(CROSS_COMPILE)objcopy -v -O binary $< $@
ram.dat: main.srec
$(TOOLS_DIR)/genram/genram-32k $<
--
2.7.4 (Apple Git-66)
More information about the J-core
mailing list