aboutsummaryrefslogtreecommitdiff
path: root/sim/v850/simops.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-10-30 16:30:59 +0000
committerJeff Law <law@redhat.com>1996-10-30 16:30:59 +0000
commit8824fb459bfdf1f4fb841747f2a7aad398b277c7 (patch)
tree3ebf28f71c7db1f49bf182c00c73f48f25c1348b /sim/v850/simops.c
parent6803f89b14a0d92f9012ca37f7069f345ddaca91 (diff)
downloadgdb-8824fb459bfdf1f4fb841747f2a7aad398b277c7.zip
gdb-8824fb459bfdf1f4fb841747f2a7aad398b277c7.tar.gz
gdb-8824fb459bfdf1f4fb841747f2a7aad398b277c7.tar.bz2
* simops.c (OP_10007E0): Handle SYS_times and SYS_gettimeofday.
Check it into devo too.
Diffstat (limited to 'sim/v850/simops.c')
-rw-r--r--sim/v850/simops.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index dc5f836..c932849 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -5,6 +5,7 @@
#include "bfd.h"
#include <errno.h>
#include <sys/stat.h>
+#include <sys/times.h>
enum op_types {
OP_UNKNOWN,
@@ -2086,6 +2087,27 @@ OP_10007E0 ()
case SYS_time:
RETVAL = time (MEMPTR (PARM1));
break;
+ case SYS_times:
+ {
+ struct tms tms;
+ RETVAL = times (&tms);
+ store_mem (PARM1, 4, tms.tms_utime);
+ store_mem (PARM1 + 4, 4, tms.tms_stime);
+ store_mem (PARM1 + 8, 4, tms.tms_cutime);
+ store_mem (PARM1 + 12, 4, tms.tms_cstime);
+ break;
+ }
+ case SYS_gettimeofday:
+ {
+ struct timeval t;
+ struct timezone tz;
+ RETVAL = gettimeofday (&t, &tz);
+ store_mem (PARM1, 4, t.tv_sec);
+ store_mem (PARM1 + 4, 4, t.tv_usec);
+ store_mem (PARM2, 4, tz.tz_minuteswest);
+ store_mem (PARM2 + 4, 4, tz.tz_dsttime);
+ break;
+ }
case SYS_utime:
/* Cast the second argument to void *, to avoid type mismatch
if a prototype is present. */