david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[efi] Dump details of any calls to our dummy block and disk I/O protocols

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2014-08-22 14:57:15 +01:00
parent a56bba3912
commit ec7c331ca3
1 changed files with 33 additions and 15 deletions

View File

@ -477,6 +477,7 @@ static EFI_STATUS EFIAPI
efi_file_open_volume ( EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *filesystem __unused, efi_file_open_volume ( EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *filesystem __unused,
EFI_FILE_PROTOCOL **file ) { EFI_FILE_PROTOCOL **file ) {
DBGC ( &efi_file_root, "EFIFILE open volume\n" );
*file = &efi_file_root.file; *file = &efi_file_root.file;
return 0; return 0;
} }
@ -489,38 +490,49 @@ static EFI_SIMPLE_FILE_SYSTEM_PROTOCOL efi_simple_file_system_protocol = {
/** Dummy block I/O reset */ /** Dummy block I/O reset */
static EFI_STATUS EFIAPI static EFI_STATUS EFIAPI
efi_block_io_reset ( EFI_BLOCK_IO_PROTOCOL *this __unused, efi_block_io_reset ( EFI_BLOCK_IO_PROTOCOL *this __unused, BOOLEAN extended ) {
BOOLEAN extended __unused ) {
DBGC ( &efi_file_root, "EFIFILE block %sreset\n",
( extended ? "extended " : "" ) );
return 0; return 0;
} }
/** Dummy block I/O read */ /** Dummy block I/O read */
static EFI_STATUS EFIAPI static EFI_STATUS EFIAPI
efi_block_io_read_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused, efi_block_io_read_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused, UINT32 MediaId,
UINT32 MediaId __unused, EFI_LBA lba __unused, EFI_LBA lba, UINTN len, VOID *data ) {
UINTN len __unused, VOID *data __unused ) {
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; return EFI_NO_MEDIA;
} }
/** Dummy block I/O write */ /** Dummy block I/O write */
static EFI_STATUS EFIAPI static EFI_STATUS EFIAPI
efi_block_io_write_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused, efi_block_io_write_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused,
UINT32 MediaId __unused, EFI_LBA lba __unused, UINT32 MediaId, EFI_LBA lba, UINTN len,
UINTN len __unused, VOID *data __unused ) { 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; return EFI_NO_MEDIA;
} }
/** Dummy block I/O flush */ /** Dummy block I/O flush */
static EFI_STATUS EFIAPI static EFI_STATUS EFIAPI
efi_block_io_flush_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused ) { efi_block_io_flush_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused ) {
DBGC ( &efi_file_root, "EFIFILE block flush\n" );
return 0; return 0;
} }
/** Dummy block I/O media */ /** Dummy block I/O media */
static EFI_BLOCK_IO_MEDIA efi_block_io_media = { static EFI_BLOCK_IO_MEDIA efi_block_io_media = {
.MediaId = EFI_MEDIA_ID_MAGIC, .MediaId = EFI_MEDIA_ID_MAGIC,
.MediaPresent = 1, .MediaPresent = TRUE,
.ReadOnly = 1, .ReadOnly = TRUE,
.BlockSize = 1, .BlockSize = 1,
}; };
@ -536,17 +548,23 @@ static EFI_BLOCK_IO_PROTOCOL efi_block_io_protocol = {
/** Dummy disk I/O read */ /** Dummy disk I/O read */
static EFI_STATUS EFIAPI static EFI_STATUS EFIAPI
efi_disk_io_read_disk ( EFI_DISK_IO_PROTOCOL *this __unused, efi_disk_io_read_disk ( EFI_DISK_IO_PROTOCOL *this __unused, UINT32 MediaId,
UINT32 MediaId __unused, UINT64 offset __unused, UINT64 offset, UINTN len, VOID *data ) {
UINTN len __unused, VOID *data __unused ) {
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; return EFI_NO_MEDIA;
} }
/** Dummy disk I/O write */ /** Dummy disk I/O write */
static EFI_STATUS EFIAPI static EFI_STATUS EFIAPI
efi_disk_io_write_disk ( EFI_DISK_IO_PROTOCOL *this __unused, efi_disk_io_write_disk ( EFI_DISK_IO_PROTOCOL *this __unused, UINT32 MediaId,
UINT32 MediaId __unused, UINT64 offset __unused, UINT64 offset, UINTN len, VOID *data ) {
UINTN len __unused, VOID *data __unused ) {
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; return EFI_NO_MEDIA;
} }