From: Heyi Guo <heyi.guo@linaro.org>
To: "Kinney, Michael D" <michael.d.kinney@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PrintLib] Question about ASSERT_UNICODE_BUFFER
Date: Mon, 4 Dec 2017 09:24:08 +0800 [thread overview]
Message-ID: <484b43c1-534a-cb81-ae71-328d95e28dcd@linaro.org> (raw)
In-Reply-To: <E92EE9817A31E24EB0585FDF735412F5A7DC8E00@ORSMSX113.amr.corp.intel.com>
Thanks for your confirmation.
Regards,
Gary (Heyi Guo)
在 12/2/2017 1:23 AM, Kinney, Michael D 写道:
>
> Gary,
>
> The correct solution is to align the Unicode string buffer before
> using those APIs.
>
> The assert for unaligned Unicode string has been in place for over 10
> years, and we have always
>
> been able to address this type of issue by fixing the calling code.
>
> Mike
>
> *From:*heyi.guo [mailto:heyi.guo@linaro.org]
> *Sent:* Thursday, November 30, 2017 10:58 PM
> *To:* edk2-devel@lists.01.org
> *Cc:* Gao, Liming <liming.gao@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> *Subject:* [PrintLib] Question about ASSERT_UNICODE_BUFFER
>
> Hi folks,
>
> I think platforms supported in EDK2 should enable unaligned data
> access, so a CHAR16 * pointer still works even if the pointer itself
> is not aligned by 2. Therefore, can we remove ASSERT_UNICODE_BUFFER
> statements in PrintLib for Unicode operations? If the platform doesn't
> support unaligned access, it can generate some kind of exception
> instead of software assert.
>
> The background is that we are importing a 3rd party driver and it
> packs a unicode string buffer into a structure, and #pragma pack(1) is
> used around the definition of this structure. So the alignment of the
> string buffer depends on the address of the whole structure and the
> members before it; it happened to be not aligned and we got assert
> during system post.
>
> Please let me know your comments.
>
> Thanks,
>
> Gary (Heyi Guo)
>
prev parent reply other threads:[~2017-12-04 1:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <F745BF38-5416-4DD5-B5FC-146633C5F4B0@linaro.org>
2017-12-01 17:23 ` [PrintLib] Question about ASSERT_UNICODE_BUFFER Kinney, Michael D
2017-12-04 1:24 ` Heyi Guo [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=484b43c1-534a-cb81-ae71-328d95e28dcd@linaro.org \
--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