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,a79e3b493c2ba811 X-Google-Attributes: gid103376,public From: Toshitaka Kumano Subject: Re: Interrupt Handlers using GNAT-VxWorks? Date: 1999/10/16 Message-ID: <38076AEB.11FA6168@cityfujisawa.ne.jp>#1/1 X-Deja-AN: 537173941 Content-Transfer-Encoding: 7bit References: <7u500m$e96@niven.ksc.nasa.gov> To: John Arnsparger Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ns2.news.cityfujisawa.ne.jp X-Trace: ns2.news.cityfujisawa.ne.jp 940010652 3904 210.145.23.88 (15 Oct 1999 18:04:12 GMT) Organization: City Fujisawa Kanagawa PREF., JAPAN. Mime-Version: 1.0 Reply-To: toots@kama.melco.co.jp NNTP-Posting-Date: 15 Oct 1999 18:04:12 GMT Newsgroups: comp.lang.ada Date: 1999-10-15T18:04:12+00:00 List-Id: Dear John, John Arnsparger wrote: > > I am trying to attach an interrupt handler (procedure) to Vector #29 > (decimal) on the mvme167 > board using Ada95 "protected" constructs. I have tried > Ada.Interrupts.Attach_Handler, > which results in "Program_Error: Trying to overwrite a static Interrupt > Handler" with a dynamic handler". > > I have also tried the "pragma Attach_Handler", which produces a run-time > error saying > "Unitialized Interrupt". > > Both of these were declared in package bodies. > > Does anyone have any helpful hints or examples of successfully doing this > with GNAT-Works m68K? Or pointers to better references than the LRM? :-) How about a workaround as follows ? 1. Export the proteced procedure to C function with the pragma Export. 2. Write C wrapper to install the C function with "intConnect ()". 3. Import the wrapper as an Ada procedure with the pragma Import. 4. Call the procedure at an appropriate timing, e.g. in the elaboration of the package body. X. Of course, unmasking must be considered in other portion of codes. P.S. "Ada Interrupts" and "Interrupts in a CPU" are different things. "Ada Interrupts" is rather a programmer model than real H/W interrupts, and the relation between two is undefined in ARM, and implementaion defined. As you may know, GNAT limits "Ada Interrupts" only to "signals" probably because of portability, although that feature could be an obtacle for those who write codes using many user defined vectors. Sorry for my poor English. --