mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
base: interface for D- and I-cache synchronization
On ARM, when machine instructions get written into the data cache (for example by a JIT compiler), one needs to make sure that the instructions get written out to memory and read from memory into the instruction cache before they get executed. This functionality is usually provided by a kernel syscall and this patch adds a generic interface for Genode applications to use it. Fixes #1153.
This commit is contained in:
committed by
Norman Feske
parent
b28a551538
commit
078883fda3
9
repos/base-linux/lib/mk/arm/base.mk
Normal file
9
repos/base-linux/lib/mk/arm/base.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# \brief ARM-specific base lib parts that are not used by hybrid applications
|
||||
# \author Christian Prochaska
|
||||
# \date 2014-05-14
|
||||
#
|
||||
|
||||
SRC_CC += cpu/arm/cache.cc
|
||||
|
||||
include $(REP_DIR)/lib/mk/base.mk
|
||||
9
repos/base-linux/lib/mk/x86/base.mk
Normal file
9
repos/base-linux/lib/mk/x86/base.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# \brief x86-specific base lib parts that are not used by hybrid applications
|
||||
# \author Christian Prochaska
|
||||
# \date 2014-05-14
|
||||
#
|
||||
|
||||
SRC_CC += cpu/cache.cc
|
||||
|
||||
include $(REP_DIR)/lib/mk/base.mk
|
||||
21
repos/base-linux/src/base/cpu/arm/cache.cc
Normal file
21
repos/base-linux/src/base/cpu/arm/cache.cc
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* \brief Implementation of the cache operations
|
||||
* \author Christian Prochaska
|
||||
* \date 2014-05-13
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <linux_syscalls.h>
|
||||
|
||||
#include <cpu/cache.h>
|
||||
|
||||
void Genode::cache_coherent(Genode::addr_t addr, Genode::size_t size)
|
||||
{
|
||||
lx_syscall(__ARM_NR_cacheflush, addr, addr + size, 0);
|
||||
}
|
||||
Reference in New Issue
Block a user