From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:ac8:66c6:: with SMTP id m6mr18266660qtp.25.1587415902308; Mon, 20 Apr 2020 13:51:42 -0700 (PDT) X-Received: by 2002:a9d:740d:: with SMTP id n13mr10968707otk.114.1587415902078; Mon, 20 Apr 2020 13:51:42 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 20 Apr 2020 13:51:41 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=70.109.61.2; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.2 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: How to emulate multiple exports From: Jere Injection-Date: Mon, 20 Apr 2020 20:51:42 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58439 Date: 2020-04-20T13:51:41-07:00 List-Id: On Monday, April 20, 2020 at 2:52:55 AM UTC-4, Jeffrey R. Carter wrote: > On 4/20/20 1:53 AM, Jere wrote: > > I am working in a space constrained environment (256k flash) > > and I want to try and reuse the same exported function for > > all of my unused interrupt handlers. > > > > procedure Default; > > procedure Default is > > begin > > -- Do some complex stuff; > > end Default; > > Interrupt handling in Ada is defined in ARM C.3 > (http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-C-3.html). The standard > way to use a single handler for multiple interrupts is to create the handler as > a library-level parameterless protected procedure with aspect Interrupt_Handler > set to True. At elaboration, calls to Ada.Interrupts.Attach_Handler attach this > handler to multiple Interrupt_Ids. No Export is needed. > > GNAT is supposed to support Annex C for all targets, so I would expect this to > work with your setup. Perhaps there is something about your target that prevents > this approach, but this would be my initial approach to the problem. > > -- > Jeff Carter > "He that hath no beard is less than a man." > Much Ado About Nothing > 132 Unfortunately, the runtime I am using doesn't support protected types and the Ada standard doesn't really provide any support for interrupts in that arena that I can tell. A lot of this has to be done on a platform by platform basis, but I was hoping that there was a way to at least leverage Export as that was language defined.