yaboot/yaboot-1.3.13-pegasos-claim...

16 lines
528 B
Diff

--- yaboot-1.3.13/second/prom.c~ 2003-11-04 09:13:17.000000000 +0000
+++ yaboot-1.3.13/second/prom.c 2005-07-29 13:19:35.000000000 +0100
@@ -547,7 +547,11 @@ prom_sleep (int seconds)
void *
prom_claim (void *virt, unsigned int size, unsigned int align)
{
- return call_prom ("claim", 3, 1, virt, size, align);
+ void *ret = call_prom ("claim", 3, 1, virt, size, align);
+ /* Pegasos II SmartFirmware returns zero for failure, usefully */
+ if (virt && !ret)
+ ret = (void *)-1;
+ return ret;
}
void