diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-04-18 22:31:19 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-04-18 23:01:08 -0400 |
commit | f956ecde56495cbcd5f8a3b440220090ee39ff56 (patch) | |
tree | ae897b81fbdce2334a3ee8109a171ce9c6fa048d /sim/m32c/syscalls.c | |
parent | 2390d779430a64350be827929a0ebf73155f4fd7 (diff) | |
download | gdb-f956ecde56495cbcd5f8a3b440220090ee39ff56.zip gdb-f956ecde56495cbcd5f8a3b440220090ee39ff56.tar.gz gdb-f956ecde56495cbcd5f8a3b440220090ee39ff56.tar.bz2 |
sim: m32c: 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/m32c/syscalls.c')
-rw-r--r-- | sim/m32c/syscalls.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sim/m32c/syscalls.c b/sim/m32c/syscalls.c index a033dba..86695cb 100644 --- a/sim/m32c/syscalls.c +++ b/sim/m32c/syscalls.c @@ -30,8 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "cpu.h" #include "mem.h" #include "syscalls.h" - -#include "syscall.h" +#include "targ-vals.h" /* The current syscall callbacks we're using. */ static struct host_callback_struct *callbacks; @@ -184,7 +183,7 @@ m32c_syscall (int id) printf ("\033[31m/* SYSCALL(%d) = %s */\033[0m\n", id, callnames[id]); switch (id) { - case SYS_exit: + case TARGET_SYS_exit: { int ec = arg (2); if (verbose) @@ -193,7 +192,7 @@ m32c_syscall (int id) } break; - case SYS_open: + case TARGET_SYS_open: { int path = arg (PTRSZ); int oflags = arg (2); @@ -228,7 +227,7 @@ m32c_syscall (int id) } break; - case SYS_close: + case TARGET_SYS_close: { int fd = arg (2); @@ -244,7 +243,7 @@ m32c_syscall (int id) } break; - case SYS_read: + case TARGET_SYS_read: { int fd = arg (2); int addr = arg (PTRSZ); @@ -264,7 +263,7 @@ m32c_syscall (int id) } break; - case SYS_write: + case TARGET_SYS_write: { int fd = arg (2); int addr = arg (PTRSZ); @@ -287,11 +286,11 @@ m32c_syscall (int id) } break; - case SYS_getpid: + case TARGET_SYS_getpid: put_reg (r0, 42); break; - case SYS_gettimeofday: + case TARGET_SYS_gettimeofday: { int tvaddr = arg (PTRSZ); struct timeval tv; @@ -306,7 +305,7 @@ m32c_syscall (int id) } break; - case SYS_kill: + case TARGET_SYS_kill: { int pid = arg (2); int sig = arg (2); |