]> granicus.if.org Git - strace/blob - cacheflush.c
Use printnum_int64 instead of print_loff_t
[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         if (entering(tcp)) {
26                 /* addr */
27                 tprintf("%#lx, ", tcp->u_arg[0]);
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 0;
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         if (entering(tcp)) {
51                 /* start addr */
52                 tprintf("%#lx, ", tcp->u_arg[0]);
53                 /* length */
54                 tprintf("%ld, ", tcp->u_arg[1]);
55                 /* flags */
56                 printxval(cacheflush_flags, tcp->u_arg[1], "?CACHE");
57         }
58         return 0;
59 }
60 #endif /* BFIN */
61
62 #ifdef SH
63 static const struct xlat cacheflush_flags[] = {
64 #ifdef CACHEFLUSH_D_INVAL
65         XLAT(CACHEFLUSH_D_INVAL),
66 #endif
67 #ifdef CACHEFLUSH_D_WB
68         XLAT(CACHEFLUSH_D_WB),
69 #endif
70 #ifdef CACHEFLUSH_D_PURGE
71         XLAT(CACHEFLUSH_D_PURGE),
72 #endif
73 #ifdef CACHEFLUSH_I
74         XLAT(CACHEFLUSH_I),
75 #endif
76         XLAT_END
77 };
78
79 SYS_FUNC(cacheflush)
80 {
81         if (entering(tcp)) {
82                 /* addr */
83                 tprintf("%#lx, ", tcp->u_arg[0]);
84                 /* len */
85                 tprintf("%lu, ", tcp->u_arg[1]);
86                 /* flags */
87                 printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???");
88         }
89         return 0;
90 }
91 #endif /* SH */
92
93 #ifdef NIOS2
94 SYS_FUNC(cacheflush)
95 {
96         if (entering(tcp)) {
97                 /* addr and len */
98                 tprintf("%#lx, %lu", tcp->u_arg[0], tcp->u_arg[3]);
99                 /* scope and flags (cache type) are currently ignored */
100         }
101         return 0;
102 }
103 #endif /* NIOS2 */