From ed55931073f564aa501a5cfc7e2dd4d674ef133c Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 15 Dec 2013 14:27:04 +0100 Subject: [PATCH] * grub-core/commands/acpi.c: Use grub_addr_t rather than long when appropriate. --- ChangeLog | 5 +++++ grub-core/commands/acpi.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43076ddd4..136a78bb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-12-15 Vladimir Serbinenko + + * grub-core/commands/acpi.c: Use grub_addr_t rather than long when + appropriate. + 2013-12-15 Vladimir Serbinenko * grub-core/kern/i386/coreboot/cbtable.c: Use char * arithmetic rather diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c index 14f639c6d..97c2cf282 100644 --- a/grub-core/commands/acpi.c +++ b/grub-core/commands/acpi.c @@ -227,7 +227,7 @@ grub_acpi_create_ebda (void) grub_dprintf ("acpi", "Copying rsdpv2 to %p\n", target); v2inebda = target; target += v2->length; - target = (grub_uint8_t *) ((((long) target - 1) | 0xf) + 1); + target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1); v2 = 0; break; } @@ -246,7 +246,7 @@ grub_acpi_create_ebda (void) grub_dprintf ("acpi", "Copying rsdpv1 to %p\n", target); v1inebda = target; target += sizeof (struct grub_acpi_rsdp_v10); - target = (grub_uint8_t *) ((((long) target - 1) | 0xf) + 1); + target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1); v1 = 0; break; } @@ -265,7 +265,7 @@ grub_acpi_create_ebda (void) grub_memcpy (target, v2, v2->length); v2inebda = target; target += v2->length; - target = (grub_uint8_t *) ((((long) target - 1) | 0xf) + 1); + target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1); v2 = 0; break; } @@ -282,7 +282,7 @@ grub_acpi_create_ebda (void) grub_memcpy (target, v1, sizeof (struct grub_acpi_rsdp_v10)); v1inebda = target; target += sizeof (struct grub_acpi_rsdp_v10); - target = (grub_uint8_t *) ((((long) target - 1) | 0xf) + 1); + target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1); v1 = 0; break; } @@ -306,7 +306,7 @@ grub_acpi_create_ebda (void) *target = 0; grub_dprintf ("acpi", "Switching EBDA\n"); - (*((grub_uint16_t *) 0x40e)) = ((long)targetebda) >> 4; + (*((grub_uint16_t *) 0x40e)) = ((grub_addr_t) targetebda) >> 4; grub_dprintf ("acpi", "EBDA switched\n"); return GRUB_ERR_NONE;