[SeaBIOS] [PATCH 5/6] update dsdt ressources at runtime

Gerd Hoffmann kraxel at redhat.com
Tue May 22 11:55:02 CEST 2012


On 05/18/12 05:07, Kevin O'Connor wrote:
> On Tue, May 15, 2012 at 12:46:25PM +0200, Gerd Hoffmann wrote:
>> Write the pci window location to memory and add a pointer to the SSDT
>> (BDAT region).  Turn \\SB.PCI0._CRS into a method which looks up the
>> information there and updates the ressources accordingly.
>>
>> Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
> [...]
>> diff --git a/src/acpi.c b/src/acpi.c
>> index 30888b9..a13298d 100644
>> --- a/src/acpi.c
>> +++ b/src/acpi.c
>> @@ -415,7 +415,8 @@ build_ssdt(void)
>>      int length = ((1+3+4)
>>                    + (acpi_cpus * SD_SIZEOF)
>>                    + (1+2+5+(12*acpi_cpus))
>> -                  + (6+2+1+(1*acpi_cpus)));
>> +                  + (6+2+1+(1*acpi_cpus))
>> +                  + 17);
>>      u8 *ssdt = malloc_high(sizeof(struct acpi_table_header) + length);
>>      if (! ssdt) {
>>          warn_noalloc();
>> @@ -477,6 +478,31 @@ build_ssdt(void)
>>      for (i=0; i<acpi_cpus; i++)
>>          *(ssdt_ptr++) = (i < CountCPUs) ? 0x01 : 0x00;
>>  
>> +    // store pci io windows: start, end, length
>> +    // this way we don't have to do the math in the dsdt
>> +    u64 *pcimem = malloc_high(sizeof(*pcimem) * 6);
>> +    pcimem[0] = pcimem_start;
>> +    pcimem[1] = pcimem_end - 1;
>> +    pcimem[2] = pcimem_end - pcimem_start - 1;
>> +    pcimem[3] = pcimem64_start;
>> +    pcimem[4] = pcimem64_end - 1;
>> +    pcimem[5] = pcimem64_end - pcimem64_start - 1;
> 
> I think we should really define a struct here instead of an array -
> that should make it more obvious what's going on.
> 
> -Kevin

Done, also created a virtual device in the dsdt to access those fields
so we have a single place in the dsdt we have to keep in sync with
acpi.h in case we are going to add more stuff there (as discussed for s3).

Comments?

[ for review only, guess we want pin down the w2k8 issue before
  committing, although that one is less critical than the winxp
  issue as it triggers only in case something is actually mapped
  high ... ]

cheers,
  Gerd
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-update-dsdt-ressources-at-runtime.patch
URL: <http://www.seabios.org/pipermail/seabios/attachments/20120522/74d44afc/attachment.ksh>


More information about the SeaBIOS mailing list