Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3606 → Rev 3607

/branches/sparc/boot/genarch/balloc.h
31,15 → 31,6
 
#include <types.h>
 
/*
* SmartFirmware unfortunatelly fails to claim physical memory
* for the boot allocator if the requested memory is too big
* (roughly 512 kB and more). SmartFirmware runs on machines
* containing newer versions of UltraSPARC processors. It
* has been observed that the OFW tree is small enough for these
* machines so that it can fit into 128 kB. This is a workaround how
* to get rid of the memory claiming failure.
*/
#define BALLOC_MAX_SIZE (128 * 1024)
 
typedef struct {
/branches/sparc/boot/genarch/ofw.c
281,10 → 281,13
*/
int ofw_memmap(memmap_t *map)
{
unsigned int ac = ofw_get_address_cells(ofw_memory);
unsigned int sc = ofw_get_size_cells(ofw_memory);
unsigned int ac = ofw_get_address_cells(ofw_memory) /
(sizeof(uintptr_t) / sizeof(uint32_t));
unsigned int sc = ofw_get_size_cells(ofw_memory) /
(sizeof(uintptr_t) / sizeof(uint32_t));
printf("address cells: %d, size cells: %d. ", ac, sc);
 
uint32_t buf[((ac + sc) * MEMMAP_MAX_RECORDS)];
uintptr_t buf[((ac + sc) * MEMMAP_MAX_RECORDS)];
int ret = ofw_get_property(ofw_memory, "reg", buf, sizeof(buf));
if (ret <= 0) /* ret is the number of written bytes */
return false;
292,11 → 295,22
int pos;
map->total = 0;
map->count = 0;
for (pos = 0; (pos < ret / sizeof(uint32_t)) &&
for (pos = 0; (pos < ret / sizeof(uintptr_t)) &&
(map->count < MEMMAP_MAX_RECORDS); pos += ac + sc) {
void * start = (void *) ((uintptr_t) buf[pos + ac - 1]);
void *start = (void *) (buf[pos + ac - 1]);
unsigned int size = buf[pos + ac + sc - 1];
 
/*
* This is a hot fix of the issue which occurs on machines where there are
* holes in the physical memory (such as SunBlade 1500). Should we detect a
* hole in the physical memory, we will ignore any memory detected behind
* the hole and pretend the hole does not exist.
*/
if ((map->count > 0) &&
(map->zones[map->count - 1].start + map->zones[map->count - 1].size
< start))
break;
 
if (size > 0) {
map->zones[map->count].start = start;
map->zones[map->count].size = size;
308,7 → 322,6
return true;
}
 
 
int ofw_screen(screen_t *screen)
{
char device_name[BUF_SIZE];
/branches/sparc/boot/arch/sparc64/loader/ofwarch.c
82,7 → 82,7
/*
* "upa-portid" for US, "portid" for US-III,
* "cpuid" for US-IV*
* "cpuid" for US-IV
*/
if (ofw_get_property(
child, "upa-portid",