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 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 23 | SYS_FUNC(cacheflush) |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 24 | { |
Dmitry V. Levin | 4b6fc98 | 2015-07-20 18:05:21 +0000 | [diff] [blame] | 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; |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 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 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 48 | SYS_FUNC(cacheflush) |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 49 | { |
Dmitry V. Levin | 4b6fc98 | 2015-07-20 18:05:21 +0000 | [diff] [blame] | 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; |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 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 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 78 | SYS_FUNC(cacheflush) |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 79 | { |
Dmitry V. Levin | 4b6fc98 | 2015-07-20 18:05:21 +0000 | [diff] [blame] | 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; |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 88 | } |
| 89 | #endif /* SH */ |
Ezequiel Garcia | bd8dd77 | 2015-04-18 17:33:27 -0300 | [diff] [blame] | 90 | |
| 91 | #ifdef NIOS2 |
| 92 | SYS_FUNC(cacheflush) |
| 93 | { |
Dmitry V. Levin | 4b6fc98 | 2015-07-20 18:05:21 +0000 | [diff] [blame] | 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; |
Ezequiel Garcia | bd8dd77 | 2015-04-18 17:33:27 -0300 | [diff] [blame] | 101 | } |
| 102 | #endif /* NIOS2 */ |