From patchwork Tue Feb 7 21:34:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 140019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 7BA99B71AA for ; Wed, 8 Feb 2012 08:34:30 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1329255271; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:To:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:User-Agent:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=xfDuhxYcY/taZ7oBSpBW0FAXcgM=; b=g94hAJ8P8oiJ7tf rjDA9IFAEYcBeRS3mKZQLIM9pqvvT0PwUCIk7f7DiSgwpZ0oUgWac18ipUiFcQMV soGFbti2HOMfNxXccXrVLd4dAmtRxqIwPs16W6xTO9lSJ81d1X9cch0+7RBH9sOz ZXuFIlfgKeB1M/7wZmLWwKKpVsO8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:To:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=WG32x4h+5WdG3RMrqUdH6URO0zzWjchoj5ABXG0chbNss7XCLJAo7IoRSdxp/2 YgzURcicZ6Ljf1Jlux5ucFr9QLJTzpIea3jT04ElIzw2samA6G7Anreci7/KD99W 0kR9VWg5R7ail8MhB7wFo6u1+mMykiS0rp9xoYnum0ZsA=; Received: (qmail 10844 invoked by alias); 7 Feb 2012 21:34:27 -0000 Received: (qmail 10626 invoked by uid 22791); 7 Feb 2012 21:34:25 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL, BAYES_40, MIME_QP_LONG_LINE X-Spam-Check-By: sourceware.org Received: from c60.cesmail.net (HELO c60.cesmail.net) (216.154.195.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Feb 2012 21:34:12 +0000 Received: from unknown (HELO epsilon2) ([192.168.1.60]) by c60.cesmail.net with ESMTP; 07 Feb 2012 16:34:11 -0500 Received: from host-92-29-217-66.as13285.net (host-92-29-217-66.as13285.net [92.29.217.66]) by webmail.spamcop.net (Horde MIME library) with HTTP; Tue, 07 Feb 2012 16:34:11 -0500 Message-ID: <20120207163411.70fbg1bfkg8k8ww8-nzlynne@webmail.spamcop.net> Date: Tue, 07 Feb 2012 16:34:11 -0500 From: Joern Rennecke To: gcc-patches@gcc.gnu.org Subject: RFA: Expand/update documentation on Epiphany interrupt attribute MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Tested by building 'info' for epiphany-elf, and by bootstrapping x86_64-unknown-linux-gnu . 2012-02-07 Jeremy Bennett Joern Rennecke * doc/extend.texi: Expand and update information on interrupt attribute for Epiphany. Index: doc/extend.texi =================================================================== --- doc/extend.texi (revision 183982) +++ doc/extend.texi (working copy) @@ -2727,7 +2727,8 @@ void bar (void) RL78, RX and Xstormy16 ports to indicate that the specified function is an interrupt handler. The compiler will generate function entry and exit sequences suitable for use in an interrupt handler when this attribute -is present. +is present. With Epiphany targets it may also generate a special section with +code to initialize the interrupt vector table. Note, interrupt handlers for the Blackfin, H8/300, H8/300H, H8S, MicroBlaze, and SH processors can be specified via the @code{interrupt_handler} attribute. @@ -2746,6 +2747,47 @@ void f () __attribute__ ((interrupt ("IR On ARMv7-M the interrupt type is ignored, and the attribute means the function may be called with a word aligned stack pointer. +On Epiphany targets one or more optional parameters may added like this: + +@smallexample +void __attribute__ ((interrupt ("dma0, dma1"))) universal_dma_handler (); +@end smallexample + +Permissible values for these parameters are: @w{@code{reset}}, +@w{@code{software_exception}}, @w{@code{page_miss}}, +@w{@code{timer0}}, @w{@code{timer1}}, @w{@code{message}}, +@w{@code{dma0}}, @w{@code{dma1}}, @w{@code{wand}} and @w{@code{swi}}. +Multiple parameters indicate that multiple entries in the interrupt +vector table should be initialized for this function. The +parameter(s) may be omitted entirely, in which case no interrupt +vector table entry will be provided. + +Note, on Epiphany targets, interrupts are enabled inside the function +unless the @code{disinterrupt} attribute is also specified. + +On Epiphany targets, you can also use the following attribute to +modify the behavior of an interrupt handler: +@table @code +@item forwarder_section +@cindex @code{forwarder_section} attribute +The interrupt handler may be in external memory which cannot be +reached by a branch instruction, so generate a local memory trampoline +to transfer control. The single parameter identifies the section where +the trampoline will be placed. +@end table + +The following examples are all valid uses of these attributes on +Epiphany targets: +@smallexample +void __attribute__ ((interrupt)) universal_handler (); +void __attribute__ ((interrupt ("dma1"))) dma1_handler (); +void __attribute__ ((interrupt ("dma0, dma1"))) universal_dma_handler (); +void __attribute__ ((interrupt ("timer0"), disinterrupt)) + fast_timer_handler (); +void __attribute__ ((interrupt ("dma0, dma1"), forwarder_section ("tramp"))) + external_dma_handler (); +@end smallexample + On MIPS targets, you can use the following attributes to modify the behavior of an interrupt handler: @table @code