aboutsummaryrefslogtreecommitdiff
path: root/sim/arm/armos.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-07-06 23:21:20 -0400
committerMike Frysinger <vapier@gentoo.org>2021-10-31 04:50:44 -0400
commitb868a2393bfd65221fe94e4ef2eebf218dee5a71 (patch)
tree21a05a8a3759bf111590424492a108128fda227e /sim/arm/armos.c
parent88c8370b25c6a76cb7de19a3ef50a34abc090756 (diff)
downloadgdb-b868a2393bfd65221fe94e4ef2eebf218dee5a71.zip
gdb-b868a2393bfd65221fe94e4ef2eebf218dee5a71.tar.gz
gdb-b868a2393bfd65221fe94e4ef2eebf218dee5a71.tar.bz2
sim: nltvals: localize TARGET_<open> defines
Code should not be using these directly, instead they should be resolving these dynamically via the open_map. Rework the common callback code that was using the defines to use symbolic names instead, and localize some of the defines in the ARM code (since it's a bit unclear how many different APIs it supports currently), then remove the defines out of the header so no new code can rely on them.
Diffstat (limited to 'sim/arm/armos.c')
-rw-r--r--sim/arm/armos.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sim/arm/armos.c b/sim/arm/armos.c
index a3713a5..a8ef7e4 100644
--- a/sim/arm/armos.c
+++ b/sim/arm/armos.c
@@ -31,11 +31,6 @@
#include <errno.h>
#include <limits.h>
#include <string.h>
-#include "targ-vals.h"
-
-#ifndef TARGET_O_BINARY
-#define TARGET_O_BINARY 0
-#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> /* For SEEK_SET etc. */
@@ -188,7 +183,17 @@ ARMul_OSInit (ARMul_State * state)
return TRUE;
}
-static int translate_open_mode[] =
+/* These are libgloss defines, but seem to be common across all supported ARM
+ targets at the moment. These should get moved to the callback open_map. */
+#define TARGET_O_BINARY 0
+#define TARGET_O_APPEND 0x8
+#define TARGET_O_CREAT 0x200
+#define TARGET_O_RDONLY 0x0
+#define TARGET_O_RDWR 0x2
+#define TARGET_O_TRUNC 0x400
+#define TARGET_O_WRONLY 0x1
+
+static const int translate_open_mode[] =
{
TARGET_O_RDONLY, /* "r" */
TARGET_O_RDONLY + TARGET_O_BINARY, /* "rb" */