Ejemplo n.º 1
0
void
dumpgroup(Symbol* g)
{
    if(debug <= 1) return; 
    fdebug("group %s {\n",(g==NULL?"null":g->name));
    if(g != NULL && g->subnodes != NULL) {    
	int i;
	for(i=0;i<listlength(g->subnodes);i++) {
	    Symbol* sym = (Symbol*)listget(g->subnodes,i);
	    char* tname;
	    if(sym->objectclass == NC_PRIM
	       || sym->objectclass == NC_TYPE) {
		tname = nctypename(sym->subclass);
	    } else
		tname = nctypename(sym->objectclass);
	    fdebug("    %3d:  %s\t%s\t%s\n",
		i,
		sym->name,
		tname,
		(sym->ref.is_ref?"ref":"")
		);
	}
    }
    fdebug("}\n");
}
Ejemplo n.º 2
0
instruction_list * isl_ast_to_noclock_ast (isl_ast_node * ast)
{
    enum isl_ast_node_type t = isl_ast_node_get_type (ast);

    instruction_list * list = NULL;
    switch (t)
    {
        case isl_ast_node_for:
            list = isl_for_to_noclock (ast);
            break;
        case isl_ast_node_if:
            list = isl_if_to_noclock (ast);
            break;
        case isl_ast_node_block:
            list = isl_block_to_noclock (ast);
            break;
        case isl_ast_node_user:
            list = isl_user_to_noclock (ast);
            break;
        default:
            fdebug (stderr, "isl_ast_to_noclock_ast(): "
                    "Unexpected node_type: %u\n", t);
            break;
    }

    return list;
}
Ejemplo n.º 3
0
// Formatted fdebug
void fdebugf(char *format, ...)
{
	int index;
	char fdebugline[512];
	if (format[0]==' ') { // ADD TIME
		struct timeval tv;
		gettimeofday( &tv, NULL );
		int ms = tv.tv_usec / 1000;
		int hr = (1+(tv.tv_sec/3600)) % 24;
		int mn = (tv.tv_sec % 3600) /60;
		int sd = (tv.tv_sec % 60);
		sprintf( fdebugline, "[%02d:%02d:%02d.%03d]", hr,mn,sd,ms);
		index = strlen(fdebugline);
	} else index=0;
	
	va_list args;
	va_start (args, format);
	vsprintf( fdebugline+index, format, args);
	va_end( args );

	fdebug(fdebugline);
}
Ejemplo n.º 4
0
Archivo: video.c Proyecto: fysnet/FYSOS
void get_video_eedid(void) {
  struct REGS regs;
  bit8u crc, edid[128];
  struct S_EEDID *p = (struct S_EEDID *) edid;
  int i;
  bool b;
  
  // VESA VBE/DC (Display Data Channel) - INSTALLATION CHECK / CAPABILITIES
  regs.eax = 0x00004F15;
  regs.ebx = 0x00000000;
  b = intx(0x10, &regs);
  
  // successful?
  if (!b && ((regs.eax & 0x0000FFFF) == 0x004F)) {
    //win_printf(main_win, "Vesa Supported EEDID call...\n");
    regs.eax = 0x00004F15;
    regs.ebx = 0x00000001;
    regs.ecx = 0x00000000;
    regs.edx = 0x00000000;
    regs.edi = MK_OFF((bit32u) edid);
    regs.es = MK_SEG((bit32u) edid);
    b = intx(0x10, &regs);
    if (!b && ((regs.eax & 0x0000FFFF) == 0x004F)) {
      //win_printf(main_win, "EDID: b = %i, eax = 0x%08X\n\n", b, regs.eax);   // 0x0000004F = successfull
      fdebug(edid, 128);
      crc = 0;
      for (i=0; i<128; i++)
        crc += edid[i];
      //win_printf(main_win, "EDID crc = 0x%02X\n", crc);
      // if crc != 0, error
      if (crc == 0) {
        //printf("size of struct S_EEDID = %i\n", sizeof(struct S_EEDID));
        printf("0x%02X 0x%02X 0x%02X\n", p->est_timings1, p->est_timings2, p->est_timings_resv);
        
      }
    }
  }
}
Ejemplo n.º 5
0
Symbol*
locate(Symbol* refsym)
{
    Symbol* sym = NULL;
    switch (refsym->objectclass) {
    case NC_DIM:
	if(refsym->is_prefixed) {
	    /* locate exact dimension specified*/
	    sym = lookup(NC_DIM,refsym);
	} else { /* Search for matching dimension in all parent groups*/
	    Symbol* parent = lookupgroup(refsym->prefix);/*get group for refsym*/
	    while(parent != NULL) {
		/* search this parent for matching name and type*/
		sym = lookupingroup(NC_DIM,refsym->name,parent);
		if(sym != NULL) break;
		parent = parent->container;
	    }
	}
	break;
    case NC_TYPE:
	if(refsym->is_prefixed) {
	    /* locate exact type specified*/
	    sym = lookup(NC_TYPE,refsym);
	} else {
	    Symbol* parent;
	    int i; /* Search for matching type in all groups (except...)*/
	    /* Short circuit test for primitive types*/
	    for(i=NC_NAT;i<=NC_STRING;i++) {
		Symbol* prim = basetypefor(i);
		if(prim == NULL) continue;
	        if(strcmp(refsym->name,prim->name)==0) {
		    sym = prim;
		    break;
		}
	    }
	    if(sym == NULL) {
	        /* Added 5/26/09: look in parent hierarchy first */
	        parent = lookupgroup(refsym->prefix);/*get group for refsym*/
	        while(parent != NULL) {
		    /* search this parent for matching name and type*/
		    sym = lookupingroup(NC_TYPE,refsym->name,parent);
		    if(sym != NULL) break;
		    parent = parent->container;
		}
	    }
	    if(sym == NULL) {
	        sym = uniquetreelocate(refsym,rootgroup); /* want unique */
	    }
	}
	break;
    case NC_VAR:
	if(refsym->is_prefixed) {
	    /* locate exact variable specified*/
	    sym = lookup(NC_VAR,refsym);
	} else {
	    Symbol* parent = lookupgroup(refsym->prefix);/*get group for refsym*/
   	    /* search this parent for matching name and type*/
	    sym = lookupingroup(NC_VAR,refsym->name,parent);
	}
        break;
    case NC_GRP:
	if(refsym->is_prefixed) {
	    /* locate exact group specified*/
	    sym = lookup(NC_GRP,refsym);
	} else {
 	    Symbol* parent = lookupgroup(refsym->prefix);/*get group for refsym*/
   	    /* search this parent for matching name and type*/
	    sym = lookupingroup(NC_GRP,refsym->name,parent);
	}
	break;

    default: PANIC1("locate: bad refsym type: %d",refsym->objectclass);
    }
    if(debug > 1) {
	char* ncname;
	if(refsym->objectclass == NC_TYPE)
	    ncname = ncclassname(refsym->subclass);
	else
	    ncname = ncclassname(refsym->objectclass);
	fdebug("locate: %s: %s -> %s\n",
		ncname,fullname(refsym),(sym?fullname(sym):"NULL"));
    }
    return sym;
}