From patchwork Fri Jun 6 09:46:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31464 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5F7A1203C3 for ; Fri, 6 Jun 2014 09:48:23 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wo20sf10782453obc.3 for ; Fri, 06 Jun 2014 02:48:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=nvDFVtb0NIrmNF/DewOJfzTYKWgOEmC160BC2bArC/E=; b=eElMi4xjpftzn2WkYwr6+fjKXFbh1nNTPTDdbEilgfwArgv8D5z6+P6G8OotuIAgpM Xfk9m+/ittrxAsSKUmLDQ3V3qTcaFKrO871ZiHWp2wxmVZ6wTNUqotJc3XCkrjnnZmfB T5on8j3rbWhXTOdfIcggsrmgb5AHcSNN9npZSt1QqdQwAK+/UZEK+c7xJl3mCKv6J4KF TxZCmBI56d86HDttJxDdNgC5SNs3Og+Uhleu/r0730yAJTXidbTLZfp5fWz04qAqjM1b oC6kpaDWufGP2roTFT/6awAQH3/jfdAXL1Du7BddM7A5EKUC+hUzJqXI+Be3EjmRgdCt wtRA== X-Gm-Message-State: ALoCoQmyWfgII8Pgw5Xd4jU7/wrNE/zPNoVqKz0xt1OxDOPJ/tIqT8/KeQV1nRmUEE9wwRotPFkM X-Received: by 10.182.79.41 with SMTP id g9mr1839281obx.41.1402048102109; Fri, 06 Jun 2014 02:48:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.201 with SMTP id z67ls641824qgd.94.gmail; Fri, 06 Jun 2014 02:48:22 -0700 (PDT) X-Received: by 10.58.100.202 with SMTP id fa10mr589605veb.79.1402048101981; Fri, 06 Jun 2014 02:48:21 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id oo9si5729277vec.88.2014.06.06.02.48.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Jun 2014 02:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id oz11so2775777veb.31 for ; Fri, 06 Jun 2014 02:48:21 -0700 (PDT) X-Received: by 10.52.25.130 with SMTP id c2mr2799669vdg.27.1402048101871; Fri, 06 Jun 2014 02:48:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp84222vcb; Fri, 6 Jun 2014 02:48:21 -0700 (PDT) X-Received: by 10.224.135.66 with SMTP id m2mr6625886qat.55.1402048101394; Fri, 06 Jun 2014 02:48:21 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i10si6068401qan.100.2014.06.06.02.48.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 06 Jun 2014 02:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:46175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsql2-0007lm-US for patch@linaro.org; Fri, 06 Jun 2014 05:48:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsqjq-0006Et-Kx for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:47:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wsqjl-0001Vu-KG for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:47:06 -0400 Received: from afflict.kos.to ([92.243.29.197]:38357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsqjl-0001Ua-95 for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:47:01 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 8192926543; Fri, 6 Jun 2014 11:46:59 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 6 Jun 2014 12:46:48 +0300 Message-Id: <1402048017-30604-5-git-send-email-riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH v2 04/13] signal/all: remove return value from setup_sigcontext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Riku Voipio Make all implementations of setup_sigcontext void and remove checking it's return value from functions calling setup_sigcontext. Signed-off-by: Riku Voipio --- linux-user/signal.c | 65 +++++++++++++++++------------------------------------ 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 0bf6213..421bd48 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -836,12 +836,11 @@ struct rt_sigframe */ /* XXX: save x87 state */ -static int -setup_sigcontext(struct target_sigcontext *sc, struct target_fpstate *fpstate, - CPUX86State *env, abi_ulong mask, abi_ulong fpstate_addr) +static void setup_sigcontext(struct target_sigcontext *sc, + struct target_fpstate *fpstate, CPUX86State *env, abi_ulong mask, + abi_ulong fpstate_addr) { CPUState *cs = CPU(x86_env_get_cpu(env)); - int err = 0; uint16_t magic; /* already locked in setup_frame() */ @@ -874,7 +873,6 @@ setup_sigcontext(struct target_sigcontext *sc, struct target_fpstate *fpstate, /* non-iBCS2 extensions.. */ __put_user(mask, &sc->oldmask); __put_user(env->cr[2], &sc->cr2); - return err; } /* @@ -994,9 +992,9 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, &frame->uc.tuc_stack.ss_flags); __put_user(target_sigaltstack_used.ss_size, &frame->uc.tuc_stack.ss_size); - err |= setup_sigcontext(&frame->uc.tuc_mcontext, &frame->fpstate, - env, set->sig[0], - frame_addr + offsetof(struct rt_sigframe, fpstate)); + setup_sigcontext(&frame->uc.tuc_mcontext, &frame->fpstate, env, + set->sig[0], frame_addr + offsetof(struct rt_sigframe, fpstate)); + for(i = 0; i < TARGET_NSIG_WORDS; i++) { if (__put_user(set->sig[i], &frame->uc.tuc_sigmask.sig[i])) goto give_sigsegv; @@ -2855,10 +2853,9 @@ static inline int install_sigtramp(unsigned int *tramp, unsigned int syscall) return err; } -static inline int -setup_sigcontext(CPUMIPSState *regs, struct target_sigcontext *sc) +static inline void setup_sigcontext(CPUMIPSState *regs, + struct target_sigcontext *sc) { - int err = 0; int i; __put_user(exception_resume_pc(regs), &sc->sc_pc); @@ -2890,8 +2887,6 @@ setup_sigcontext(CPUMIPSState *regs, struct target_sigcontext *sc) for (i = 0; i < 32; ++i) { __put_user(regs->active_fpu.fpr[i].d, &sc->sc_fpregs[i]); } - - return err; } static inline int @@ -2978,8 +2973,7 @@ static void setup_frame(int sig, struct target_sigaction * ka, install_sigtramp(frame->sf_code, TARGET_NR_sigreturn); - if(setup_sigcontext(regs, &frame->sf_sc)) - goto give_sigsegv; + setup_sigcontext(regs, &frame->sf_sc); for(i = 0; i < TARGET_NSIG_WORDS; i++) { if(__put_user(set->sig[i], &frame->sf_mask.sig[i])) @@ -3226,10 +3220,9 @@ static abi_ulong get_sigframe(struct target_sigaction *ka, return (sp - frame_size) & -8ul; } -static int setup_sigcontext(struct target_sigcontext *sc, +static void setup_sigcontext(struct target_sigcontext *sc, CPUSH4State *regs, unsigned long mask) { - int err = 0; int i; #define COPY(x) __put_user(regs->x, &sc->sc_##x) @@ -3254,8 +3247,6 @@ static int setup_sigcontext(struct target_sigcontext *sc, /* non-iBCS2 extensions.. */ __put_user(mask, &sc->oldmask); - - return err; } static int restore_sigcontext(CPUSH4State *regs, struct target_sigcontext *sc, @@ -3304,7 +3295,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, signal = current_exec_domain_sig(sig); - err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); + setup_sigcontext(&frame->sc, regs, set->sig[0]); for (i = 0; i < TARGET_NSIG_WORDS - 1; i++) { __put_user(set->sig[i + 1], &frame->extramask[i]); @@ -3954,11 +3945,10 @@ badframe: /* Set up a signal frame. */ -static int setup_sigcontext(struct target_sigcontext *sc, +static void setup_sigcontext(struct target_sigcontext *sc, CPUOpenRISCState *regs, unsigned long mask) { - int err = 0; unsigned long usp = regs->gpr[1]; /* copy the regs. they are first in sc so we can use sc directly */ @@ -3972,7 +3962,7 @@ static int setup_sigcontext(struct target_sigcontext *sc, /* then some other stuff */ __put_user(mask, &sc->oldmask); - __put_user(usp, &sc->usp); return err; + __put_user(usp, &sc->usp); } static inline unsigned long align_sigframe(unsigned long sp) @@ -4047,14 +4037,10 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, __put_user(sas_ss_flags(env->gpr[1]), &frame->uc.tuc_stack.ss_flags); __put_user(target_sigaltstack_used.ss_size, &frame->uc.tuc_stack.ss_size); - err |= setup_sigcontext(&frame->sc, env, set->sig[0]); + setup_sigcontext(&frame->sc, env, set->sig[0]); /*err |= copy_to_user(frame->uc.tuc_sigmask, set, sizeof(*set));*/ - if (err) { - goto give_sigsegv; - } - /* trampoline - the desired return ip is the retcode itself */ return_ip = (unsigned long)&frame->retcode; /* This is l.ori r11,r0,__NR_sigreturn, l.sys 1 */ @@ -5087,12 +5073,9 @@ struct target_rt_sigframe struct target_ucontext uc; }; -static int -setup_sigcontext(struct target_sigcontext *sc, CPUM68KState *env, - abi_ulong mask) +static void setup_sigcontext(struct target_sigcontext *sc, CPUM68KState *env, + abi_ulong mask) { - int err = 0; - __put_user(mask, &sc->sc_mask); __put_user(env->aregs[7], &sc->sc_usp); __put_user(env->dregs[0], &sc->sc_d0); @@ -5101,8 +5084,6 @@ setup_sigcontext(struct target_sigcontext *sc, CPUM68KState *env, __put_user(env->aregs[1], &sc->sc_a1); __put_user(env->sr, &sc->sc_sr); __put_user(env->pc, &sc->sc_pc); - - return err; } static int @@ -5162,9 +5143,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, sc_addr = frame_addr + offsetof(struct target_sigframe, sc); __put_user(sc_addr, &frame->psc); - err |= setup_sigcontext(&frame->sc, env, set->sig[0]); - if (err) - goto give_sigsegv; + setup_sigcontext(&frame->sc, env, set->sig[0]); for(i = 1; i < TARGET_NSIG_WORDS; i++) { if (__put_user(set->sig[i], &frame->extramask[i - 1])) @@ -5457,10 +5436,10 @@ struct target_rt_sigframe { #define INSN_LDI_R0 0x201f0000 #define INSN_CALLSYS 0x00000083 -static int setup_sigcontext(struct target_sigcontext *sc, CPUAlphaState *env, +static void setup_sigcontext(struct target_sigcontext *sc, CPUAlphaState *env, abi_ulong frame_addr, target_sigset_t *set) { - int i, err = 0; + int i; __put_user(on_sig_stack(frame_addr), &sc->sc_onstack); __put_user(set->sig[0], &sc->sc_mask); @@ -5481,8 +5460,6 @@ static int setup_sigcontext(struct target_sigcontext *sc, CPUAlphaState *env, __put_user(0, &sc->sc_traparg_a0); /* FIXME */ __put_user(0, &sc->sc_traparg_a1); /* FIXME */ __put_user(0, &sc->sc_traparg_a2); /* FIXME */ - - return err; } static int restore_sigcontext(CPUAlphaState *env, @@ -5531,7 +5508,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, goto give_sigsegv; } - err |= setup_sigcontext(&frame->sc, env, frame_addr, set); + setup_sigcontext(&frame->sc, env, frame_addr, set); if (ka->sa_restorer) { r26 = ka->sa_restorer; @@ -5586,7 +5563,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, &frame->uc.tuc_stack.ss_flags); __put_user(target_sigaltstack_used.ss_size, &frame->uc.tuc_stack.ss_size); - err |= setup_sigcontext(&frame->uc.tuc_mcontext, env, frame_addr, set); + setup_sigcontext(&frame->uc.tuc_mcontext, env, frame_addr, set); for (i = 0; i < TARGET_NSIG_WORDS; ++i) { __put_user(set->sig[i], &frame->uc.tuc_sigmask.sig[i]); }