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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada in command / control systems Date: Tue, 26 Feb 2019 15:50:35 +0000 Organization: A noiseless patient Spider Message-ID: References: <2199b15b-d704-403f-a6c4-00fab29792d5@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="adbf4900d65c27c9f4544a923b90acee"; logging-data="29255"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1861NNx8keZNgOON7OqI/QtY8bgyatz91Y=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cancel-Lock: sha1:9l1VMEcMv/FqfB9is96aaWYwZek= sha1:SeTdtDGrBTkeZnH5qqT7b2kP+Ek= Xref: reader01.eternal-september.org comp.lang.ada:55674 Date: 2019-02-26T15:50:35+00:00 List-Id: "J-P. Rosen" writes: > Le 25/02/2019 à 20:21, russ lyttle a écrit : >> Some items need to be specified to be >> allocated to EEPROM, some to RAM, etc. > You can do that with address clauses. The compiler will straightforwardly distinguish between text, read-only, read-write, and bss. If you need more, you can (GNAT) use pragma Linker_Section: for interrupt vectors for an STM32F4, Vectors : array (-14 .. Ada.Interrupts.Names.FPU_IRQ) of Handler := (-9 .. -6 | -4 .. -3 => null, -- reserved -14 => Dummy_Handler'Access, -- NMI -13 => HardFault_Handler'Access, -- HardFault -12 => Dummy_Handler'Access, -- MemManagement -11 => Dummy_Handler'Access, -- BusFault -10 => Dummy_Handler'Access, -- UsageFault -5 => SVC_Handler'Access, -- SVCall -2 => PendSV_Handler'Access, -- PendSV -1 => SysTick_Handler'Access, -- SysTick others => IRQ_Handler'Access) with Export, Convention => Ada, External_Name => "isr_vector"; pragma Linker_Section (Vectors, ".isr_vector"); and then use the linker script to place that section appropriately.