Committed: cris/traps.c: Support 32-bit stat syscall.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Committed: cris/traps.c: Support 32-bit stat syscall.

Hans-Peter Nilsson
Supporting (32-bit) stat is necessary to run the stat test-cases
on cris-axis-elf, whereas glibc only uses stat64.  (I've
rearranged the C tests a bit before submitting, so at least
*some* are runnable without glibc.)

sim/:
        * cris/traps.c (TARGET_SYS_stat): Define.
        (syscall_stat32_map): Add entry for TARGET_SYS_stat.
        (cris_break_13_handler) <case TARGET_SYS_stat>: New case.

Index: cris/traps.c
===================================================================
RCS file: /cvs/src/src/sim/cris/traps.c,v
retrieving revision 1.3
diff -p -u -r1.3 traps.c
--- cris/traps.c 18 Apr 2005 03:08:46 -0000 1.3
+++ cris/traps.c 17 Nov 2005 15:34:07 -0000
@@ -63,6 +64,7 @@ with this program; if not, write to the
 #define TARGET_SYS_truncate 92
 #define TARGET_SYS_ftruncate 93
 #define TARGET_SYS_socketcall 102
+#define TARGET_SYS_stat 106
 #define TARGET_SYS_fstat 108
 #define TARGET_SYS_wait4 114
 #define TARGET_SYS_sigreturn 119
@@ -260,6 +262,7 @@ static const char stat32_map[] =
 static const CB_TARGET_DEFS_MAP syscall_stat32_map[] =
 {
   { CB_SYS_fstat, TARGET_SYS_fstat },
+  { CB_SYS_stat, TARGET_SYS_stat },
   { 0, -1 }
 };
 
@@ -2324,6 +2354,7 @@ cris_break_13_handler (SIM_CPU *current_
   /* Add case labels here for other syscalls using the 32-bit
      "struct stat", provided they have a corresponding simulator
      function of course.  */
+ case TARGET_SYS_stat:
  case TARGET_SYS_fstat:
   {
     /* As long as the infrastructure doesn't cache anything

brgds, H-P