On Feb 13, 2013, at 9:34 AM, Tim Lewis <[email protected]> wrote:
> Sathya –
>
> This was discussed earlier in this thread. I count it as a bug, since there
> is nothing in the API definition which requires pointers be on even addresses.
>
Tim,
I think the ASSERTs are based on this statement in the UEFI spec:
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.
As Mike pointed out a packed structure or pointer math will cause some issues
using these routines.
Thanks,
Andrew
> Tim
>
> From: Prakash, Sathya [mailto:[email protected]]
> Sent: Wednesday, February 13, 2013 9:19 AM
> To: [email protected]
> Subject: [edk2] How to align auto variables?
>
> I am able to compile my code successfully with UDK but when I run my code I
> see lot ASSERTS similar to ASSERT (((UINTN) String & BIT0) == 0);
>
>
> I have used a static library in my code which is compiled in EDK1.6 (I need
> to port that to UDK but for now I am keeping this way to do some basic
> testing)
>
>
> I would like to know how to tell the compiler to align the char array
> allocated in string to be aligned to avoid the ASSERT? Do I need to use
> __declspec(align(#)) across all the variable definitions, can I pass it once
> as a compile flag?
>
> Thanks
> Sathya
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel