mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-01 20:11:32 +00:00
disk: part_efi: resolve endianness issues
Tested on little endian ARMv7 and ARMv8 configurations Signed-off-by: Steve Rae <srae@broadcom.com>
This commit is contained in:
parent
ed6a5d4f88
commit
dedf37bb61
1 changed files with 3 additions and 2 deletions
|
@ -279,7 +279,7 @@ int write_gpt_table(block_dev_desc_t *dev_desc,
|
||||||
gpt_h->header_crc32 = cpu_to_le32(calc_crc32);
|
gpt_h->header_crc32 = cpu_to_le32(calc_crc32);
|
||||||
|
|
||||||
if (dev_desc->block_write(dev_desc->dev,
|
if (dev_desc->block_write(dev_desc->dev,
|
||||||
le32_to_cpu(gpt_h->last_usable_lba + 1),
|
le32_to_cpu(gpt_h->last_usable_lba) + 1,
|
||||||
pte_blk_cnt, gpt_e) != pte_blk_cnt)
|
pte_blk_cnt, gpt_e) != pte_blk_cnt)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
@ -300,6 +300,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
|
||||||
{
|
{
|
||||||
u32 offset = (u32)le32_to_cpu(gpt_h->first_usable_lba);
|
u32 offset = (u32)le32_to_cpu(gpt_h->first_usable_lba);
|
||||||
ulong start;
|
ulong start;
|
||||||
|
u32 last_usable_lba = (u32)le32_to_cpu(gpt_h->last_usable_lba);
|
||||||
int i, k;
|
int i, k;
|
||||||
size_t efiname_len, dosname_len;
|
size_t efiname_len, dosname_len;
|
||||||
#ifdef CONFIG_PARTITION_UUIDS
|
#ifdef CONFIG_PARTITION_UUIDS
|
||||||
|
@ -321,7 +322,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
|
||||||
gpt_e[i].starting_lba = cpu_to_le64(offset);
|
gpt_e[i].starting_lba = cpu_to_le64(offset);
|
||||||
offset += partitions[i].size;
|
offset += partitions[i].size;
|
||||||
}
|
}
|
||||||
if (offset >= gpt_h->last_usable_lba) {
|
if (offset >= last_usable_lba) {
|
||||||
printf("Partitions layout exceds disk size\n");
|
printf("Partitions layout exceds disk size\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue