qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user,alpha: correct select()
@ 2013-01-07 22:38 Laurent Vivier
  2013-01-07 23:14 ` Richard Henderson
  2013-01-10 21:30 ` [Qemu-devel] [PATCH][v2] " Laurent Vivier
  0 siblings, 2 replies; 5+ messages in thread
From: Laurent Vivier @ 2013-01-07 22:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier, dillona, Richard Henderson

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2232bb8..76bafff 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6249,7 +6249,9 @@ 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) && !defined(TARGET_S390X) && \
+                                 !defined(TARGET_S390) && \
+                                 !defined(TARGET_ALPHA)
     case TARGET_NR_select:
         {
             struct target_sel_arg_struct *sel;
@@ -7189,8 +7191,9 @@ 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
+#if defined(TARGET_NR__newselect) || defined(TARGET_S390X) \
+                                  || defined(TARGET_ALPHA)
+#if defined(TARGET_S390X) || defined(TARGET_ALPHA)
     case TARGET_NR_select:
 #else
     case TARGET_NR__newselect:
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user,alpha: correct select()
  2013-01-07 22:38 [Qemu-devel] [PATCH] linux-user,alpha: correct select() Laurent Vivier
@ 2013-01-07 23:14 ` Richard Henderson
  2013-01-08  9:28   ` Laurent Vivier
  2013-01-10 21:30 ` [Qemu-devel] [PATCH][v2] " Laurent Vivier
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2013-01-07 23:14 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Riku Voipio, qemu-devel, dillona

On 01/07/2013 02:38 PM, Laurent Vivier wrote:
> -#if defined(TARGET_NR_select) && !defined(TARGET_S390X) && !defined(TARGET_S390)
> +#if defined(TARGET_NR_select) && !defined(TARGET_S390X) && \
> +                                 !defined(TARGET_S390) && \
> +                                 !defined(TARGET_ALPHA)
>      case TARGET_NR_select:
>          {
>              struct target_sel_arg_struct *sel;
> @@ -7189,8 +7191,9 @@ 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
> +#if defined(TARGET_NR__newselect) || defined(TARGET_S390X) \
> +                                  || defined(TARGET_ALPHA)
> +#if defined(TARGET_S390X) || defined(TARGET_ALPHA)
>      case TARGET_NR_select:
>  #else
>      case TARGET_NR__newselect:

I would much prefer to see these blocks moved around so that it's of the form

#if defined(TARGET_NR_select)
  case TARGET_NR_select:
# if defined(TARGET_ALPHA) || defined(TARGET_S390X)
    ret = do_select(arg1, arg2, arg3, arg4, arg5);
# else
    {
      other stuff
    }
# endif
    break;
#endif
#if defined(TARGET_NR__newselect)
  case TARGET_NR__newselect:
    ret = do_select(arg1, arg2, arg3, arg4, arg5);
    break;
#endif

I sincerely dislike sequences of defined and !defined that must be in sync.
Also note that there is no TARGET_S390, only TARGET_S390X.  We only emulate
the 64-bit guest.


r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user,alpha: correct select()
  2013-01-07 23:14 ` Richard Henderson
@ 2013-01-08  9:28   ` Laurent Vivier
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Vivier @ 2013-01-08  9:28 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Riku Voipio, qemu-devel, dillona

[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]


Le 8 janvier 2013 à 00:14, Richard Henderson <rth@twiddle.net> a écrit :
> On 01/07/2013 02:38 PM, Laurent Vivier wrote:
> > -#if defined(TARGET_NR_select) && !defined(TARGET_S390X) &&
> > !defined(TARGET_S390)
> > +#if defined(TARGET_NR_select) && !defined(TARGET_S390X) && \
> > + !defined(TARGET_S390) && \
> > + !defined(TARGET_ALPHA)
> > case TARGET_NR_select:
> > {
> > struct target_sel_arg_struct *sel;
> > @@ -7189,8 +7191,9 @@ 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
> > +#if defined(TARGET_NR__newselect) || defined(TARGET_S390X) \
> > + || defined(TARGET_ALPHA)
> > +#if defined(TARGET_S390X) || defined(TARGET_ALPHA)
> > case TARGET_NR_select:
> > #else
> > case TARGET_NR__newselect:
>
> I would much prefer to see these blocks moved around so that it's of the form
>
> #if defined(TARGET_NR_select)
> case TARGET_NR_select:
> # if defined(TARGET_ALPHA) || defined(TARGET_S390X)
> ret = do_select(arg1, arg2, arg3, arg4, arg5);
> # else
> {
> other stuff
> }
> # endif
> break;
> #endif
> #if defined(TARGET_NR__newselect)
> case TARGET_NR__newselect:
> ret = do_select(arg1, arg2, arg3, arg4, arg5);
> break;
> #endif
>
> I sincerely dislike sequences of defined and !defined that must be in sync.
> Also note that there is no TARGET_S390, only TARGET_S390X. We only emulate
> the 64-bit guest.
>

I agree with you, but I like to keep my patches as minimal as possible : I just
add the TARGET_ALPHA on the line.
If I'm able to test the TARGET_S390X, I will try to rewrite this patch as you
explain.

Regards,
Laurent

[-- Attachment #2: Type: text/html, Size: 3177 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH][v2] linux-user,alpha: correct select()
  2013-01-07 22:38 [Qemu-devel] [PATCH] linux-user,alpha: correct select() Laurent Vivier
  2013-01-07 23:14 ` Richard Henderson
@ 2013-01-10 21:30 ` Laurent Vivier
  2013-01-10 21:47   ` Richard Henderson
  1 sibling, 1 reply; 5+ messages in thread
From: Laurent Vivier @ 2013-01-10 21:30 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Riku Voipio, qemu-devel, Laurent Vivier

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
v2: remove unused TARGET_S390 and simplify ifdefs
 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.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH][v2] linux-user,alpha: correct select()
  2013-01-10 21:30 ` [Qemu-devel] [PATCH][v2] " Laurent Vivier
@ 2013-01-10 21:47   ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2013-01-10 21:47 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Riku Voipio, qemu-devel

On 01/10/2013 01:30 PM, Laurent Vivier wrote:
> Signed-off-by: Laurent Vivier<laurent@vivier.eu>
> ---
> v2: remove unused TARGET_S390 and simplify ifdefs
>   linux-user/syscall.c |   12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-10 21:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-07 22:38 [Qemu-devel] [PATCH] linux-user,alpha: correct select() Laurent Vivier
2013-01-07 23:14 ` Richard Henderson
2013-01-08  9:28   ` Laurent Vivier
2013-01-10 21:30 ` [Qemu-devel] [PATCH][v2] " Laurent Vivier
2013-01-10 21:47   ` Richard Henderson

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).