diff --git a/build/libraries/sample_dll/ARM7/Makefile b/build/libraries/sample_dll/ARM7/Makefile new file mode 100644 index 0000000..779f643 --- /dev/null +++ b/build/libraries/sample_dll/ARM7/Makefile @@ -0,0 +1,62 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - libraries - dll_sample/ARM7 +# File: Makefile +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Log: $ +# $NoKeywords: $ +#---------------------------------------------------------------------------- + +SUBDIRS = + + +#---------------------------------------------------------------------------- + +# build ARM & THUMB libraries +TWL_CODEGEN_ALL ?= True + +# Codegen for sub processer +TWL_PROC = ARM7 + +SRCDIR = ../common/src src + +SRCS = \ + shirait.c \ + miya.c \ + +TARGET_LIB = libsampledll_sp$(TWL_LIBSUFFIX).a + + +#---------------------------------------------------------------------------- + +# DEBUG版ビルドの場合、RELEASE版でビルドして +# DEBUG版のライブラリを装います。 + +ifdef NITRO_DEBUG +NITRO_BUILD_TYPE = RELEASE +endif + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +GINCLUDES += $(TWL_INCDIR)/twl/fatfs/ARM7 + +INSTALL_TARGETS = $(TARGETS) +INSTALL_DIR = .. + + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile ===== diff --git a/build/libraries/sample_dll/ARM7/src/miya.c b/build/libraries/sample_dll/ARM7/src/miya.c new file mode 100644 index 0000000..100a2b1 --- /dev/null +++ b/build/libraries/sample_dll/ARM7/src/miya.c @@ -0,0 +1,43 @@ +#include +#include + +void global_func( void ); +static int internal_data = 2; +int global_data = 3; +extern int no_data; + +extern void g_func( void); + +#define NUM_OF_DATA 0x1 + +static int internal_func( void ) +{ + int a = 1; + int b = 2; + int i; + int c[NUM_OF_DATA]; + internal_data = 1; + a += b; + + for( i = 0 ; i < NUM_OF_DATA ; i++) { + c[i] = i; + } + + for( i = 0 ; i < NUM_OF_DATA ; i++) { + a += c[i]; + } + + OS_TPrintf("aho\n"); + g_func(); + + return a; +} + +void global_func( void ) +{ + int c; + c = internal_func(); + global_data = 1; + no_data = 4; + OS_Printf("aho %d\n",c); +} diff --git a/build/libraries/sample_dll/ARM7/src/miya_object.h b/build/libraries/sample_dll/ARM7/src/miya_object.h new file mode 100644 index 0000000..9c63ad9 --- /dev/null +++ b/build/libraries/sample_dll/ARM7/src/miya_object.h @@ -0,0 +1,7 @@ + +#ifndef __MIYA_H__ +#define __MIYA_H__ + +typedef void (*global_func_p)( void); + +#endif /*__MIYA_H__*/ diff --git a/build/libraries/sample_dll/ARM7/src/shirait.c b/build/libraries/sample_dll/ARM7/src/shirait.c new file mode 100644 index 0000000..24eb42c --- /dev/null +++ b/build/libraries/sample_dll/ARM7/src/shirait.c @@ -0,0 +1,62 @@ +#include + +static int a_func( void); +static int i_func( void); +void g_func( void); + +static u16 i_data = 2; +u16 g_data = 3; + +#define D_NUM 0x4 + + +#include +static int a_func( void) +{ + u16 a = 5; + u16 b = 7; + + a+= b; + if( ((vu16)(g_data)) > 2) { + a+= i_func(); + } + + OS_TPrintf( "arm_a_func\n"); + return a; +} +#include + + + +#include +static int i_func( void) +{ + u16 a = 1; + u16 b = 2; + u16 i; + u16 c[D_NUM]; + + i_data = 1; + a+= b; + + OS_TPrintf( "thumb_i_func\n"); + return a; +} + +void g_func( void) +{ + u16 c; + + if( ((vu16)(g_data)) > 2) { + c = a_func(); + i_func(); + }else{ + c = i_func(); + a_func(); + } + + OS_Printf( "t_func %d\n", c); +} +#include + + diff --git a/build/libraries/sample_dll/ARM7/src/shirait_object.h b/build/libraries/sample_dll/ARM7/src/shirait_object.h new file mode 100644 index 0000000..f311204 --- /dev/null +++ b/build/libraries/sample_dll/ARM7/src/shirait_object.h @@ -0,0 +1,7 @@ + +#ifndef __SHIRAIT_H__ +#define __SHIRAIT_H__ + +typedef void (*g_func_p)( void); + +#endif /*__SHIRAIT_H__*/ diff --git a/build/libraries/sample_dll/Makefile b/build/libraries/sample_dll/Makefile new file mode 100644 index 0000000..30f7109 --- /dev/null +++ b/build/libraries/sample_dll/Makefile @@ -0,0 +1,34 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - libraries - aes +# File: Makefile +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Log: $ +# $NoKeywords: $ +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + + +#---------------------------------------------------------------------------- + +#SUBDIRS = ARM9 + +ifdef TWL_WITH_ARM7 +SUBDIRS += ARM7 +endif + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile =====