[SeaBIOS] [PATCH 2/2] accept MADT over fw_cfg
Michael S. Tsirkin
mst at redhat.com
Tue Apr 23 10:52:59 CEST 2013
On Mon, Apr 22, 2013 at 08:42:18PM -0400, Kevin O'Connor wrote:
> On Mon, Apr 22, 2013 at 08:23:39PM +0300, Michael S. Tsirkin wrote:
> > > @@ -0,0 +1,28 @@
> > > +#include "types.h" // u8
> > > +#include "util.h" // romfile_s
> > > +
> > > +/* ROM file linker interface. Linker uses little endian format */
> > > +struct linker_entry_s {
> > > + u8 size; /* size in bytes including the header */
> > > + u8 bytes; /* How many bytes to change. Can be 1,2,4 or 8. */
> > > + u8 type;
> > > + u8 format;
> > > + u32 reserved;
> > > + u64 src_offset; /* Offset in source. Little endian format. */
> >
> > src_offset is not needed: host can pre-fill destination
> > table with the offset value.
> > Will probably drop it.
> >
> > > + u64 dst_offset; /* Offset in destination. Little endian format. */
> > > + /* Followed by source and destination
> >
> > Add "file names"
> >
> > >, optionally padded by
> > > + * 0, up to the total of entry_len - 4 bytes.
> > > + * Strings are 0-terminated. */
> > > + char src_dst[];
> > > +} PACKED;
> > > +
> > > +enum linker_entry_type {
> >
> > Documentation:
> >
> > ADD: increment value in DST by the address of SRC
> > useful e.g. to fill in pointer values in ACPI tables
> > SUB: decrement value in DST by the address of SRC
> > useful e.g. to fix up checksum values in ACPI tables
>
> I don't see how one could implement a checksum with just a
> subtraction. If the table is at 0x12345678 the checksum isn't
> (oldcksum-0x12345678), it's (oldcksum-0x12-0x34-0x56-0x78).
>
> -Kevin
True, it's a bug. I'll add a shift option to fix it.
--
MST
More information about the SeaBIOS
mailing list