Author: agraf Date: Tue Jun 25 19:23:09 2013 New Revision: 1162 URL: http://tracker.coreboot.org/trac/openbios/changeset/1162
Log: hfsplus: Fix disk support for disks > 4GB
The HFS+ driver was truncating the end of the disk to 32bit implicitly by multiplying a 32bit value with another 32bit value. Cast the first one to 64bit, making the result 64bit wide as well.
This fixes booting from big disks for me.
Signed-off-by: Alexander Graf agraf@suse.de
Modified: trunk/openbios-devel/fs/hfsplus/hfsp_volume.c
Modified: trunk/openbios-devel/fs/hfsplus/hfsp_volume.c ============================================================================== --- trunk/openbios-devel/fs/hfsplus/hfsp_volume.c Tue Jun 25 18:11:57 2013 (r1161) +++ trunk/openbios-devel/fs/hfsplus/hfsp_volume.c Tue Jun 25 19:23:09 2013 (r1162) @@ -207,7 +207,7 @@ ret = volume_readbuf(vh, p); if( !ret ) { /* When reading the initial partition we must use 512 byte blocks */ - vol_size = vh->blocksize * vh->total_blocks; + vol_size = (uint64_t)vh->blocksize * vh->total_blocks; vol->maxblocks = vol_size / HFSP_BLOCKSZ; }