* [Qemu-devel] [PULL 0/2] alpha-linux-user patch queue
@ 2013-01-16 16:28 Richard Henderson
2013-01-16 16:28 ` [Qemu-devel] [PATCH 1/2] alpha-linux-user: Translate fcntl l_type Richard Henderson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Richard Henderson @ 2013-01-16 16:28 UTC (permalink / raw)
To: qemu-devel
The following changes since commit 249d41720b7dfbb5951b430b9eefdbee7464f515:
qdev: Prepare "realized" property (2013-01-15 18:27:00 -0600)
are available in the git repository at:
git://github.com/rth7680/qemu.git axp-next
for you to fetch changes up to 9468a5d4904223af2c47131f32e3a0555142e4e3:
alpha-linux-user: Correct select (2013-01-16 08:15:16 -0800)
----------------------------------------------------------------
Laurent Vivier (2):
alpha-linux-user: Translate fcntl l_type
alpha-linux-user: Correct select
linux-user/syscall.c | 40 ++++++++++++++++++++++++++++------------
linux-user/syscall_defs.h | 18 ++++++++++++++++++
2 files changed, 46 insertions(+), 12 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 1/2] alpha-linux-user: Translate fcntl l_type
2013-01-16 16:28 [Qemu-devel] [PULL 0/2] alpha-linux-user patch queue Richard Henderson
@ 2013-01-16 16:28 ` Richard Henderson
2013-01-16 16:28 ` [Qemu-devel] [PATCH 2/2] alpha-linux-user: Correct select Richard Henderson
2013-01-19 13:56 ` [Qemu-devel] [PULL 0/2] alpha-linux-user patch queue Blue Swirl
2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2013-01-16 16:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier
From: Laurent Vivier <laurent@vivier.eu>
The values of F_RDLCK, F_WRLCK, F_UNLCK, F_EXLCK, F_SHLCK
differ between alpha and other linux architectures.
This patch allows to run "dpkg" (database lock).
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
linux-user/syscall.c | 28 ++++++++++++++++++++++------
linux-user/syscall_defs.h | 18 ++++++++++++++++++
2 files changed, 40 insertions(+), 6 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3167a87..94f79dd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4512,6 +4512,16 @@ static int target_to_host_fcntl_cmd(int cmd)
return -TARGET_EINVAL;
}
+#define TRANSTBL_CONVERT(a) { -1, TARGET_##a, -1, a }
+static const bitmask_transtbl flock_tbl[] = {
+ TRANSTBL_CONVERT(F_RDLCK),
+ TRANSTBL_CONVERT(F_WRLCK),
+ TRANSTBL_CONVERT(F_UNLCK),
+ TRANSTBL_CONVERT(F_EXLCK),
+ TRANSTBL_CONVERT(F_SHLCK),
+ { 0, 0, 0, 0 }
+};
+
static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
{
struct flock fl;
@@ -4528,7 +4538,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
case TARGET_F_GETLK:
if (!lock_user_struct(VERIFY_READ, target_fl, arg, 1))
return -TARGET_EFAULT;
- fl.l_type = tswap16(target_fl->l_type);
+ fl.l_type =
+ target_to_host_bitmask(tswap16(target_fl->l_type), flock_tbl);
fl.l_whence = tswap16(target_fl->l_whence);
fl.l_start = tswapal(target_fl->l_start);
fl.l_len = tswapal(target_fl->l_len);
@@ -4538,7 +4549,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
if (ret == 0) {
if (!lock_user_struct(VERIFY_WRITE, target_fl, arg, 0))
return -TARGET_EFAULT;
- target_fl->l_type = tswap16(fl.l_type);
+ target_fl->l_type =
+ host_to_target_bitmask(tswap16(fl.l_type), flock_tbl);
target_fl->l_whence = tswap16(fl.l_whence);
target_fl->l_start = tswapal(fl.l_start);
target_fl->l_len = tswapal(fl.l_len);
@@ -4551,7 +4563,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
case TARGET_F_SETLKW:
if (!lock_user_struct(VERIFY_READ, target_fl, arg, 1))
return -TARGET_EFAULT;
- fl.l_type = tswap16(target_fl->l_type);
+ fl.l_type =
+ target_to_host_bitmask(tswap16(target_fl->l_type), flock_tbl);
fl.l_whence = tswap16(target_fl->l_whence);
fl.l_start = tswapal(target_fl->l_start);
fl.l_len = tswapal(target_fl->l_len);
@@ -4563,7 +4576,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
case TARGET_F_GETLK64:
if (!lock_user_struct(VERIFY_READ, target_fl64, arg, 1))
return -TARGET_EFAULT;
- fl64.l_type = tswap16(target_fl64->l_type) >> 1;
+ fl64.l_type =
+ target_to_host_bitmask(tswap16(target_fl64->l_type), flock_tbl) >> 1;
fl64.l_whence = tswap16(target_fl64->l_whence);
fl64.l_start = tswap64(target_fl64->l_start);
fl64.l_len = tswap64(target_fl64->l_len);
@@ -4573,7 +4587,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
if (ret == 0) {
if (!lock_user_struct(VERIFY_WRITE, target_fl64, arg, 0))
return -TARGET_EFAULT;
- target_fl64->l_type = tswap16(fl64.l_type) >> 1;
+ target_fl64->l_type =
+ host_to_target_bitmask(tswap16(fl64.l_type), flock_tbl) >> 1;
target_fl64->l_whence = tswap16(fl64.l_whence);
target_fl64->l_start = tswap64(fl64.l_start);
target_fl64->l_len = tswap64(fl64.l_len);
@@ -4585,7 +4600,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
case TARGET_F_SETLKW64:
if (!lock_user_struct(VERIFY_READ, target_fl64, arg, 1))
return -TARGET_EFAULT;
- fl64.l_type = tswap16(target_fl64->l_type) >> 1;
+ fl64.l_type =
+ target_to_host_bitmask(tswap16(target_fl64->l_type), flock_tbl) >> 1;
fl64.l_whence = tswap16(target_fl64->l_whence);
fl64.l_start = tswap64(target_fl64->l_start);
fl64.l_len = tswap64(target_fl64->l_len);
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index f8f5539..92c01a9 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2017,6 +2017,12 @@ struct target_statfs64 {
#define TARGET_F_SETLKW 9
#define TARGET_F_SETOWN 5 /* for sockets. */
#define TARGET_F_GETOWN 6 /* for sockets. */
+
+#define TARGET_F_RDLCK 1
+#define TARGET_F_WRLCK 2
+#define TARGET_F_UNLCK 8
+#define TARGET_F_EXLCK 16
+#define TARGET_F_SHLCK 32
#elif defined(TARGET_MIPS)
#define TARGET_F_GETLK 14
#define TARGET_F_SETLK 6
@@ -2031,6 +2037,18 @@ struct target_statfs64 {
#define TARGET_F_GETOWN 9 /* for sockets. */
#endif
+#ifndef TARGET_F_RDLCK
+#define TARGET_F_RDLCK 0
+#define TARGET_F_WRLCK 1
+#define TARGET_F_UNLCK 2
+#endif
+
+#ifndef TARGET_F_EXLCK
+#define TARGET_F_EXLCK 4
+#define TARGET_F_SHLCK 8
+#endif
+
+
#define TARGET_F_SETSIG 10 /* for sockets. */
#define TARGET_F_GETSIG 11 /* for sockets. */
--
1.7.11.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 2/2] alpha-linux-user: Correct select
2013-01-16 16:28 [Qemu-devel] [PULL 0/2] alpha-linux-user patch queue Richard Henderson
2013-01-16 16:28 ` [Qemu-devel] [PATCH 1/2] alpha-linux-user: Translate fcntl l_type Richard Henderson
@ 2013-01-16 16:28 ` Richard Henderson
2013-01-19 13:56 ` [Qemu-devel] [PULL 0/2] alpha-linux-user patch queue Blue Swirl
2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2013-01-16 16:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier
From: Laurent Vivier <laurent@vivier.eu>
Alpha, like s390x, passes all select arguments in registers.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
linux-user/syscall.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 94f79dd..693e66f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6227,8 +6227,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
ret = get_errno(settimeofday(&tv, NULL));
}
break;
-#if defined(TARGET_NR_select) && !defined(TARGET_S390X) && !defined(TARGET_S390)
+#if defined(TARGET_NR_select)
case TARGET_NR_select:
+#if defined(TARGET_S390X) || defined(TARGET_ALPHA)
+ ret = do_select(arg1, arg2, arg3, arg4, arg5);
+#else
{
struct target_sel_arg_struct *sel;
abi_ulong inp, outp, exp, tvp;
@@ -6244,6 +6247,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
unlock_user_struct(sel, arg1, 0);
ret = do_select(nsel, inp, outp, exp, tvp);
}
+#endif
break;
#endif
#ifdef TARGET_NR_pselect6
@@ -7167,12 +7171,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
}
break;
#endif /* TARGET_NR_getdents64 */
-#if defined(TARGET_NR__newselect) || defined(TARGET_S390X)
-#ifdef TARGET_S390X
- case TARGET_NR_select:
-#else
+#if defined(TARGET_NR__newselect)
case TARGET_NR__newselect:
-#endif
ret = do_select(arg1, arg2, arg3, arg4, arg5);
break;
#endif
--
1.7.11.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] alpha-linux-user patch queue
2013-01-16 16:28 [Qemu-devel] [PULL 0/2] alpha-linux-user patch queue Richard Henderson
2013-01-16 16:28 ` [Qemu-devel] [PATCH 1/2] alpha-linux-user: Translate fcntl l_type Richard Henderson
2013-01-16 16:28 ` [Qemu-devel] [PATCH 2/2] alpha-linux-user: Correct select Richard Henderson
@ 2013-01-19 13:56 ` Blue Swirl
2 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2013-01-19 13:56 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel
Thanks, pulled.
On Wed, Jan 16, 2013 at 4:28 PM, Richard Henderson <rth@twiddle.net> wrote:
> The following changes since commit 249d41720b7dfbb5951b430b9eefdbee7464f515:
>
> qdev: Prepare "realized" property (2013-01-15 18:27:00 -0600)
>
> are available in the git repository at:
>
> git://github.com/rth7680/qemu.git axp-next
>
> for you to fetch changes up to 9468a5d4904223af2c47131f32e3a0555142e4e3:
>
> alpha-linux-user: Correct select (2013-01-16 08:15:16 -0800)
>
> ----------------------------------------------------------------
> Laurent Vivier (2):
> alpha-linux-user: Translate fcntl l_type
> alpha-linux-user: Correct select
>
> linux-user/syscall.c | 40 ++++++++++++++++++++++++++++------------
> linux-user/syscall_defs.h | 18 ++++++++++++++++++
> 2 files changed, 46 insertions(+), 12 deletions(-)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-19 13:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 16:28 [Qemu-devel] [PULL 0/2] alpha-linux-user patch queue Richard Henderson
2013-01-16 16:28 ` [Qemu-devel] [PATCH 1/2] alpha-linux-user: Translate fcntl l_type Richard Henderson
2013-01-16 16:28 ` [Qemu-devel] [PATCH 2/2] alpha-linux-user: Correct select Richard Henderson
2013-01-19 13:56 ` [Qemu-devel] [PULL 0/2] alpha-linux-user patch queue Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).