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

[Xen-devel] [PATCH v2 28/41] arm : acpi add efi structures to common efi header



add efi table and memory descriptor structures
to common efi header file and pass efi system table address
retrieved from uefi.This is required for
creating efi table and passing memory information
to DOM0

Signed-off-by: Parth Dixit <parth.dixit@xxxxxxxxxx>
---
 xen/common/efi/boot.c |  2 ++
 xen/include/xen/efi.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index f5e179b..906e040 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1009,6 +1009,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE 
*SystemTable)
               efi.smbios3 = (long)efi_ct[i].VendorTable;
     }
 
+    efi.est = (long)SystemTable;
+
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
     dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR
                       ? (void *)(long)efi.smbios : NULL,
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 26b2f45..9fdc72b 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -16,10 +16,46 @@ struct efi {
     unsigned long acpi20;       /* ACPI table (ACPI 2.0) */
     unsigned long smbios;       /* SM BIOS table */
     unsigned long smbios3;      /* SMBIOS v3 table */
+    unsigned long est;          /* EFI system table */
 };
 
 extern struct efi efi;
 
+/*
+ * Generic EFI table header
+ */
+struct  efi_table_hdr {
+    u64 signature;
+    u32 revision;
+    u32 headersize;
+    u32 crc32;
+    u32 reserved;
+};
+
+struct efi_guid{
+    u8 b[16];
+};
+
+#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7)                         \
+    ((struct efi_guid)                                                       \
+    {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
+                (b) & 0xff, ((b) >> 8) & 0xff,                          \
+                (c) & 0xff, ((c) >> 8) & 0xff,                          \
+                (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
+
+#define ACPI_20_TBL_GUID                                              \
+    EFI_GUID(  0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 
0x88, 0x81 )
+
+#define EFI_CONVENTIONAL_MEMORY                 7
+#define EFI_ACPI_RECLAIM_MEMORY                 9
+
+#define EFI_MEMORY_ATT_WB              ((u64)0x0000000000000008ULL)    /* 
write-back */
+
+struct efi_config_table {
+    struct efi_guid guid;
+    u64 table;
+};
+
 struct efi_memory_desc {
     u32 type;
     u32 pad;
@@ -29,6 +65,24 @@ struct efi_memory_desc {
     u64 attribute;
 };
 
+struct efi_system_table {
+    struct efi_table_hdr hdr;
+    u64 fw_vendor;     /* physical addr of CHAR16 vendor string */
+    u32 fw_revision;
+    u32 __pad1;
+    u64 con_in_handle;
+    u64 con_in;
+    u64 con_out_handle;
+    u64 con_out;
+    u64 stderr_handle;
+    u64 stderr;
+    u64 runtime;
+    u64 boottime;
+    u32 nr_tables;
+    u32 __pad2;
+    u64 tables;
+};
+
 #ifndef __ASSEMBLY__
 
 union xenpf_efi_info;
-- 
1.9.1


_______________________________________________
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®.