From 5505e1909ce7dfbc7f223e7991fffeeb9d60f011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 16 Jun 2009 10:38:25 +0000 Subject: [PATCH] * Apparently the "free_identify_partition_cookie()" function pointer should not be NULL. If the intention is to allow this, then there is a bug somewhere else. Fixes booting on Macs, thanks to Zenja for testing this! * Fixed what I believe to be an off-by-one error in BlockCount(). This also makes it symetrical with SetBlockCount(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31069 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/partitioning_systems/efi/efi_gpt.cpp | 9 ++++++++- src/add-ons/kernel/partitioning_systems/efi/efi_gpt.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/partitioning_systems/efi/efi_gpt.cpp b/src/add-ons/kernel/partitioning_systems/efi/efi_gpt.cpp index 28f1d303f3..5df649a328 100644 --- a/src/add-ons/kernel/partitioning_systems/efi/efi_gpt.cpp +++ b/src/add-ons/kernel/partitioning_systems/efi/efi_gpt.cpp @@ -505,6 +505,13 @@ efi_gpt_scan_partition(int fd, partition_data *partition, void *_cookie) } +static void +efi_gpt_free_identify_partition_cookie(partition_data *partition, void *_cookie) +{ + // Cookie is freed in efi_gpt_free_partition_content_cookie(). +} + + static void efi_gpt_free_partition_content_cookie(partition_data *partition) { @@ -1222,7 +1229,7 @@ partition_module_info gEFIPartitionModule = { // scanning efi_gpt_identify_partition, efi_gpt_scan_partition, - NULL, // free_identify_partition_cookie + efi_gpt_free_identify_partition_cookie, NULL, // free_partition_cookie efi_gpt_free_partition_content_cookie, diff --git a/src/add-ons/kernel/partitioning_systems/efi/efi_gpt.h b/src/add-ons/kernel/partitioning_systems/efi/efi_gpt.h index 4436362b47..2de5e9a4d2 100644 --- a/src/add-ons/kernel/partitioning_systems/efi/efi_gpt.h +++ b/src/add-ons/kernel/partitioning_systems/efi/efi_gpt.h @@ -113,7 +113,7 @@ struct efi_partition_entry { void SetBlockCount(uint64 blockCount) { SetEndBlock(StartBlock() + blockCount - 1); } uint64 BlockCount() const - { return EndBlock() - StartBlock(); } + { return EndBlock() - StartBlock() + 1; } } _PACKED; #endif /* EFI_GPT_H */