[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 11/22] arm/acpi: Prepare EFI system table for Dom0



On 2016年03月22日 00:10, Julien Grall wrote:
> Hi Shannon,
> 
> On 17/03/2016 09:40, Shannon Zhao wrote:
> 
> [...]
> 
>> diff --git a/xen/arch/arm/efi/efi-dom0.c b/xen/arch/arm/efi/efi-dom0.c
>> index 90a7699..b8a062c 100644
>> --- a/xen/arch/arm/efi/efi-dom0.c
>> +++ b/xen/arch/arm/efi/efi-dom0.c
>> @@ -48,3 +48,47 @@ size_t __init estimate_efi_size(int mem_nr_banks)
>>
>>       return size;
>>   }
>> +
>> +#include "../../../common/decompress.h"
>> +#define XZ_EXTERN STATIC
>> +#include "../../../common/xz/crc32.c"
> 
> All the includes should be at the beginning of the file.
> 
>> +
>> +void __init acpi_create_efi_system_table(paddr_t paddr, void
>> *efi_acpi_table,
>> +                                         struct membank tbl_add[])
>> +{
>> +    u64 table_addr, table_size, offset = 0;
>> +    u8 *base_ptr;
>> +    EFI_CONFIGURATION_TABLE *efi_conf_tbl;
>> +    EFI_SYSTEM_TABLE *efi_sys_tbl;
>> +
>> +    table_addr = paddr + acpi_get_table_offset(tbl_add, TBL_EFIT);
>> +    table_size = sizeof(EFI_SYSTEM_TABLE) +
>> sizeof(EFI_CONFIGURATION_TABLE)
>> +                 + sizeof(xen_efi_fw_vendor);
>> +    base_ptr = efi_acpi_table + acpi_get_table_offset(tbl_add,
>> TBL_EFIT);
>> +    efi_sys_tbl = (EFI_SYSTEM_TABLE *)base_ptr;
>> +
>> +    efi_sys_tbl->Hdr.Signature = EFI_SYSTEM_TABLE_SIGNATURE;
>> +    /* Specify the revision as 2.5 */
>> +    efi_sys_tbl->Hdr.Revision = (2 << 16 | 50);
>> +    efi_sys_tbl->Hdr.HeaderSize = table_size;
>> +
>> +    efi_sys_tbl->FirmwareRevision = 1;
>> +    efi_sys_tbl->NumberOfTableEntries = 1;
>> +    offset += sizeof(EFI_SYSTEM_TABLE);
>> +    memcpy((CHAR16 *)(base_ptr + offset), xen_efi_fw_vendor,
> 
> Why the cast to CHAR16?
Because the type of xen_efi_fw_vendor is CHAR16.

Thanks,
-- 
Shannon

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.