@@ -421,10 +421,10 @@ EfiStatus read_blocks(EfiBlockIoProtocol *self, uint32_t media_id, uint64_t lba,
421
421
return END_OF_MEDIA;
422
422
}
423
423
424
- const auto bytes_read =
424
+ const size_t bytes_read =
425
425
call_with_stack (interface->io_stack , bio_read_block, dev, buffer, lba,
426
426
buffer_size / dev->block_size );
427
- if (bytes_read != static_cast < ssize_t >( buffer_size) ) {
427
+ if (bytes_read != buffer_size) {
428
428
printf (" Failed to read %ld bytes from %s\n " , buffer_size, dev->name );
429
429
return DEVICE_ERROR;
430
430
}
@@ -449,7 +449,7 @@ EfiStatus open_block_device(EfiHandle handle, void **intf) {
449
449
vmm_alloc (vmm_get_kernel_aspace (), " uefi_io_stack" , kIoStackSize , &io_stack,
450
450
PAGE_SIZE_SHIFT, 0 , 0 );
451
451
}
452
- printf (" %s(%s )\n " , __FUNCTION__, handle);
452
+ printf (" %s(%p )\n " , __FUNCTION__, handle);
453
453
const auto interface = reinterpret_cast <EfiBlockIoInterface *>(
454
454
mspace_malloc (get_mspace (), sizeof (EfiBlockIoInterface)));
455
455
memset (interface, 0 , sizeof (EfiBlockIoInterface));
@@ -504,7 +504,7 @@ EFI_STATUS efi_dt_fixup(struct EfiDtFixupProtocol *self, void *fdt,
504
504
EfiStatus fixup_kernel_commandline (struct GblEfiOsConfigurationProtocol *self,
505
505
const char *command_line, char *fixup,
506
506
size_t *fixup_buffer_size) {
507
- printf (" %s(0x%lx , \" %s\" )\n " , __FUNCTION__, self, command_line);
507
+ printf (" %s(%p , \" %s\" )\n " , __FUNCTION__, self, command_line);
508
508
*fixup_buffer_size = 0 ;
509
509
return SUCCESS;
510
510
}
@@ -513,7 +513,7 @@ EfiStatus fixup_kernel_commandline(struct GblEfiOsConfigurationProtocol *self,
513
513
EfiStatus fixup_bootconfig (struct GblEfiOsConfigurationProtocol *self,
514
514
const char *bootconfig, size_t size, char *fixup,
515
515
size_t *fixup_buffer_size) {
516
- printf (" %s(0x%lx , %s, %lu, %lu)\n " , __FUNCTION__, self, bootconfig, size,
516
+ printf (" %s(%p , %s, %lu, %lu)\n " , __FUNCTION__, self, bootconfig, size,
517
517
*fixup_buffer_size);
518
518
constexpr auto &&to_add = " \n androidboot.fstab_suffix=cf.f2fs."
519
519
" hctr2\n androidboot.boot_devices=4010000000.pcie" ;
@@ -532,7 +532,7 @@ EfiStatus fixup_bootconfig(struct GblEfiOsConfigurationProtocol *self,
532
532
EfiStatus select_device_trees (struct GblEfiOsConfigurationProtocol *self,
533
533
GblEfiVerifiedDeviceTree *device_trees,
534
534
size_t num_device_trees) {
535
- printf (" %s(0x%lx , %lx, %lu)\n " , __FUNCTION__, self, device_trees,
535
+ printf (" %s(%p , %p %lu)\n " , __FUNCTION__, self, device_trees,
536
536
num_device_trees);
537
537
return UNSUPPORTED;
538
538
}
@@ -547,29 +547,29 @@ EfiStatus open_protocol(EfiHandle handle, const EfiGuid *protocol, void **intf,
547
547
interface->parent_handle = handle;
548
548
interface->image_base = handle;
549
549
*intf = interface;
550
- printf (" %s(LOADED_IMAGE_PROTOCOL_GUID, handle=0x%lx , agent_handle=0x%lx , "
551
- " controller_handle=0x%lx , attr=0x%x)\n " ,
550
+ printf (" %s(LOADED_IMAGE_PROTOCOL_GUID, handle=%p , agent_handle=%p , "
551
+ " controller_handle=%p , attr=0x%x)\n " ,
552
552
__FUNCTION__, handle, agent_handle, controller_handle, attr);
553
553
return SUCCESS;
554
554
} else if (guid_eq (protocol, EFI_DEVICE_PATH_PROTOCOL_GUID)) {
555
555
printf (
556
- " %s(EFI_DEVICE_PATH_PROTOCOL_GUID, handle=0x%lx , agent_handle=0x%lx , "
557
- " controller_handle=0x%lx , attr=0x%x)\n " ,
556
+ " %s(EFI_DEVICE_PATH_PROTOCOL_GUID, handle=%p , agent_handle=%p , "
557
+ " controller_handle=%p , attr=0x%x)\n " ,
558
558
__FUNCTION__, handle, agent_handle, controller_handle, attr);
559
559
return UNSUPPORTED;
560
560
} else if (guid_eq (protocol, EFI_BLOCK_IO_PROTOCOL_GUID)) {
561
- printf (" %s(EFI_BLOCK_IO_PROTOCOL_GUID, handle=0x%lx , agent_handle=0x%lx , "
562
- " controller_handle=0x%lx , attr=0x%x)\n " ,
561
+ printf (" %s(EFI_BLOCK_IO_PROTOCOL_GUID, handle=%p , agent_handle=%p , "
562
+ " controller_handle=%p , attr=0x%x)\n " ,
563
563
__FUNCTION__, handle, agent_handle, controller_handle, attr);
564
564
return open_block_device (handle, intf);
565
565
} else if (guid_eq (protocol, EFI_BLOCK_IO2_PROTOCOL_GUID)) {
566
- printf (" %s(EFI_BLOCK_IO2_PROTOCOL_GUID, handle=0x%lx , agent_handle=0x%lx , "
567
- " controller_handle=0x%lx , attr=0x%x)\n " ,
566
+ printf (" %s(EFI_BLOCK_IO2_PROTOCOL_GUID, handle=%p , agent_handle=%p , "
567
+ " controller_handle=%p , attr=0x%x)\n " ,
568
568
__FUNCTION__, handle, agent_handle, controller_handle, attr);
569
569
return UNSUPPORTED;
570
570
} else if (guid_eq (protocol, EFI_DT_FIXUP_PROTOCOL_GUID)) {
571
- printf (" %s(EFI_DT_FIXUP_PROTOCOL_GUID, handle=0x%lx , agent_handle=0x%lx , "
572
- " controller_handle=0x%lx , attr=0x%x)\n " ,
571
+ printf (" %s(EFI_DT_FIXUP_PROTOCOL_GUID, handle=%p , agent_handle=%p , "
572
+ " controller_handle=%p , attr=0x%x)\n " ,
573
573
__FUNCTION__, handle, agent_handle, controller_handle, attr);
574
574
if (intf != nullptr ) {
575
575
EfiDtFixupProtocol *fixup = nullptr ;
@@ -584,9 +584,9 @@ EfiStatus open_protocol(EfiHandle handle, const EfiGuid *protocol, void **intf,
584
584
}
585
585
return SUCCESS;
586
586
} else if (guid_eq (protocol, EFI_GBL_OS_CONFIGURATION_PROTOCOL_GUID)) {
587
- printf (" %s(EFI_GBL_OS_CONFIGURATION_PROTOCOL_GUID, handle=0x%lx , "
588
- " agent_handle=0x%lx , "
589
- " controller_handle=0x%lx , attr=0x%x)\n " ,
587
+ printf (" %s(EFI_GBL_OS_CONFIGURATION_PROTOCOL_GUID, handle=%p , "
588
+ " agent_handle=%p , "
589
+ " controller_handle=%p , attr=0x%x)\n " ,
590
590
__FUNCTION__, handle, agent_handle, controller_handle, attr);
591
591
GblEfiOsConfigurationProtocol *config = nullptr ;
592
592
allocate_pool (BOOT_SERVICES_DATA, sizeof (*config),
@@ -610,24 +610,24 @@ EfiStatus open_protocol(EfiHandle handle, const EfiGuid *protocol, void **intf,
610
610
EfiStatus close_protocol (EfiHandle handle, const EfiGuid *protocol,
611
611
EfiHandle agent_handle, EfiHandle controller_handle) {
612
612
if (guid_eq (protocol, LOADED_IMAGE_PROTOCOL_GUID)) {
613
- printf (" %s(LOADED_IMAGE_PROTOCOL_GUID, handle=0x%lx , agent_handle=0x%lx , "
614
- " controller_handle=0x%lx )\n " ,
613
+ printf (" %s(LOADED_IMAGE_PROTOCOL_GUID, handle=%p , agent_handle=%p , "
614
+ " controller_handle=%p )\n " ,
615
615
__FUNCTION__, handle, agent_handle, controller_handle);
616
616
return SUCCESS;
617
617
} else if (guid_eq (protocol, EFI_DEVICE_PATH_PROTOCOL_GUID)) {
618
618
printf (
619
- " %s(EFI_DEVICE_PATH_PROTOCOL_GUID, handle=0x%lx , agent_handle=0x%lx , "
620
- " controller_handle=0x%lx )\n " ,
619
+ " %s(EFI_DEVICE_PATH_PROTOCOL_GUID, handle=%p , agent_handle=%p , "
620
+ " controller_handle=%p )\n " ,
621
621
__FUNCTION__, handle, agent_handle, controller_handle);
622
622
return SUCCESS;
623
623
} else if (guid_eq (protocol, EFI_BLOCK_IO_PROTOCOL_GUID)) {
624
- printf (" %s(EFI_BLOCK_IO_PROTOCOL_GUID, handle=0x%lx , agent_handle=0x%lx , "
625
- " controller_handle=0x%lx )\n " ,
624
+ printf (" %s(EFI_BLOCK_IO_PROTOCOL_GUID, handle=%p , agent_handle=%p , "
625
+ " controller_handle=%p )\n " ,
626
626
__FUNCTION__, handle, agent_handle, controller_handle);
627
627
return SUCCESS;
628
628
} else if (guid_eq (protocol, EFI_DT_FIXUP_PROTOCOL_GUID)) {
629
- printf (" %s(EFI_DT_FIXUP_PROTOCOL_GUID, handle=0x%lx , agent_handle=0x%lx , "
630
- " controller_handle=0x%lx )\n " ,
629
+ printf (" %s(EFI_DT_FIXUP_PROTOCOL_GUID, handle=%p , agent_handle=%p , "
630
+ " controller_handle=%p )\n " ,
631
631
__FUNCTION__, handle, agent_handle, controller_handle);
632
632
return SUCCESS;
633
633
}
@@ -661,16 +661,16 @@ EfiStatus locate_handle_buffer(EfiLocateHandleSearchType search_type,
661
661
if (search_type == BY_PROTOCOL) {
662
662
return list_block_devices (num_handles, buf);
663
663
}
664
- printf (" %s(0x%x, EFI_BLOCK_IO_PROTOCOL_GUID, search_key=0x%lx )\n " ,
664
+ printf (" %s(0x%x, EFI_BLOCK_IO_PROTOCOL_GUID, search_key=%p )\n " ,
665
665
__FUNCTION__, search_type, search_key);
666
666
return UNSUPPORTED;
667
667
} else if (guid_eq (protocol, EFI_TEXT_INPUT_PROTOCOL_GUID)) {
668
- printf (" %s(0x%x, EFI_TEXT_INPUT_PROTOCOL_GUID, search_key=0x%lx )\n " ,
668
+ printf (" %s(0x%x, EFI_TEXT_INPUT_PROTOCOL_GUID, search_key=%p )\n " ,
669
669
__FUNCTION__, search_type, search_key);
670
670
return NOT_FOUND;
671
671
} else if (guid_eq (protocol, EFI_GBL_OS_CONFIGURATION_PROTOCOL_GUID)) {
672
672
printf (
673
- " %s(0x%x, EFI_GBL_OS_CONFIGURATION_PROTOCOL_GUID, search_key=0x%lx )\n " ,
673
+ " %s(0x%x, EFI_GBL_OS_CONFIGURATION_PROTOCOL_GUID, search_key=%p )\n " ,
674
674
__FUNCTION__, search_type, search_key);
675
675
if (num_handles != nullptr ) {
676
676
*num_handles = 1 ;
@@ -681,7 +681,7 @@ EfiStatus locate_handle_buffer(EfiLocateHandleSearchType search_type,
681
681
}
682
682
return SUCCESS;
683
683
} else if (guid_eq (protocol, EFI_DT_FIXUP_PROTOCOL_GUID)) {
684
- printf (" %s(0x%x, EFI_DT_FIXUP_PROTOCOL_GUID, search_key=0x%lx )\n " ,
684
+ printf (" %s(0x%x, EFI_DT_FIXUP_PROTOCOL_GUID, search_key=%p )\n " ,
685
685
__FUNCTION__, search_type, search_key);
686
686
if (num_handles != nullptr ) {
687
687
*num_handles = 1 ;
@@ -692,7 +692,7 @@ EfiStatus locate_handle_buffer(EfiLocateHandleSearchType search_type,
692
692
}
693
693
return SUCCESS;
694
694
}
695
- printf (" %s(0x%x, (0x%x 0x%x 0x%x 0x%llx), search_key=0x%lx )\n " , __FUNCTION__,
695
+ printf (" %s(0x%x, (0x%x 0x%x 0x%x 0x%llx), search_key=%p )\n " , __FUNCTION__,
696
696
search_type, protocol->data1 , protocol->data2 , protocol->data3 ,
697
697
*(uint64_t *)&protocol->data4 , search_key);
698
698
return UNSUPPORTED;
0 commit comments