From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1tgQNq-0005S1-39 for mharc-qemu-rust@gnu.org; Fri, 07 Feb 2025 10:35:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tgQKR-0008Dx-On for qemu-rust@nongnu.org; Fri, 07 Feb 2025 10:31:50 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tgQKD-00042w-UU for qemu-rust@nongnu.org; Fri, 07 Feb 2025 10:31:39 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-38db104d35eso1792024f8f.1 for ; Fri, 07 Feb 2025 07:31:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738942283; x=1739547083; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ss1s/z8UDnfCDTK92VTNTdO4MGHnAPeMCWUHdvvh61s=; b=nNMZDgnhuQajNYVVq558zMpeT6wnXeS/yqwKxgtG3MYBrNDn/sG1+zozdI/ayyzUFZ EuEq7Qh7stYMgyk2KcVByC1KGPQjadhB1QGzSSt1bxtDZynBJ6Kj8gLdjS+9pNdynlhh yXEL6t84aWrRmdo9bqUk3FDvO4/oB4kURd7Ub4iB0Yv8uONtp4fqzhZT/p2mu76epJPV EPyKGmRhTmeKMs58iVLx79nUZy/U746UIRSTnwwOvOOWy6W0AdJ4Wk2G2i6H5en0fjqG +pwj58/5H/sUFieGkcGTk8VqsqB344Ivai4FYGxYTpzQ39wg6CYQnK/ucLrhDAmsqaXq 9dqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738942283; x=1739547083; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ss1s/z8UDnfCDTK92VTNTdO4MGHnAPeMCWUHdvvh61s=; b=jIWIAsXclr/VITBPpUHMI+LBkBM1toNLZERT2leDsLyYVvfvkizV2CCDOOo9IPa2kq +09ikx9/i9TFA8pvEMGG9puK5p07RTVJI7lZ+REiwr/V8GwcclPNIPEOg+QGJ4LKjlSA zVE12ixe7mtrGEimKtfltOcDBUN49Mbn5JEeyI8jcEL6WulwRRPwhtkXipRs/0UkCmRr RlpG1a5h4/hXEdH1zFcZV+ZIspsngc4my20eouGD3QjkbmAjHyC9wc7I0BqD1VXZqxm5 /EJZhpkDBcwJMIEsz72PtdTji4EP7zrZH3adZ+KTAvltULrGYV3Tjjvd8qaJObH12RhZ I0cg== X-Forwarded-Encrypted: i=1; AJvYcCUt5JFziG3ZrbzYpdPtswhnxc9iT9tEBp3p8MTphZWxu7L2LquO9o21G0Y2qsNoNWzDhSuSHQHKf7Q=@nongnu.org X-Gm-Message-State: AOJu0YwAGwIvqfaR8P8k7Ukv15aeG/VNMpLNkw6bUXA3GFqKLOrUhuzI ndzcS2kq3+P1lwKlw3ajuCfEdxggY3UF9qhTYa87+gI5BzyYFVQhdf6Pddd4Wq4= X-Gm-Gg: ASbGncsDW5LcD9JwRtz7T4LpYH93Zyqpp0VYXVN61jjSh1PxtdWX4nTJrE50BJw1b/y sJ/nQ2cEFAv8Q/tLh8I8osmCgOKCgCFDGwgV2K5WLZMnre5MQ2/nnfERefPMoUmCFfKmaLL1sX4 eTy6yMoRBGiCEeirh6s+NjAv10xBFl6IbVSyvEX+sEuaRt4xDFugwcSCxkbnx5kGM+H759GQLow kyKtcv39NtuNHPaEomvORUTvFiHCYVEYXTI8WGpIlJWIfWNDVZYbtFXgWSf0sINdXe8E8kooIBi qG7/qH1dZHaBbfjB1A== X-Google-Smtp-Source: AGHT+IG2SX5Q4KH4eRUVjOQ+1iALf4yNIx/St/braMTwifGpTyevkQkBwosEMcyUpLup4bcyJ/NyEA== X-Received: by 2002:a5d:584b:0:b0:38b:e32a:109f with SMTP id ffacd0b85a97d-38dc8dbfc57mr2993423f8f.12.1738942283500; Fri, 07 Feb 2025 07:31:23 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab779832909sm246283066b.49.2025.02.07.07.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 07:31:18 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 7F319609FC; Fri, 7 Feb 2025 15:31:13 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Xu , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Weiwei Li , qemu-arm@nongnu.org, Nicholas Piggin , Liu Zhiwei , Bin Meng , Tyrone Ting , Hao Wu , Kyle Evans , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Riku Voipio , Harsh Prateek Bora , Fabiano Rosas , Alexandre Iooss , Laurent Vivier , Daniel Henrique Barboza , Warner Losh , Pierrick Bouvier , Palmer Dabbelt , Mahmoud Mandour , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-rust@nongnu.org, qemu-riscv@nongnu.org, Ilya Leoshkevich , Richard Henderson Subject: [PATCH v2 12/17] user: Introduce user/signal.h Date: Fri, 7 Feb 2025 15:31:07 +0000 Message-Id: <20250207153112.3939799-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250207153112.3939799-1-alex.bennee@linaro.org> References: <20250207153112.3939799-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-rust@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: QEMU Rust-related patches and discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2025 15:31:58 -0000 From: Ilya Leoshkevich gdbstub needs target_to_host_signal(), so move its declaration to a public header. Reviewed-by: Richard Henderson Reviewed-by: Warner Losh Signed-off-by: Ilya Leoshkevich Message-Id: <20250117001542.8290-4-iii@linux.ibm.com> Signed-off-by: Alex Bennée --- bsd-user/signal-common.h | 1 - include/user/signal.h | 23 +++++++++++++++++++++++ linux-user/signal-common.h | 1 - bsd-user/signal.c | 1 + linux-user/signal.c | 1 + linux-user/syscall.c | 1 + 6 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 include/user/signal.h diff --git a/bsd-user/signal-common.h b/bsd-user/signal-common.h index 77d7c7a78b..4e634e04a3 100644 --- a/bsd-user/signal-common.h +++ b/bsd-user/signal-common.h @@ -42,7 +42,6 @@ void process_pending_signals(CPUArchState *env); void queue_signal(CPUArchState *env, int sig, int si_type, target_siginfo_t *info); void signal_init(void); -int target_to_host_signal(int sig); void target_to_host_sigset(sigset_t *d, const target_sigset_t *s); /* diff --git a/include/user/signal.h b/include/user/signal.h new file mode 100644 index 0000000000..19b6b9e5dd --- /dev/null +++ b/include/user/signal.h @@ -0,0 +1,23 @@ +/* + * Signal-related declarations. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef USER_SIGNAL_H +#define USER_SIGNAL_H + +#ifndef CONFIG_USER_ONLY +#error Cannot include this header from system emulation +#endif + +/** + * target_to_host_signal: + * @sig: target signal. + * + * On success, return the host signal between 0 (inclusive) and NSIG + * (exclusive) corresponding to the target signal @sig. Return any other value + * on failure. + */ +int target_to_host_signal(int sig); + +#endif diff --git a/linux-user/signal-common.h b/linux-user/signal-common.h index 8584d9ecc2..196d2406f8 100644 --- a/linux-user/signal-common.h +++ b/linux-user/signal-common.h @@ -61,7 +61,6 @@ void queue_signal(CPUArchState *env, int sig, int si_type, target_siginfo_t *info); void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info); void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tinfo); -int target_to_host_signal(int sig); int host_to_target_signal(int sig); long do_sigreturn(CPUArchState *env); long do_rt_sigreturn(CPUArchState *env); diff --git a/bsd-user/signal.c b/bsd-user/signal.c index b4e1458237..8c51f6ce65 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -24,6 +24,7 @@ #include "user/cpu_loop.h" #include "exec/page-protection.h" #include "user/page-protection.h" +#include "user/signal.h" #include "user/tswap-target.h" #include "gdbstub/user.h" #include "signal-common.h" diff --git a/linux-user/signal.c b/linux-user/signal.c index 087c4d270e..bffbef235c 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -36,6 +36,7 @@ #include "user/cpu_loop.h" #include "user/page-protection.h" #include "user/safe-syscall.h" +#include "user/signal.h" #include "tcg/tcg.h" /* target_siginfo_t must fit in gdbstub's siginfo save area. */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6ee02383da..90afaa4426 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -138,6 +138,7 @@ #include "user-mmap.h" #include "user/page-protection.h" #include "user/safe-syscall.h" +#include "user/signal.h" #include "qemu/guest-random.h" #include "qemu/selfmap.h" #include "user/syscall-trace.h" -- 2.39.5