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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fe5641bca012dada X-Google-Attributes: gid103376,public From: matthew_heaney@acm.org (Matthew Heaney) Subject: Re: help about handling interrupts Date: 1998/04/07 Message-ID: #1/1 X-Deja-AN: 341720138 Content-Transfer-Encoding: 8bit References: <3528B9E0.6F0F@bipa162.bi.ehu.es> <3529047A.44EE08B8@cl.cam.ac.uk> Content-Type: text/plain; charset=ISO-8859-1 Organization: Network Intensive Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-04-07T00:00:00+00:00 List-Id: In article , dewar@merv.cs.nyu.edu (Robert Dewar) wrote: >Matthew says > ><<>User processes cannot directly handle interrupts under Linux. >>If you want to write an interrupt handler yourself, you have to >>do this in a loadable kernel module. You can write loadable kernel >>modules in Ada just like you can do this in C. You have to call a >>kernel function at module load time that registers your Ada >>procedure as an interrupt handler, and then the Linux kernel >>will call your Ada procedure whenever this interrupt comes in. > >I don't understand this response. > >In Ada 95, you attach protected procedure of a protected object to an >interrupt. Section 19.6, INTERRUPT HANDLING, in Norm Cohen's book is >dedicated to this very topic. > >No, the OS doesn't make any difference. The syntax for specifying an >>> > > > >And I don't understand Matthew's response. If you take the attitude that >an interrupt in the RM really means an interrupt (as opposed to some kind >of operating system signal), then it is perfectly legitimate to reject all >attempts at attaching interrupt handlers on a system which does not allow >you to define an interrupt routine in the environment in which you are trying >to compile (e.g. user mode on NT or Unix). I think there's a terminology problem. When the original poster said "attach an interrupt," I interpreted him to mean "attach a procedure to a UNIX signal." I suppose if you're writing a device driver, and you need an "interrupt service routine (ISR)," then I don't think you can use a protected object. But if you mean "UNIX signal," then you can (at least I hope you can!).