On Sep 17, 2013, at 2:19 PM, Binh Tran <binh_t...@phoenix.com> wrote:
> Hi all,
>
> StrLen() function MdePkg file BaseLib/String.c will ASSERT if the string is
> not DWORD aligned.
>
> I’m very curious, what is the rationale for this ASSERT?
The EFI ABI requires that types are naturally aligned. Since a CHAR16 is
16-bits it needs to be aligned on a 16-bit boundary.
UEFI 2.4
2.3.1 Data Types
Table 6 lists the common data types that are used in the interface definitions,
and Table 7 lists their modifiers. Unless otherwise specified all data types
are naturally aligned. Structures are aligned on boundaries equal to the
largest internal datum of the structure and internal data are implicitly padded
to achieve natural alignment.
The values of the pointers passed into or returned by the UEFI interfaces must
provide natural alignment for the underlying types.
Thanks,
Andrew Fish
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk_______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel