<br><br><div class="gmail_quote">On Thu, Mar 25, 2010 at 11:53 AM, Stefan Reinauer <span dir="ltr"><<a href="mailto:stepan@coresystems.de">stepan@coresystems.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



  

<div text="#000000" bgcolor="#ffffff"><div class="im">
On 3/25/10 5:45 PM, Myles Watson wrote:
<blockquote type="cite">The reason I object to the void* method was that it just
masked the
problem so that gcc couldn't spot it.  Casting to void* and back to a
struct seems equivalent to just having it declared two different ways.</blockquote>
</div><br>
<font size="-1"><font face="Helvetica, Arial, sans-serif">I don't think
it's masking the problem. It should be sufficient to let gcc know that
it can't assume anything from the pointer since it comes from a void *.
Also, it's not casting it back to a struct, because it never was a
struct. So, while it might not be beautiful, I think it's at least not
wrong.</font></font></div></blockquote><div>The interesting thing is that gcc won't allow the cast if you don't have a variable for it.  That's why I thought it was masking the problem.<br><br>In other words, when I tried:<br>
((acpi_header_t*)((void*)&AmlCode)) ->length<br><br>It still has the type-punned-pointer warning.<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff"><font size="-1"><font face="Helvetica, Arial, sans-serif"><div class="im"><blockquote type="cite">> Which makes me think if there are not
other ways to determine the size<br>
> of an array. Maybe sizeof(AmlCode) ?<br>
I tried that.  It doesn't work because it's an incomplete type.</blockquote></div>
It would not if we included the file<br>
<br>
----- 8< ------ dsdt_wrapper.c -------- 8< ----------<br>
<br>
#include "dsdt.c"<br>
<br>
int AmlCodeSize = sizeof(AmlCode);<br></font></font></div></blockquote><div>The boards with multiple ssdts would have to be refactored.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff"><font size="-1"><font face="Helvetica, Arial, sans-serif">
</font></font>A (maybe too obvious) variant would be to create a binary dsdt instead
of a C file and pack that into CBFS. It would reduce coreboot size and
allow to copy/decompress it right to cbmem<br></div></blockquote><div>This would be fine with me.  It's quite a bit more overhead than the double copy, though.<br><br>Thanks,<br>Myles <br></div></div><br>