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 | { |
| 25 | if (entering(tcp)) { |
| 26 | /* addr */ |
Dmitry V. Levin | bb16ee1 | 2015-07-20 17:57:37 +0000 | [diff] [blame^] | 27 | printaddr(tcp->u_arg[0]); |
| 28 | tprints(", "); |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 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 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 49 | SYS_FUNC(cacheflush) |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 50 | { |
| 51 | if (entering(tcp)) { |
| 52 | /* start addr */ |
Dmitry V. Levin | bb16ee1 | 2015-07-20 17:57:37 +0000 | [diff] [blame^] | 53 | printaddr(tcp->u_arg[0]); |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 54 | /* length */ |
Dmitry V. Levin | bb16ee1 | 2015-07-20 17:57:37 +0000 | [diff] [blame^] | 55 | tprintf(", %ld, ", tcp->u_arg[1]); |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 56 | /* flags */ |
| 57 | printxval(cacheflush_flags, tcp->u_arg[1], "?CACHE"); |
| 58 | } |
| 59 | return 0; |
| 60 | } |
| 61 | #endif /* BFIN */ |
| 62 | |
| 63 | #ifdef SH |
| 64 | static const struct xlat cacheflush_flags[] = { |
| 65 | #ifdef CACHEFLUSH_D_INVAL |
| 66 | XLAT(CACHEFLUSH_D_INVAL), |
| 67 | #endif |
| 68 | #ifdef CACHEFLUSH_D_WB |
| 69 | XLAT(CACHEFLUSH_D_WB), |
| 70 | #endif |
| 71 | #ifdef CACHEFLUSH_D_PURGE |
| 72 | XLAT(CACHEFLUSH_D_PURGE), |
| 73 | #endif |
| 74 | #ifdef CACHEFLUSH_I |
| 75 | XLAT(CACHEFLUSH_I), |
| 76 | #endif |
| 77 | XLAT_END |
| 78 | }; |
| 79 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 80 | SYS_FUNC(cacheflush) |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 81 | { |
| 82 | if (entering(tcp)) { |
| 83 | /* addr */ |
Dmitry V. Levin | bb16ee1 | 2015-07-20 17:57:37 +0000 | [diff] [blame^] | 84 | printaddr(tcp->u_arg[0]); |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 85 | /* len */ |
Dmitry V. Levin | bb16ee1 | 2015-07-20 17:57:37 +0000 | [diff] [blame^] | 86 | tprintf(", %lu, ", tcp->u_arg[1]); |
Dmitry V. Levin | 95edb8b | 2014-12-03 20:50:08 +0000 | [diff] [blame] | 87 | /* flags */ |
| 88 | printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???"); |
| 89 | } |
| 90 | return 0; |
| 91 | } |
| 92 | #endif /* SH */ |
Ezequiel Garcia | bd8dd77 | 2015-04-18 17:33:27 -0300 | [diff] [blame] | 93 | |
| 94 | #ifdef NIOS2 |
| 95 | SYS_FUNC(cacheflush) |
| 96 | { |
| 97 | if (entering(tcp)) { |
Dmitry V. Levin | bb16ee1 | 2015-07-20 17:57:37 +0000 | [diff] [blame^] | 98 | /* addr */ |
| 99 | printaddr(tcp->u_arg[0]); |
| 100 | /* len */ |
| 101 | tprintf(", %lu, ", tcp->u_arg[3]); |
Ezequiel Garcia | bd8dd77 | 2015-04-18 17:33:27 -0300 | [diff] [blame] | 102 | /* scope and flags (cache type) are currently ignored */ |
| 103 | } |
| 104 | return 0; |
| 105 | } |
| 106 | #endif /* NIOS2 */ |