# HG changeset patch # User Me@portablequad # Date 1329040078 28800 # Node ID 8d9d367e96f9945cfb2208e811ed47b51dbc5194 # Parent ddd87abfeefd32b43d8984b816c9de1b546f23ca updated for VMS name chgs from VMS__malloc to VMS_int__malloc diff -r ddd87abfeefd -r 8d9d367e96f9 HWSim__PingPong__HWDef/FakeSim.c --- a/HWSim__PingPong__HWDef/FakeSim.c Sat Feb 11 16:59:18 2012 -0800 +++ b/HWSim__PingPong__HWDef/FakeSim.c Sun Feb 12 01:47:58 2012 -0800 @@ -15,7 +15,7 @@ elems= malloc(nrElems*(sizeof(HWSimElem))); checkMalloc(elems); for (i= 0; i - #include - #include "SimParams.h" -#include "ParamHelper/Param.h" - - - - uint8 * - read_Machine_Code_From_File( int numBytesInFile, char *machineCodeFileName ); - - - void - fill_sim_params_from_bag( SimulationParams *simParams, ParamBag *paramBag ) - { char *guestAppFileName, *systemCodeFileName; - int numBytesInGuestApp, numBytesInSystemCode; - - ParamStruc *param; //param = getParamFromBag( "GuestApplicationFileName", paramBag ); - guestAppFileName = param->strValue; //param = getParamFromBag( "numBytesInGuestApp", paramBag ); - numBytesInGuestApp = param->intValue; - - simParams->guestApp = - read_Machine_Code_From_File( numBytesInGuestApp, guestAppFileName ); - - //param = getParamFromBag( "SystemCodeFileName", paramBag ); - systemCodeFileName = param->strValue; //param = getParamFromBag( "numBytesInSystemCode", paramBag ); - numBytesInSystemCode = param->intValue; - - simParams->systemCode = - read_Machine_Code_From_File( numBytesInSystemCode, systemCodeFileName ); - - - - //param = getParamFromBag( "numNodes", paramBag ); - simParams->numNodes = param->intValue; - - - } - - - - - uint8 * - read_Machine_Code_From_File( int numBytesInFile, char *machineCodeFileName ) - { int byte; - FILE *file; - char *machineCode = malloc( numBytesInFile ); - if( machineCode == NULL ) printf( "\nno mem for machine code\n" ); - - file = fopen( machineCodeFileName, "r" ); - if( file == NULL ) { printf( "\nCouldn't open file!!\n"); exit(1);} - - fseek( file, 0, SEEK_SET ); - for( byte = 0; byte < numBytesInFile; byte++ ) - { - if( feof( file ) ) printf( "file ran out too soon" ); - // machineCode[byte] = getchar( file ); - - - } - return machineCode; - } - - - - //========================================================================== - +//========================================================================== void - printSimResults( SimulationResults simResults ) - { - } - - - diff -r ddd87abfeefd -r 8d9d367e96f9 SimParams.h --- a/SimParams.h Sat Feb 11 16:59:18 2012 -0800 +++ b/SimParams.h Sun Feb 12 01:47:58 2012 -0800 @@ -11,7 +11,7 @@ #include #include "../VMS_Implementations/VMS_impl/VMS_primitive_data_types.h" -#include "ParamHelper/Param.h" +#include "../C_Libraries/ParamHelper/Param.h" //============================== Structures ============================== diff -r ddd87abfeefd -r 8d9d367e96f9 main.c --- a/main.c Sat Feb 11 16:59:18 2012 -0800 +++ b/main.c Sun Feb 12 01:47:58 2012 -0800 @@ -10,6 +10,9 @@ #include "SimParams.h" #include "HWSim__PingPong__HWDef/HWSim__PingPong__HWDef.h" +//Stefan: name conflict here -- MC_shared version of params is in HWSim__PingPong__HWDef.h, but need normal C version here +#include "../C_Libraries/ParamHelper/Param.h" + char __ProgrammName[] = "HWSim Hello World"; char __DataSet[255];