Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions arch/ARM/cortex_m/src/memory_barriers.adb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- Copyright (C) 2015-2026, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
Expand Down Expand Up @@ -40,7 +40,17 @@ package body Memory_Barriers is
procedure Data_Synchronization_Barrier is
pragma Suppress (All_Checks);
begin
Asm ("DSB #0xF", Volatile => True); -- 15 is 'Sy", ie "full system"
Asm ("DSB #0xF", Volatile => True); -- 15 is 'Sy", ie "full system"
end Data_Synchronization_Barrier;

-----------------------------------------
-- Instruction_Synchronization_Barrier --
-----------------------------------------

procedure Instruction_Synchronization_Barrier is
pragma Suppress (All_Checks);
begin
Asm ("ISB", Volatile => True);
end Instruction_Synchronization_Barrier;

end Memory_Barriers;
10 changes: 7 additions & 3 deletions arch/ARM/cortex_m/src/memory_barriers.ads
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- Copyright (C) 2015-2026, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
Expand Down Expand Up @@ -29,14 +29,18 @@
-- --
------------------------------------------------------------------------------

-- This file provides utility functions for ARM Cortex microcontrollers
-- This unit provides memory barrier routines for ARM Cortex microcontrollers

package Memory_Barriers is
pragma Preelaborate;

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

procedure Instruction_Synchronization_Barrier with Inline_Always;
-- Injects instruction "ISB"

procedure DSB renames Data_Synchronization_Barrier;
procedure ISB renames Instruction_Synchronization_Barrier;

end Memory_Barriers;
Loading