Mercurial > hg > CbC > CbC_gcc
diff gcc/ada/libgnat/s-atopri.ads @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/gcc/ada/libgnat/s-atopri.ads Thu Oct 25 07:37:49 2018 +0900 +++ b/gcc/ada/libgnat/s-atopri.ads Thu Feb 13 11:34:05 2020 +0900 @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2012-2018, Free Software Foundation, Inc. -- +-- Copyright (C) 2012-2019, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,8 +33,10 @@ -- functions and operations used by the compiler to generate the lock-free -- implementation of protected objects. +with Interfaces.C; + package System.Atomic_Primitives is - pragma Preelaborate; + pragma Pure; type uint is mod 2 ** Long_Integer'Size; @@ -60,6 +62,9 @@ subtype Mem_Model is Integer range Relaxed .. Last; + type bool is new Boolean; + pragma Convention (C, bool); + ------------------------------------ -- GCC built-in atomic primitives -- ------------------------------------ @@ -130,6 +135,22 @@ -- Atomic_Compare_Exchange_8, -- "__atomic_compare_exchange_1"); + function Atomic_Test_And_Set + (Ptr : System.Address; + Model : Mem_Model := Seq_Cst) return bool; + pragma Import (Intrinsic, Atomic_Test_And_Set, "__atomic_test_and_set"); + + procedure Atomic_Clear + (Ptr : System.Address; + Model : Mem_Model := Seq_Cst); + pragma Import (Intrinsic, Atomic_Clear, "__atomic_clear"); + + function Atomic_Always_Lock_Free + (Size : Interfaces.C.size_t; + Ptr : System.Address := System.Null_Address) return bool; + pragma Import + (Intrinsic, Atomic_Always_Lock_Free, "__atomic_always_lock_free"); + -------------------------- -- Lock-free operations -- --------------------------