For v2003.06.01 Release $Revision: 1.9 $ Support: ------------- Language : C - C++ Features : Component Testing - Code Coverage - Memory Profiling - Performance Profiling - Trace Tested Against: ------------------------ Host Machine : Windows 2000 Compiler : ARM Developer Suite 1.0.1 Linker : ARM Developer Suite 1.0.1 Debugger : ARM Developer Suite 1.0.1 OS : None Target : ARMulator c obj axf C:\Program Files\ARM\ARM Developer Suite\Include -W -ec -fy -g -elf -debug -map -list MapFile.map C:\Program Files\ARM\ARM Developer Suite\lib ENV_PATH C:\Program Files\ARM\ARM Developer Suite\Bin;$ENV{'PATH'} COMPILER armcc.exe PREPROCESSOR armcc.exe LINKER armlink.exe DEBUGGER adw.exe STD_INCLUDE C:\Program Files\ARM\ARM Developer Suite\Include cpp obj axf C:\Program Files\ARM\ARM Developer Suite\Include -W -ec -fy -g -elf -debug -map -list MapFile.map C:\Program Files\ARM\ARM Developer Suite\lib ENV_PATH C:\Program Files\ARM\ARM Developer Suite\Bin;$ENV{'PATH'} COMPILER armcpp.exe PREPROCESSOR armcpp.exe LINKER armlink.exe DEBUGGER adw.exe STD_INCLUDE C:\Program Files\ARM\ARM Developer Suite\Include sub atl_cc($$$$\@\@) { my ( $lang,$src,$out,$cflags,$Defines,$Includes) = @_; my $defines = ""; foreach $D ( @$Defines ) { $defines .= " \"-D$D\"" ; } my $includes = ""; foreach $I ( @$Includes ) { $includes .= " \"-I$I\"" ; } SystemP( "$Ini{'COMPILER'} -c $cflags $defines $includes \"$src\" -o \"$out\""); } sub atl_cpp($$$$\@\@) { my ( $lang,$src,$out,$cflags,$Defines,$Includes) = @_; my $defines = ""; foreach $D ( @$Defines ) { $defines .= " \"-D$D\"" ; } my $includes = ""; foreach $I ( @$Includes ) { $includes .= " \"-I$I\"" ; } $status=SystemP( "$Ini{'PREPROCESSOR'} -E $cflags $defines $includes \"$src\" -o \"$out\"" ); return($status) if($status!=0); } 1; sub atl_link($\@$\@$) { my ($exe,$Objects,$ldflags,$LibPath,$libs) = @_; my $objects = ""; foreach $O ( @$Objects ) { $objects .= " \"$O\"" ; } my $libpath = ""; foreach $L ( @$LibPath ) { $libpath .= " -libpath \"$L\"" ; } SystemP( "$Ini{'LINKER'} $ldflags -output \"$exe\" $objects $libpath $libs"); } 1; sub atl_exec($$$) { my ($exe,$out,$parameters) = @_; #rm unlink( $out ); unlink("rtrt.cmd"); # Patch the rtrt command script with the right executable open(IN, "$TARGETDIR\\cmd\\rtrt.cmd") or die "Unable to open $TARGETDIR\\cmd\\rtrt.cmd\n"; open(OUT, ">rtrt.cmd") or die "Unable to open rtrt.cmd\n"; while(<IN>) { my $line=$_; if ($line=~/_EXECUTABLE_/) { $line=~s/_EXECUTABLE_/$exe/; } print OUT $line; } close(IN); close(OUT); $status=SystemP( "$Ini{'DEBUGGER'} -armul -script rtrt.cmd" ); return($status) if($status!=0); } sub atl_execdbg($$$) { my ($exe,$out,$parameters) = @_; #rm unlink( $out ); $status=SystemP( "$Ini{'DEBUGGER'} -armul $exe $parameters" ); return($status) if($status!=0); } 1; load _EXECUTABLE_ go quit /* Insert any includes */ #include <stdio.h> #include <time.h> a##b static static extern extern "C" virtual char unsigned char short unsigned short long unsigned long unsigned int ((RTRT_U_INT32)p) RTRT_NONE RTRT_STD RTRT_USR void usr_exit(RTRT_INT32 x) { /* Code here your own exit function, returning x */ ; } RTRT_NONE RTRT_USR char *usr_date() { /* Code here your own get date function */ return ((char *)0); } RTRT_NONE RTRT_STD RTRT_USR void *usr_memcpy(void *dest,const void *src,RTRT_SIZE_T s) { int i; /* Code here your memcpy function */ i=0; for(i=0;i<s;i++) ((char *)(dest))[i]=((char *)(src))[i]; return dest; } RTRT_NONE RTRT_STD RTRT_USR void *usr_gethostname(char *p) { /* Code here your gethostname function */ /* The p parameter is a 50-bytes long allocated pointer */ } RTRT_NONE RTRT_STD RTRT_USR int usr_rdv(char *p) { /* Code here your rendez-vous function */ /* The p parameter contains the name of the rendez-vous */ /* THis function should block until all the members are at the same point */ } RTRT_NONE RTRT_STD RTRT_USR int usr_atexit(void (handler)(void)) { /* Code here your atexit function */ /* The p parameter contains the name of a function that should be */ /* called at normal program termination */ } RTRT_NONE RTRT_STD RTRT_USR char *usr_getenv(char *s) { /* Code here your getenv function */ /* The s parameter contains the name of the environment variable */ /* that should be retrieved from the environment */ } RTRT_NONE RTRT_STD RTRT_USR int usr_getpid() { /* Code here your getpid function */ return(0); } RTRT_NONE RTRT_STD RTRT_USR void usr_signal(int sig,void (handler)(int)) { /* Code here your signal function */ /* The sig parameter contains the signal number to be registered */ /* The f parameter is a function pointer to the handler */ } RTRT_NONE RTRT_USR void _atl_stack_jump(void *,short); #define STACK_GOING_UP 0 #define STACK_GOING_DOWN 1 #include <setjmp.h> void RTRT_longjmp(jmp_buf env,int val) { /* First parameter contains the SP register address */ _atl_stack_jump((void *)((env)[4]),STACK_GOING_DOWN); longjmp(env,val); } #define longjmp RTRT_longjmp int main(int argc,char *argv[]) { return(0); 6 15 15 RTRT_NONE RTRT_STD RTRT_USR FILE * RTRT_FILE_TYPE usr_init(char *fileName) { /* Code here the open function */ /* The fileName parameter contains the name of the file */ /* to be opened on the host */ return((FILE *) fopen(fileName,"w")); } RTRT_FILE_TYPE usr_open(char *fileName) { /* Code here the open function */ /* The fileName parameter contains the name of the file */ /* to be opened on the host */ return((FILE *) fopen(fileName,"w")); } void usr_writeln(RTRT_FILE_TYPE f,char *s) { /* Code here the write function */ /* The f parameter contains the file */ /* The s parameter contains the string to be printed */ fprintf(f,"%s",s); } void usr_close(RTRT_FILE_TYPE f) { /* Code here the close function */ /* The f parameter contains the file to be closed */ fclose(f); } RTRT_NONE RTRT_STD RTRT_USR void usr_error(const char *s) { /* Code the error function here */ } RTRT_STD RTRT_USR RTRT_NONE void *usr_malloc(RTRT_SIZE_T size) { /* Code here your own allocation function here */ } void usr_free(void *ptr) { /* Code here your own free function here */ } RTRT_USR RTRT_NONE void *lowlevel_malloc(RTRT_SIZE_T size) { /* Code the low level allocation function here */ return(__libc_malloc(size)); } void *lowlevel_calloc(RTRT_SIZE_T x,RTRT_SIZE_T y) { /* Code the low level allocation function here */ return(__libc_calloc(x,y)); } void *lowlevel_realloc(void *ptr,RTRT_SIZE_T s) { /* Code the low level allocation function here */ return(__libc_realloc(ptr,s)); } void lowlevel_free(void *ptr) { /* Code the low level allocation function here */ __libc_free(ptr); } RTRT_NONE RTRT_USR #include "atpapi.h" void *RTRT_memPartAlloc(int id,unsigned n) { void *r; unsigned x=_PurifyLTHeapActualSize(n); r=memPartAlloc(id,x); return(_PurifyLTHeapAction(_PurifyLT_API_ALLOC,r,n,0)); } void memPartFree(int id,char *ptr) { void *r=_PurifyLTHeapAction(_PurifyLT_API_FREE,ptr,0,0)); memPartFree(id,ret); } #define memPartAlloc RTRT_memPartAlloc #define memPartFree RTRT_memPartFree RTRT_NONE RTRT_STD RTRT_USR clock_t void usr_clock(RTRT_CLOCK_TYPE *p) { (*p)=clock(); } void usr_clock_init(void) { } RTRT_U_INT32 4 " Clock Ticks" "3" (c) ((r)=((a)-(b))) RTRT_U_INT32 "3" (c) 1000 void usr_sleep(RTRT_TIME_TYPE p) { } RTRT_STD RTRT_SOLARIS RTRT_USR RTRT_NONE thread_t thread_self() thread_equals((t1),(t2)) thread_exit((int)(v)); thread_mutex_t v; thread_mutex_init(&v) thread_mutex_lock(&v) thread_mutex_unlock(&v) thread_mutex_destroy(&v) thread_key_t key; thread_key_create(key,NULL); thread_key_delete(key); v=thread_getspecifics(key); thread_setspecifics(key,v); /* Add your code */ #define __arm #define __sizeof_int 4 #define __sizeof_long 4 #define __sizeof_ptr 4 #define __CLK_TCK 100 #define __ARMCC_VERSION 4.90 #pragma attol exit_instr = "exit" #pragma attol nointerpret --old_for_init --dollar --special_subscript_cost --microsoft_asm --microsoft_union_with_array --nonconst_ref_anachronism --no_const_string_literal --no_class_name_injection --nonstd_using_decl --variadic_macros --extended_variadic_macros --diag_suppress 177,983 --guiding_decls --old_specializations --void_star_null_pointer --gnu_mode --ignore_std --old_style_preprocessing --no_exceptions