mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
include/exec: Move gdb_stat and gdb_timeval to gdbstub.h
We have two copies of these structures, and require them in semihosting/ going forward. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
94b14fe08f
commit
7c56c2d3da
3 changed files with 33 additions and 54 deletions
|
@ -47,30 +47,6 @@
|
|||
#define HOSTED_ISATTY 12
|
||||
#define HOSTED_SYSTEM 13
|
||||
|
||||
typedef uint32_t gdb_mode_t;
|
||||
typedef uint32_t gdb_time_t;
|
||||
|
||||
struct nios2_gdb_stat {
|
||||
uint32_t gdb_st_dev; /* device */
|
||||
uint32_t gdb_st_ino; /* inode */
|
||||
gdb_mode_t gdb_st_mode; /* protection */
|
||||
uint32_t gdb_st_nlink; /* number of hard links */
|
||||
uint32_t gdb_st_uid; /* user ID of owner */
|
||||
uint32_t gdb_st_gid; /* group ID of owner */
|
||||
uint32_t gdb_st_rdev; /* device type (if inode device) */
|
||||
uint64_t gdb_st_size; /* total size, in bytes */
|
||||
uint64_t gdb_st_blksize; /* blocksize for filesystem I/O */
|
||||
uint64_t gdb_st_blocks; /* number of blocks allocated */
|
||||
gdb_time_t gdb_st_atime; /* time of last access */
|
||||
gdb_time_t gdb_st_mtime; /* time of last modification */
|
||||
gdb_time_t gdb_st_ctime; /* time of last change */
|
||||
} QEMU_PACKED;
|
||||
|
||||
struct gdb_timeval {
|
||||
gdb_time_t tv_sec; /* second */
|
||||
uint64_t tv_usec; /* microsecond */
|
||||
} QEMU_PACKED;
|
||||
|
||||
static int translate_openflags(int flags)
|
||||
{
|
||||
int hf;
|
||||
|
@ -102,9 +78,9 @@ static int translate_openflags(int flags)
|
|||
static bool translate_stat(CPUNios2State *env, target_ulong addr,
|
||||
struct stat *s)
|
||||
{
|
||||
struct nios2_gdb_stat *p;
|
||||
struct gdb_stat *p;
|
||||
|
||||
p = lock_user(VERIFY_WRITE, addr, sizeof(struct nios2_gdb_stat), 0);
|
||||
p = lock_user(VERIFY_WRITE, addr, sizeof(struct gdb_stat), 0);
|
||||
|
||||
if (!p) {
|
||||
return false;
|
||||
|
@ -128,7 +104,7 @@ static bool translate_stat(CPUNios2State *env, target_ulong addr,
|
|||
p->gdb_st_atime = cpu_to_be32(s->st_atime);
|
||||
p->gdb_st_mtime = cpu_to_be32(s->st_mtime);
|
||||
p->gdb_st_ctime = cpu_to_be32(s->st_ctime);
|
||||
unlock_user(p, addr, sizeof(struct nios2_gdb_stat));
|
||||
unlock_user(p, addr, sizeof(struct gdb_stat));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue