Example #1
0
INT32 EnableCore(UINT32 core_id) {
    if(check_Enable_Core_parm(core_id)) {
        printf("check_Enable_Core_parm fail\n");
        return API_RTN_ERROR;
    }

    Core* pCore_temp = create_core(core_id);

    if(insert_core(pCore_temp)) {
        printf("insert_core fail\n");
        return API_RTN_ERROR;
    }

    return API_RTN_OK;
}
Example #2
0
NickAlias *makenick(const char *nick)
{
    NickAlias *na;
    NickCore *nc;

    /* First make the core */
    nc = scalloc(1, sizeof(NickCore));
    nc->display = sstrdup(nick);
    slist_init(&nc->aliases);
    insert_core(nc);
    alog("%s: group %s has been created", s_NickServ, nc->display);

    /* Then make the alias */
    na = scalloc(1, sizeof(NickAlias));
    na->nick = sstrdup(nick);
    na->nc = nc;
    slist_add(&nc->aliases, na);
    alpha_insert_alias(na);
    return na;
}
Example #3
0
/* Name: BuildCPUTree
 * Description: Given a cpustats struct, build and "link" the CPU tree. 
 * Notes: This is an externally referenced API - read the full description in
 *        cpustat.h.
 */
int BuildCPUTree(struct cpustats *cpus)
{
   struct rawsyscpu *rscl;
   struct rawsyscpu *thisrsc;
   struct cpu_socket *cpu_tree;
   struct cpustat *thiscpus;
   int i;

   /* Make sure we are dealing with a real struct here */
   if ( NULL == cpus )
      return(1);

   /* Read in a linked list of CPU info */
   if (NULL == (rscl = read_sys_cpus()))
   {
      return(1);
   }

   /* Build out the cpu_sockets */
   thisrsc = rscl;
   cpu_tree = NULL;
   while( thisrsc )
   {
      cpu_tree = insert_socket(cpu_tree, thisrsc);
      thisrsc = thisrsc->next;
   }

   /* Build out the cpu_cores */
   thisrsc = rscl;
   while( thisrsc )
   {
      if(insert_core(cpu_tree, thisrsc))
         return(1);

      thisrsc = thisrsc->next;
   }

   /* Build out the cpu_threads */
   thisrsc = rscl;
   while( thisrsc )
   {
      if(insert_thread(cpu_tree, thisrsc))
         return(1);

      thisrsc = thisrsc->next;
   }

   thiscpus = cpus->cpulist;
   i = 0;
   while ( i < cpus->cpucnt )
   {
      if(insert_cpustat(cpu_tree, &thiscpus[i]))
         return(1);

      i++;
   }

   /* Only insert the tree when complete -> 100% successful */
   cpus->cpu_tree = cpu_tree;

   return(0);
}
Example #4
0
void simp_rule_sets::insert(name const & eqv, congr_rule const & r) {
    return insert_core(eqv, r);
}