From patchwork Mon May 17 18:13:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 440197 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1345883jac; Mon, 17 May 2021 11:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKg7r6KJyF8ObkC+MlYejZFlFVOUrFJQr3jzjrptDg8Eobr30CxxIkn++yKmq5AW3KPCta X-Received: by 2002:a05:6602:280d:: with SMTP id d13mr1136975ioe.90.1621276975274; Mon, 17 May 2021 11:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621276975; cv=none; d=google.com; s=arc-20160816; b=L0K3ADlC1RpG4HxIx9GW6ZtoTpJ21ouEWM+isNkPXDqVVruonoKyfhKjHUnWTLDcT1 i+jsZxgvINQKT2Agl/vtuC28DQWNBR1qS4GSt2aTgufJgS3UaXZzjUlx1VLuOgh3vFm/ ascGuGk022RkWN/qxaUk1knqyE6V+rOOe3lwVMrAh/AMCond7PUIXHci3w5QW34kpKU8 Vu/HoujbYSlQX53XwiMJcIo50o/QXvjuIWje8sujd1ItjwMMkcrzXg2fyVGnK/CTHRl7 EqlEx9kfH7IE9rcGMF6K5MzmBzU/YF9x9zcczopDsb4UoCB6L9XoQFN0KLzs45++kDKs Kvjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=RjmzNiqX/HTvl9sPUYpG2flxCzIiFrj0/u9nqI9FbRc=; b=UxU081IQcc+hmmPu6XWNJYe212lJJ2TmMwnK4hLBGv2looT+GbHB39KUzYQ13ApOmI p1q9fYkxOcqiEMFTRpFyzyx+gWROW15RgxK4vPxgWnFBRoWm8W71isLXqXGRz+UcmoG7 3WIaRF7QbseBYIdtxIllNifwayjjlqyZWhdpQZH/9iCEJtdaCoMsf+3rBxSOtzbbNUXo WzeXz5on1rBefWy2j9Nm2BW4JRxV4V4KDCFpVTBBntZSNhireLzL4cOcy+t7c1Cu6H/F ypQkao75hkpsE0fGcs8yFlapYZwiYJ99B407cz9HYFMH8xz0xOy/+D1ZIDJ//G/Ui19+ hblw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p5si19816454ilm.11.2021.05.17.11.42.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 11:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:34310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liiCc-0000vY-Oc for patch@linaro.org; Mon, 17 May 2021 14:42:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihla-0006Pz-U0 for qemu-devel@nongnu.org; Mon, 17 May 2021 14:14:58 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:34187) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihlM-0004RO-UG for qemu-devel@nongnu.org; Mon, 17 May 2021 14:14:58 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MZCKd-1lwCJr3Zrd-00VBPr; Mon, 17 May 2021 20:14:39 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 23/59] linux-user/sparc: Split out save_reg_win Date: Mon, 17 May 2021 20:13:48 +0200 Message-Id: <20210517181424.8093-24-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517181424.8093-1-laurent@vivier.eu> References: <20210517181424.8093-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:/teubC/BxMMR9XwAm+O8TAizN8KfXAWMqW2Zy0fVuntw+ggTZeX 9V3w5oE/cjhuUuD342oz8lgGtKFuYNKqri4i6jpf4lI2gfzz2G8d13kJOvZz+NFWB7V7NqB ESjpf8612ta73yJ/QbBZWSJdKzf8vhOH2rOhVBn+M3R7q3EnoIU7KqE7TGwGaYi8ppduMaO sEIfZc3l4BR+kLehfxfOg== X-UI-Out-Filterresults: notjunk:1; V03:K0:HsmHhJRLzRQ=:CGuDtYJ7SOyoWDnxE2cZtB MoZ/pVMUP1BPnYno58kTmJYNn8xiL5xEFDsDLoVuc8GG0NqR9xY9fhQKjhTfIkSbDDRjv20ij l2Yyokkqj3qDn1MzlZNYmmor6k5+9+meXSstz9HghA2/7/Vy47JD5adSCHk1yGyoxV3HdISYH bTPhG8CfkwRNofc5znMYf4TbXdUWLZiuPRrZAbq9mUlIIpqBH3eEkkJiT8k1inr1347EfwjIZ j/IZUwLZyxeeyKEPWZdaSbB+ROVGgp8C5JbOTWGcgv9rVnDfBWJ6fwocb+50EUoUjMcs+gsMB eB9vcClDi77oPAMOl510ogvSGlYwabyN7chZIBRDdoUxYoA6NLk3lIYLZLQ3WVmJpP69HWGMM WfOpy1RAyyfkzDnzzmz6DSIShWNyDj9q4dtYyyW8S/NL/+wq6CSiV0zPuQ5Qk5Da1T64F1TUc JqFxSU2/Mk4ewTv+xfueg7VKjd4mzUxou4kJOoQO71h1nkvDQFVSTpT5QAKxf2gwm/V1gyaTw 7iRSHDXSAxIXwb0zPWk+BE= Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20210426025334.1168495-17-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/signal.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) -- 2.31.1 diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 0d9305818f8c..69fee5a76a8b 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -150,6 +150,18 @@ static void restore_pt_regs(struct target_pt_regs *regs, CPUSPARCState *env) } } +static void save_reg_win(struct target_reg_window *win, CPUSPARCState *env) +{ + int i; + + for (i = 0; i < 8; i++) { + __put_user(env->regwptr[i + WREG_L0], &win->locals[i]); + } + for (i = 0; i < 8; i++) { + __put_user(env->regwptr[i + WREG_I0], &win->ins[i]); + } +} + #define NF_ALIGNEDSZ (((sizeof(struct target_signal_frame) + 7) & (~7))) void setup_frame(int sig, struct target_sigaction *ka, @@ -183,12 +195,7 @@ void setup_frame(int sig, struct target_sigaction *ka, __put_user(set->sig[i + 1], &sf->extramask[i]); } - for (i = 0; i < 8; i++) { - __put_user(env->regwptr[i + WREG_L0], &sf->ss.win.locals[i]); - } - for (i = 0; i < 8; i++) { - __put_user(env->regwptr[i + WREG_I0], &sf->ss.win.ins[i]); - } + save_reg_win(&sf->ss.win, env); /* 3. signal handler back-trampoline and parameters */ env->regwptr[WREG_SP] = sf_addr;