X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=blobdiff_plain;f=second%2Fprom.c;h=784994d5bbdc938099738a31b2fc7bdb8a137dd3;hp=119d0f363cabbc971f259b6e6f4c61b27cbbaf4c;hb=3cbe90093acba116c5fc46beaf50f74c7c8a1b69;hpb=ba5849c566fd9e1d0765d734d1871bc48c12350f diff --git a/second/prom.c b/second/prom.c index 119d0f3..784994d 100644 --- a/second/prom.c +++ b/second/prom.c @@ -196,7 +196,7 @@ prom_get_devtype (char *device) char tmp[64]; if (strstr(device, TOK_ISCSI)) - device = strcpy(tmp, "/vdevice/gscsi/disk"); + return FILE_DEVICE_ISCSI; /* Find OF device phandle */ dev = prom_finddevice(device); @@ -599,6 +599,23 @@ prom_claim_chunk(void *virt, unsigned int size, unsigned int align) return((void*)-1); } +/* Start from top of memory and work down to get the needed space */ +void * +prom_claim_chunk_top(unsigned int size, unsigned int align) +{ + void *found, *addr; + for(addr=(void*)PROM_CLAIM_MAX_ADDR; addr >= (void *)size; + addr-=(0x100000/sizeof(addr))) { + found = call_prom("claim", 3, 1, addr, size, 0); + if (found != (void *)-1) { + prom_debug("claim of 0x%x at 0x%x returned 0x%x\n", size, (int)addr, (int)found); + return(found); + } + } + prom_printf("ERROR: claim of 0x%x in range 0x0-0x%x failed\n", size, PROM_CLAIM_MAX_ADDR); + return((void*)-1); +} + void * prom_claim (void *virt, unsigned int size, unsigned int align) {