]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4sys/include/cache.h
update
[l4.git] / l4 / pkg / l4sys / include / cache.h
1 /**
2  * \file
3  * \brief  Cache-consistency functions.
4  *
5  * \date   2007-11
6  * \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
7  *
8  * \ingroup l4_api
9  *
10  */
11 /*
12  * (c) 2007-2009 Author(s)
13  *     economic rights: Technische Universität Dresden (Germany)
14  *
15  * This file is part of TUD:OS and distributed under the terms of the
16  * GNU General Public License 2.
17  * Please see the COPYING-GPL-2 file for details.
18  *
19  * As a special exception, you may use this file as part of a free software
20  * library without restriction.  Specifically, if other files instantiate
21  * templates or use macros or inline functions from this file, or you compile
22  * this file and link it with other files to produce an executable, this
23  * file does not by itself cause the resulting executable to be covered by
24  * the GNU General Public License.  This exception does not however
25  * invalidate any other reasons why the executable file might be covered by
26  * the GNU General Public License.
27  */
28
29 #ifndef __L4SYS__INCLUDE__CACHE_H__
30 #define __L4SYS__INCLUDE__CACHE_H__
31
32 #include <l4/sys/compiler.h>
33
34 /**
35  * \defgroup l4_cache_api Cache Consistency
36  * \ingroup l4_api
37  * \brief Various functions for cache consistency.
38  *
39  * <c>\#include <l4/sys/cache.h></c>
40  */
41
42 EXTERN_C_BEGIN
43
44 /**
45  * \brief Cache clean a range in D-cache.
46  * \ingroup l4_cache_api
47  * \param start  Start of range (inclusive)
48  * \param end    End of range (exclusive)
49  */
50 L4_INLINE void
51 l4_cache_clean_data(unsigned long start,
52                     unsigned long end) L4_NOTHROW;
53
54 /**
55  * \brief Cache flush a range.
56  * \ingroup l4_cache_api
57  * \param start  Start of range (inclusive)
58  * \param end    End of range (exclusive)
59  */
60 L4_INLINE void
61 l4_cache_flush_data(unsigned long start,
62                     unsigned long end) L4_NOTHROW;
63
64 /**
65  * \brief Cache invalidate a range.
66  * \ingroup l4_cache_api
67  * \param start  Start of range (inclusive)
68  * \param end    End of range (exclusive)
69  */
70 L4_INLINE void
71 l4_cache_inv_data(unsigned long start,
72                   unsigned long end) L4_NOTHROW;
73
74 /**
75  * \brief Make memory coherent between I-cache and D-cache.
76  * \ingroup l4_cache_api
77  * \param start  Start of range (inclusive)
78  * \param end    End of range (exclusive)
79  */
80 L4_INLINE void
81 l4_cache_coherent(unsigned long start,
82                   unsigned long end) L4_NOTHROW;
83
84 /**
85  * \brief Make memory coherent for use with external memory.
86  * \ingroup l4_cache_api
87  * \param start  Start of range (inclusive)
88  * \param end    End of range (exclusive)
89  */
90 L4_INLINE void
91 l4_cache_dma_coherent(unsigned long start,
92                       unsigned long end) L4_NOTHROW;
93
94 /**
95  * \brief Make memory coherent for use with external memory.
96  * \ingroup l4_cache_api
97  */
98 L4_INLINE void
99 l4_cache_dma_coherent_full(void) L4_NOTHROW;
100
101 EXTERN_C_END
102
103 #endif /* ! __L4SYS__INCLUDE__CACHE_H__ */