From patchwork Fri Jul 29 17:21:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 594366 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp1540966maz; Fri, 29 Jul 2022 10:25:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u7mu5sovJbcAsTi536ReEFo+Y7qlhV0+j27EelooWcwP/rFP0Go4v4kSivp9iaopK7ffj9 X-Received: by 2002:a05:622a:1210:b0:31e:e139:a6d4 with SMTP id y16-20020a05622a121000b0031ee139a6d4mr4381975qtx.160.1659115533992; Fri, 29 Jul 2022 10:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659115533; cv=none; d=google.com; s=arc-20160816; b=euJSZDw5oI2l61nr6vTar+Y/BrOQ3PDrTUkfct7bvGtqvT7SHu5SfzrpqrBXh5GeLu tm7LTGkBTHT89dLZ4eAXjZCBT7FlhaTWMbh7KnWmcU2VyXzNEW62smiJLg/ER2UhLQx1 NKmspFXqrVRfyoHGuPeFGpfC3QY4Vi+XxO/O/SBML+2OYSp6dfk90i7vpvfu84JPB7lG AvPHDetyIK0SlIM5l+cNzc6C1nO40KDpfUSDZBvqlEAPuxcRY/YQNRj14fuWlu+fMAzP 0ya2RkunQ5qWaPnO7+Ls89eNJiDoovaMQy+l2abxh3/aTf9HOBUzEA7qhzE1v4TZppLF HBug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=A9GgmeiJQSr2xjaj5SsR3wBj4T3CMWdOAEf/FFOx6HQ=; b=BO+FlnlyBDTMGZx0OzSsc2XEneukIojWXTY1OZ0wraqTZ7ORU8x4RCI+GTWRkKGrb3 +5xEabSrjzwLdOGEaszCrT58c3dWlM9mjZ957FFt4BFwHHNQoAYMwX60HAjf4gsnbzif bmSuEth1yXfN/65i81mSCnxbSbB+rYoczzbRy/q3w8isOlbcUatl65zXivp55qncK9MN VmuIr1hFexel7A0mJrYA/TEel/ocRaszoyGxw4rLnMQJyWdGRTZhxObBs1X8LqT5C8R8 GnndmmQkLqG/tmNLcSAMHdnbILgRHIBhC1reT1AMH3ityxEf0rDrLFvlKyzxDX4z17pZ jXqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BEZjAcpA; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c10-20020a37e10a000000b006b48ac65a0csi2131543qkm.301.2022.07.29.10.25.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jul 2022 10:25:33 -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; dkim=pass header.i=@linaro.org header.s=google header.b=BEZjAcpA; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHTjx-0007NH-J5 for patch@linaro.org; Fri, 29 Jul 2022 13:25:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHTgL-0002pn-FR for qemu-devel@nongnu.org; Fri, 29 Jul 2022 13:21:50 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:35698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHTgH-0003nW-8f for qemu-devel@nongnu.org; Fri, 29 Jul 2022 13:21:48 -0400 Received: by mail-pj1-x102e.google.com with SMTP id a7-20020a17090a008700b001f325db8b90so4442404pja.0 for ; Fri, 29 Jul 2022 10:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A9GgmeiJQSr2xjaj5SsR3wBj4T3CMWdOAEf/FFOx6HQ=; b=BEZjAcpAfEOV9i1gp9Z3PVL1JV3gHV18ZnrHS8HlzIicrQ20cMbYxogeeQ74RHxhPW vIn4dKBPKtHio7S7/fd08UhSCA0jeF54Hbh5VtqxTS9l85SVgE5kLS/VEoHgXYIao4lq 2doI+X7FKpi9+a5BlgzFFRGx7FOT7nR+mvO4serkSRWVEADSO/VwdVl0MxOpccvwUik9 JdlPtm+9bDCcrJ9jxTPK8CB41fNeud0WpQTt4YkMBwilxpjsioVaYoEAuzval4Oo87Cx JCL49tHiWS8OPsx2xX1KeP3oV6MwLYsfTM0LFkhVD2agaugi8AnyRsFnJkh4/NU8cYUy 1R9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A9GgmeiJQSr2xjaj5SsR3wBj4T3CMWdOAEf/FFOx6HQ=; b=oPkLvGKW1+vYMJjiBHy9gO5MCz8ZvtihB29SAhKgrBRmuNklKTnM++cxj3tIreA+AV XaN+1OHnZWcrA31Sqh/FjOB9vc/fRAAch5jhGfEaQiu2QdX4rr5DcNjpPATCx9Z6fa1O Gg2RopLESdiSDCawMIP2mrzCJnh3NJJ4BwpZxKGuP2hnVg23EWNxKcJMUh6+qJk8r7fn 2qSB3JkptFguMHS5NihXMCdY2mKsEkdzG3zAZ18BwufKCwqExdY3NmEXfG5BD/+kmGhf zhSx6i/NfkPXcvet7WcUgmdyJrSCi9NL6gD+cS72Hqd6cDXhUzFFA8YzVjO2/hzxxoE+ 3BUg== X-Gm-Message-State: ACgBeo2TFTY0QLQ/LqN1IKY7z7w+TKhdAf4L+LP9fS50vx0t1OX1AQst Ln0BFuGVZpwy8ADinFM83/URbHP1c2EF0Q== X-Received: by 2002:a17:90a:8a8d:b0:1f3:155:3324 with SMTP id x13-20020a17090a8a8d00b001f301553324mr5117194pjn.89.1659115303917; Fri, 29 Jul 2022 10:21:43 -0700 (PDT) Received: from stoup.. ([2602:ae:1549:801:51c4:5cf0:5954:aeb6]) by smtp.gmail.com with ESMTPSA id d18-20020a170902aa9200b0016bb24f5d19sm3881039plr.209.2022.07.29.10.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jul 2022 10:21:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, qemu-ppc@nongnu.org, laurent@vivier.eu Subject: [PATCH 1/2] common-user/host/ppc: Implement safe-syscall.inc.S Date: Fri, 29 Jul 2022 10:21:40 -0700 Message-Id: <20220729172141.1789105-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220729172141.1789105-1-richard.henderson@linaro.org> References: <20220729172141.1789105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza --- common-user/host/ppc/safe-syscall.inc.S | 107 ++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 common-user/host/ppc/safe-syscall.inc.S diff --git a/common-user/host/ppc/safe-syscall.inc.S b/common-user/host/ppc/safe-syscall.inc.S new file mode 100644 index 0000000000..0851f6c0b8 --- /dev/null +++ b/common-user/host/ppc/safe-syscall.inc.S @@ -0,0 +1,107 @@ +/* + * safe-syscall.inc.S : host-specific assembly fragment + * to handle signals occurring at the same time as system calls. + * This is intended to be included by common-user/safe-syscall.S + * + * Copyright (C) 2022 Linaro, Ltd. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +/* + * Standardize on the _CALL_FOO symbols used by GCC: + * Apple XCode does not define _CALL_DARWIN. + * Clang defines _CALL_ELF (64-bit) but not _CALL_SYSV (32-bit). + */ +#if !defined(_CALL_SYSV) && \ + !defined(_CALL_DARWIN) && \ + !defined(_CALL_AIX) && \ + !defined(_CALL_ELF) +# if defined(__APPLE__) +# define _CALL_DARWIN +# elif defined(__ELF__) && TCG_TARGET_REG_BITS == 32 +# define _CALL_SYSV +# else +# error "Unknown ABI" +# endif +#endif + +#ifndef _CALL_SYSV +# error "Unsupported ABI" +#endif + + + .global safe_syscall_base + .global safe_syscall_start + .global safe_syscall_end + .type safe_syscall_base, @function + + .text + + /* + * This is the entry point for making a system call. The calling + * convention here is that of a C varargs function with the + * first argument an 'int *' to the signal_pending flag, the + * second one the system call number (as a 'long'), and all further + * arguments being syscall arguments (also 'long'). + */ +safe_syscall_base: + .cfi_startproc + stwu 1, -8(1) + .cfi_def_cfa_offset 8 + stw 30, 4(1) + .cfi_offset 30, -4 + + /* + * We enter with r3 == &signal_pending + * r4 == syscall number + * r5 ... r10 == syscall arguments + * and return the result in r3 + * and the syscall instruction needs + * r0 == syscall number + * r3 ... r8 == syscall arguments + * and returns the result in r3 + * Shuffle everything around appropriately. + */ + mr 30, 3 /* signal_pending */ + mr 0, 4 /* syscall number */ + mr 3, 5 /* syscall arguments */ + mr 4, 6 + mr 5, 7 + mr 6, 8 + mr 7, 9 + mr 8, 10 + + /* + * This next sequence of code works in conjunction with the + * rewind_if_safe_syscall_function(). If a signal is taken + * and the interrupted PC is anywhere between 'safe_syscall_start' + * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. + * The code sequence must therefore be able to cope with this, and + * the syscall instruction must be the final one in the sequence. + */ +safe_syscall_start: + /* if signal_pending is non-zero, don't do the call */ + lwz 12, 0(30) + cmpwi 0, 12, 0 + bne- 2f + sc +safe_syscall_end: + /* code path when we did execute the syscall */ + lwz 30, 4(1) /* restore r30 */ + addi 1, 1, 8 /* restore stack */ + .cfi_restore 30 + .cfi_def_cfa_offset 0 + bnslr+ /* return on success */ + b safe_syscall_set_errno_tail + + /* code path when we didn't execute the syscall */ +2: lwz 30, 4(1) + addi 1, 1, 8 + addi 3, 0, QEMU_ERESTARTSYS + b safe_syscall_set_errno_tail + + .cfi_endproc + + .size safe_syscall_base, .-safe_syscall_base From patchwork Fri Jul 29 17:21:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 594365 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp1539507maz; Fri, 29 Jul 2022 10:23:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1upde1GvSatvcDsOM73HJiQIsUVgU18IV0Q5JB0IdEaCy3TwgbhOnuVxOnpIysJJgLHtYAf X-Received: by 2002:a05:620a:4088:b0:6b6:1b34:d273 with SMTP id f8-20020a05620a408800b006b61b34d273mr3674443qko.706.1659115404894; Fri, 29 Jul 2022 10:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659115404; cv=none; d=google.com; s=arc-20160816; b=tktAMk7e4TJ9WdT2E1NAMcWCINDWd8KBPDzsREWlf0ed6Q7F+AiEUBju//VXiEpww/ rzsbu9zP1eaEsa0h82b5JfT5Q47rfwAL/9rXf3eq0MzeSeiAnkdR1LUYmOEGJTx4Pf3w SEi/OpAnCXwh8dwcrrRfHdOsZt06q68p06wd5FZh0bjezMIHMnhPpj6KY6XZJWqsiAEK HbYKkfDepdXsbe4GX0CKuGPqn49nKlZYlvZkhHuTfVwIHw0QS4msuyLd/KfvylL0qr34 kyUuIkygmLsv4mmcfmQv7ykDqfl0lJTBHvP6YBkaleh4OhF4yzqOcSq96PkbyL5xPa+p WC4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=0q4lynJszics53xcZKYUS9IEsGSast3cy0Ggpgs4xg4=; b=fViGMb28dGwhr7XNgZBZYynkp+aS9eMf7KXnlUGidtEr93gX3Vj9AqNKmS4E3EQulw cBfyOcUnlky5KMu8Hxw24brT43H41HeGvUT0iVK+pK196jGFINY/yhcvFqGOv3FZkavy skTOF4P9oxmvqT+45hM2VJgboBlvOHK6ueTUuqEBvTWr/7AU0nEvwb/Hl9z/1msAaj6q /nfLPX8R2B0GV9jQM6kVVuNkr2v4e9FZaVodIhI5ZgpVgs47nBBGsyLYEWPjMiuKoxeR zIjoOy6Iy7aISLUnCFiPF/U4UbhIc+KS+MJdGrNnjgJuTUqrGJzxqy4WZ75+wkonwm7N ux2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rt0qJ1Xj; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t4-20020ad45bc4000000b00474991e37d3si577933qvt.74.2022.07.29.10.23.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jul 2022 10:23:24 -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; dkim=pass header.i=@linaro.org header.s=google header.b=rt0qJ1Xj; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHThr-0003Wz-2h for patch@linaro.org; Fri, 29 Jul 2022 13:23:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHTgM-0002pq-C4 for qemu-devel@nongnu.org; Fri, 29 Jul 2022 13:21:50 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:34415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHTgJ-0003nm-FP for qemu-devel@nongnu.org; Fri, 29 Jul 2022 13:21:49 -0400 Received: by mail-pl1-x632.google.com with SMTP id z19so5190057plb.1 for ; Fri, 29 Jul 2022 10:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0q4lynJszics53xcZKYUS9IEsGSast3cy0Ggpgs4xg4=; b=rt0qJ1Xj3xiS3VZPwZe413MA0FzWOr8P+yzdbdX/mhWGiRaoS907oCWvpH9mUcDQve nm2YkLen9Unm4jTHLYERCK/JpNeqW/j/f0ZTbuKkG3PHrPEz7FJefowONfRkV95x8ALx PSzVt4CXioxGHwc05UIzWSNbkk3iFE1iK3J4IRNzu4AEQYVkJMmHXnEFQC9SqVcsa5DP ROV3X4zQcFNrPp3LZVYqZtR+fotr9Q2bNNQhq7QrvPA/9cPYMXtvm6ML1L52SaoDc1W1 CApwoQLhZecYVfvj+bAFBg39TOhSmQjlH9UQRv0l/zFOmT3Vxj/DTi7Z2Kk/otlKAJQS Ogsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0q4lynJszics53xcZKYUS9IEsGSast3cy0Ggpgs4xg4=; b=VnM3K1KA/NGNqneG3iHk2A6bdy3Xlsn7A5pdkesfaRKIneRcOt+iZgZ6Ex0RRdK1sh 9OHodzlb3l8SpxdkVKpKPS2+sjZatEKRGKdp/J2QYK2i8lSdaZDHRggxkRBL0g7vR3DA uGA22mGeDpzDkccFy4GojHuYW78Ul6Y8xutPNbEnrqtyKf9ehgBp6RNQRrQ+Es2idB9w WSPOwx7JRWzWnbcYPFCGpuOLg9q4e0EBkisjP5qwvC4cCQYoPptSHYEDPcM+9zsScDsX X/25OVQ4oZ64Xcj++FElvFWzWlQv/Aw51ybD3GOI98GSPYcLQWRIznZMETVcguZ+jpCL nXrw== X-Gm-Message-State: ACgBeo00NJ0z0JNeNpBDArVdA0r707YZMIFJfxSkbNR6MvcR52gcpl5x IQwFxxIz6K7IErtelxswmP0pu+QqH4yAHA== X-Received: by 2002:a17:90a:1c01:b0:1f1:bf54:67ff with SMTP id s1-20020a17090a1c0100b001f1bf5467ffmr5782119pjs.172.1659115306036; Fri, 29 Jul 2022 10:21:46 -0700 (PDT) Received: from stoup.. ([2602:ae:1549:801:51c4:5cf0:5954:aeb6]) by smtp.gmail.com with ESMTPSA id d18-20020a170902aa9200b0016bb24f5d19sm3881039plr.209.2022.07.29.10.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jul 2022 10:21:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, qemu-ppc@nongnu.org, laurent@vivier.eu Subject: [PATCH 2/2] linux-user: Implment host/ppc/host-signal.h Date: Fri, 29 Jul 2022 10:21:41 -0700 Message-Id: <20220729172141.1789105-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220729172141.1789105-1-richard.henderson@linaro.org> References: <20220729172141.1789105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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" This commit re-enables ppc32 as a linux-user host, as existance of the directory is noted by configure. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1097 Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza --- linux-user/include/host/ppc/host-signal.h | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 linux-user/include/host/ppc/host-signal.h diff --git a/linux-user/include/host/ppc/host-signal.h b/linux-user/include/host/ppc/host-signal.h new file mode 100644 index 0000000000..de25c803f5 --- /dev/null +++ b/linux-user/include/host/ppc/host-signal.h @@ -0,0 +1,39 @@ +/* + * host-signal.h: signal info dependent on the host architecture + * + * Copyright (c) 2022 Linaro Ltd. + * + * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef PPC_HOST_SIGNAL_H +#define PPC_HOST_SIGNAL_H + +#include + +/* The third argument to a SA_SIGINFO handler is ucontext_t. */ +typedef ucontext_t host_sigcontext; + +static inline uintptr_t host_signal_pc(host_sigcontext *uc) +{ + return uc->uc_mcontext.regs->nip; +} + +static inline void host_signal_set_pc(host_sigcontext *uc, uintptr_t pc) +{ + uc->uc_mcontext.regs->nip = pc; +} + +static inline void *host_signal_mask(host_sigcontext *uc) +{ + return &uc->uc_sigmask; +} + +static inline bool host_signal_write(siginfo_t *info, host_sigcontext *uc) +{ + return uc->uc_mcontext.regs->trap != 0x400 + && (uc->uc_mcontext.regs->dsisr & 0x02000000); +} + +#endif