<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 3/25/10 5:45 PM, Myles Watson wrote:
<blockquote
 cite="mid:2831fecf1003250945l62a812c3hee3e3d3aaadb0b75@mail.gmail.com"
 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>
<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.<br>
<br>
<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>
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>
<br>
</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">-----
8< ------ dsdt_wrapper.c -------- 8< ----------</font></font><br>
<br>
and use that.<br>
<br>
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>
<br>
Stefan<br>
</body>
</html>