diff --git a/grub-core/kern/arm64/cache.c b/grub-core/kern/arm64/cache.c index c4f02b868..b84383da1 100644 --- a/grub-core/kern/arm64/cache.c +++ b/grub-core/kern/arm64/cache.c @@ -31,7 +31,7 @@ void grub_arch_invalidate_icache_range (grub_addr_t beg, grub_addr_t end, static void probe_caches (void) { - grub_uint32_t cache_type; + grub_uint64_t cache_type; /* Read Cache Type Register */ asm volatile ("mrs %0, ctr_el0": "=r"(cache_type)); @@ -46,17 +46,17 @@ probe_caches (void) void grub_arch_sync_caches (void *address, grub_size_t len) { - grub_uint64_t start, end, max; + grub_uint64_t start, end, max_align; if (dlinesz == 0) probe_caches(); if (dlinesz == 0) grub_fatal ("Unknown cache line size!"); - max = dlinesz > ilinesz ? dlinesz : ilinesz; + max_align = dlinesz > ilinesz ? dlinesz : ilinesz; - start = ALIGN_DOWN ((grub_uint64_t) address, max); - end = ALIGN_UP ((grub_uint64_t) address + len, max); + start = ALIGN_DOWN ((grub_uint64_t) address, max_align); + end = ALIGN_UP ((grub_uint64_t) address + len, max_align); grub_arch_clean_dcache_range (start, end, dlinesz); grub_arch_invalidate_icache_range (start, end, ilinesz); diff --git a/grub-core/kern/arm64/cache_flush.S b/grub-core/kern/arm64/cache_flush.S index 589e8eb7a..e064f7ece 100644 --- a/grub-core/kern/arm64/cache_flush.S +++ b/grub-core/kern/arm64/cache_flush.S @@ -31,7 +31,7 @@ FUNCTION(grub_arch_clean_dcache_range) // Clean data cache for range to point-of-unification 1: cmp x0, x1 - bge 2f + b.ge 2f dc cvau, x0 // Clean Virtual Address to PoU add x0, x0, x2 // Next line b 1b @@ -45,7 +45,7 @@ FUNCTION(grub_arch_clean_dcache_range) FUNCTION(grub_arch_invalidate_icache_range) // Invalidate instruction cache for range to point-of-unification 1: cmp x0, x1 - bge 2f + b.ge 2f ic ivau, x0 // Invalidate Virtual Address to PoU add x0, x0, x2 // Next line b 1b