]> granicus.if.org Git - strace/blob - cacheflush.c
evdev: decode struct input_absinfo regardless of in-kernel definitions
[strace] / cacheflush.c
1 /*
2  * Copyright (c) 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
3  * Copyright (c) 2010 Mike Frysinger <vapier@gentoo.org>
4  * Copyright (c) 2010 Carmelo Amoroso <carmelo.amoroso@st.com>
5  * Copyright (c) 2015 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
6  * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
7  * Copyright (c) 2014-2019 The strace developers.
8  * All rights reserved.
9  *
10  * SPDX-License-Identifier: LGPL-2.1-or-later
11  */
12
13 #include "defs.h"
14
15 #ifdef HAVE_ASM_CACHECTL_H
16 # include <asm/cachectl.h>
17 #endif
18
19 #ifdef M68K
20 # include "xlat/cacheflush_scope.h"
21
22 static const struct xlat cacheflush_flags[] = {
23 # ifdef FLUSH_CACHE_BOTH
24         XLAT(FLUSH_CACHE_BOTH),
25 # endif
26 # ifdef FLUSH_CACHE_DATA
27         XLAT(FLUSH_CACHE_DATA),
28 # endif
29 # ifdef FLUSH_CACHE_INSN
30         XLAT(FLUSH_CACHE_INSN),
31 # endif
32         XLAT_END
33 };
34
35 SYS_FUNC(cacheflush)
36 {
37         /* addr */
38         printaddr(tcp->u_arg[0]);
39         tprints(", ");
40         /* scope */
41         printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
42         tprints(", ");
43         /* flags */
44         printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???");
45         /* len */
46         tprintf(", %lu", tcp->u_arg[3]);
47
48         return RVAL_DECODED;
49 }
50 #endif /* M68K */
51
52 #if defined(BFIN) || defined(CSKY)
53 static const struct xlat cacheflush_flags[] = {
54         XLAT(ICACHE),
55         XLAT(DCACHE),
56         XLAT(BCACHE),
57         XLAT_END
58 };
59
60 SYS_FUNC(cacheflush)
61 {
62         /* start addr */
63         printaddr(tcp->u_arg[0]);
64         /* length */
65         tprintf(", %lu, ", tcp->u_arg[1]);
66         /* flags */
67         printxval(cacheflush_flags, tcp->u_arg[2], "?CACHE");
68
69         return RVAL_DECODED;
70 }
71 #endif /* BFIN || CSKY */
72
73 #ifdef SH
74 static const struct xlat cacheflush_flags[] = {
75 # ifdef CACHEFLUSH_D_INVAL
76         XLAT(CACHEFLUSH_D_INVAL),
77 # endif
78 # ifdef CACHEFLUSH_D_WB
79         XLAT(CACHEFLUSH_D_WB),
80 # endif
81 # ifdef CACHEFLUSH_D_PURGE
82         XLAT(CACHEFLUSH_D_PURGE),
83 # endif
84 # ifdef CACHEFLUSH_I
85         XLAT(CACHEFLUSH_I),
86 # endif
87         XLAT_END
88 };
89
90 SYS_FUNC(cacheflush)
91 {
92         /* addr */
93         printaddr(tcp->u_arg[0]);
94         /* len */
95         tprintf(", %lu, ", tcp->u_arg[1]);
96         /* flags */
97         printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???");
98
99         return RVAL_DECODED;
100 }
101 #endif /* SH */
102
103 #ifdef NIOS2
104 SYS_FUNC(cacheflush)
105 {
106         /* addr */
107         printaddr(tcp->u_arg[0]);
108         /* len */
109         tprintf(", %lu, ", tcp->u_arg[3]);
110         /* scope and flags (cache type) are currently ignored */
111
112         return RVAL_DECODED;
113 }
114 #endif /* NIOS2 */