mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
sparc: fix partition probe, try two partitions
If the size of the partition currently being probed is zero, fail the probe. This lets Forth code try the next candidate from boot-device list. Add explicit ':d' (Sparc32, 'f' for Sparc64) partition to CDROM probe list, so we can remove the ugly forced partition logic. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@846 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -784,7 +784,7 @@ arch_init( void )
|
||||
break;
|
||||
default:
|
||||
case 'd':
|
||||
push_str("cdrom");
|
||||
push_str("cdrom:d cdrom");
|
||||
break;
|
||||
case 'n':
|
||||
push_str("net");
|
||||
|
||||
@@ -480,7 +480,7 @@ void arch_nvram_get(char *data)
|
||||
break;
|
||||
default:
|
||||
case 'd':
|
||||
push_str("cdrom");
|
||||
push_str("cdrom:f cdrom");
|
||||
break;
|
||||
case 'n':
|
||||
push_str("net");
|
||||
|
||||
@@ -175,10 +175,6 @@ sunparts_open( sunparts_info_t *di )
|
||||
__be32_to_cpu(p->partitions[i].num_sectors),
|
||||
__be16_to_cpu(p->infos[i].id),
|
||||
__be16_to_cpu(p->infos[i].flags));
|
||||
if (parnum < 0) {
|
||||
if (p->partitions[i].num_sectors != 0 && p->infos[i].id != 0)
|
||||
parnum = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (parnum < 0)
|
||||
@@ -192,6 +188,10 @@ sunparts_open( sunparts_info_t *di )
|
||||
di->offs_hi = offs >> BITS;
|
||||
di->offs_lo = offs & (ucell) -1;
|
||||
size = (long long)__be32_to_cpu(p->partitions[parnum].num_sectors) * bs;
|
||||
if (size == 0) {
|
||||
DPRINTF("Partition size is 0, exiting\n");
|
||||
RET(0);
|
||||
}
|
||||
di->size_hi = size >> BITS;
|
||||
di->size_lo = size & (ucell) -1;
|
||||
di->type = __be16_to_cpu(p->infos[parnum].id);
|
||||
|
||||
Reference in New Issue
Block a user