Ejemplo n.º 1
0
os_int32
os_procInstallHook()
{
    os_int32 result = 0;

    if (os_procHookInstalled == 0) {
        os_procHookInstalled = 1;
        result = taskCreateHookAdd(os_procDDSHook);
    }

    return (result);
}
Ejemplo n.º 2
0
void init_contexts_sys_dep(void) {
    SPIN_LOCK_ISR_INIT(&events_lock, 0);
    if ((events_signal = semCInitialize(events_signal_mem, SEM_Q_FIFO, 0)) == NULL) {
        check_error(errno);
    }
    vxdbg_clnt_id = vxdbgClntRegister(EVT_BP);
    if (vxdbg_clnt_id == NULL) {
        check_error(errno);
    }
    context_extension_offset = context_extension(sizeof(ContextExtensionVxWorks));
    taskCreateHookAdd((FUNCPTR)task_create_hook);
    vxdbgHookAdd(vxdbg_clnt_id, EVT_BP, vxdbg_event_hook);
    vxdbgHookAdd(vxdbg_clnt_id, EVT_TRACE, vxdbg_event_hook);
    check_error(pthread_create(&events_thread, &pthread_create_attr, event_thread_func, NULL));
    add_waitpid_listener(waitpid_listener, NULL);
    ini_context_pid_hash();
}
Ejemplo n.º 3
0
int main() {
  int _p[4] = {200, 100, 100, 100};
  
  char * word;
  DynArray * da = (DynArray *)malloc(sizeof(DynArray));
  DynArray * clone1 = (DynArray *)malloc(sizeof(DynArray));
  DynArray * clone2 = (DynArray *)malloc(sizeof(DynArray));
  DynArray * clone3 = (DynArray *)malloc(sizeof(DynArray));
  initDynArray(da, bulk_alloc);  

  for (word = strtok(srcString, " "); word ; word = strtok(NULL, " ")) {
    addDynArray(da, word);    
  }
  
  cloneDynArray(clone1, da);
  cloneDynArray(clone2, da);
  cloneDynArray(clone3, da);
  
  sysTimestampEnable();
    
  TASK_ID qsTid;
  TASK_ID bsTid;
  TASK_ID ssTid;
  TASK_ID supTid;  
  
  taskCreateHookAdd(taskCreateCallback);
  taskDeleteHookAdd(taskDeleteCallback);   
  taskSwitchHookAdd(taskSwitchCallback);
    
  supTid = taskSpawn(sup, _p[0], VX_NO_STACK_FILL, 2048*1000, supEntry, \
		  	  da, clone1, clone2, clone3, compare,0,0,0,0,0);  
      
  qsTid = taskSpawn(mqs, _p[1], VX_NO_STACK_FILL, 2048*1000, myqsortEntry, \
		  	  clone1, compare, supTid, 0,0,0,0,0,0,0);
  bsTid = taskSpawn(mbs, _p[2], VX_NO_STACK_FILL, 2048*1000, mybsortEntry, \
		  	  clone2, compare, supTid, 0,0,0,0,0,0,0);
  ssTid = taskSpawn(mns, _p[3], VX_NO_STACK_FILL, 2048*1000, mynsortEntry, \
		  	  clone3, compare, supTid, 0,0,0,0,0,0,0);      
  
  return 0;
}
Ejemplo n.º 4
0
void ini_processes_service(Protocol * proto) {
#if defined(_WRS_KERNEL)
    prs_list_lock = semMCreate(SEM_Q_PRIORITY);
    if (prs_list_lock == NULL) check_error(errno);
    if (taskCreateHookAdd((FUNCPTR)task_create_hook) != OK) check_error(errno);
    if (taskDeleteHookAdd((FUNCPTR)task_delete_hook) != OK) check_error(errno);
#endif
    list_init(&prs_list);
    add_waitpid_listener(waitpid_listener, NULL);
    add_command_handler(proto, PROCESSES, "getContext", command_get_context);
    add_command_handler(proto, PROCESSES, "getChildren", command_get_children);
    add_command_handler(proto, PROCESSES, "attach", command_attach);
    add_command_handler(proto, PROCESSES, "detach", command_detach);
    add_command_handler(proto, PROCESSES, "terminate", command_terminate);
    add_command_handler(proto, PROCESSES, "signal", command_signal);
    add_command_handler(proto, PROCESSES, "getSignalList", command_get_signal_list);
    add_command_handler(proto, PROCESSES, "getSignalMask", command_get_signal_mask);
    add_command_handler(proto, PROCESSES, "setSignalMask", command_set_signal_mask);
    add_command_handler(proto, PROCESSES, "getEnvironment", command_get_environment);
    add_command_handler(proto, PROCESSES, "start", command_start);
}