aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-04-18 22:43:06 -0400
committerMike Frysinger <vapier@gentoo.org>2021-04-18 23:03:08 -0400
commitb7c5246bbfad67b60a820db5e548e665171645ec (patch)
tree3e3bf2509358ee5cdf3f8c89f6ded780c375ebe9 /sim/common
parentb3d4da0f120444d98d76bb56646af682d64907dd (diff)
downloadgdb-b7c5246bbfad67b60a820db5e548e665171645ec.zip
gdb-b7c5246bbfad67b60a820db5e548e665171645ec.tar.gz
gdb-b7c5246bbfad67b60a820db5e548e665171645ec.tar.bz2
sim: sh: switch syscalls to common nltvals
Rather than hand duplicate the syscall table, switch to the common nltvals framework. We have to tweak the constant names, but we get everything else for free. I made sure the constants have the same values before & after too :).
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog5
-rwxr-xr-xsim/common/gennltvals.py2
-rw-r--r--sim/common/nltvals.def38
3 files changed, 45 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index f0827b2..20a4257 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,10 @@
2021-04-18 Mike Frysinger <vapier@gentoo.org>
+ * gennltvals.py (TARGET_DIRS, TARGETS): Add sh.
+ * nltvals.def: Regenerate.
+
+2021-04-18 Mike Frysinger <vapier@gentoo.org>
+
* gennltvals.py (TARGETS): Add rx.
* nltvals.def: Regenerate.
diff --git a/sim/common/gennltvals.py b/sim/common/gennltvals.py
index bf0aaa4..5831607 100755
--- a/sim/common/gennltvals.py
+++ b/sim/common/gennltvals.py
@@ -51,6 +51,7 @@ TARGET_DIRS = {
'i960': 'libgloss/i960',
'mcore': 'libgloss/mcore',
'riscv': 'libgloss/riscv/machine',
+ 'sh': 'newlib/libc/sys/sh/sys',
'v850': 'libgloss/v850/sys',
}
TARGETS = {
@@ -71,6 +72,7 @@ TARGETS = {
'pru',
'riscv',
'rx',
+ 'sh',
'sparc',
'v850',
}
diff --git a/sim/common/nltvals.def b/sim/common/nltvals.def
index fbaee3a..3b890af 100644
--- a/sim/common/nltvals.def
+++ b/sim/common/nltvals.def
@@ -688,6 +688,44 @@
/* end rx sys target macros */
#endif
#endif
+#ifdef NL_TARGET_sh
+#ifdef sys_defs
+/* from syscall.h */
+/* begin sh sys target macros */
+ { "SYS_ARG", 24 },
+ { "SYS_argc", 172 },
+ { "SYS_argn", 174 },
+ { "SYS_argnlen", 173 },
+ { "SYS_chdir", 12 },
+ { "SYS_chmod", 15 },
+ { "SYS_chown", 16 },
+ { "SYS_close", 6 },
+ { "SYS_creat", 8 },
+ { "SYS_execv", 11 },
+ { "SYS_execve", 59 },
+ { "SYS_exit", 1 },
+ { "SYS_fork", 2 },
+ { "SYS_fstat", 22 },
+ { "SYS_ftruncate", 130 },
+ { "SYS_getpid", 20 },
+ { "SYS_isatty", 21 },
+ { "SYS_link", 9 },
+ { "SYS_lseek", 19 },
+ { "SYS_mknod", 14 },
+ { "SYS_open", 5 },
+ { "SYS_pipe", 42 },
+ { "SYS_read", 3 },
+ { "SYS_stat", 38 },
+ { "SYS_time", 23 },
+ { "SYS_truncate", 129 },
+ { "SYS_unlink", 10 },
+ { "SYS_utime", 201 },
+ { "SYS_wait", 202 },
+ { "SYS_wait4", 7 },
+ { "SYS_write", 4 },
+/* end sh sys target macros */
+#endif
+#endif
#ifdef NL_TARGET_sparc
#ifdef sys_defs
/* from syscall.h */