summaryrefslogtreecommitdiff
path: root/sysdeps/linux-gnu/mksyscallent_mips
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-08-22 20:34:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:34:56 +0900
commit517f5529d7008eba87b8b2fee5ec9ec0a5075f6e (patch)
treec71720a9b41309713c089478f921165bd2d63b25 /sysdeps/linux-gnu/mksyscallent_mips
parent689b9dbb8d7f88ab91e7741932ed000b6e49be9a (diff)
downloadltrace-517f5529d7008eba87b8b2fee5ec9ec0a5075f6e.tar.gz
ltrace-517f5529d7008eba87b8b2fee5ec9ec0a5075f6e.tar.bz2
ltrace-517f5529d7008eba87b8b2fee5ec9ec0a5075f6e.zip
Imported Upstream version 0.7.91upstream/0.7.91upstream
Diffstat (limited to 'sysdeps/linux-gnu/mksyscallent_mips')
-rwxr-xr-xsysdeps/linux-gnu/mksyscallent_mips60
1 files changed, 60 insertions, 0 deletions
diff --git a/sysdeps/linux-gnu/mksyscallent_mips b/sysdeps/linux-gnu/mksyscallent_mips
new file mode 100755
index 0000000..f3961b4
--- /dev/null
+++ b/sysdeps/linux-gnu/mksyscallent_mips
@@ -0,0 +1,60 @@
+#!/usr/bin/awk -f
+# This file is part of ltrace.
+# Copyright (C) 2010 Arnaud Patard, Mandriva SA
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA
+
+# hack expression to generate arch/syscallent.h from <asm/unistd.h>
+# It reads from stdin and writes to stdout
+# It should work OK on i386,m68k,arm,ia64
+# It does NOT work in mips, s390
+# It is untested in other architectures
+
+BEGIN {
+ max=0;
+ FS="[ \t\n()+]+";
+}
+
+{
+ #debug
+ #printf("/%s/%s/%s/%s/\n", $1, $2, $3, $4);
+ if ($2 ~ /__NR_Linux/ && $3 ~ /4000/) {
+ syscall=1;
+ }
+ if ($2 ~ /__NR_Linux_syscalls/) {
+ syscall=0;
+ }
+ if (syscall && ($1 ~ /^#define$/) && ($2 ~ /^__NR_/)) {
+ SYSCALL[$4]=substr($2,6);
+ if ($4 > max) {
+ max=$4;
+ }
+ }
+}
+
+END {
+ for(i=0; i<=max; i++) {
+ if (!SYSCALL[i]) {
+ SYSCALL[i] = i;
+ }
+ pad = 32 - length(SYSCALL[i]);
+ if (pad<1) {
+ pad=1;
+ }
+ printf("\t\"%s\",%*s/* %d */\n", SYSCALL[i], pad, "", i);
+ }
+}
+