From patchwork Tue Jul 30 07:23:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 1966361 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gjlay.de header.i=@gjlay.de header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=AeU7MmVv; dkim=fail reason="signature verification failed" header.d=gjlay.de header.i=@gjlay.de header.a=ed25519-sha256 header.s=strato-dkim-0003 header.b=xhB+Kgn4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WY6CV1VCrz1ybX for ; Tue, 30 Jul 2024 17:23:33 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 12A0E3858410 for ; Tue, 30 Jul 2024 07:23:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.23]) by sourceware.org (Postfix) with ESMTPS id C1D8A3858C56 for ; Tue, 30 Jul 2024 07:23:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C1D8A3858C56 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gjlay.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=gjlay.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C1D8A3858C56 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=85.215.255.23 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722324192; cv=pass; b=qV1edDDfg8FQxVo1MvSkgYOTmSI5K8ofBMoKWNkLa7cnbKbRx5s/XWcub2/C7RO3ksrxFDSHAOXcPPh/hqAeiv2p54ul9bx0oZ0eM1q+793pF45hFW8BoN07wmW2uFvaaK3xbn8XOf3tKPpFKCcaE1wp6Bmjh4u0rvPTJabXEec= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722324192; c=relaxed/simple; bh=IN0maCc06NS7CC/Ft1z3EqJWgmoXuqhoyOYRa2bIf6Y=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version:From: To:Subject; b=xlHcINCT2pFW2uvDFFzVHTAAf1WiWBg4Ux0AK50vtVQxGgOJ0rkuBZmf0DpqAcqf/qqbieRjlCqt5dWvKxYx9f6jLIyCsED77u9nsqaRWf5VKbrRsiPiyMkxl439xMLbxxS0dVAFcYncoEmx19DwTNTWaimZwnLHXGHaS9wZxqw= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1722324189; cv=none; d=strato.com; s=strato-dkim-0002; b=EryyFhecdU+3OehBmpCPxX6GKDtcD7pjeyWgAvrC8r+T2svT5QmV00nI+W0fG3VxG5 MzCcICHqIkF05Xq895e27W99I4JFq+tiRT6HHEqSq69/EKatcTZTgx813LUE5+mDO9e1 swaeXHS0Pm9Vc9oW3okN4wpuyx1+F0vz4EPpymA7KhQUCdXkXHQRr4eKVwYjN6Z1u0WK 5sLMgIuwaU1IxY+xOD01pEIY4+l2tshWRUPZGI0yT8gH6B9xAqFksvNxrSyWyjpZKcGk QmigjJT4PQSaE9IvoG9uOEAYpxqzZ+Se8ek6DIihUtbs10YTlvXbZdVcdIY9M6JU+scK SyHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1722324189; s=strato-dkim-0002; d=strato.com; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=MkPB8n1S+ShnJ0M2cuFdRPydd3JfcPezj1xmwPEhhsk=; b=kcnnOw7XbZLYoEQDa8ZuEOnDioYDX7q0077+D8t3hPqxrO6fRqyrb+nQlBQFcy+z73 xhmAP6kJ5UMgjRXhksvH++tzJXhEwvtnzEJ/NhqLAkZ58lcaKJ7nFAWzKtpRu2iA0Xnv ww+mT9aijuzHp48VE9iCgjd9ufyxCTi9XlD+hOldL4SKWAQgcDD6aM/SJhrmDBSR2KxF /RzT7pwOQD+x+jvJFVlt9T821uKFkq1tBblPm5t4h1bLtD9ZnLYmPicUVSuKS0r50I+7 RKytKML5B8neW+rdoBX/DaiXxXoKz0rhN8O54jBKfz4fJmT3W71jFsw9vzqwYYGZK1YX yQPw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1722324189; s=strato-dkim-0002; d=gjlay.de; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=MkPB8n1S+ShnJ0M2cuFdRPydd3JfcPezj1xmwPEhhsk=; b=AeU7MmVvk1HAGT6cTd+Z8gV+zX36ea82fdAFSfqkBM6YxgacSVTVF8bqoIWAGn5iXO M41FO6h+5N4B1AzTNA9w/GriUkfU+gLJ79t71tlcHWM7Mez7QNCNrrFJfu457f8M+yBc j4Y2u6d8/KDObxd2XecvCUCh3JXuLuM0vrGkOtjhiNAF6S6WOtsouVDNEKp9B4iwAoHi +F4/xyjIC8sfUmRzwko3hw30QHfSqMnbpySaBuEN69oxMl3CJXbI3IyKzOjP2429tqnV kv2OjIpIlmdj7zgcwQLypFN4Sgn4IqKVxSEWnbwZDIkuErb4yo8PCNhp5WgIKuZWKm+t zV6g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1722324189; s=strato-dkim-0003; d=gjlay.de; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=MkPB8n1S+ShnJ0M2cuFdRPydd3JfcPezj1xmwPEhhsk=; b=xhB+Kgn4KQVtDEj42RCHP9Wriki72W7MNta8bgyf1wiV3RuFplIXqlbbKWFyAtT1kt 41ruPltb73RoHIVvugBw== X-RZG-AUTH: ":LXoWVUeid/7A29J/hMvvT3koxZnKXKoq0dKoR0vUoSQvrBElHrlQxKVE" Received: from [192.168.2.102] by smtp.strato.de (RZmta 51.1.0 DYNA|AUTH) with ESMTPSA id xa21ea06U7N94QQ (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Tue, 30 Jul 2024 09:23:09 +0200 (CEST) Message-ID: Date: Tue, 30 Jul 2024 09:23:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Georg-Johann Lay Content-Language: en-US To: "gcc-patches@gcc.gnu.org" Subject: [patch, avr, applied] Propose to use attribute signal(n) via AVR-LibC's ISR_N. X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Applied the following patchlet to the documentation. Johann --- AVR: Propose to use attribute signal(n) via AVR-LibC's ISR_N. gcc/ * doc/extend.texi (AVR Function Attributes): Propose to use attribute signal(n) via AVR-LibC's ISR_N from avr/interrupt.h diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 927aa24ab63..48b27ff9f39 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -5147,22 +5147,38 @@ the attribute, rather than providing the ISR name itself as the function name: @example __attribute__((signal(1))) -void my_handler (void) +static void my_handler (void) @{ // Code for __vector_1 @} +@end example -#include +Notice that the handler function needs not to be externally visible. +The recommended way to use these attributes is by means of the +@code{ISR_N} macro provided by @code{avr/interrupt.h} from +@w{@uref{https://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html,,AVR-LibC}}: + +@example +#include -__attribute__((__signal__(PCINT0_vect_num, PCINT1_vect_num))) -static void my_pcint0_1_handler (void) +ISR_N (PCINT0_vect_num) +static void my_pcint0_handler (void) @{ - // Code for PCINT0 and PCINT1 (__vector_3 and __vector_4 - // on ATmega328). + // Code +@} + +ISR_N (ADC_vect_num, ISR_NOBLOCK) +static void my_adc_handler (void) +@{ + // Code @} @end example -Notice that the handler function needs not to be externally visible. +@code{ISR_N} can be specified more than once, in which case several +interrupt vectors are pointing to the same handler function. This +is similar to the @code{ISR_ALIASOF} macro provided by AVR-LibC, but +without the overhead introduced by @code{ISR_ALIASOF}. + @cindex @code{noblock} function attribute, AVR @item noblock