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@strace.io>
7 * Copyright (c) 2014-2021 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 # include "xlat/cacheflush_flags.h"
22
23 SYS_FUNC(cacheflush)
24 {
25 /* addr */
26 printaddr(tcp->u_arg[0]);
27 tprint_arg_next();
28
29 /* scope */
30 printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
31 tprint_arg_next();
32
33 /* flags */
34 printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???");
35 tprint_arg_next();
36
37 /* len */
38 PRINT_VAL_U(tcp->u_arg[3]);
39
40 return RVAL_DECODED;
41 }
42 #endif /* M68K */
43
44 #if defined(BFIN) || defined(CSKY)
45 # include "xlat/cacheflush_flags.h"
46
47 SYS_FUNC(cacheflush)
48 {
49 /* start addr */
50 printaddr(tcp->u_arg[0]);
51 tprint_arg_next();
52
53 /* length */
54 PRINT_VAL_U(tcp->u_arg[1]);
55 tprint_arg_next();
56
57 /* flags */
58 printxval(cacheflush_flags, tcp->u_arg[2], "?CACHE");
59
60 return RVAL_DECODED;
61 }
62 #endif /* BFIN || CSKY */
63
64 #ifdef SH
65 # include "xlat/cacheflush_flags.h"
66
67 SYS_FUNC(cacheflush)
68 {
69 /* addr */
70 printaddr(tcp->u_arg[0]);
71 tprint_arg_next();
72
73 /* len */
74 PRINT_VAL_U(tcp->u_arg[1]);
75 tprint_arg_next();
76
77 /* flags */
78 printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???");
79
80 return RVAL_DECODED;
81 }
82 #endif /* SH */
83
84 #ifdef NIOS2
85 SYS_FUNC(cacheflush)
86 {
87 /* addr */
88 printaddr(tcp->u_arg[0]);
89 tprint_arg_next();
90
91 /* len */
92 PRINT_VAL_U(tcp->u_arg[3]);
93
94 /* scope and flags (cache type) are currently ignored */
95
96 return RVAL_DECODED;
97 }
98 #endif /* NIOS2 */