Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 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 | int |
| 24 | sys_cacheflush(struct tcb *tcp) |
| 25 | { |
| 26 | if (entering(tcp)) { |
| 27 | /* addr */ |
| 28 | tprintf("%#lx, ", tcp->u_arg[0]); |
| 29 | /* scope */ |
| 30 | printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???"); |
| 31 | tprints(", "); |
| 32 | /* flags */ |
| 33 | printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???"); |
| 34 | /* len */ |
| 35 | tprintf(", %lu", tcp->u_arg[3]); |
| 36 | } |
| 37 | return 0; |
| 38 | } |
| 39 | #endif /* M68K */ |
| 40 | |
| 41 | #ifdef BFIN |
| 42 | static const struct xlat cacheflush_flags[] = { |
| 43 | XLAT(ICACHE), |
| 44 | XLAT(DCACHE), |
| 45 | XLAT(BCACHE), |
| 46 | XLAT_END |
| 47 | }; |
| 48 | |
| 49 | int |
| 50 | sys_cacheflush(struct tcb *tcp) |
| 51 | { |
| 52 | if (entering(tcp)) { |
| 53 | /* start addr */ |
| 54 | tprintf("%#lx, ", tcp->u_arg[0]); |
| 55 | /* length */ |
| 56 | tprintf("%ld, ", tcp->u_arg[1]); |
| 57 | /* flags */ |
| 58 | printxval(cacheflush_flags, tcp->u_arg[1], "?CACHE"); |
| 59 | } |
| 60 | return 0; |
| 61 | } |
| 62 | #endif /* BFIN */ |
| 63 | |
| 64 | #ifdef SH |
| 65 | static const struct xlat cacheflush_flags[] = { |
| 66 | #ifdef CACHEFLUSH_D_INVAL |
| 67 | XLAT(CACHEFLUSH_D_INVAL), |
| 68 | #endif |
| 69 | #ifdef CACHEFLUSH_D_WB |
| 70 | XLAT(CACHEFLUSH_D_WB), |
| 71 | #endif |
| 72 | #ifdef CACHEFLUSH_D_PURGE |
| 73 | XLAT(CACHEFLUSH_D_PURGE), |
| 74 | #endif |
| 75 | #ifdef CACHEFLUSH_I |
| 76 | XLAT(CACHEFLUSH_I), |
| 77 | #endif |
| 78 | XLAT_END |
| 79 | }; |
| 80 | |
| 81 | int |
| 82 | sys_cacheflush(struct tcb *tcp) |
| 83 | { |
| 84 | if (entering(tcp)) { |
| 85 | /* addr */ |
| 86 | tprintf("%#lx, ", tcp->u_arg[0]); |
| 87 | /* len */ |
| 88 | tprintf("%lu, ", tcp->u_arg[1]); |
| 89 | /* flags */ |
| 90 | printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???"); |
| 91 | } |
| 92 | return 0; |
| 93 | } |
| 94 | #endif /* SH */ |