diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2003-10-15 12:30:47 +0000 |
---|---|---|
committer | Joern Rennecke <joern.rennecke@embecosm.com> | 2003-10-15 12:30:47 +0000 |
commit | 8822d0016c0c592c921a3a4e96d2e8533c79545f (patch) | |
tree | 990fecea2f39fa10115680ad71e7dfca642d51bd /sim/sh/interp.c | |
parent | cdc9c0bc96781bae099051b052ccfd66ea685ba5 (diff) | |
download | gdb-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/interp.c')
-rw-r--r-- | sim/sh/interp.c | 11 |
1 files changed, 11 insertions, 0 deletions
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; |