* armos.c (fcntl.h): Do not include it.
authorMark Mitchell <mark@codesourcery.com>
Mon, 29 Dec 2003 19:52:57 +0000 (19:52 +0000)
committerMark Mitchell <mark@codesourcery.com>
Mon, 29 Dec 2003 19:52:57 +0000 (19:52 +0000)
(O_RDONLY): Do not define.
(O_WRONLY): Likewise.
(O_RDWR): Likewise.
(targ-vals.h): Include it.
(translate_open_mode): Use TARGET_O_* instead of O_*.
(SWIopen): Likewise.
* Makefile.in (armos.o): Depend on targ-vals.h.

sim/arm/ChangeLog
sim/arm/Makefile.in
sim/arm/armos.c

index a3cd7f2248a34a1306c2680e25378c9fe390b4d1..6447e219679f2b89e39ea3d580e2b1cc16eef9b2 100644 (file)
@@ -1,3 +1,14 @@
+2003-12-29  Mark Mitchell  <mark@codesourcery.com>
+
+       * armos.c (fcntl.h): Do not include it.
+       (O_RDONLY): Do not define.
+       (O_WRONLY): Likewise.
+       (O_RDWR): Likewise.
+       (targ-vals.h): Include it.
+       (translate_open_mode): Use TARGET_O_* instead of O_*.
+       (SWIopen): Likewise.
+       * Makefile.in (armos.o): Depend on targ-vals.h.
+
 2003-04-13  Nick Clifton  <nickc@redhat.com>
 
        * armvirt.c (GetWord): Only call XScale_check_memacc if in XScale
index 7def0f967bb4513087d555faf1171b1fda8a53e1..1214a4a335c97679cb5ee723e43b014124f7214d 100644 (file)
@@ -28,7 +28,7 @@ SIM_OBJS = armemu26.o armemu32.o arminit.o armos.o armsupp.o \
 ## COMMON_POST_CONFIG_FRAG
 
 
-armos.o: armos.c armdefs.h armos.h armfpe.h
+armos.o: armos.c armdefs.h armos.h armfpe.h targ-vals.h
 
 armcopro.o: armcopro.c armdefs.h
 maverick.o: maverick.c armdefs.h
index 613d07eda1712f67f7e5bab04aaf953d2953cd47..5c26b2b0b9a7a961825f066cd200b1116114476f 100644 (file)
 #include <time.h>
 #include <errno.h>
 #include <string.h>
-#include <fcntl.h>
+#include "targ-vals.h"
 
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-#ifndef O_WRONLY
-#define O_WRONLY 1
-#endif
-#ifndef O_RDWR
-#define O_RDWR   2
-#endif
-#ifndef O_BINARY
-#define O_BINARY 0
+#ifndef TARGET_O_BINARY
+#define TARGET_O_BINARY 0
 #endif
 
 #ifdef __STDC__
@@ -260,18 +251,18 @@ ARMword ARMul_OSLastErrorP (ARMul_State * state)
 
 static int translate_open_mode[] =
 {
-  O_RDONLY,                    /* "r"   */
-  O_RDONLY + O_BINARY,         /* "rb"  */
-  O_RDWR,                      /* "r+"  */
-  O_RDWR + O_BINARY,           /* "r+b" */
-  O_WRONLY + O_CREAT + O_TRUNC,        /* "w"   */
-  O_WRONLY + O_BINARY + O_CREAT + O_TRUNC,     /* "wb"  */
-  O_RDWR + O_CREAT + O_TRUNC,  /* "w+"  */
-  O_RDWR + O_BINARY + O_CREAT + O_TRUNC,       /* "w+b" */
-  O_WRONLY + O_APPEND + O_CREAT,       /* "a"   */
-  O_WRONLY + O_BINARY + O_APPEND + O_CREAT,    /* "ab"  */
-  O_RDWR + O_APPEND + O_CREAT, /* "a+"  */
-  O_RDWR + O_BINARY + O_APPEND + O_CREAT       /* "a+b" */
+  TARGET_O_RDONLY,             /* "r"   */
+  TARGET_O_RDONLY + TARGET_O_BINARY,   /* "rb"  */
+  TARGET_O_RDWR,               /* "r+"  */
+  TARGET_O_RDWR + TARGET_O_BINARY,             /* "r+b" */
+  TARGET_O_WRONLY + TARGET_O_CREAT + TARGET_O_TRUNC,   /* "w"   */
+  TARGET_O_WRONLY + TARGET_O_BINARY + TARGET_O_CREAT + TARGET_O_TRUNC, /* "wb"  */
+  TARGET_O_RDWR + TARGET_O_CREAT + TARGET_O_TRUNC,     /* "w+"  */
+  TARGET_O_RDWR + TARGET_O_BINARY + TARGET_O_CREAT + TARGET_O_TRUNC,   /* "w+b" */
+  TARGET_O_WRONLY + TARGET_O_APPEND + TARGET_O_CREAT,  /* "a"   */
+  TARGET_O_WRONLY + TARGET_O_BINARY + TARGET_O_APPEND + TARGET_O_CREAT,        /* "ab"  */
+  TARGET_O_RDWR + TARGET_O_APPEND + TARGET_O_CREAT,    /* "a+"  */
+  TARGET_O_RDWR + TARGET_O_BINARY + TARGET_O_APPEND + TARGET_O_CREAT   /* "a+b" */
 };
 
 static void
@@ -325,7 +316,7 @@ SWIopen (ARMul_State * state, ARMword name, ARMword SWIflags)
   /* Filename ":tt" is special: it denotes stdin/out.  */
   if (strcmp (dummy, ":tt") == 0)
     {
-      if (flags == O_RDONLY)   /* opening tty "r" */
+      if (flags == TARGET_O_RDONLY) /* opening tty "r" */
        state->Reg[0] = 0;      /* stdin */
       else
        state->Reg[0] = 1;      /* stdout */
This page took 0.029426 seconds and 4 git commands to generate.