[haiku-commits] Change in haiku[master]: Efi: fix headers for 32 bit platforms

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 23 Mar 2020 17:55:05 +0000

From X512 <danger_mail@xxxxxxx>:

X512 has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2413 ;)


Change subject: Efi: fix headers for 32 bit platforms
......................................................................

Efi: fix headers for 32 bit platforms

Change-Id: Id43bfcbfc24b1adb8f6e9fff587c6df9b62910f2
---
M headers/private/kernel/platform/efi/protocol/block-io.h
M headers/private/kernel/platform/efi/types.h
2 files changed, 8 insertions(+), 3 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/13/2413/1

diff --git a/headers/private/kernel/platform/efi/protocol/block-io.h 
b/headers/private/kernel/platform/efi/protocol/block-io.h
index cf53e6b..6f1c52b 100644
--- a/headers/private/kernel/platform/efi/protocol/block-io.h
+++ b/headers/private/kernel/platform/efi/protocol/block-io.h
@@ -26,10 +26,10 @@
                         bool ExtendedVerification) EFIAPI;
     efi_status (*ReadBlocks)(efi_block_io_protocol* self,
                              uint32_t MediaId, uint64_t LBA,
-                             uint64_t BufferSize, void* Buffer) EFIAPI;
+                             size_t BufferSize, void* Buffer) EFIAPI;
     efi_status (*WriteBlocks)(efi_block_io_protocol* self,
                               uint32_t MediaId, uint64_t LBA,
-                              uint64_t BufferSize, const void* Buffer) EFIAPI;
+                              size_t BufferSize, const void* Buffer) EFIAPI;
     efi_status (*FlushBlocks)(efi_block_io_protocol* self);


diff --git a/headers/private/kernel/platform/efi/types.h 
b/headers/private/kernel/platform/efi/types.h
index 0295e7f..8aec555 100644
--- a/headers/private/kernel/platform/efi/types.h
+++ b/headers/private/kernel/platform/efi/types.h
@@ -14,9 +14,14 @@
 #define EFIAPI
 #endif

+#if UINTPTR_MAX == 0xffffffff
+#define EFI_ERROR_MASK 0x80000000
+#elif UINTPTR_MAX == 0xffffffffffffffff
 #define EFI_ERROR_MASK 0x8000000000000000
+#endif
+
 #define EFI_ERR(x) (EFI_ERROR_MASK | x)
-#define EFI_ERROR(x) (((int64_t)x) < 0)
+#define EFI_ERROR(x) (((ssize_t)x) < 0)

 #define EFI_SUCCESS              0
 #define EFI_LOAD_ERROR           EFI_ERR(1)

--
To view, visit https://review.haiku-os.org/c/haiku/+/2413
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Id43bfcbfc24b1adb8f6e9fff587c6df9b62910f2
Gerrit-Change-Number: 2413
Gerrit-PatchSet: 1
Gerrit-Owner: X512 <danger_mail@xxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: Efi: fix headers for 32 bit platforms - Gerrit