diff --git a/headers/private/kernel/platform/efi/protocol/block-io.h b/headers/private/kernel/platform/efi/protocol/block-io.h index cf53e6b49b..6f1c52b8d2 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 @@ struct efi_block_io_protocol { 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 0295e7fbc6..8aec5553d5 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)