]> granicus.if.org Git - strace/blob - cacheflush.c
build: fix -I options
[strace] / cacheflush.c
1 #include "defs.h"
2
3 #ifdef HAVE_ASM_CACHECTL_H
4 # include <asm/cachectl.h>
5 #endif
6
7 #ifdef M68K
8 # include "xlat/cacheflush_scope.h"
9
10 static const struct xlat cacheflush_flags[] = {
11 #ifdef FLUSH_CACHE_BOTH
12         XLAT(FLUSH_CACHE_BOTH),
13 #endif
14 #ifdef FLUSH_CACHE_DATA
15         XLAT(FLUSH_CACHE_DATA),
16 #endif
17 #ifdef FLUSH_CACHE_INSN
18         XLAT(FLUSH_CACHE_INSN),
19 #endif
20         XLAT_END
21 };
22
23 SYS_FUNC(cacheflush)
24 {
25         /* addr */
26         printaddr(tcp->u_arg[0]);
27         tprints(", ");
28         /* scope */
29         printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
30         tprints(", ");
31         /* flags */
32         printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???");
33         /* len */
34         tprintf(", %lu", tcp->u_arg[3]);
35
36         return RVAL_DECODED;
37 }
38 #endif /* M68K */
39
40 #ifdef BFIN
41 static const struct xlat cacheflush_flags[] = {
42         XLAT(ICACHE),
43         XLAT(DCACHE),
44         XLAT(BCACHE),
45         XLAT_END
46 };
47
48 SYS_FUNC(cacheflush)
49 {
50         /* start addr */
51         printaddr(tcp->u_arg[0]);
52         /* length */
53         tprintf(", %ld, ", tcp->u_arg[1]);
54         /* flags */
55         printxval(cacheflush_flags, tcp->u_arg[1], "?CACHE");
56
57         return RVAL_DECODED;
58 }
59 #endif /* BFIN */
60
61 #ifdef SH
62 static const struct xlat cacheflush_flags[] = {
63 #ifdef CACHEFLUSH_D_INVAL
64         XLAT(CACHEFLUSH_D_INVAL),
65 #endif
66 #ifdef CACHEFLUSH_D_WB
67         XLAT(CACHEFLUSH_D_WB),
68 #endif
69 #ifdef CACHEFLUSH_D_PURGE
70         XLAT(CACHEFLUSH_D_PURGE),
71 #endif
72 #ifdef CACHEFLUSH_I
73         XLAT(CACHEFLUSH_I),
74 #endif
75         XLAT_END
76 };
77
78 SYS_FUNC(cacheflush)
79 {
80         /* addr */
81         printaddr(tcp->u_arg[0]);
82         /* len */
83         tprintf(", %lu, ", tcp->u_arg[1]);
84         /* flags */
85         printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???");
86
87         return RVAL_DECODED;
88 }
89 #endif /* SH */
90
91 #ifdef NIOS2
92 SYS_FUNC(cacheflush)
93 {
94         /* addr */
95         printaddr(tcp->u_arg[0]);
96         /* len */
97         tprintf(", %lu, ", tcp->u_arg[3]);
98         /* scope and flags (cache type) are currently ignored */
99
100         return RVAL_DECODED;
101 }
102 #endif /* NIOS2 */