2 * wARM - exporting ARM processor specific privileged services to userspace
5 * Copyright (c) GraÅžvydas "notaz" Ignotas, 2009
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * Neither the name of the organization nor the
15 * names of its contributors may be used to endorse or promote products
16 * derived from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 /* cache operations (warm_cache_op_*):
33 * o clean - write dirty data to memory, but also leave in cache.
34 * o invalidate - throw away everything in cache, losing dirty data.
36 * Write buffer is always drained, no ops will only drain WB
38 #define WOP_D_CLEAN (1 << 0)
39 #define WOP_D_INVALIDATE (1 << 1)
40 #define WOP_I_INVALIDATE (1 << 2)
42 /* change C and B bits (warm_change_cb_*)
43 * if is_set in not zero, bits are set, else cleared.
44 * the address for range function is virtual address.
46 #define WCB_C_BIT (1 << 0)
47 #define WCB_B_BIT (1 << 1)
58 int warm_cache_op_range(int ops, void *virt_addr, unsigned long size);
59 int warm_cache_op_all(int ops);
61 int warm_change_cb_upper(int cb, int is_set);
62 int warm_change_cb_range(int cb, int is_set, void *virt_addr, unsigned long size);
64 unsigned long warm_virt2phys(const void *ptr);
66 void warm_finish(void);
75 #include <linux/ioctl.h>
77 #define WARM_IOCTL_BASE 'A'
94 #define WARMC_CACHE_OP _IOW(WARM_IOCTL_BASE, 0, struct warm_cache_op)
95 #define WARMC_CHANGE_CB _IOW(WARM_IOCTL_BASE, 1, struct warm_change_cb)
96 #define WARMC_VIRT2PHYS _IOWR(WARM_IOCTL_BASE, 2, unsigned long)
98 #endif /* WARM_CODE */
99 #endif /* !__ASSEMBLER__ */
100 #endif /* __WARM_H__ */