[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 12/74] include/exec: Move gdb open flags to gdbstub.h
From: |
Richard Henderson |
Subject: |
[PATCH v2 12/74] include/exec: Move gdb open flags to gdbstub.h |
Date: |
Tue, 3 May 2022 12:47:41 -0700 |
There were 3 copies of these flags. Place them in the
file with gdb_do_syscall, with which they belong.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/exec/gdbstub.h | 10 ++++++++++
semihosting/arm-compat-semi.c | 8 --------
target/m68k/m68k-semi.c | 8 --------
target/nios2/nios2-semi.c | 8 --------
4 files changed, 10 insertions(+), 24 deletions(-)
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index c35d7334b4..2aaba9c723 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -10,6 +10,16 @@
#define GDB_WATCHPOINT_READ 3
#define GDB_WATCHPOINT_ACCESS 4
+/* For gdb file i/o remote protocol open flags. */
+#define GDB_O_BINARY 0
+#define GDB_O_RDONLY 0
+#define GDB_O_WRONLY 1
+#define GDB_O_RDWR 2
+#define GDB_O_APPEND 8
+#define GDB_O_CREAT 0x200
+#define GDB_O_TRUNC 0x400
+#define GDB_O_EXCL 0x800
+
#ifdef NEED_CPU_H
#include "cpu.h"
diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
index 18664b1c47..a1fc4ea039 100644
--- a/semihosting/arm-compat-semi.c
+++ b/semihosting/arm-compat-semi.c
@@ -86,14 +86,6 @@
#define O_BINARY 0
#endif
-#define GDB_O_RDONLY 0x000
-#define GDB_O_WRONLY 0x001
-#define GDB_O_RDWR 0x002
-#define GDB_O_APPEND 0x008
-#define GDB_O_CREAT 0x200
-#define GDB_O_TRUNC 0x400
-#define GDB_O_BINARY 0
-
static int gdb_open_modeflags[12] = {
GDB_O_RDONLY,
GDB_O_RDONLY | GDB_O_BINARY,
diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c
index a31db38fc3..475a6b13b7 100644
--- a/target/m68k/m68k-semi.c
+++ b/target/m68k/m68k-semi.c
@@ -69,14 +69,6 @@ struct gdb_timeval {
uint64_t tv_usec; /* microsecond */
} QEMU_PACKED;
-#define GDB_O_RDONLY 0x0
-#define GDB_O_WRONLY 0x1
-#define GDB_O_RDWR 0x2
-#define GDB_O_APPEND 0x8
-#define GDB_O_CREAT 0x200
-#define GDB_O_TRUNC 0x400
-#define GDB_O_EXCL 0x800
-
static int translate_openflags(int flags)
{
int hf;
diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c
index 373e6b9436..0eec1f9a1c 100644
--- a/target/nios2/nios2-semi.c
+++ b/target/nios2/nios2-semi.c
@@ -71,14 +71,6 @@ struct gdb_timeval {
uint64_t tv_usec; /* microsecond */
} QEMU_PACKED;
-#define GDB_O_RDONLY 0x0
-#define GDB_O_WRONLY 0x1
-#define GDB_O_RDWR 0x2
-#define GDB_O_APPEND 0x8
-#define GDB_O_CREAT 0x200
-#define GDB_O_TRUNC 0x400
-#define GDB_O_EXCL 0x800
-
static int translate_openflags(int flags)
{
int hf;
--
2.34.1
- Re: [PATCH v2 06/74] semihosting: Simplify softmmu_lock_user_string, (continued)
- [PATCH v2 07/74] semihosting: Split out guestfd.c, Richard Henderson, 2022/05/03
- [PATCH v2 08/74] semihosting: Generalize GuestFDFeatureFile, Richard Henderson, 2022/05/03
- [PATCH v2 09/74] semihosting: Return void from do_common_semihosting, Richard Henderson, 2022/05/03
- [PATCH v2 13/74] include/exec: Move gdb_stat and gdb_timeval to gdbstub.h, Richard Henderson, 2022/05/03
- [PATCH v2 10/74] semihosting: Adjust error checking in common_semi_cb, Richard Henderson, 2022/05/03
- [PATCH v2 12/74] include/exec: Move gdb open flags to gdbstub.h,
Richard Henderson <=
- [PATCH v2 14/74] include/exec: Define errno values in gdbstub.h, Richard Henderson, 2022/05/03
- [PATCH v2 15/74] semihosting: Use struct gdb_stat in common_semi_flen_cb, Richard Henderson, 2022/05/03
- [PATCH v2 17/74] semihosting: Split common_semi_flen_buf per target, Richard Henderson, 2022/05/03
- [PATCH v2 16/74] semihosting: Split is_64bit_semihosting per target, Richard Henderson, 2022/05/03
- [PATCH v2 19/74] semihosting: Use env more often in do_common_semihosting, Richard Henderson, 2022/05/03
- [PATCH v2 22/74] semihosting: Split out semihost_sys_close, Richard Henderson, 2022/05/03
- [PATCH v2 21/74] semihosting: Split out semihost_sys_open, Richard Henderson, 2022/05/03
- [PATCH v2 20/74] semihosting: Move GET_ARG/SET_ARG earlier in the file, Richard Henderson, 2022/05/03