hw: implement update_data_region for ARMv8

Ref #3426
This commit is contained in:
Stefan Kalkowski 2019-07-10 17:52:49 +02:00 committed by Christian Helmuth
parent dd505edd19
commit ee38504d81
3 changed files with 14 additions and 1 deletions

View File

@ -86,6 +86,15 @@ void Genode::Cpu::clean_data_cache_by_virt_region(addr_t base, size_t sz)
}
void Genode::Cpu::clean_invalidate_data_cache_by_virt_region(addr_t base, size_t sz)
{
addr_t const top = base + sz;
base &= line_align_mask;
for (; base < top; base += line_size) {
asm volatile("dc civac, %0" :: "r" (base)); }
}
void Genode::Cpu::invalidate_instr_cache_by_virt_region(addr_t base,
size_t size)
{

View File

@ -87,6 +87,7 @@ struct Genode::Cpu : Hw::Arm_64_cpu
static void clean_data_cache_by_virt_region(addr_t, size_t);
static void clean_invalidate_data_cache_by_virt_region(addr_t, size_t);
static void invalidate_instr_cache_by_virt_region(addr_t, size_t);
};

View File

@ -106,7 +106,10 @@ bool Kernel::Pd::invalidate_tlb(Cpu &, addr_t addr, size_t size)
void Kernel::Thread::_call_update_data_region()
{
Genode::raw(__func__, " not implemented yet!");
addr_t const base = (addr_t)user_arg_1();
size_t const size = (size_t)user_arg_2();
Cpu::clean_invalidate_data_cache_by_virt_region(base, size);
Cpu::invalidate_instr_cache_by_virt_region(base, size);
}