Changeset a4bd537 in mainline for boot/genarch/include/genarch/efi.h
- Timestamp:
- 2019-04-06T13:39:58Z (5 years ago)
- Children:
- f7842ef
- Parents:
- 0d073b8
- git-author:
- Petr Pavlu <setup@…> (2019-03-31 14:09:57)
- git-committer:
- Petr Pavlu <setup@…> (2019-04-06 13:39:58)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/genarch/include/genarch/efi.h
r0d073b8 ra4bd537 32 32 #include <arch/types.h> 33 33 34 #define EFI_SUCCESS 0 35 #define EFI_ERROR(code) (((sysarg_t) 1 << (sizeof(sysarg_t) * 8 - 1)) | (code)) 36 #define EFI_LOAD_ERROR EFI_ERROR(1) 37 #define EFI_UNSUPPORTED EFI_ERROR(3) 38 #define EFI_BUFFER_TOO_SMALL EFI_ERROR(5) 39 40 typedef uint64_t efi_status_t; 41 34 42 typedef struct { 35 43 uint64_t signature; … … 56 64 } efi_guid_t; 57 65 58 typedef struct { 59 efi_guid_t guid; 60 void *table; 61 } efi_configuration_table_t; 62 63 typedef struct { 64 efi_table_header_t hdr; 65 char *fw_vendor; 66 uint32_t fw_revision; 67 void *cons_in_handle; 68 void *cons_in; 69 void *cons_out_handle; 70 void *cons_out; 71 void *cons_err_handle; 72 void *cons_err; 73 void *runtime_services; 74 void *boot_services; 75 sysarg_t conf_table_entries; 76 efi_configuration_table_t *conf_table; 77 } efi_system_table_t; 66 typedef enum { 67 EFI_ALLOCATE_ANY_PAGES, 68 EFI_ALLOCATE_MAX_ADDRESS, 69 EFI_ALLOCATE_ADDRESS 70 } efi_allocate_type_t; 78 71 79 72 typedef enum { … … 91 84 EFI_MEMORY_MAPPED_IO, 92 85 EFI_MEMORY_MAPPED_IO_PORT_SPACE, 93 EFI_PAL_CODE 86 EFI_PAL_CODE, 87 EFI_PERSISTENT_MEMORY 94 88 } efi_memory_type_t; 89 90 #define EFI_MEMORY_UC UINT64_C(0x0000000000000001) 91 #define EFI_MEMORY_WC UINT64_C(0x0000000000000002) 92 #define EFI_MEMORY_WT UINT64_C(0x0000000000000004) 93 #define EFI_MEMORY_WB UINT64_C(0x0000000000000008) 94 #define EFI_MEMORY_UCE UINT64_C(0x0000000000000010) 95 #define EFI_MEMORY_WP UINT64_C(0x0000000000001000) 96 #define EFI_MEMORY_RP UINT64_C(0x0000000000002000) 97 #define EFI_MEMORY_XP UINT64_C(0x0000000000004000) 98 #define EFI_MEMORY_NV UINT64_C(0x0000000000008000) 99 #define EFI_MEMORY_MORE_RELIABLE UINT64_C(0x0000000000010000) 100 #define EFI_MEMORY_RO UINT64_C(0x0000000000020000) 101 #define EFI_MEMORY_RUNTIME UINT64_C(0x8000000000000000) 95 102 96 103 typedef struct { … … 102 109 } efi_v1_memdesc_t; 103 110 111 typedef struct { 112 efi_guid_t guid; 113 void *table; 114 } efi_configuration_table_t; 115 116 typedef struct efi_simple_text_output_protocol { 117 void *reset; 118 efi_status_t (*output_string)(struct efi_simple_text_output_protocol *, 119 int16_t *); 120 void *test_string; 121 void *query_mode; 122 void *set_mode; 123 void *set_attribute; 124 void *clear_screen; 125 void *set_cursor_position; 126 void *enable_cursor; 127 void *mode; 128 } efi_simple_text_output_protocol_t; 129 130 typedef struct { 131 efi_table_header_t hdr; 132 void *raise_TPL; 133 void *restore_TPL; 134 efi_status_t (*allocate_pages)(efi_allocate_type_t, efi_memory_type_t, 135 sysarg_t, uint64_t *); 136 efi_status_t (*free_pages)(uint64_t, sysarg_t); 137 efi_status_t (*get_memory_map)(sysarg_t *, efi_v1_memdesc_t *, 138 sysarg_t *, sysarg_t *, uint32_t *); 139 efi_status_t (*allocate_pool)(efi_memory_type_t, sysarg_t, void **); 140 efi_status_t (*free_pool)(void *); 141 void *create_event; 142 void *set_timer; 143 void *wait_for_event; 144 void *signal_event; 145 void *close_event; 146 void *check_event; 147 void *install_protocol_interface; 148 void *reinstall_protocol_interface; 149 void *uninstall_protocol_interface; 150 void *handle_protocol; 151 void *reserved; 152 void *register_protocol_notify; 153 void *locate_handle; 154 void *locate_device_path; 155 void *install_configuration_table; 156 void *load_image; 157 void *start_image; 158 void *exit; 159 void *unload_image; 160 efi_status_t (*exit_boot_services)(void *, sysarg_t); 161 void *get_next_monotonic_count; 162 void *stall; 163 void *set_watchdog_timer; 164 void *connect_controller; 165 void *disconnect_controller; 166 void *open_protocol; 167 void *close_protocol; 168 void *open_protocol_information; 169 void *protocols_per_handle; 170 void *locate_handle_buffer; 171 void *locate_protocol; 172 void *install_multiple_protocol_interfaces; 173 void *uninstall_multiple_protocol_intefaces; 174 void *calculate_crc32; 175 void *copy_mem; 176 void *set_mem; 177 void *create_event_ex; 178 } efi_boot_services_t; 179 180 typedef struct { 181 efi_table_header_t hdr; 182 char *fw_vendor; 183 uint32_t fw_revision; 184 void *cons_in_handle; 185 void *cons_in; 186 void *cons_out_handle; 187 efi_simple_text_output_protocol_t *cons_out; 188 void *cons_err_handle; 189 efi_simple_text_output_protocol_t *cons_err; 190 void *runtime_services; 191 efi_boot_services_t *boot_services; 192 sysarg_t conf_table_entries; 193 efi_configuration_table_t *conf_table; 194 } efi_system_table_t; 195 104 196 #define EFI_PAGE_SIZE 4096 105 197 106 198 extern void *efi_vendor_table_find(efi_system_table_t *, efi_guid_t); 199 extern efi_status_t efi_get_memory_map(efi_system_table_t *, sysarg_t *, 200 efi_v1_memdesc_t **, sysarg_t *, sysarg_t *, uint32_t *); 107 201 108 202 #endif
Note:
See TracChangeset
for help on using the changeset viewer.