Skip to content

Commit b3d8558

Browse files
Fabien-Chouteaureznikmm
authored andcommitted
arch/ARM/cotrex_m: preelaborate some units
1 parent 72e36aa commit b3d8558

13 files changed

+21
-15
lines changed

arch/ARM/cortex_m/src/cortex_m-cache.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
with System;
3636

3737
package Cortex_M.Cache is
38+
pragma Elaborate_Body;
3839

3940
procedure Enable_I_Cache;
4041

arch/ARM/cortex_m/src/cortex_m-debug.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
------------------------------------------------------------------------------
3131

3232
package Cortex_M.Debug is
33+
pragma Preelaborate;
3334

3435
function Halting_Debug_Enabled return Boolean;
3536

arch/ARM/cortex_m/src/cortex_m-dwt.ads

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ package Cortex_M.DWT is -- Data Watchpoint Trace
5151
-- below. The values are just the NUMCOMP nibble and the boolean flags in
5252
-- the next nibble.
5353
No_DWT_Present : constant UInt32 := 0;
54-
Only_One_Comparator : constant UInt32 := 16#1000_0000#; -- 268435456 dec
55-
One_Comparator_Watchpoints : constant UInt32 := 16#1F00_0000#; -- 520093696 dec
56-
Four_Comparators_Watchpoints_And_Triggers : constant UInt32 := 16#4000_0000#; -- 1073741824 dec
57-
Four_Comparators_Watchpoints_Only : constant UInt32 := 16#4F00_0000#; -- 1325400064 dec
54+
Only_One_Comparator : constant UInt32 :=
55+
16#1000_0000#; -- 268435456 dec
56+
One_Comparator_Watchpoints : constant UInt32 :=
57+
16#1F00_0000#; -- 520093696 dec
58+
Four_Comparators_Watchpoints_And_Triggers : constant UInt32 :=
59+
16#4000_0000#; -- 1073741824 dec
60+
Four_Comparators_Watchpoints_Only : constant UInt32 :=
61+
16#4F00_0000#; -- 1325400064 dec
5862

5963
function DWT_Reset_Value return UInt32 with Inline;
6064
-- Returns the value of the DWT.CTRL register as a word, for convenient

arch/ARM/cortex_m/src/cortex_m-hints.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
-- https://developer.arm.com/documentation/ddi0419/e
4040

4141
package Cortex_M.Hints is
42+
pragma Preelaborate;
4243

4344
procedure Send_Event with Inline;
4445
-- A6.7.57 SEV

arch/ARM/cortex_m/src/fpu/cortex_m-fpu.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
with HAL; use HAL;
4848

4949
package Cortex_M.FPU is
50+
pragma Preelaborate;
5051

5152
function Sqrt (X : Float) return Float;
5253

arch/ARM/cortex_m/src/memory_barriers.adb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,3 @@ package body Memory_Barriers is
4444
end Data_Synchronization_Barrier;
4545

4646
end Memory_Barriers;
47-

arch/ARM/cortex_m/src/memory_barriers.ads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
-- This file provides utility functions for ARM Cortex microcontrollers
3333

3434
package Memory_Barriers is
35+
pragma Preelaborate;
3536

3637
procedure Data_Synchronization_Barrier with Inline;
3738
-- Injects instruction "DSB Sy" i.e., a "full system" domain barrier
3839

3940
procedure DSB renames Data_Synchronization_Barrier;
4041

4142
end Memory_Barriers;
42-

arch/ARM/cortex_m/src/nvic_cm0/cortex_m-nvic.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
with HAL; use HAL;
4646

4747
package Cortex_M.NVIC is -- the Nested Vectored Interrupt Controller
48+
pragma Preelaborate;
4849

4950
NVIC_PRIO_BITS : constant := 2;
5051
-- All Cortex M0 parts have 2 bit priority mask

arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ package body Cortex_M.NVIC is
9999
Subpriority : Interrupt_Priority)
100100
return Interrupt_Priority
101101
is
102-
PriorityGroupTmp : constant Interrupt_Priority := Priority_Group and 16#07#;
102+
PriorityGroupTmp : constant Interrupt_Priority :=
103+
Priority_Group and 16#07#;
103104
PreemptPriorityBits : Interrupt_Priority;
104105
SubPriorityBits : Interrupt_Priority;
105106
Temp1 : Interrupt_Priority;
@@ -251,4 +252,3 @@ package body Cortex_M.NVIC is
251252
end Reset_System;
252253

253254
end Cortex_M.NVIC;
254-

arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.ads

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ with System;
4646
with HAL; use HAL;
4747

4848
package Cortex_M.NVIC is -- the Nested Vectored Interrupt Controller
49+
pragma Elaborate_Body;
4950

5051
type Interrupt_ID is new Natural range 0 .. 240;
5152
type Interrupt_Priority is new UInt32;
@@ -65,7 +66,6 @@ package Cortex_M.NVIC is -- the Nested Vectored Interrupt Controller
6566
-- 4 bits for pre-emption priority; 0 bits for subpriority
6667
Priority_Group_4 : constant UInt32 := 16#00000003#;
6768

68-
6969
procedure Set_Priority_Grouping (Priority_Group : Interrupt_Priority)
7070
with Inline;
7171

@@ -110,7 +110,6 @@ private
110110
type Words is array (Natural range <>) of UInt32;
111111
type UInt8s is array (Natural range <>) of UInt8;
112112

113-
114113
type Nested_Vectored_Interrupt_Controller is record
115114
ISER : Words (0 .. 7);
116115
-- Interrupt Set Enable Register
@@ -151,7 +150,6 @@ private
151150
STIR at 3584 range 0 .. 31; -- 4 UInt8s
152151
end record;
153152

154-
155153
type System_Control_Block is record
156154
CPUID : UInt32;
157155
-- CPUID Base Register (read-only)
@@ -221,7 +219,6 @@ private
221219
CPACR at 136 range 0 .. 31; -- Offset: 0x088
222220
end record;
223221

224-
225222
SCS_Base : constant := 16#E000_E000#;
226223
-- system control space base address
227224
NVIC_Base : constant := SCS_Base + 16#0100#;
@@ -238,7 +235,6 @@ private
238235
Address => System'To_Address (NVIC_Base);
239236
pragma Import (Ada, NVIC);
240237

241-
242238
SCB_AIRCR_PRIGROUP_Pos : constant := 8;
243239
SCB_AIRCR_PRIGROUP_Mask : constant UInt32 :=
244240
Shift_Left (7, SCB_AIRCR_PRIGROUP_Pos);

arch/ARM/cortex_m/src/semihosting-filesystem.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ with HAL.Filesystem; use HAL.Filesystem;
3838
with HAL; use HAL;
3939

4040
package Semihosting.Filesystem is
41+
pragma Preelaborate;
4142

4243
type SHFS is new HAL.Filesystem.Filesystem_Driver with private;
4344
type Any_SHFS is access all SHFS'Class;

arch/ARM/cortex_m/src/semihosting.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ package body Semihosting is
9797
-- Generic_SH_Call --
9898
---------------------
9999

100-
function Generic_SH_Call (R0 : SH_Word; R1 : System.Address) return SH_Word is
100+
function Generic_SH_Call (R0 : SH_Word; R1 : System.Address)
101+
return SH_Word is
101102
begin
102103
return Generic_SH_Call (R0, To_SH_u32 (R1));
103104
end Generic_SH_Call;
@@ -300,5 +301,4 @@ package body Semihosting is
300301
Write_C (ASCII.LF);
301302
end Log_New_Line;
302303

303-
304304
end Semihosting;

arch/ARM/cortex_m/src/semihosting.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ with System;
3333
with HAL;
3434

3535
package Semihosting is
36+
pragma Preelaborate;
3637

3738
type SH_Word is new HAL.UInt32;
3839

0 commit comments

Comments
 (0)