blob: e4b704c85f68a15e325325eca078847375281be6 [file] [log] [blame]
Dmitry V. Levin95edb8b2014-12-03 20:50:08 +00001#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
10static 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
Dmitry V. Levina0bd3742015-04-07 01:36:50 +000023SYS_FUNC(cacheflush)
Dmitry V. Levin95edb8b2014-12-03 20:50:08 +000024{
Dmitry V. Levin4b6fc982015-07-20 18:05:21 +000025 /* 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;
Dmitry V. Levin95edb8b2014-12-03 20:50:08 +000037}
38#endif /* M68K */
39
40#ifdef BFIN
41static const struct xlat cacheflush_flags[] = {
42 XLAT(ICACHE),
43 XLAT(DCACHE),
44 XLAT(BCACHE),
45 XLAT_END
46};
47
Dmitry V. Levina0bd3742015-04-07 01:36:50 +000048SYS_FUNC(cacheflush)
Dmitry V. Levin95edb8b2014-12-03 20:50:08 +000049{
Dmitry V. Levin4b6fc982015-07-20 18:05:21 +000050 /* 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;
Dmitry V. Levin95edb8b2014-12-03 20:50:08 +000058}
59#endif /* BFIN */
60
61#ifdef SH
62static 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
Dmitry V. Levina0bd3742015-04-07 01:36:50 +000078SYS_FUNC(cacheflush)
Dmitry V. Levin95edb8b2014-12-03 20:50:08 +000079{
Dmitry V. Levin4b6fc982015-07-20 18:05:21 +000080 /* 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;
Dmitry V. Levin95edb8b2014-12-03 20:50:08 +000088}
89#endif /* SH */
Ezequiel Garciabd8dd772015-04-18 17:33:27 -030090
91#ifdef NIOS2
92SYS_FUNC(cacheflush)
93{
Dmitry V. Levin4b6fc982015-07-20 18:05:21 +000094 /* 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;
Ezequiel Garciabd8dd772015-04-18 17:33:27 -0300101}
102#endif /* NIOS2 */