mirror of
https://github.com/rvtr/twl_wrapsdk.git
synced 2025-10-31 06:11:10 -04:00
fix dll system
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@156 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
parent
0c34a21d35
commit
abe75431be
@ -7,7 +7,8 @@
|
|||||||
#include "sample1.h"
|
#include "sample1.h"
|
||||||
#include "dlltest.h"
|
#include "dlltest.h"
|
||||||
|
|
||||||
#define PRINTDEBUG( ...) ((void)0)
|
#define PRINTDEBUG OS_TPrintf
|
||||||
|
// #define PRINTDEBUG( ...) ((void)0)
|
||||||
|
|
||||||
|
|
||||||
#define _DLL_LINK_DYNAMIC_ (1)
|
#define _DLL_LINK_DYNAMIC_ (1)
|
||||||
@ -94,15 +95,32 @@ void TwlSpMain( void)
|
|||||||
{
|
{
|
||||||
ElDesc dll_desc;
|
ElDesc dll_desc;
|
||||||
u32 i;
|
u32 i;
|
||||||
|
OSHeapHandle heapHandle;
|
||||||
u32 free_bytes, free_blocks, total_blocks;
|
u32 free_bytes, free_blocks, total_blocks;
|
||||||
u8 rslt;
|
u8 rslt;
|
||||||
u32 len;
|
u32 len;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
// vmsk_log(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_EMERG)) ;
|
// OS初期化
|
||||||
PRINTDEBUG( "Sample program starts (exinf = %d).\n", (INT) exinf);
|
OS_Init();
|
||||||
PRINTDEBUG( "printf test 0.03 = %f\n", 0.03);
|
|
||||||
|
OS_InitTick();
|
||||||
|
OS_InitAlarm();
|
||||||
|
|
||||||
|
// PXI初期化、ARM9と同期
|
||||||
|
PXI_Init();
|
||||||
|
|
||||||
|
// ヒープ領域設定
|
||||||
|
// heapHandle = InitializeAllocateSystem();
|
||||||
|
|
||||||
|
(void)OS_EnableIrq();
|
||||||
|
(void)OS_EnableInterrupts();
|
||||||
|
|
||||||
|
OS_InitThread();
|
||||||
|
|
||||||
|
|
||||||
|
// vmsk_log(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_EMERG)) ;
|
||||||
|
PRINTDEBUG( "Sample program starts.\n");
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
PRINTDEBUG("Sample program starts.\n");
|
PRINTDEBUG("Sample program starts.\n");
|
||||||
@ -144,7 +162,8 @@ void TwlSpMain( void)
|
|||||||
|
|
||||||
|
|
||||||
/*----------*/
|
/*----------*/
|
||||||
fd = po_open( (byte*)"\\libdlltest.a", (PO_CREAT|PO_BINARY|PO_WRONLY), PS_IREAD);
|
// fd = po_open( (byte*)"\\libdlltest.a", (PO_CREAT|PO_BINARY|PO_WRONLY), PS_IREAD);
|
||||||
|
fd = po_open( (byte*)"\\libsampledll_sp.twl.a", (PO_CREAT|PO_BINARY|PO_WRONLY), PS_IREAD);
|
||||||
if( fd < 0) {
|
if( fd < 0) {
|
||||||
PRINTDEBUG( "po_open failed.\n");
|
PRINTDEBUG( "po_open failed.\n");
|
||||||
while( 1) {};
|
while( 1) {};
|
||||||
|
|||||||
@ -3,42 +3,40 @@
|
|||||||
#ifndef __STATIC_SYM_LIST__
|
#ifndef __STATIC_SYM_LIST__
|
||||||
#define __STATIC_SYM_LIST__
|
#define __STATIC_SYM_LIST__
|
||||||
|
|
||||||
#include <twl_sp.h>
|
#include <twl.h>
|
||||||
#include <el/elf_loader.h>
|
#include <el/elf_loader.h>
|
||||||
|
|
||||||
/*--------------------------------
|
/*--------------------------------
|
||||||
extern symbol
|
extern symbol
|
||||||
--------------------------------*/
|
--------------------------------*/
|
||||||
extern int no_data;
|
|
||||||
extern void __aeabi_unwind_cpp_pr0( void);
|
|
||||||
//extern void Lib$$Request$$armlib( void);
|
|
||||||
|
|
||||||
/*--------------------------------
|
/*--------------------------------
|
||||||
symbol structure
|
symbol structure
|
||||||
--------------------------------*/
|
--------------------------------*/
|
||||||
ElAdrEntry AdrEnt_no_data = {
|
ElAdrEntry AdrEnt_OS_TPrintf = {
|
||||||
(void*)NULL,
|
(void*)NULL,
|
||||||
(char*)"no_data\0",
|
(char*)"OS_TPrintf\0",
|
||||||
(void*)&no_data,
|
(void*)OS_TPrintf,
|
||||||
0,
|
|
||||||
0,
|
|
||||||
};
|
|
||||||
/*
|
|
||||||
ElAdrEntry AdrEnt_Lib$$Request$$armlib = {
|
|
||||||
(void*)NULL,
|
|
||||||
(char*)"Lib$$Request$$armlib\0",
|
|
||||||
(void*)Lib$$Request$$armlib,
|
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
};*/
|
};
|
||||||
|
ElAdrEntry AdrEnt_OS_Printf = {
|
||||||
|
(void*)NULL,
|
||||||
|
(char*)"OS_Printf\0",
|
||||||
|
(void*)OS_Printf,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------
|
/*--------------------------------
|
||||||
API
|
API
|
||||||
--------------------------------*/
|
--------------------------------*/
|
||||||
void elAddStaticSym( void)
|
void elAddStaticSym( void)
|
||||||
{
|
{
|
||||||
elAddAdrEntry( &AdrEnt_no_data);
|
elAddAdrEntry( &AdrEnt_OS_TPrintf);
|
||||||
// elAddAdrEntry( &AdrEnt_Lib$$Request$$armlib);
|
elAddAdrEntry( &AdrEnt_OS_Printf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /*__STATIC_SYM_LIST__*/
|
#endif /*__STATIC_SYM_LIST__*/
|
||||||
|
|||||||
@ -223,8 +223,8 @@ int main(int argc, char *argv[])
|
|||||||
file_write( "#ifndef __STATIC_SYM_LIST__\n", CSourceFilep);
|
file_write( "#ifndef __STATIC_SYM_LIST__\n", CSourceFilep);
|
||||||
file_write( "#define __STATIC_SYM_LIST__\n", CSourceFilep);
|
file_write( "#define __STATIC_SYM_LIST__\n", CSourceFilep);
|
||||||
file_write( "\n", CSourceFilep);
|
file_write( "\n", CSourceFilep);
|
||||||
file_write( "#include <ctr.h>\n", CSourceFilep);
|
file_write( "#include <twl.h>\n", CSourceFilep);
|
||||||
file_write( "#include <elf_loader.h>\n", CSourceFilep);
|
file_write( "#include <el/elf_loader.h>\n", CSourceFilep);
|
||||||
file_write( "\n", CSourceFilep);
|
file_write( "\n", CSourceFilep);
|
||||||
|
|
||||||
EL_ResolveAllLibrary(); //抽出シンボルのマーキング
|
EL_ResolveAllLibrary(); //抽出シンボルのマーキング
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user