From: "Tim Lewis" <tim.lewis@insyde.com>
To: "'TVKR'" <tresko1@gmail.com>, <edk2-devel@lists.01.org>
Subject: Re: Data Structure alignment
Date: Thu, 14 Mar 2019 14:08:52 -0700 [thread overview]
Message-ID: <049701d4daaa$28b78bc0$7a26a340$@insyde.com> (raw)
In-Reply-To: <CAD+hitemczBHzo88dLnPUqg5Bik0zUKSaodY-kZaRvtCWdDg+A@mail.gmail.com>
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
prev parent reply other threads:[~2019-03-14 21:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 20:46 Data Structure alignment TVKR
2019-03-14 21:08 ` Tim Lewis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='049701d4daaa$28b78bc0$7a26a340$@insyde.com' \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox