aboutsummaryrefslogtreecommitdiff
path: root/sim/sh
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2003-10-15 12:30:47 +0000
committerJoern Rennecke <joern.rennecke@embecosm.com>2003-10-15 12:30:47 +0000
commit8822d0016c0c592c921a3a4e96d2e8533c79545f (patch)
tree990fecea2f39fa10115680ad71e7dfca642d51bd /sim/sh
parentcdc9c0bc96781bae099051b052ccfd66ea685ba5 (diff)
downloadgdb-8822d0016c0c592c921a3a4e96d2e8533c79545f.zip
gdb-8822d0016c0c592c921a3a4e96d2e8533c79545f.tar.gz
gdb-8822d0016c0c592c921a3a4e96d2e8533c79545f.tar.bz2
include/gdb:
* callback.h (struct host_callback_struct): New members ftruncate and truncate. gdb: sim/common: * callback.c (os_ftruncate, os_truncate): New functions. (default_callback): Initialize ftruncate and truncate members. sim/sh: * syscall.h (SYS_truncate, SYS_ftruncate): Define. * interp.c (trap): Add support for SYS_ftruncate and SYS_truncate.
Diffstat (limited to 'sim/sh')
-rw-r--r--sim/sh/ChangeLog5
-rw-r--r--sim/sh/interp.c11
-rw-r--r--sim/sh/syscall.h2
3 files changed, 18 insertions, 0 deletions
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index 7ab1394..2b6cf43 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-15 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * syscall.h (SYS_truncate, SYS_ftruncate): Define.
+ * interp.c (trap): Add support for SYS_ftruncate and SYS_truncate.
+
2003-08-11 Shrinivas Atre <shrinivasa@KPITCummins.com>
* sim/sh/gencode.c ( tab[] ): Addition of MAC.L handler and
correction for MAC.W handler
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index 91899f4..711df1e 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -1153,6 +1153,17 @@ trap (i, regs, insn_ptr, memory, maskl, maskw, endianw)
case SYS_time:
regs[0] = get_now ();
break;
+ case SYS_ftruncate:
+ regs[0] = callback->ftruncate (callback, regs[5], regs[6]);
+ break;
+ case SYS_truncate:
+ {
+ int len = strswaplen (regs[5]);
+ strnswap (regs[5], len);
+ regs[0] = callback->truncate (callback, ptr (regs[5]), regs[6]);
+ strnswap (regs[5], len);
+ break;
+ }
default:
regs[0] = -1;
break;
diff --git a/sim/sh/syscall.h b/sim/sh/syscall.h
index 9b818f9..aebce2c 100644
--- a/sim/sh/syscall.h
+++ b/sim/sh/syscall.h
@@ -27,6 +27,8 @@
#define SYS_stat 38
#define SYS_pipe 42
#define SYS_execve 59
+#define SYS_truncate 129
+#define SYS_ftruncate 130
#define SYS_argc 172
#define SYS_argnlen 173
#define SYS_argn 174