Commit Graph
15 Commits
Author SHA1 Message Date
Sebastian Huber 26a73bcdec score: Flatten the red-black tree node
The red-black tree node held its links and its color in a nested
member.  The nesting came from the entry macro of the header which the
previous commit removed.  It served no purpose, and each access had to
name the nested member.

Move the links and the color into the node.  Change the prefix of the
fields from rbe_ of the entry to rbn_ of the node.  The Linux API
wrapper <linux/rbtree.h> renames the Linux fields with
"#define rb_left rbn_left" and "#define rb_right rbn_right".  Other
Linux compatibility layers such as the linuxkpi of FreeBSD define
rb_left and rb_right as object-like macros.  The prefix rbn_ is no
Linux name, so these macros leave the fields alone.

The tests sprbtree01 and ts-unit-no-clock-0 passed on the boards of
eight targets.

  Target                    Processor
  aarch64/zynqmp_apu        Cortex-A53
  LS1046A                   Cortex-A72
  arm/zynqmp_rpu_lock_step  Cortex-R5F
  arm/samrh71_flexram       Cortex-M7
  arm/xilinx_zynq_zc702     Cortex-A9
  riscv/mpfs_e51            E51
  riscv/mpfs_u54            U54
  sparc/gr740               LEON4

Update #5804.

Assisted-by: Claude:claude-opus-5-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-10-14 15:20:12 +11:00
Sebastian Huber 9485932096 score: Translate the red-black tree macros
The red-black tree of the score used <rtems/score/bsd-tree.h>, an import
of the FreeBSD <sys/tree.h> of 2020.  FreeBSD replaced this red-black
tree by a rank-balanced tree, so the header has no upstream any more.
The macros of the header generated the functions of the tree.  Most of
the header, such as the splay tree, served no code of RTEMS.

Translate each macro which the score uses into a static inline function
of <rtems/score/rbtree.h> or <rtems/score/rbtreeimpl.h>.  Each field of
a node gets a getter and a setter.  The body of each generated function
moves into the function which called it.  Each statement of a macro maps
to one statement of the translation.  Remove the header with its unused
parts and keep its copyright in each file which receives its code.  The
node keeps its layout and its field names, and the colors keep their
names.

The test sptree01 checked that the RTEMS_ prefixed macros of the header
did not clash with the macros of <sys/tree.h>.  It ran no check at
runtime.  Remove the test with the header.

The tests sprbtree01 and ts-unit-no-clock-0 passed on the boards of
eight targets.

  Target                    Processor
  aarch64/zynqmp_apu        Cortex-A53
  LS1046A                   Cortex-A72
  arm/zynqmp_rpu_lock_step  Cortex-R5F
  arm/samrh71_flexram       Cortex-M7
  arm/xilinx_zynq_zc702     Cortex-A9
  riscv/mpfs_e51            E51
  riscv/mpfs_u54            U54
  sparc/gr740               LEON4

Update #5804.

Assisted-by: Claude:claude-opus-5-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-10-14 15:20:12 +11:00
Sebastian Huber 2e50add72a cpukit: Write the driver and PCI Doxygen briefs
The briefs of the block device drivers and the PCI headers named a
topic, not the content of the file.  Five libblock files carried the
same brief "Media implementation.".  Four more carried "RAM disk block
device implementation.".

Write every brief in the style of the tree.  A source brief starts with
"This source file contains" and names the functions the file defines
where there are at most three.  A header brief starts with "This header
file provides".  Put @file, @ingroup and @brief in this order.

The CAN and CAN FD stack keeps its briefs.  Its contributors write them
in a style of their own.

Updates #5717.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-09-01 20:17:20 +00:00
Sebastian Huber 3f2e1bc22b cpukit: Add the remaining Doxygen file headers
Thirty-five files across the device drivers, the event recording, the
debugger interfaces, the flattened device tree support and several small
libraries had no Doxygen block.  Doxygen listed none of them.

Give each file a block with @file, @ingroup and @brief.  The brief names
what the file implements.

The score/cpu ports and the shell still lack their blocks.  Later
commits add them.

Updates #5717.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-09-01 20:17:20 +00:00
Gedare Bloom 332d42027f cpukit/include: reformat linux to OAR style
These are linux support header files, not imports from linux.

fixes #5479.
2026-02-05 14:01:17 -06:00
Gedare Bloom 88ca88f3fd cpukit/bsd-tree.h: prepend CPP with RTEMS_ scoping 2024-07-09 22:52:40 +00:00
Sebastian Huber bcef89f236 Update company name
The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.
2023-05-20 11:05:26 +02:00
Chris Johns f5233fe51c cpukit/include: Fixes for C++
Updates #4706
2022-08-22 08:30:00 +10:00
Joel Sherrill 3ec0b2676d cpukit/include/linux: Change license to BSD-2
Updates #3053.
2022-03-25 11:19:28 -05:00
Joel Sherrill 255fe433fd cpukit/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:49 +01:00
Sebastian Huber 4a7c68675d Fix rbtree_postorder_for_each_entry_safe()
Use the non-standard typeof operator to avoid code generation errors
with clang and use of uninitialized variable warnings with GCC and
Coverity Scan.

Update #3465.
2018-10-05 13:41:07 +02:00
Sebastian Huber 22d9575fd0 linux: Add rbtree_postorder_for_each_entry_safe()
Update #3465.
2018-07-16 07:22:11 +02:00
Sebastian Huber 0cb425704b linux: Simplify <linux/rbtree.h>
Remove the placeholder struct rb_node and use RBTree_Node directly via
some C pre-processor defines to adjust the member names.

Update #3465.
2018-07-16 07:22:11 +02:00
Sebastian Huber 877aeab6d2 linux: Install <linux/rbtree.h>
This makes it possible to test this API.

Update #3465.
2018-07-16 07:22:11 +02:00
Chris Johns 2afb22b7e1 Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step.  It
copied header files from arbitrary locations into the build tree.  The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

* The make preinstall step itself needs time and disk space.

* Errors in header files show up in the build tree copy.  This makes it
  hard for editors to open the right file to fix the error.

* There is no clear relationship between source and build tree header
  files.  This makes an audit of the build process difficult.

* The visibility of all header files in the build tree makes it
  difficult to enforce API barriers.  For example it is discouraged to
  use BSP-specifics in the cpukit.

* An introduction of a new build system is difficult.

* Include paths specified by the -B option are system headers.  This
  may suppress warnings.

* The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step.   All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc.  Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

* cpukit/include

* cpukit/score/cpu/@RTEMS_CPU@/include

* cpukit/libnetworking

The new BSP include directories are:

* bsps/include

* bsps/@RTEMS_CPU@/include

* bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed.  The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.
2018-01-25 08:45:26 +01:00