diff --git a/trunk/bootrom/build/buildtools/commondefs b/trunk/bootrom/build/buildtools/commondefs index 2d02abe..d2f5618 100644 --- a/trunk/bootrom/build/buildtools/commondefs +++ b/trunk/bootrom/build/buildtools/commondefs @@ -138,9 +138,9 @@ CTR_DEBUGGER ?= $(BROM_DEBUGGER) ifeq ($(BROM_TARGET),BROM) ifndef BROM_PROMGEN ifeq ($(CODEGEN_PROC),ARM11) -CRT0_O ?= crt0.o crt0_secure.o +CRT0_O ?= crt0.o crt0_excp.o crt0_secure.o else # CODEGEN_PROC==ARM9 -CRT0_O ?= crt0.o crt0_secure_sp.o +CRT0_O ?= crt0.o crt0_excp.o crt0_secure_sp.o endif # CODEGEN_PROC==ARM9 endif # BROM_PROMGEN else # BROM_TARGET diff --git a/trunk/bootrom/build/libraries/init/ARM11/Makefile b/trunk/bootrom/build/libraries/init/ARM11/Makefile index 907abb3..341363d 100644 --- a/trunk/bootrom/build/libraries/init/ARM11/Makefile +++ b/trunk/bootrom/build/libraries/init/ARM11/Makefile @@ -29,8 +29,8 @@ BROM_PROC = ARM11 SRCDIR = ../common . -SRCS = crt0.c crt0_secure.c crt0_scat.c # crt0_app.c -TARGET_OBJ = crt0.o crt0_secure.o crt0_scat.o # crt0_app.o +SRCS = crt0.c crt0_secure.c crt0_scat.c crt0_excp.c # crt0_app.c +TARGET_OBJ = crt0.o crt0_secure.o crt0_scat.o crt0_excp.o # crt0_app.o #---------------------------------------------------------------------------- diff --git a/trunk/bootrom/build/libraries/init/ARM11/crt0.c b/trunk/bootrom/build/libraries/init/ARM11/crt0.c index 7ff2f72..e46262e 100644 --- a/trunk/bootrom/build/libraries/init/ARM11/crt0.c +++ b/trunk/bootrom/build/libraries/init/ARM11/crt0.c @@ -35,6 +35,9 @@ asm void _start( void ) CODE32 // for _start reference INASM_EXTERN( STUPi_StartHandler ) + INASM_EXTERN( STUPi_SwiHandler ) + INASM_EXTERN( STUPi_IrqHandler ) + INASM_EXTERN( STUPi_DbgHandler ) b stupStartHandlerVeneer // don't change for NULL access compatibility undef b STUPi_DbgHandler @@ -47,8 +50,5 @@ fiq b STUPi_DbgHandler stupStartHandlerVeneer b STUPi_StartHandler - DCD 0 } -#include <../common/crt0_excpHandler.c> - diff --git a/trunk/bootrom/build/libraries/init/ARM9/Makefile b/trunk/bootrom/build/libraries/init/ARM9/Makefile index bad1fd2..41759ef 100644 --- a/trunk/bootrom/build/libraries/init/ARM9/Makefile +++ b/trunk/bootrom/build/libraries/init/ARM9/Makefile @@ -29,8 +29,8 @@ BROM_PROC = ARM9 SRCDIR = ../common . -SRCS = crt0.c crt0_secure_sp.c crt0_scat.c # crt0_app.c -TARGET_OBJ = crt0.o crt0_secure_sp.o crt0_scat.o # crt0_app.o +SRCS = crt0.c crt0_secure_sp.c crt0_scat.c crt0_excp.c # crt0_app.c +TARGET_OBJ = crt0.o crt0_secure_sp.o crt0_scat.o crt0_excp.o # crt0_app.o #---------------------------------------------------------------------------- diff --git a/trunk/bootrom/build/libraries/init/ARM9/crt0.c b/trunk/bootrom/build/libraries/init/ARM9/crt0.c index 7d0eead..3200320 100644 --- a/trunk/bootrom/build/libraries/init/ARM9/crt0.c +++ b/trunk/bootrom/build/libraries/init/ARM9/crt0.c @@ -35,6 +35,9 @@ asm void _start( void ) CODE32 // for _start reference INASM_EXTERN( STUPi_StartHandler ) + INASM_EXTERN( STUPi_SwiHandler ) + INASM_EXTERN( STUPi_IrqHandler ) + INASM_EXTERN( STUPi_DbgHandler ) b stupStartHandlerVeneer // don't change for NULL access compatibility undef b STUPi_DbgHandler @@ -55,6 +58,3 @@ stupStartHandlerVeneer DCD |Image$$SVC_RW$$Base| DCD |Load$$SVC_RW$$Base| } - -#include <../common/crt0_excpHandler.c> - diff --git a/trunk/bootrom/build/libraries/init/common/crt0_excpHandler.c b/trunk/bootrom/build/libraries/init/common/crt0_excp.c similarity index 95% rename from trunk/bootrom/build/libraries/init/common/crt0_excpHandler.c rename to trunk/bootrom/build/libraries/init/common/crt0_excp.c index f89d4eb..a0e96e8 100644 --- a/trunk/bootrom/build/libraries/init/common/crt0_excpHandler.c +++ b/trunk/bootrom/build/libraries/init/common/crt0_excp.c @@ -81,6 +81,8 @@ semi_vector asm void STUPi_SwiHandler( void ) { + INASM_EXTERN( _start ) + stmfd sp!, {r11, r12, lr} // SVCモード レジスタ退避 ldrh r12, [lr, #-2] // システムコールNo取得(ハーフワードアクセス対応) mov r12, r12, lsl #1 @@ -93,7 +95,7 @@ asm void STUPi_SwiHandler( void ) adr r11, SWI_Table // システムコールアドレス 取得 ldrh r12, [r11, r12] #ifdef SDK_ARM9 - adr r11, _start // = HW_BIOS + ldr r11, =HW_BIOS orr r12, r12, r11 #endif // SDK_ARM9 diff --git a/trunk/bootrom/include/brom/hw/ARM11/mmap_brom.h b/trunk/bootrom/include/brom/hw/ARM11/mmap_brom.h index bec56b2..79bc22c 100644 --- a/trunk/bootrom/include/brom/hw/ARM11/mmap_brom.h +++ b/trunk/bootrom/include/brom/hw/ARM11/mmap_brom.h @@ -35,6 +35,9 @@ extern "C" { #define HW_BROM_NML HW_BROM #define HW_BROM_NML_END (HW_BROM_NML + HW_BROM_NML_SIZE) #define HW_BROM_NML_SIZE 0x8000 // 32KB +#define HW_BROM_NML_ABT HW_BROM_NML +#define HW_BROM_NML_ABT_END (HW_BROM_NML_ABT + HW_BROM_NML_ABT_SIZE) +#define HW_BROM_NML_ABT_SIZE 0x1000 // 4KB #define HW_BROM_SEC HW_BROM_NML_END #define HW_BROM_SEC_END (HW_BROM_SEC + HW_BROM_SEC_SIZE) #define HW_BROM_SEC_SIZE 0x8000 // 32KB diff --git a/trunk/bootrom/include/brom/specfiles/ARM11-TEG.ldscript.template b/trunk/bootrom/include/brom/specfiles/ARM11-TEG.ldscript.template index d718580..ce0aa47 100644 --- a/trunk/bootrom/include/brom/specfiles/ARM11-TEG.ldscript.template +++ b/trunk/bootrom/include/brom/specfiles/ARM11-TEG.ldscript.template @@ -28,8 +28,9 @@ LOAD_NORMAL HW_BROM_NML HW_BROM_NML_SIZE { *crt0.*o (.emb_text, +FIRST) } - NML_RO +0 + NML_RO HW_BROM_NML_ABT_END { + *crt0_excp.o (.emb_text) *libos*.brom*.a (:gdef:OSi_Boot) *libos*.brom*.a (:gdef:OSi_BootCore) *libos*.brom*.a (:gdef:OSi_ClearWorkArea) diff --git a/trunk/bootrom/include/brom/specfiles/ARM9-TEG.ldscript.template b/trunk/bootrom/include/brom/specfiles/ARM9-TEG.ldscript.template index a2fe515..6ce7116 100644 --- a/trunk/bootrom/include/brom/specfiles/ARM9-TEG.ldscript.template +++ b/trunk/bootrom/include/brom/specfiles/ARM9-TEG.ldscript.template @@ -27,6 +27,7 @@ LOAD_NORMAL HW_BROM_NML HW_BROM_NML_SIZE STUP_ENTRY +0 { *crt0.*o (.emb_text, +FIRST) + *crt0_excp.o (.emb_text) } NML_RO +0 {