- Timestamp:
- 2019-04-10T15:04:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8df0306
- Parents:
- b58728f
- git-author:
- Petr Pavlu <setup@…> (2019-03-31 14:09:57)
- git-committer:
- Jakub Jermář <jakub@…> (2019-04-10 15:04:17)
- Location:
- boot
- Files:
-
- 13 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.build
rb58728f r84176f3 37 37 38 38 AFLAGS = --fatal-warnings 39 LDFLAGS = -Wl,--fatal-warnings,--warn-common 39 LDFLAGS = -Wl,--fatal-warnings,--warn-common $(EXTRA_LDFLAGS) 40 40 41 41 COMMON_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ -
boot/Makefile.grub
rb58728f r84176f3 64 64 endif 65 65 66 ifeq ($(GRUB_LOADER),multiboot) 66 67 for module in $(COMPONENTS) ; do \ 67 68 cp "$$module" $(BOOT)/ ; \ 68 69 done 70 endif 71 ifeq ($(GRUB_LOADER),chainloader) 72 cp "$(BOOT_OUTPUT)" $(BOOT)/ 73 endif 69 74 70 75 echo "set default=0" > $(BOOT_CONFIG) … … 83 88 84 89 echo "menuentry 'HelenOS $(RELEASE)' --class helenos --class os {" >> $(BOOT_CONFIG) 90 ifeq ($(GRUB_LOADER),multiboot) 85 91 for module in $(MODULES) ; do \ 86 92 echo " echo 'Loading $$module'" >> $(BOOT_CONFIG) ; \ … … 91 97 fi \ 92 98 done 99 endif 100 ifeq ($(GRUB_LOADER),chainloader) 101 echo " echo 'Loading $(BOOT_OUTPUT)'" >> $(BOOT_CONFIG) 102 echo " chainloader /boot/$(BOOT_OUTPUT)" >> $(BOOT_CONFIG) 103 echo " boot" >> $(BOOT_CONFIG) 104 endif 93 105 echo "}" >> $(BOOT_CONFIG) 94 106 -
boot/arch/amd64/Makefile.inc
rb58728f r84176f3 74 74 BUILD = Makefile.empty 75 75 POSTBUILD = Makefile.grub 76 GRUB_LOADER = multiboot -
boot/doc/doxygroups.h
rb58728f r84176f3 11 11 * @ingroup boot 12 12 */ 13 14 /** @addtogroup boot_arm64 arm64 15 * @ingroup boot 16 */ -
boot/genarch/include/genarch/efi.h
rb58728f r84176f3 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 -
boot/genarch/src/efi.c
rb58728f r84176f3 42 42 return NULL; 43 43 } 44 45 efi_status_t efi_get_memory_map(efi_system_table_t *st, 46 sysarg_t *memory_map_size, efi_v1_memdesc_t **memory_map, sysarg_t *map_key, 47 sysarg_t *descriptor_size, uint32_t *descriptor_version) 48 { 49 efi_status_t status; 50 51 *memory_map_size = 8 * sizeof(**memory_map); 52 53 do { 54 /* Allocate space for the memory map. */ 55 status = st->boot_services->allocate_pool(EFI_LOADER_DATA, 56 *memory_map_size, (void **) memory_map); 57 if (status != EFI_SUCCESS) 58 return status; 59 60 /* Try to obtain the map. */ 61 status = st->boot_services->get_memory_map(memory_map_size, 62 *memory_map, map_key, descriptor_size, descriptor_version); 63 if (status == EFI_SUCCESS) 64 return status; 65 66 /* An error occurred, release the allocated memory. */ 67 st->boot_services->free_pool(*memory_map); 68 } while (status == EFI_BUFFER_TOO_SMALL); 69 70 return status; 71 } -
boot/generic/include/align.h
rb58728f r84176f3 49 49 #define ALIGN_UP(s, a) (((s) + ((a) - 1)) & ~((a) - 1)) 50 50 51 /** Check alignment. 52 * 53 * @param s Address or size to be checked for alignment. 54 * @param a Size of alignment, must be a power of 2. 55 */ 56 #define IS_ALIGNED(s, a) (ALIGN_UP((s), (a)) == (s)) 57 51 58 #endif 52 59
Note:
See TracChangeset
for help on using the changeset viewer.