int main (int argc, char ** argv) { Int status = 0; //ServiceMgr_Config serviceMgrConfig; Int i, j; /* * Must be at least one set of procId and outfile. So argc cannot be odd */ if ((argc < 3) || (argc / 2 * 2 == argc) || (argc > 7)) { Osal_printf ("uiaDemo <procId> <outfile> [<procId> <outfile>] [<procId> <outfile>]\n"); return (-1); } for (i = 0, j = 1 ; i < argc/2; i++, j = j + 2) { uiaDemo_procId[i] = strtol (argv [j], NULL, 16); uiaDemo_filePath[i] = argv [j + 1]; uiaDemo_numProcessors++; } Osal_printf ("Running on %d processors\n", uiaDemo_numProcessors); Osal_printf ("Calling SysLink_setup\n"); SysLink_setup (); Osal_printf ("Calling uiaDemo_startup\n"); status = uiaDemo_startup (); /* write to a binary file instead of sending out over Ethernet */ //ServiceMgr_getConfig (&serviceMgrConfig); //strcpy(serviceMgrConfig.fileName, "eventDump"); //status = ServiceMgr_setConfig (&serviceMgrConfig); //Osal_printf ("ServiceMgr_setConfig status = [0x%x]\n", status); Osal_printf ("Calling ServiceMgr_start\n"); ServiceMgr_start(); Osal_printf ("Calling uiaDemo_execute\n"); status = uiaDemo_execute (); Osal_printf ("Calling ServiceMgr_stop\n"); ServiceMgr_stop(); Osal_printf ("Calling uiaDemo_shutdown\n"); status = uiaDemo_shutdown (); Osal_printf ("Calling SysLink_destroy\n"); SysLink_destroy (); return (0); }
Int main(Int argc, char* argv[]) { RcmServer_Params rcmServerParams; System_printf("%s starting..\n", MultiProc_getName(MultiProc_self())); /* * Enable use of runtime Diags_setMask per module: * * Codes: E = ENTRY, X = EXIT, L = LIFECYCLE, F = INFO, S = STATUS */ Diags_setMask("ti.ipc.rpmsg.MessageQCopy=EXLFS"); /* Setup the table of services, so clients can create and connect to * new service instances: */ ServiceMgr_init(); /* initialize RcmServer create params */ RcmServer_Params_init(&rcmServerParams); /* The first function, at index 0, is a special create function, which * gets passed a Service_Handle argument. * We set this at run time as our C compiler is not allowing named union * field initialization: */ OMXServer_fxnTab.elem[0].addr.createFxn = RPC_SKEL_GetHandle; rcmServerParams.priority = Thread_Priority_ABOVE_NORMAL; rcmServerParams.fxns.length = OMXServer_fxnTab.length; rcmServerParams.fxns.elem = OMXServer_fxnTab.elem; int i = 0; for (i = 0; i < 255; i ++) bit_num[i] = ((i&1) != 0) + ((i&2) != 0) + ((i&4) != 0) + ((i&8) != 0) + ((i&16) != 0) + ((i&32) != 0) + ((i&64) != 0) + ((i&128) != 0); /* Register an OMX service to create and call new OMX components: */ ServiceMgr_register("OMX", &rcmServerParams); #if 0 /* Some background ping testing tasks, used by rpmsg samples: */ start_ping_tasks(); #endif #if 0 /* DSP or CORE0 or IPU */ /* Run a background task to test rpmsg_resmgr service */ start_resmgr_task(); #endif #if 0 /* DSP or CORE0 or IPU */ /* Run a background task to test hwspinlock */ start_hwSpinlock_task(); #endif /* Start the ServiceMgr services */ ServiceMgr_start(0); BIOS_start(); return (0); }
Int main(Int argc, char* argv[]) { RcmServer_Params rcmServerParams; System_printf("%s starting..\n", MultiProc_getName(MultiProc_self())); /* * Enable use of runtime Diags_setMask per module: * * Codes: E = ENTRY, X = EXIT, L = LIFECYCLE, F = INFO, S = STATUS */ Diags_setMask("ti.ipc.rpmsg.MessageQCopy=EXLFS"); /* Setup the table of services, so clients can create and connect to * new service instances: */ ServiceMgr_init(); /* initialize RcmServer create params */ RcmServer_Params_init(&rcmServerParams); /* The first function, at index 0, is a special create function, which * gets passed a Service_Handle argument. * We set this at run time as our C compiler is not allowing named union * field initialization: */ OMXServer_fxnTab.elem[0].addr.createFxn = RPC_SKEL_GetHandle; rcmServerParams.priority = Thread_Priority_ABOVE_NORMAL; rcmServerParams.fxns.length = OMXServer_fxnTab.length; rcmServerParams.fxns.elem = OMXServer_fxnTab.elem; /* Register an OMX service to create and call new OMX components: */ ServiceMgr_register("OMX", &rcmServerParams); /* Some background ping testing tasks, used by rpmsg samples: */ //start_ping_tasks(); #if 0 /* DSP or CORE0 or IPU */ /* Run a background task to test rpmsg_resmgr service */ start_resmgr_task(); #endif #if 0 /* DSP or CORE0 or IPU */ /* Run a background task to test hwspinlock */ start_hwSpinlock_task(); #endif /* Create 1 task with priority 15 */ Error_init(&eb0); Task_Params_init(&taskParams0); //taskParams0.stackSize = 512; taskParams0.priority = 15; taskParams0.affinity = 1; taskParams0.arg0 = (xdc_UArg)(&(t1)) ; taskParams0.arg1 = 0 ; /* Create 1 task with priority 15 */ Error_init(&eb1); Task_Params_init(&taskParams1); //taskParams1.stackSize = 512; taskParams1.priority = 15; taskParams1.affinity = 0; taskParams1.arg0 = (xdc_UArg)(&(t2)) ; taskParams1.arg1 = 1 ; /* create an Event object. All events are binary */ Error_Block eb; Error_init(&eb); edgeDetectEvent = Event_create(NULL, &eb); if (edgeDetectEvent == NULL) { System_abort("Event create failed"); } local_barrier_sense = local_barrier_counter = 2 ; sem0 = Semaphore_create(1, NULL, NULL) ; /* Start the ServiceMgr services */ ServiceMgr_start(0); BIOS_start(); return (0); }