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>
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>
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>
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>
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.
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.