For v2003.06.01 Release $Revision: 1.11 $ Support: ------------- Language : C - C++ Features : Component Testing - Code Coverage - Performance Profiling - Memory Profiling - Trace Tested Against: ------------------------ Host Machine : Windows 2000 Compiler : GreenHills C/C++ Compiler Version 3.0 Linker : GreenHills Linker Version 3.0 Debugger : Multi 2000 Version 3.0 OS : None Target : PowerPC Simulator c o out -G -w -G -YS,c:\green\ippc c:\green\ippc ENV_PATH c:\green;$ENV{'PATH'} Compiler used COMPILER ccppc.exe Preprocessor used PREPROCESSOR ccppc.exe Linker used LINKER ccppc.exe Debugger used DEBUGGER simppc.exe STD_INCLUDE cpp o out -G -w -G -YS,c:\green\ippc c:\green\ippc,c:\green\sim800 -lcxinit -lsedgnoe ENV_PATH c:\green;$ENV{'PATH'} Compiler used COMPILER ccppc.exe Preprocessor used PREPROCESSOR ccppc.exe Linker used LINKER ccppc.exe Debugger used DEBUGGER simppc.exe RESTR NOEXCEP STD_INCLUDE sub atl_cc($$$$\@\@) { my ( $lang,$src,$out,$cflags,$Defines,$Includes) = @_; my $includes=""; my $defines=""; foreach(@$Includes) { $includes.=" -I\"$_\""; } foreach(@$Defines) { $defines.=" -D$_"; } my $cc=$Ini{'COMPILER'}; SystemP("$cc -c $cflags $defines $includes \"$src\" -o \"$out\""); } sub atl_cpp($$$$\@\@) { my ( $lang,$src,$out,$cflags,$Defines,$Includes) = @_; my $includes=""; my $defines=""; foreach(@$Includes) { $includes.=" -I\"$_\""; } foreach(@$Defines) { $defines.=" -D$_"; } my $cc=$Ini{'PREPROCESSOR'}; unlink($out); SystemP("$cc -E $cflags $defines $includes \"$src\" > atltmp.i"); return($Status) if ($Status!=0); SystemP("$BINDIR/fixlines","atltmp.i",$out); unlink("atltmp.i"); return($Status); } 1; sub atl_link($\@$\@$) { my ($exe,$Objects,$ldflags,$LibPath,$libs) = @_; my $libpath=""; my $objects=""; foreach(@$LibPath) { $libpath.=" -L$_"; } foreach(@$Objects) { $objects.=" $_"; } close(STDERR); my $linker=$Ini{'LINKER'}; SystemP("$linker $ldflags -o \"$exe\" $objects $libpath $libs"); } 1; sub atl_exec($$$) { my ($exe,$out,$parameters) = @_; my $Debugger = $Ini{'DEBUGGER'}; unlink($out); SystemP("$Debugger $exe $parameters"); } sub atl_execdbg($$$) { my ($exe,$out,$parameters) = @_; unlink($out); SystemP("multi $exe $parameters"); } 1; /* Insert any includes */ /* Insert Here any includes free functions or macros */ #include <stdlib.h> #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) { /* Call the actual longjmp function */ /* after having called _atl_stack_jump ( [Stack Pointer Register Address], [STACK_GOING_UP|STACK_GOING_DOWN] ); */ _atl_stack_jump(env[0],STACK_GOING_UP); longjmp(env,val); } void RTRT__longjmp(jmp_buf env,int val) { /* Call the actual longjmp function */ /* after having called _atl_stack_jump ( [Stack Pointer Register Address], [STACK_GOING_UP|STACK_GOING_DOWN] ); */ _atl_stack_jump(env[0],STACK_GOING_UP); _longjmp(env,val); } #define longjmp RTRT_longjmp #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) { /* Open the file named name */ return((FILE *) fopen(fileName,"w")); } RTRT_FILE_TYPE usr_open(char *fileName) { /* Open the file named name */ return((FILE *) fopen(fileName,"w")); } void usr_writeln(RTRT_FILE_TYPE f,char *s) { /* Print the string str into file and add a newline character */ fprintf(f,"%s",s); } void usr_close(RTRT_FILE_TYPE f) { /* Close the file */ 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) { /* Code here the funtion which reads the clock */ /* and sets (*p) to the current clock value */ (*p)=clock(); } void usr_clock_init(void) { /* This function will be called only once when starting the program */ /* You may code here clock resolution computation */ } RTRT_U_INT32 4 "Ticks" "3" (c) ((r)=((a)-(b))) RTRT_U_INT32 "3" (c) 1000 void usr_sleep(RTRT_TIME_TYPE p) { /* Code here the funtion which sleeps for a while */ /* p contains the duration, represented in a RTRT_TIME_TYPE item */ } 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 */ This set of defines and standard include paths are given by the -v option of ccppc /* Specify the list of #pragmas and #defines adapted to your compiler here */ #pragma attol incl_std=c:\green\ppc\include #pragma attol incl_std=c:\green\ansi #define __PROTOTYPES__ #define __STDC_VERSION__ 199409L #define __EDG__ #define __ghs #define __ghs__ #define __ghs_psinfo #define __ELF #define __PowerPC #define __ppc #define __ppc601 #define __ghs_alignment 8 #define __ghs_sda #define __ghs_zda #define __BigEndian #define __DOUBLE_HL #define __IeeeFloat #define __Char_Is_Unsigned__ #define __Ptr_Is_Signed__ #define __Field_Is_Unsigned__ #define __Enum_Field_Is_Unsigned__ #define __Int_Is_32 #define __Long_Is_32 #define __LL_Is_64 #define __Ptr_Is_32 #define __WChar_Is_Signed__ #define __WChar_Is_Long__ #define __CHAR_BIT 8 #define __SHRT_BIT 16 #define __INT_BIT 32 #define __LONG_BIT 32 #define __WCHAR_BIT 32 #define __LL_BIT 64 #define __Reg_Is_32 #define LANGUAGE_C #define __LANGUAGE_C #define __LANGUAGE_C__ This set of defines and standard include paths are given by the -v option of ccppc /* Specify the list of #pragmas and #defines adapted to your compiler here */ #pragma attol incl_std=c:\green\scxx #pragma attol incl_std=c:\green\ppc\include #pragma attol incl_std=c:\green\ansi #define __PROTOTYPES__ #define__c_plusplus 1 #define__cplusplus 199711L #define__LANGUAGE_CXX #define__LANGUAGE_CXX__ #define__EDG__ #define_WCHAR_T #define_BOOL #define__ARRAY_OPERATORS #define_RTTI #define__EDG_RUNTIME_USES_NAMESPACES #define__NAMESPACES #define__STANDARD_CXX #define__STANDARD_CXX_HEADERS #define__ghs #define__ghs__ #define__ghs_psinfo #define__ELF #define__PowerPC #define__ppc #define__ppc601 #define__ghs_alignment 8 #define__ghs_sda #define__ghs_zda #define__BigEndian #define__DOUBLE_HL #define__IeeeFloat #define__Char_Is_Unsigned__ #define__Ptr_Is_Signed__ #define__Field_Is_Unsigned__ #define__Enum_Field_Is_Unsigned__ #define__Int_Is_32 #define__Long_Is_32 #define__LL_Is_64 #define__Ptr_Is_32 #define__WChar_Is_Signed__ #define__WChar_Is_Long__ #define__CHAR_BIT 8 #define__SHRT_BIT=16 #define__INT_BIT 32 #define__LONG_BIT 32 #define__WCHAR_BIT 32 #define__LL_BIT 64 #define__Reg_Is_32 This set of defines and standard include paths are given by the -v option of ccppc #pragma attol exit_instr = "exit" #pragma attol incl_std=c:\green\ppc\include #pragma attol incl_std=c:\green\ansi This set of defines and standard include paths are given by the -v option of ccppc //#ifdef NEED_PREPRO_DEFS #define __PROTOTYPES__ #define __LANGUAGE_CXX #define __LANGUAGE_CXX__ #define _RTTI #define __NAMESPACES #define __STANDARD_CXX #define __STANDARD_CXX_HEADERS #define __ghs #define __ghs__ #define __ghs_psinfo #define __ELF #define __PowerPC #define __ppc #define __ppc601 #define __ghs_alignment 8 #define __ghs_sda #define __ghs_zda #define __BigEndian #define __DOUBLE_HL #define __IeeeFloat #define __Char_Is_Unsigned__ #define __Ptr_Is_Signed__ #define __Field_Is_Unsigned__ #define __Enum_Field_Is_Unsigned__ #define __Int_Is_32 #define __Long_Is_32 #define __LL_Is_64 #define __Ptr_Is_32 #define __WChar_Is_Signed__ #define __WChar_Is_Long__ #define __CHAR_BIT 8 #define __SHRT_BIT 16 #define __INT_BIT 32 #define __LONG_BIT 32 #define __WCHAR_BIT 32 #define __LL_BIT 64 #define __Reg_Is_32 //#endif /* NEED_PREPRO_DEFS */ This set of defines and standard include paths are given by the -v option of ccppc --sys_include=c:\green\ansi --sys_include=c:\green\scxx --sys_include=c:\green\ppc\include --no_exceptions --dollar --diag_suppress 1,21,30,68,161,177,326,426,461,550,830,837,983 --no_alternative_tokens --diag_remark=450 --gnu=none --namespaces --rtti --bool --explicit --wchar_t_keyword --array_new_and_delete --no_restrict --extern_inline --implicit_extern_c_type_conversion --new_for_init --short_lifetime_temps --early_tiebreaker --enum_overloading --no_friend_injection --distinct_template_signatures --old_specializations --typename --implicit_typename --guiding_decls