Merge pull request #228 from czapek1337/some-fixes

Some minor fixes
This commit is contained in:
mint 2022-10-06 06:05:37 +02:00 committed by GitHub
commit 23f2c7dbac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 13 deletions

View File

@ -504,14 +504,6 @@ fail:
break;
}
EFI_GUID disk_io_guid = DISK_IO_PROTOCOL;
EFI_DISK_IO *disk_io = NULL;
status = gBS->HandleProtocol(handles[i], &disk_io_guid, (void **)&disk_io);
if (status) {
continue;
}
EFI_BLOCK_IO *drive = NULL;
status = gBS->HandleProtocol(handles[i], &block_io_guid, (void **)&drive);
@ -522,13 +514,12 @@ fail:
if (drive->Media->LogicalPartition)
continue;
uint64_t orig;
status = disk_io->ReadDisk(disk_io, drive->Media->MediaId, 0, sizeof(uint64_t), &orig);
status = drive->ReadBlocks(drive, drive->Media->MediaId, 0, 4096, unique_sector_pool);
if (status) {
continue;
}
status = disk_io->WriteDisk(disk_io, drive->Media->MediaId, 0, sizeof(uint64_t), &orig);
status = drive->WriteBlocks(drive, drive->Media->MediaId, 0, 4096, unique_sector_pool);
struct volume *block = ext_mem_alloc(sizeof(struct volume));

View File

@ -106,7 +106,7 @@ could_not_match:
(void **)&loaded_image);
if (status) {
panic(false, "HandleProtocol failure (%x)", status);
goto could_not_match;
}
boot_volume = disk_volume_from_efi_handle(loaded_image->DeviceHandle);

View File

@ -267,7 +267,11 @@ int pit_sleep_and_quit_on_keypress(int seconds) {
if (gBS->HandleProtocol(gST->ConsoleInHandle, &exproto_guid, (void **)&exproto) != EFI_SUCCESS) {
if (gBS->HandleProtocol(gST->ConsoleInHandle, &sproto_guid, (void **)&sproto) != EFI_SUCCESS) {
panic(false, "Your input device doesn't have an input protocol!");
if (gST->ConIn != NULL) {
sproto = gST->ConIn;
} else {
panic(false, "Your input device doesn't have an input protocol!");
}
}
events[0] = sproto->WaitForKey;