From ffc67e7a94d475d4c52370915a89b16cf9423ac2 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Sat, 3 Jan 2009 19:58:11 +0000 Subject: [PATCH] * cris/traps.c (TARGET_UTSNAME): Update to 2009-01-01. (TARGET_EPOCH): Update to match TARGET_UTSNAME. Correct comment. (cris_break_13_handler) : Update to 2.6.27. Set machine field to the BFD printable name of the machine. --- sim/ChangeLog | 9 ++++++++- sim/cris/traps.c | 20 ++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/sim/ChangeLog b/sim/ChangeLog index 1a44d01cd16..553d3bd5720 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,7 +1,14 @@ 2009-01-03 Hans-Peter Nilsson + * cris/traps.c (TARGET_UTSNAME): Update to 2009-01-01. + (TARGET_EPOCH): Update to match TARGET_UTSNAME. Correct comment. + (cris_break_13_handler) : Update to + 2.6.27. Set machine field to the BFD printable name of the + machine. + * cris/traps.c (TARGET_MAP_DENYWRITE): Define. - : Handle TARGET_MAP_DENYWRITE. + (cris_break_13_handler) : Handle + TARGET_MAP_DENYWRITE. * cris/traps.c (TARGET_SYS_access, TARGET_R_OK, TARGET_W_OK) (TARGET_X_OK, TARGET_F_OK): Define. diff --git a/sim/cris/traps.c b/sim/cris/traps.c index ff70902d7f8..b11cd867fd3 100644 --- a/sim/cris/traps.c +++ b/sim/cris/traps.c @@ -144,10 +144,11 @@ along with this program. If not, see . */ #define TARGET_TCGETS 0x5401 -#define TARGET_UTSNAME "#38 Sun Apr 1 00:00:00 MET 2001" +#define TARGET_UTSNAME "#7 Thu Jan 1 00:00:00 MET 2009" -/* Seconds since the above date + 10 minutes. */ -#define TARGET_EPOCH 986080200 +/* Seconds since 1970-01-01 to the above date + 10 minutes; + 'date -d "Thu Jan 1 00:00:10 MET 2009" +%s'. */ +#define TARGET_EPOCH 1230764410 /* Milliseconds since start of run. We use the number of syscalls to avoid introducing noise in the execution time. */ @@ -1570,16 +1571,23 @@ cris_break_13_handler (SIM_CPU *current_cpu, USI callnum, USI arg1, case TARGET_SYS_uname: { /* Fill in a few constants to appease glibc. */ - static const char sim_utsname[6][65] = + static char sim_utsname[6][65] = { "Linux", "sim-target", - "2.4.5", + "2.6.27", TARGET_UTSNAME, - "cris", + "cris", /* Overwritten below. */ "localdomain" }; + /* Having the hardware type in Linux equal to the bfd + printable name is deliberate: if you make config.guess + work on your Linux-type system the usual way, it + probably will; either the bfd printable_name or the + ambiguous arch_name. */ + strcpy (sim_utsname[4], STATE_ARCHITECTURE (sd)->printable_name); + if ((s.write_mem) (cb, &s, arg1, (const char *) sim_utsname, sizeof (sim_utsname)) != sizeof (sim_utsname)) -- 2.30.2