3 * \brief Cache functions
6 * \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
10 * (c) 2007-2009 Author(s)
11 * economic rights: Technische Universität Dresden (Germany)
13 * This file is part of TUD:OS and distributed under the terms of the
14 * GNU General Public License 2.
15 * Please see the COPYING-GPL-2 file for details.
17 * As a special exception, you may use this file as part of a free software
18 * library without restriction. Specifically, if other files instantiate
19 * templates or use macros or inline functions from this file, or you compile
20 * this file and link it with other files to produce an executable, this
21 * file does not by itself cause the resulting executable to be covered by
22 * the GNU General Public License. This exception does not however
23 * invalidate any other reasons why the executable file might be covered by
24 * the GNU General Public License.
26 #ifndef __L4SYS__INCLUDE__ARCH_ARM__CACHE_H__
27 #define __L4SYS__INCLUDE__ARCH_ARM__CACHE_H__
29 #include <l4/sys/compiler.h>
30 #include <l4/sys/syscall_defs.h>
32 #include_next <l4/sys/cache.h>
38 l4_cache_op_arm_call(unsigned long op,
43 l4_cache_op_arm_call(unsigned long op,
47 register unsigned long _op asm ("r0") = op;
48 register unsigned long _start asm ("r1") = start;
49 register unsigned long _end asm ("r2") = end;
52 ("@ l4_cache_op_arm_call(start) \n\t"
55 "@ l4_cache_op_arm_call(end) \n\t"
61 [sc] "i" (L4_SYSCALL_MEM_OP),
72 L4_MEM_CACHE_OP_CLEAN_DATA = 0,
73 L4_MEM_CACHE_OP_FLUSH_DATA = 1,
74 L4_MEM_CACHE_OP_INV_DATA = 2,
75 L4_MEM_CACHE_OP_COHERENT = 3,
76 L4_MEM_CACHE_OP_DMA_COHERENT = 4,
77 L4_MEM_CACHE_OP_DMA_COHERENT_FULL = 5,
78 L4_MEM_CACHE_OP_L2_CLEAN = 6,
79 L4_MEM_CACHE_OP_L2_FLUSH = 7,
80 L4_MEM_CACHE_OP_L2_INV = 8,
84 l4_cache_clean_data(unsigned long start,
85 unsigned long end) L4_NOTHROW
87 l4_cache_op_arm_call(L4_MEM_CACHE_OP_CLEAN_DATA, start, end);
91 l4_cache_flush_data(unsigned long start,
92 unsigned long end) L4_NOTHROW
94 l4_cache_op_arm_call(L4_MEM_CACHE_OP_FLUSH_DATA, start, end);
98 l4_cache_inv_data(unsigned long start,
99 unsigned long end) L4_NOTHROW
101 l4_cache_op_arm_call(L4_MEM_CACHE_OP_INV_DATA, start, end);
105 l4_cache_coherent(unsigned long start,
106 unsigned long end) L4_NOTHROW
108 l4_cache_op_arm_call(L4_MEM_CACHE_OP_COHERENT, start, end);
112 l4_cache_dma_coherent(unsigned long start,
113 unsigned long end) L4_NOTHROW
115 l4_cache_op_arm_call(L4_MEM_CACHE_OP_DMA_COHERENT, start, end);
119 l4_cache_dma_coherent_full(void) L4_NOTHROW
121 l4_cache_op_arm_call(L4_MEM_CACHE_OP_DMA_COHERENT_FULL, 0, 0);
125 l4_cache_l2_clean(unsigned long start,
126 unsigned long end) L4_NOTHROW
128 l4_cache_op_arm_call(L4_MEM_CACHE_OP_L2_CLEAN, start, end);
132 l4_cache_l2_flush(unsigned long start,
133 unsigned long end) L4_NOTHROW
135 l4_cache_op_arm_call(L4_MEM_CACHE_OP_L2_FLUSH, start, end);
139 l4_cache_l2_inv(unsigned long start,
140 unsigned long end) L4_NOTHROW
142 l4_cache_op_arm_call(L4_MEM_CACHE_OP_L2_INV, start, end);
145 #endif /* ! __L4SYS__INCLUDE__ARCH_ARM__CACHE_H__ */