sprintf(buf, "mem %d, 0x%x, 0x%x\n", descr->Type, descr->BasePage * 4096, descr->PageCount * 4096); bios_putstring(buf);
bios_configure_memory(){	arc_mem_t *descr = 0;	struct mem_descriptor *m;	vm_offset_t seg_start, seg_end;	int	i;	descr = (arc_mem_t *)Bios_GetMemoryDescriptor(descr);	while(descr != 0) {		sprintf(buf, "mem %d, 0x%x, 0x%x\n",			descr->Type,			descr->BasePage * 4096,			descr->PageCount * 4096);		bios_putstring(buf);		seg_start = descr->BasePage * 4096;		seg_end = seg_start + descr->PageCount * 4096;		switch(descr->Type) {		case BadMemory:		/* Have no use for theese */			break;		case ExeceptionBlock:		case SystemParameterBlock:		case FreeMemory:		case FirmwareTemporary:		case FirmwarePermanent:		case FreeContigous:			physmem += descr->PageCount * 4096;			m = 0;			for( i = 0; i < MAXMEMSEGS; i++) {				if(mem_layout[i].mem_size == 0) {					if(m == 0)						m = &mem_layout[i]; /* free */				}				else if(seg_end == mem_layout[i].mem_start) {					m = &mem_layout[i];					m->mem_start = seg_start;					m->mem_size += seg_end - seg_start;				}				else if(mem_layout[i].mem_start +				    mem_layout[i].mem_size == seg_start) {					m = &mem_layout[i];					m->mem_size += seg_end - seg_start;				}			}			if(m && m->mem_size == 0) {				m->mem_start = seg_start;				m->mem_size = seg_end - seg_start;			}			break;		case LoadedProgram:	/* This is the loaded kernel */			physmem += descr->PageCount * 4096;			break;		default:		/* Unknown type, leave it alone... */			break;		}		descr = (arc_mem_t *)Bios_GetMemoryDescriptor(descr);	}	for( i = 0; i < MAXMEMSEGS; i++) {	    if(mem_layout[i].mem_size) {		sprintf(buf, "MEM %d, 0x%x, 0x%x\n",i,			mem_layout[i].mem_start,			mem_layout[i].mem_size);		bios_putstring(buf);	    }	}}