18 Commits

Author SHA1 Message Date
Arnaud Pouliquen
d3a27c1454 lib: fix file headers for doxygen generation
- start by "/**",
- fix file relative path,
- fix typos,

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2026-01-13 10:33:04 +01:00
Sebastian Huber
dcf121ab61 lib: optionally provide ATOMIC_VAR_INIT()
The ATOMIC_VAR_INIT() macro was deprecated in C17 and removed in C23.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2025-05-28 15:54:24 +02:00
Yongrong Wang
7f351a5158 lib: fix compile error
lib/errno.h: defined(__ARMCC_VERSION) for use GCC compile
lib/autmoic:fix compiler error:
nuttx/include/metal/compiler/gcc/atomic.h:19:13: error: conflicting type
qualifiers for 'atomic_flag'
19 | typedef int atomic_flag;
| ^~~~~~~~~~~
In file included from nuttx/include/nuttx/net/netdev_lowerhalf.h:38,
from virtio/virtio-net.c:33:
prebuilts/gcc/linux/arm/lib/gcc/arm-none-eabi/13.2.1/include/
stdatomic.h:233:3: note: previous declaration of 'atomic_flag' with
type 'atomic_flag'
233 | } atomic_flag;
| ^~~~~~~~~~~
nuttx/include/metal/compiler/gcc/atomic.h:20:14: error: conflicting
type qualifiers for 'atomic_char'
20 | typedef char atomic_char;
^~~~~~~~~~~

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-21 13:57:15 +02:00
Alberto Escolar Piedras
85fb13958d Refactor equal processor headers into new generic ones
Refactor all processor headers which had the same content
into a generic set, to reduce the number of duplicates.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-10 14:04:39 +01:00
Arnaud Pouliquen
9855f84ae9 lib: compiler support of arm compiler v6
The predefined macro __CC_ARM available on 5.x is migrated to the
macro __arm__ for the version 6.x. Add defines to support both versions.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2023-11-06 14:27:22 +01:00
Sergei Korneichuk
548f642855 Export each of the memory_order enumerators
The lib/atomic.h exports memory_order enum into the global namespace,
but none of its enumerators. According to Section 7.3.3 "The using
declaration" of the C++ standard: "specifying an enumeration name
in a using-declaration does not declare its enumerators in
the using-declaration's declarative region." See also:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0943r1.html

Signed-off-by: Sergei Korneichuk <sergei.korneichuk@amd.com>
2023-08-21 18:46:33 +02:00
Haithem Rahmani
65d77a680b Make ARMCC use GCC atomic routines
The MDK-ARM ARMCC doesn't provide the "stdatomic.h", however, with the
option "--gnu", it can support the standard gcc atomic routines.

This patch makes the armcc compiler use the "compiler/gcc/atomic.h"

Signed-off-by: Haithem Rahmani <haithem.rahmani@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2020-12-15 12:46:08 -08:00
Simon Leiner
8dfbbadc2d Use <atomic> when compiled as C++
This is necessary for the use of libmetal together with C++ clients that
require <atomic> as the replacement headers create a conflict with
<atomic>.

Signed-off-by: Simon Leiner <simon@leiner.me>
2020-09-07 10:29:31 +02:00
Ed Mooring
23c3c332ac Revert "atomic: use cpp atomic if cpp compiler is used"
This reverts commit 81f85dc244.
2019-07-29 17:58:46 -07:00
Wendy Liang
3ff0b75adf atomic: include stdint.h before including stdatomic.h
stdatomic.h depends on types defined in stdint.h.

Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
2019-03-07 02:18:58 -06:00
Wendy Liang
81f85dc244 atomic: use cpp atomic if cpp compiler is used
Use cpp atomic if cpp compiler is used as the
c atomic definition doesn't work with the cpp
atomic definition.

Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
2019-01-30 10:05:17 -08:00
Wendy Liang
9520117eee Covert license text to use SPDX tags
Replace the license text with SPDX tags

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-04-09 23:51:01 -07:00
Wendy Liang
a7b357357b change metal include from "metal/xxx.h" to <metal/xxx.h>
This change will save compilation time from looking into the directory
containing the current file for the header files.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2017-12-13 22:34:01 -08:00
Wendy Liang
290d2d7f84 atomic: support c++
Allow using libmetal in c++ program.
When c++ program uses libmetal, it will use
the default atomic impelementation defined
in libmetal library.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2017-07-07 15:20:45 -07:00
Sam Sortais
652303890e have includes use consistent format
Signed-off-by: Sam Sortais <sam.sortais@xilinx.com>
2016-08-03 13:24:05 -07:00
Cyril Chemparathy
893f908a47 Add processor specific atomic.h stubs
Signed-off-by: Wendy Liang <jliang@xilinx.com>
2016-03-07 15:52:21 -08:00
Cyril Chemparathy
4ab255319e code movement. 2016-01-06 15:48:57 -08:00
Cyril Chemparathy
7bda1db4a9 Initial commit
This commit sets up the basic infrastructure necessary for the project:

  - Documentation generation and installation using Doxygen.

  - Configuration options and template headers with option substitution.

  - Self-tests using cmake add_test() commands.

  - Configurable selection, build, and install of static and shared
    libraries, as well as handling for dependencies (libsysfs,
    libhugetlbfs) for linux builds.

  - Cross compilation for bare-metal and Linux target platforms.

  - Basic infrastructure for initialization, logging, etc. and
    separation between common, and system specific code.
2016-01-06 09:09:40 -08:00