Skip to content

Commit

Permalink
[efi] Dump details of any calls to our dummy block and disk I/O proto…
Browse files Browse the repository at this point in the history
…cols

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Aug 22, 2014
1 parent a56bba3 commit ec7c331
Showing 1 changed file with 33 additions and 15 deletions.
48 changes: 33 additions & 15 deletions src/interface/efi/efi_file.c
Expand Up @@ -477,6 +477,7 @@ static EFI_STATUS EFIAPI
efi_file_open_volume ( EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *filesystem __unused,
EFI_FILE_PROTOCOL **file ) {

DBGC ( &efi_file_root, "EFIFILE open volume\n" );
*file = &efi_file_root.file;
return 0;
}
Expand All @@ -489,38 +490,49 @@ static EFI_SIMPLE_FILE_SYSTEM_PROTOCOL efi_simple_file_system_protocol = {

/** Dummy block I/O reset */
static EFI_STATUS EFIAPI
efi_block_io_reset ( EFI_BLOCK_IO_PROTOCOL *this __unused,
BOOLEAN extended __unused ) {
efi_block_io_reset ( EFI_BLOCK_IO_PROTOCOL *this __unused, BOOLEAN extended ) {

DBGC ( &efi_file_root, "EFIFILE block %sreset\n",
( extended ? "extended " : "" ) );
return 0;
}

/** Dummy block I/O read */
static EFI_STATUS EFIAPI
efi_block_io_read_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused,
UINT32 MediaId __unused, EFI_LBA lba __unused,
UINTN len __unused, VOID *data __unused ) {
efi_block_io_read_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused, UINT32 MediaId,
EFI_LBA lba, UINTN len, VOID *data ) {

DBGC ( &efi_file_root, "EFIFILE block read ID %#08x LBA %#08llx -> "
"%p+%zx\n", MediaId, ( ( unsigned long long ) lba ),
data, ( ( size_t ) len ) );
return EFI_NO_MEDIA;
}

/** Dummy block I/O write */
static EFI_STATUS EFIAPI
efi_block_io_write_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused,
UINT32 MediaId __unused, EFI_LBA lba __unused,
UINTN len __unused, VOID *data __unused ) {
UINT32 MediaId, EFI_LBA lba, UINTN len,
VOID *data ) {

DBGC ( &efi_file_root, "EFIFILE block write ID %#08x LBA %#08llx <- "
"%p+%zx\n", MediaId, ( ( unsigned long long ) lba ),
data, ( ( size_t ) len ) );
return EFI_NO_MEDIA;
}

/** Dummy block I/O flush */
static EFI_STATUS EFIAPI
efi_block_io_flush_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused ) {

DBGC ( &efi_file_root, "EFIFILE block flush\n" );
return 0;
}

/** Dummy block I/O media */
static EFI_BLOCK_IO_MEDIA efi_block_io_media = {
.MediaId = EFI_MEDIA_ID_MAGIC,
.MediaPresent = 1,
.ReadOnly = 1,
.MediaPresent = TRUE,
.ReadOnly = TRUE,
.BlockSize = 1,
};

Expand All @@ -536,17 +548,23 @@ static EFI_BLOCK_IO_PROTOCOL efi_block_io_protocol = {

/** Dummy disk I/O read */
static EFI_STATUS EFIAPI
efi_disk_io_read_disk ( EFI_DISK_IO_PROTOCOL *this __unused,
UINT32 MediaId __unused, UINT64 offset __unused,
UINTN len __unused, VOID *data __unused ) {
efi_disk_io_read_disk ( EFI_DISK_IO_PROTOCOL *this __unused, UINT32 MediaId,
UINT64 offset, UINTN len, VOID *data ) {

DBGC ( &efi_file_root, "EFIFILE disk read ID %#08x offset %#08llx -> "
"%p+%zx\n", MediaId, ( ( unsigned long long ) offset ),
data, ( ( size_t ) len ) );
return EFI_NO_MEDIA;
}

/** Dummy disk I/O write */
static EFI_STATUS EFIAPI
efi_disk_io_write_disk ( EFI_DISK_IO_PROTOCOL *this __unused,
UINT32 MediaId __unused, UINT64 offset __unused,
UINTN len __unused, VOID *data __unused ) {
efi_disk_io_write_disk ( EFI_DISK_IO_PROTOCOL *this __unused, UINT32 MediaId,
UINT64 offset, UINTN len, VOID *data ) {

DBGC ( &efi_file_root, "EFIFILE disk write ID %#08x offset %#08llx <- "
"%p+%zx\n", MediaId, ( ( unsigned long long ) offset ),
data, ( ( size_t ) len ) );
return EFI_NO_MEDIA;
}

Expand Down

0 comments on commit ec7c331

Please sign in to comment.