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));
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);
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
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