summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-07-08 10:08:24 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-07-08 10:08:24 +0000
commit1b8dd648bdccefa8ba1b05416e65e9b3a278b0e6 (patch)
tree9fd48ef072e8d14a10cd1e3cd59081dffbe80e35 /linux-user
parent17d996e1f1de8057b3bb88b753e65735a6d8f191 (diff)
downloadqemu-1b8dd648bdccefa8ba1b05416e65e9b3a278b0e6.tar.gz
Fix Sparc64 stat system call
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3053 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c9
-rw-r--r--linux-user/syscall_defs.h51
2 files changed, 59 insertions, 1 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6cad6d92f4..52806bb20e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3535,7 +3535,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
struct target_stat *target_st;
lock_user_struct(target_st, arg2, 0);
-#if defined(TARGET_MIPS)
+#if defined(TARGET_MIPS) || defined(TARGET_SPARC64)
target_st->st_dev = tswap32(st.st_dev);
#else
target_st->st_dev = tswap16(st.st_dev);
@@ -3545,6 +3545,10 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
target_st->st_mode = tswapl(st.st_mode); /* XXX: check this */
target_st->st_uid = tswap32(st.st_uid);
target_st->st_gid = tswap32(st.st_gid);
+#elif defined(TARGET_SPARC64)
+ target_st->st_mode = tswap32(st.st_mode);
+ target_st->st_uid = tswap32(st.st_uid);
+ target_st->st_gid = tswap32(st.st_gid);
#else
target_st->st_mode = tswap16(st.st_mode);
target_st->st_uid = tswap16(st.st_uid);
@@ -3554,6 +3558,9 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
/* If this is the same on PPC, then just merge w/ the above ifdef */
target_st->st_nlink = tswapl(st.st_nlink);
target_st->st_rdev = tswapl(st.st_rdev);
+#elif defined(TARGET_SPARC64)
+ target_st->st_nlink = tswap32(st.st_nlink);
+ target_st->st_rdev = tswap32(st.st_rdev);
#else
target_st->st_nlink = tswap16(st.st_nlink);
target_st->st_rdev = tswap16(st.st_rdev);
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 0e39a2e77e..7b4122fede 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -962,6 +962,57 @@ struct target_eabi_stat64 {
} __attribute__ ((packed));
#endif
+#elif defined(TARGET_SPARC64)
+struct target_stat {
+ unsigned int st_dev;
+ target_ulong st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ unsigned int st_rdev;
+ target_long st_size;
+ target_long target_st_atime;
+ target_long target_st_mtime;
+ target_long target_st_ctime;
+ target_long st_blksize;
+ target_long st_blocks;
+ target_ulong __unused4[2];
+};
+
+struct target_stat64 {
+ unsigned char __pad0[6];
+ unsigned short st_dev;
+
+ uint64_t st_ino;
+ uint64_t st_nlink;
+
+ unsigned int st_mode;
+
+ unsigned int st_uid;
+ unsigned int st_gid;
+
+ unsigned char __pad2[6];
+ unsigned short st_rdev;
+
+ int64_t st_size;
+ int64_t st_blksize;
+
+ unsigned char __pad4[4];
+ unsigned int st_blocks;
+
+ target_ulong target_st_atime;
+ target_ulong __unused1;
+
+ target_ulong target_st_mtime;
+ target_ulong __unused2;
+
+ target_ulong target_st_ctime;
+ target_ulong __unused3;
+
+ target_ulong __unused4[3];
+};
+
#elif defined(TARGET_SPARC)
struct target_stat {