[haiku-commits] haiku: hrev54404 - src/system/boot/platform/efi

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 6 Jul 2020 09:55:19 -0400 (EDT)

hrev54404 adds 1 changeset to branch 'master'
old head: 3853f36288165ebacc3eb3004063b91cdf69d969
new head: b0f530bada62bb29ad62403ceee9c36dcc8235a3
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=b0f530bada62+%5E3853f3628816

----------------------------------------------------------------------------

b0f530bada62: efi/devices: Improve tracing, no functional change
  
  Change-Id: Iefb4da99d148f9328a3bbfdf1bbeaec8cf97648a
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/2993
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

                          [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev54404
Commit:      b0f530bada62bb29ad62403ceee9c36dcc8235a3
URL:         https://git.haiku-os.org/haiku/commit/?id=b0f530bada62
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Sun Jul  5 22:26:20 2020 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Mon Jul  6 13:55:16 2020 UTC

----------------------------------------------------------------------------

1 file changed, 30 insertions(+)
src/system/boot/platform/efi/devices.cpp | 30 ++++++++++++++++++++++++++++

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/efi/devices.cpp 
b/src/system/boot/platform/efi/devices.cpp
index 810bf0394d..17cd4a9c14 100644
--- a/src/system/boot/platform/efi/devices.cpp
+++ b/src/system/boot/platform/efi/devices.cpp
@@ -12,6 +12,14 @@
 #include <efi/protocol/block-io.h>
 
 
+//#define TRACE_DEVICES
+#ifdef TRACE_DEVICES
+#   define TRACE(x...) dprintf("efi/devices: " x)
+#else
+#   define TRACE(x...) ;
+#endif
+
+
 static efi_guid BlockIoGUID = EFI_BLOCK_IO_PROTOCOL_GUID;
 
 
@@ -50,6 +58,9 @@ EfiDevice::~EfiDevice()
 ssize_t
 EfiDevice::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
 {
+       TRACE("%s called. pos: %" B_PRIdOFF ", %p, %" B_PRIuSIZE "\n", __func__,
+               pos, buffer, bufferSize);
+
        off_t offset = pos % BlockSize();
        pos /= BlockSize();
 
@@ -69,6 +80,8 @@ EfiDevice::ReadAt(void *cookie, off_t pos, void *buffer, 
size_t bufferSize)
 static off_t
 get_next_check_sum_offset(int32 index, off_t maxSize)
 {
+       TRACE("%s: called\n", __func__);
+
        if (index < 2)
                return index * 512;
 
@@ -82,6 +95,8 @@ get_next_check_sum_offset(int32 index, off_t maxSize)
 static uint32
 compute_check_sum(Node *device, off_t offset)
 {
+       TRACE("%s: called\n", __func__);
+
        char buffer[512];
        ssize_t bytesRead = device->ReadAt(NULL, offset, buffer, 
sizeof(buffer));
        if (bytesRead < B_OK)
@@ -103,6 +118,8 @@ compute_check_sum(Node *device, off_t offset)
 status_t
 platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)
 {
+       TRACE("%s: called\n", __func__);
+
        efi_block_io_protocol *blockIo;
        size_t memSize = 0;
 
@@ -127,6 +144,14 @@ platform_add_boot_device(struct stage2_args *args, 
NodeList *devicesList)
                                (void**)&blockIo) != EFI_SUCCESS)
                        panic("Cannot get block device handle!");
 
+               TRACE("%s: %p: present: %s, logical: %s, removeable: %s, "
+                       "blocksize: %" B_PRIuSIZE ", lastblock: %" B_PRIu64 
"\n",
+                       __func__, blockIo,
+                       blockIo->Media->MediaPresent ? "true" : "false",
+                       blockIo->Media->LogicalPartition ? "true" : "false",
+                       blockIo->Media->RemovableMedia ? "true" : "false",
+                       blockIo->Media->BlockSize, blockIo->Media->LastBlock);
+
                if (!blockIo->Media->MediaPresent || 
blockIo->Media->LogicalPartition)
                        continue;
 
@@ -141,6 +166,8 @@ platform_add_boot_device(struct stage2_args *args, NodeList 
*devicesList)
 status_t
 platform_add_block_devices(struct stage2_args *args, NodeList *devicesList)
 {
+       TRACE("%s: called\n", __func__);
+
        //TODO: Currently we add all in platform_add_boot_device
        return B_ENTRY_NOT_FOUND;
 }
@@ -149,6 +176,7 @@ status_t
 platform_get_boot_partition(struct stage2_args *args, Node *bootDevice,
                NodeList *partitions, boot::Partition **_partition)
 {
+       TRACE("%s: called\n", __func__);
        *_partition = (boot::Partition*)partitions->GetIterator().Next();
        return *_partition != NULL ? B_OK : B_ENTRY_NOT_FOUND;
 }
@@ -157,6 +185,8 @@ platform_get_boot_partition(struct stage2_args *args, Node 
*bootDevice,
 status_t
 platform_register_boot_device(Node *device)
 {
+       TRACE("%s: called\n", __func__);
+
        EfiDevice *efiDevice = (EfiDevice *)device;
        disk_identifier identifier;
 


Other related posts:

  • » [haiku-commits] haiku: hrev54404 - src/system/boot/platform/efi - waddlesplash