From patchwork Tue Sep 21 15:26:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 1530783 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=K3sx2z4/; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HDQcV5LVBz9sSn for ; Wed, 22 Sep 2021 01:40:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 882F5385B83F for ; Tue, 21 Sep 2021 15:40:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 54D0A3857C4B for ; Tue, 21 Sep 2021 15:26:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 54D0A3857C4B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x42b.google.com with SMTP id g16so40344210wrb.3 for ; Tue, 21 Sep 2021 08:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=W3YAbyCNRvkgArRhB1NZzNrzqqRVfNoCtdrJPncYdII=; b=K3sx2z4/gbJ+qIOMwbKPvMt/6zpqFJfDg1pQi8ol4/n919+6H4s6iNvL8UGh00kYPY dt5S9tqOMMHwOhmlIGoNAB2VRMN401jIn/UZtumWQ4wax6vM7sgHac7GiyTQiYBdoVsn 9+t6gjlLaonlYuc/b9hdKBjaJaxOJUs5bwfBuIHP6NXw/QctDa3/uJhBbIXOtXQhFfwl xbMsCt4P1VJ0i/BfLRUQOSN4O8ekImkNXeNqDkwIqkmSbN6LMbSC3ZsSrojd/Y97fl/X HNB1sluoCIUboij+XjBc12sHkicW9aePc/6ORQRjRtEr6kEUjj5zd4k0DTzqtU6Mfa0C NWZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=W3YAbyCNRvkgArRhB1NZzNrzqqRVfNoCtdrJPncYdII=; b=GzF9AZWbeSXIPmTT78p4NvX41xOTy+jasknsAIca2fNQhErTeM+nVx/9Rj2UeY72Zb Obq8LkwbkaoOaS9Z9WO/JyhSe66Cn+LJzCbN8hTfei9PQI8JA0UvvvDGgZJ4ei8SbyQm 4gKLhOAo7eLbkUyZPt0Ex3S/9X2icorOD2WSlKk4wN4Hhp9jbB6FZibRdvkAUELHnWih 8ErEJAvY/MLw2r6pzWuWC1YOygMTxT965LHztmCcnN0Srql6m47og2R3izwEhBFw0wfn SNHprLhialwBUyMi7yIEa0j9aaUrDheDuVR8ZM0/8klfLzKS2KVRu4qpzvYtpZXEFGUB 8b4w== X-Gm-Message-State: AOAM531HD5GI1ZqPaL3C/g/zU+MfldmLKGfd1m6Vaknj2phzBYxo15E7 EmsqP5kFFhHb40XrWTmQik/pk4RzrkI+WA== X-Google-Smtp-Source: ABdhPJx1M2t6cfLn3R60PS3sN3ExQBmKNe3TWYxkuwL8ga6C6/dEMxs1PtQgL34lZG4snQjjQVD+Fg== X-Received: by 2002:a5d:6741:: with SMTP id l1mr35987360wrw.289.1632237997245; Tue, 21 Sep 2021 08:26:37 -0700 (PDT) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id 20sm3581596wme.46.2021.09.21.08.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 08:26:36 -0700 (PDT) Date: Tue, 21 Sep 2021 15:26:36 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Subject: [Ada] Add some comments in init.c about the lynx178 signal handler Message-ID: <20210921152636.GA3094985@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doug Rupp Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" __gnat_error_handler for LynxOS in init.c only accepts a "sig" argument. Add some comments to explain why, and how to fix it with a change to a kernel build parameter. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * init.c (__gnat_error_handler) [LynxOS]: Add a comment about missing optional args. diff --git a/gcc/ada/init.c b/gcc/ada/init.c --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -661,6 +661,28 @@ __gnat_install_handler (void) #include #include +/* SA_SIGINFO is not supported by default on LynxOS, so all we have + available here is the "sig" argument. On newer LynxOS versions it's + possible to support SA_SIGINFO by setting a kernel configuration macro. + + To wit: + + #define NONPOSIX_SA_HANDLER_PROTO (0) + + This macro must be set to 1 in either sys/bsp./uparam.h + or in the associated uparam.h customization file sys/bsp./xparam.h + (uparam.h includes xparam.h for customization) + + The NONPOSIX_SA_HANDLER_PROTO macro makes it possible to provide + signal-catching function with 'info' and 'context' input parameters + even if SA_SIGINFO flag is not set or it is set for a non-realtime signal. + + It also allows signal-catching function to update thread context even + if SA_UPDATECTX flag is not set. + + This would be useful, but relying on that would transmit the requirement + to users to configure that feature as well, which is undesirable. */ + static void __gnat_error_handler (int sig) {