snprintf(str, sizeof(str), "MEM %d, 0x%x to  0x%x\n",i,
bios_printf("MEM %d, 0x%x to  0x%x\n",i,
bios_configure_memory(){	arc_mem_t *descr = 0;	struct phys_mem_desc *m;	vaddr_t seg_start, seg_end;	int	i;	descr = (arc_mem_t *)Bios_GetMemoryDescriptor(descr);	while(descr != 0) {		seg_start = descr->BasePage;		seg_end = seg_start + descr->PageCount;		switch (descr->Type) {		case BadMemory:		/* Have no use for theese */			break;		case FreeMemory:		case FreeContigous:			physmem += descr->PageCount;			m = 0;			for (i = 0; i < MAXMEMSEGS; i++) {				if (mem_layout[i].mem_last_page == 0) {					if (m == 0)						m = &mem_layout[i]; /* free */				}				else if (seg_end == mem_layout[i].mem_first_page) {					m = &mem_layout[i];					m->mem_first_page = seg_start;				}				else if (mem_layout[i].mem_last_page == seg_start) {					m = &mem_layout[i];					m->mem_last_page = seg_end;				}			}			if (m && m->mem_first_page == 0) {				m->mem_first_page = seg_start;				m->mem_last_page = seg_end;			}			break;		case ExeceptionBlock:		case SystemParameterBlock:		case FirmwareTemporary:		case FirmwarePermanent:			rsvdmem += descr->PageCount;			physmem += descr->PageCount;			break;		case LoadedProgram:	/* Count this into total memory */			physmem += descr->PageCount;			break;		default:		/* Unknown type, leave it alone... */			break;		}		descr = (arc_mem_t *)Bios_GetMemoryDescriptor(descr);	}#ifdef DEBUG_MEM_LAYOUT	for ( i = 0; i < MAXMEMSEGS; i++) {		char str[100];		if (mem_layout[i].mem_first_page) {			snprintf(str, sizeof(str), "MEM %d, 0x%x to  0x%x\n",i,				mem_layout[i].mem_first_page * 4096,				mem_layout[i].mem_last_page * 4096);			bios_putstring(str);	    }	}#endif}