compute checksum for roms bigger than a segment
commitb4227586f4006461144ee82fcf059abb63800398
authorGlauber Costa <glommer@redhat.com>
Wed, 24 Jun 2009 13:31:41 +0000 (24 14:31 +0100)
committerMark McLoughlin <markmc@redhat.com>
Fri, 11 Sep 2009 10:38:02 +0000 (11 11:38 +0100)
tree28e4572eae0bec53a9060142317862d1c6985c91
parentf360bdf1c79a8c52c554533e6dc1c72dad3bc0ef
compute checksum for roms bigger than a segment

Some option roms (e1000 provided by gpxe project as an example)
are bigger than a segment. The current algorithm to compute the
checksum fails in such case. To proper compute the checksum, this
patch deals with the possibility of the rom's size crossing a
segment border.

We don't need to worry about it crossing more than one segment
border, since the option roms format only save one byte to store
the image size (thus, maximum size = 0xff = 128k = 2 segments)

[ including improvements suggested by malc ]

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Fedora-patch: qemu-bios-bigger-roms.patch
kvm/bios/rombios.c