|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 14/22] arm/acpi: Create min DT stub for Dom0
On 2016年03月22日 09:07, Julien Grall wrote:
>
>> +int __init arm_acpi_make_efi_nodes(void *fdt, struct membank tbl_add[])
>
> It's odd to have this function in efi-dom0.c. We want to keep all the
> device tree creation together.
>
We've discussed this before. We want to reuse the definition of EFI
struct, eg EFI_MEMORY_DESCRIPTOR here, so we add the file efi-dom.c to
place those functions because if we include the efi headers in
domain_build.c there are some type conflicts. That's the reason why we
add efi-dom0.c and place this function in it as well.
> Also, to stay consistent with the other name. Please rename the function
> into acpi_make_efi_nodes.
>
>> +{
>> + u64 fdt_val64;
>> + u32 fdt_val32;
>> + int desc_ver = 1;
>> + int res;
>> +
>> + res = fdt_begin_node(fdt, "uefi");
>> + if ( res )
>> + return res;
>> +
>> + fdt_val64 = cpu_to_fdt64(tbl_add[TBL_EFIT].start);
>> + res = fdt_property(fdt, "xen,uefi-system-table",
>> + &fdt_val64, sizeof(fdt_val64));
>
> Those two lines could be replaced by fdt_property_u64.
>
>> + if ( res )
>> + return res;
>> +
>> + fdt_val64 = cpu_to_fdt64(tbl_add[TBL_MMAP].start);
>> + res = fdt_property(fdt, "xen,uefi-mmap-start",
>> + &fdt_val64, sizeof(fdt_val64));
>
> Ditto
>
>> + if ( res )
>> + return res;
>> +
>> + fdt_val32 = cpu_to_fdt32(tbl_add[TBL_MMAP].size);
>> + res = fdt_property(fdt, "xen,uefi-mmap-size",
>> + &fdt_val32, sizeof(fdt_val32));
>
> Here by fdt_property_u32.
>
>> + if ( res )
>> + return res;
>> +
>> + fdt_val32 = cpu_to_fdt32(sizeof(EFI_MEMORY_DESCRIPTOR));
>> + res = fdt_property(fdt, "xen,uefi-mmap-desc-size",
>> + &fdt_val32, sizeof(fdt_val32));
>
> Ditto
>
>> + if ( res )
>> + return res;
>> +
>> + fdt_val32 = cpu_to_fdt32(desc_ver);
>> + res = fdt_property(fdt, "xen,uefi-mmap-desc-ver",
>> + &fdt_val32, sizeof(fdt_val32));
Thanks,
--
Shannon
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |