projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
USB ehci freescale support
[oweals/u-boot.git]
/
disk
/
part_efi.c
diff --git
a/disk/part_efi.c
b/disk/part_efi.c
index 979019ac80175053da7da32b7bfbcb3b6ac4d410..d8a81115c5a94993862cd06fe1a29260a880bae4 100644
(file)
--- a/
disk/part_efi.c
+++ b/
disk/part_efi.c
@@
-22,10
+22,10
@@
*/
/*
*/
/*
- * Problems with C
FG
_64BIT_LBA:
+ * Problems with C
ONFIG_SYS
_64BIT_LBA:
*
* struct disk_partition.start in include/part.h is sized as ulong.
*
* struct disk_partition.start in include/part.h is sized as ulong.
- * When C
FG
_64BIT_LBA is activated, lbaint_t changes from ulong to uint64_t.
+ * When C
ONFIG_SYS
_64BIT_LBA is activated, lbaint_t changes from ulong to uint64_t.
* For now, it is cast back to ulong at assignment.
*
* This limits the maximum size of addressable storage to < 2 Terra Bytes
* For now, it is cast back to ulong at assignment.
*
* This limits the maximum size of addressable storage to < 2 Terra Bytes
@@
-163,7
+163,9
@@
int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
/* The ulong casting limits the maximum disk size to 2 TB */
info->start = (ulong) le64_to_int((*pgpt_pte)[part - 1].starting_lba);
/* The ulong casting limits the maximum disk size to 2 TB */
info->start = (ulong) le64_to_int((*pgpt_pte)[part - 1].starting_lba);
- info->size = (ulong) le64_to_int((*pgpt_pte)[part - 1].ending_lba) - info->start;
+ /* The ending LBA is inclusive, to calculate size, add 1 to it */
+ info->size = ((ulong)le64_to_int((*pgpt_pte)[part - 1].ending_lba) + 1)
+ - info->start;
info->blksz = GPT_BLOCK_SIZE;
sprintf((char *)info->name, "%s%d\n", GPT_ENTRY_NAME, part);
info->blksz = GPT_BLOCK_SIZE;
sprintf((char *)info->name, "%s%d\n", GPT_ENTRY_NAME, part);