debuggers.hg

view tools/libxc/xc_efi.h @ 16715:c5deb251b9dc

Update version to 3.2.0-rc4
author Keir Fraser <keir.fraser@citrix.com>
date Sat Dec 29 17:57:37 2007 +0000 (2007-12-29)
parents 03e04b861d91
children eccfdeb41b80
line source
1 #ifndef XC_EFI_H
2 #define XC_EFI_H
4 /* definitions from xen/include/asm-ia64/linux-xen/linux/efi.h */
6 /*
7 * Extensible Firmware Interface
8 * Based on 'Extensible Firmware Interface Specification' version 0.9, April 30, 1999
9 *
10 * Copyright (C) 1999 VA Linux Systems
11 * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
12 * Copyright (C) 1999, 2002-2003 Hewlett-Packard Co.
13 * David Mosberger-Tang <davidm@hpl.hp.com>
14 * Stephane Eranian <eranian@hpl.hp.com>
15 */
17 typedef struct {
18 uint8_t b[16];
19 } efi_guid_t;
21 #define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
22 ((efi_guid_t) \
23 {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
24 (b) & 0xff, ((b) >> 8) & 0xff, \
25 (c) & 0xff, ((c) >> 8) & 0xff, \
26 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
28 /*
29 * Generic EFI table header
30 */
31 typedef struct {
32 uint64_t signature;
33 uint32_t revision;
34 uint32_t headersize;
35 uint32_t crc32;
36 uint32_t reserved;
37 } efi_table_hdr_t;
39 /*
40 * Memory map descriptor:
41 */
43 /* Memory types: */
44 #define EFI_RESERVED_TYPE 0
45 #define EFI_LOADER_CODE 1
46 #define EFI_LOADER_DATA 2
47 #define EFI_BOOT_SERVICES_CODE 3
48 #define EFI_BOOT_SERVICES_DATA 4
49 #define EFI_RUNTIME_SERVICES_CODE 5
50 #define EFI_RUNTIME_SERVICES_DATA 6
51 #define EFI_CONVENTIONAL_MEMORY 7
52 #define EFI_UNUSABLE_MEMORY 8
53 #define EFI_ACPI_RECLAIM_MEMORY 9
54 #define EFI_ACPI_MEMORY_NVS 10
55 #define EFI_MEMORY_MAPPED_IO 11
56 #define EFI_MEMORY_MAPPED_IO_PORT_SPACE 12
57 #define EFI_PAL_CODE 13
58 #define EFI_MAX_MEMORY_TYPE 14
60 /* Attribute values: */
61 #define EFI_MEMORY_UC ((uint64_t)0x0000000000000001ULL) /* uncached */
62 #define EFI_MEMORY_WC ((uint64_t)0x0000000000000002ULL) /* write-coalescing */
63 #define EFI_MEMORY_WT ((uint64_t)0x0000000000000004ULL) /* write-through */
64 #define EFI_MEMORY_WB ((uint64_t)0x0000000000000008ULL) /* write-back */
65 #define EFI_MEMORY_WP ((uint64_t)0x0000000000001000ULL) /* write-protect */
66 #define EFI_MEMORY_RP ((uint64_t)0x0000000000002000ULL) /* read-protect */
67 #define EFI_MEMORY_XP ((uint64_t)0x0000000000004000ULL) /* execute-protect */
68 #define EFI_MEMORY_RUNTIME ((uint64_t)0x8000000000000000ULL) /* range requires runtime mapping */
69 #define EFI_MEMORY_DESCRIPTOR_VERSION 1
71 #define EFI_PAGE_SHIFT 12
73 /*
74 * For current x86 implementations of EFI, there is
75 * additional padding in the mem descriptors. This is not
76 * the case in ia64. Need to have this fixed in the f/w.
77 */
78 typedef struct {
79 uint32_t type;
80 uint32_t pad;
81 uint64_t phys_addr;
82 uint64_t virt_addr;
83 uint64_t num_pages;
84 uint64_t attribute;
85 #if defined (__i386__)
86 uint64_t pad1;
87 #endif
88 } efi_memory_desc_t;
90 /*
91 * EFI Runtime Services table
92 */
93 #define EFI_RUNTIME_SERVICES_SIGNATURE ((uint64_t)0x5652453544e5552ULL)
94 #define EFI_RUNTIME_SERVICES_REVISION 0x00010000
96 typedef struct {
97 efi_table_hdr_t hdr;
98 unsigned long get_time;
99 unsigned long set_time;
100 unsigned long get_wakeup_time;
101 unsigned long set_wakeup_time;
102 unsigned long set_virtual_address_map;
103 unsigned long convert_pointer;
104 unsigned long get_variable;
105 unsigned long get_next_variable;
106 unsigned long set_variable;
107 unsigned long get_next_high_mono_count;
108 unsigned long reset_system;
109 } efi_runtime_services_t;
111 /*
112 * EFI Configuration Table and GUID definitions
113 */
114 #define NULL_GUID \
115 EFI_GUID( 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 )
116 #define ACPI_20_TABLE_GUID \
117 EFI_GUID( 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 )
118 #define SAL_SYSTEM_TABLE_GUID \
119 EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
121 typedef struct {
122 efi_guid_t guid;
123 unsigned long table;
124 } efi_config_table_t;
126 #define EFI_SYSTEM_TABLE_SIGNATURE ((uint64_t)0x5453595320494249ULL)
127 #define EFI_SYSTEM_TABLE_REVISION ((1 << 16) | 00)
129 typedef struct {
130 efi_table_hdr_t hdr;
131 unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */
132 uint32_t fw_revision;
133 unsigned long con_in_handle;
134 unsigned long con_in;
135 unsigned long con_out_handle;
136 unsigned long con_out;
137 unsigned long stderr_handle;
138 unsigned long stderr;
139 efi_runtime_services_t *runtime;
140 unsigned long boottime;
141 unsigned long nr_tables;
142 unsigned long tables;
143 } efi_system_table_t;
145 #endif /* XC_EFI_H */