* Data Structure alignment
@ 2019-03-14 20:46 TVKR
2019-03-14 21:08 ` Tim Lewis
0 siblings, 1 reply; 2+ messages in thread
From: TVKR @ 2019-03-14 20:46 UTC (permalink / raw)
To: edk2-devel
Hi,
The PCI FW spec says PCI Data Structure must be DWORD aligned and I came
across this code the uses the following check
(RomHeader->PcirOffset & 3) != 0
The above is using the PcirOffset to do the check and not the actual data
structure itself (located at RomHeader + RomHeader->PcirOffset) Shouldn't
it instead be
(RomHeader + RomHeader->PcirOffset & 3) != 0
Thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Data Structure alignment
2019-03-14 20:46 Data Structure alignment TVKR
@ 2019-03-14 21:08 ` Tim Lewis
0 siblings, 0 replies; 2+ messages in thread
From: Tim Lewis @ 2019-03-14 21:08 UTC (permalink / raw)
To: 'TVKR', edk2-devel
I believe the option ROM header itself has an alignment requirement greater
than a DWORD. This is true whether it is from the option ROM BAR or whether
it is copied into allocated memory via AllocatePool. In this case, the check
you showed will still be adequate. But I am going from memory.
Thanks,
Tim
-----Original Message-----
From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of TVKR
Sent: Thursday, March 14, 2019 1:47 PM
To: edk2-devel@lists.01.org
Subject: [edk2] Data Structure alignment
Hi,
The PCI FW spec says PCI Data Structure must be DWORD aligned and I came
across this code the uses the following check
(RomHeader->PcirOffset & 3) != 0
The above is using the PcirOffset to do the check and not the actual data
structure itself (located at RomHeader + RomHeader->PcirOffset) Shouldn't it
instead be
(RomHeader + RomHeader->PcirOffset & 3) != 0
Thanks
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-14 21:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-14 20:46 Data Structure alignment TVKR
2019-03-14 21:08 ` Tim Lewis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox