]> granicus.if.org Git - strace/commitdiff
sh: Add support for tracing sys_cacheflush system call
authorCarmelo AMOROSO <carmelo.amoroso@st.com>
Wed, 1 Dec 2010 13:27:07 +0000 (14:27 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 3 Dec 2010 17:27:29 +0000 (17:27 +0000)
* linux/sh/syscallent.h: Update sys_cacheflush entry.
* linux/syscall.h [SH] (sys_cacheflush): New function declaration.
* system.c [SH] (cacheflush_flags): New xlat structure.
[SH] (sys_cacheflush): New function.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Reviewed-by: Angelo Castello <angelo.castello@st.com>
linux/sh/syscallent.h
linux/syscall.h
system.c

index 2291131a1229e486835f17283da2dc36f36b1561..f3b59db6a641d33e765b011eea38244ef868369e 100644 (file)
        { 5,    TP,     sys_clone,              "clone"         }, /* 120 */
        { 2,    0,      sys_setdomainname,      "setdomainname" }, /* 121 */
        { 1,    0,      sys_uname,              "uname"         }, /* 122 */
-       { 3,    0,      printargs,              "cacheflush"    }, /* 123 */
+       { 3,    0,      sys_cacheflush,         "cacheflush"    }, /* 123 */
        { 1,    0,      sys_adjtimex,           "adjtimex"      }, /* 124 */
        { 3,    0,      sys_mprotect,           "mprotect"      }, /* 125 */
        { 3,    TS,     sys_sigprocmask,        "sigprocmask"   }, /* 126 */
index 679697fb45406125023070798fec113baded5632..e7348ff45a73b048f9570878dcb7e1f5457b12d1 100644 (file)
@@ -322,7 +322,7 @@ int sys_sysmips();
 int sys_setpgrp(), sys_gethostname(), sys_getdtablesize(), sys_utimes();
 int sys_capget(), sys_capset();
 
-#ifdef M68K
+#if defined M68K || defined SH
 int sys_cacheflush();
 #endif
 
index e16a6be4a1b8315c5d072fe773f9567bddee7196..f0641c30236b903595ce487da815d287e4f6a503 100644 (file)
--- a/system.c
+++ b/system.c
@@ -343,6 +343,38 @@ sys_cacheflush(struct tcb *tcp)
 
 #endif
 
+#ifdef SH
+static const struct xlat cacheflush_flags[] = {
+#ifdef CACHEFLUSH_D_INVAL
+       { CACHEFLUSH_D_INVAL,   "CACHEFLUSH_D_INVAL" },
+#endif
+#ifdef CACHEFLUSH_D_WB
+       { CACHEFLUSH_D_WB,      "CACHEFLUSH_D_WB" },
+#endif
+#ifdef CACHEFLUSH_D_PURGE
+       { CACHEFLUSH_D_PURGE,   "CACHEFLUSH_D_PURGE" },
+#endif
+#ifdef CACHEFLUSH_I
+       { CACHEFLUSH_I,         "CACHEFLUSH_I" },
+#endif
+       { 0,                    NULL },
+};
+
+int
+sys_cacheflush(struct tcb *tcp)
+{
+       if (entering(tcp)) {
+               /* addr */
+               tprintf("%#lx, ", tcp->u_arg[0]);
+               /* len */
+               tprintf("%lu, ", tcp->u_arg[1]);
+               /* flags */
+               printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???");
+       }
+       return 0;
+}
+#endif /* SH */
+
 #endif /* LINUX */
 
 #ifdef SUNOS4