diff mbox

[v2,02/19] linux-user: Move handle_pending_signal() to avoid need for declaration

Message ID 1464360721-14359-3-git-send-email-peter.maydell@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Maydell May 27, 2016, 2:51 p.m. UTC
Move the handle_pending_signal() function above process_pending_signals()
to avoid the need for a forward declaration. (Whitespace only change.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 linux-user/signal.c | 44 +++++++++++++++++++++-----------------------
 1 file changed, 21 insertions(+), 23 deletions(-)

Comments

Laurent Vivier June 6, 2016, 9:42 p.m. UTC | #1
Le 27/05/2016 à 16:51, Peter Maydell a écrit :
> Move the handle_pending_signal() function above process_pending_signals()
> to avoid the need for a forward declaration. (Whitespace only change.)
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

> ---
>  linux-user/signal.c | 44 +++++++++++++++++++++-----------------------
>  1 file changed, 21 insertions(+), 23 deletions(-)
> 
> diff --git a/linux-user/signal.c b/linux-user/signal.c
> index a9ac491..5f98c71 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -5765,29 +5765,6 @@ long do_rt_sigreturn(CPUArchState *env)
>  
>  #endif
>  
> -static void handle_pending_signal(CPUArchState *cpu_env, int sig);
> -
> -void process_pending_signals(CPUArchState *cpu_env)
> -{
> -    CPUState *cpu = ENV_GET_CPU(cpu_env);
> -    int sig;
> -    TaskState *ts = cpu->opaque;
> -
> -    if (!ts->signal_pending)
> -        return;
> -
> -    /* FIXME: This is not threadsafe.  */
> -    for(sig = 1; sig <= TARGET_NSIG; sig++) {
> -        if (ts->sigtab[sig - 1].pending) {
> -            handle_pending_signal(cpu_env, sig);
> -            return;
> -        }
> -    }
> -    /* if no signal is pending, just return */
> -    ts->signal_pending = 0;
> -    return;
> -}
> -
>  static void handle_pending_signal(CPUArchState *cpu_env, int sig)
>  {
>      CPUState *cpu = ENV_GET_CPU(cpu_env);
> @@ -5876,3 +5853,24 @@ static void handle_pending_signal(CPUArchState *cpu_env, int sig)
>      if (q != &k->info)
>          free_sigqueue(cpu_env, q);
>  }
> +
> +void process_pending_signals(CPUArchState *cpu_env)
> +{
> +    CPUState *cpu = ENV_GET_CPU(cpu_env);
> +    int sig;
> +    TaskState *ts = cpu->opaque;
> +
> +    if (!ts->signal_pending)
> +        return;
> +
> +    /* FIXME: This is not threadsafe.  */
> +    for(sig = 1; sig <= TARGET_NSIG; sig++) {
> +        if (ts->sigtab[sig - 1].pending) {
> +            handle_pending_signal(cpu_env, sig);
> +            return;
> +        }
> +    }
> +    /* if no signal is pending, just return */
> +    ts->signal_pending = 0;
> +    return;
> +}
>
diff mbox

Patch

diff --git a/linux-user/signal.c b/linux-user/signal.c
index a9ac491..5f98c71 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -5765,29 +5765,6 @@  long do_rt_sigreturn(CPUArchState *env)
 
 #endif
 
-static void handle_pending_signal(CPUArchState *cpu_env, int sig);
-
-void process_pending_signals(CPUArchState *cpu_env)
-{
-    CPUState *cpu = ENV_GET_CPU(cpu_env);
-    int sig;
-    TaskState *ts = cpu->opaque;
-
-    if (!ts->signal_pending)
-        return;
-
-    /* FIXME: This is not threadsafe.  */
-    for(sig = 1; sig <= TARGET_NSIG; sig++) {
-        if (ts->sigtab[sig - 1].pending) {
-            handle_pending_signal(cpu_env, sig);
-            return;
-        }
-    }
-    /* if no signal is pending, just return */
-    ts->signal_pending = 0;
-    return;
-}
-
 static void handle_pending_signal(CPUArchState *cpu_env, int sig)
 {
     CPUState *cpu = ENV_GET_CPU(cpu_env);
@@ -5876,3 +5853,24 @@  static void handle_pending_signal(CPUArchState *cpu_env, int sig)
     if (q != &k->info)
         free_sigqueue(cpu_env, q);
 }
+
+void process_pending_signals(CPUArchState *cpu_env)
+{
+    CPUState *cpu = ENV_GET_CPU(cpu_env);
+    int sig;
+    TaskState *ts = cpu->opaque;
+
+    if (!ts->signal_pending)
+        return;
+
+    /* FIXME: This is not threadsafe.  */
+    for(sig = 1; sig <= TARGET_NSIG; sig++) {
+        if (ts->sigtab[sig - 1].pending) {
+            handle_pending_signal(cpu_env, sig);
+            return;
+        }
+    }
+    /* if no signal is pending, just return */
+    ts->signal_pending = 0;
+    return;
+}