Use typedef for the GOP structures, in anticipation of unifying 32/64-bit code. Also use more appropriate types in the non-bitness specific structures for the framebuffer address and pointers.
Unified · Split
| @@ -35,7 +35,7 @@ static void find_bits(unsigned long mask, u8 *pos, u8 *size) · 34 unmodified lines | ||
| 35 | 35 | |
| 36 | 36 | static void |
| 37 | 37 | setup_pixel_info(struct screen_info *si, u32 pixels_per_scan_line, |
| 38 | − struct efi_pixel_bitmask pixel_info, int pixel_format) | |
| 38 | + efi_pixel_bitmask_t pixel_info, int pixel_format) | |
| 39 | 39 | { |
| 40 | 40 | if (pixel_format == PIXEL_RGB_RESERVED_8BIT_PER_COLOR) { |
| 41 | 41 | si->lfb_depth = 32; |
| @@ -87,13 +87,13 @@ static efi_status_t · 45 unmodified lines | ||
| 87 | 87 | setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si, |
| 88 | 88 | efi_guid_t *proto, unsigned long size, void **gop_handle) |
| 89 | 89 | { |
| 90 | − struct efi_graphics_output_protocol_32 *gop32, *first_gop; | |
| 90 | + efi_graphics_output_protocol_32_t *gop32, *first_gop; | |
| 91 | 91 | unsigned long nr_gops; |
| 92 | 92 | u16 width, height; |
| 93 | 93 | u32 pixels_per_scan_line; |
| 94 | 94 | u32 ext_lfb_base; |
| 95 | − u64 fb_base; | |
| 96 | − struct efi_pixel_bitmask pixel_info; | |
| 95 | + efi_physical_addr_t fb_base; | |
| 96 | + efi_pixel_bitmask_t pixel_info; | |
| 97 | 97 | int pixel_format; |
| 98 | 98 | efi_status_t status; |
| 99 | 99 | u32 *handles = (u32 *)(unsigned long)gop_handle; |
| @@ -104,13 +104,13 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si, · 4 unmodified lines | ||
| 104 | 104 | |
| 105 | 105 | nr_gops = size / sizeof(u32); |
| 106 | 106 | for (i = 0; i < nr_gops; i++) { |
| 107 | − struct efi_graphics_output_protocol_mode_32 *mode; | |
| 108 | − struct efi_graphics_output_mode_info *info = NULL; | |
| 107 | + efi_graphics_output_protocol_mode_32_t *mode; | |
| 108 | + efi_graphics_output_mode_info_t *info = NULL; | |
| 109 | 109 | efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID; |
| 110 | 110 | bool conout_found = false; |
| 111 | 111 | void *dummy = NULL; |
| 112 | 112 | efi_handle_t h = (efi_handle_t)(unsigned long)handles[i]; |
| 113 | − u64 current_fb_base; | |
| 113 | + efi_physical_addr_t current_fb_base; | |
| 114 | 114 | |
| 115 | 115 | status = efi_call_early(handle_protocol, h, |
| 116 | 116 | proto, (void **)&gop32); |
| @@ -184,13 +184,13 @@ static efi_status_t · 67 unmodified lines | ||
| 184 | 184 | setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si, |
| 185 | 185 | efi_guid_t *proto, unsigned long size, void **gop_handle) |
| 186 | 186 | { |
| 187 | − struct efi_graphics_output_protocol_64 *gop64, *first_gop; | |
| 187 | + efi_graphics_output_protocol_64_t *gop64, *first_gop; | |
| 188 | 188 | unsigned long nr_gops; |
| 189 | 189 | u16 width, height; |
| 190 | 190 | u32 pixels_per_scan_line; |
| 191 | 191 | u32 ext_lfb_base; |
| 192 | − u64 fb_base; | |
| 193 | − struct efi_pixel_bitmask pixel_info; | |
| 192 | + efi_physical_addr_t fb_base; | |
| 193 | + efi_pixel_bitmask_t pixel_info; | |
| 194 | 194 | int pixel_format; |
| 195 | 195 | efi_status_t status; |
| 196 | 196 | u64 *handles = (u64 *)(unsigned long)gop_handle; |
| @@ -201,13 +201,13 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si, · 4 unmodified lines | ||
| 201 | 201 | |
| 202 | 202 | nr_gops = size / sizeof(u64); |
| 203 | 203 | for (i = 0; i < nr_gops; i++) { |
| 204 | − struct efi_graphics_output_protocol_mode_64 *mode; | |
| 205 | − struct efi_graphics_output_mode_info *info = NULL; | |
| 204 | + efi_graphics_output_protocol_mode_64_t *mode; | |
| 205 | + efi_graphics_output_mode_info_t *info = NULL; | |
| 206 | 206 | efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID; |
| 207 | 207 | bool conout_found = false; |
| 208 | 208 | void *dummy = NULL; |
| 209 | 209 | efi_handle_t h = (efi_handle_t)(unsigned long)handles[i]; |
| 210 | − u64 current_fb_base; | |
| 210 | + efi_physical_addr_t current_fb_base; | |
| 211 | 211 | |
| 212 | 212 | status = efi_call_early(handle_protocol, h, |
| 213 | 213 | proto, (void **)&gop64); |
| @@ -1415,69 +1415,69 @@ struct efi_simple_text_output_protocol { · 1414 unmodified lines | ||
| 1415 | 1415 | #define PIXEL_BLT_ONLY 3 |
| 1416 | 1416 | #define PIXEL_FORMAT_MAX 4 |
| 1417 | 1417 | |
| 1418 | −struct efi_pixel_bitmask { | |
| 1418 | +typedef struct { | |
| 1419 | 1419 | u32 red_mask; |
| 1420 | 1420 | u32 green_mask; |
| 1421 | 1421 | u32 blue_mask; |
| 1422 | 1422 | u32 reserved_mask; |
| 1423 | −}; | |
| 1423 | +} efi_pixel_bitmask_t; | |
| 1424 | 1424 | |
| 1425 | −struct efi_graphics_output_mode_info { | |
| 1425 | +typedef struct { | |
| 1426 | 1426 | u32 version; |
| 1427 | 1427 | u32 horizontal_resolution; |
| 1428 | 1428 | u32 vertical_resolution; |
| 1429 | 1429 | int pixel_format; |
| 1430 | − struct efi_pixel_bitmask pixel_information; | |
| 1430 | + efi_pixel_bitmask_t pixel_information; | |
| 1431 | 1431 | u32 pixels_per_scan_line; |
| 1432 | −}; | |
| 1432 | +} efi_graphics_output_mode_info_t; | |
| 1433 | 1433 | |
| 1434 | −struct efi_graphics_output_protocol_mode_32 { | |
| 1434 | +typedef struct { | |
| 1435 | 1435 | u32 max_mode; |
| 1436 | 1436 | u32 mode; |
| 1437 | 1437 | u32 info; |
| 1438 | 1438 | u32 size_of_info; |
| 1439 | 1439 | u64 frame_buffer_base; |
| 1440 | 1440 | u32 frame_buffer_size; |
| 1441 | −}; | |
| 1441 | +} efi_graphics_output_protocol_mode_32_t; | |
| 1442 | 1442 | |
| 1443 | −struct efi_graphics_output_protocol_mode_64 { | |
| 1443 | +typedef struct { | |
| 1444 | 1444 | u32 max_mode; |
| 1445 | 1445 | u32 mode; |
| 1446 | 1446 | u64 info; |
| 1447 | 1447 | u64 size_of_info; |
| 1448 | 1448 | u64 frame_buffer_base; |
| 1449 | 1449 | u64 frame_buffer_size; |
| 1450 | −}; | |
| 1450 | +} efi_graphics_output_protocol_mode_64_t; | |
| 1451 | 1451 | |
| 1452 | −struct efi_graphics_output_protocol_mode { | |
| 1452 | +typedef struct { | |
| 1453 | 1453 | u32 max_mode; |
| 1454 | 1454 | u32 mode; |
| 1455 | − unsigned long info; | |
| 1455 | + efi_graphics_output_mode_info_t *info; | |
| 1456 | 1456 | unsigned long size_of_info; |
| 1457 | − u64 frame_buffer_base; | |
| 1457 | + efi_physical_addr_t frame_buffer_base; | |
| 1458 | 1458 | unsigned long frame_buffer_size; |
| 1459 | −}; | |
| 1459 | +} efi_graphics_output_protocol_mode_t; | |
| 1460 | 1460 | |
| 1461 | −struct efi_graphics_output_protocol_32 { | |
| 1461 | +typedef struct { | |
| 1462 | 1462 | u32 query_mode; |
| 1463 | 1463 | u32 set_mode; |
| 1464 | 1464 | u32 blt; |
| 1465 | 1465 | u32 mode; |
| 1466 | −}; | |
| 1466 | +} efi_graphics_output_protocol_32_t; | |
| 1467 | 1467 | |
| 1468 | −struct efi_graphics_output_protocol_64 { | |
| 1468 | +typedef struct { | |
| 1469 | 1469 | u64 query_mode; |
| 1470 | 1470 | u64 set_mode; |
| 1471 | 1471 | u64 blt; |
| 1472 | 1472 | u64 mode; |
| 1473 | −}; | |
| 1473 | +} efi_graphics_output_protocol_64_t; | |
| 1474 | 1474 | |
| 1475 | −struct efi_graphics_output_protocol { | |
| 1476 | − unsigned long query_mode; | |
| 1477 | − unsigned long set_mode; | |
| 1478 | − unsigned long blt; | |
| 1479 | − struct efi_graphics_output_protocol_mode *mode; | |
| 1480 | −}; | |
| 1475 | +typedef struct { | |
| 1476 | + void *query_mode; | |
| 1477 | + void *set_mode; | |
| 1478 | + void *blt; | |
| 1479 | + efi_graphics_output_protocol_mode_t *mode; | |
| 1480 | +} efi_graphics_output_protocol_t; | |
| 1481 | 1481 | |
| 1482 | 1482 | extern struct list_head efivar_sysfs_list; |
| 1483 | 1483 | |