summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cpukit/doxygen/appl-config.h49
-rw-r--r--cpukit/dtc/VERSION17
-rw-r--r--cpukit/dtc/libfdt/fdt_ro.c2
-rw-r--r--cpukit/include/drvmgr/drvmgr.h4
-rw-r--r--cpukit/include/link_elf.h8
-rw-r--r--cpukit/include/linux/rbtree.h10
-rw-r--r--cpukit/include/machine/_kernel_in.h6
-rw-r--r--cpukit/include/machine/_kernel_in6.h1
-rw-r--r--cpukit/include/machine/_kernel_uio.h4
-rw-r--r--cpukit/include/pci/access.h20
-rw-r--r--cpukit/include/pci/irq.h10
-rw-r--r--cpukit/include/rtems/bsd.h24
-rw-r--r--cpukit/include/rtems/capture.h4
-rw-r--r--cpukit/include/rtems/cbs.h24
-rw-r--r--cpukit/include/rtems/chain.h64
-rw-r--r--cpukit/include/rtems/confdefs.h1
-rw-r--r--cpukit/include/rtems/confdefs/face.h82
-rw-r--r--cpukit/include/rtems/confdefs/newlib.h3
-rw-r--r--cpukit/include/rtems/confdefs/scheduler.h10
-rw-r--r--cpukit/include/rtems/confdefs/threads.h21
-rw-r--r--cpukit/include/rtems/config.h631
-rw-r--r--cpukit/include/rtems/counter.h8
-rw-r--r--cpukit/include/rtems/extensionimpl.h6
-rw-r--r--cpukit/include/rtems/fatal.h2
-rw-r--r--cpukit/include/rtems/imfs.h38
-rw-r--r--cpukit/include/rtems/imfsimpl.h92
-rw-r--r--cpukit/include/rtems/init.h2
-rw-r--r--cpukit/include/rtems/ioimpl.h4
-rw-r--r--cpukit/include/rtems/libcsupport.h28
-rw-r--r--cpukit/include/rtems/libio.h2
-rw-r--r--cpukit/include/rtems/linkersets.h2
-rw-r--r--cpukit/include/rtems/malloc.h60
-rw-r--r--cpukit/include/rtems/mallocinitmulti.h2
-rw-r--r--cpukit/include/rtems/mallocinitone.h2
-rw-r--r--cpukit/include/rtems/media.h2
-rw-r--r--cpukit/include/rtems/posix/condimpl.h10
-rw-r--r--cpukit/include/rtems/posix/keyimpl.h22
-rw-r--r--cpukit/include/rtems/posix/mqueueimpl.h14
-rw-r--r--cpukit/include/rtems/posix/muteximpl.h39
-rw-r--r--cpukit/include/rtems/posix/posixapi.h10
-rw-r--r--cpukit/include/rtems/posix/priorityimpl.h4
-rw-r--r--cpukit/include/rtems/posix/psignalimpl.h4
-rw-r--r--cpukit/include/rtems/posix/pthreadattrimpl.h8
-rw-r--r--cpukit/include/rtems/posix/pthreadimpl.h4
-rw-r--r--cpukit/include/rtems/posix/rwlockimpl.h2
-rw-r--r--cpukit/include/rtems/posix/semaphoreimpl.h18
-rw-r--r--cpukit/include/rtems/posix/shmimpl.h10
-rw-r--r--cpukit/include/rtems/posix/spinlockimpl.h2
-rw-r--r--cpukit/include/rtems/posix/timer.h18
-rw-r--r--cpukit/include/rtems/posix/timerimpl.h10
-rw-r--r--cpukit/include/rtems/pty.h2
-rw-r--r--cpukit/include/rtems/qreslib.h24
-rw-r--r--cpukit/include/rtems/rbtree.h46
-rw-r--r--cpukit/include/rtems/record.h22
-rw-r--r--cpukit/include/rtems/rtems/attrimpl.h28
-rw-r--r--cpukit/include/rtems/rtems/barrierimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/cache.h2
-rw-r--r--cpukit/include/rtems/rtems/clock.h12
-rw-r--r--cpukit/include/rtems/rtems/config.h218
-rw-r--r--cpukit/include/rtems/rtems/dpmem.h2
-rw-r--r--cpukit/include/rtems/rtems/dpmemimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/eventimpl.h10
-rw-r--r--cpukit/include/rtems/rtems/intr.h5
-rw-r--r--cpukit/include/rtems/rtems/messageimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/modes.h2
-rw-r--r--cpukit/include/rtems/rtems/modesimpl.h14
-rw-r--r--cpukit/include/rtems/rtems/mp.h2
-rw-r--r--cpukit/include/rtems/rtems/msgmp.h2
-rw-r--r--cpukit/include/rtems/rtems/object.h2
-rw-r--r--cpukit/include/rtems/rtems/options.h2
-rw-r--r--cpukit/include/rtems/rtems/optionsimpl.h4
-rw-r--r--cpukit/include/rtems/rtems/partimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/partmp.h2
-rw-r--r--cpukit/include/rtems/rtems/ratemonimpl.h12
-rw-r--r--cpukit/include/rtems/rtems/region.h2
-rw-r--r--cpukit/include/rtems/rtems/regionimpl.h12
-rw-r--r--cpukit/include/rtems/rtems/semimpl.h24
-rw-r--r--cpukit/include/rtems/rtems/semmp.h2
-rw-r--r--cpukit/include/rtems/rtems/status.h2
-rw-r--r--cpukit/include/rtems/rtems/statusimpl.h4
-rw-r--r--cpukit/include/rtems/rtems/support.h2
-rw-r--r--cpukit/include/rtems/rtems/tasks.h60
-rw-r--r--cpukit/include/rtems/rtems/tasksimpl.h6
-rw-r--r--cpukit/include/rtems/rtems/timerimpl.h22
-rw-r--r--cpukit/include/rtems/rtems/types.h3
-rw-r--r--cpukit/include/rtems/rtl/rtl-obj.h20
-rw-r--r--cpukit/include/rtems/rtl/rtl.h2
-rw-r--r--cpukit/include/rtems/scheduler.h20
-rw-r--r--cpukit/include/rtems/score/address.h14
-rw-r--r--cpukit/include/rtems/score/basedefs.h24
-rw-r--r--cpukit/include/rtems/score/chain.h22
-rw-r--r--cpukit/include/rtems/score/chainimpl.h82
-rw-r--r--cpukit/include/rtems/score/corebarrierimpl.h10
-rw-r--r--cpukit/include/rtems/score/coremsgimpl.h26
-rw-r--r--cpukit/include/rtems/score/coremuteximpl.h38
-rw-r--r--cpukit/include/rtems/score/corerwlockimpl.h6
-rw-r--r--cpukit/include/rtems/score/coresemimpl.h12
-rw-r--r--cpukit/include/rtems/score/freechainimpl.h8
-rw-r--r--cpukit/include/rtems/score/gcov.h87
-rw-r--r--cpukit/include/rtems/score/hash.h8
-rw-r--r--cpukit/include/rtems/score/heap.h8
-rw-r--r--cpukit/include/rtems/score/heapimpl.h54
-rw-r--r--cpukit/include/rtems/score/interr.h2
-rw-r--r--cpukit/include/rtems/score/isrlock.h2
-rw-r--r--cpukit/include/rtems/score/memory.h40
-rw-r--r--cpukit/include/rtems/score/mpciimpl.h2
-rw-r--r--cpukit/include/rtems/score/mrspimpl.h32
-rw-r--r--cpukit/include/rtems/score/object.h8
-rw-r--r--cpukit/include/rtems/score/objectdata.h4
-rw-r--r--cpukit/include/rtems/score/objectimpl.h73
-rw-r--r--cpukit/include/rtems/score/percpu.h14
-rw-r--r--cpukit/include/rtems/score/priority.h11
-rw-r--r--cpukit/include/rtems/score/prioritybitmapimpl.h22
-rw-r--r--cpukit/include/rtems/score/priorityimpl.h64
-rw-r--r--cpukit/include/rtems/score/processormask.h42
-rw-r--r--cpukit/include/rtems/score/profiling.h5
-rw-r--r--cpukit/include/rtems/score/protectedheap.h6
-rw-r--r--cpukit/include/rtems/score/rbtree.h38
-rw-r--r--cpukit/include/rtems/score/schedulercbsimpl.h4
-rw-r--r--cpukit/include/rtems/score/scheduleredfimpl.h39
-rw-r--r--cpukit/include/rtems/score/schedulerimpl.h127
-rw-r--r--cpukit/include/rtems/score/schedulernodeimpl.h20
-rw-r--r--cpukit/include/rtems/score/schedulerpriority.h2
-rw-r--r--cpukit/include/rtems/score/schedulerpriorityimpl.h50
-rw-r--r--cpukit/include/rtems/score/schedulersimpleimpl.h30
-rw-r--r--cpukit/include/rtems/score/scheduleruniimpl.h221
-rw-r--r--cpukit/include/rtems/score/smpimpl.h4
-rw-r--r--cpukit/include/rtems/score/smplockstats.h4
-rw-r--r--cpukit/include/rtems/score/stackimpl.h10
-rw-r--r--cpukit/include/rtems/score/statesimpl.h18
-rw-r--r--cpukit/include/rtems/score/sysstate.h12
-rw-r--r--cpukit/include/rtems/score/thread.h10
-rw-r--r--cpukit/include/rtems/score/threaddispatch.h16
-rw-r--r--cpukit/include/rtems/score/threadimpl.h246
-rw-r--r--cpukit/include/rtems/score/threadmp.h2
-rw-r--r--cpukit/include/rtems/score/threadqimpl.h70
-rw-r--r--cpukit/include/rtems/score/timestampimpl.h26
-rw-r--r--cpukit/include/rtems/score/tls.h2
-rw-r--r--cpukit/include/rtems/score/todimpl.h4
-rw-r--r--cpukit/include/rtems/score/userextimpl.h4
-rw-r--r--cpukit/include/rtems/score/watchdogimpl.h52
-rw-r--r--cpukit/include/rtems/score/wkspaceinitmulti.h2
-rw-r--r--cpukit/include/rtems/score/wkspaceinitone.h2
-rw-r--r--cpukit/include/rtems/shellconfig.h6
-rw-r--r--cpukit/include/rtems/termiostypes.h8
-rw-r--r--cpukit/include/rtems/test-info.h14
-rw-r--r--cpukit/include/rtems/test.h18
-rw-r--r--cpukit/include/rtems/timecounter.h14
-rw-r--r--cpukit/include/rtems/timespec.h28
-rw-r--r--cpukit/include/sha224.h62
-rw-r--r--cpukit/include/sha256.h16
-rw-r--r--cpukit/include/sha384.h61
-rw-r--r--cpukit/include/sha512.h17
-rw-r--r--cpukit/include/sha512t.h68
-rw-r--r--cpukit/include/sys/exec_elf.h840
-rw-r--r--cpukit/libcrypt/crypt-md5.c2
-rw-r--r--cpukit/libcrypt/crypt-sha256.c15
-rw-r--r--cpukit/libcrypt/crypt-sha512.c15
-rw-r--r--cpukit/libcrypt/misc.c4
-rw-r--r--cpukit/libcsupport/src/gcovfork.c94
-rw-r--r--cpukit/libcsupport/src/getreentglobal.c2
-rw-r--r--cpukit/libcsupport/src/newlibc_reent.c6
-rw-r--r--cpukit/libdebugger/rtems-debugger-aarch64.c23
-rw-r--r--cpukit/libdl/rtl-elf.c2
-rw-r--r--cpukit/libdl/rtl-elf.h2
-rw-r--r--cpukit/libdl/rtl-mdreloc-aarch64.c520
-rw-r--r--cpukit/libdl/rtl-mdreloc-arm.c79
-rw-r--r--cpukit/libdl/rtl-obj-comp.c6
-rw-r--r--cpukit/libdl/rtl-shell.c4
-rw-r--r--cpukit/libdl/rtl-sym.c2
-rw-r--r--cpukit/libdl/rtl-unresolved.c2
-rw-r--r--cpukit/libdl/rtl-unwind-arm.c65
-rw-r--r--cpukit/libdl/rtl-unwind-arm.h46
-rw-r--r--cpukit/libfs/src/dosfs/msdos.h4
-rw-r--r--cpukit/libfs/src/imfs/imfs_add_node.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_chown.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_fchmod.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_fifo.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_linfile.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_link.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_make_generic_node.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_memfile.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_mknod.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_node.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_rename.c2
-rw-r--r--cpukit/libmd/sha256c.c230
-rw-r--r--cpukit/libmd/sha512c.c377
-rw-r--r--cpukit/libmisc/rtems-fdt/rtems-fdt.c6
-rw-r--r--cpukit/libmisc/shell/main_rtems.c156
-rw-r--r--cpukit/libtest/t-test-checks.c12
-rw-r--r--cpukit/libtest/t-test-hash-sha256.c9
-rw-r--r--cpukit/libtest/testgcovbspreset.c54
-rw-r--r--cpukit/libtest/testgcovcpufatalhalt.c54
-rw-r--r--cpukit/libtest/testgcovdumpinfo.c66
-rw-r--r--cpukit/posix/src/cancel.c2
-rw-r--r--cpukit/posix/src/clocknanosleep.c16
-rw-r--r--cpukit/posix/src/psxtimercreate.c31
-rw-r--r--cpukit/posix/src/pthreadatfork.c13
-rw-r--r--cpukit/posix/src/pthreadjoin.c47
-rw-r--r--cpukit/rtems/src/clockgettickssinceboot.c53
-rw-r--r--cpukit/rtems/src/rtemsbuildname.c2
-rw-r--r--cpukit/rtems/src/schedulerident.c27
-rw-r--r--cpukit/rtems/src/taskdelete.c17
-rw-r--r--cpukit/rtems/src/timerserver.c2
-rw-r--r--cpukit/score/cpu/aarch64/cpu.c25
-rw-r--r--cpukit/score/cpu/aarch64/include/libcpu/mmu-vmsav8-64.h1
-rw-r--r--cpukit/score/cpu/aarch64/include/machine/elf_machdep.h256
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/score/cpu.h36
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h13
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/cpuimpl.h17
-rw-r--r--cpukit/score/cpu/bfin/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/bfin/include/rtems/score/cpuimpl.h15
-rw-r--r--cpukit/score/cpu/i386/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/i386/include/rtems/score/cpuimpl.h34
-rw-r--r--cpukit/score/cpu/i386/include/rtems/score/i386.h4
-rw-r--r--cpukit/score/cpu/lm32/include/rtems/score/cpu.h12
-rw-r--r--cpukit/score/cpu/lm32/include/rtems/score/cpuimpl.h15
-rw-r--r--cpukit/score/cpu/m68k/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/m68k/include/rtems/score/cpuimpl.h19
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/score/cpuimpl.h15
-rw-r--r--cpukit/score/cpu/mips/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/mips/include/rtems/score/cpuimpl.h15
-rw-r--r--cpukit/score/cpu/moxie/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/moxie/include/rtems/score/cpuimpl.h15
-rw-r--r--cpukit/score/cpu/nios2/include/rtems/score/cpu.h8
-rw-r--r--cpukit/score/cpu/nios2/include/rtems/score/cpuimpl.h16
-rw-r--r--cpukit/score/cpu/nios2/nios2-iic-irq.c2
-rw-r--r--cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h41
-rw-r--r--cpukit/score/cpu/no_cpu/include/rtems/score/cpuimpl.h21
-rw-r--r--cpukit/score/cpu/or1k/include/rtems/score/cpu.h12
-rw-r--r--cpukit/score/cpu/or1k/include/rtems/score/cpuimpl.h11
-rw-r--r--cpukit/score/cpu/or1k/include/rtems/score/or1k-utility.h10
-rw-r--r--cpukit/score/cpu/powerpc/cpu.c5
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/score/cpu.h35
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/score/cpuimpl.h20
-rw-r--r--cpukit/score/cpu/powerpc/ppc-context-validate.S77
-rw-r--r--cpukit/score/cpu/riscv/include/rtems/score/cpu.h14
-rw-r--r--cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h18
-rw-r--r--cpukit/score/cpu/sh/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/sh/include/rtems/score/cpuimpl.h15
-rw-r--r--cpukit/score/cpu/sparc/include/libcpu/byteorder.h16
-rw-r--r--cpukit/score/cpu/sparc/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/sparc/include/rtems/score/cpuimpl.h16
-rw-r--r--cpukit/score/cpu/sparc64/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/sparc64/include/rtems/score/cpuimpl.h15
-rw-r--r--cpukit/score/cpu/v850/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/v850/include/rtems/score/cpuimpl.h15
-rw-r--r--cpukit/score/cpu/x86_64/include/rtems/score/cpu.h15
-rw-r--r--cpukit/score/cpu/x86_64/include/rtems/score/cpu_asm.h20
-rw-r--r--cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h15
-rw-r--r--cpukit/score/src/gcovdumpinfo.c96
-rw-r--r--cpukit/score/src/gcovdumpinfobase64.c104
-rw-r--r--cpukit/score/src/gcovinfoset.c43
-rw-r--r--cpukit/score/src/memorydirtyfreeareas.c9
-rw-r--r--cpukit/score/src/memorynoinit.c45
-rw-r--r--cpukit/score/src/memoryzerofreeareas.c9
-rw-r--r--cpukit/score/src/mpci.c2
-rw-r--r--cpukit/score/src/objectactivecount.c18
-rw-r--r--cpukit/score/src/objectfree.c12
-rw-r--r--cpukit/score/src/percpudata.c9
-rw-r--r--cpukit/score/src/profilingisrentryexit.c5
-rw-r--r--cpukit/score/src/scheduleredfblock.c4
-rw-r--r--cpukit/score/src/scheduleredfchangepriority.c5
-rw-r--r--cpukit/score/src/scheduleredfschedule.c5
-rw-r--r--cpukit/score/src/scheduleredfunblock.c20
-rw-r--r--cpukit/score/src/scheduleredfyield.c2
-rw-r--r--cpukit/score/src/schedulerpriorityblock.c4
-rw-r--r--cpukit/score/src/schedulerprioritychangepriority.c5
-rw-r--r--cpukit/score/src/schedulerpriorityschedule.c5
-rw-r--r--cpukit/score/src/schedulerpriorityunblock.c16
-rw-r--r--cpukit/score/src/schedulerpriorityyield.c5
-rw-r--r--cpukit/score/src/schedulersimpleblock.c4
-rw-r--r--cpukit/score/src/schedulersimplechangepriority.c5
-rw-r--r--cpukit/score/src/schedulersimpleschedule.c5
-rw-r--r--cpukit/score/src/schedulersimpleunblock.c20
-rw-r--r--cpukit/score/src/schedulersimpleyield.c5
-rw-r--r--cpukit/score/src/threadchangepriority.c2
-rw-r--r--cpukit/score/src/threadcreateidle.c11
-rw-r--r--cpukit/score/src/threadinitialize.c1
-rw-r--r--cpukit/score/src/threadrestart.c128
282 files changed, 6109 insertions, 2534 deletions
diff --git a/cpukit/doxygen/appl-config.h b/cpukit/doxygen/appl-config.h
index 85290fd4bc..005d47e7b1 100644
--- a/cpukit/doxygen/appl-config.h
+++ b/cpukit/doxygen/appl-config.h
@@ -1995,6 +1995,55 @@
/** @} */
+/* Generated from spec:/acfg/if/group-face */
+
+/**
+ * @defgroup RTEMSApplConfigFACETechnicalStandardRelatedConfiguration \
+ * FACE Technical Standard Related Configuration
+ *
+ * @ingroup RTEMSApplConfig
+ *
+ * This section describes configuration options related to adapting RTEMS
+ * behavior to be aligned with the FACE Technical Standard. The FACE Technical
+ * Standard is a product of the FACE Consortium which operates under the Open
+ * Group. The FACE Consortium was founded by avionics organizations to improve
+ * the portability of cockpit software across various platforms. It addresses
+ * technical and business concerns.
+ *
+ * Most important from an RTEMS perspective, the FACE Technical Standard
+ * defines four POSIX profiles: Security, Safety Base, Safety Extended, and the
+ * General Purpose Profile. Each has an increasingly larger subset of POSIX
+ * APIs. In the Security and Safety profiles, ARINC 653 is required. It is
+ * optional in the General Purpose Profile.
+ *
+ * The RTEMS Project has been tracking alignment with the FACE POSIX profiles
+ * and they are included in the "RTEMS POSIX 1003.1 Compliance Guide."
+ *
+ * @{
+ */
+
+/* Generated from spec:/acfg/if/posix-timer-face-behavior */
+
+/**
+ * @brief This configuration option is a boolean feature define.
+ *
+ * If this configuration option is defined, then POSIX timers may not be
+ * created to use the CLOCK_REALTIME. Per POSIX, this is allowed behavior but
+ * per the FACE Technical Standard, it is not. Using POSIX timers based on
+ * CLOCK_REALTIME (e.g., time of day) is unsafe for real-time safety systems as
+ * setting CLOCK_REALTIME will perturb any active timers.
+ *
+ * If this option is not defined, POSIX timers may be created to use the
+ * CLOCK_REALTIME in compliance with the POSIX specification.
+ *
+ * @par Default Configuration
+ * If this configuration option is undefined, then the described feature is not
+ * enabled.
+ */
+#define CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR
+
+/** @} */
+
/* Generated from spec:/acfg/if/group-filesystem */
/**
diff --git a/cpukit/dtc/VERSION b/cpukit/dtc/VERSION
index 77198ab947..3eccee5e6d 100644
--- a/cpukit/dtc/VERSION
+++ b/cpukit/dtc/VERSION
@@ -2,17 +2,24 @@ Import from:
git://git.kernel.org/pub/scm/utils/dtc/dtc.git
-Commit:
+commit ed310803ea893ed0a8bba9c4ff0d9eb0063a8bef
+Author: Luca Weiss <luca@z3ntu.xyz>
+Date: Tue Apr 19 21:45:38 2022 +0200
-17739b7ef510917471409d71fb45d8eaf6a1e1fb
+ pylibfdt: add FdtRo.get_path()
-Date:
+ Add a new Python method wrapping fdt_get_path() from the C API.
-Thu Dec 9 07:14:20 2021 +0100
+ Also add a test for the new method.
+
+ Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
+ Message-Id: <20220419194537.63170-1-luca@z3ntu.xyz>
+ Reviewed-by: Simon Glass <sjg@chromium.org>
+ Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Commands to generate update patches:
-git format-patch 17739b7ef510917471409d71fb45d8eaf6a1e1fb -- libfdt/fdt_addresses.c libfdt/fdt.c libfdt/fdt_empty_tree.c libfdt/fdt.h libfdt/fdt_ro.c libfdt/fdt_rw.c libfdt/fdt_strerror.c libfdt/fdt_sw.c libfdt/fdt_wip.c libfdt/libfdt_env.h libfdt/libfdt.h libfdt/libfdt_internal.h libfdt/TODO
+git format-patch ed310803ea893ed0a8bba9c4ff0d9eb0063a8bef -- libfdt/fdt_addresses.c libfdt/fdt.c libfdt/fdt_empty_tree.c libfdt/fdt.h libfdt/fdt_ro.c libfdt/fdt_rw.c libfdt/fdt_strerror.c libfdt/fdt_sw.c libfdt/fdt_wip.c libfdt/libfdt_env.h libfdt/libfdt.h libfdt/libfdt_internal.h libfdt/TODO
sed -i 's%/libfdt/fdt.h%/cpukit/include/fdt.h%g' 00*
sed -i 's%/libfdt/libfdt.h%/cpukit/include/libfdt.h%g' 00*
sed -i 's%/libfdt/libfdt_env.h%/cpukit/include/libfdt_env.h%g' 00*
diff --git a/cpukit/dtc/libfdt/fdt_ro.c b/cpukit/dtc/libfdt/fdt_ro.c
index 17584da257..9f6c551a22 100644
--- a/cpukit/dtc/libfdt/fdt_ro.c
+++ b/cpukit/dtc/libfdt/fdt_ro.c
@@ -481,12 +481,12 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset,
if (!can_assume(VALID_INPUT)) {
name = fdt_get_string(fdt, fdt32_ld_(&prop->nameoff),
&namelen);
+ *namep = name;
if (!name) {
if (lenp)
*lenp = namelen;
return NULL;
}
- *namep = name;
} else {
*namep = fdt_string(fdt, fdt32_ld_(&prop->nameoff));
}
diff --git a/cpukit/include/drvmgr/drvmgr.h b/cpukit/include/drvmgr/drvmgr.h
index 8573159af6..fc60aede2b 100644
--- a/cpukit/include/drvmgr/drvmgr.h
+++ b/cpukit/include/drvmgr/drvmgr.h
@@ -485,7 +485,7 @@ extern union drvmgr_key_value *drvmgr_dev_key_get(
/*** DRIVER INTERACE USED TO REQUEST INFORMATION/SERVICES FROM BUS DRIVER ***/
/*! Get parent bus */
-RTEMS_INLINE_ROUTINE struct drvmgr_bus *drvmgr_get_parent(
+static inline struct drvmgr_bus *drvmgr_get_parent(
struct drvmgr_dev *dev)
{
if (dev)
@@ -495,7 +495,7 @@ RTEMS_INLINE_ROUTINE struct drvmgr_bus *drvmgr_get_parent(
}
/*! Get Driver of device */
-RTEMS_INLINE_ROUTINE struct drvmgr_drv *drvmgr_get_drv(struct drvmgr_dev *dev)
+static inline struct drvmgr_drv *drvmgr_get_drv(struct drvmgr_dev *dev)
{
if (dev)
return dev->drv;
diff --git a/cpukit/include/link_elf.h b/cpukit/include/link_elf.h
index 6cab3c2c7f..6483c021fd 100644
--- a/cpukit/include/link_elf.h
+++ b/cpukit/include/link_elf.h
@@ -13,6 +13,10 @@
#include <stdint.h>
#include <rtems/rtl/rtl-obj-fwd.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum sections
{
rap_text = 0,
@@ -76,4 +80,8 @@ int _rtld_linkmap_add (rtems_rtl_obj* obj);
* Remove link map from the list.
*/
void _rtld_linkmap_delete (rtems_rtl_obj* obj);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* _LINK_ELF_H_ */
diff --git a/cpukit/include/linux/rbtree.h b/cpukit/include/linux/rbtree.h
index b6ec864d06..fc6caad582 100644
--- a/cpukit/include/linux/rbtree.h
+++ b/cpukit/include/linux/rbtree.h
@@ -30,6 +30,10 @@
#include <rtems/score/rbtree.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define rb_node RBTree_Node
#define rb_left Node.rbe_left
@@ -109,7 +113,7 @@ static inline struct rb_node *rb_last( struct rb_root *root )
static inline void rb_replace_node(
struct rb_node *victim,
- struct rb_node *replacement,
+ struct rb_node *replacement,
struct rb_root *root
)
{
@@ -151,4 +155,8 @@ static inline struct rb_node *rb_parent( struct rb_node *node )
node = next \
)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _LINUX_RBTREE_H */
diff --git a/cpukit/include/machine/_kernel_in.h b/cpukit/include/machine/_kernel_in.h
index 29a6112e96..b33283353a 100644
--- a/cpukit/include/machine/_kernel_in.h
+++ b/cpukit/include/machine/_kernel_in.h
@@ -50,8 +50,14 @@ int in_broadcast(struct in_addr, struct ifnet *);
int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *);
int in_canforward(struct in_addr);
int in_localaddr(struct in_addr);
+#if __FreeBSD_version >= 1400039
+bool in_localip(struct in_addr);
+#else
int in_localip(struct in_addr);
+#endif
+bool in_localip_fib(struct in_addr, uint16_t);
int in_ifhasaddr(struct ifnet *, struct in_addr);
+struct in_ifaddr *in_findlocal(uint32_t, bool);
int inet_aton(const char *, struct in_addr *); /* in libkern */
char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */
char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */
diff --git a/cpukit/include/machine/_kernel_in6.h b/cpukit/include/machine/_kernel_in6.h
index c2b603fb36..7ec695bd6d 100644
--- a/cpukit/include/machine/_kernel_in6.h
+++ b/cpukit/include/machine/_kernel_in6.h
@@ -167,6 +167,7 @@ int in6_cksum_partial(struct mbuf *, u_int8_t, u_int32_t, u_int32_t,
u_int32_t);
int in6_localaddr(struct in6_addr *);
int in6_localip(struct in6_addr *);
+bool in6_localip_fib(struct in6_addr *, uint16_t);
int in6_ifhasaddr(struct ifnet *, struct in6_addr *);
int in6_addrscope(const struct in6_addr *);
char *ip6_sprintf(char *, const struct in6_addr *);
diff --git a/cpukit/include/machine/_kernel_uio.h b/cpukit/include/machine/_kernel_uio.h
index 7e45a28c16..59929cb03c 100644
--- a/cpukit/include/machine/_kernel_uio.h
+++ b/cpukit/include/machine/_kernel_uio.h
@@ -71,12 +71,8 @@ struct vm_page;
struct bus_dma_segment;
struct uio *cloneuio(struct uio *uiop);
-int copyinfrom(const void * __restrict src, void * __restrict dst,
- size_t len, int seg);
int copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov,
int error);
-int copyinstrfrom(const void * __restrict src, void * __restrict dst,
- size_t len, size_t * __restrict copied, int seg);
int copyinuio(const struct iovec *iovp, u_int iovcnt, struct uio **uiop);
int copyout_map(struct thread *td, vm_offset_t *addr, size_t sz);
int copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz);
diff --git a/cpukit/include/pci/access.h b/cpukit/include/pci/access.h
index 9a53c7e3a3..680c96d4dc 100644
--- a/cpukit/include/pci/access.h
+++ b/cpukit/include/pci/access.h
@@ -134,32 +134,32 @@ extern int pci_access_drv_register(struct pci_access_drv *drv);
extern void pci_modify_cmdsts(pci_dev_t dev, uint32_t mask, uint32_t val);
/* Enable Memory in command register */
-RTEMS_INLINE_ROUTINE void pci_mem_enable(pci_dev_t dev)
+static inline void pci_mem_enable(pci_dev_t dev)
{
pci_modify_cmdsts(dev, PCIM_CMD_MEMEN, PCIM_CMD_MEMEN);
}
-RTEMS_INLINE_ROUTINE void pci_mem_disable(pci_dev_t dev)
+static inline void pci_mem_disable(pci_dev_t dev)
{
pci_modify_cmdsts(dev, PCIM_CMD_MEMEN, 0);
}
-RTEMS_INLINE_ROUTINE void pci_io_enable(pci_dev_t dev)
+static inline void pci_io_enable(pci_dev_t dev)
{
pci_modify_cmdsts(dev, PCIM_CMD_PORTEN, PCIM_CMD_PORTEN);
}
-RTEMS_INLINE_ROUTINE void pci_io_disable(pci_dev_t dev)
+static inline void pci_io_disable(pci_dev_t dev)
{
pci_modify_cmdsts(dev, PCIM_CMD_PORTEN, 0);
}
-RTEMS_INLINE_ROUTINE void pci_master_enable(pci_dev_t dev)
+static inline void pci_master_enable(pci_dev_t dev)
{
pci_modify_cmdsts(dev, PCIM_CMD_BUSMASTEREN, PCIM_CMD_BUSMASTEREN);
}
-RTEMS_INLINE_ROUTINE void pci_master_disable(pci_dev_t dev)
+static inline void pci_master_disable(pci_dev_t dev)
{
pci_modify_cmdsts(dev, PCIM_CMD_BUSMASTEREN, 0);
}
@@ -185,25 +185,25 @@ extern void pci_io_w16(uint32_t adr, uint16_t data);
extern void pci_io_w32(uint32_t adr, uint32_t data);
/* Translate PCI address into CPU accessible address */
-RTEMS_INLINE_ROUTINE int pci_pci2cpu(uint32_t *address, int type)
+static inline int pci_pci2cpu(uint32_t *address, int type)
{
return pci_access_ops.translate(address, type, 0);
}
/* Translate CPU accessible address into PCI address (for DMA) */
-RTEMS_INLINE_ROUTINE int pci_cpu2pci(uint32_t *address, int type)
+static inline int pci_cpu2pci(uint32_t *address, int type)
{
return pci_access_ops.translate(address, type, 1);
}
/*** Read/Write a register over PCI Memory Space ***/
-RTEMS_INLINE_ROUTINE uint8_t pci_ld8(volatile uint8_t *addr)
+static inline uint8_t pci_ld8(volatile uint8_t *addr)
{
return *addr;
}
-RTEMS_INLINE_ROUTINE void pci_st8(volatile uint8_t *addr, uint8_t val)
+static inline void pci_st8(volatile uint8_t *addr, uint8_t val)
{
*addr = val;
}
diff --git a/cpukit/include/pci/irq.h b/cpukit/include/pci/irq.h
index b7c4a77aab..190c68a723 100644
--- a/cpukit/include/pci/irq.h
+++ b/cpukit/include/pci/irq.h
@@ -53,7 +53,7 @@ extern int pci_dev_irq(pci_dev_t dev);
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE int pci_interrupt_register(int irq, const char *info,
+static inline int pci_interrupt_register(int irq, const char *info,
pci_isr isr, void *arg)
{
return rtems_interrupt_handler_install(irq, info,
@@ -68,7 +68,7 @@ RTEMS_INLINE_ROUTINE int pci_interrupt_register(int irq, const char *info,
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE int pci_interrupt_unregister(int irq, pci_isr isr,
+static inline int pci_interrupt_unregister(int irq, pci_isr isr,
void *arg)
{
return rtems_interrupt_handler_remove(irq, isr, arg);
@@ -85,7 +85,7 @@ RTEMS_INLINE_ROUTINE int pci_interrupt_unregister(int irq, pci_isr isr,
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE void pci_interrupt_unmask(int irq)
+static inline void pci_interrupt_unmask(int irq)
{
BSP_shared_interrupt_unmask(irq);
}
@@ -101,7 +101,7 @@ RTEMS_INLINE_ROUTINE void pci_interrupt_unmask(int irq)
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE void pci_interrupt_mask(int irq)
+static inline void pci_interrupt_mask(int irq)
{
BSP_shared_interrupt_mask(irq);
}
@@ -115,7 +115,7 @@ RTEMS_INLINE_ROUTINE void pci_interrupt_mask(int irq)
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE void pci_interrupt_clear(int irq)
+static inline void pci_interrupt_clear(int irq)
{
BSP_shared_interrupt_clear(irq);
}
diff --git a/cpukit/include/rtems/bsd.h b/cpukit/include/rtems/bsd.h
index ea56f91c7c..fe54246212 100644
--- a/cpukit/include/rtems/bsd.h
+++ b/cpukit/include/rtems/bsd.h
@@ -54,7 +54,7 @@ extern "C" {
/**
* @copydoc _Timecounter_Bintime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_bintime( struct bintime *bt )
+static inline void rtems_bsd_bintime( struct bintime *bt )
{
_Timecounter_Bintime( bt );
}
@@ -62,7 +62,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_bintime( struct bintime *bt )
/**
* @copydoc _Timecounter_Nanotime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_nanotime( struct timespec *ts )
+static inline void rtems_bsd_nanotime( struct timespec *ts )
{
_Timecounter_Nanotime( ts );
}
@@ -70,7 +70,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_nanotime( struct timespec *ts )
/**
* @copydoc _Timecounter_Microtime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_microtime( struct timeval *tv )
+static inline void rtems_bsd_microtime( struct timeval *tv )
{
_Timecounter_Microtime( tv );
}
@@ -78,7 +78,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_microtime( struct timeval *tv )
/**
* @copydoc _Timecounter_Binuptime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_binuptime( struct bintime *bt )
+static inline void rtems_bsd_binuptime( struct bintime *bt )
{
_Timecounter_Binuptime( bt );
}
@@ -86,7 +86,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_binuptime( struct bintime *bt )
/**
* @copydoc _Timecounter_Nanouptime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_nanouptime( struct timespec *ts )
+static inline void rtems_bsd_nanouptime( struct timespec *ts )
{
_Timecounter_Nanouptime( ts );
}
@@ -94,7 +94,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_nanouptime( struct timespec *ts )
/**
* @copydoc _Timecounter_Microtime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_microuptime( struct timeval *tv )
+static inline void rtems_bsd_microuptime( struct timeval *tv )
{
_Timecounter_Microuptime( tv );
}
@@ -102,7 +102,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_microuptime( struct timeval *tv )
/**
* @copydoc _Timecounter_Getbintime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_getbintime( struct bintime *bt )
+static inline void rtems_bsd_getbintime( struct bintime *bt )
{
_Timecounter_Getbintime( bt );
}
@@ -110,7 +110,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_getbintime( struct bintime *bt )
/**
* @copydoc _Timecounter_Getnanotime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_getnanotime( struct timespec *ts )
+static inline void rtems_bsd_getnanotime( struct timespec *ts )
{
_Timecounter_Getnanotime( ts );
}
@@ -118,7 +118,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_getnanotime( struct timespec *ts )
/**
* @copydoc _Timecounter_Getmicrotime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_getmicrotime( struct timeval *tv )
+static inline void rtems_bsd_getmicrotime( struct timeval *tv )
{
_Timecounter_Getmicrotime( tv );
}
@@ -126,7 +126,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_getmicrotime( struct timeval *tv )
/**
* @copydoc _Timecounter_Getbinuptime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_getbinuptime( struct bintime *bt )
+static inline void rtems_bsd_getbinuptime( struct bintime *bt )
{
_Timecounter_Getbinuptime( bt );
}
@@ -134,7 +134,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_getbinuptime( struct bintime *bt )
/**
* @copydoc _Timecounter_Getnanouptime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_getnanouptime( struct timespec *ts )
+static inline void rtems_bsd_getnanouptime( struct timespec *ts )
{
_Timecounter_Getnanouptime( ts );
}
@@ -142,7 +142,7 @@ RTEMS_INLINE_ROUTINE void rtems_bsd_getnanouptime( struct timespec *ts )
/**
* @copydoc _Timecounter_Getmicrouptime()
*/
-RTEMS_INLINE_ROUTINE void rtems_bsd_getmicrouptime( struct timeval *tv )
+static inline void rtems_bsd_getmicrouptime( struct timeval *tv )
{
_Timecounter_Getmicrouptime( tv );
}
diff --git a/cpukit/include/rtems/capture.h b/cpukit/include/rtems/capture.h
index c37d652211..4ab638ec24 100644
--- a/cpukit/include/rtems/capture.h
+++ b/cpukit/include/rtems/capture.h
@@ -838,7 +838,7 @@ rtems_capture_task_flags (rtems_tcb* tcb)
static inline rtems_capture_control*
rtems_capture_task_control (rtems_tcb* tcb)
{
- return tcb->Capture.control;
+ return (rtems_capture_control*) tcb->Capture.control;
}
/**
@@ -853,7 +853,7 @@ rtems_capture_task_control (rtems_tcb* tcb)
static inline uint32_t
rtems_capture_task_control_flags (rtems_tcb* tcb)
{
- rtems_capture_control* control = tcb->Capture.control;
+ rtems_capture_control* control = rtems_capture_task_control (tcb);
if (!control)
return 0;
return control->flags;
diff --git a/cpukit/include/rtems/cbs.h b/cpukit/include/rtems/cbs.h
index d8a78cc214..ee87cb7ae0 100644
--- a/cpukit/include/rtems/cbs.h
+++ b/cpukit/include/rtems/cbs.h
@@ -81,7 +81,7 @@ typedef Scheduler_CBS_Parameters rtems_cbs_parameters;
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_initialize ( void )
+static inline int rtems_cbs_initialize ( void )
{
return _Scheduler_CBS_Initialize();
}
@@ -93,7 +93,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_initialize ( void )
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_cleanup ( void )
+static inline int rtems_cbs_cleanup ( void )
{
return _Scheduler_CBS_Cleanup();
}
@@ -105,7 +105,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_cleanup ( void )
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_create_server (
+static inline int rtems_cbs_create_server (
rtems_cbs_parameters *params,
rtems_cbs_budget_overrun budget_overrun_callback,
rtems_cbs_server_id *server_id
@@ -125,7 +125,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_create_server (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_attach_thread (
+static inline int rtems_cbs_attach_thread (
rtems_cbs_server_id server_id,
rtems_id task_id
)
@@ -140,7 +140,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_attach_thread (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_detach_thread (
+static inline int rtems_cbs_detach_thread (
rtems_cbs_server_id server_id,
rtems_id task_id
)
@@ -155,7 +155,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_detach_thread (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_destroy_server (
+static inline int rtems_cbs_destroy_server (
rtems_cbs_server_id server_id
)
{
@@ -170,7 +170,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_destroy_server (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_get_server_id (
+static inline int rtems_cbs_get_server_id (
rtems_id task_id,
rtems_cbs_server_id *server_id
)
@@ -185,7 +185,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_get_server_id (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_get_parameters (
+static inline int rtems_cbs_get_parameters (
rtems_cbs_server_id server_id,
rtems_cbs_parameters *params
)
@@ -200,7 +200,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_get_parameters (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_set_parameters (
+static inline int rtems_cbs_set_parameters (
rtems_cbs_server_id server_id,
rtems_cbs_parameters *params
)
@@ -215,7 +215,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_set_parameters (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_get_execution_time (
+static inline int rtems_cbs_get_execution_time (
rtems_cbs_server_id server_id,
time_t *exec_time,
time_t *abs_time
@@ -231,7 +231,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_get_execution_time (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_get_remaining_budget (
+static inline int rtems_cbs_get_remaining_budget (
rtems_cbs_server_id server_id,
time_t *remaining_budget
)
@@ -247,7 +247,7 @@ RTEMS_INLINE_ROUTINE int rtems_cbs_get_remaining_budget (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE int rtems_cbs_get_approved_budget (
+static inline int rtems_cbs_get_approved_budget (
rtems_cbs_server_id server_id,
time_t *appr_budget
)
diff --git a/cpukit/include/rtems/chain.h b/cpukit/include/rtems/chain.h
index da08ddcfdd..076056dd7a 100644
--- a/cpukit/include/rtems/chain.h
+++ b/cpukit/include/rtems/chain.h
@@ -166,7 +166,7 @@ rtems_status_code rtems_chain_get_with_wait(
* @param[in] number_nodes is the number of nodes that will be in the chain
* @param[in] node_size is the size of each node
*/
-RTEMS_INLINE_ROUTINE void rtems_chain_initialize(
+static inline void rtems_chain_initialize(
rtems_chain_control *the_chain,
void *starting_address,
size_t number_nodes,
@@ -188,7 +188,7 @@ RTEMS_INLINE_ROUTINE void rtems_chain_initialize(
*
* @param[in] the_chain is the chain to be initialized.
*/
-RTEMS_INLINE_ROUTINE void rtems_chain_initialize_empty(
+static inline void rtems_chain_initialize_empty(
rtems_chain_control *the_chain
)
{
@@ -203,7 +203,7 @@ RTEMS_INLINE_ROUTINE void rtems_chain_initialize_empty(
*
* @param[in] node the node set to off chain.
*/
-RTEMS_INLINE_ROUTINE void rtems_chain_set_off_chain(
+static inline void rtems_chain_set_off_chain(
rtems_chain_node *node
)
{
@@ -218,7 +218,7 @@ RTEMS_INLINE_ROUTINE void rtems_chain_set_off_chain(
*
* @param[in] the_node The chain node to initialize.
*/
-RTEMS_INLINE_ROUTINE void rtems_chain_initialize_node(
+static inline void rtems_chain_initialize_node(
rtems_chain_node *node
)
{
@@ -236,7 +236,7 @@ RTEMS_INLINE_ROUTINE void rtems_chain_initialize_node(
* @retval true The node is off chain.
* @retval false The node is not off chain.
*/
-RTEMS_INLINE_ROUTINE bool rtems_chain_is_node_off_chain(
+static inline bool rtems_chain_is_node_off_chain(
const rtems_chain_node *node
)
{
@@ -253,7 +253,7 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_is_node_off_chain(
* @retval true The chain node pointer is NULL.
* @retval false The chain node pointer is not NULL.
*/
-RTEMS_INLINE_ROUTINE bool rtems_chain_is_null_node(
+static inline bool rtems_chain_is_null_node(
const rtems_chain_node *the_node
)
{
@@ -269,7 +269,7 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_is_null_node(
*
* @return This method returns the permanent node of the chain.
*/
-RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_head(
+static inline rtems_chain_node *rtems_chain_head(
rtems_chain_control *the_chain
)
{
@@ -285,7 +285,7 @@ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_head(
*
* @return This method returns the permanent head node of the chain.
*/
-RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_head(
+static inline const rtems_chain_node *rtems_chain_immutable_head(
const rtems_chain_control *the_chain
)
{
@@ -301,7 +301,7 @@ RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_head(
*
* @return This method returns the permanent tail node of the chain.
*/
-RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_tail(
+static inline rtems_chain_node *rtems_chain_tail(
rtems_chain_control *the_chain
)
{
@@ -317,7 +317,7 @@ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_tail(
*
* @return This method returns the permanent tail node of the chain.
*/
-RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_tail(
+static inline const rtems_chain_node *rtems_chain_immutable_tail(
const rtems_chain_control *the_chain
)
{
@@ -334,7 +334,7 @@ RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_tail(
*
* @return This method returns the first node of the chain.
*/
-RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_first(
+static inline rtems_chain_node *rtems_chain_first(
const rtems_chain_control *the_chain
)
{
@@ -351,7 +351,7 @@ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_first(
*
* @return This method returns the first node of the chain.
*/
-RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_first(
+static inline const rtems_chain_node *rtems_chain_immutable_first(
const rtems_chain_control *the_chain
)
{
@@ -368,7 +368,7 @@ RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_first(
*
* @return This method returns the last node of the chain.
*/
-RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_last(
+static inline rtems_chain_node *rtems_chain_last(
const rtems_chain_control *the_chain
)
{
@@ -385,7 +385,7 @@ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_last(
*
* @return This method returns the last node of the chain.
*/
-RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_last(
+static inline const rtems_chain_node *rtems_chain_immutable_last(
const rtems_chain_control *the_chain
)
{
@@ -401,7 +401,7 @@ RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_last(
*
* @return This method returns the next node on the chain.
*/
-RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_next(
+static inline rtems_chain_node *rtems_chain_next(
const rtems_chain_node *the_node
)
{
@@ -417,7 +417,7 @@ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_next(
*
* @return This method returns the next node on the chain.
*/
-RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_next(
+static inline const rtems_chain_node *rtems_chain_immutable_next(
const rtems_chain_node *the_node
)
{
@@ -433,7 +433,7 @@ RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_next(
*
* @return This method returns the previous node on the chain.
*/
-RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_previous(
+static inline rtems_chain_node *rtems_chain_previous(
const rtems_chain_node *the_node
)
{
@@ -449,7 +449,7 @@ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_previous(
*
* @return This method returns the previous node on the chain.
*/
-RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_previous(
+static inline const rtems_chain_node *rtems_chain_immutable_previous(
const rtems_chain_node *the_node
)
{
@@ -468,7 +468,7 @@ RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_previous(
* @retval true @a left is equal to @a right.
* @retval false @a left is not equal to @a right
*/
-RTEMS_INLINE_ROUTINE bool rtems_chain_are_nodes_equal(
+static inline bool rtems_chain_are_nodes_equal(
const rtems_chain_node *left,
const rtems_chain_node *right
)
@@ -487,7 +487,7 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_are_nodes_equal(
* @retval true The chain is empty.
* @retval false The chain is not empty.
*/
-RTEMS_INLINE_ROUTINE bool rtems_chain_is_empty(
+static inline bool rtems_chain_is_empty(
const rtems_chain_control *the_chain
)
{
@@ -506,7 +506,7 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_is_empty(
* @retval true @a the_node is the first node on a chain.
* @retval false @a the_node is not the first node on a chain.
*/
-RTEMS_INLINE_ROUTINE bool rtems_chain_is_first(
+static inline bool rtems_chain_is_first(
const rtems_chain_node *the_node
)
{
@@ -524,7 +524,7 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_is_first(
* @retval true @a the_node is the last node on a chain.
* @retval false @a the_node is not the last node on a chain
*/
-RTEMS_INLINE_ROUTINE bool rtems_chain_is_last(
+static inline bool rtems_chain_is_last(
const rtems_chain_node *the_node
)
{
@@ -542,7 +542,7 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_is_last(
* @retval true The chain has only one node.
* @retval false The chain has more than one nodes.
*/
-RTEMS_INLINE_ROUTINE bool rtems_chain_has_only_one_node(
+static inline bool rtems_chain_has_only_one_node(
const rtems_chain_control *the_chain
)
{
@@ -561,7 +561,7 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_has_only_one_node(
* @retval true @a the_node is the head of @a the_chain.
* @retval false @a the_node is not the head of @a the_chain.
*/
-RTEMS_INLINE_ROUTINE bool rtems_chain_is_head(
+static inline bool rtems_chain_is_head(
const rtems_chain_control *the_chain,
const rtems_chain_node *the_node
)
@@ -581,7 +581,7 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_is_head(
* @retval true @a the_node is the tail of @a the_chain.
* @retval false @a the_node is not the tail of @a the_chain.
*/
-RTEMS_INLINE_ROUTINE bool rtems_chain_is_tail(
+static inline bool rtems_chain_is_tail(
const rtems_chain_control *the_chain,
const rtems_chain_node *the_node
)
@@ -610,7 +610,7 @@ void rtems_chain_extract(
* NOTE: It does NOT disable interrupts to ensure the atomicity of the
* append operation.
*/
-RTEMS_INLINE_ROUTINE void rtems_chain_extract_unprotected(
+static inline void rtems_chain_extract_unprotected(
rtems_chain_node *the_node
)
{
@@ -636,7 +636,7 @@ rtems_chain_node *rtems_chain_get(
/**
* @brief See _Chain_Get_unprotected().
*/
-RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get_unprotected(
+static inline rtems_chain_node *rtems_chain_get_unprotected(
rtems_chain_control *the_chain
)
{
@@ -646,7 +646,7 @@ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get_unprotected(
/**
* @brief See _Chain_Get_first_unprotected().
*/
-RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get_first_unprotected(
+static inline rtems_chain_node *rtems_chain_get_first_unprotected(
rtems_chain_control *the_chain
)
{
@@ -670,7 +670,7 @@ void rtems_chain_insert(
/**
* @brief See _Chain_Insert_unprotected().
*/
-RTEMS_INLINE_ROUTINE void rtems_chain_insert_unprotected(
+static inline void rtems_chain_insert_unprotected(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
@@ -699,7 +699,7 @@ void rtems_chain_append(
* NOTE: It does NOT disable interrupts to ensure the atomicity of the
* append operation.
*/
-RTEMS_INLINE_ROUTINE void rtems_chain_append_unprotected(
+static inline void rtems_chain_append_unprotected(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
@@ -734,7 +734,7 @@ void rtems_chain_prepend(
* NOTE: It does NOT disable interrupts to ensure the atomicity of the
* prepend operation.
*/
-RTEMS_INLINE_ROUTINE void rtems_chain_prepend_unprotected(
+static inline void rtems_chain_prepend_unprotected(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
@@ -795,7 +795,7 @@ bool rtems_chain_get_with_empty_check(
*
* @return The node count of the chain.
*/
-RTEMS_INLINE_ROUTINE size_t rtems_chain_node_count_unprotected(
+static inline size_t rtems_chain_node_count_unprotected(
const rtems_chain_control *chain
)
{
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index e6dd3d70ee..3927d26ec5 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -64,6 +64,7 @@
#include <rtems/confdefs/clock.h>
#include <rtems/confdefs/console.h>
#include <rtems/confdefs/extensions.h>
+#include <rtems/confdefs/face.h>
#include <rtems/confdefs/inittask.h>
#include <rtems/confdefs/initthread.h>
#include <rtems/confdefs/iodrivers.h>
diff --git a/cpukit/include/rtems/confdefs/face.h b/cpukit/include/rtems/confdefs/face.h
new file mode 100644
index 0000000000..317d821623
--- /dev/null
+++ b/cpukit/include/rtems/confdefs/face.h
@@ -0,0 +1,82 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSImplApplConfig
+ *
+ * @brief This header file evaluates configuration options related to
+ * the FACE Technical Standard.
+ *
+ * The FACE Technical Standard (https://opengroup.org/face) is an
+ * open standard designed for safety critical embedded systems. It
+ * includes POSIX profiles and requirements that promote safety
+ * and portability. As a general rules, the profiles place a minimum
+ * on the services which an operating system must provide. Those
+ * same profile definitions represent the maximum services which
+ * an application may use.
+ */
+
+/*
+ * Copyright (C) 2022 On-Line Applications Research Corporation (OAR)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_CONFDEFS_FACE_H
+#define _RTEMS_CONFDEFS_FACE_H
+
+#ifndef __CONFIGURATION_TEMPLATE_h
+#error "Do not include this file directly, use <rtems/confdefs.h> instead"
+#endif
+
+#ifdef CONFIGURE_INIT
+
+#ifdef CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR
+
+ #include <rtems/posix/timer.h>
+
+ int _POSIX_Timer_Is_allowed(
+ clockid_t clock_id
+ )
+ {
+ /*
+ * Per the FACE Technical Standard, POSIX timers should not be
+ * allowed on CLOCK_REALTIME for safety reasons. If the application
+ * wants the FACE behavior, then this method is instantiated.
+ */
+ if ( clock_id == CLOCK_REALTIME ) {
+ return EPERM;
+ }
+
+ if ( clock_id != CLOCK_MONOTONIC ) {
+ return EINVAL;
+ }
+
+ return 0;
+ }
+
+#endif /* CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR */
+
+#endif /* CONFIGURE_INIT */
+
+#endif /* _RTEMS_CONFDEFS_FACE_H */
diff --git a/cpukit/include/rtems/confdefs/newlib.h b/cpukit/include/rtems/confdefs/newlib.h
index 96bf850163..fef71a8855 100644
--- a/cpukit/include/rtems/confdefs/newlib.h
+++ b/cpukit/include/rtems/confdefs/newlib.h
@@ -57,7 +57,8 @@
extern "C" {
#endif
-#ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
+#if defined(_CONFIGURE_ENABLE_NEWLIB_REENTRANCY) && \
+ !defined(_REENT_THREAD_LOCAL)
struct _reent *__getreent( void )
{
return _Thread_Get_executing()->libc_reent;
diff --git a/cpukit/include/rtems/confdefs/scheduler.h b/cpukit/include/rtems/confdefs/scheduler.h
index 84ca810fd7..8ac943921f 100644
--- a/cpukit/include/rtems/confdefs/scheduler.h
+++ b/cpukit/include/rtems/confdefs/scheduler.h
@@ -234,7 +234,17 @@ extern "C" {
#endif
#ifdef CONFIGURE_SCHEDULER
+ /*
+ * Ignore these warnings:
+ *
+ * - invalid use of structure with flexible array member
+ *
+ * - struct has no members
+ */
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wpedantic"
CONFIGURE_SCHEDULER;
+ #pragma GCC diagnostic pop
#endif
const Scheduler_Control _Scheduler_Table[] = {
diff --git a/cpukit/include/rtems/confdefs/threads.h b/cpukit/include/rtems/confdefs/threads.h
index 503a4b20ec..4040bcb50a 100644
--- a/cpukit/include/rtems/confdefs/threads.h
+++ b/cpukit/include/rtems/confdefs/threads.h
@@ -147,7 +147,15 @@ const size_t _Thread_Maximum_TLS_size =
CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE;
struct Thread_Configured_control {
+/*
+ * This was added to address the following warning.
+ * warning: invalid use of structure with flexible array member
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
Thread_Control Control;
+#pragma GCC diagnostic pop
+
#if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ];
#endif
@@ -159,7 +167,8 @@ struct Thread_Configured_control {
#if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
char name[ CONFIGURE_MAXIMUM_THREAD_NAME_SIZE ];
#endif
- #ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
+ #if defined(_CONFIGURE_ENABLE_NEWLIB_REENTRANCY) && \
+ !defined(_REENT_THREAD_LOCAL)
struct _reent Newlib;
#endif
};
@@ -175,7 +184,8 @@ const Thread_Control_add_on _Thread_Control_add_ons[] = {
),
offsetof( Thread_Configured_control, API_RTEMS )
}
- #ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
+ #if defined(_CONFIGURE_ENABLE_NEWLIB_REENTRANCY) && \
+ !defined(_REENT_THREAD_LOCAL)
, {
offsetof(
Thread_Configured_control,
@@ -209,7 +219,14 @@ const size_t _Thread_Control_add_on_count =
#ifdef RTEMS_SMP
struct Thread_queue_Configured_heads {
+/*
+ * This was put in to address the following warning.
+ * warning: invalid use of structure with flexible array member
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
Thread_queue_Heads Heads;
+#pragma GCC diagnostic pop
Thread_queue_Priority_queue Priority[ _CONFIGURE_SCHEDULER_COUNT ];
};
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 32dd662b3e..3d51fd6b5d 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -10,8 +10,8 @@
*/
/*
- * Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
* Copyright (C) 2009, 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1988, 2021 On-Line Applications Research Corporation (OAR)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -61,6 +61,7 @@
#include <stdint.h>
#include <rtems/rtems/config.h>
#include <rtems/score/cpu.h>
+#include <rtems/score/cpuopts.h>
#include <rtems/score/isr.h>
#include <rtems/score/memory.h>
#include <rtems/score/object.h>
@@ -90,10 +91,146 @@ extern "C" {
* @brief The application configuration information group provides an API to
* get the configuration of an application.
*
- * Some interfaces of this API are also used to define application
- * configuration option values, for example rtems_resource_unlimited().
+ * RTEMS must be configured for an application. This configuration encompasses
+ * a variety of information including the length of each clock tick, the
+ * maximum number of each information RTEMS object that can be created, the
+ * application initialization tasks, the task scheduling algorithm to be used,
+ * and the device drivers in the application.
+ *
+ * Although this information is contained in data structures that are used by
+ * RTEMS at system initialization time, the data structures themselves must not
+ * be generated by hand. RTEMS provides a set of macros system which provides a
+ * simple standard mechanism to automate the generation of these structures.
+ *
+ * The RTEMS header file ``<rtems/confdefs.h>`` is at the core of the automatic
+ * generation of system configuration. It is based on the idea of setting
+ * macros which define configuration parameters of interest to the application
+ * and defaulting or calculating all others. This variety of macros can
+ * automatically produce all of the configuration data required for an RTEMS
+ * application. The term ``confdefs`` is shorthand for a *Configuration
+ * Defaults*.
+ *
+ * As a general rule, application developers only specify values for the
+ * configuration parameters of interest to them. They define what resources or
+ * features they require. In most cases, when a parameter is not specified, it
+ * defaults to zero (0) instances, a standards compliant value, or disabled as
+ * appropriate. For example, by default there will be 256 task priority levels
+ * but this can be lowered by the application. This number of priority levels
+ * is required to be compliant with the RTEID/ORKID standards upon which the
+ * Classic API is based. There are similar cases where the default is selected
+ * to be compliant with the POSIX standard.
+ *
+ * For each configuration parameter in the configuration tables, the macro
+ * corresponding to that field is discussed. The RTEMS Maintainers expect that
+ * all systems can be easily configured using the ``<rtems/confdefs.h>``
+ * mechanism and that using this mechanism will avoid internal RTEMS
+ * configuration changes impacting applications.
+ *
+ * Some application configuration settings and other system parameters can be
+ * queried by the application.
*/
+/* Generated from spec:/rtems/config/if/unlimited-objects */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief This flag is used in augment a resource number so that it indicates
+ * an unlimited resource.
+ */
+#define RTEMS_UNLIMITED_OBJECTS OBJECTS_UNLIMITED_OBJECTS
+
+/* Generated from spec:/rtems/config/if/get-stack-allocator-avoids-work-space */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief Indicates if the task stack allocator is configured to avoid the
+ * RTEMS Workspace for this application.
+ *
+ * @return Returns true, if the task stack allocator is configured to avoid the
+ * RTEMS Workspace for this application, otherwise false.
+ *
+ * @par Notes
+ * The setting is defined by the
+ * #CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE application configuration
+ * option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+#define rtems_configuration_get_stack_allocator_avoids_work_space() \
+ _Stack_Allocator_avoids_workspace
+
+/* Generated from spec:/rtems/config/if/get-stack-space-size */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief Gets the configured size in bytes of the memory space used to
+ * allocate thread stacks for this application.
+ *
+ * @return Returns the configured size in bytes of the memory space used to
+ * allocate thread stacks for this application.
+ *
+ * @par Notes
+ * The size takes only threads and tasks into account with are known at the
+ * application configuration time.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+uintptr_t rtems_configuration_get_stack_space_size( void );
+
+/* Generated from spec:/rtems/config/if/has-hardware-fp */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief This constant evaluates to #TRUE, if this processor variant has
+ * hardware floating point support, otherwise to #FALSE.
+ */
+#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
+
+/* Generated from spec:/rtems/config/if/stack-allocate-hook */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief A thread stack allocator allocate handler shall have this type.
+ */
+typedef Stack_Allocator_allocate rtems_stack_allocate_hook;
+
+/* Generated from spec:/rtems/config/if/stack-allocate-init-hook */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief A task stack allocator initialization handler shall have this type.
+ */
+typedef Stack_Allocator_initialize rtems_stack_allocate_init_hook;
+
+/* Generated from spec:/rtems/config/if/stack-free-hook */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief A task stack allocator free handler shall have this type.
+ */
+typedef Stack_Allocator_free rtems_stack_free_hook;
+
/* Generated from spec:/rtems/config/if/get-build-label */
/**
@@ -101,10 +238,11 @@ extern "C" {
*
* @brief Gets the RTEMS build label.
*
- * The build label is a user-provided string defined by the build
- * configuration.
+ * The build label is a user-provided string defined by the build configuration
+ * through the ``RTEMS_BUILD_LABEL`` build option. The format of the string is
+ * completely user-defined.
*
- * @return Returns the pointer to the RTEMS build label.
+ * @return Returns a pointer to the RTEMS build label.
*
* @par Notes
* The build label can be used to distinguish test suite results obtained from
@@ -132,10 +270,77 @@ const char *rtems_get_build_label( void );
*
* @brief Gets the RTEMS copyright notice.
*
- * @return Returns the pointer to the RTEMS copyright notice.
+ * @return Returns a pointer to the RTEMS copyright notice.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
const char *rtems_get_copyright_notice( void );
+/* Generated from spec:/rtems/config/if/get-target-hash */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief Gets the RTEMS target hash.
+ *
+ * The target hash is calculated from BSP-specific values which characterize a
+ * target system. The target hash is encoded as a base64url string. The
+ * target hash algorithm is unspecified.
+ *
+ * @return Returns a pointer to the RTEMS target hash.
+ *
+ * @par Notes
+ * @parblock
+ * For example, the device tree, settings of the memory controller, processor
+ * and bus frequencies, a serial number of a chip may be used to calculate the
+ * target hash.
+ *
+ * The target hash can be used to distinguish test suite results obtained from
+ * different target systems. See also rtems_get_build_label().
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+const char *rtems_get_target_hash( void );
+
+/* Generated from spec:/rtems/config/if/get-version-string */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief Gets the RTEMS version string.
+ *
+ * @return Returns a pointer to the RTEMS version string.
+ *
+ * @par Notes
+ * The version string has no particular format. Parsing the string may break
+ * across RTEMS releases.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+const char *rtems_get_version_string( void );
+
/* Generated from spec:/rtems/config/if/get-do-zero-of-workspace */
/**
@@ -148,37 +353,67 @@ const char *rtems_get_copyright_notice( void );
* during system initialization for this application, otherwise false.
*
* @par Notes
- * See #CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY.
+ * The setting is defined by the #CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
+ * application configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_do_zero_of_workspace() _Memory_Zero_before_use
-/* Generated from spec:/rtems/config/if/get-idle-task */
+/* Generated from spec:/rtems/config/if/get-idle-task-stack-size */
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the IDLE task entry of this application.
+ * @brief Gets the IDLE task stack size in bytes of this application.
*
- * @return Returns the IDLE task entry of this application.
+ * @return Returns the IDLE task stack size in bytes of this application.
*
* @par Notes
- * See #CONFIGURE_IDLE_TASK_BODY.
+ * The IDLE task stack size is defined by the #CONFIGURE_IDLE_TASK_STACK_SIZE
+ * application configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-#define rtems_configuration_get_idle_task() _Thread_Idle_body
+#define rtems_configuration_get_idle_task_stack_size() _Thread_Idle_stack_size
-/* Generated from spec:/rtems/config/if/get-idle-task-stack-size */
+/* Generated from spec:/rtems/config/if/get-idle-task */
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the IDLE task stack size in bytes of this application.
+ * @brief Gets the IDLE task body of this application.
*
- * @return Returns the IDLE task stack size in bytes of this application.
+ * @return Returns the IDLE task body of this application.
*
* @par Notes
- * See #CONFIGURE_IDLE_TASK_STACK_SIZE.
+ * The IDLE task body is defined by the #CONFIGURE_IDLE_TASK_BODY application
+ * configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-#define rtems_configuration_get_idle_task_stack_size() _Thread_Idle_stack_size
+#define rtems_configuration_get_idle_task() _Thread_Idle_body
/* Generated from spec:/rtems/config/if/get-interrupt-stack-size */
@@ -190,7 +425,17 @@ const char *rtems_get_copyright_notice( void );
* @return Returns the interrupt stack size in bytes of this application.
*
* @par Notes
- * See #CONFIGURE_INTERRUPT_STACK_SIZE.
+ * The interrupt stack size is defined by the #CONFIGURE_INTERRUPT_STACK_SIZE
+ * application configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_interrupt_stack_size() \
((size_t) _ISR_Stack_size)
@@ -200,14 +445,25 @@ const char *rtems_get_copyright_notice( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API User Extensions configured for
- * this application.
+ * @brief Gets the resource number of @ref RTEMSAPIClassicUserExt objects
+ * configured for this application.
*
- * @return Returns the maximum number of Classic API User Extensions configured
- * for this application.
+ * @return Returns the resource number of @ref RTEMSAPIClassicUserExt objects
+ * configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_USER_EXTENSIONS.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_USER_EXTENSIONS
+ * application configuration option. See also rtems_resource_is_unlimited()
+ * and rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_extensions( void );
@@ -231,6 +487,15 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
* In uniprocessor configurations, this macro is a compile time constant which
* evaluates to one.
* @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_maximum_processors() \
_SMP_Processor_configured_maximum
@@ -247,7 +512,17 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
* this application.
*
* @par Notes
- * See #CONFIGURE_MICROSECONDS_PER_TICK.
+ * The number of microseconds per clock tick is defined by the
+ * #CONFIGURE_MICROSECONDS_PER_TICK application configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_microseconds_per_tick() \
_Watchdog_Microseconds_per_tick
@@ -264,7 +539,17 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
* this application.
*
* @par Notes
- * See #CONFIGURE_MICROSECONDS_PER_TICK.
+ * The number of milliseconds per clock tick is defined by the
+ * #CONFIGURE_MICROSECONDS_PER_TICK application configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_milliseconds_per_tick() \
( _Watchdog_Microseconds_per_tick / 1000 )
@@ -281,7 +566,17 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
* this application.
*
* @par Notes
- * See #CONFIGURE_MICROSECONDS_PER_TICK.
+ * The number of nanoseconds per clock tick is defined by the
+ * #CONFIGURE_MICROSECONDS_PER_TICK application configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_nanoseconds_per_tick() \
_Watchdog_Nanoseconds_per_tick
@@ -298,7 +593,18 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
* application.
*
* @par Notes
- * See #CONFIGURE_INITIAL_EXTENSIONS.
+ * The number of initial extensions is defined by the
+ * #CONFIGURE_INITIAL_EXTENSIONS application configuration option and related
+ * options.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_number_of_initial_extensions() \
((uint32_t) _User_extensions_Initial_count)
@@ -308,14 +614,24 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the thread stack allocator allocate hook used to allocate the
+ * @brief Gets the task stack allocator allocate hook used to allocate the
* stack of each IDLE task configured for this application.
*
- * @return Returns the thread stack allocator allocate hook used to allocate
- * the stack of each IDLE task configured for this application.
+ * @return Returns the task stack allocator allocate hook used to allocate the
+ * stack of each IDLE task configured for this application.
*
* @par Notes
- * See #CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE.
+ * The task stack allocator allocate hook for idle tasks is defined by the
+ * #CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE application configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_stack_allocate_for_idle_hook() \
_Stack_Allocator_allocate_for_idle
@@ -325,101 +641,68 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the thread stack allocator allocate hook configured for this
+ * @brief Gets the task stack allocator allocate hook configured for this
* application.
*
- * @return Returns the thread stack allocator allocate hook configured for this
+ * @return Returns the task stack allocator allocate hook configured for this
* application.
*
* @par Notes
- * See #CONFIGURE_TASK_STACK_ALLOCATOR.
- */
-#define rtems_configuration_get_stack_allocate_hook() _Stack_Allocator_allocate
-
-/* Generated from spec:/rtems/config/if/get-stack-allocate-init-hook */
-
-/**
- * @ingroup RTEMSAPIConfig
+ * The task stack allocator allocate hook is defined by the
+ * #CONFIGURE_TASK_STACK_ALLOCATOR application configuration option.
*
- * @brief Gets the thread stack allocator initialization hook configured for
- * this application.
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * @return Returns the thread stack allocator initialization hook configured
- * for this application.
+ * * The directive may be called from within any runtime context.
*
- * @par Notes
- * See #CONFIGURE_TASK_STACK_ALLOCATOR_INIT.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-#define rtems_configuration_get_stack_allocate_init_hook() \
- _Stack_Allocator_initialize
+#define rtems_configuration_get_stack_allocate_hook() _Stack_Allocator_allocate
-/* Generated from spec:/rtems/config/if/get-stack-allocator-avoids-work-space */
+/* Generated from spec:/rtems/config/if/get-stack-allocate-init-hook */
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Indicates if the thread stack allocator is configured to avoid the
- * RTEMS Workspace for this application.
+ * @brief Gets the task stack allocator initialization hook configured for this
+ * application.
*
- * @return Returns true, if the thread stack allocator is configured to avoid
- * the RTEMS Workspace for this application, otherwise false.
+ * @return Returns the task stack allocator initialization hook configured for
+ * this application.
*
* @par Notes
- * See #CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE.
- */
-#define rtems_configuration_get_stack_allocator_avoids_work_space() \
- _Stack_Allocator_avoids_workspace
-
-/* Generated from spec:/rtems/config/if/get-stack-free-hook */
-
-/**
- * @ingroup RTEMSAPIConfig
+ * The task stack allocator initialization hook is defined by the
+ * #CONFIGURE_TASK_STACK_ALLOCATOR_INIT application configuration option.
*
- * @brief Gets the thread stack allocator free hook configured for this
- * application.
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * @return Returns the thread stack allocator free hook configured for this
- * application.
+ * * The directive may be called from within any runtime context.
*
- * @par Notes
- * See #CONFIGURE_TASK_STACK_DEALLOCATOR.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-#define rtems_configuration_get_stack_free_hook() _Stack_Allocator_free
+#define rtems_configuration_get_stack_allocate_init_hook() \
+ _Stack_Allocator_initialize
-/* Generated from spec:/rtems/config/if/get-stack-space-size */
+/* Generated from spec:/rtems/config/if/get-stack-free-hook */
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the thread stack space size in bytes of configured for this
+ * @brief Gets the task stack allocator free hook configured for this
* application.
*
- * @return Returns the thread stack space size in bytes of configured for this
+ * @return Returns the task stack allocator free hook configured for this
* application.
- */
-uintptr_t rtems_configuration_get_stack_space_size( void );
-
-/* Generated from spec:/rtems/config/if/get-target-hash */
-
-/**
- * @ingroup RTEMSAPIConfig
- *
- * @brief Gets the RTEMS target hash.
- *
- * The target hash is calculated from BSP-specific values which characterize a
- * target system.
- *
- * @return Returns the pointer to the RTEMS target hash.
*
* @par Notes
- * @parblock
- * For example, the device tree, settings of the memory controller, processor
- * and bus frequencies, a serial number of a chip may be used to calculate the
- * target hash.
- *
- * The target hash can be used to distinguish test suite results obtained from
- * different target systems. See also rtems_get_build_label().
- * @endparblock
+ * The task stack allocator free hook is defined by the
+ * #CONFIGURE_TASK_STACK_DEALLOCATOR application configuration option.
*
* @par Constraints
* @parblock
@@ -430,7 +713,7 @@ uintptr_t rtems_configuration_get_stack_space_size( void );
* * The directive will not cause the calling task to be preempted.
* @endparblock
*/
-const char *rtems_get_target_hash( void );
+#define rtems_configuration_get_stack_free_hook() _Stack_Allocator_free
/* Generated from spec:/rtems/config/if/get-ticks-per-timeslice */
@@ -443,7 +726,17 @@ const char *rtems_get_target_hash( void );
* application.
*
* @par Notes
- * See #CONFIGURE_TICKS_PER_TIMESLICE.
+ * The clock ticks per timeslice is defined by the
+ * #CONFIGURE_TICKS_PER_TIMESLICE application configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_ticks_per_timeslice() \
_Watchdog_Ticks_per_timeslice
@@ -460,7 +753,17 @@ const char *rtems_get_target_hash( void );
* configured to be unified for this application, otherwise false.
*
* @par Notes
- * See #CONFIGURE_UNIFIED_WORK_AREAS.
+ * The setting is defined by the #CONFIGURE_UNIFIED_WORK_AREAS application
+ * configuration option.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_unified_work_area() _Workspace_Is_unified
@@ -471,8 +774,17 @@ const char *rtems_get_target_hash( void );
*
* @brief Gets the initial extensions table configured for this application.
*
- * @return Returns the pointer to the initial extensions table configured for
+ * @return Returns a pointer to the initial extensions table configured for
* this application.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_user_extension_table() \
_User_extensions_Initial_extensions
@@ -484,8 +796,17 @@ const char *rtems_get_target_hash( void );
*
* @brief Gets the MPCI configuration table configured for this application.
*
- * @return Returns the pointer to the MPCI configuration table configured for
+ * @return Returns a pointer to the MPCI configuration table configured for
* this application.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#if defined(RTEMS_MULTIPROCESSING)
#define rtems_configuration_get_user_multiprocessing_table() \
@@ -494,17 +815,6 @@ const char *rtems_get_target_hash( void );
#define rtems_configuration_get_user_multiprocessing_table() NULL
#endif
-/* Generated from spec:/rtems/config/if/get-version-string */
-
-/**
- * @ingroup RTEMSAPIConfig
- *
- * @brief Gets the RTEMS version string.
- *
- * @return Returns the pointer to the RTEMS version string.
- */
-const char *rtems_get_version_string( void );
-
/* Generated from spec:/rtems/config/if/get-work-space-size */
/**
@@ -515,22 +825,21 @@ const char *rtems_get_version_string( void );
*
* @return Returns the RTEMS Workspace size in bytes configured for this
* application.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_configuration_get_work_space_size() \
( _Workspace_Size + \
( rtems_configuration_get_stack_allocator_avoids_work_space() ? \
0 : rtems_configuration_get_stack_space_size() ) )
-/* Generated from spec:/rtems/config/if/has-hardware-fp */
-
-/**
- * @ingroup RTEMSAPIConfig
- *
- * @brief This constant evaluates to #TRUE, if this processor variant has
- * hardware floating point support, otherwise to #FALSE.
- */
-#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP
-
/* Generated from spec:/rtems/config/if/resource-is-unlimited */
/**
@@ -542,9 +851,16 @@ const char *rtems_get_version_string( void );
*
* @return Returns true, if the resource is unlimited, otherwise false.
*
- * @par Notes
- * This function is implemented as a macro and can be used to define compile
- * time constants.
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive is implemented by a macro and may be called from within
+ * C/C++ constant expressions. In addition, a function implementation of the
+ * directive exists for bindings to other programming languages.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_resource_is_unlimited( _resource ) \
_Objects_Is_unlimited( _resource )
@@ -560,49 +876,19 @@ const char *rtems_get_version_string( void );
*
* @return Returns the maximum number per allocation of a resource number.
*
- * @par Notes
- * This function is implemented as a macro and can be used to define compile
- * time constants.
- */
-#define rtems_resource_maximum_per_allocation( _resource ) \
- _Objects_Maximum_per_allocation( _resource )
-
-/* Generated from spec:/rtems/config/if/stack-allocate-hook */
-
-/**
- * @ingroup RTEMSAPIConfig
- *
- * @brief A thread stack allocator allocate handler shall have this type.
- */
-typedef Stack_Allocator_allocate rtems_stack_allocate_hook;
-
-/* Generated from spec:/rtems/config/if/stack-allocate-init-hook */
-
-/**
- * @ingroup RTEMSAPIConfig
- *
- * @brief A thread stack allocator initialization handler shall have this type.
- */
-typedef Stack_Allocator_initialize rtems_stack_allocate_init_hook;
-
-/* Generated from spec:/rtems/config/if/stack-free-hook */
-
-/**
- * @ingroup RTEMSAPIConfig
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * @brief A thread stack allocator free handler shall have this type.
- */
-typedef Stack_Allocator_free rtems_stack_free_hook;
-
-/* Generated from spec:/rtems/config/if/unlimited-objects */
-
-/**
- * @ingroup RTEMSAPIConfig
+ * * The directive is implemented by a macro and may be called from within
+ * C/C++ constant expressions. In addition, a function implementation of the
+ * directive exists for bindings to other programming languages.
*
- * @brief This flag is used in augment a resource number so that it indicates
- * an unlimited resource.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-#define RTEMS_UNLIMITED_OBJECTS OBJECTS_UNLIMITED_OBJECTS
+#define rtems_resource_maximum_per_allocation( _resource ) \
+ _Objects_Maximum_per_allocation( _resource )
/* Generated from spec:/rtems/config/if/resource-unlimited */
@@ -618,8 +904,19 @@ typedef Stack_Allocator_free rtems_stack_free_hook;
* resource.
*
* @par Notes
- * This function is implemented as a macro and can be used to define compile
- * time constants.
+ * This directive should be used to configure unlimited objects, see Unlimited
+ * Objects.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive is implemented by a macro and may be called from within
+ * C/C++ constant expressions. In addition, a function implementation of the
+ * directive exists for bindings to other programming languages.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
#define rtems_resource_unlimited( _resource ) \
( ( _resource ) | RTEMS_UNLIMITED_OBJECTS )
diff --git a/cpukit/include/rtems/counter.h b/cpukit/include/rtems/counter.h
index ad6d5517a3..61a0677bd3 100644
--- a/cpukit/include/rtems/counter.h
+++ b/cpukit/include/rtems/counter.h
@@ -99,20 +99,20 @@ static inline rtems_counter_ticks rtems_counter_read( void )
* @brief Returns the difference between the second and first CPU counter
* value.
*
- * This operation may be carried out as a modulo operation depending on the
- * range of the CPU counter device.
+ * This function is provided for backward compatibility.
+ * You may use "second - first" directly in the code.
*
* @param[in] second The second CPU counter value.
* @param[in] first The first CPU counter value.
*
- * @return Returns second minus first modulo counter period.
+ * @return Returns second minus first.
*/
static inline rtems_counter_ticks rtems_counter_difference(
rtems_counter_ticks second,
rtems_counter_ticks first
)
{
- return _CPU_Counter_difference( second, first );
+ return second - first;
}
/**
diff --git a/cpukit/include/rtems/extensionimpl.h b/cpukit/include/rtems/extensionimpl.h
index f90d1df5f4..8d559e2fed 100644
--- a/cpukit/include/rtems/extensionimpl.h
+++ b/cpukit/include/rtems/extensionimpl.h
@@ -54,19 +54,19 @@ extern "C" {
* @{
*/
-RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
+static inline Extension_Control *_Extension_Allocate( void )
{
return (Extension_Control *) _Objects_Allocate( &_Extension_Information );
}
-RTEMS_INLINE_ROUTINE void _Extension_Free (
+static inline void _Extension_Free (
Extension_Control *the_extension
)
{
_Objects_Free( &_Extension_Information, &the_extension->Object );
}
-RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get( Objects_Id id )
+static inline Extension_Control *_Extension_Get( Objects_Id id )
{
return (Extension_Control *)
_Objects_Get_no_protection( id, &_Extension_Information );
diff --git a/cpukit/include/rtems/fatal.h b/cpukit/include/rtems/fatal.h
index 0253ab4343..1cc59076fe 100644
--- a/cpukit/include/rtems/fatal.h
+++ b/cpukit/include/rtems/fatal.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassic
+ *
* @brief This header file defines the Fatal Error Manager API.
*/
diff --git a/cpukit/include/rtems/imfs.h b/cpukit/include/rtems/imfs.h
index 57c498cfe8..7db9b4e462 100644
--- a/cpukit/include/rtems/imfs.h
+++ b/cpukit/include/rtems/imfs.h
@@ -3,7 +3,7 @@
/**
* @file
*
- * @brief Header File for the In-Memory File System
+ * @brief This header file defines the API of the In-Memory File System.
*/
/*
@@ -39,7 +39,6 @@
#include <rtems/libio_.h>
#include <rtems/pipe.h>
-#include <rtems/score/timecounter.h>
/**
* @brief In-Memory File System Support.
@@ -372,41 +371,6 @@ static inline IMFS_memfile_t *IMFS_iop_to_memfile( const rtems_libio_t *iop )
return (IMFS_memfile_t *) iop->pathinfo.node_access;
}
-static inline time_t _IMFS_get_time( void )
-{
- struct bintime now;
-
- /* Use most efficient way to get the time in seconds (CLOCK_REALTIME) */
- _Timecounter_Getbintime( &now );
-
- return now.sec;
-}
-
-static inline void IMFS_update_atime( IMFS_jnode_t *jnode )
-{
- jnode->stat_atime = _IMFS_get_time();
-}
-
-static inline void IMFS_update_mtime( IMFS_jnode_t *jnode )
-{
- jnode->stat_mtime = _IMFS_get_time();
-}
-
-static inline void IMFS_update_ctime( IMFS_jnode_t *jnode )
-{
- jnode->stat_ctime = _IMFS_get_time();
-}
-
-static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode )
-{
- time_t now;
-
- now = _IMFS_get_time();
-
- jnode->stat_mtime = now;
- jnode->stat_ctime = now;
-}
-
typedef struct {
const IMFS_mknod_control *directory;
const IMFS_mknod_control *device;
diff --git a/cpukit/include/rtems/imfsimpl.h b/cpukit/include/rtems/imfsimpl.h
new file mode 100644
index 0000000000..db1ae32af7
--- /dev/null
+++ b/cpukit/include/rtems/imfsimpl.h
@@ -0,0 +1,92 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @brief This header file contains interfaces used by the implementation of
+ * the In-Memory File System.
+ */
+
+/*
+ * Copyright (C) 2013, 2018 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_IMFSIMPL_H
+#define _RTEMS_IMFSIMPL_H
+
+#include <rtems/imfs.h>
+#include <rtems/score/timecounter.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup IMFS
+ *
+ * @{
+ */
+
+static inline time_t _IMFS_get_time( void )
+{
+ struct bintime now;
+
+ /* Use most efficient way to get the time in seconds (CLOCK_REALTIME) */
+ _Timecounter_Getbintime( &now );
+
+ return now.sec;
+}
+
+static inline void IMFS_update_atime( IMFS_jnode_t *jnode )
+{
+ jnode->stat_atime = _IMFS_get_time();
+}
+
+static inline void IMFS_update_mtime( IMFS_jnode_t *jnode )
+{
+ jnode->stat_mtime = _IMFS_get_time();
+}
+
+static inline void IMFS_update_ctime( IMFS_jnode_t *jnode )
+{
+ jnode->stat_ctime = _IMFS_get_time();
+}
+
+static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode )
+{
+ time_t now;
+
+ now = _IMFS_get_time();
+
+ jnode->stat_mtime = now;
+ jnode->stat_ctime = now;
+}
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_IMFSIMPL_H */
diff --git a/cpukit/include/rtems/init.h b/cpukit/include/rtems/init.h
index a821f92107..d386a0bcea 100644
--- a/cpukit/include/rtems/init.h
+++ b/cpukit/include/rtems/init.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassic
+ *
* @brief This header file defines the Initialization Manager API.
*/
diff --git a/cpukit/include/rtems/ioimpl.h b/cpukit/include/rtems/ioimpl.h
index dff474dcac..3be4df286b 100644
--- a/cpukit/include/rtems/ioimpl.h
+++ b/cpukit/include/rtems/ioimpl.h
@@ -70,7 +70,7 @@ void _IO_Initialize_all_drivers( void );
ISR_LOCK_DECLARE( extern, _IO_Driver_registration_lock )
-RTEMS_INLINE_ROUTINE void _IO_Driver_registration_acquire(
+static inline void _IO_Driver_registration_acquire(
ISR_lock_Context *lock_context
)
{
@@ -80,7 +80,7 @@ RTEMS_INLINE_ROUTINE void _IO_Driver_registration_acquire(
);
}
-RTEMS_INLINE_ROUTINE void _IO_Driver_registration_release(
+static inline void _IO_Driver_registration_release(
ISR_lock_Context *lock_context
)
{
diff --git a/cpukit/include/rtems/libcsupport.h b/cpukit/include/rtems/libcsupport.h
index 212eb16e59..67a09dc2a2 100644
--- a/cpukit/include/rtems/libcsupport.h
+++ b/cpukit/include/rtems/libcsupport.h
@@ -96,27 +96,33 @@ extern int malloc_info(Heap_Information_block *the_info);
/*
* Prototypes required to install newlib reentrancy user extension
*/
+
+#ifdef _REENT_THREAD_LOCAL
+#define _NEWLIB_CREATE_HOOK NULL
+#else
bool newlib_create_hook(
rtems_tcb *current_task,
rtems_tcb *creating_task
);
+#define _NEWLIB_CREATE_HOOK newlib_create_hook
+#endif
void newlib_terminate_hook(
rtems_tcb *current_task
);
#define RTEMS_NEWLIB_EXTENSION \
-{ \
- newlib_create_hook, /* rtems_task_create */ \
- 0, /* rtems_task_start */ \
- 0, /* rtems_task_restart */ \
- 0, /* rtems_task_delete */ \
- 0, /* task_switch */ \
- 0, /* task_begin */ \
- 0, /* task_exitted */ \
- 0, /* fatal */ \
- newlib_terminate_hook /* thread terminate */ \
-}
+ { \
+ _NEWLIB_CREATE_HOOK, /* thread_create */ \
+ NULL, /* thread_start */ \
+ NULL, /* thread_restart */ \
+ NULL, /* thread_delete */ \
+ NULL, /* thread_switch */ \
+ NULL, /* thread_begin */ \
+ NULL, /* thread_exitted */ \
+ NULL, /* fatal */ \
+ newlib_terminate_hook /* thread_terminate */ \
+ }
typedef struct {
uint32_t active_barriers;
diff --git a/cpukit/include/rtems/libio.h b/cpukit/include/rtems/libio.h
index 5379d92e4a..041fc050ad 100644
--- a/cpukit/include/rtems/libio.h
+++ b/cpukit/include/rtems/libio.h
@@ -1905,7 +1905,7 @@ typedef struct rtems_termios_callbacks {
int outputUsesInterrupts;
} rtems_termios_callbacks;
-RTEMS_INLINE_ROUTINE void rtems_termios_initialize( void )
+static inline void rtems_termios_initialize( void )
{
/* Nothing to do, provided for backward compatibility */
}
diff --git a/cpukit/include/rtems/linkersets.h b/cpukit/include/rtems/linkersets.h
index cdfcd54cde..c4b3e2b7dc 100644
--- a/cpukit/include/rtems/linkersets.h
+++ b/cpukit/include/rtems/linkersets.h
@@ -129,7 +129,7 @@ extern "C" {
decl \
RTEMS_SECTION( ".rtemsrwset." #set ".content" )
-RTEMS_INLINE_ROUTINE uintptr_t _Linker_set_Obfuscate( const void *ptr )
+static inline uintptr_t _Linker_set_Obfuscate( const void *ptr )
{
uintptr_t addr;
diff --git a/cpukit/include/rtems/malloc.h b/cpukit/include/rtems/malloc.h
index 7d7f8fa677..c26b262881 100644
--- a/cpukit/include/rtems/malloc.h
+++ b/cpukit/include/rtems/malloc.h
@@ -3,7 +3,12 @@
/**
* @file
*
- * This file defines the interface to RTEMS extensions to the Malloc Family.
+ * @ingroup MallocSupport
+ *
+ * @ingroup RTEMSAPIMalloc
+ *
+ * @brief This header file defines interfaces to support and use dynamic memory
+ * allocation.
*/
/*
@@ -46,11 +51,13 @@ extern "C" {
#endif
/**
- * @defgroup MallocSupport Malloc Support
+ * @defgroup MallocSupport Malloc Support
+ *
+ * @ingroup libcsupport
*
- * @ingroup libcsupport
+ * @brief This group contains interfaces to support dynamic memory allocation.
*
- * @brief RTEMS extensions to the Malloc Family
+ * @{
*/
/**
@@ -63,8 +70,6 @@ extern Heap_Control *RTEMS_Malloc_Heap;
void _Malloc_Initialize( void );
-void rtems_heap_set_sbrk_amount( ptrdiff_t sbrk_amount );
-
typedef void *(*rtems_heap_extend_handler)(
Heap_Control *heap,
size_t alloc_size
@@ -78,19 +83,6 @@ void *rtems_heap_extend_via_sbrk(
size_t alloc_size
);
-/**
- * @brief Greedy allocate that empties the sbrk memory
- *
- * Afterwards all the sbrk avialable memory will have been allocated
- * to the provided heap.
- *
- * @see rtems_heap_extend_via_sbrk().
- */
-void rtems_heap_sbrk_greedy_allocate(
- Heap_Control *heap,
- size_t alloc_size
-);
-
void *rtems_heap_null_extend(
Heap_Control *heap,
size_t alloc_size
@@ -104,6 +96,34 @@ extern const rtems_heap_extend_handler rtems_malloc_extend_handler;
typedef void (*rtems_malloc_dirtier_t)(void *, size_t);
extern rtems_malloc_dirtier_t rtems_malloc_dirty_helper;
+/** @} */
+
+/**
+ * @defgroup RTEMSAPIMalloc Dynamic Memory Allocation
+ *
+ * @ingroup RTEMSAPI
+ *
+ * @brief This group contains non-standard interfaces to use dynamic memory
+ * allocation.
+ *
+ * @{
+ */
+
+void rtems_heap_set_sbrk_amount( ptrdiff_t sbrk_amount );
+
+/**
+ * @brief Greedy allocate that empties the sbrk memory
+ *
+ * Afterwards all the sbrk avialable memory will have been allocated
+ * to the provided heap.
+ *
+ * @see rtems_heap_extend_via_sbrk().
+ */
+void rtems_heap_sbrk_greedy_allocate(
+ Heap_Control *heap,
+ size_t alloc_size
+);
+
/**
* @brief Dirty Memory Function
*
@@ -251,6 +271,8 @@ void *rtems_heap_greedy_allocate_all_except_largest(
*/
void rtems_heap_greedy_free( void *opaque );
+/** @} */
+
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/include/rtems/mallocinitmulti.h b/cpukit/include/rtems/mallocinitmulti.h
index a64c6e4802..45b52e7dc6 100644
--- a/cpukit/include/rtems/mallocinitmulti.h
+++ b/cpukit/include/rtems/mallocinitmulti.h
@@ -54,7 +54,7 @@ extern "C" {
* memory area via _Memory_Get() to implement
* _Workspace_Malloc_initialize_separate().
*/
-RTEMS_INLINE_ROUTINE Heap_Control *_Malloc_Initialize_for_multiple_areas(
+static inline Heap_Control *_Malloc_Initialize_for_multiple_areas(
Heap_Control *heap
)
{
diff --git a/cpukit/include/rtems/mallocinitone.h b/cpukit/include/rtems/mallocinitone.h
index eaa0d8eb3e..1e28df137c 100644
--- a/cpukit/include/rtems/mallocinitone.h
+++ b/cpukit/include/rtems/mallocinitone.h
@@ -54,7 +54,7 @@ extern "C" {
* This implementation should be used by BSPs which provide exactly one memory
* area via _Memory_Get() to implement _Workspace_Malloc_initialize_separate().
*/
-RTEMS_INLINE_ROUTINE Heap_Control *_Malloc_Initialize_for_one_area(
+static inline Heap_Control *_Malloc_Initialize_for_one_area(
Heap_Control *heap
)
{
diff --git a/cpukit/include/rtems/media.h b/cpukit/include/rtems/media.h
index 7868267d6c..9a8cf2d4e2 100644
--- a/cpukit/include/rtems/media.h
+++ b/cpukit/include/rtems/media.h
@@ -343,7 +343,7 @@ typedef rtems_status_code (*rtems_media_worker)(
* @retval RTEMS_SUCCESSFUL Successful operation.
* @retval RTEMS_NO_MEMORY Not enough resources.
*/
-RTEMS_INLINE_ROUTINE rtems_status_code rtems_media_initialize(void)
+static inline rtems_status_code rtems_media_initialize(void)
{
return RTEMS_SUCCESSFUL;
}
diff --git a/cpukit/include/rtems/posix/condimpl.h b/cpukit/include/rtems/posix/condimpl.h
index 10c044de72..5bbc35c4b3 100644
--- a/cpukit/include/rtems/posix/condimpl.h
+++ b/cpukit/include/rtems/posix/condimpl.h
@@ -82,7 +82,7 @@ static inline POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get(
return (POSIX_Condition_variables_Control *) cond;
}
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Initialize(
+static inline void _POSIX_Condition_variables_Initialize(
POSIX_Condition_variables_Control *the_cond,
const pthread_condattr_t *the_attr
)
@@ -102,14 +102,14 @@ RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Initialize(
the_cond->flags = flags;
}
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Destroy(
+static inline void _POSIX_Condition_variables_Destroy(
POSIX_Condition_variables_Control *the_cond
)
{
the_cond->flags = ~the_cond->flags;
}
-RTEMS_INLINE_ROUTINE clockid_t _POSIX_Condition_variables_Get_clock(
+static inline clockid_t _POSIX_Condition_variables_Get_clock(
unsigned long flags
)
{
@@ -120,7 +120,7 @@ RTEMS_INLINE_ROUTINE clockid_t _POSIX_Condition_variables_Get_clock(
return CLOCK_REALTIME;
}
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Condition_variables_Acquire(
+static inline Thread_Control *_POSIX_Condition_variables_Acquire(
POSIX_Condition_variables_Control *the_cond,
Thread_queue_Context *queue_context
)
@@ -140,7 +140,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Condition_variables_Acquire(
return executing;
}
-RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Release(
+static inline void _POSIX_Condition_variables_Release(
POSIX_Condition_variables_Control *the_cond,
Thread_queue_Context *queue_context
)
diff --git a/cpukit/include/rtems/posix/keyimpl.h b/cpukit/include/rtems/posix/keyimpl.h
index 8f8644ca71..5ff269d95c 100644
--- a/cpukit/include/rtems/posix/keyimpl.h
+++ b/cpukit/include/rtems/posix/keyimpl.h
@@ -70,7 +70,7 @@ extern Freechain_Control _POSIX_Keys_Keypool;
* the inactive chain of free keys control blocks.
*/
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
+static inline POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
{
return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information );
}
@@ -81,20 +81,20 @@ RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void )
* This routine frees a keys control block to the
* inactive chain of free keys control blocks.
*/
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free(
+static inline void _POSIX_Keys_Free(
POSIX_Keys_Control *the_key
)
{
_Objects_Free( &_POSIX_Keys_Information, &the_key->Object );
}
-RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get( pthread_key_t key )
+static inline POSIX_Keys_Control *_POSIX_Keys_Get( pthread_key_t key )
{
return (POSIX_Keys_Control *)
_Objects_Get_no_protection( (Objects_Id) key, &_POSIX_Keys_Information );
}
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_acquire(
+static inline void _POSIX_Keys_Key_value_acquire(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -102,7 +102,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_acquire(
_ISR_lock_ISR_disable_and_acquire( &the_thread->Keys.Lock, lock_context );
}
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_release(
+static inline void _POSIX_Keys_Key_value_release(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -112,7 +112,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_release(
POSIX_Keys_Key_value_pair * _POSIX_Keys_Key_value_allocate( void );
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_free(
+static inline void _POSIX_Keys_Key_value_free(
POSIX_Keys_Key_value_pair *key_value_pair
)
{
@@ -120,7 +120,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_free(
_Freechain_Put( &_POSIX_Keys_Keypool, key_value_pair );
}
-RTEMS_INLINE_ROUTINE bool _POSIX_Keys_Key_value_equal(
+static inline bool _POSIX_Keys_Key_value_equal(
const void *left,
const RBTree_Node *right
)
@@ -134,7 +134,7 @@ RTEMS_INLINE_ROUTINE bool _POSIX_Keys_Key_value_equal(
return *the_left == the_right->key;
}
-RTEMS_INLINE_ROUTINE bool _POSIX_Keys_Key_value_less(
+static inline bool _POSIX_Keys_Key_value_less(
const void *left,
const RBTree_Node *right
)
@@ -148,12 +148,12 @@ RTEMS_INLINE_ROUTINE bool _POSIX_Keys_Key_value_less(
return *the_left < the_right->key;
}
-RTEMS_INLINE_ROUTINE void *_POSIX_Keys_Key_value_map( RBTree_Node *node )
+static inline void *_POSIX_Keys_Key_value_map( RBTree_Node *node )
{
return POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node );
}
-RTEMS_INLINE_ROUTINE POSIX_Keys_Key_value_pair *_POSIX_Keys_Key_value_find(
+static inline POSIX_Keys_Key_value_pair *_POSIX_Keys_Key_value_find(
pthread_key_t key,
const Thread_Control *the_thread
)
@@ -167,7 +167,7 @@ RTEMS_INLINE_ROUTINE POSIX_Keys_Key_value_pair *_POSIX_Keys_Key_value_find(
);
}
-RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_insert(
+static inline void _POSIX_Keys_Key_value_insert(
pthread_key_t key,
POSIX_Keys_Key_value_pair *key_value_pair,
Thread_Control *the_thread
diff --git a/cpukit/include/rtems/posix/mqueueimpl.h b/cpukit/include/rtems/posix/mqueueimpl.h
index 127709c0f1..c2749db1e2 100644
--- a/cpukit/include/rtems/posix/mqueueimpl.h
+++ b/cpukit/include/rtems/posix/mqueueimpl.h
@@ -99,7 +99,7 @@ int _POSIX_Message_queue_Send_support(
Thread_queue_Enqueue_callout enqueue_callout
);
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *
+static inline POSIX_Message_queue_Control *
_POSIX_Message_queue_Allocate_unprotected( void )
{
return (POSIX_Message_queue_Control *)
@@ -112,7 +112,7 @@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *
* This routine frees a message queue control block to the
* inactive chain of free message queue control blocks.
*/
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free(
+static inline void _POSIX_Message_queue_Free(
POSIX_Message_queue_Control *the_mq
)
{
@@ -120,7 +120,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free(
}
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get(
+static inline POSIX_Message_queue_Control *_POSIX_Message_queue_Get(
Objects_Id id,
Thread_queue_Context *queue_context
)
@@ -139,7 +139,7 @@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get(
* This method converts a POSIX message priority to the priorities used
* by the Score.
*/
-RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types
+static inline CORE_message_queue_Submit_types
_POSIX_Message_queue_Priority_to_core(
unsigned int priority
)
@@ -154,7 +154,7 @@ RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types
* This method converts a POSIX message priority from the priorities used
* by the Score.
*/
-RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
+static inline unsigned int _POSIX_Message_queue_Priority_from_core(
CORE_message_queue_Submit_types priority
)
{
@@ -165,7 +165,7 @@ RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
/**
* @brief POSIX Message Queue Remove from Namespace
*/
-RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Namespace_remove (
+static inline void _POSIX_Message_queue_Namespace_remove (
POSIX_Message_queue_Control *the_mq
)
{
@@ -175,7 +175,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Namespace_remove (
);
}
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *
+static inline POSIX_Message_queue_Control *
_POSIX_Message_queue_Get_by_name(
const char *name,
size_t *name_length_p,
diff --git a/cpukit/include/rtems/posix/muteximpl.h b/cpukit/include/rtems/posix/muteximpl.h
index e2b4e187d1..8dffea80a5 100644
--- a/cpukit/include/rtems/posix/muteximpl.h
+++ b/cpukit/include/rtems/posix/muteximpl.h
@@ -4,8 +4,8 @@
* @file
*
* @brief Private Inlined Routines for POSIX Mutex's.
- *
- * This include file contains the static inline implementation of the private
+ *
+ * This include file contains the static inline implementation of the private
* inlined routines for POSIX mutex's.
*/
@@ -87,7 +87,7 @@ typedef enum {
*/
extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes;
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Mutex_Acquire(
+static inline Thread_Control *_POSIX_Mutex_Acquire(
POSIX_Mutex_Control *the_mutex,
Thread_queue_Context *queue_context
)
@@ -108,7 +108,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Mutex_Acquire(
return executing;
}
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Release(
+static inline void _POSIX_Mutex_Release(
POSIX_Mutex_Control *the_mutex,
Thread_queue_Context *queue_context
)
@@ -119,28 +119,28 @@ RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Release(
);
}
-RTEMS_INLINE_ROUTINE POSIX_Mutex_Protocol _POSIX_Mutex_Get_protocol(
+static inline POSIX_Mutex_Protocol _POSIX_Mutex_Get_protocol(
unsigned long flags
)
{
- return flags & POSIX_MUTEX_PROTOCOL_MASK;
+ return (POSIX_Mutex_Protocol) (flags & POSIX_MUTEX_PROTOCOL_MASK);
}
-RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_recursive(
+static inline bool _POSIX_Mutex_Is_recursive(
unsigned long flags
)
{
return ( flags & POSIX_MUTEX_RECURSIVE ) != 0;
}
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Mutex_Get_owner(
+static inline Thread_Control *_POSIX_Mutex_Get_owner(
const POSIX_Mutex_Control *the_mutex
)
{
return the_mutex->Recursive.Mutex.Queue.Queue.owner;
}
-RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_locked(
+static inline bool _POSIX_Mutex_Is_locked(
const POSIX_Mutex_Control *the_mutex
)
{
@@ -155,7 +155,7 @@ Status_Control _POSIX_Mutex_Seize_slow(
Thread_queue_Context *queue_context
);
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Set_owner(
+static inline void _POSIX_Mutex_Set_owner(
POSIX_Mutex_Control *the_mutex,
Thread_Control *owner
)
@@ -163,7 +163,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Set_owner(
the_mutex->Recursive.Mutex.Queue.Queue.owner = owner;
}
-RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_owner(
+static inline bool _POSIX_Mutex_Is_owner(
const POSIX_Mutex_Control *the_mutex,
const Thread_Control *the_thread
)
@@ -185,7 +185,7 @@ static Status_Control _POSIX_Mutex_Lock_nested(
}
}
-RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Seize(
+static inline Status_Control _POSIX_Mutex_Seize(
POSIX_Mutex_Control *the_mutex,
unsigned long flags,
const Thread_queue_Operations *operations,
@@ -222,7 +222,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Seize(
);
}
-RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Surrender(
+static inline Status_Control _POSIX_Mutex_Surrender(
POSIX_Mutex_Control *the_mutex,
const Thread_queue_Operations *operations,
Thread_Control *executing,
@@ -265,7 +265,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Surrender(
return STATUS_SUCCESSFUL;
}
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_POSIX_Mutex_Get_scheduler(
+static inline const Scheduler_Control *_POSIX_Mutex_Get_scheduler(
const POSIX_Mutex_Control *the_mutex
)
{
@@ -276,7 +276,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_POSIX_Mutex_Get_scheduler(
#endif
}
-RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Set_priority(
+static inline void _POSIX_Mutex_Set_priority(
POSIX_Mutex_Control *the_mutex,
Priority_Control priority_ceiling,
Thread_queue_Context *queue_context
@@ -301,14 +301,14 @@ RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Set_priority(
}
}
-RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Mutex_Get_priority(
+static inline Priority_Control _POSIX_Mutex_Get_priority(
const POSIX_Mutex_Control *the_mutex
)
{
return the_mutex->Priority_ceiling.priority;
}
-RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_set_owner(
+static inline Status_Control _POSIX_Mutex_Ceiling_set_owner(
POSIX_Mutex_Control *the_mutex,
Thread_Control *owner,
Thread_queue_Context *queue_context
@@ -347,7 +347,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_set_owner(
return STATUS_SUCCESSFUL;
}
-RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_seize(
+static inline Status_Control _POSIX_Mutex_Ceiling_seize(
POSIX_Mutex_Control *the_mutex,
unsigned long flags,
Thread_Control *executing,
@@ -395,7 +395,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_seize(
);
}
-RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_surrender(
+static inline Status_Control _POSIX_Mutex_Ceiling_surrender(
POSIX_Mutex_Control *the_mutex,
Thread_Control *executing,
Thread_queue_Context *queue_context
@@ -465,4 +465,3 @@ bool _POSIX_Mutex_Auto_initialization( POSIX_Mutex_Control *the_mutex );
#endif
/* end of include file */
-
diff --git a/cpukit/include/rtems/posix/posixapi.h b/cpukit/include/rtems/posix/posixapi.h
index d166608774..24c1dc51e0 100644
--- a/cpukit/include/rtems/posix/posixapi.h
+++ b/cpukit/include/rtems/posix/posixapi.h
@@ -59,7 +59,7 @@
extern const int _POSIX_Get_by_name_error_table[ 3 ];
-RTEMS_INLINE_ROUTINE int _POSIX_Get_by_name_error(
+static inline int _POSIX_Get_by_name_error(
Objects_Get_by_name_error error
)
{
@@ -67,19 +67,19 @@ RTEMS_INLINE_ROUTINE int _POSIX_Get_by_name_error(
return _POSIX_Get_by_name_error_table[ error ];
}
-RTEMS_INLINE_ROUTINE int _POSIX_Get_error( Status_Control status )
+static inline int _POSIX_Get_error( Status_Control status )
{
return STATUS_GET_POSIX( status );
}
-RTEMS_INLINE_ROUTINE int _POSIX_Get_error_after_wait(
+static inline int _POSIX_Get_error_after_wait(
const Thread_Control *executing
)
{
return _POSIX_Get_error( _Thread_Wait_get_status( executing ) );
}
-RTEMS_INLINE_ROUTINE int _POSIX_Zero_or_minus_one_plus_errno(
+static inline int _POSIX_Zero_or_minus_one_plus_errno(
Status_Control status
)
{
@@ -97,7 +97,7 @@ RTEMS_INLINE_ROUTINE int _POSIX_Zero_or_minus_one_plus_errno(
*
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_09
*/
-RTEMS_INLINE_ROUTINE bool _POSIX_Is_valid_pshared( int pshared )
+static inline bool _POSIX_Is_valid_pshared( int pshared )
{
return pshared == PTHREAD_PROCESS_PRIVATE ||
pshared == PTHREAD_PROCESS_SHARED;
diff --git a/cpukit/include/rtems/posix/priorityimpl.h b/cpukit/include/rtems/posix/priorityimpl.h
index e391448372..2cb1bb22fc 100644
--- a/cpukit/include/rtems/posix/priorityimpl.h
+++ b/cpukit/include/rtems/posix/priorityimpl.h
@@ -68,7 +68,7 @@ extern "C" {
*
* @return The maximum POSIX API priority for this scheduler instance.
*/
-RTEMS_INLINE_ROUTINE int _POSIX_Priority_Get_maximum(
+static inline int _POSIX_Priority_Get_maximum(
const Scheduler_Control *scheduler
)
{
@@ -84,7 +84,7 @@ RTEMS_INLINE_ROUTINE int _POSIX_Priority_Get_maximum(
* Thus, SuperCore has priorities run in the opposite sense of the POSIX API.
*
* Let N be the maximum priority of this scheduler instance. The SuperCore
- * priority zero is system reserved (PRIORITY_PSEUDO_ISR). There are only
+ * priority zero is system reserved (PRIORITY_MINIMUM). There are only
* N - 1 POSIX API priority levels since a thread at SuperCore priority N would
* never run because of the idle threads. This is necessary because GNAT maps
* the lowest Ada task priority to the lowest thread priority. The lowest
diff --git a/cpukit/include/rtems/posix/psignalimpl.h b/cpukit/include/rtems/posix/psignalimpl.h
index c5c02edf65..16c9b38607 100644
--- a/cpukit/include/rtems/posix/psignalimpl.h
+++ b/cpukit/include/rtems/posix/psignalimpl.h
@@ -92,14 +92,14 @@ extern Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ];
* Internal routines
*/
-RTEMS_INLINE_ROUTINE void _POSIX_signals_Acquire(
+static inline void _POSIX_signals_Acquire(
Thread_queue_Context *queue_context
)
{
_Thread_queue_Acquire( &_POSIX_signals_Wait_queue, queue_context );
}
-RTEMS_INLINE_ROUTINE void _POSIX_signals_Release(
+static inline void _POSIX_signals_Release(
Thread_queue_Context *queue_context
)
{
diff --git a/cpukit/include/rtems/posix/pthreadattrimpl.h b/cpukit/include/rtems/posix/pthreadattrimpl.h
index b94c6fc193..726519c690 100644
--- a/cpukit/include/rtems/posix/pthreadattrimpl.h
+++ b/cpukit/include/rtems/posix/pthreadattrimpl.h
@@ -60,7 +60,7 @@ extern "C" {
*/
extern const pthread_attr_t _POSIX_Threads_Default_attributes;
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Copy_attributes(
+static inline void _POSIX_Threads_Copy_attributes(
pthread_attr_t *dst_attr,
const pthread_attr_t *src_attr
)
@@ -72,7 +72,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Copy_attributes(
dst_attr->affinityset = &dst_attr->affinitysetpreallocated;
}
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Initialize_attributes(
+static inline void _POSIX_Threads_Initialize_attributes(
pthread_attr_t *attr
)
{
@@ -82,7 +82,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Initialize_attributes(
);
}
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Get_sched_param_sporadic(
+static inline void _POSIX_Threads_Get_sched_param_sporadic(
const Thread_Control *the_thread,
const Scheduler_Control *scheduler,
struct sched_param *param
@@ -91,7 +91,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Get_sched_param_sporadic(
#if defined(RTEMS_POSIX_API)
const POSIX_API_Control *api;
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
+ api = (const POSIX_API_Control*) the_thread->API_Extensions[ THREAD_API_POSIX ];
param->sched_ss_low_priority = _POSIX_Priority_From_core(
scheduler,
api->Sporadic.Low_priority.priority
diff --git a/cpukit/include/rtems/posix/pthreadimpl.h b/cpukit/include/rtems/posix/pthreadimpl.h
index 2f75b4aafb..3e76f2792a 100644
--- a/cpukit/include/rtems/posix/pthreadimpl.h
+++ b/cpukit/include/rtems/posix/pthreadimpl.h
@@ -61,7 +61,7 @@ extern "C" {
#define PTHREAD_MINIMUM_STACK_SIZE _POSIX_Threads_Minimum_stack_size
#if defined(RTEMS_POSIX_API)
-RTEMS_INLINE_ROUTINE void _POSIX_Threads_Sporadic_timer_insert(
+static inline void _POSIX_Threads_Sporadic_timer_insert(
Thread_Control *the_thread,
POSIX_API_Control *api
)
@@ -109,7 +109,7 @@ int _POSIX_Thread_Translate_sched_param(
Thread_Configuration *config
);
-RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate(void)
+static inline Thread_Control *_POSIX_Threads_Allocate(void)
{
_Objects_Allocator_lock();
diff --git a/cpukit/include/rtems/posix/rwlockimpl.h b/cpukit/include/rtems/posix/rwlockimpl.h
index 2f77cbabad..f17967b1f6 100644
--- a/cpukit/include/rtems/posix/rwlockimpl.h
+++ b/cpukit/include/rtems/posix/rwlockimpl.h
@@ -54,7 +54,7 @@ typedef struct {
CORE_RWLock_Control RWLock;
} POSIX_RWLock_Control;
-RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Get(
+static inline POSIX_RWLock_Control *_POSIX_RWLock_Get(
pthread_rwlock_t *rwlock
)
{
diff --git a/cpukit/include/rtems/posix/semaphoreimpl.h b/cpukit/include/rtems/posix/semaphoreimpl.h
index b10e3731c5..7f322c21c0 100644
--- a/cpukit/include/rtems/posix/semaphoreimpl.h
+++ b/cpukit/include/rtems/posix/semaphoreimpl.h
@@ -53,7 +53,7 @@ extern "C" {
*/
#define POSIX_SEMAPHORE_MAGIC 0x5d367fe7UL
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *
+static inline POSIX_Semaphore_Control *
_POSIX_Semaphore_Allocate_unprotected( void )
{
return (POSIX_Semaphore_Control *)
@@ -66,31 +66,31 @@ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *
* This routine frees a semaphore control block to the
* inactive chain of free semaphore control blocks.
*/
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
+static inline void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
}
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get(
+static inline POSIX_Semaphore_Control *_POSIX_Semaphore_Get(
sem_t *sem
)
{
return RTEMS_CONTAINER_OF( sem, POSIX_Semaphore_Control, Semaphore );
}
-RTEMS_INLINE_ROUTINE bool _POSIX_Semaphore_Is_named( const sem_t *sem )
+static inline bool _POSIX_Semaphore_Is_named( const sem_t *sem )
{
return sem->_Semaphore._Queue._name != NULL;
}
-RTEMS_INLINE_ROUTINE bool _POSIX_Semaphore_Is_busy( const sem_t *sem )
+static inline bool _POSIX_Semaphore_Is_busy( const sem_t *sem )
{
return sem->_Semaphore._Queue._heads != NULL;
}
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Initialize(
+static inline void _POSIX_Semaphore_Initialize(
sem_t *sem,
const char *name,
unsigned int value
@@ -100,7 +100,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Initialize(
_Semaphore_Initialize_named( &sem->_Semaphore, name, value );
}
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Destroy( sem_t *sem )
+static inline void _POSIX_Semaphore_Destroy( sem_t *sem )
{
sem->_flags = 0;
_Semaphore_Destroy( &sem->_Semaphore );
@@ -116,7 +116,7 @@ void _POSIX_Semaphore_Delete( POSIX_Semaphore_Control *the_semaphore );
/**
* @brief POSIX Semaphore Namespace Remove
*/
-RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Namespace_remove (
+static inline void _POSIX_Semaphore_Namespace_remove (
POSIX_Semaphore_Control *the_semaphore
)
{
@@ -126,7 +126,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Namespace_remove (
);
}
-RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get_by_name(
+static inline POSIX_Semaphore_Control *_POSIX_Semaphore_Get_by_name(
const char *name,
size_t *name_length_p,
Objects_Get_by_name_error *error
diff --git a/cpukit/include/rtems/posix/shmimpl.h b/cpukit/include/rtems/posix/shmimpl.h
index b0630acbe1..b5f8847b0c 100644
--- a/cpukit/include/rtems/posix/shmimpl.h
+++ b/cpukit/include/rtems/posix/shmimpl.h
@@ -50,7 +50,7 @@ extern "C" {
* @{
*/
-RTEMS_INLINE_ROUTINE POSIX_Shm_Control *_POSIX_Shm_Allocate_unprotected( void )
+static inline POSIX_Shm_Control *_POSIX_Shm_Allocate_unprotected( void )
{
return (POSIX_Shm_Control *)
_Objects_Allocate_unprotected( &_POSIX_Shm_Information );
@@ -61,14 +61,14 @@ RTEMS_INLINE_ROUTINE POSIX_Shm_Control *_POSIX_Shm_Allocate_unprotected( void )
*
* This routine frees a shm control block.
*/
-RTEMS_INLINE_ROUTINE void _POSIX_Shm_Free (
+static inline void _POSIX_Shm_Free (
POSIX_Shm_Control *the_shm
)
{
_Objects_Free( &_POSIX_Shm_Information, &the_shm->Object );
}
-RTEMS_INLINE_ROUTINE POSIX_Shm_Control *_POSIX_Shm_Get_by_name(
+static inline POSIX_Shm_Control *_POSIX_Shm_Get_by_name(
const char *name,
size_t *name_length_p,
Objects_Get_by_name_error *error
@@ -82,7 +82,7 @@ RTEMS_INLINE_ROUTINE POSIX_Shm_Control *_POSIX_Shm_Get_by_name(
);
}
-RTEMS_INLINE_ROUTINE void _POSIX_Shm_Update_atime(
+static inline void _POSIX_Shm_Update_atime(
POSIX_Shm_Control *shm
)
{
@@ -91,7 +91,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Shm_Update_atime(
shm->atime = now.tv_sec;
}
-RTEMS_INLINE_ROUTINE void _POSIX_Shm_Update_mtime_ctime(
+static inline void _POSIX_Shm_Update_mtime_ctime(
POSIX_Shm_Control *shm
)
{
diff --git a/cpukit/include/rtems/posix/spinlockimpl.h b/cpukit/include/rtems/posix/spinlockimpl.h
index be3245f90a..a5e5bb1850 100644
--- a/cpukit/include/rtems/posix/spinlockimpl.h
+++ b/cpukit/include/rtems/posix/spinlockimpl.h
@@ -62,7 +62,7 @@ typedef struct {
ISR_Level interrupt_state;
} POSIX_Spinlock_Control;
-RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get(
+static inline POSIX_Spinlock_Control *_POSIX_Spinlock_Get(
pthread_spinlock_t *lock
)
{
diff --git a/cpukit/include/rtems/posix/timer.h b/cpukit/include/rtems/posix/timer.h
index 05a6f36eab..86b45ba05d 100644
--- a/cpukit/include/rtems/posix/timer.h
+++ b/cpukit/include/rtems/posix/timer.h
@@ -94,6 +94,24 @@ extern Objects_Information _POSIX_Timer_Information;
NULL \
)
+/**
+ * @brief Follow POSIX or FACE Technical Standard on timer_create
+ *
+ * POSIX allows for the creation of timers based on CLOCK_REALTIME.
+ * This is viewed as a safety issue by the FACE Technical Standard
+ * and required to return an error. These are conflicting behaviors.
+ * This method is instanced by configuration when FACE conformant
+ * behavior is desired by the application.
+ *
+ * @param[in] clock_id is the clock ID to validate
+ *
+ * @return 0 if @a clock_id is allowed for use. Otherwise an errno value.
+ */
+int _POSIX_Timer_Is_allowed(
+ clockid_t clock_id
+);
+
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/posix/timerimpl.h b/cpukit/include/rtems/posix/timerimpl.h
index 8f92186e30..f0622b6026 100644
--- a/cpukit/include/rtems/posix/timerimpl.h
+++ b/cpukit/include/rtems/posix/timerimpl.h
@@ -76,7 +76,7 @@ extern "C" {
* This function allocates a timer control block from
* the inactive chain of free timer control blocks.
*/
-RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void )
+static inline POSIX_Timer_Control *_POSIX_Timer_Allocate( void )
{
return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information );
}
@@ -87,7 +87,7 @@ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void )
* This routine frees a timer control block to the
* inactive chain of free timer control blocks.
*/
-RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free (
+static inline void _POSIX_Timer_Free (
POSIX_Timer_Control *the_timer
)
{
@@ -105,7 +105,7 @@ void _POSIX_Timer_TSR( Watchdog_Control *the_watchdog );
* is set to OBJECTS_LOCAL. Otherwise, location is set
* to OBJECTS_ERROR and the returned value is undefined.
*/
-RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get (
+static inline POSIX_Timer_Control *_POSIX_Timer_Get (
timer_t id,
ISR_lock_Context *lock_context
)
@@ -117,7 +117,7 @@ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get (
);
}
-RTEMS_INLINE_ROUTINE Per_CPU_Control *_POSIX_Timer_Acquire_critical(
+static inline Per_CPU_Control *_POSIX_Timer_Acquire_critical(
POSIX_Timer_Control *ptimer,
ISR_lock_Context *lock_context
)
@@ -130,7 +130,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_POSIX_Timer_Acquire_critical(
return cpu;
}
-RTEMS_INLINE_ROUTINE void _POSIX_Timer_Release(
+static inline void _POSIX_Timer_Release(
Per_CPU_Control *cpu,
ISR_lock_Context *lock_context
)
diff --git a/cpukit/include/rtems/pty.h b/cpukit/include/rtems/pty.h
index 46d07602b4..e9303a1be3 100644
--- a/cpukit/include/rtems/pty.h
+++ b/cpukit/include/rtems/pty.h
@@ -39,7 +39,7 @@ typedef struct {
const char *rtems_pty_initialize(rtems_pty_context *pty, uintptr_t unique);
-RTEMS_INLINE_ROUTINE const char *rtems_pty_get_path(const rtems_pty_context *pty)
+static inline const char *rtems_pty_get_path(const rtems_pty_context *pty)
{
return pty->name;
}
diff --git a/cpukit/include/rtems/qreslib.h b/cpukit/include/rtems/qreslib.h
index f06925674b..a8e70433a1 100644
--- a/cpukit/include/rtems/qreslib.h
+++ b/cpukit/include/rtems/qreslib.h
@@ -98,7 +98,7 @@ typedef struct {
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_init ( void )
+static inline qos_rv qres_init ( void )
{
return _Scheduler_CBS_Initialize();
}
@@ -110,7 +110,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_init ( void )
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_cleanup ( void )
+static inline qos_rv qres_cleanup ( void )
{
return _Scheduler_CBS_Cleanup();
}
@@ -122,7 +122,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_cleanup ( void )
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_create_server (
+static inline qos_rv qres_create_server (
qres_params_t *params,
qres_sid_t *server_id
)
@@ -141,7 +141,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_create_server (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_attach_thread (
+static inline qos_rv qres_attach_thread (
qres_sid_t server_id,
pid_t pid,
tid_t task_id
@@ -157,7 +157,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_attach_thread (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_detach_thread (
+static inline qos_rv qres_detach_thread (
qres_sid_t server_id,
pid_t pid,
tid_t task_id
@@ -173,7 +173,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_detach_thread (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_destroy_server (
+static inline qos_rv qres_destroy_server (
qres_sid_t server_id
)
{
@@ -188,7 +188,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_destroy_server (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_get_sid (
+static inline qos_rv qres_get_sid (
pid_t pid,
tid_t task_id,
qres_sid_t *server_id
@@ -204,7 +204,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_get_sid (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_get_params (
+static inline qos_rv qres_get_params (
qres_sid_t server_id,
qres_params_t *params
)
@@ -222,7 +222,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_get_params (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_set_params (
+static inline qos_rv qres_set_params (
qres_sid_t server_id,
qres_params_t *params
)
@@ -240,7 +240,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_set_params (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_get_exec_time (
+static inline qos_rv qres_get_exec_time (
qres_sid_t server_id,
qres_time_t *exec_time,
qres_atime_t *abs_time
@@ -256,7 +256,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_get_exec_time (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_get_curr_budget (
+static inline qos_rv qres_get_curr_budget (
qres_sid_t server_id,
qres_time_t *current_budget
)
@@ -272,7 +272,7 @@ RTEMS_INLINE_ROUTINE qos_rv qres_get_curr_budget (
*
* @return status code.
*/
-RTEMS_INLINE_ROUTINE qos_rv qres_get_appr_budget (
+static inline qos_rv qres_get_appr_budget (
qres_sid_t server_id,
qres_time_t *appr_budget
)
diff --git a/cpukit/include/rtems/rbtree.h b/cpukit/include/rtems/rbtree.h
index 73b0d1bbfc..45d08701da 100644
--- a/cpukit/include/rtems/rbtree.h
+++ b/cpukit/include/rtems/rbtree.h
@@ -139,7 +139,7 @@ void rtems_rbtree_initialize(
*
* This routine initializes @a the_rbtree to contain zero nodes.
*/
-RTEMS_INLINE_ROUTINE void rtems_rbtree_initialize_empty(
+static inline void rtems_rbtree_initialize_empty(
rtems_rbtree_control *the_rbtree
)
{
@@ -152,7 +152,7 @@ RTEMS_INLINE_ROUTINE void rtems_rbtree_initialize_empty(
* This function sets the next and previous fields of the @a node to NULL
* indicating the @a node is not part of any rbtree.
*/
-RTEMS_INLINE_ROUTINE void rtems_rbtree_set_off_tree(
+static inline void rtems_rbtree_set_off_tree(
rtems_rbtree_node *node
)
{
@@ -165,7 +165,7 @@ RTEMS_INLINE_ROUTINE void rtems_rbtree_set_off_tree(
* This function returns true if the @a node is not on a rbtree. A @a node is
* off rbtree if the next and previous fields are set to NULL.
*/
-RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_node_off_tree(
+static inline bool rtems_rbtree_is_node_off_tree(
const rtems_rbtree_node *node
)
{
@@ -177,7 +177,7 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_node_off_tree(
*
* This function returns a pointer to the root node of @a the_rbtree.
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_root(
+static inline rtems_rbtree_node *rtems_rbtree_root(
const rtems_rbtree_control *the_rbtree
)
{
@@ -187,7 +187,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_root(
/**
* @copydoc _RBTree_Minimum()
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_min(
+static inline rtems_rbtree_node *rtems_rbtree_min(
const rtems_rbtree_control *the_rbtree
)
{
@@ -197,7 +197,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_min(
/**
* @copydoc _RBTree_Maximum()
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_max(
+static inline rtems_rbtree_node *rtems_rbtree_max(
const rtems_rbtree_control *the_rbtree
)
{
@@ -209,7 +209,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_max(
*
* This function returns a pointer to the left child node of @a the_node.
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_left(
+static inline rtems_rbtree_node *rtems_rbtree_left(
const rtems_rbtree_node *the_node
)
{
@@ -221,7 +221,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_left(
*
* This function returns a pointer to the right child node of @a the_node.
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_right(
+static inline rtems_rbtree_node *rtems_rbtree_right(
const rtems_rbtree_node *the_node
)
{
@@ -231,7 +231,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_right(
/**
* @copydoc _RBTree_Parent()
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_parent(
+static inline rtems_rbtree_node *rtems_rbtree_parent(
const rtems_rbtree_node *the_node
)
{
@@ -244,7 +244,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_parent(
* This function returns true if there a no nodes on @a the_rbtree and
* false otherwise.
*/
-RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_empty(
+static inline bool rtems_rbtree_is_empty(
const rtems_rbtree_control *the_rbtree
)
{
@@ -257,7 +257,7 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_empty(
* This function returns true if @a the_node is the min node on @a the_rbtree
* and false otherwise.
*/
-RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_min(
+static inline bool rtems_rbtree_is_min(
const rtems_rbtree_control *the_rbtree,
const rtems_rbtree_node *the_node
)
@@ -271,7 +271,7 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_min(
* This function returns true if @a the_node is the max node on @a the_rbtree
* and false otherwise.
*/
-RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_max(
+static inline bool rtems_rbtree_is_max(
const rtems_rbtree_control *the_rbtree,
const rtems_rbtree_node *the_node
)
@@ -282,28 +282,28 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_max(
/**
* @copydoc _RBTree_Is_root()
*/
-RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_root(
+static inline bool rtems_rbtree_is_root(
const rtems_rbtree_node *the_node
)
{
return _RBTree_Is_root( the_node );
}
-RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_equal(
+static inline bool rtems_rbtree_is_equal(
rtems_rbtree_compare_result compare_result
)
{
return compare_result == 0;
}
-RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_greater(
+static inline bool rtems_rbtree_is_greater(
rtems_rbtree_compare_result compare_result
)
{
return compare_result > 0;
}
-RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_lesser(
+static inline bool rtems_rbtree_is_lesser(
rtems_rbtree_compare_result compare_result
)
{
@@ -334,7 +334,7 @@ rtems_rbtree_node* rtems_rbtree_find(
/**
* @copydoc _RBTree_Predecessor()
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_predecessor(
+static inline rtems_rbtree_node* rtems_rbtree_predecessor(
const rtems_rbtree_node *node
)
{
@@ -344,7 +344,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_predecessor(
/**
* @copydoc _RBTree_Successor()
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_successor(
+static inline rtems_rbtree_node* rtems_rbtree_successor(
const rtems_rbtree_node *node
)
{
@@ -354,7 +354,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_successor(
/**
* @copydoc _RBTree_Extract()
*/
-RTEMS_INLINE_ROUTINE void rtems_rbtree_extract(
+static inline void rtems_rbtree_extract(
rtems_rbtree_control *the_rbtree,
rtems_rbtree_node *the_node
)
@@ -374,7 +374,7 @@ RTEMS_INLINE_ROUTINE void rtems_rbtree_extract(
* @retval NULL The tree is empty.
* @retval node A node with the minimal key value on the tree.
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_min(
+static inline rtems_rbtree_node *rtems_rbtree_get_min(
rtems_rbtree_control *the_rbtree
)
{
@@ -399,7 +399,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_min(
* @retval NULL The tree is empty.
* @retval node A node with the maximal key value on the tree.
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_max(
+static inline rtems_rbtree_node *rtems_rbtree_get_max(
rtems_rbtree_control *the_rbtree
)
{
@@ -419,7 +419,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_max(
* without changing the tree. If @a the_rbtree is empty,
* then NULL is returned.
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_peek_min(
+static inline rtems_rbtree_node *rtems_rbtree_peek_min(
const rtems_rbtree_control *the_rbtree
)
{
@@ -433,7 +433,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_peek_min(
* without changing the tree. If @a the_rbtree is empty,
* then NULL is returned.
*/
-RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_peek_max(
+static inline rtems_rbtree_node *rtems_rbtree_peek_max(
const rtems_rbtree_control *the_rbtree
)
{
diff --git a/cpukit/include/rtems/record.h b/cpukit/include/rtems/record.h
index 2f5ad5415c..a8e115ad44 100644
--- a/cpukit/include/rtems/record.h
+++ b/cpukit/include/rtems/record.h
@@ -112,7 +112,7 @@ void _Record_Thread_terminate(
struct _Thread_Control *executing
);
-RTEMS_INLINE_ROUTINE unsigned int _Record_Index(
+static inline unsigned int _Record_Index(
const Record_Control *control,
unsigned int index
)
@@ -120,17 +120,17 @@ RTEMS_INLINE_ROUTINE unsigned int _Record_Index(
return index & control->mask;
}
-RTEMS_INLINE_ROUTINE unsigned int _Record_Head( const Record_Control *control )
+static inline unsigned int _Record_Head( const Record_Control *control )
{
return _Atomic_Load_uint( &control->head, ATOMIC_ORDER_RELAXED );
}
-RTEMS_INLINE_ROUTINE unsigned int _Record_Tail( const Record_Control *control )
+static inline unsigned int _Record_Tail( const Record_Control *control )
{
return control->tail;
}
-RTEMS_INLINE_ROUTINE bool _Record_Is_overflow(
+static inline bool _Record_Is_overflow(
const Record_Control *control,
unsigned int tail,
unsigned int head
@@ -139,7 +139,7 @@ RTEMS_INLINE_ROUTINE bool _Record_Is_overflow(
return head - tail >= control->mask + 1U;
}
-RTEMS_INLINE_ROUTINE unsigned int _Record_Capacity(
+static inline unsigned int _Record_Capacity(
const Record_Control *control,
unsigned int tail,
unsigned int head
@@ -148,7 +148,7 @@ RTEMS_INLINE_ROUTINE unsigned int _Record_Capacity(
return ( tail - head - 1U ) & control->mask;
}
-RTEMS_INLINE_ROUTINE rtems_counter_ticks _Record_Now( void )
+static inline rtems_counter_ticks _Record_Now( void )
{
return rtems_counter_read();
}
@@ -498,7 +498,7 @@ void _Record_Exit_10(
* context may have an arbitrary content at function entry.
* @param cpu_self The control of the current processor.
*/
-RTEMS_INLINE_ROUTINE void rtems_record_prepare_critical(
+static inline void rtems_record_prepare_critical(
rtems_record_context *context,
const Per_CPU_Control *cpu_self
)
@@ -524,7 +524,7 @@ RTEMS_INLINE_ROUTINE void rtems_record_prepare_critical(
*
* @see rtems_record_produce().
*/
-RTEMS_INLINE_ROUTINE void rtems_record_prepare( rtems_record_context *context )
+static inline void rtems_record_prepare( rtems_record_context *context )
{
uint32_t level;
const Per_CPU_Control *cpu_self;
@@ -549,7 +549,7 @@ RTEMS_INLINE_ROUTINE void rtems_record_prepare( rtems_record_context *context )
* @param event The record event without a time stamp for the item.
* @param data The record data for the item.
*/
-RTEMS_INLINE_ROUTINE void rtems_record_add(
+static inline void rtems_record_add(
rtems_record_context *context,
rtems_record_event event,
rtems_record_data data
@@ -575,7 +575,7 @@ RTEMS_INLINE_ROUTINE void rtems_record_add(
* @param context The record context initialized via
* rtems_record_prepare_critical().
*/
-RTEMS_INLINE_ROUTINE void rtems_record_commit_critical( rtems_record_context *context )
+static inline void rtems_record_commit_critical( rtems_record_context *context )
{
_Atomic_Store_uint(
&context->control->head,
@@ -589,7 +589,7 @@ RTEMS_INLINE_ROUTINE void rtems_record_commit_critical( rtems_record_context *co
*
* @param context The record context initialized via rtems_record_prepare().
*/
-RTEMS_INLINE_ROUTINE void rtems_record_commit( rtems_record_context *context )
+static inline void rtems_record_commit( rtems_record_context *context )
{
rtems_record_commit_critical( context );
RTEMS_COMPILER_MEMORY_BARRIER();
diff --git a/cpukit/include/rtems/rtems/attrimpl.h b/cpukit/include/rtems/rtems/attrimpl.h
index 9321a92048..e5ac35c26a 100644
--- a/cpukit/include/rtems/rtems/attrimpl.h
+++ b/cpukit/include/rtems/rtems/attrimpl.h
@@ -80,7 +80,7 @@ extern "C" {
* This function sets the requested new_attributes in the attribute_set
* passed in. The result is returned to the user.
*/
-RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set (
+static inline rtems_attribute _Attributes_Set (
rtems_attribute new_attributes,
rtems_attribute attribute_set
)
@@ -95,7 +95,7 @@ RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set (
* This function clears the requested new_attributes in the attribute_set
* passed in. The result is returned to the user.
*/
-RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
+static inline rtems_attribute _Attributes_Clear (
rtems_attribute attribute_set,
rtems_attribute mask
)
@@ -110,7 +110,7 @@ RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear (
* This function returns TRUE if the floating point attribute is
* enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_floating_point(
+static inline bool _Attributes_Is_floating_point(
rtems_attribute attribute_set
)
{
@@ -125,7 +125,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_floating_point(
* This function returns TRUE if the global object attribute is
* enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_global(
+static inline bool _Attributes_Is_global(
rtems_attribute attribute_set
)
{
@@ -139,7 +139,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_global(
* This function returns TRUE if the priority attribute is
* enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(
+static inline bool _Attributes_Is_priority(
rtems_attribute attribute_set
)
{
@@ -153,7 +153,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(
* This function returns TRUE if the binary semaphore attribute is
* enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore(
+static inline bool _Attributes_Is_binary_semaphore(
rtems_attribute attribute_set
)
{
@@ -167,7 +167,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore(
* This function returns TRUE if the simple binary semaphore attribute is
* enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_simple_binary_semaphore(
+static inline bool _Attributes_Is_simple_binary_semaphore(
rtems_attribute attribute_set
)
{
@@ -182,7 +182,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_simple_binary_semaphore(
* This function returns TRUE if the counting semaphore attribute is
* enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore(
+static inline bool _Attributes_Is_counting_semaphore(
rtems_attribute attribute_set
)
{
@@ -196,7 +196,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore(
* This function returns TRUE if the priority inheritance attribute
* is enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority(
+static inline bool _Attributes_Is_inherit_priority(
rtems_attribute attribute_set
)
{
@@ -210,7 +210,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_inherit_priority(
* The protocols are RTEMS_INHERIT_PRIORITY, RTEMS_PRIORITY_CEILING and
* RTEMS_MULTIPROCESSOR_RESOURCE_SHARING.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Has_at_most_one_protocol(
+static inline bool _Attributes_Has_at_most_one_protocol(
rtems_attribute attribute_set
)
{
@@ -227,7 +227,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Has_at_most_one_protocol(
* This function returns TRUE if the priority ceiling attribute
* is enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling(
+static inline bool _Attributes_Is_priority_ceiling(
rtems_attribute attribute_set
)
{
@@ -241,7 +241,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority_ceiling(
* This function returns TRUE if the Multiprocessor Resource Sharing Protocol
* attribute is enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_multiprocessor_resource_sharing(
+static inline bool _Attributes_Is_multiprocessor_resource_sharing(
rtems_attribute attribute_set
)
{
@@ -255,7 +255,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_multiprocessor_resource_sharing(
* This function returns TRUE if the barrier automatic release
* attribute is enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_barrier_automatic(
+static inline bool _Attributes_Is_barrier_automatic(
rtems_attribute attribute_set
)
{
@@ -269,7 +269,7 @@ RTEMS_INLINE_ROUTINE bool _Attributes_Is_barrier_automatic(
* This function returns TRUE if the system task attribute
* is enabled in the attribute_set and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Attributes_Is_system_task(
+static inline bool _Attributes_Is_system_task(
rtems_attribute attribute_set
)
{
diff --git a/cpukit/include/rtems/rtems/barrierimpl.h b/cpukit/include/rtems/rtems/barrierimpl.h
index 9e28ad9cb1..88228b64f9 100644
--- a/cpukit/include/rtems/rtems/barrierimpl.h
+++ b/cpukit/include/rtems/rtems/barrierimpl.h
@@ -62,7 +62,7 @@ extern "C" {
* This function allocates a barrier control block from
* the inactive chain of free barrier control blocks.
*/
-RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Allocate( void )
+static inline Barrier_Control *_Barrier_Allocate( void )
{
return (Barrier_Control *) _Objects_Allocate( &_Barrier_Information );
}
@@ -73,7 +73,7 @@ RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Allocate( void )
* This routine frees a barrier control block to the
* inactive chain of free barrier control blocks.
*/
-RTEMS_INLINE_ROUTINE void _Barrier_Free (
+static inline void _Barrier_Free (
Barrier_Control *the_barrier
)
{
@@ -81,7 +81,7 @@ RTEMS_INLINE_ROUTINE void _Barrier_Free (
_Objects_Free( &_Barrier_Information, &the_barrier->Object );
}
-RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get(
+static inline Barrier_Control *_Barrier_Get(
Objects_Id id,
Thread_queue_Context *queue_context
)
diff --git a/cpukit/include/rtems/rtems/cache.h b/cpukit/include/rtems/rtems/cache.h
index c7c19b80e2..e869769393 100644
--- a/cpukit/include/rtems/rtems/cache.h
+++ b/cpukit/include/rtems/rtems/cache.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicCache
+ *
* @brief This header file defines the Cache Manager API.
*/
diff --git a/cpukit/include/rtems/rtems/clock.h b/cpukit/include/rtems/rtems/clock.h
index 7247b483db..7b460ea4fb 100644
--- a/cpukit/include/rtems/rtems/clock.h
+++ b/cpukit/include/rtems/rtems/clock.h
@@ -1135,6 +1135,18 @@ static inline bool rtems_clock_tick_before( rtems_interval ticks )
* @par Notes
* The directive is a legacy interface. It should not be called by
* applications directly. A Clock Driver may call this directive.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ * @endparblock
*/
rtems_status_code rtems_clock_tick( void );
diff --git a/cpukit/include/rtems/rtems/config.h b/cpukit/include/rtems/rtems/config.h
index 2a12c8f3cb..4a6e6c8e2e 100644
--- a/cpukit/include/rtems/rtems/config.h
+++ b/cpukit/include/rtems/rtems/config.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassic
+ *
* @brief This header file provides parts of the application configuration
* information API.
*/
@@ -169,32 +171,30 @@ typedef struct {
const rtems_initialization_tasks_table *User_initialization_tasks_table;
} rtems_api_configuration_table;
-/* Generated from spec:/rtems/config/if/get-api-configuration */
-
-/**
- * @ingroup RTEMSAPIConfig
- *
- * @brief Gets the Classic API Configuration Table of this application.
- *
- * @return Returns the pointer to the Classic API Configuration Table of this
- * application.
- */
-const rtems_api_configuration_table *
-rtems_configuration_get_rtems_api_configuration( void );
-
/* Generated from spec:/rtems/config/if/get-maximum-barriers */
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API Barriers configured for this
- * application.
+ * @brief Gets the resource number of @ref RTEMSAPIClassicBarrier objects
+ * configured for this application.
*
- * @return Returns the maximum number of Classic API Barriers configured for
- * this application.
+ * @return Returns the resource number of @ref RTEMSAPIClassicBarrier objects
+ * configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_BARRIERS.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_BARRIERS
+ * application configuration option. See also rtems_resource_is_unlimited()
+ * and rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_barriers( void );
@@ -203,14 +203,25 @@ uint32_t rtems_configuration_get_maximum_barriers( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API Message Queues configured for
- * this application.
+ * @brief Gets the resource number of @ref RTEMSAPIClassicMessage objects
+ * configured for this application.
*
- * @return Returns the maximum number of Classic API Message Queues configured
- * for this application.
+ * @return Returns the resource number of @ref RTEMSAPIClassicMessage objects
+ * configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_MESSAGE_QUEUES.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_MESSAGE_QUEUES
+ * application configuration option. See also rtems_resource_is_unlimited()
+ * and rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_message_queues( void );
@@ -219,14 +230,25 @@ uint32_t rtems_configuration_get_maximum_message_queues( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API Partitions configured for this
- * application.
+ * @brief Gets the resource number of @ref RTEMSAPIClassicPart objects
+ * configured for this application.
*
- * @return Returns the maximum number of Classic API Partitions configured for
- * this application.
+ * @return Returns the resource number of @ref RTEMSAPIClassicPart objects
+ * configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_PARTITIONS.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_PARTITIONS
+ * application configuration option. See also rtems_resource_is_unlimited()
+ * and rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_partitions( void );
@@ -235,14 +257,25 @@ uint32_t rtems_configuration_get_maximum_partitions( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API Rate Monotonic Periods
+ * @brief Gets the resource number of @ref RTEMSAPIClassicRatemon objects
* configured for this application.
*
- * @return Returns the maximum number of Classic API Rate Monotonic Periods
+ * @return Returns the resource number of @ref RTEMSAPIClassicRatemon objects
* configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_PERIODS.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_PERIODS application
+ * configuration option. See also rtems_resource_is_unlimited() and
+ * rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_periods( void );
@@ -251,14 +284,25 @@ uint32_t rtems_configuration_get_maximum_periods( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API Dual-Ported Memories
+ * @brief Gets the resource number of @ref RTEMSAPIClassicDPMem objects
* configured for this application.
*
- * @return Returns the maximum number of Classic API Dual-Ported Memories
+ * @return Returns the resource number of @ref RTEMSAPIClassicDPMem objects
* configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_PORTS.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_PORTS application
+ * configuration option. See also rtems_resource_is_unlimited() and
+ * rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_ports( void );
@@ -267,14 +311,25 @@ uint32_t rtems_configuration_get_maximum_ports( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API Regions configured for this
- * application.
+ * @brief Gets the resource number of @ref RTEMSAPIClassicRegion objects
+ * configured for this application.
*
- * @return Returns the maximum number of Classic API Regions configured for
- * this application.
+ * @return Returns the resource number of @ref RTEMSAPIClassicRegion objects
+ * configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_REGIONS.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_REGIONS application
+ * configuration option. See also rtems_resource_is_unlimited() and
+ * rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_regions( void );
@@ -283,14 +338,25 @@ uint32_t rtems_configuration_get_maximum_regions( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API Semaphores configured for this
- * application.
+ * @brief Gets the resource number of @ref RTEMSAPIClassicSem objects
+ * configured for this application.
*
- * @return Returns the maximum number of Classic API Semaphores configured for
- * this application.
+ * @return Returns the resource number of @ref RTEMSAPIClassicSem objects
+ * configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_SEMAPHORES.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_SEMAPHORES
+ * application configuration option. See also rtems_resource_is_unlimited()
+ * and rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_semaphores( void );
@@ -299,14 +365,25 @@ uint32_t rtems_configuration_get_maximum_semaphores( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API Tasks configured for this
- * application.
+ * @brief Gets the resource number of @ref RTEMSAPIClassicTasks objects
+ * configured for this application.
*
- * @return Returns the maximum number of Classic API Tasks configured for this
- * application.
+ * @return Returns the resource number of @ref RTEMSAPIClassicTasks objects
+ * configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_TASKS.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_TASKS application
+ * configuration option. See also rtems_resource_is_unlimited() and
+ * rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_tasks( void );
@@ -315,17 +392,50 @@ uint32_t rtems_configuration_get_maximum_tasks( void );
/**
* @ingroup RTEMSAPIConfig
*
- * @brief Gets the maximum number of Classic API Timers configured for this
- * application.
+ * @brief Gets the resource number of @ref RTEMSAPIClassicTimer objects
+ * configured for this application.
*
- * @return Returns the maximum number of Classic API Timers configured for this
- * application.
+ * @return Returns the resource number of @ref RTEMSAPIClassicTimer objects
+ * configured for this application.
*
* @par Notes
- * See #CONFIGURE_MAXIMUM_TIMERS.
+ * The resource number is defined by the #CONFIGURE_MAXIMUM_TIMERS application
+ * configuration option. See also rtems_resource_is_unlimited() and
+ * rtems_resource_maximum_per_allocation().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
uint32_t rtems_configuration_get_maximum_timers( void );
+/* Generated from spec:/rtems/config/if/get-api-configuration */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief Gets the Classic API Configuration Table of this application.
+ *
+ * @return Returns a pointer to the Classic API Configuration Table of this
+ * application.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+const rtems_api_configuration_table *
+rtems_configuration_get_rtems_api_configuration( void );
+
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/include/rtems/rtems/dpmem.h b/cpukit/include/rtems/rtems/dpmem.h
index 9ecdf3a170..855ea3ddc6 100644
--- a/cpukit/include/rtems/rtems/dpmem.h
+++ b/cpukit/include/rtems/rtems/dpmem.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicDPMem
+ *
* @brief This header file defines the Dual-Ported Memory Manager API.
*/
diff --git a/cpukit/include/rtems/rtems/dpmemimpl.h b/cpukit/include/rtems/rtems/dpmemimpl.h
index 7287ab6489..04462335b8 100644
--- a/cpukit/include/rtems/rtems/dpmemimpl.h
+++ b/cpukit/include/rtems/rtems/dpmemimpl.h
@@ -61,7 +61,7 @@ extern "C" {
* This routine allocates a port control block from the inactive chain
* of free port control blocks.
*/
-RTEMS_INLINE_ROUTINE Dual_ported_memory_Control
+static inline Dual_ported_memory_Control
*_Dual_ported_memory_Allocate ( void )
{
return (Dual_ported_memory_Control *)
@@ -75,14 +75,14 @@ RTEMS_INLINE_ROUTINE Dual_ported_memory_Control
* This routine frees a port control block to the inactive chain
* of free port control blocks.
*/
-RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free (
+static inline void _Dual_ported_memory_Free (
Dual_ported_memory_Control *the_port
)
{
_Objects_Free( &_Dual_ported_memory_Information, &the_port->Object );
}
-RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get(
+static inline Dual_ported_memory_Control *_Dual_ported_memory_Get(
Objects_Id id,
ISR_lock_Context *lock_context
)
diff --git a/cpukit/include/rtems/rtems/eventimpl.h b/cpukit/include/rtems/rtems/eventimpl.h
index ae14e5c836..9c0380930a 100644
--- a/cpukit/include/rtems/rtems/eventimpl.h
+++ b/cpukit/include/rtems/rtems/eventimpl.h
@@ -123,7 +123,7 @@ rtems_status_code _Event_Surrender(
*
* @param event is the event control block to initialize.
*/
-RTEMS_INLINE_ROUTINE void _Event_Initialize( Event_Control *event )
+static inline void _Event_Initialize( Event_Control *event )
{
event->pending_events = 0;
}
@@ -136,7 +136,7 @@ RTEMS_INLINE_ROUTINE void _Event_Initialize( Event_Control *event )
* @return Returns true, if there are no posted events in the event set,
* otherwise false.
*/
-RTEMS_INLINE_ROUTINE bool _Event_sets_Is_empty(
+static inline bool _Event_sets_Is_empty(
rtems_event_set the_event_set
)
{
@@ -150,7 +150,7 @@ RTEMS_INLINE_ROUTINE bool _Event_sets_Is_empty(
*
* @param the_event_set[in, out] is the event set.
*/
-RTEMS_INLINE_ROUTINE void _Event_sets_Post(
+static inline void _Event_sets_Post(
rtems_event_set the_new_events,
rtems_event_set *the_event_set
)
@@ -168,7 +168,7 @@ RTEMS_INLINE_ROUTINE void _Event_sets_Post(
* @return Return the events of the event condition which are posted in the
* event set.
*/
-RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
+static inline rtems_event_set _Event_sets_Get(
rtems_event_set the_event_set,
rtems_event_set the_event_condition
)
@@ -186,7 +186,7 @@ RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
* @return Returns the event set with all event cleared specified by the event
* mask.
*/
-RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
+static inline rtems_event_set _Event_sets_Clear(
rtems_event_set the_event_set,
rtems_event_set the_mask
)
diff --git a/cpukit/include/rtems/rtems/intr.h b/cpukit/include/rtems/rtems/intr.h
index c53cf694ba..021b9e3e94 100644
--- a/cpukit/include/rtems/rtems/intr.h
+++ b/cpukit/include/rtems/rtems/intr.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassic
+ *
* @brief This header file defines the Interrupt Manager API.
*/
@@ -65,6 +67,7 @@
#include <rtems/score/basedefs.h>
#include <rtems/score/chain.h>
#include <rtems/score/cpu.h>
+#include <rtems/score/cpuopts.h>
#include <rtems/score/isr.h>
#include <rtems/score/isrlevel.h>
#include <rtems/score/isrlock.h>
@@ -1032,7 +1035,7 @@ typedef struct rtems_interrupt_entry {
* initialize an interrupt entry.
*/
#define RTEMS_INTERRUPT_ENTRY_INITIALIZER( _routine, _arg, _info ) \
- { _routine, _arg, NULL, _info }
+ { _routine, _arg, NULL, _info }
/* Generated from spec:/rtems/intr/if/entry-initialize */
diff --git a/cpukit/include/rtems/rtems/messageimpl.h b/cpukit/include/rtems/rtems/messageimpl.h
index 0bbd104c18..5fbdcadcf6 100644
--- a/cpukit/include/rtems/rtems/messageimpl.h
+++ b/cpukit/include/rtems/rtems/messageimpl.h
@@ -97,14 +97,14 @@ rtems_status_code _Message_queue_Submit(
* This routine deallocates a message queue control block into
* the inactive chain of free message queue control blocks.
*/
-RTEMS_INLINE_ROUTINE void _Message_queue_Free (
+static inline void _Message_queue_Free (
Message_queue_Control *the_message_queue
)
{
_Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
}
-RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get(
+static inline Message_queue_Control *_Message_queue_Get(
Objects_Id id,
Thread_queue_Context *queue_context
)
@@ -117,7 +117,7 @@ RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get(
);
}
-RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Allocate( void )
+static inline Message_queue_Control *_Message_queue_Allocate( void )
{
return (Message_queue_Control *)
_Objects_Allocate( &_Message_queue_Information );
diff --git a/cpukit/include/rtems/rtems/modes.h b/cpukit/include/rtems/rtems/modes.h
index 559029d2da..038a84676d 100644
--- a/cpukit/include/rtems/rtems/modes.h
+++ b/cpukit/include/rtems/rtems/modes.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicModes
+ *
* @brief This header file provides the task modes API of the Task Manager.
*/
diff --git a/cpukit/include/rtems/rtems/modesimpl.h b/cpukit/include/rtems/rtems/modesimpl.h
index d195188774..8cbf655cbb 100644
--- a/cpukit/include/rtems/rtems/modesimpl.h
+++ b/cpukit/include/rtems/rtems/modesimpl.h
@@ -64,7 +64,7 @@ extern "C" {
* This function returns TRUE if mode_set indicates that Asynchronous
* Signal Processing is disabled, and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled (
+static inline bool _Modes_Is_asr_disabled (
rtems_mode mode_set
)
{
@@ -77,7 +77,7 @@ RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled (
* This function returns TRUE if mode_set indicates that preemption
* is enabled, and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
+static inline bool _Modes_Is_preempt (
rtems_mode mode_set
)
{
@@ -90,7 +90,7 @@ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
* This function returns TRUE if mode_set indicates that timeslicing
* is enabled, and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
+static inline bool _Modes_Is_timeslice (
rtems_mode mode_set
)
{
@@ -102,7 +102,7 @@ RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
*
* This function returns the interrupt level portion of the mode_set.
*/
-RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
+static inline ISR_Level _Modes_Get_interrupt_level (
rtems_mode mode_set
)
{
@@ -119,7 +119,7 @@ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
* @return Returns true, if support for the interrupt level is implemented,
* otherwise returns false.
*/
-RTEMS_INLINE_ROUTINE bool _Modes_Is_interrupt_level_supported(
+static inline bool _Modes_Is_interrupt_level_supported(
rtems_mode mode_set
)
{
@@ -142,7 +142,7 @@ RTEMS_INLINE_ROUTINE bool _Modes_Is_interrupt_level_supported(
* @return Returns true, if support for the preempt mode is implemented,
* otherwise returns false.
*/
-RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt_mode_supported(
+static inline bool _Modes_Is_preempt_mode_supported(
rtems_mode mode_set,
const Thread_Control *the_thread
)
@@ -162,7 +162,7 @@ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt_mode_supported(
*
* @param[out] the_thread is the thread to apply the timeslice mode.
*/
-RTEMS_INLINE_ROUTINE void _Modes_Apply_timeslice_to_thread(
+static inline void _Modes_Apply_timeslice_to_thread(
rtems_mode mode_set,
Thread_Control *the_thread
)
diff --git a/cpukit/include/rtems/rtems/mp.h b/cpukit/include/rtems/rtems/mp.h
index 91c31047fb..614a65fe4c 100644
--- a/cpukit/include/rtems/rtems/mp.h
+++ b/cpukit/include/rtems/rtems/mp.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassic
+ *
* @brief This header file defines the Multiprocessing Manager API.
*/
diff --git a/cpukit/include/rtems/rtems/msgmp.h b/cpukit/include/rtems/rtems/msgmp.h
index ee4a68b0da..ddd5aa11cc 100644
--- a/cpukit/include/rtems/rtems/msgmp.h
+++ b/cpukit/include/rtems/rtems/msgmp.h
@@ -99,7 +99,7 @@ typedef struct {
#define MESSAGE_QUEUE_MP_PACKET_SIZE \
offsetof(Message_queue_MP_Packet, buffer)
-RTEMS_INLINE_ROUTINE bool _Message_queue_MP_Is_remote( Objects_Id id )
+static inline bool _Message_queue_MP_Is_remote( Objects_Id id )
{
return _Objects_MP_Is_remote( id, &_Message_queue_Information );
}
diff --git a/cpukit/include/rtems/rtems/object.h b/cpukit/include/rtems/rtems/object.h
index e80303da28..02b8ef01e2 100644
--- a/cpukit/include/rtems/rtems/object.h
+++ b/cpukit/include/rtems/rtems/object.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicObject
+ *
* @brief This header file provides the Object Services API.
*/
diff --git a/cpukit/include/rtems/rtems/options.h b/cpukit/include/rtems/rtems/options.h
index 60d90f997e..5328c383b5 100644
--- a/cpukit/include/rtems/rtems/options.h
+++ b/cpukit/include/rtems/rtems/options.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassic
+ *
* @brief This header file provides the Classic API directive options.
*/
diff --git a/cpukit/include/rtems/rtems/optionsimpl.h b/cpukit/include/rtems/rtems/optionsimpl.h
index 58cabaf798..24e861bf9d 100644
--- a/cpukit/include/rtems/rtems/optionsimpl.h
+++ b/cpukit/include/rtems/rtems/optionsimpl.h
@@ -59,7 +59,7 @@ extern "C" {
* This function returns TRUE if the RTEMS_NO_WAIT option is enabled in
* option_set, and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Options_Is_no_wait (
+static inline bool _Options_Is_no_wait (
rtems_option option_set
)
{
@@ -72,7 +72,7 @@ RTEMS_INLINE_ROUTINE bool _Options_Is_no_wait (
* This function returns TRUE if the RTEMS_EVENT_ANY option is enabled in
* OPTION_SET, and FALSE otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Options_Is_any (
+static inline bool _Options_Is_any (
rtems_option option_set
)
{
diff --git a/cpukit/include/rtems/rtems/partimpl.h b/cpukit/include/rtems/rtems/partimpl.h
index ac2883e417..2dcea25b81 100644
--- a/cpukit/include/rtems/rtems/partimpl.h
+++ b/cpukit/include/rtems/rtems/partimpl.h
@@ -62,7 +62,7 @@ extern "C" {
*
* @return See _Objects_Get().
*/
-RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get(
+static inline Partition_Control *_Partition_Get(
Objects_Id id,
ISR_lock_Context *lock_context
)
@@ -81,7 +81,7 @@ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get(
*
* @param[in, out] lock_context is the lock context set up by _Partition_Get().
*/
-RTEMS_INLINE_ROUTINE void _Partition_Acquire_critical(
+static inline void _Partition_Acquire_critical(
Partition_Control *the_partition,
ISR_lock_Context *lock_context
)
@@ -96,7 +96,7 @@ RTEMS_INLINE_ROUTINE void _Partition_Acquire_critical(
*
* @param[in, out] lock_context is the lock context set up by _Partition_Get().
*/
-RTEMS_INLINE_ROUTINE void _Partition_Release(
+static inline void _Partition_Release(
Partition_Control *the_partition,
ISR_lock_Context *lock_context
)
diff --git a/cpukit/include/rtems/rtems/partmp.h b/cpukit/include/rtems/rtems/partmp.h
index 0cae87f0d7..cffde801d8 100644
--- a/cpukit/include/rtems/rtems/partmp.h
+++ b/cpukit/include/rtems/rtems/partmp.h
@@ -85,7 +85,7 @@ typedef struct {
Objects_Id proxy_id;
} Partition_MP_Packet;
-RTEMS_INLINE_ROUTINE bool _Partition_MP_Is_remote( Objects_Id id )
+static inline bool _Partition_MP_Is_remote( Objects_Id id )
{
return _Objects_MP_Is_remote( id, &_Partition_Information );
}
diff --git a/cpukit/include/rtems/rtems/ratemonimpl.h b/cpukit/include/rtems/rtems/ratemonimpl.h
index aa56266ea4..3874fd4884 100644
--- a/cpukit/include/rtems/rtems/ratemonimpl.h
+++ b/cpukit/include/rtems/rtems/ratemonimpl.h
@@ -74,13 +74,13 @@ extern "C" {
* This function allocates a period control block from
* the inactive chain of free period control blocks.
*/
-RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
+static inline Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
{
return (Rate_monotonic_Control *)
_Objects_Allocate( &_Rate_monotonic_Information );
}
-RTEMS_INLINE_ROUTINE void _Rate_monotonic_Acquire_critical(
+static inline void _Rate_monotonic_Acquire_critical(
Rate_monotonic_Control *the_period,
ISR_lock_Context *lock_context
)
@@ -88,7 +88,7 @@ RTEMS_INLINE_ROUTINE void _Rate_monotonic_Acquire_critical(
_ISR_lock_Acquire( &the_period->Lock, lock_context );
}
-RTEMS_INLINE_ROUTINE void _Rate_monotonic_Release(
+static inline void _Rate_monotonic_Release(
Rate_monotonic_Control *the_period,
ISR_lock_Context *lock_context
)
@@ -96,7 +96,7 @@ RTEMS_INLINE_ROUTINE void _Rate_monotonic_Release(
_ISR_lock_Release_and_ISR_enable( &the_period->Lock, lock_context );
}
-RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get(
+static inline Rate_monotonic_Control *_Rate_monotonic_Get(
Objects_Id id,
ISR_lock_Context *lock_context
)
@@ -137,14 +137,14 @@ void _Rate_monotonic_Cancel(
ISR_lock_Context *lock_context
);
-RTEMS_INLINE_ROUTINE void _Rate_monotonic_Reset_min_time(
+static inline void _Rate_monotonic_Reset_min_time(
Timestamp_Control *min_time
)
{
_Timestamp_Set( min_time, 0x7fffffff, 0x7fffffff );
}
-RTEMS_INLINE_ROUTINE void _Rate_monotonic_Reset_statistics(
+static inline void _Rate_monotonic_Reset_statistics(
Rate_monotonic_Control *the_period
)
{
diff --git a/cpukit/include/rtems/rtems/region.h b/cpukit/include/rtems/rtems/region.h
index 1e35344f7d..94a8d7008f 100644
--- a/cpukit/include/rtems/rtems/region.h
+++ b/cpukit/include/rtems/rtems/region.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicRegion
+ *
* @brief This header file defines the Region Manager API.
*/
diff --git a/cpukit/include/rtems/rtems/regionimpl.h b/cpukit/include/rtems/rtems/regionimpl.h
index ec1f1166ed..adb481f3e7 100644
--- a/cpukit/include/rtems/rtems/regionimpl.h
+++ b/cpukit/include/rtems/rtems/regionimpl.h
@@ -66,7 +66,7 @@ extern "C" {
* This function allocates a region control block from
* the inactive chain of free region control blocks.
*/
-RTEMS_INLINE_ROUTINE Region_Control *_Region_Allocate( void )
+static inline Region_Control *_Region_Allocate( void )
{
return (Region_Control *) _Objects_Allocate( &_Region_Information );
}
@@ -77,7 +77,7 @@ RTEMS_INLINE_ROUTINE Region_Control *_Region_Allocate( void )
* This routine frees a region control block to the
* inactive chain of free region control blocks.
*/
-RTEMS_INLINE_ROUTINE void _Region_Free (
+static inline void _Region_Free (
Region_Control *the_region
)
{
@@ -85,7 +85,7 @@ RTEMS_INLINE_ROUTINE void _Region_Free (
_Objects_Free( &_Region_Information, &the_region->Object );
}
-RTEMS_INLINE_ROUTINE Region_Control *_Region_Get_and_lock( Objects_Id id )
+static inline Region_Control *_Region_Get_and_lock( Objects_Id id )
{
Region_Control *the_region;
@@ -103,7 +103,7 @@ RTEMS_INLINE_ROUTINE Region_Control *_Region_Get_and_lock( Objects_Id id )
return NULL;
}
-RTEMS_INLINE_ROUTINE void _Region_Unlock( Region_Control *the_region )
+static inline void _Region_Unlock( Region_Control *the_region )
{
(void) the_region;
_RTEMS_Unlock_allocator();
@@ -116,7 +116,7 @@ RTEMS_INLINE_ROUTINE void _Region_Unlock( Region_Control *the_region )
* If successful, it returns the address of the allocated segment.
* Otherwise, it returns NULL.
*/
-RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment (
+static inline void *_Region_Allocate_segment (
Region_Control *the_region,
uintptr_t size
)
@@ -129,7 +129,7 @@ RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment (
*
* This function frees the_segment to the_region.
*/
-RTEMS_INLINE_ROUTINE bool _Region_Free_segment (
+static inline bool _Region_Free_segment (
Region_Control *the_region,
void *the_segment
)
diff --git a/cpukit/include/rtems/rtems/semimpl.h b/cpukit/include/rtems/rtems/semimpl.h
index 5518c1d348..5164c593f7 100644
--- a/cpukit/include/rtems/rtems/semimpl.h
+++ b/cpukit/include/rtems/rtems/semimpl.h
@@ -78,7 +78,7 @@ typedef enum {
SEMAPHORE_DISCIPLINE_FIFO
} Semaphore_Discipline;
-RTEMS_INLINE_ROUTINE uintptr_t _Semaphore_Get_flags(
+static inline uintptr_t _Semaphore_Get_flags(
const Semaphore_Control *the_semaphore
)
{
@@ -86,7 +86,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Semaphore_Get_flags(
return (uintptr_t) the_semaphore->Object.Node.previous;
}
-RTEMS_INLINE_ROUTINE void _Semaphore_Set_flags(
+static inline void _Semaphore_Set_flags(
Semaphore_Control *the_semaphore,
uintptr_t flags
)
@@ -95,14 +95,14 @@ RTEMS_INLINE_ROUTINE void _Semaphore_Set_flags(
the_semaphore->Object.Node.previous = (Chain_Node *) flags;
}
-RTEMS_INLINE_ROUTINE Semaphore_Variant _Semaphore_Get_variant(
+static inline Semaphore_Variant _Semaphore_Get_variant(
uintptr_t flags
)
{
return (Semaphore_Variant) ( flags & 0x7 );
}
-RTEMS_INLINE_ROUTINE uintptr_t _Semaphore_Set_variant(
+static inline uintptr_t _Semaphore_Set_variant(
uintptr_t flags,
Semaphore_Variant variant
)
@@ -110,14 +110,14 @@ RTEMS_INLINE_ROUTINE uintptr_t _Semaphore_Set_variant(
return flags | variant;
}
-RTEMS_INLINE_ROUTINE Semaphore_Discipline _Semaphore_Get_discipline(
+static inline Semaphore_Discipline _Semaphore_Get_discipline(
uintptr_t flags
)
{
return (Semaphore_Discipline) ( ( flags >> 3 ) & 0x1 );
}
-RTEMS_INLINE_ROUTINE uintptr_t _Semaphore_Set_discipline(
+static inline uintptr_t _Semaphore_Set_discipline(
uintptr_t flags,
Semaphore_Discipline discipline
)
@@ -126,20 +126,20 @@ RTEMS_INLINE_ROUTINE uintptr_t _Semaphore_Set_discipline(
}
#if defined(RTEMS_MULTIPROCESSING)
-RTEMS_INLINE_ROUTINE bool _Semaphore_Is_global(
+static inline bool _Semaphore_Is_global(
uintptr_t flags
)
{
return ( flags & 0x10 ) != 0;
}
-RTEMS_INLINE_ROUTINE uintptr_t _Semaphore_Make_global( uintptr_t flags )
+static inline uintptr_t _Semaphore_Make_global( uintptr_t flags )
{
return flags | 0x10;
}
#endif
-RTEMS_INLINE_ROUTINE const Thread_queue_Operations *_Semaphore_Get_operations(
+static inline const Thread_queue_Operations *_Semaphore_Get_operations(
uintptr_t flags
)
{
@@ -163,7 +163,7 @@ RTEMS_INLINE_ROUTINE const Thread_queue_Operations *_Semaphore_Get_operations(
* This function allocates a semaphore control block from
* the inactive chain of free semaphore control blocks.
*/
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
+static inline Semaphore_Control *_Semaphore_Allocate( void )
{
return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );
}
@@ -175,14 +175,14 @@ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
* This routine frees a semaphore control block to the
* inactive chain of free semaphore control blocks.
*/
-RTEMS_INLINE_ROUTINE void _Semaphore_Free (
+static inline void _Semaphore_Free (
Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
}
-RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get(
+static inline Semaphore_Control *_Semaphore_Get(
Objects_Id id,
Thread_queue_Context *queue_context
)
diff --git a/cpukit/include/rtems/rtems/semmp.h b/cpukit/include/rtems/rtems/semmp.h
index 888e2aa480..7fbf5c9046 100644
--- a/cpukit/include/rtems/rtems/semmp.h
+++ b/cpukit/include/rtems/rtems/semmp.h
@@ -83,7 +83,7 @@ typedef struct {
Objects_Id proxy_id;
} Semaphore_MP_Packet;
-RTEMS_INLINE_ROUTINE bool _Semaphore_MP_Is_remote( Objects_Id id )
+static inline bool _Semaphore_MP_Is_remote( Objects_Id id )
{
return _Objects_MP_Is_remote( id, &_Semaphore_Information );
}
diff --git a/cpukit/include/rtems/rtems/status.h b/cpukit/include/rtems/rtems/status.h
index 872bb9b2b3..29bcb27dc1 100644
--- a/cpukit/include/rtems/rtems/status.h
+++ b/cpukit/include/rtems/rtems/status.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassic
+ *
* @brief This header file provides the status codes of Classic API directives
* and support functions.
*/
diff --git a/cpukit/include/rtems/rtems/statusimpl.h b/cpukit/include/rtems/rtems/statusimpl.h
index 060ec5ae07..2ea12d9f6c 100644
--- a/cpukit/include/rtems/rtems/statusimpl.h
+++ b/cpukit/include/rtems/rtems/statusimpl.h
@@ -63,14 +63,14 @@ extern "C" {
* @{
*/
-RTEMS_INLINE_ROUTINE rtems_status_code _Status_Get(
+static inline rtems_status_code _Status_Get(
Status_Control status
)
{
return (rtems_status_code) STATUS_GET_CLASSIC( status );
}
-RTEMS_INLINE_ROUTINE rtems_status_code _Status_Get_after_wait(
+static inline rtems_status_code _Status_Get_after_wait(
const Thread_Control *executing
)
{
diff --git a/cpukit/include/rtems/rtems/support.h b/cpukit/include/rtems/rtems/support.h
index 60e090ccec..356e29739b 100644
--- a/cpukit/include/rtems/rtems/support.h
+++ b/cpukit/include/rtems/rtems/support.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassic
+ *
* @brief This header file defines support services of the API.
*/
diff --git a/cpukit/include/rtems/rtems/tasks.h b/cpukit/include/rtems/rtems/tasks.h
index 81757db8c7..6d643b7fbe 100644
--- a/cpukit/include/rtems/rtems/tasks.h
+++ b/cpukit/include/rtems/rtems/tasks.h
@@ -283,6 +283,25 @@ typedef struct {
rtems_task_argument argument;
} rtems_initialization_tasks_table;
+/* Generated from spec:/rtems/task/if/maximum-priority-impl */
+
+/**
+ * @ingroup RTEMSImplClassicTask
+ *
+ * @brief Returns the maximum priority of the scheduler with index zero.
+ */
+rtems_task_priority _RTEMS_Maximum_priority( void );
+
+/* Generated from spec:/rtems/task/if/maximum-priority */
+
+/**
+ * @ingroup RTEMSAPIClassicTasks
+ *
+ * @brief This runtime constant represents the lowest (least important) task
+ * priority of the scheduler with index zero.
+ */
+#define RTEMS_MAXIMUM_PRIORITY _RTEMS_Maximum_priority()
+
/* Generated from spec:/rtems/task/if/minimum-priority */
/**
@@ -401,23 +420,6 @@ typedef bool( *rtems_task_visitor )( rtems_tcb *, void * );
*/
#define RTEMS_YIELD_PROCESSOR WATCHDOG_NO_TIMEOUT
-/* Generated from spec:/score/if/maximum-priority */
-
-/**
- * @brief Returns the maximum priority of the scheduler with index zero.
- */
-rtems_task_priority _RTEMS_Maximum_priority( void );
-
-/* Generated from spec:/rtems/task/if/maximum-priority */
-
-/**
- * @ingroup RTEMSAPIClassicTasks
- *
- * @brief This constant variable provides the lowest (least important) task
- * priority of the first configured scheduler.
- */
-#define RTEMS_MAXIMUM_PRIORITY _RTEMS_Maximum_priority()
-
/* Generated from spec:/rtems/task/if/create */
/**
@@ -1031,13 +1033,25 @@ rtems_status_code rtems_task_restart(
* @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
* interrupt context.
*
+ * @retval ::RTEMS_INCORRECT_STATE The task termination procedure was started,
+ * however, waiting for the terminating task would have resulted in a
+ * deadlock.
+ *
* @retval ::RTEMS_ILLEGAL_ON_REMOTE_OBJECT The task resided on a remote node.
*
* @par Notes
* @parblock
- * RTEMS stops the execution of the task and reclaims the stack memory, any
- * allocated delay or timeout timers, the TCB, and, if the task is
- * #RTEMS_FLOATING_POINT, its floating point context area. RTEMS explicitly
+ * The task deletion is done in several steps. Firstly, the task is marked as
+ * terminating. While the task life of the terminating task is protected, it
+ * executes normally until it disables the task life protection or it deletes
+ * itself. A terminating task will eventually stop its normal execution and
+ * start its termination procedure. The procedure executes in the context of
+ * the terminating task. The task termination procedure involves the
+ * destruction of POSIX key values and running the task termination user
+ * extensions. Once complete the execution of the task is stopped and
+ * task-specific resources are reclaimed by the system, such as the stack
+ * memory, any allocated delay or timeout timers, the TCB, and, if the task is
+ * #RTEMS_FLOATING_POINT, its floating point context area. RTEMS explicitly
* does not reclaim the following resources: region segments, partition
* buffers, semaphores, timers, or rate monotonic periods.
*
@@ -1049,10 +1063,12 @@ rtems_status_code rtems_task_restart(
* resources and delete itself by restarting it with a special argument or by
* sending it a message, an event, or a signal.
*
- * Deletion of the current task (#RTEMS_SELF) will force RTEMS to select
+ * Deletion of the calling task (#RTEMS_SELF) will force RTEMS to select
* another task to execute.
*
- * The TCB for the deleted task is reclaimed by RTEMS.
+ * When a task deletes another task, the calling task waits until the task
+ * termination procedure of the task being deleted has completed. The
+ * terminating task inherits the eligible priorities of the calling task.
*
* When a global task is deleted, the task identifier must be transmitted to
* every node in the system for deletion from the local copy of the global
diff --git a/cpukit/include/rtems/rtems/tasksimpl.h b/cpukit/include/rtems/rtems/tasksimpl.h
index a10fd75acf..8c87cfc93b 100644
--- a/cpukit/include/rtems/rtems/tasksimpl.h
+++ b/cpukit/include/rtems/rtems/tasksimpl.h
@@ -75,7 +75,7 @@ rtems_status_code _RTEMS_tasks_Create(
RTEMS_tasks_Prepare_stack prepare_stack
);
-RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate(void)
+static inline Thread_Control *_RTEMS_tasks_Allocate(void)
{
_Objects_Allocator_lock();
@@ -99,7 +99,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate(void)
*
* @return The corresponding SuperCore priority.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_Priority_To_core(
+static inline Priority_Control _RTEMS_Priority_To_core(
const Scheduler_Control *scheduler,
rtems_task_priority priority,
bool *valid
@@ -119,7 +119,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_Priority_To_core(
*
* @return The corresponding RTEMS API priority.
*/
-RTEMS_INLINE_ROUTINE rtems_task_priority _RTEMS_Priority_From_core(
+static inline rtems_task_priority _RTEMS_Priority_From_core(
const Scheduler_Control *scheduler,
Priority_Control priority
)
diff --git a/cpukit/include/rtems/rtems/timerimpl.h b/cpukit/include/rtems/rtems/timerimpl.h
index f74d970e57..8bb95c3be1 100644
--- a/cpukit/include/rtems/rtems/timerimpl.h
+++ b/cpukit/include/rtems/rtems/timerimpl.h
@@ -80,7 +80,7 @@ extern Timer_server_Control *volatile _Timer_server;
* This function allocates a timer control block from
* the inactive chain of free timer control blocks.
*/
-RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
+static inline Timer_Control *_Timer_Allocate( void )
{
return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
}
@@ -91,14 +91,14 @@ RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
* This routine frees a timer control block to the
* inactive chain of free timer control blocks.
*/
-RTEMS_INLINE_ROUTINE void _Timer_Free (
+static inline void _Timer_Free (
Timer_Control *the_timer
)
{
_Objects_Free( &_Timer_Information, &the_timer->Object );
}
-RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get(
+static inline Timer_Control *_Timer_Get(
Objects_Id id,
ISR_lock_Context *lock_context
)
@@ -110,7 +110,7 @@ RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get(
);
}
-RTEMS_INLINE_ROUTINE Per_CPU_Control *_Timer_Acquire_critical(
+static inline Per_CPU_Control *_Timer_Acquire_critical(
Timer_Control *the_timer,
ISR_lock_Context *lock_context
)
@@ -123,7 +123,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Timer_Acquire_critical(
return cpu;
}
-RTEMS_INLINE_ROUTINE void _Timer_Release(
+static inline void _Timer_Release(
Per_CPU_Control *cpu,
ISR_lock_Context *lock_context
)
@@ -132,7 +132,7 @@ RTEMS_INLINE_ROUTINE void _Timer_Release(
_ISR_lock_ISR_enable( lock_context );
}
-RTEMS_INLINE_ROUTINE bool _Timer_Is_interval_class(
+static inline bool _Timer_Is_interval_class(
Timer_Classes the_class
)
{
@@ -142,7 +142,7 @@ RTEMS_INLINE_ROUTINE bool _Timer_Is_interval_class(
return ( the_class & mask ) == TIMER_CLASS_BIT_NOT_DORMANT;
}
-RTEMS_INLINE_ROUTINE bool _Timer_Is_on_task_class(
+static inline bool _Timer_Is_on_task_class(
Timer_Classes the_class
)
{
@@ -152,14 +152,14 @@ RTEMS_INLINE_ROUTINE bool _Timer_Is_on_task_class(
return ( the_class & mask ) == mask;
}
-RTEMS_INLINE_ROUTINE Per_CPU_Watchdog_index _Timer_Watchdog_header_index(
+static inline Per_CPU_Watchdog_index _Timer_Watchdog_header_index(
Timer_Classes the_class
)
{
return (Per_CPU_Watchdog_index) ( the_class & TIMER_CLASS_BIT_TIME_OF_DAY );
}
-RTEMS_INLINE_ROUTINE Watchdog_Interval _Timer_Get_CPU_ticks(
+static inline Watchdog_Interval _Timer_Get_CPU_ticks(
const Per_CPU_Control *cpu
)
{
@@ -199,7 +199,7 @@ void _Timer_Routine_adaptor( Watchdog_Control *the_watchdog );
void _Timer_server_Routine_adaptor( Watchdog_Control *the_watchdog );
-RTEMS_INLINE_ROUTINE void _Timer_server_Acquire_critical(
+static inline void _Timer_server_Acquire_critical(
Timer_server_Control *timer_server,
ISR_lock_Context *lock_context
)
@@ -207,7 +207,7 @@ RTEMS_INLINE_ROUTINE void _Timer_server_Acquire_critical(
_ISR_lock_Acquire( &timer_server->Lock, lock_context );
}
-RTEMS_INLINE_ROUTINE void _Timer_server_Release_critical(
+static inline void _Timer_server_Release_critical(
Timer_server_Control *timer_server,
ISR_lock_Context *lock_context
)
diff --git a/cpukit/include/rtems/rtems/types.h b/cpukit/include/rtems/rtems/types.h
index caa75b4f0d..1dd5f8da86 100644
--- a/cpukit/include/rtems/rtems/types.h
+++ b/cpukit/include/rtems/rtems/types.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassic
+ *
* @brief This header file provides types used by the Classic API.
*/
@@ -59,6 +61,7 @@
#include <sys/_timeval.h>
#include <sys/cpuset.h>
#include <rtems/rtems/modes.h>
+#include <rtems/score/cpuopts.h>
#include <rtems/score/mppkt.h>
#include <rtems/score/object.h>
#include <rtems/score/watchdogticks.h>
diff --git a/cpukit/include/rtems/rtl/rtl-obj.h b/cpukit/include/rtems/rtl/rtl-obj.h
index 33951e10d1..6b47eb1205 100644
--- a/cpukit/include/rtems/rtl/rtl-obj.h
+++ b/cpukit/include/rtems/rtl/rtl-obj.h
@@ -250,7 +250,7 @@ struct rtems_rtl_obj
size_t tramps_size; /**< Size of the trampoline memory. */
void* tramp_brk; /**< Trampoline memory allocator. MD
* relocators can take memory from the
- * break upto the size. */
+ * break up to the size. */
size_t tramp_relocs; /**< Number of slots reserved for
* relocs. The remainder are for
* unresolved symbols. */
@@ -352,7 +352,7 @@ static inline bool rtems_rtl_obj_text_inside (const rtems_rtl_obj* obj,
{
return
(address >= obj->text_base) &&
- (address < (obj->text_base + obj->text_size));
+ ((char*) address < ((char*) obj->text_base + obj->text_size));
}
/**
@@ -393,11 +393,23 @@ static inline bool rtems_rtl_obj_has_symbol (const rtems_rtl_obj* obj,
* @param size The size to be allocated.
* @retval bool Returns @true if the space is available.
*/
+static inline size_t rtems_rtl_obj_tramp_avail_space (const rtems_rtl_obj* obj)
+{
+ return (char*) obj->tramp_brk - (char*) obj->trampoline;
+}
+
+/**
+ * Is there space in the trampoline memory for a trapoline.
+ *
+ * @param obj The object file's descriptor to check for available space.
+ * @param size The size to be allocated.
+ * @retval bool Returns @true if the space is available.
+ */
static inline bool rtems_rtl_obj_has_tramp_space (const rtems_rtl_obj* obj,
const size_t size)
{
return (obj->trampoline != NULL &&
- ((obj->tramp_brk - obj->trampoline) + size) <= obj->tramps_size);
+ (rtems_rtl_obj_tramp_avail_space (obj) + size) <= obj->tramps_size);
}
/**
@@ -421,7 +433,7 @@ static inline size_t rtems_rtl_obj_trampoline_slots (const rtems_rtl_obj* obj)
static inline size_t rtems_rtl_obj_trampolines (const rtems_rtl_obj* obj)
{
return obj->trampoline == NULL || obj->tramp_size == 0 ?
- 0 : (obj->tramp_brk - obj->trampoline) / obj->tramp_size;
+ 0 : rtems_rtl_obj_tramp_avail_space (obj) / obj->tramp_size;
}
/**
diff --git a/cpukit/include/rtems/rtl/rtl.h b/cpukit/include/rtems/rtl/rtl.h
index 7901127785..0fd4e74cdf 100644
--- a/cpukit/include/rtems/rtl/rtl.h
+++ b/cpukit/include/rtems/rtl/rtl.h
@@ -107,7 +107,7 @@ extern struct r_debug _rtld_debug;
* Debugger break function. Call when debugging to have it read the _rtld_debug
* variable.
*/
-extern void _rtld_debug_state (void);
+void _rtld_debug_state (void);
/**
* The type of constructor/destructor function.
diff --git a/cpukit/include/rtems/scheduler.h b/cpukit/include/rtems/scheduler.h
index d5c7e51ef5..a8004cb5e4 100644
--- a/cpukit/include/rtems/scheduler.h
+++ b/cpukit/include/rtems/scheduler.h
@@ -132,6 +132,10 @@
#endif
#ifdef CONFIGURE_SCHEDULER_EDF_SMP
+ #ifndef RTEMS_SMP
+ #error "CONFIGURE_SCHEDULER_EDF_SMP cannot be used if RTEMS_SMP is disabled"
+ #endif
+
#include <rtems/score/scheduleredfsmp.h>
#ifndef CONFIGURE_MAXIMUM_PROCESSORS
@@ -198,6 +202,10 @@
#endif
#ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP
+ #ifndef RTEMS_SMP
+ #error "CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP cannot be used if RTEMS_SMP is disabled"
+ #endif
+
#include <rtems/score/schedulerpriorityaffinitysmp.h>
#define SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name ) \
@@ -230,6 +238,10 @@
#endif
#ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP
+ #ifndef RTEMS_SMP
+ #error "CONFIGURE_SCHEDULER_PRIORITY_SMP cannot be used if RTEMS_SMP is disabled"
+ #endif
+
#include <rtems/score/schedulerprioritysmp.h>
#define SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name ) \
@@ -262,6 +274,10 @@
#endif
#ifdef CONFIGURE_SCHEDULER_STRONG_APA
+ #ifndef RTEMS_SMP
+ #error "CONFIGURE_SCHEDULER_STRONG_APA cannot be used if RTEMS_SMP is disabled"
+ #endif
+
#include <rtems/score/schedulerstrongapa.h>
#ifndef CONFIGURE_MAXIMUM_PROCESSORS
@@ -324,6 +340,10 @@
#endif
#ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP
+ #ifndef RTEMS_SMP
+ #error "CONFIGURE_SCHEDULER_SIMPLE_SMP cannot be used if RTEMS_SMP is disabled"
+ #endif
+
#include <rtems/score/schedulersimplesmp.h>
#define SCHEDULER_SIMPLE_SMP_CONTEXT_NAME( name ) \
diff --git a/cpukit/include/rtems/score/address.h b/cpukit/include/rtems/score/address.h
index 02e7c5f954..e6a06f5996 100644
--- a/cpukit/include/rtems/score/address.h
+++ b/cpukit/include/rtems/score/address.h
@@ -69,7 +69,7 @@ extern "C" {
*
* @return This method returns the resulting address.
*/
-RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
+static inline void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
@@ -90,7 +90,7 @@ RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
* @return This method returns the resulting address.
*/
-RTEMS_INLINE_ROUTINE void *_Addresses_Subtract_offset (
+static inline void *_Addresses_Subtract_offset (
const void *base,
uintptr_t offset
)
@@ -109,7 +109,7 @@ RTEMS_INLINE_ROUTINE void *_Addresses_Subtract_offset (
*
* @return This method returns the resulting address.
*/
-RTEMS_INLINE_ROUTINE intptr_t _Addresses_Subtract(
+static inline intptr_t _Addresses_Subtract(
const void *left,
const void *right
)
@@ -129,7 +129,7 @@ RTEMS_INLINE_ROUTINE intptr_t _Addresses_Subtract(
* @retval true The @a address is aligned.
* @retval false The @a address is not aligned.
*/
-RTEMS_INLINE_ROUTINE bool _Addresses_Is_aligned(
+static inline bool _Addresses_Is_aligned(
const void *address
)
{
@@ -152,7 +152,7 @@ RTEMS_INLINE_ROUTINE bool _Addresses_Is_aligned(
* @retval true The @a address is within the memory range specified
* @retval false The @a address is not within the memory range specified.
*/
-RTEMS_INLINE_ROUTINE bool _Addresses_Is_in_range (
+static inline bool _Addresses_Is_in_range (
const void *address,
const void *base,
const void *limit
@@ -174,7 +174,7 @@ RTEMS_INLINE_ROUTINE bool _Addresses_Is_in_range (
*
* @return Returns the aligned address.
*/
-RTEMS_INLINE_ROUTINE void *_Addresses_Align_up(
+static inline void *_Addresses_Align_up(
void *address,
size_t alignment
)
@@ -196,7 +196,7 @@ RTEMS_INLINE_ROUTINE void *_Addresses_Align_up(
*
* @return Returns the aligned address.
*/
-RTEMS_INLINE_ROUTINE void *_Addresses_Align_down(
+static inline void *_Addresses_Align_down(
void *address,
size_t alignment
)
diff --git a/cpukit/include/rtems/score/basedefs.h b/cpukit/include/rtems/score/basedefs.h
index 7a37299eee..c182ea02ec 100644
--- a/cpukit/include/rtems/score/basedefs.h
+++ b/cpukit/include/rtems/score/basedefs.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSScore
+ *
* @brief This header file provides basic definitions used by the API and the
* implementation.
*/
@@ -423,9 +425,11 @@ extern "C" {
*/
#define RTEMS_XCONCAT( _x, _y ) RTEMS_CONCAT( _x, _y )
-/* Generated from spec:/score/if/assert-unreachable */
+/* Generated from spec:/score/basedefs/if/assert-unreachable */
/**
+ * @ingroup RTEMSScore
+ *
* @brief Asserts that this program point is unreachable.
*/
#if defined(RTEMS_DEBUG)
@@ -435,9 +439,11 @@ extern "C" {
#endif
#if !defined(ASM)
- /* Generated from spec:/score/if/dequalify-types-not-compatible */
+ /* Generated from spec:/score/basedefs/if/dequalify-types-not-compatible */
/**
+ * @ingroup RTEMSScore
+ *
* @brief A not implemented function to trigger compile time errors with an
* error message.
*/
@@ -468,12 +474,18 @@ extern "C" {
( const_cast<_type>( _var ) )
#elif defined(__GNUC__)
#define RTEMS_DEQUALIFY_DEPTHX( _ptr_level, _type, _var ) \
- __builtin_choose_expr( __builtin_types_compatible_p( \
+ __builtin_choose_expr( \
+ __builtin_types_compatible_p( \
RTEMS_TYPEOF_REFX( _ptr_level, _var ), \
RTEMS_TYPEOF_REFX( _ptr_level, _type ) \
- ) || __builtin_types_compatible_p( _type, void * ), \
- (_type) ( _var ), \
- RTEMS_DEQUALIFY_types_not_compatible() )
+ ) || \
+ __builtin_types_compatible_p( \
+ _type, \
+ void * \
+ ), \
+ (_type) ( _var ), \
+ RTEMS_DEQUALIFY_types_not_compatible() \
+ )
#else
#define RTEMS_DEQUALIFY_DEPTHX( _ptr_level, _type, _var ) \
( (_type) (uintptr_t) (const volatile void *)( _var ) )
diff --git a/cpukit/include/rtems/score/chain.h b/cpukit/include/rtems/score/chain.h
index 7414fdb697..95f2d2b2ef 100644
--- a/cpukit/include/rtems/score/chain.h
+++ b/cpukit/include/rtems/score/chain.h
@@ -61,17 +61,7 @@ extern "C" {
*/
/**
- * @typedef Chain_Node
- *
- * This type definition promotes the name for the Chain Node used by
- * all RTEMS code. It is a separate type definition because a forward
- * reference is required to define it. See @ref Chain_Node_struct for
- * detailed information.
- */
-typedef struct Chain_Node_struct Chain_Node;
-
-/**
- * @struct Chain_Node_struct
+ * @brief This structure represents a chain node.
*
* This is used to manage each element (node) which is placed
* on a chain.
@@ -85,15 +75,15 @@ typedef struct Chain_Node_struct Chain_Node;
* so the user can cast the pointers back and forth.
*
*/
-struct Chain_Node_struct {
+typedef struct Chain_Node {
/** This points to the node after this one on this chain. */
- Chain_Node *next;
+ struct Chain_Node *next;
/** This points to the node immediate prior to this one on this chain. */
- Chain_Node *previous;
-};
+ struct Chain_Node *previous;
+} Chain_Node;
/**
- * @struct Chain_Control
+ * @brief This union represents a chain control block.
*
* This is used to manage a chain. A chain consists of a doubly
* linked list of zero or more nodes.
diff --git a/cpukit/include/rtems/score/chainimpl.h b/cpukit/include/rtems/score/chainimpl.h
index 4b53fa266e..1f0d29cc6d 100644
--- a/cpukit/include/rtems/score/chainimpl.h
+++ b/cpukit/include/rtems/score/chainimpl.h
@@ -121,7 +121,7 @@ size_t _Chain_Node_count_unprotected( const Chain_Control *chain );
*
* @param[out] node The node to set off chain.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
+static inline void _Chain_Set_off_chain(
Chain_Node *node
)
{
@@ -139,7 +139,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
*
* @param[out] the_node The chain node to initialize.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Initialize_node( Chain_Node *the_node )
+static inline void _Chain_Initialize_node( Chain_Node *the_node )
{
#if defined(RTEMS_DEBUG)
_Chain_Set_off_chain( the_node );
@@ -159,7 +159,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Initialize_node( Chain_Node *the_node )
* @retval true The @a node is off chain.
* @retval false The @a node is not off chain.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
+static inline bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
@@ -178,7 +178,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
* @retval true @a left and @a right are equal.
* @retval false @a left and @a right are not equal.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Are_nodes_equal(
+static inline bool _Chain_Are_nodes_equal(
const Chain_Node *left,
const Chain_Node *right
)
@@ -195,7 +195,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Are_nodes_equal(
*
* @return This method returns the permanent head node of the chain.
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head(
+static inline Chain_Node *_Chain_Head(
Chain_Control *the_chain
)
{
@@ -211,7 +211,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head(
*
* @return This method returns the permanent head node of the chain.
*/
-RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_head(
+static inline const Chain_Node *_Chain_Immutable_head(
const Chain_Control *the_chain
)
{
@@ -227,7 +227,7 @@ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_head(
*
* @return This method returns the permanent tail node of the chain.
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
+static inline Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
@@ -243,7 +243,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
*
* @return This method returns the permanent tail node of the chain.
*/
-RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
+static inline const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
@@ -260,7 +260,7 @@ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
*
* @return This method returns the first node of the chain.
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
+static inline Chain_Node *_Chain_First(
const Chain_Control *the_chain
)
{
@@ -277,7 +277,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
*
* @return This method returns the first node of the chain.
*/
-RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
+static inline const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
@@ -294,7 +294,7 @@ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
*
* @return This method returns the last node of the chain.
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last(
+static inline Chain_Node *_Chain_Last(
const Chain_Control *the_chain
)
{
@@ -311,7 +311,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last(
*
* @return This method returns the last node of the chain.
*/
-RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_last(
+static inline const Chain_Node *_Chain_Immutable_last(
const Chain_Control *the_chain
)
{
@@ -327,7 +327,7 @@ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_last(
*
* @return This method returns the next node on the chain.
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
+static inline Chain_Node *_Chain_Next(
const Chain_Node *the_node
)
{
@@ -343,7 +343,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
*
* @return This method returns the next node on the chain.
*/
-RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next(
+static inline const Chain_Node *_Chain_Immutable_next(
const Chain_Node *the_node
)
{
@@ -359,7 +359,7 @@ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next(
*
* @return This method returns the previous node on the chain.
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Previous(
+static inline Chain_Node *_Chain_Previous(
const Chain_Node *the_node
)
{
@@ -375,7 +375,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Previous(
*
* @return This method returns the previous node on the chain.
*/
-RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_previous(
+static inline const Chain_Node *_Chain_Immutable_previous(
const Chain_Node *the_node
)
{
@@ -393,7 +393,7 @@ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_previous(
* @retval true There are no nodes on @a the_chain.
* @retval false There are nodes on @a the_chain.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
+static inline bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
@@ -413,7 +413,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
* @retval true @a the_node is the first node on a chain.
* @retval false @a the_node is not the first node on a chain.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Is_first(
+static inline bool _Chain_Is_first(
const Chain_Node *the_node
)
{
@@ -432,7 +432,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_first(
* @retval true @a the_node is the last node on a chain.
* @retval false @a the_node is not the last node on a chain.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Is_last(
+static inline bool _Chain_Is_last(
const Chain_Node *the_node
)
{
@@ -450,7 +450,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_last(
* @retval true There is only one node on @a the_chain.
* @retval false There is more than one node on @a the_chain.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Has_only_one_node(
+static inline bool _Chain_Has_only_one_node(
const Chain_Control *the_chain
)
{
@@ -470,7 +470,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Has_only_one_node(
* @retval true @a the_node is the head of @a the_chain.
* @retval false @a the_node is not the head of @a the_chain.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Is_head(
+static inline bool _Chain_Is_head(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
@@ -490,7 +490,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_head(
* @retval true @a the_node is the tail of @a the_chain.
* @retval false @a the_node is not the tail of @a the_chain.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
+static inline bool _Chain_Is_tail(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
@@ -505,7 +505,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
*
* @param[out] the_chain The chain to be initialized.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
+static inline void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
@@ -528,7 +528,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
* @param[out] the_chain The chain to be initialized to contain exactly the specified node.
* @param[out] the_node The one and only node of the chain to be initialized.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Initialize_one(
+static inline void _Chain_Initialize_one(
Chain_Control *the_chain,
Chain_Node *the_node
)
@@ -558,7 +558,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Initialize_one(
*
* @param[out] the_node The node to be extracted.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Extract_unprotected(
+static inline void _Chain_Extract_unprotected(
Chain_Node *the_node
)
{
@@ -592,7 +592,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Extract_unprotected(
* @note This routine assumes that there is at least one node on the chain
* and always returns a node even if it is the Chain Tail.
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
+static inline Chain_Node *_Chain_Get_first_unprotected(
Chain_Control *the_chain
)
{
@@ -630,7 +630,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
* @note It does NOT disable interrupts to ensure the atomicity of the
* get operation.
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
+static inline Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
@@ -653,7 +653,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
* @note It does NOT disable interrupts to ensure the atomicity
* of the extract operation.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Insert_unprotected(
+static inline void _Chain_Insert_unprotected(
Chain_Node *after_node,
Chain_Node *the_node
)
@@ -680,7 +680,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Insert_unprotected(
* @note It does NOT disable interrupts to ensure the atomicity of the
* append operation.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
+static inline void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
@@ -711,7 +711,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
*
* @see _Chain_Append_unprotected() and _Chain_Is_node_off_chain().
*/
-RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected(
+static inline void _Chain_Append_if_is_off_chain_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
@@ -732,7 +732,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected(
* @note It does NOT disable interrupts to ensure the atomicity of the
* prepend operation.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
+static inline void _Chain_Prepend_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
@@ -754,7 +754,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
* @retval true The chain was empty before.
* @retval false The chain contained at least one node before.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Append_with_empty_check_unprotected(
+static inline bool _Chain_Append_with_empty_check_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
@@ -780,7 +780,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Append_with_empty_check_unprotected(
* @retval true The chain was empty before.
* @retval false The chain contained at least one node before.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Prepend_with_empty_check_unprotected(
+static inline bool _Chain_Prepend_with_empty_check_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
@@ -810,7 +810,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Prepend_with_empty_check_unprotected(
* @retval true The chain is empty now.
* @retval false The chain contains at least one node now.
*/
-RTEMS_INLINE_ROUTINE bool _Chain_Get_with_empty_check_unprotected(
+static inline bool _Chain_Get_with_empty_check_unprotected(
Chain_Control *the_chain,
Chain_Node **the_node
)
@@ -865,7 +865,7 @@ typedef bool ( *Chain_Node_order )(
* variable.
* @param order The order relation.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Insert_ordered_unprotected(
+static inline void _Chain_Insert_ordered_unprotected(
Chain_Control *the_chain,
Chain_Node *to_insert,
const void *key,
@@ -954,7 +954,7 @@ typedef struct {
*
* @param[out] the_registry The chain iterator registry to be initialized.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Iterator_registry_initialize(
+static inline void _Chain_Iterator_registry_initialize(
Chain_Iterator_registry *the_registry
)
{
@@ -973,7 +973,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Iterator_registry_initialize(
* @param[in, out] the_registry the chain iterator registry.
* @param[out] the_node_to_extract The node that will be extracted.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Iterator_registry_update(
+static inline void _Chain_Iterator_registry_update(
Chain_Iterator_registry *the_registry,
Chain_Node *the_node_to_extract
)
@@ -1060,7 +1060,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Iterator_registry_update(
* implementation is unfit for use in performance relevant components, due to
* the linear time complexity in _Chain_Iterator_registry_update().
*/
-RTEMS_INLINE_ROUTINE void _Chain_Iterator_initialize(
+static inline void _Chain_Iterator_initialize(
Chain_Control *the_chain,
Chain_Iterator_registry *the_registry,
Chain_Iterator *the_iterator,
@@ -1092,7 +1092,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Iterator_initialize(
*
* @return The next node in the iterator direction
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Iterator_next(
+static inline Chain_Node *_Chain_Iterator_next(
const Chain_Iterator *the_iterator
)
{
@@ -1109,7 +1109,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Iterator_next(
* @param[out] the_iterator The chain iterator.
* @param[out] the_node The new iterator position.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Iterator_set_position(
+static inline void _Chain_Iterator_set_position(
Chain_Iterator *the_iterator,
Chain_Node *the_node
)
@@ -1124,7 +1124,7 @@ RTEMS_INLINE_ROUTINE void _Chain_Iterator_set_position(
*
* @param[out] the_iterator The chain iterator.
*/
-RTEMS_INLINE_ROUTINE void _Chain_Iterator_destroy(
+static inline void _Chain_Iterator_destroy(
Chain_Iterator *the_iterator
)
{
diff --git a/cpukit/include/rtems/score/corebarrierimpl.h b/cpukit/include/rtems/score/corebarrierimpl.h
index 707d9cb3aa..b58bc44b4c 100644
--- a/cpukit/include/rtems/score/corebarrierimpl.h
+++ b/cpukit/include/rtems/score/corebarrierimpl.h
@@ -89,7 +89,7 @@ void _CORE_barrier_Initialize(
*
* @param[out] the_barrier The barrier to destroy.
*/
-RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy(
+static inline void _CORE_barrier_Destroy(
CORE_barrier_Control *the_barrier
)
{
@@ -102,7 +102,7 @@ RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy(
* @param[in, out] the_barrier The barrier to acquire.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical(
+static inline void _CORE_barrier_Acquire_critical(
CORE_barrier_Control *the_barrier,
Thread_queue_Context *queue_context
)
@@ -116,7 +116,7 @@ RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical(
* @param[in, out] the_barrier The barrier to release.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_barrier_Release(
+static inline void _CORE_barrier_Release(
CORE_barrier_Control *the_barrier,
Thread_queue_Context *queue_context
)
@@ -157,7 +157,7 @@ Status_Control _CORE_barrier_Seize(
*
* @return The number of unblocked threads.
*/
-RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender(
+static inline uint32_t _CORE_barrier_Surrender(
CORE_barrier_Control *the_barrier,
Thread_queue_Context *queue_context
)
@@ -176,7 +176,7 @@ RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender(
* @param[in, out] the_barrier The barrier to flush.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush(
+static inline void _CORE_barrier_Flush(
CORE_barrier_Control *the_barrier,
Thread_queue_Context *queue_context
)
diff --git a/cpukit/include/rtems/score/coremsgimpl.h b/cpukit/include/rtems/score/coremsgimpl.h
index fff3f3e159..8ed5719e04 100644
--- a/cpukit/include/rtems/score/coremsgimpl.h
+++ b/cpukit/include/rtems/score/coremsgimpl.h
@@ -372,7 +372,7 @@ void _CORE_message_queue_Insert_message(
* @retval STATUS_MESSAGE_QUEUE_WAIT_IN_ISR The caller is in an ISR, do not block!
* @retval STATUS_TIMEOUT A timeout occurred.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_message_queue_Send(
+static inline Status_Control _CORE_message_queue_Send(
CORE_message_queue_Control *the_message_queue,
const void *buffer,
size_t size,
@@ -408,7 +408,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_message_queue_Send(
* @retval STATUS_MESSAGE_QUEUE_WAIT_IN_ISR The caller is in an ISR, do not block!
* @retval STATUS_TIMEOUT A timeout occurred.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_message_queue_Urgent(
+static inline Status_Control _CORE_message_queue_Urgent(
CORE_message_queue_Control *the_message_queue,
const void *buffer,
size_t size,
@@ -433,7 +433,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_message_queue_Urgent(
* @param[in, out] the_message_queue Rhe message queue to acquire.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Acquire(
+static inline void _CORE_message_queue_Acquire(
CORE_message_queue_Control *the_message_queue,
Thread_queue_Context *queue_context
)
@@ -447,7 +447,7 @@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Acquire(
* @param[in, out] the_message_queue The message queue to acquire critical.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Acquire_critical(
+static inline void _CORE_message_queue_Acquire_critical(
CORE_message_queue_Control *the_message_queue,
Thread_queue_Context *queue_context
)
@@ -461,7 +461,7 @@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Acquire_critical(
* @param[in, out] the_message_queue The message queue to release.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Release(
+static inline void _CORE_message_queue_Release(
CORE_message_queue_Control *the_message_queue,
Thread_queue_Context *queue_context
)
@@ -479,7 +479,7 @@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Release(
* @param[out] destination The destination messag buffer to copy the source to.
* @param size The size of the source buffer.
*/
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Copy_buffer (
+static inline void _CORE_message_queue_Copy_buffer (
const void *source,
void *destination,
size_t size
@@ -499,7 +499,7 @@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Copy_buffer (
* @retval pointer The allocated message buffer.
* @retval NULL The inactive message buffer chain is empty.
*/
-RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer *
+static inline CORE_message_queue_Buffer *
_CORE_message_queue_Allocate_message_buffer (
CORE_message_queue_Control *the_message_queue
)
@@ -517,7 +517,7 @@ _CORE_message_queue_Allocate_message_buffer (
* @param[in, out] the_message_queue The message queue to free the message buffer to.
* @param[out] the_message The message to be freed.
*/
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
+static inline void _CORE_message_queue_Free_message_buffer (
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Buffer *the_message
)
@@ -538,7 +538,7 @@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
* @note It encapsulates the optional behavior that message priority is
* disabled if no API requires it.
*/
-RTEMS_INLINE_ROUTINE int _CORE_message_queue_Get_message_priority (
+static inline int _CORE_message_queue_Get_message_priority (
const CORE_message_queue_Buffer *the_message
)
{
@@ -560,7 +560,7 @@ RTEMS_INLINE_ROUTINE int _CORE_message_queue_Get_message_priority (
* @retval pointer The first message if the message queue is not empty.
* @retval NULL The message queue is empty.
*/
-RTEMS_INLINE_ROUTINE
+static inline
CORE_message_queue_Buffer *_CORE_message_queue_Get_pending_message (
CORE_message_queue_Control *the_message_queue
)
@@ -581,7 +581,7 @@ RTEMS_INLINE_ROUTINE
* @retval true Notification is enabled on this message queue.
* @retval false Notification is not enabled on this message queue.
*/
- RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_notify_enabled (
+ static inline bool _CORE_message_queue_Is_notify_enabled (
CORE_message_queue_Control *the_message_queue
)
{
@@ -599,7 +599,7 @@ RTEMS_INLINE_ROUTINE
* @param[out] the_handler The notification information for the message queue.
*/
#if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
- RTEMS_INLINE_ROUTINE void _CORE_message_queue_Set_notify (
+ static inline void _CORE_message_queue_Set_notify (
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Notify_Handler the_handler
)
@@ -627,7 +627,7 @@ RTEMS_INLINE_ROUTINE
* @retval thread The Thread_Control for the first locked thread, if there is a locked thread.
* @retval NULL There are pending messages or no thread waiting to receive.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_CORE_message_queue_Dequeue_receiver(
+static inline Thread_Control *_CORE_message_queue_Dequeue_receiver(
CORE_message_queue_Control *the_message_queue,
const void *buffer,
size_t size,
diff --git a/cpukit/include/rtems/score/coremuteximpl.h b/cpukit/include/rtems/score/coremuteximpl.h
index d489a0d946..bcdd1adceb 100644
--- a/cpukit/include/rtems/score/coremuteximpl.h
+++ b/cpukit/include/rtems/score/coremuteximpl.h
@@ -65,7 +65,7 @@ extern "C" {
*
* @param[out] the_mutex The mutex to initialize.
*/
-RTEMS_INLINE_ROUTINE void _CORE_mutex_Initialize(
+static inline void _CORE_mutex_Initialize(
CORE_mutex_Control *the_mutex
)
{
@@ -77,7 +77,7 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Initialize(
*
* @param[out] the_mutex the mutex to destroy.
*/
-RTEMS_INLINE_ROUTINE void _CORE_mutex_Destroy( CORE_mutex_Control *the_mutex )
+static inline void _CORE_mutex_Destroy( CORE_mutex_Control *the_mutex )
{
_Thread_queue_Destroy( &the_mutex->Wait_queue );
}
@@ -88,7 +88,7 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Destroy( CORE_mutex_Control *the_mutex )
* @param[in, out] the_mutex The mutex to acquire critical.
* @param queue_context The queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_mutex_Acquire_critical(
+static inline void _CORE_mutex_Acquire_critical(
CORE_mutex_Control *the_mutex,
Thread_queue_Context *queue_context
)
@@ -102,7 +102,7 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Acquire_critical(
* @param[in, out] the_mutex The mutex to release.
* @param queue_context The queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_mutex_Release(
+static inline void _CORE_mutex_Release(
CORE_mutex_Control *the_mutex,
Thread_queue_Context *queue_context
)
@@ -117,7 +117,7 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Release(
*
* @return The owner of the mutex.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_CORE_mutex_Get_owner(
+static inline Thread_Control *_CORE_mutex_Get_owner(
const CORE_mutex_Control *the_mutex
)
{
@@ -135,7 +135,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_CORE_mutex_Get_owner(
* @retval true The mutex is locked.
* @retval false The mutex is not locked.
*/
-RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_locked(
+static inline bool _CORE_mutex_Is_locked(
const CORE_mutex_Control *the_mutex
)
{
@@ -168,7 +168,7 @@ Status_Control _CORE_mutex_Seize_slow(
* @param[out] the_mutex The mutex to set the owner from.
* @param owner The new owner of the mutex.
*/
-RTEMS_INLINE_ROUTINE void _CORE_mutex_Set_owner(
+static inline void _CORE_mutex_Set_owner(
CORE_mutex_Control *the_mutex,
Thread_Control *owner
)
@@ -185,7 +185,7 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Set_owner(
* @retval true @a the_thread is the owner of @a the_mutex.
* @retval false @a the_thread is not the owner of @a the_mutex.
*/
-RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_owner(
+static inline bool _CORE_mutex_Is_owner(
const CORE_mutex_Control *the_mutex,
const Thread_Control *the_thread
)
@@ -198,7 +198,7 @@ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_owner(
*
* @param[out] the_mutex The recursive mutex to initialize.
*/
-RTEMS_INLINE_ROUTINE void _CORE_recursive_mutex_Initialize(
+static inline void _CORE_recursive_mutex_Initialize(
CORE_recursive_mutex_Control *the_mutex
)
{
@@ -213,7 +213,7 @@ RTEMS_INLINE_ROUTINE void _CORE_recursive_mutex_Initialize(
*
* @return STATUS_SUCCESSFUL, this method is always successful.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_recursive_mutex_Seize_nested(
+static inline Status_Control _CORE_recursive_mutex_Seize_nested(
CORE_recursive_mutex_Control *the_mutex
)
{
@@ -236,7 +236,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_recursive_mutex_Seize_nested(
* @retval _Thread_Wait_get_status The status of the executing thread.
* @retval STATUS_UNAVAILABLE The calling thread is not willing to wait.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_recursive_mutex_Seize(
+static inline Status_Control _CORE_recursive_mutex_Seize(
CORE_recursive_mutex_Control *the_mutex,
const Thread_queue_Operations *operations,
Thread_Control *executing,
@@ -286,7 +286,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_recursive_mutex_Seize(
* @retval STATUS_SUCCESSFUL @a the_mutex is successfully surrendered.
* @retval STATUS_NOT_OWNER The executing thread does not own @a the_mutex.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_recursive_mutex_Surrender(
+static inline Status_Control _CORE_recursive_mutex_Surrender(
CORE_recursive_mutex_Control *the_mutex,
const Thread_queue_Operations *operations,
Thread_Control *executing,
@@ -339,7 +339,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_recursive_mutex_Surrender(
* Only needed if RTEMS_SMP is defined
* @param priority_ceiling The priority ceiling for the initialized mutex.
*/
-RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Initialize(
+static inline void _CORE_ceiling_mutex_Initialize(
CORE_ceiling_mutex_Control *the_mutex,
const Scheduler_Control *scheduler,
Priority_Control priority_ceiling
@@ -359,7 +359,7 @@ RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Initialize(
*
* @return The scheduler of the mutex. If RTEMS_SMP is not defined, the first entry of the _Scheduler_Table is returned.
*/
-RTEMS_INLINE_ROUTINE const Scheduler_Control *
+static inline const Scheduler_Control *
_CORE_ceiling_mutex_Get_scheduler(
const CORE_ceiling_mutex_Control *the_mutex
)
@@ -377,7 +377,7 @@ _CORE_ceiling_mutex_Get_scheduler(
* @param[out] the_mutex The ceiling mutex to set the priority of.
* @param priority_ceiling The new priority ceiling of the mutex.
*/
-RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Set_priority(
+static inline void _CORE_ceiling_mutex_Set_priority(
CORE_ceiling_mutex_Control *the_mutex,
Priority_Control priority_ceiling
)
@@ -412,7 +412,7 @@ RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Set_priority(
*
* @return The priority ceiling of @a the_mutex.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _CORE_ceiling_mutex_Get_priority(
+static inline Priority_Control _CORE_ceiling_mutex_Get_priority(
const CORE_ceiling_mutex_Control *the_mutex
)
{
@@ -430,7 +430,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _CORE_ceiling_mutex_Get_priority(
* @retval STATUS_MUTEX_CEILING_VIOLATED The owners wait priority
* is smaller than the priority of the ceiling mutex.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Set_owner(
+static inline Status_Control _CORE_ceiling_mutex_Set_owner(
CORE_ceiling_mutex_Control *the_mutex,
Thread_Control *owner,
Thread_queue_Context *queue_context
@@ -484,7 +484,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Set_owner(
* is smaller than the priority of the ceiling mutex.
* @retval other Return value of @a nested.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Seize(
+static inline Status_Control _CORE_ceiling_mutex_Seize(
CORE_ceiling_mutex_Control *the_mutex,
Thread_Control *executing,
bool wait,
@@ -544,7 +544,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Seize(
* @retval STATUS_SUCCESSFUL The ceiling mutex was successfullysurrendered.
* @retval STATUS_NOT_OWNER The executing thread is not the owner of @a the_mutex.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Surrender(
+static inline Status_Control _CORE_ceiling_mutex_Surrender(
CORE_ceiling_mutex_Control *the_mutex,
Thread_Control *executing,
Thread_queue_Context *queue_context
diff --git a/cpukit/include/rtems/score/corerwlockimpl.h b/cpukit/include/rtems/score/corerwlockimpl.h
index d59abd6f81..0cb2965199 100644
--- a/cpukit/include/rtems/score/corerwlockimpl.h
+++ b/cpukit/include/rtems/score/corerwlockimpl.h
@@ -124,7 +124,7 @@ void _CORE_RWLock_Initialize(
*
* @param[out] the_rwlock is the RWLock to destroy.
*/
-RTEMS_INLINE_ROUTINE void _CORE_RWLock_Destroy(
+static inline void _CORE_RWLock_Destroy(
CORE_RWLock_Control *the_rwlock
)
{
@@ -139,7 +139,7 @@ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Destroy(
*
* @return The executing thread.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_CORE_RWLock_Acquire(
+static inline Thread_Control *_CORE_RWLock_Acquire(
CORE_RWLock_Control *the_rwlock,
Thread_queue_Context *queue_context
)
@@ -165,7 +165,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_CORE_RWLock_Acquire(
* @param[in, out] the_rwlock The RWlock to release.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_RWLock_Release(
+static inline void _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock,
Thread_queue_Context *queue_context
)
diff --git a/cpukit/include/rtems/score/coresemimpl.h b/cpukit/include/rtems/score/coresemimpl.h
index f7168d6f63..ca952a4570 100644
--- a/cpukit/include/rtems/score/coresemimpl.h
+++ b/cpukit/include/rtems/score/coresemimpl.h
@@ -81,7 +81,7 @@ void _CORE_semaphore_Initialize(
* @param[in, out] the_semaphore The semaphore to acquire.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_semaphore_Acquire_critical(
+static inline void _CORE_semaphore_Acquire_critical(
CORE_semaphore_Control *the_semaphore,
Thread_queue_Context *queue_context
)
@@ -97,7 +97,7 @@ RTEMS_INLINE_ROUTINE void _CORE_semaphore_Acquire_critical(
* @param[in, out] the_semaphore The semaphore to release.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_semaphore_Release(
+static inline void _CORE_semaphore_Release(
CORE_semaphore_Control *the_semaphore,
Thread_queue_Context *queue_context
)
@@ -114,7 +114,7 @@ RTEMS_INLINE_ROUTINE void _CORE_semaphore_Release(
* @param operations The thread queue operations.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _CORE_semaphore_Destroy(
+static inline void _CORE_semaphore_Destroy(
CORE_semaphore_Control *the_semaphore,
const Thread_queue_Operations *operations,
Thread_queue_Context *queue_context
@@ -145,7 +145,7 @@ RTEMS_INLINE_ROUTINE void _CORE_semaphore_Destroy(
* @retval STATUS_SUCCESSFUL The unit was successfully freed to the semaphore.
* @retval STATUS_MAXIMUM_COUNT_EXCEEDED The maximum number of units was exceeded.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_semaphore_Surrender(
+static inline Status_Control _CORE_semaphore_Surrender(
CORE_semaphore_Control *the_semaphore,
const Thread_queue_Operations *operations,
uint32_t maximum_count,
@@ -187,7 +187,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_semaphore_Surrender(
*
* @return the current count of this semaphore.
*/
-RTEMS_INLINE_ROUTINE uint32_t _CORE_semaphore_Get_count(
+static inline uint32_t _CORE_semaphore_Get_count(
const CORE_semaphore_Control *the_semaphore
)
{
@@ -214,7 +214,7 @@ RTEMS_INLINE_ROUTINE uint32_t _CORE_semaphore_Get_count(
* calling thread not willing to wait.
* @retval STATUS_TIMEOUT A timeout occurred.
*/
-RTEMS_INLINE_ROUTINE Status_Control _CORE_semaphore_Seize(
+static inline Status_Control _CORE_semaphore_Seize(
CORE_semaphore_Control *the_semaphore,
const Thread_queue_Operations *operations,
Thread_Control *executing,
diff --git a/cpukit/include/rtems/score/freechainimpl.h b/cpukit/include/rtems/score/freechainimpl.h
index 8eeebcc728..3f02472961 100644
--- a/cpukit/include/rtems/score/freechainimpl.h
+++ b/cpukit/include/rtems/score/freechainimpl.h
@@ -68,7 +68,7 @@ typedef void *( *Freechain_Allocator )( size_t size );
* @param number_nodes The initial number of nodes.
* @param node_size The node size.
*/
-RTEMS_INLINE_ROUTINE void _Freechain_Initialize(
+static inline void _Freechain_Initialize(
Freechain_Control *freechain,
void *initial_nodes,
size_t number_nodes,
@@ -88,7 +88,7 @@ RTEMS_INLINE_ROUTINE void _Freechain_Initialize(
*
* @param freechain The freechain control.
*/
-RTEMS_INLINE_ROUTINE bool _Freechain_Is_empty(
+static inline bool _Freechain_Is_empty(
const Freechain_Control *freechain
)
{
@@ -102,7 +102,7 @@ RTEMS_INLINE_ROUTINE bool _Freechain_Is_empty(
*
* @param freechain The freechain control.
*/
-RTEMS_INLINE_ROUTINE void *_Freechain_Pop( Freechain_Control *freechain )
+static inline void *_Freechain_Pop( Freechain_Control *freechain )
{
return _Chain_Get_first_unprotected( &freechain->Free );
}
@@ -113,7 +113,7 @@ RTEMS_INLINE_ROUTINE void *_Freechain_Pop( Freechain_Control *freechain )
* @param freechain The freechain control.
* @param node The node to push back. The node shall not be @c NULL.
*/
-void RTEMS_INLINE_ROUTINE _Freechain_Push(
+void static inline _Freechain_Push(
Freechain_Control *freechain,
void *node
)
diff --git a/cpukit/include/rtems/score/gcov.h b/cpukit/include/rtems/score/gcov.h
new file mode 100644
index 0000000000..b150c9f763
--- /dev/null
+++ b/cpukit/include/rtems/score/gcov.h
@@ -0,0 +1,87 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreGcov
+ *
+ * @brief This header file provides the interfaces of the
+ * @ref RTEMSScoreGcov.
+ */
+
+/*
+ * Copyright (c) 2013-2014 embedded brains GmbH. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_SCORE_GCOV_H
+#define _RTEMS_SCORE_GCOV_H
+
+#include <gcov.h>
+
+#include <rtems/linkersets.h>
+#include <rtems/score/io.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @defgroup RTEMSScoreGcov Gcov Support
+ *
+ * @ingroup RTEMSScore
+ *
+ * @brief This group contains the gocv support.
+ *
+ * @{
+ */
+
+RTEMS_LINKER_ROSET_DECLARE( gcov_info, const struct gcov_info * );
+
+/**
+ * @brief Dumps the gcov information as a binary gcfn and gcda data
+ * stream using the put character handler.
+ *
+ * @param put_char is the put character handler used to output the data stream.
+ *
+ * @param arg is the argument passed to the put character handler.
+ */
+void _Gcov_Dump_info( IO_Put_char put_char, void *arg );
+
+/**
+ * @brief Dumps the gcov information as a base64 encoded gcfn and gcda data
+ * stream using the put character handler.
+ *
+ * @param put_char is the put character handler used to output the data stream.
+ *
+ * @param arg is the argument passed to the put character handler.
+ */
+void _Gcov_Dump_info_base64( IO_Put_char put_char, void *arg );
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _RTEMS_SCORE_GCOV_H */
diff --git a/cpukit/include/rtems/score/hash.h b/cpukit/include/rtems/score/hash.h
index c6f9ebf463..06c88c6948 100644
--- a/cpukit/include/rtems/score/hash.h
+++ b/cpukit/include/rtems/score/hash.h
@@ -84,7 +84,7 @@ typedef struct {
*
* @return Returns the hash value as a NUL-terminated string.
*/
-RTEMS_INLINE_ROUTINE const char *_Hash_Get_string( const Hash_Control *hash )
+static inline const char *_Hash_Get_string( const Hash_Control *hash )
{
return &hash->chars[ 0 ];
}
@@ -114,7 +114,7 @@ typedef struct {
*
* @param[out] context is the hash context to initialize.
*/
-RTEMS_INLINE_ROUTINE void _Hash_Initialize( Hash_Context *context )
+static inline void _Hash_Initialize( Hash_Context *context )
{
SHA256_Init( &context->Context );
}
@@ -128,7 +128,7 @@ RTEMS_INLINE_ROUTINE void _Hash_Initialize( Hash_Context *context )
*
* @param size is the size of the data in bytes.
*/
-RTEMS_INLINE_ROUTINE void _Hash_Add_data(
+static inline void _Hash_Add_data(
Hash_Context *context,
const void *begin,
size_t size
@@ -144,7 +144,7 @@ RTEMS_INLINE_ROUTINE void _Hash_Add_data(
*
* @param str is the string to add.
*/
-RTEMS_INLINE_ROUTINE void _Hash_Add_string(
+static inline void _Hash_Add_string(
Hash_Context *context,
const char *str
)
diff --git a/cpukit/include/rtems/score/heap.h b/cpukit/include/rtems/score/heap.h
index 963c31d4aa..8777e8b548 100644
--- a/cpukit/include/rtems/score/heap.h
+++ b/cpukit/include/rtems/score/heap.h
@@ -431,7 +431,7 @@ uintptr_t _Heap_No_extend(
*
* @return The @a value aligned to the given @a alignment, rounded up.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up(
+static inline uintptr_t _Heap_Align_up(
uintptr_t value,
uintptr_t alignment
)
@@ -452,7 +452,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up(
*
* @return The minimal Heap Block size for the given @a page_size.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Min_block_size( uintptr_t page_size )
+static inline uintptr_t _Heap_Min_block_size( uintptr_t page_size )
{
return _Heap_Align_up( sizeof( Heap_Block ), page_size );
}
@@ -464,7 +464,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Heap_Min_block_size( uintptr_t page_size )
*
* @return The worst case overhead to manage a memory area.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Area_overhead(
+static inline uintptr_t _Heap_Area_overhead(
uintptr_t page_size
)
{
@@ -493,7 +493,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Heap_Area_overhead(
*
* @return The size with administration and alignment overhead for one allocation.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Size_with_overhead(
+static inline uintptr_t _Heap_Size_with_overhead(
uintptr_t page_size,
uintptr_t size,
uintptr_t alignment
diff --git a/cpukit/include/rtems/score/heapimpl.h b/cpukit/include/rtems/score/heapimpl.h
index 2b1ef21c83..91326c6577 100644
--- a/cpukit/include/rtems/score/heapimpl.h
+++ b/cpukit/include/rtems/score/heapimpl.h
@@ -156,7 +156,7 @@ void *_Heap_Allocate_aligned_with_boundary(
* @retval pointer The starting address of the allocated memory area.
* @retval NULL No memory is available of the parameters are inconsistent.
*/
-RTEMS_INLINE_ROUTINE void *_Heap_Allocate_aligned(
+static inline void *_Heap_Allocate_aligned(
Heap_Control *heap,
uintptr_t size,
uintptr_t alignment
@@ -177,7 +177,7 @@ RTEMS_INLINE_ROUTINE void *_Heap_Allocate_aligned(
* @retval pointer The starting address of the allocated memory area.
* @retval NULL No memory is available of the parameters are inconsistent.
*/
-RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size )
+static inline void *_Heap_Allocate( Heap_Control *heap, uintptr_t size )
{
return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
}
@@ -440,7 +440,7 @@ Heap_Block *_Heap_Block_allocate(
* @param[in, out] heap The heap control.
* @param fraction The fraction is one divided by this fraction value.
*/
-RTEMS_INLINE_ROUTINE void _Heap_Protection_set_delayed_free_fraction(
+static inline void _Heap_Protection_set_delayed_free_fraction(
Heap_Control *heap,
uintptr_t fraction
)
@@ -460,7 +460,7 @@ RTEMS_INLINE_ROUTINE void _Heap_Protection_set_delayed_free_fraction(
*
* @return The head of the free list.
*/
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_head( Heap_Control *heap )
+static inline Heap_Block *_Heap_Free_list_head( Heap_Control *heap )
{
return &heap->free_list;
}
@@ -472,7 +472,7 @@ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_head( Heap_Control *heap )
*
* @return The tail of the free list.
*/
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_tail( Heap_Control *heap )
+static inline Heap_Block *_Heap_Free_list_tail( Heap_Control *heap )
{
return &heap->free_list;
}
@@ -484,7 +484,7 @@ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_tail( Heap_Control *heap )
*
* @return The first block of the free list.
*/
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
+static inline Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
}
@@ -496,7 +496,7 @@ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
*
* @return The last block of the free list.
*/
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap )
+static inline Heap_Block *_Heap_Free_list_last( Heap_Control *heap )
{
return _Heap_Free_list_tail(heap)->prev;
}
@@ -506,7 +506,7 @@ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap )
*
* @param block The block to be removed.
*/
-RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
+static inline void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
@@ -521,7 +521,7 @@ RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
* @param old_block The block in the free list to replace.
* @param new_block The block that should replace @a old_block.
*/
-RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace(
+static inline void _Heap_Free_list_replace(
Heap_Block *old_block,
Heap_Block *new_block
)
@@ -542,7 +542,7 @@ RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace(
* @param block_before The block that is already in the free list.
* @param new_block The block to be inserted after @a block_before.
*/
-RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
+static inline void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
@@ -561,7 +561,7 @@ RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
* @param block_before The block that is already in the free list.
* @param new_block The block to be inserted before @a block_before.
*/
-RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_before(
+static inline void _Heap_Free_list_insert_before(
Heap_Block *block_next,
Heap_Block *new_block
)
@@ -583,7 +583,7 @@ RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_before(
* @retval true The value is aligned to the given alignment.
* @retval false The value is not aligned to the given alignment.
*/
-RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
+static inline bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
@@ -599,7 +599,7 @@ RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
*
* @return The aligned value, truncated.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
+static inline uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
@@ -615,7 +615,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
*
* @return The address of the block which is @a offset away from @a block.
*/
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
+static inline Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
@@ -630,7 +630,7 @@ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
*
* @return The address of the previous block.
*/
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Prev_block(
+static inline Heap_Block *_Heap_Prev_block(
const Heap_Block *block
)
{
@@ -644,7 +644,7 @@ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Prev_block(
*
* @return The first address after the heap header.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
+static inline uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
@@ -659,7 +659,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
*
* @return The Starting address of the corresponding block of the allocatable area.
*/
-RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area(
+static inline Heap_Block *_Heap_Block_of_alloc_area(
uintptr_t alloc_begin,
uintptr_t page_size
)
@@ -675,7 +675,7 @@ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area(
*
* @return The block size.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
+static inline uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
}
@@ -686,7 +686,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
* @param[in, out] block The block of which the size shall be set.
* @param size The new size of the block.
*/
-RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
+static inline void _Heap_Block_set_size(
Heap_Block *block,
uintptr_t size
)
@@ -705,7 +705,7 @@ RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
* @retval true The previous block is used.
* @retval false The previous block is not used.
*/
-RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
+static inline bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
}
@@ -718,7 +718,7 @@ RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
* @retval true The block is used.
* @retval false The block is not used.
*/
-RTEMS_INLINE_ROUTINE bool _Heap_Is_used(
+static inline bool _Heap_Is_used(
const Heap_Block *block
)
{
@@ -736,7 +736,7 @@ RTEMS_INLINE_ROUTINE bool _Heap_Is_used(
* @retval true The block is free.
* @retval false The block is not free.
*/
-RTEMS_INLINE_ROUTINE bool _Heap_Is_free(
+static inline bool _Heap_Is_free(
const Heap_Block *block
)
{
@@ -752,7 +752,7 @@ RTEMS_INLINE_ROUTINE bool _Heap_Is_free(
* @retval true The block is part of the heap.
* @retval false The block is not part of the heap.
*/
-RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
+static inline bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
@@ -774,7 +774,7 @@ RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
*
* @param[in, out] heap The heap to set the last block size of.
*/
-RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap )
+static inline void _Heap_Set_last_block_size( Heap_Control *heap )
{
_Heap_Block_set_size(
heap->last_block,
@@ -791,7 +791,7 @@ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap )
*
* @return The size of the allocatable area in @a heap in bytes.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Get_size( const Heap_Control *heap )
+static inline uintptr_t _Heap_Get_size( const Heap_Control *heap )
{
return heap->stats.size;
}
@@ -805,7 +805,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Heap_Get_size( const Heap_Control *heap )
* @retval a If a > b.
* @retval b If b >= a
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Max( uintptr_t a, uintptr_t b )
+static inline uintptr_t _Heap_Max( uintptr_t a, uintptr_t b )
{
return a > b ? a : b;
}
@@ -819,7 +819,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Heap_Max( uintptr_t a, uintptr_t b )
* @retval a If a < b.
* @retval b If b <= a
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Min( uintptr_t a, uintptr_t b )
+static inline uintptr_t _Heap_Min( uintptr_t a, uintptr_t b )
{
return a < b ? a : b;
}
diff --git a/cpukit/include/rtems/score/interr.h b/cpukit/include/rtems/score/interr.h
index d3fb370ec3..ae4966d6d8 100644
--- a/cpukit/include/rtems/score/interr.h
+++ b/cpukit/include/rtems/score/interr.h
@@ -175,7 +175,7 @@ typedef enum {
* This enum value ensures that the enum type needs at least 32-bits for
* architectures with short enums.
*/
- RTEMS_FATAL_SOURCE_LAST = 0xffffffff
+ RTEMS_FATAL_SOURCE_LAST = 0x7fffffff
} Internal_errors_Source;
/**
diff --git a/cpukit/include/rtems/score/isrlock.h b/cpukit/include/rtems/score/isrlock.h
index 7dbb7aa938..72ac760196 100644
--- a/cpukit/include/rtems/score/isrlock.h
+++ b/cpukit/include/rtems/score/isrlock.h
@@ -172,7 +172,7 @@ typedef struct {
* @param[out] context The ISR lock context.
* @param level The ISR level.
*/
-RTEMS_INLINE_ROUTINE void _ISR_lock_Context_set_level(
+static inline void _ISR_lock_Context_set_level(
ISR_lock_Context *context,
ISR_Level level
)
diff --git a/cpukit/include/rtems/score/memory.h b/cpukit/include/rtems/score/memory.h
index 5761402711..7eceef360b 100644
--- a/cpukit/include/rtems/score/memory.h
+++ b/cpukit/include/rtems/score/memory.h
@@ -10,7 +10,7 @@
/*
* SPDX-License-Identifier: BSD-2-Clause
*
- * Copyright (C) 2019 embedded brains GmbH
+ * Copyright (C) 2019, 2022 embedded brains GmbH
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -115,7 +115,7 @@ typedef struct {
*
* @return The memory area count.
*/
-RTEMS_INLINE_ROUTINE size_t _Memory_Get_count(
+static inline size_t _Memory_Get_count(
const Memory_Information *information
)
{
@@ -130,7 +130,7 @@ RTEMS_INLINE_ROUTINE size_t _Memory_Get_count(
*
* @return The memory area of the specified index.
*/
-RTEMS_INLINE_ROUTINE Memory_Area *_Memory_Get_area(
+static inline Memory_Area *_Memory_Get_area(
const Memory_Information *information,
size_t index
)
@@ -146,7 +146,7 @@ RTEMS_INLINE_ROUTINE Memory_Area *_Memory_Get_area(
* @param begin The begin of the memory area.
* @param end The end of the memory area.
*/
-RTEMS_INLINE_ROUTINE void _Memory_Initialize(
+static inline void _Memory_Initialize(
Memory_Area *area,
void *begin,
void *end
@@ -164,7 +164,7 @@ RTEMS_INLINE_ROUTINE void _Memory_Initialize(
* @param begin The begin of the memory area.
* @param size The size of the memory area in bytes.
*/
-RTEMS_INLINE_ROUTINE void _Memory_Initialize_by_size(
+static inline void _Memory_Initialize_by_size(
Memory_Area *area,
void *begin,
uintptr_t size
@@ -182,7 +182,7 @@ RTEMS_INLINE_ROUTINE void _Memory_Initialize_by_size(
*
* @return The memory area begin.
*/
-RTEMS_INLINE_ROUTINE const void *_Memory_Get_begin( const Memory_Area *area )
+static inline const void *_Memory_Get_begin( const Memory_Area *area )
{
return area->begin;
}
@@ -193,7 +193,7 @@ RTEMS_INLINE_ROUTINE const void *_Memory_Get_begin( const Memory_Area *area )
* @param area The memory area.
* @param begin The memory area begin.
*/
-RTEMS_INLINE_ROUTINE void _Memory_Set_begin(
+static inline void _Memory_Set_begin(
Memory_Area *area,
const void *begin
)
@@ -208,7 +208,7 @@ RTEMS_INLINE_ROUTINE void _Memory_Set_begin(
*
* @return The memory area end.
*/
-RTEMS_INLINE_ROUTINE const void *_Memory_Get_end( const Memory_Area *area )
+static inline const void *_Memory_Get_end( const Memory_Area *area )
{
return area->end;
}
@@ -219,7 +219,7 @@ RTEMS_INLINE_ROUTINE const void *_Memory_Get_end( const Memory_Area *area )
* @param area The memory area.
* @param end The memory area end.
*/
-RTEMS_INLINE_ROUTINE void _Memory_Set_end(
+static inline void _Memory_Set_end(
Memory_Area *area,
const void *end
)
@@ -234,7 +234,7 @@ RTEMS_INLINE_ROUTINE void _Memory_Set_end(
*
* @return The memory area size in bytes.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Memory_Get_size( const Memory_Area *area )
+static inline uintptr_t _Memory_Get_size( const Memory_Area *area )
{
return (uintptr_t) area->end - (uintptr_t) area->begin;
}
@@ -246,7 +246,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Memory_Get_size( const Memory_Area *area )
*
* @return The free memory area begin the memory area.
*/
-RTEMS_INLINE_ROUTINE void *_Memory_Get_free_begin( const Memory_Area *area )
+static inline void *_Memory_Get_free_begin( const Memory_Area *area )
{
return area->free;
}
@@ -257,7 +257,7 @@ RTEMS_INLINE_ROUTINE void *_Memory_Get_free_begin( const Memory_Area *area )
* @param area The memory area.
* @param begin The free memory area begin the memory area.
*/
-RTEMS_INLINE_ROUTINE void _Memory_Set_free_begin(
+static inline void _Memory_Set_free_begin(
Memory_Area *area,
void *begin
)
@@ -272,7 +272,7 @@ RTEMS_INLINE_ROUTINE void _Memory_Set_free_begin(
*
* @return The free memory area size in bytes of the memory area.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Memory_Get_free_size( const Memory_Area *area )
+static inline uintptr_t _Memory_Get_free_size( const Memory_Area *area )
{
return (uintptr_t) area->end - (uintptr_t) area->free;
}
@@ -285,7 +285,7 @@ RTEMS_INLINE_ROUTINE uintptr_t _Memory_Get_free_size( const Memory_Area *area )
* @param consume The bytes to consume from the free memory area of the memory
* area.
*/
-RTEMS_INLINE_ROUTINE void _Memory_Consume(
+static inline void _Memory_Consume(
Memory_Area *area,
uintptr_t consume
)
@@ -352,6 +352,18 @@ void _Memory_Zero_free_areas( void );
*/
void _Memory_Dirty_free_areas( void );
+/**
+ * @brief This symbol marks the begin of the non-initialized section used by
+ * RTEMS.
+ */
+extern char _Memory_Noinit_begin[];
+
+/**
+ * @brief This symbol marks the end of the non-initialized section used by
+ * RTEMS.
+ */
+extern char _Memory_Noinit_end[];
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/score/mpciimpl.h b/cpukit/include/rtems/score/mpciimpl.h
index 5ee819fb32..b646d4be4d 100644
--- a/cpukit/include/rtems/score/mpciimpl.h
+++ b/cpukit/include/rtems/score/mpciimpl.h
@@ -337,7 +337,7 @@ MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void );
* because this enum starts at lower bound of zero.
*/
-RTEMS_INLINE_ROUTINE bool _Mp_packet_Is_valid_packet_class (
+static inline bool _Mp_packet_Is_valid_packet_class (
MP_packet_Classes the_packet_class
)
{
diff --git a/cpukit/include/rtems/score/mrspimpl.h b/cpukit/include/rtems/score/mrspimpl.h
index 50f63f22e0..4a5e68fa41 100644
--- a/cpukit/include/rtems/score/mrspimpl.h
+++ b/cpukit/include/rtems/score/mrspimpl.h
@@ -64,7 +64,7 @@ extern "C" {
* @param mrsp The MrsP control for the operation.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _MRSP_Acquire_critical(
+static inline void _MRSP_Acquire_critical(
MRSP_Control *mrsp,
Thread_queue_Context *queue_context
)
@@ -78,7 +78,7 @@ RTEMS_INLINE_ROUTINE void _MRSP_Acquire_critical(
* @param mrsp The MrsP control for the operation.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _MRSP_Release(
+static inline void _MRSP_Release(
MRSP_Control *mrsp,
Thread_queue_Context *queue_context
)
@@ -93,7 +93,7 @@ RTEMS_INLINE_ROUTINE void _MRSP_Release(
*
* @return The owner of the Mrsp control.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_MRSP_Get_owner(
+static inline Thread_Control *_MRSP_Get_owner(
const MRSP_Control *mrsp
)
{
@@ -106,7 +106,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_MRSP_Get_owner(
* @param[out] mrsp The MrsP control to set the owner of.
* @param owner The desired new owner for @a mrsp.
*/
-RTEMS_INLINE_ROUTINE void _MRSP_Set_owner(
+static inline void _MRSP_Set_owner(
MRSP_Control *mrsp,
Thread_Control *owner
)
@@ -122,7 +122,7 @@ RTEMS_INLINE_ROUTINE void _MRSP_Set_owner(
*
* @return The priority of the MrsP control.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _MRSP_Get_priority(
+static inline Priority_Control _MRSP_Get_priority(
const MRSP_Control *mrsp,
const Scheduler_Control *scheduler
)
@@ -140,7 +140,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _MRSP_Get_priority(
* @param schedulger The corresponding scheduler.
* @param new_priority The new priority for the MrsP control
*/
-RTEMS_INLINE_ROUTINE void _MRSP_Set_priority(
+static inline void _MRSP_Set_priority(
MRSP_Control *mrsp,
const Scheduler_Control *scheduler,
Priority_Control new_priority
@@ -165,7 +165,7 @@ RTEMS_INLINE_ROUTINE void _MRSP_Set_priority(
* @retval STATUS_MUTEX_CEILING_VIOLATED The wait priority of the thread
* exceeds the ceiling priority.
*/
-RTEMS_INLINE_ROUTINE Status_Control _MRSP_Raise_priority(
+static inline Status_Control _MRSP_Raise_priority(
MRSP_Control *mrsp,
Thread_Control *thread,
Priority_Node *priority_node,
@@ -207,7 +207,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Raise_priority(
* @param priority_node The priority node to remove from the thread
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _MRSP_Remove_priority(
+static inline void _MRSP_Remove_priority(
Thread_Control *thread,
Priority_Node *priority_node,
Thread_queue_Context *queue_context
@@ -229,7 +229,7 @@ RTEMS_INLINE_ROUTINE void _MRSP_Remove_priority(
* @param[out] thread The thread to replace the priorities.
* @param ceiling_priority The node to be replaced.
*/
-RTEMS_INLINE_ROUTINE void _MRSP_Replace_priority(
+static inline void _MRSP_Replace_priority(
MRSP_Control *mrsp,
Thread_Control *thread,
Priority_Node *ceiling_priority
@@ -257,7 +257,7 @@ RTEMS_INLINE_ROUTINE void _MRSP_Replace_priority(
* @retval STATUS_MUTEX_CEILING_VIOLATED The wait priority of the executing
* thread exceeds the ceiling priority.
*/
-RTEMS_INLINE_ROUTINE Status_Control _MRSP_Claim_ownership(
+static inline Status_Control _MRSP_Claim_ownership(
MRSP_Control *mrsp,
Thread_Control *executing,
Thread_queue_Context *queue_context
@@ -300,7 +300,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Claim_ownership(
* @retval STATUS_INVALID_NUMBER The MrsP control is initially locked.
* @retval STATUS_NO_MEMORY There is not enough memory to allocate.
*/
-RTEMS_INLINE_ROUTINE Status_Control _MRSP_Initialize(
+static inline Status_Control _MRSP_Initialize(
MRSP_Control *mrsp,
const Scheduler_Control *scheduler,
Priority_Control ceiling_priority,
@@ -361,7 +361,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Initialize(
* @retval STATUS_DEADLOCK A deadlock occurred.
* @retval STATUS_TIMEOUT A timeout occurred.
*/
-RTEMS_INLINE_ROUTINE Status_Control _MRSP_Wait_for_ownership(
+static inline Status_Control _MRSP_Wait_for_ownership(
MRSP_Control *mrsp,
Thread_Control *executing,
Thread_queue_Context *queue_context
@@ -439,7 +439,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Wait_for_ownership(
* @retval STATUS_MUTEX_CEILING_VIOLATED The current priority of the executing
* thread exceeds the ceiling priority of the mutex.
*/
-RTEMS_INLINE_ROUTINE Status_Control _MRSP_Seize(
+static inline Status_Control _MRSP_Seize(
MRSP_Control *mrsp,
Thread_Control *executing,
bool wait,
@@ -478,7 +478,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Seize(
* @retval STATUS_SUCCESSFUL The operation succeeded.
* @retval STATUS_NOT_OWNER The executing thread does not own the MrsP control.
*/
-RTEMS_INLINE_ROUTINE Status_Control _MRSP_Surrender(
+static inline Status_Control _MRSP_Surrender(
MRSP_Control *mrsp,
Thread_Control *executing,
Thread_queue_Context *queue_context
@@ -530,7 +530,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Surrender(
* @retval STATUS_RESOURCE_IN_USE The MrsP control is in use,
* it cannot be destroyed.
*/
-RTEMS_INLINE_ROUTINE Status_Control _MRSP_Can_destroy( MRSP_Control *mrsp )
+static inline Status_Control _MRSP_Can_destroy( MRSP_Control *mrsp )
{
if ( _MRSP_Get_owner( mrsp ) != NULL ) {
return STATUS_RESOURCE_IN_USE;
@@ -545,7 +545,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Can_destroy( MRSP_Control *mrsp )
* @param[in, out] The mrsp that is about to be destroyed.
* @param queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _MRSP_Destroy(
+static inline void _MRSP_Destroy(
MRSP_Control *mrsp,
Thread_queue_Context *queue_context
)
diff --git a/cpukit/include/rtems/score/object.h b/cpukit/include/rtems/score/object.h
index 867e1766ab..cdb554b39c 100644
--- a/cpukit/include/rtems/score/object.h
+++ b/cpukit/include/rtems/score/object.h
@@ -273,7 +273,7 @@ typedef enum {
*
* @return An object Id constructed from the arguments.
*/
-RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(
+static inline Objects_APIs _Objects_Get_API(
Objects_Id id
)
{
@@ -287,7 +287,7 @@ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(
*
* @return The class portion of the ID.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
+static inline uint32_t _Objects_Get_class(
Objects_Id id
)
{
@@ -302,7 +302,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
*
* @return Returns the node portion of an object ID.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_node(
+static inline uint32_t _Objects_Get_node(
Objects_Id id
)
{
@@ -316,7 +316,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_node(
*
* @return Returns the index portion of the specified object ID.
*/
-RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Get_index(
+static inline Objects_Maximum _Objects_Get_index(
Objects_Id id
)
{
diff --git a/cpukit/include/rtems/score/objectdata.h b/cpukit/include/rtems/score/objectdata.h
index d624f182f9..4bdd30f2c6 100644
--- a/cpukit/include/rtems/score/objectdata.h
+++ b/cpukit/include/rtems/score/objectdata.h
@@ -449,7 +449,9 @@ Objects_Information name##_Information = { \
#define OBJECTS_INFORMATION_DEFINE( name, api, cls, type, max, nl, ex ) \
static Objects_Control * \
name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \
-static type name##_Objects[ _Objects_Maximum_per_allocation( max ) ]; \
+static RTEMS_SECTION( ".noinit.rtems.content.objects." #name ) \
+type \
+name##_Objects[ _Objects_Maximum_per_allocation( max ) ]; \
Objects_Information name##_Information = { \
_Objects_Build_id( api, cls, 1, _Objects_Maximum_per_allocation( max ) ), \
name##_Local_table, \
diff --git a/cpukit/include/rtems/score/objectimpl.h b/cpukit/include/rtems/score/objectimpl.h
index 72a5f6b126..c58957ccb5 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -396,7 +396,7 @@ Objects_Information *_Objects_Get_information_id(
* @retval true The object has a string name.
* @retval false The object does not have a string name.
*/
-RTEMS_INLINE_ROUTINE bool _Objects_Has_string_name(
+static inline bool _Objects_Has_string_name(
const Objects_Information *information
)
{
@@ -471,7 +471,7 @@ Status_Control _Objects_Set_name(
* @param information The corresponding object information table.
* @param[out] the_object The object to operate upon.
*/
-RTEMS_INLINE_ROUTINE void _Objects_Namespace_remove_u32(
+static inline void _Objects_Namespace_remove_u32(
const Objects_Information *information,
Objects_Control *the_object
)
@@ -523,7 +523,7 @@ Objects_Maximum _Objects_Active_count(
*
* @return The number of objects per block of @a information.
*/
-RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Extend_size(
+static inline Objects_Maximum _Objects_Extend_size(
const Objects_Information *information
)
{
@@ -538,7 +538,7 @@ RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Extend_size(
* @retval true The specified api value is valid.
* @retval false The specified api value is not valid.
*/
-RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid(
+static inline bool _Objects_Is_api_valid(
uint32_t the_api
)
{
@@ -556,7 +556,7 @@ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid(
* @retval true The specified node is the local node.
* @retval false The specified node is not the local node.
*/
-RTEMS_INLINE_ROUTINE bool _Objects_Is_local_node(
+static inline bool _Objects_Is_local_node(
uint32_t node
)
{
@@ -573,7 +573,7 @@ RTEMS_INLINE_ROUTINE bool _Objects_Is_local_node(
*
* @note On a single processor configuration, this always returns true.
*/
-RTEMS_INLINE_ROUTINE bool _Objects_Is_local_id(
+static inline bool _Objects_Is_local_id(
#if defined(RTEMS_MULTIPROCESSING)
Objects_Id id
#else
@@ -597,7 +597,7 @@ RTEMS_INLINE_ROUTINE bool _Objects_Is_local_id(
* @retval true The specified object IDs are equal.
* @retval false The specified object IDs are not equal.
*/
-RTEMS_INLINE_ROUTINE bool _Objects_Are_ids_equal(
+static inline bool _Objects_Are_ids_equal(
Objects_Id left,
Objects_Id right
)
@@ -614,7 +614,7 @@ RTEMS_INLINE_ROUTINE bool _Objects_Are_ids_equal(
*
* @return The corresponding ID with the minimum index.
*/
-RTEMS_INLINE_ROUTINE Objects_Id _Objects_Get_minimum_id( Objects_Id id )
+static inline Objects_Id _Objects_Get_minimum_id( Objects_Id id )
{
id &= ~OBJECTS_INDEX_MASK;
id += (Objects_Id) OBJECTS_INDEX_MINIMUM << OBJECTS_INDEX_START_BIT;
@@ -628,7 +628,7 @@ RTEMS_INLINE_ROUTINE Objects_Id _Objects_Get_minimum_id( Objects_Id id )
*
* @return The maximum index of the specified object class.
*/
-RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Get_maximum_index(
+static inline Objects_Maximum _Objects_Get_maximum_index(
const Objects_Information *information
)
{
@@ -641,7 +641,7 @@ RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Get_maximum_index(
* @retval NULL No inactive object is available.
* @retval object An inactive object.
*/
-RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Get_inactive(
+static inline Objects_Control *_Objects_Get_inactive(
Objects_Information *information
)
{
@@ -657,7 +657,7 @@ RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Get_inactive(
* @retval true The automatic object extension (unlimited objects) is enabled.
* @retval false The automatic object extension (unlimited objects) is not enabled.
*/
-RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Is_auto_extend(
+static inline Objects_Maximum _Objects_Is_auto_extend(
const Objects_Information *information
)
{
@@ -678,7 +678,7 @@ RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Is_auto_extend(
* or delete/destroy operations.
*/
-RTEMS_INLINE_ROUTINE void _Objects_Set_local_object(
+static inline void _Objects_Set_local_object(
const Objects_Information *information,
uint32_t index,
Objects_Control *the_object
@@ -711,7 +711,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Set_local_object(
* or delete/destroy operations.
*/
-RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
+static inline void _Objects_Invalidate_Id(
const Objects_Information *information,
Objects_Control *the_object
)
@@ -738,7 +738,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
*
* @return Returns the identifier of the object which is now valid.
*/
-RTEMS_INLINE_ROUTINE Objects_Id _Objects_Open_u32(
+static inline Objects_Id _Objects_Open_u32(
const Objects_Information *information,
Objects_Control *the_object,
uint32_t name
@@ -769,7 +769,7 @@ RTEMS_INLINE_ROUTINE Objects_Id _Objects_Open_u32(
*
* @param name is the name of the object to open.
*/
-RTEMS_INLINE_ROUTINE void _Objects_Open_string(
+static inline void _Objects_Open_string(
const Objects_Information *information,
Objects_Control *the_object,
const char *name
@@ -802,7 +802,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_string(
*
* @see _Objects_Allocator_unlock() and _Objects_Allocate().
*/
-RTEMS_INLINE_ROUTINE void _Objects_Allocator_lock( void )
+static inline void _Objects_Allocator_lock( void )
{
_RTEMS_Lock_allocator();
}
@@ -814,7 +814,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Allocator_lock( void )
* previous thread life protection state and thus may not return if the
* executing thread was restarted or deleted in the mean-time.
*/
-RTEMS_INLINE_ROUTINE void _Objects_Allocator_unlock( void )
+static inline void _Objects_Allocator_unlock( void )
{
_RTEMS_Unlock_allocator();
}
@@ -825,7 +825,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Allocator_unlock( void )
* @retval true The allocator is the owner of the object allocator mutex.
* @retval false The allocato is not the owner of the object allocator mutex.
*/
-RTEMS_INLINE_ROUTINE bool _Objects_Allocator_is_owner( void )
+static inline bool _Objects_Allocator_is_owner( void )
{
return _RTEMS_Allocator_is_owner();
}
@@ -845,7 +845,7 @@ RTEMS_INLINE_ROUTINE bool _Objects_Allocator_is_owner( void )
*
* @see _Objects_Allocate() and _Objects_Free().
*/
-RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Allocate_unprotected(
+static inline Objects_Control *_Objects_Allocate_unprotected(
Objects_Information *information
)
{
@@ -901,7 +901,7 @@ RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Allocate_unprotected(
* }
* @endcode
*/
-RTEMS_INLINE_ROUTINE void _Objects_Free(
+static inline void _Objects_Free(
Objects_Information *information,
Objects_Control *the_object
)
@@ -912,6 +912,25 @@ RTEMS_INLINE_ROUTINE void _Objects_Free(
}
/**
+ * @brief Returns true, if the object associated with the zero-based index is
+ * contained in an allocated block of objects, otherwise false.
+ *
+ * @param index is the zero-based object index.
+ * @param objects_per_block is the object count per block.
+ *
+ * @retval true The object associated with the zero-based index is in an
+ * allocated block of objects.
+ * @retval false Otherwise.
+ */
+static inline bool _Objects_Is_in_allocated_block(
+ Objects_Maximum index,
+ Objects_Maximum objects_per_block
+)
+{
+ return index >= objects_per_block;
+}
+
+/**
* @brief Activate the object.
*
* This function must be only used in case this objects information supports
@@ -920,21 +939,23 @@ RTEMS_INLINE_ROUTINE void _Objects_Free(
* @param information The object information block.
* @param the_object The object to activate.
*/
-RTEMS_INLINE_ROUTINE void _Objects_Activate_unlimited(
+static inline void _Objects_Activate_unlimited(
Objects_Information *information,
Objects_Control *the_object
)
{
Objects_Maximum objects_per_block;
- Objects_Maximum block;
+ Objects_Maximum index;
_Assert( _Objects_Is_auto_extend( information ) );
objects_per_block = information->objects_per_block;
- block = _Objects_Get_index( the_object->id ) - OBJECTS_INDEX_MINIMUM;
+ index = _Objects_Get_index( the_object->id ) - OBJECTS_INDEX_MINIMUM;
+
+ if ( _Objects_Is_in_allocated_block( index, objects_per_block ) ) {
+ Objects_Maximum block;
- if ( block > objects_per_block ) {
- block /= objects_per_block;
+ block = index / objects_per_block;
information->inactive_per_block[ block ]--;
information->inactive--;
@@ -950,7 +971,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Activate_unlimited(
* @param information The object information block.
* @param extend The object information extend handler.
*/
-RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Allocate_with_extend(
+static inline Objects_Control *_Objects_Allocate_with_extend(
Objects_Information *information,
void ( *extend )( Objects_Information * )
)
diff --git a/cpukit/include/rtems/score/percpu.h b/cpukit/include/rtems/score/percpu.h
index 24086cde86..f740ed2a00 100644
--- a/cpukit/include/rtems/score/percpu.h
+++ b/cpukit/include/rtems/score/percpu.h
@@ -262,6 +262,13 @@ typedef struct Per_CPU_Job {
/**
* @brief Per-CPU statistics.
*/
+
+/*
+ * This was added to address the following warning:
+ * warning: struct has no members
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
typedef struct {
#if defined( RTEMS_PROFILING )
/**
@@ -330,6 +337,7 @@ typedef struct {
uint64_t total_interrupt_time;
#endif /* defined( RTEMS_PROFILING ) */
} Per_CPU_Stats;
+#pragma GCC diagnostic pop
/**
* @brief Per-CPU watchdog header index.
@@ -747,7 +755,7 @@ static inline bool _Per_CPU_Is_boot_processor(
#endif
}
-RTEMS_INLINE_ROUTINE void _Per_CPU_Acquire_all(
+static inline void _Per_CPU_Acquire_all(
ISR_lock_Context *lock_context
)
{
@@ -774,7 +782,7 @@ RTEMS_INLINE_ROUTINE void _Per_CPU_Acquire_all(
#endif
}
-RTEMS_INLINE_ROUTINE void _Per_CPU_Release_all(
+static inline void _Per_CPU_Release_all(
ISR_lock_Context *lock_context
)
{
@@ -951,7 +959,7 @@ void _Per_CPU_Wait_for_job(
*
* @return The thread control block of the executing thread.
*/
-RTEMS_INLINE_ROUTINE struct _Thread_Control *_Thread_Get_executing( void )
+static inline struct _Thread_Control *_Thread_Get_executing( void )
{
struct _Thread_Control *executing;
diff --git a/cpukit/include/rtems/score/priority.h b/cpukit/include/rtems/score/priority.h
index 568e3c4e3e..aa29fef8c0 100644
--- a/cpukit/include/rtems/score/priority.h
+++ b/cpukit/include/rtems/score/priority.h
@@ -45,12 +45,12 @@
#include <rtems/score/cpu.h>
#include <rtems/score/rbtree.h>
-struct _Scheduler_Control;
-
#ifdef __cplusplus
extern "C" {
#endif
+struct _Scheduler_Control;
+
/**
* @defgroup RTEMSScorePriority Priority Handler
*
@@ -96,13 +96,6 @@ typedef uint64_t Priority_Control;
#define PRIORITY_MINIMUM 0
/**
- * @brief The priority value of pseudo-ISR threads.
- *
- * Examples are the MPCI and timer server threads.
- */
-#define PRIORITY_PSEUDO_ISR PRIORITY_MINIMUM
-
-/**
* @brief The default lowest (least important) thread priority value.
*
* This value is CPU port dependent.
diff --git a/cpukit/include/rtems/score/prioritybitmapimpl.h b/cpukit/include/rtems/score/prioritybitmapimpl.h
index 7c98126f8d..eda19357c4 100644
--- a/cpukit/include/rtems/score/prioritybitmapimpl.h
+++ b/cpukit/include/rtems/score/prioritybitmapimpl.h
@@ -72,7 +72,7 @@ extern const unsigned char _Bitfield_Leading_zeros[256];
*
* @see _Priority_Bits_index() and _Priority_Mask().
*/
-RTEMS_INLINE_ROUTINE unsigned int _Bitfield_Find_first_bit(
+static inline unsigned int _Bitfield_Find_first_bit(
unsigned int value
)
{
@@ -102,7 +102,7 @@ RTEMS_INLINE_ROUTINE unsigned int _Bitfield_Find_first_bit(
*
* @return The priority bit mask.
*/
-RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Mask(
+static inline Priority_bit_map_Word _Priority_Mask(
unsigned int bit_number
)
{
@@ -121,7 +121,7 @@ RTEMS_INLINE_ROUTINE Priority_bit_map_Word _Priority_Mask(
*
* @return The corresponding array index into the priority bit map.
*/
-RTEMS_INLINE_ROUTINE unsigned int _Priority_Bits_index(
+static inline unsigned int _Priority_Bits_index(
unsigned int bit_number
)
{
@@ -139,7 +139,7 @@ RTEMS_INLINE_ROUTINE unsigned int _Priority_Bits_index(
*
* @return The major portion of the priority.
*/
-RTEMS_INLINE_ROUTINE unsigned int _Priority_Major( unsigned int the_priority )
+static inline unsigned int _Priority_Major( unsigned int the_priority )
{
return the_priority / 16;
}
@@ -151,7 +151,7 @@ RTEMS_INLINE_ROUTINE unsigned int _Priority_Major( unsigned int the_priority )
*
* @return The minor portion of the priority.
*/
-RTEMS_INLINE_ROUTINE unsigned int _Priority_Minor( unsigned int the_priority )
+static inline unsigned int _Priority_Minor( unsigned int the_priority )
{
return the_priority % 16;
}
@@ -161,7 +161,7 @@ RTEMS_INLINE_ROUTINE unsigned int _Priority_Minor( unsigned int the_priority )
*
* @param[out] bit_map The bit map to initialize.
*/
-RTEMS_INLINE_ROUTINE void _Priority_bit_map_Initialize(
+static inline void _Priority_bit_map_Initialize(
Priority_bit_map_Control *bit_map
)
{
@@ -176,7 +176,7 @@ RTEMS_INLINE_ROUTINE void _Priority_bit_map_Initialize(
* @param[out] bit_map The bit map to be altered by @a bit_map_info.
* @param bit_map_info The information with which to alter @a bit_map.
*/
-RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add (
+static inline void _Priority_bit_map_Add (
Priority_bit_map_Control *bit_map,
Priority_bit_map_Information *bit_map_info
)
@@ -193,7 +193,7 @@ RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add (
* @param[out] bit_map The bit map to be altered by @a bit_map_info.
* @param bit_map_info The information with which to alter @a bit_map.
*/
-RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove (
+static inline void _Priority_bit_map_Remove (
Priority_bit_map_Control *bit_map,
Priority_bit_map_Information *bit_map_info
)
@@ -210,7 +210,7 @@ RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove (
*
* @return The highest portion of the bitmap.
*/
-RTEMS_INLINE_ROUTINE unsigned int _Priority_bit_map_Get_highest(
+static inline unsigned int _Priority_bit_map_Get_highest(
const Priority_bit_map_Control *bit_map
)
{
@@ -232,7 +232,7 @@ RTEMS_INLINE_ROUTINE unsigned int _Priority_bit_map_Get_highest(
* @retval true The Priority queue bit map is empty
* @retval false The Priority queue bit map is not empty.
*/
-RTEMS_INLINE_ROUTINE bool _Priority_bit_map_Is_empty(
+static inline bool _Priority_bit_map_Is_empty(
const Priority_bit_map_Control *bit_map
)
{
@@ -248,7 +248,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_bit_map_Is_empty(
* @param new_priority The new priority for the initialization
* of the bit map information.
*/
-RTEMS_INLINE_ROUTINE void _Priority_bit_map_Initialize_information(
+static inline void _Priority_bit_map_Initialize_information(
Priority_bit_map_Control *bit_map,
Priority_bit_map_Information *bit_map_info,
unsigned int new_priority
diff --git a/cpukit/include/rtems/score/priorityimpl.h b/cpukit/include/rtems/score/priorityimpl.h
index 55cddf53be..ccd4cd7c64 100644
--- a/cpukit/include/rtems/score/priorityimpl.h
+++ b/cpukit/include/rtems/score/priorityimpl.h
@@ -78,7 +78,7 @@ typedef enum {
*
* @param[out] actions The actions to be initialized empty.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Actions_initialize_empty(
+static inline void _Priority_Actions_initialize_empty(
Priority_Actions *actions
)
{
@@ -93,7 +93,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Actions_initialize_empty(
* @param node The action node for the @a actions to be initialized.
* @param type The action type for the @a actions to be initialized.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Actions_initialize_one(
+static inline void _Priority_Actions_initialize_one(
Priority_Actions *actions,
Priority_Aggregation *aggregation,
Priority_Node *node,
@@ -117,7 +117,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Actions_initialize_one(
* @retval true The priority actions @a actions is empty.
* @retval false The priority actions @a actions is empty.
*/
-RTEMS_INLINE_ROUTINE bool _Priority_Actions_is_empty(
+static inline bool _Priority_Actions_is_empty(
const Priority_Actions *actions
)
{
@@ -131,7 +131,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Actions_is_empty(
*
* @return The former actions of @a actions that were moved.
*/
-RTEMS_INLINE_ROUTINE Priority_Aggregation *_Priority_Actions_move(
+static inline Priority_Aggregation *_Priority_Actions_move(
Priority_Actions *actions
)
{
@@ -149,7 +149,7 @@ RTEMS_INLINE_ROUTINE Priority_Aggregation *_Priority_Actions_move(
* @param[in, out] actions The priority actions to add actions to.
* @param[out] aggregation The actions to add to @a actions.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Actions_add(
+static inline void _Priority_Actions_add(
Priority_Actions *actions,
Priority_Aggregation *aggregation
)
@@ -170,7 +170,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Actions_add(
* @param[out] node The priority node to be initialized.
* @param priority The priority to initialize @a node to.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Node_initialize(
+static inline void _Priority_Node_initialize(
Priority_Node *node,
Priority_Control priority
)
@@ -185,7 +185,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Node_initialize(
* @param[out] node The priority node to set the priority of.
* @param priority The new priority for @a node.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Node_set_priority(
+static inline void _Priority_Node_set_priority(
Priority_Node *node,
Priority_Control priority
)
@@ -198,7 +198,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Node_set_priority(
*
* @param[in, out] node The priority node to set inactive.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Node_set_inactive(
+static inline void _Priority_Node_set_inactive(
Priority_Node *node
)
{
@@ -213,7 +213,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Node_set_inactive(
* @retval true The priority node is active.
* @retval false The priority node is inactive.
*/
-RTEMS_INLINE_ROUTINE bool _Priority_Node_is_active(
+static inline bool _Priority_Node_is_active(
const Priority_Node *node
)
{
@@ -225,7 +225,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Node_is_active(
*
* @param[out] aggregation The priority aggregaton to initialize empty.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Initialize_empty(
+static inline void _Priority_Initialize_empty(
Priority_Aggregation *aggregation
)
{
@@ -246,7 +246,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Initialize_empty(
* @param[out] aggregation The priority aggregaton to initialize.
* @param node The priority node to initialize @a aggregation with.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Initialize_one(
+static inline void _Priority_Initialize_one(
Priority_Aggregation *aggregation,
Priority_Node *node
)
@@ -270,7 +270,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Initialize_one(
* @retval true The priority aggregation is empty.
* @retval false The priority aggregation is not empty.
*/
-RTEMS_INLINE_ROUTINE bool _Priority_Is_empty(
+static inline bool _Priority_Is_empty(
const Priority_Aggregation *aggregation
)
{
@@ -284,7 +284,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Is_empty(
*
* @return The priority of @a aggregation.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_priority(
+static inline Priority_Control _Priority_Get_priority(
const Priority_Aggregation *aggregation
)
{
@@ -298,7 +298,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_priority(
*
* @return The scheduler of @a aggregation.
*/
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Priority_Get_scheduler(
+static inline const Scheduler_Control *_Priority_Get_scheduler(
const Priority_Aggregation *aggregation
)
{
@@ -316,7 +316,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_Priority_Get_scheduler(
*
* @return The minimum node of @a aggregation
*/
-RTEMS_INLINE_ROUTINE Priority_Node *_Priority_Get_minimum_node(
+static inline Priority_Node *_Priority_Get_minimum_node(
const Priority_Aggregation *aggregation
)
{
@@ -329,7 +329,7 @@ RTEMS_INLINE_ROUTINE Priority_Node *_Priority_Get_minimum_node(
* @param[out] aggregation The priority aggregation to set the action node of.
* @param node The new priority node for @a aggregation.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Set_action_node(
+static inline void _Priority_Set_action_node(
Priority_Aggregation *aggregation,
Priority_Node *node
)
@@ -343,7 +343,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Set_action_node(
* @param[out] aggregation The priority aggregation to set the action type of.
* @param type The new action type for @a aggregation.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Set_action_type(
+static inline void _Priority_Set_action_type(
Priority_Aggregation *aggregation,
Priority_Action_type type
)
@@ -359,7 +359,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Set_action_type(
* @param node The new action node for @a aggregation.
* @param type The new action type for @a aggregation.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Set_action(
+static inline void _Priority_Set_action(
Priority_Aggregation *aggregation,
Priority_Node *node,
Priority_Action_type type
@@ -378,7 +378,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Set_action(
* @return Returns the next action of the priority aggregation or NULL if there
* is no next action.
*/
-RTEMS_INLINE_ROUTINE Priority_Aggregation *_Priority_Get_next_action(
+static inline Priority_Aggregation *_Priority_Get_next_action(
const Priority_Aggregation *aggregation
)
{
@@ -395,7 +395,7 @@ RTEMS_INLINE_ROUTINE Priority_Aggregation *_Priority_Get_next_action(
* @retval true The priority on the left hand side of the comparison is smaller.
* @retval false The priority on the left hand side of the comparison is greater of equal.
*/
-RTEMS_INLINE_ROUTINE bool _Priority_Less(
+static inline bool _Priority_Less(
const void *left,
const RBTree_Node *right
)
@@ -403,7 +403,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Less(
const Priority_Control *the_left;
const Priority_Node *the_right;
- the_left = left;
+ the_left = (const Priority_Control *) left;
the_right = RTEMS_CONTAINER_OF( right, Priority_Node, Node.RBTree );
return *the_left < the_right->priority;
@@ -422,7 +422,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Less(
* @retval true The inserted node with its priority is the minimum of the RBTree.
* @retval false The inserted node with its priority is not the minimum of the RBTree.
*/
-RTEMS_INLINE_ROUTINE bool _Priority_Plain_insert(
+static inline bool _Priority_Plain_insert(
Priority_Aggregation *aggregation,
Priority_Node *node,
Priority_Control priority
@@ -444,7 +444,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Plain_insert(
* @param[in, out] aggregation The aggregation to extract the node from.
* @param node The node to be extracted.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Plain_extract(
+static inline void _Priority_Plain_extract(
Priority_Aggregation *aggregation,
Priority_Node *node
)
@@ -461,7 +461,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Plain_extract(
* @param[in, out] aggregation The aggregation to change the node in.
* @param node The node that has a new priority and will be reinserted in the aggregation.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Plain_changed(
+static inline void _Priority_Plain_changed(
Priority_Aggregation *aggregation,
Priority_Node *node
)
@@ -499,7 +499,7 @@ typedef void ( *Priority_Remove_handler )(
* @param actions Is ignored by the method.
* @param arg Is ignored by the method.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Change_nothing(
+static inline void _Priority_Change_nothing(
Priority_Aggregation *aggregation,
Priority_Group_order group_order,
Priority_Actions *actions,
@@ -521,7 +521,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Change_nothing(
* @param actions Is ignored by the method.
* @param arg Is ignored by the method.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Remove_nothing(
+static inline void _Priority_Remove_nothing(
Priority_Aggregation *aggregation,
Priority_Actions *actions,
void *arg
@@ -545,7 +545,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Remove_nothing(
* @param arg Arguments for @a change that is used if the node is the new
* minimum.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Non_empty_insert(
+static inline void _Priority_Non_empty_insert(
Priority_Aggregation *aggregation,
Priority_Node *node,
Priority_Actions *actions,
@@ -576,7 +576,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Non_empty_insert(
* insert and @a node is the new minimum of the aggregation.
* @param arg The arguments for @a change.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Insert(
+static inline void _Priority_Insert(
Priority_Aggregation *aggregation,
Priority_Node *node,
Priority_Actions *actions,
@@ -610,7 +610,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Insert(
* @param change Is called in the case that the minimal node was extracted.
* @param arg The arguments for @a remove and @a change.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Extract(
+static inline void _Priority_Extract(
Priority_Aggregation *aggregation,
Priority_Node *node,
Priority_Actions *actions,
@@ -650,7 +650,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Extract(
* @param change Is called in the case that the minimal node was extracted.
* @param arg The arguments for @a change.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Extract_non_empty(
+static inline void _Priority_Extract_non_empty(
Priority_Aggregation *aggregation,
Priority_Node *node,
Priority_Actions *actions,
@@ -685,7 +685,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Extract_non_empty(
* @param change Is called if the minimal priority is incorrectly set after the change.
* @param arg The arguments for @a change.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Changed(
+static inline void _Priority_Changed(
Priority_Aggregation *aggregation,
Priority_Node *node,
Priority_Group_order group_order,
@@ -721,7 +721,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Changed(
* @param[out] replacement The node that replaces @a victim. It obtains its priority
* from @a victim.
*/
-RTEMS_INLINE_ROUTINE void _Priority_Replace(
+static inline void _Priority_Replace(
Priority_Aggregation *aggregation,
Priority_Node *victim,
Priority_Node *replacement
diff --git a/cpukit/include/rtems/score/processormask.h b/cpukit/include/rtems/score/processormask.h
index 40fb52a70f..bcdc1c471e 100644
--- a/cpukit/include/rtems/score/processormask.h
+++ b/cpukit/include/rtems/score/processormask.h
@@ -128,7 +128,7 @@ typedef __BITSET_DEFINE( Processor_mask, CPU_MAXIMUM_PROCESSORS ) Processor_mask
*
* @param[out] mask The mask to set to zero.
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_Zero( Processor_mask *mask )
+static inline void _Processor_mask_Zero( Processor_mask *mask )
{
__BIT_ZERO( CPU_MAXIMUM_PROCESSORS, mask );
}
@@ -141,7 +141,7 @@ RTEMS_INLINE_ROUTINE void _Processor_mask_Zero( Processor_mask *mask )
* @retval true The mask is zero.
* @retval false The mask is not zero.
*/
-RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_zero( const Processor_mask *mask )
+static inline bool _Processor_mask_Is_zero( const Processor_mask *mask )
{
return __BIT_EMPTY( CPU_MAXIMUM_PROCESSORS, mask );
}
@@ -151,7 +151,7 @@ RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_zero( const Processor_mask *mask )
*
* @param[out] mask The mask to fill
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_Fill( Processor_mask *mask )
+static inline void _Processor_mask_Fill( Processor_mask *mask )
{
__BIT_FILL( CPU_MAXIMUM_PROCESSORS, mask );
}
@@ -162,7 +162,7 @@ RTEMS_INLINE_ROUTINE void _Processor_mask_Fill( Processor_mask *mask )
* @param[out] dst The mask to copy @a src to.
* @param src The mask to copy to @a dst.
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_Assign(
+static inline void _Processor_mask_Assign(
Processor_mask *dst, const Processor_mask *src
)
{
@@ -175,7 +175,7 @@ RTEMS_INLINE_ROUTINE void _Processor_mask_Assign(
* @param[out] mask The mask to set the bit of.
* @param index The index of the bit that shall be set.
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_Set(
+static inline void _Processor_mask_Set(
Processor_mask *mask,
uint32_t index
)
@@ -189,7 +189,7 @@ RTEMS_INLINE_ROUTINE void _Processor_mask_Set(
* @param[out] mask The mask to clear the bit of.
* @param index The index of the bit that shall be cleared.
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_Clear(
+static inline void _Processor_mask_Clear(
Processor_mask *mask,
uint32_t index
)
@@ -206,7 +206,7 @@ RTEMS_INLINE_ROUTINE void _Processor_mask_Clear(
* @retval true The specified index bit is set.
* @retval false The specified index bit is not set.
*/
-RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_set(
+static inline bool _Processor_mask_Is_set(
const Processor_mask *mask,
uint32_t index
)
@@ -223,7 +223,7 @@ RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_set(
* @retval true The processor sets a and b are equal.
* @retval false The processor sets a and b are not equal.
*/
-RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_equal(
+static inline bool _Processor_mask_Is_equal(
const Processor_mask *a,
const Processor_mask *b
)
@@ -241,7 +241,7 @@ RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_equal(
* @retval true The intersection of the processor sets a and b is non-empty.
* @retval false The intersection of the processor sets a and b is empty.
*/
-RTEMS_INLINE_ROUTINE bool _Processor_mask_Has_overlap(
+static inline bool _Processor_mask_Has_overlap(
const Processor_mask *a,
const Processor_mask *b
)
@@ -259,7 +259,7 @@ RTEMS_INLINE_ROUTINE bool _Processor_mask_Has_overlap(
* @retval true @a small is a subset of @a big.
* @retval false @a small is not a subset of @a big.
*/
-RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_subset(
+static inline bool _Processor_mask_Is_subset(
const Processor_mask *big,
const Processor_mask *small
)
@@ -274,7 +274,7 @@ RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_subset(
* @param b The first parameter of the AND-operation.
* @param c The second parameter of the AND-operation.
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_And(
+static inline void _Processor_mask_And(
Processor_mask *a,
const Processor_mask *b,
const Processor_mask *c
@@ -290,7 +290,7 @@ RTEMS_INLINE_ROUTINE void _Processor_mask_And(
* @param b The first parameter of the OR-operation.
* @param c The second parameter of the OR-operation.
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_Or(
+static inline void _Processor_mask_Or(
Processor_mask *a,
const Processor_mask *b,
const Processor_mask *c
@@ -306,7 +306,7 @@ RTEMS_INLINE_ROUTINE void _Processor_mask_Or(
* @param b The first parameter of the XOR-operation.
* @param c The second parameter of the XOR-operation.
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_Xor(
+static inline void _Processor_mask_Xor(
Processor_mask *a,
const Processor_mask *b,
const Processor_mask *c
@@ -322,7 +322,7 @@ RTEMS_INLINE_ROUTINE void _Processor_mask_Xor(
*
* @return The number of set bits in @a a.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Count( const Processor_mask *a )
+static inline uint32_t _Processor_mask_Count( const Processor_mask *a )
{
return (uint32_t) __BIT_COUNT( CPU_MAXIMUM_PROCESSORS, a );
}
@@ -334,7 +334,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Count( const Processor_mask *a )
*
* @return The last set of @a a.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Find_last_set( const Processor_mask *a )
+static inline uint32_t _Processor_mask_Find_last_set( const Processor_mask *a )
{
return (uint32_t) __BIT_FLS( CPU_MAXIMUM_PROCESSORS, a );
}
@@ -348,7 +348,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_Find_last_set( const Processor_mas
*
* @return The subset containing the specified index as an unsigned 32-bit integer.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_To_uint32_t(
+static inline uint32_t _Processor_mask_To_uint32_t(
const Processor_mask *mask,
uint32_t index
)
@@ -366,7 +366,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Processor_mask_To_uint32_t(
* @param bits The bits for creating the mask.
* @param index The index to which the mask is relative.
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_From_uint32_t(
+static inline void _Processor_mask_From_uint32_t(
Processor_mask *mask,
uint32_t bits,
uint32_t index
@@ -382,7 +382,7 @@ RTEMS_INLINE_ROUTINE void _Processor_mask_From_uint32_t(
* @param[out] The mask that is created.
* @param index The specified index.
*/
-RTEMS_INLINE_ROUTINE void _Processor_mask_From_index(
+static inline void _Processor_mask_From_index(
Processor_mask *mask,
uint32_t index
)
@@ -405,7 +405,7 @@ typedef enum {
* @retval true At most partial loss can be guaranteed.
* @retval false The status indicates more than partial loss.
*/
-RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_at_most_partial_loss(
+static inline bool _Processor_mask_Is_at_most_partial_loss(
Processor_mask_Copy_status status
)
{
@@ -452,7 +452,7 @@ Processor_mask_Copy_status _Processor_mask_Copy(
* @retval PROCESSOR_MASK_COPY_INVALID_SIZE One of the arguments sizes
* is invalid (bigger than the size of a long).
*/
-RTEMS_INLINE_ROUTINE Processor_mask_Copy_status _Processor_mask_To_cpu_set_t(
+static inline Processor_mask_Copy_status _Processor_mask_To_cpu_set_t(
const Processor_mask *src,
size_t dst_size,
cpu_set_t *dst
@@ -482,7 +482,7 @@ RTEMS_INLINE_ROUTINE Processor_mask_Copy_status _Processor_mask_To_cpu_set_t(
* @retval PROCESSOR_MASK_COPY_INVALID_SIZE One of the arguments sizes
* is invalid (bigger than the size of a long).
*/
-RTEMS_INLINE_ROUTINE Processor_mask_Copy_status _Processor_mask_From_cpu_set_t(
+static inline Processor_mask_Copy_status _Processor_mask_From_cpu_set_t(
Processor_mask *dst,
size_t src_size,
const cpu_set_t *src
diff --git a/cpukit/include/rtems/score/profiling.h b/cpukit/include/rtems/score/profiling.h
index 90e470a775..90d441b0d0 100644
--- a/cpukit/include/rtems/score/profiling.h
+++ b/cpukit/include/rtems/score/profiling.h
@@ -129,10 +129,7 @@ static inline void _Profiling_Thread_dispatch_enable(
if ( new_thread_dispatch_disable_level == 0 ) {
Per_CPU_Stats *stats = &cpu->Stats;
CPU_Counter_ticks now = _CPU_Counter_read();
- CPU_Counter_ticks delta = _CPU_Counter_difference(
- now,
- stats->thread_dispatch_disabled_instant
- );
+ CPU_Counter_ticks delta = now - stats->thread_dispatch_disabled_instant;
stats->total_thread_dispatch_disabled_time += delta;
diff --git a/cpukit/include/rtems/score/protectedheap.h b/cpukit/include/rtems/score/protectedheap.h
index d165c4ddec..884d7e1c47 100644
--- a/cpukit/include/rtems/score/protectedheap.h
+++ b/cpukit/include/rtems/score/protectedheap.h
@@ -65,7 +65,7 @@ extern "C" {
* @param area_size The size of the heap area.
* @param page_size The page size for the heap.
*/
-RTEMS_INLINE_ROUTINE uintptr_t _Protected_heap_Initialize(
+static inline uintptr_t _Protected_heap_Initialize(
Heap_Control *heap,
void *area_begin,
uintptr_t area_size,
@@ -131,7 +131,7 @@ void *_Protected_heap_Allocate_aligned_with_boundary(
* @retval pointer The starting address of the allocated memory area.
* @retval NULL No memory is available of the parameters are inconsistent.
*/
-RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate_aligned(
+static inline void *_Protected_heap_Allocate_aligned(
Heap_Control *heap,
uintptr_t size,
uintptr_t alignment
@@ -154,7 +154,7 @@ RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate_aligned(
* @retval pointer The starting address of the allocated memory area.
* @retval NULL No memory is available of the parameters are inconsistent.
*/
-RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate(
+static inline void *_Protected_heap_Allocate(
Heap_Control *heap,
uintptr_t size
)
diff --git a/cpukit/include/rtems/score/rbtree.h b/cpukit/include/rtems/score/rbtree.h
index aa8d1a32a6..253ef296bc 100644
--- a/cpukit/include/rtems/score/rbtree.h
+++ b/cpukit/include/rtems/score/rbtree.h
@@ -103,7 +103,7 @@ typedef RB_HEAD(RBTree_Control, RBTree_Node) RBTree_Control;
*
* @see _RBTree_Is_node_off_tree().
*/
-RTEMS_INLINE_ROUTINE void _RBTree_Set_off_tree( RBTree_Node *the_node )
+static inline void _RBTree_Set_off_tree( RBTree_Node *the_node )
{
RB_COLOR( the_node, Node ) = -1;
}
@@ -118,7 +118,7 @@ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_tree( RBTree_Node *the_node )
*
* @see _RBTree_Set_off_tree().
*/
-RTEMS_INLINE_ROUTINE bool _RBTree_Is_node_off_tree(
+static inline bool _RBTree_Is_node_off_tree(
const RBTree_Node *the_node
)
{
@@ -144,7 +144,7 @@ void _RBTree_Insert_color(
*
* @param[out] the_node The red-black tree node to initialize.
*/
-RTEMS_INLINE_ROUTINE void _RBTree_Initialize_node( RBTree_Node *the_node )
+static inline void _RBTree_Initialize_node( RBTree_Node *the_node )
{
#if defined(RTEMS_DEBUG)
_RBTree_Set_off_tree( the_node );
@@ -160,7 +160,7 @@ RTEMS_INLINE_ROUTINE void _RBTree_Initialize_node( RBTree_Node *the_node )
* @param[out] parent The parent node.
* @param[out] link The child node link of the parent node.
*/
-RTEMS_INLINE_ROUTINE void _RBTree_Add_child(
+static inline void _RBTree_Add_child(
RBTree_Node *child,
RBTree_Node *parent,
RBTree_Node **link
@@ -221,7 +221,7 @@ RTEMS_INLINE_ROUTINE void _RBTree_Add_child(
* }
* @endcode
*/
-RTEMS_INLINE_ROUTINE void _RBTree_Insert_with_parent(
+static inline void _RBTree_Insert_with_parent(
RBTree_Control *the_rbtree,
RBTree_Node *the_node,
RBTree_Node *parent,
@@ -261,7 +261,7 @@ void _RBTree_Extract(
*
* @see _RBTree_Is_root().
*/
-RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Root(
+static inline RBTree_Node *_RBTree_Root(
const RBTree_Control *the_rbtree
)
{
@@ -276,7 +276,7 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Root(
* @retval pointer Pointer to the root node.
* @retval NULL The tree is empty.
*/
-RTEMS_INLINE_ROUTINE RBTree_Node **_RBTree_Root_reference(
+static inline RBTree_Node **_RBTree_Root_reference(
RBTree_Control *the_rbtree
)
{
@@ -291,7 +291,7 @@ RTEMS_INLINE_ROUTINE RBTree_Node **_RBTree_Root_reference(
* @retval pointer Pointer to the root node.
* @retval NULL The tree is empty.
*/
-RTEMS_INLINE_ROUTINE RBTree_Node * const *_RBTree_Root_const_reference(
+static inline RBTree_Node * const *_RBTree_Root_const_reference(
const RBTree_Control *the_rbtree
)
{
@@ -310,7 +310,7 @@ RTEMS_INLINE_ROUTINE RBTree_Node * const *_RBTree_Root_const_reference(
* @retval parent The parent of this node.
* @retval undefined The node is the root node or not part of a tree.
*/
-RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
+static inline RBTree_Node *_RBTree_Parent(
const RBTree_Node *the_node
)
{
@@ -326,7 +326,7 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
*
* @return This method returns the left node on the rbtree.
*/
-RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Left(
+static inline RBTree_Node *_RBTree_Left(
const RBTree_Node *the_node
)
{
@@ -341,7 +341,7 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Left(
*
* @return This method returns a reference to the left child pointer on the rbtree.
*/
-RTEMS_INLINE_ROUTINE RBTree_Node **_RBTree_Left_reference(
+static inline RBTree_Node **_RBTree_Left_reference(
RBTree_Node *the_node
)
{
@@ -357,7 +357,7 @@ RTEMS_INLINE_ROUTINE RBTree_Node **_RBTree_Left_reference(
*
* @return This method returns the right node on the rbtree.
*/
-RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Right(
+static inline RBTree_Node *_RBTree_Right(
const RBTree_Node *the_node
)
{
@@ -372,7 +372,7 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Right(
*
* @return This method returns a reference to the right child pointer on the rbtree.
*/
-RTEMS_INLINE_ROUTINE RBTree_Node **_RBTree_Right_reference(
+static inline RBTree_Node **_RBTree_Right_reference(
RBTree_Node *the_node
)
{
@@ -390,7 +390,7 @@ RTEMS_INLINE_ROUTINE RBTree_Node **_RBTree_Right_reference(
* @retval true There are no nodes on @a the_rbtree.
* @retval false There are nodes on @a the_rbtree.
*/
-RTEMS_INLINE_ROUTINE bool _RBTree_Is_empty(
+static inline bool _RBTree_Is_empty(
const RBTree_Control *the_rbtree
)
{
@@ -411,7 +411,7 @@ RTEMS_INLINE_ROUTINE bool _RBTree_Is_empty(
*
* @see _RBTree_Root().
*/
-RTEMS_INLINE_ROUTINE bool _RBTree_Is_root(
+static inline bool _RBTree_Is_root(
const RBTree_Node *the_node
)
{
@@ -425,7 +425,7 @@ RTEMS_INLINE_ROUTINE bool _RBTree_Is_root(
*
* @param[out] the_rbtree The rbtree to initialize.
*/
-RTEMS_INLINE_ROUTINE void _RBTree_Initialize_empty(
+static inline void _RBTree_Initialize_empty(
RBTree_Control *the_rbtree
)
{
@@ -439,7 +439,7 @@ RTEMS_INLINE_ROUTINE void _RBTree_Initialize_empty(
* @param[out] the_rbtree The red-black tree control.
* @param[out] the_node The one and only node.
*/
-RTEMS_INLINE_ROUTINE void _RBTree_Initialize_one(
+static inline void _RBTree_Initialize_one(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
@@ -523,7 +523,7 @@ void _RBTree_Replace_node(
* @retval false The inserted node is not the new minimum node according to the
* specified less order function.
*/
-RTEMS_INLINE_ROUTINE bool _RBTree_Insert_inline(
+static inline bool _RBTree_Insert_inline(
RBTree_Control *the_rbtree,
RBTree_Node *the_node,
const void *key,
@@ -572,7 +572,7 @@ RTEMS_INLINE_ROUTINE bool _RBTree_Insert_inline(
* @retval object An object with the specified key.
* @retval NULL No object with the specified key exists in the red-black tree.
*/
-RTEMS_INLINE_ROUTINE void *_RBTree_Find_inline(
+static inline void *_RBTree_Find_inline(
const RBTree_Control *the_rbtree,
const void *key,
bool ( *equal )( const void *, const RBTree_Node * ),
diff --git a/cpukit/include/rtems/score/schedulercbsimpl.h b/cpukit/include/rtems/score/schedulercbsimpl.h
index c51400b135..83d4eac9d8 100644
--- a/cpukit/include/rtems/score/schedulercbsimpl.h
+++ b/cpukit/include/rtems/score/schedulercbsimpl.h
@@ -57,7 +57,7 @@ extern "C" {
*
* @return Pointer to the scheduler node of @a the_thread.
*/
-RTEMS_INLINE_ROUTINE Scheduler_CBS_Node *_Scheduler_CBS_Thread_get_node(
+static inline Scheduler_CBS_Node *_Scheduler_CBS_Thread_get_node(
Thread_Control *the_thread
)
{
@@ -71,7 +71,7 @@ RTEMS_INLINE_ROUTINE Scheduler_CBS_Node *_Scheduler_CBS_Thread_get_node(
*
* @return CBS Node pointer to @a node.
*/
-RTEMS_INLINE_ROUTINE Scheduler_CBS_Node *_Scheduler_CBS_Node_downcast(
+static inline Scheduler_CBS_Node *_Scheduler_CBS_Node_downcast(
Scheduler_Node *node
)
{
diff --git a/cpukit/include/rtems/score/scheduleredfimpl.h b/cpukit/include/rtems/score/scheduleredfimpl.h
index e0a07a8915..8aa0388537 100644
--- a/cpukit/include/rtems/score/scheduleredfimpl.h
+++ b/cpukit/include/rtems/score/scheduleredfimpl.h
@@ -39,7 +39,7 @@
#define _RTEMS_SCORE_SCHEDULEREDFIMPL_H
#include <rtems/score/scheduleredf.h>
-#include <rtems/score/schedulerimpl.h>
+#include <rtems/score/scheduleruniimpl.h>
#ifdef __cplusplus
extern "C" {
@@ -67,7 +67,7 @@ extern "C" {
*
* @return The scheduler context of @a scheduler.
*/
-RTEMS_INLINE_ROUTINE Scheduler_EDF_Context *
+static inline Scheduler_EDF_Context *
_Scheduler_EDF_Get_context( const Scheduler_Control *scheduler )
{
return (Scheduler_EDF_Context *) _Scheduler_Get_context( scheduler );
@@ -80,7 +80,7 @@ RTEMS_INLINE_ROUTINE Scheduler_EDF_Context *
*
* @return The EDF scheduler node of @a the_thread.
*/
-RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Thread_get_node(
+static inline Scheduler_EDF_Node *_Scheduler_EDF_Thread_get_node(
Thread_Control *the_thread
)
{
@@ -94,7 +94,7 @@ RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Thread_get_node(
*
* @return The corresponding scheduler EDF node.
*/
-RTEMS_INLINE_ROUTINE Scheduler_EDF_Node * _Scheduler_EDF_Node_downcast(
+static inline Scheduler_EDF_Node * _Scheduler_EDF_Node_downcast(
Scheduler_Node *node
)
{
@@ -110,7 +110,7 @@ RTEMS_INLINE_ROUTINE Scheduler_EDF_Node * _Scheduler_EDF_Node_downcast(
* @retval true @a left is less than the priority of @a right.
* @retval false @a left is greater or equal than the priority of @a right.
*/
-RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Less(
+static inline bool _Scheduler_EDF_Less(
const void *left,
const RBTree_Node *right
)
@@ -120,7 +120,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Less(
Priority_Control prio_left;
Priority_Control prio_right;
- the_left = left;
+ the_left = (const Priority_Control *) left;
the_right = RTEMS_CONTAINER_OF( right, Scheduler_EDF_Node, Node );
prio_left = *the_left;
@@ -138,7 +138,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Less(
* @retval true @a left is less or equal than the priority of @a right.
* @retval false @a left is greater than the priority of @a right.
*/
-RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Priority_less_equal(
+static inline bool _Scheduler_EDF_Priority_less_equal(
const void *left,
const RBTree_Node *right
)
@@ -148,7 +148,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Priority_less_equal(
Priority_Control prio_left;
Priority_Control prio_right;
- the_left = left;
+ the_left = (const Priority_Control *) left;
the_right = RTEMS_CONTAINER_OF( right, Scheduler_EDF_Node, Node );
prio_left = *the_left;
@@ -165,7 +165,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Priority_less_equal(
* @param node The node to be inserted.
* @param insert_priority The priority with which the node will be inserted.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Enqueue(
+static inline void _Scheduler_EDF_Enqueue(
Scheduler_EDF_Context *context,
Scheduler_EDF_Node *node,
Priority_Control insert_priority
@@ -185,7 +185,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Enqueue(
* @param[in, out] context The context to extract the node from.
* @param[in, out] node The node to extract.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract(
+static inline void _Scheduler_EDF_Extract(
Scheduler_EDF_Context *context,
Scheduler_EDF_Node *node
)
@@ -200,7 +200,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract(
* @param the_thread The thread is not used in this method.
* @param[in, out] node The node to be extracted.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract_body(
+static inline void _Scheduler_EDF_Extract_body(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -216,30 +216,23 @@ RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract_body(
}
/**
- * @brief Schedules the next ready thread as the heir.
+ * @brief Gets the highest priority ready thread of the scheduler.
*
- * @param scheduler The scheduler instance to schedule the minimum of the context of.
- * @param the_thread This parameter is not used.
- * @param force_dispatch Indicates whether the current heir is blocked even if it is
- * not set as preemptible.
+ * @param scheduler is the scheduler.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Schedule_body(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- bool force_dispatch
+static inline Thread_Control *_Scheduler_EDF_Get_highest_ready(
+ const Scheduler_Control *scheduler
)
{
Scheduler_EDF_Context *context;
RBTree_Node *first;
Scheduler_EDF_Node *node;
- (void) the_thread;
-
context = _Scheduler_EDF_Get_context( scheduler );
first = _RBTree_Minimum( &context->Ready );
node = RTEMS_CONTAINER_OF( first, Scheduler_EDF_Node, Node );
- _Scheduler_Update_heir( node->Base.owner, force_dispatch );
+ return node->Base.owner;
}
/** @} */
diff --git a/cpukit/include/rtems/score/schedulerimpl.h b/cpukit/include/rtems/score/schedulerimpl.h
index 806cb4e145..2056408e6a 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -101,7 +101,7 @@ void _Scheduler_Handler_initialization( void );
*
* @return The context of @a scheduler.
*/
-RTEMS_INLINE_ROUTINE Scheduler_Context *_Scheduler_Get_context(
+static inline Scheduler_Context *_Scheduler_Get_context(
const Scheduler_Control *scheduler
)
{
@@ -115,7 +115,7 @@ RTEMS_INLINE_ROUTINE Scheduler_Context *_Scheduler_Get_context(
*
* @return The scheduler for the cpu.
*/
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_by_CPU(
+static inline const Scheduler_Control *_Scheduler_Get_by_CPU(
const Per_CPU_Control *cpu
)
{
@@ -135,7 +135,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_by_CPU(
* @param lock_context The lock context to use for
* _Scheduler_Release_critical().
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Acquire_critical(
+static inline void _Scheduler_Acquire_critical(
const Scheduler_Control *scheduler,
ISR_lock_Context *lock_context
)
@@ -159,7 +159,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Acquire_critical(
* @param lock_context The lock context used for
* _Scheduler_Acquire_critical().
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Release_critical(
+static inline void _Scheduler_Release_critical(
const Scheduler_Control *scheduler,
ISR_lock_Context *lock_context
)
@@ -185,7 +185,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_critical(
* @return True if the non-preempt mode for threads is supported by the
* scheduler, otherwise false.
*/
-RTEMS_INLINE_ROUTINE bool _Scheduler_Is_non_preempt_mode_supported(
+static inline bool _Scheduler_Is_non_preempt_mode_supported(
const Scheduler_Control *scheduler
)
{
@@ -216,7 +216,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Is_non_preempt_mode_supported(
*
* @param the_thread The thread which state changed previously.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( Thread_Control *the_thread )
+static inline void _Scheduler_Schedule( Thread_Control *the_thread )
{
const Scheduler_Control *scheduler;
ISR_lock_Context lock_context;
@@ -237,7 +237,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( Thread_Control *the_thread )
*
* @param the_thread The yielding thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Yield( Thread_Control *the_thread )
+static inline void _Scheduler_Yield( Thread_Control *the_thread )
{
const Scheduler_Control *scheduler;
ISR_lock_Context lock_context;
@@ -262,7 +262,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( Thread_Control *the_thread )
*
* @param the_thread The thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Block( Thread_Control *the_thread )
+static inline void _Scheduler_Block( Thread_Control *the_thread )
{
#if defined(RTEMS_SMP)
Chain_Node *node;
@@ -324,7 +324,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Block( Thread_Control *the_thread )
*
* @see _Scheduler_Node_get_priority().
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Thread_Control *the_thread )
+static inline void _Scheduler_Unblock( Thread_Control *the_thread )
{
Scheduler_Node *scheduler_node;
const Scheduler_Control *scheduler;
@@ -359,7 +359,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Thread_Control *the_thread )
*
* @see _Scheduler_Node_get_priority().
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Update_priority( Thread_Control *the_thread )
+static inline void _Scheduler_Update_priority( Thread_Control *the_thread )
{
#if defined(RTEMS_SMP)
Chain_Node *node;
@@ -413,7 +413,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update_priority( Thread_Control *the_thread
*
* @return The corresponding thread priority of the scheduler domain is returned.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Map_priority(
+static inline Priority_Control _Scheduler_Map_priority(
const Scheduler_Control *scheduler,
Priority_Control priority
)
@@ -429,7 +429,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Map_priority(
*
* @return The corresponding thread priority of the user domain is returned.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Unmap_priority(
+static inline Priority_Control _Scheduler_Unmap_priority(
const Scheduler_Control *scheduler,
Priority_Control priority
)
@@ -450,7 +450,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Unmap_priority(
* @param the_thread The thread of the scheduler node to initialize.
* @param priority The thread priority.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_initialize(
+static inline void _Scheduler_Node_initialize(
const Scheduler_Control *scheduler,
Scheduler_Node *node,
Thread_Control *the_thread,
@@ -474,7 +474,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_initialize(
* @param scheduler The scheduler instance.
* @param[out] node The scheduler node to destroy.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_destroy(
+static inline void _Scheduler_Node_destroy(
const Scheduler_Control *scheduler,
Scheduler_Node *node
)
@@ -491,7 +491,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_destroy(
* @param queue_context The thread queue context to provide the set of
* threads for _Thread_Priority_update().
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Release_job(
+static inline void _Scheduler_Release_job(
Thread_Control *the_thread,
Priority_Node *priority_node,
uint64_t deadline,
@@ -518,7 +518,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_job(
* @param queue_context The thread queue context to provide the set of
* threads for _Thread_Priority_update().
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Cancel_job(
+static inline void _Scheduler_Cancel_job(
Thread_Control *the_thread,
Priority_Node *priority_node,
Thread_queue_Context *queue_context
@@ -544,7 +544,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Cancel_job(
*
* @see _Thread_Create_idle().
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Start_idle(
+static inline void _Scheduler_Start_idle(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Per_CPU_Control *cpu
@@ -563,7 +563,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Start_idle(
* @retval true The scheduler of the cpu is the given @a scheduler.
* @retval false The scheduler of the cpu is not the given @a scheduler.
*/
-RTEMS_INLINE_ROUTINE bool _Scheduler_Has_processor_ownership(
+static inline bool _Scheduler_Has_processor_ownership(
const Scheduler_Control *scheduler,
uint32_t cpu_index
)
@@ -591,7 +591,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Has_processor_ownership(
*
* @return The processors of the context of the given scheduler.
*/
-RTEMS_INLINE_ROUTINE const Processor_mask *_Scheduler_Get_processors(
+static inline const Processor_mask *_Scheduler_Get_processors(
const Scheduler_Control *scheduler
)
{
@@ -632,7 +632,7 @@ Status_Control _Scheduler_Get_affinity(
* @retval STATUS_INVALID_NUMBER The affinity is not a subset of the online
* processors.
*/
-RTEMS_INLINE_ROUTINE Status_Control _Scheduler_default_Set_affinity_body(
+static inline Status_Control _Scheduler_default_Set_affinity_body(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node,
@@ -669,47 +669,13 @@ Status_Control _Scheduler_Set_affinity(
);
/**
- * @brief Blocks the thread.
- *
- * @param scheduler The scheduler instance.
- * @param the_thread The thread to block.
- * @param node The corresponding scheduler node.
- * @param extract Method to extract the thread.
- * @param schedule Method for scheduling threads.
- */
-RTEMS_INLINE_ROUTINE void _Scheduler_Generic_block(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- Scheduler_Node *node,
- void ( *extract )(
- const Scheduler_Control *,
- Thread_Control *,
- Scheduler_Node *
- ),
- void ( *schedule )(
- const Scheduler_Control *,
- Thread_Control *,
- bool
- )
-)
-{
- ( *extract )( scheduler, the_thread, node );
-
- /* TODO: flash critical section? */
-
- if ( _Thread_Is_heir( the_thread ) ) {
- ( *schedule )( scheduler, the_thread, true );
- }
-}
-
-/**
* @brief Gets the number of processors of the scheduler.
*
* @param scheduler The scheduler instance to get the number of processors of.
*
* @return The number of processors.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Scheduler_Get_processor_count(
+static inline uint32_t _Scheduler_Get_processor_count(
const Scheduler_Control *scheduler
)
{
@@ -731,7 +697,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Scheduler_Get_processor_count(
*
* @return The build id.
*/
-RTEMS_INLINE_ROUTINE Objects_Id _Scheduler_Build_id( uint32_t scheduler_index )
+static inline Objects_Id _Scheduler_Build_id( uint32_t scheduler_index )
{
return _Objects_Build_id(
OBJECTS_FAKE_OBJECTS_API,
@@ -748,7 +714,7 @@ RTEMS_INLINE_ROUTINE Objects_Id _Scheduler_Build_id( uint32_t scheduler_index )
*
* @return The scheduler index.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Scheduler_Get_index_by_id( Objects_Id id )
+static inline uint32_t _Scheduler_Get_index_by_id( Objects_Id id )
{
uint32_t minimum_id = _Scheduler_Build_id( 0 );
@@ -762,7 +728,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Scheduler_Get_index_by_id( Objects_Id id )
*
* @return The scheduler to the object id.
*/
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_by_id(
+static inline const Scheduler_Control *_Scheduler_Get_by_id(
Objects_Id id
)
{
@@ -784,7 +750,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_by_id(
*
* @return The index of the given scheduler.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Scheduler_Get_index(
+static inline uint32_t _Scheduler_Get_index(
const Scheduler_Control *scheduler
)
{
@@ -821,7 +787,7 @@ typedef void ( *Scheduler_Release_idle_node )(
* @param[out] the_thread The thread to change the state of.
* @param new_state The new state for @a the_thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Thread_change_state(
+static inline void _Scheduler_Thread_change_state(
Thread_Control *the_thread,
Thread_Scheduler_state new_state
)
@@ -844,7 +810,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Thread_change_state(
*
* @param arg is the handler argument.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Use_idle_thread(
+static inline Thread_Control *_Scheduler_Use_idle_thread(
Scheduler_Node *node,
Scheduler_Get_idle_node get_idle_node,
void *arg
@@ -872,7 +838,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Use_idle_thread(
*
* @param arg is the handler argument.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Release_idle_thread(
+static inline void _Scheduler_Release_idle_thread(
Scheduler_Node *node,
const Thread_Control *idle,
Scheduler_Release_idle_node release_idle_node,
@@ -904,7 +870,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_idle_thread(
*
* @return Returns the idle thread used by the scheduler node.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Release_idle_thread_if_necessary(
+static inline Thread_Control *_Scheduler_Release_idle_thread_if_necessary(
Scheduler_Node *node,
Scheduler_Release_idle_node release_idle_node,
void *arg
@@ -932,7 +898,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Release_idle_thread_if_necessary
*
* @param arg is the handler argument.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Discard_idle_thread(
+static inline void _Scheduler_Discard_idle_thread(
Thread_Control *the_thread,
Scheduler_Node *node,
Scheduler_Release_idle_node release_idle_node,
@@ -952,37 +918,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Discard_idle_thread(
#endif
/**
- * @brief Updates the heir.
- *
- * @param[in, out] new_heir The new heir.
- * @param force_dispatch Indicates whether the dispatch happens also if the
- * currently running thread is set as not preemptible.
- */
-RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
- Thread_Control *new_heir,
- bool force_dispatch
-)
-{
- Thread_Control *heir = _Thread_Heir;
-
- if ( heir != new_heir && ( heir->is_preemptible || force_dispatch ) ) {
-#if defined(RTEMS_SMP)
- /*
- * We need this state only for _Thread_Get_CPU_time_used_locked(). Cannot
- * use _Scheduler_Thread_change_state() since THREAD_SCHEDULER_BLOCKED to
- * THREAD_SCHEDULER_BLOCKED state changes are illegal for the real SMP
- * schedulers.
- */
- heir->Scheduler.state = THREAD_SCHEDULER_BLOCKED;
- new_heir->Scheduler.state = THREAD_SCHEDULER_SCHEDULED;
-#endif
- _Thread_Update_CPU_time_used( heir, _Thread_Get_CPU( heir ) );
- _Thread_Heir = new_heir;
- _Thread_Dispatch_necessary = true;
- }
-}
-
-/**
* @brief Sets a new scheduler.
*
* @param new_scheduler The new scheduler to set.
@@ -993,7 +928,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
* @retval STATUS_RESOURCE_IN_USE The thread's wait queue is not empty.
* @retval STATUS_UNSATISFIED The new scheduler has no processors.
*/
-RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set(
+static inline Status_Control _Scheduler_Set(
const Scheduler_Control *new_scheduler,
Thread_Control *the_thread,
Priority_Control priority
diff --git a/cpukit/include/rtems/score/schedulernodeimpl.h b/cpukit/include/rtems/score/schedulernodeimpl.h
index 5231c6aef2..ef1813d39c 100644
--- a/cpukit/include/rtems/score/schedulernodeimpl.h
+++ b/cpukit/include/rtems/score/schedulernodeimpl.h
@@ -100,7 +100,7 @@ extern "C" {
*
* @param priority is the initial priority of the node.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
+static inline void _Scheduler_Node_do_initialize(
const struct _Scheduler_Control *scheduler,
Scheduler_Node *node,
Thread_Control *the_thread,
@@ -132,7 +132,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
*
* @param[in, out] node is the node to destroy.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_destroy(
+static inline void _Scheduler_Node_do_destroy(
const struct _Scheduler_Control *scheduler,
Scheduler_Node *node
)
@@ -153,7 +153,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_destroy(
*
* @return The scheduler of the node.
*/
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Node_get_scheduler(
+static inline const Scheduler_Control *_Scheduler_Node_get_scheduler(
const Scheduler_Node *node
)
{
@@ -167,7 +167,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Node_get_scheduler(
*
* @return The owner of the node.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(
+static inline Thread_Control *_Scheduler_Node_get_owner(
const Scheduler_Node *node
)
{
@@ -181,7 +181,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(
*
* @return The priority of the node.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
+static inline Priority_Control _Scheduler_Node_get_priority(
Scheduler_Node *node
)
{
@@ -214,7 +214,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
* @param group_order is the priority group order, see #PRIORITY_GROUP_FIRST
* and #PRIORITY_GROUP_LAST.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(
+static inline void _Scheduler_Node_set_priority(
Scheduler_Node *node,
Priority_Control new_priority,
Priority_Group_order group_order
@@ -243,7 +243,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(
*
* @return The user of the node.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_user(
+static inline Thread_Control *_Scheduler_Node_get_user(
const Scheduler_Node *node
)
{
@@ -256,7 +256,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_user(
* @param[out] node The node to set the user of.
* @param user The new user for @a node.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_user(
+static inline void _Scheduler_Node_set_user(
Scheduler_Node *node,
Thread_Control *user
)
@@ -271,7 +271,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_user(
*
* @return The idle thread of @a node.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_idle(
+static inline Thread_Control *_Scheduler_Node_get_idle(
const Scheduler_Node *node
)
{
@@ -285,7 +285,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_idle(
*
* @param idle is the idle thread to use.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_idle_user(
+static inline void _Scheduler_Node_set_idle_user(
Scheduler_Node *node,
Thread_Control *idle
)
diff --git a/cpukit/include/rtems/score/schedulerpriority.h b/cpukit/include/rtems/score/schedulerpriority.h
index cf5d0762a9..1325224fa9 100644
--- a/cpukit/include/rtems/score/schedulerpriority.h
+++ b/cpukit/include/rtems/score/schedulerpriority.h
@@ -94,7 +94,7 @@ typedef struct {
/**
* @brief One ready queue per priority level.
*/
- Chain_Control Ready[ 0 ];
+ Chain_Control Ready[ RTEMS_ZERO_LENGTH_ARRAY ];
} Scheduler_priority_Context;
/**
diff --git a/cpukit/include/rtems/score/schedulerpriorityimpl.h b/cpukit/include/rtems/score/schedulerpriorityimpl.h
index d8d226d6f1..eef0de59b1 100644
--- a/cpukit/include/rtems/score/schedulerpriorityimpl.h
+++ b/cpukit/include/rtems/score/schedulerpriorityimpl.h
@@ -41,7 +41,7 @@
#include <rtems/score/schedulerpriority.h>
#include <rtems/score/chainimpl.h>
#include <rtems/score/prioritybitmapimpl.h>
-#include <rtems/score/schedulerimpl.h>
+#include <rtems/score/scheduleruniimpl.h>
#include <rtems/score/thread.h>
#ifdef __cplusplus
@@ -61,7 +61,7 @@ extern "C" {
*
* @return The context of the scheduler.
*/
-RTEMS_INLINE_ROUTINE Scheduler_priority_Context *
+static inline Scheduler_priority_Context *
_Scheduler_priority_Get_context( const Scheduler_Control *scheduler )
{
return (Scheduler_priority_Context *) _Scheduler_Get_context( scheduler );
@@ -74,7 +74,7 @@ RTEMS_INLINE_ROUTINE Scheduler_priority_Context *
*
* @return The scheduler node of @a the_thread.
*/
-RTEMS_INLINE_ROUTINE Scheduler_priority_Node *_Scheduler_priority_Thread_get_node(
+static inline Scheduler_priority_Node *_Scheduler_priority_Thread_get_node(
Thread_Control *the_thread
)
{
@@ -88,7 +88,7 @@ RTEMS_INLINE_ROUTINE Scheduler_priority_Node *_Scheduler_priority_Thread_get_nod
*
* @return The priority node.
*/
-RTEMS_INLINE_ROUTINE Scheduler_priority_Node *_Scheduler_priority_Node_downcast(
+static inline Scheduler_priority_Node *_Scheduler_priority_Node_downcast(
Scheduler_Node *node
)
{
@@ -103,7 +103,7 @@ RTEMS_INLINE_ROUTINE Scheduler_priority_Node *_Scheduler_priority_Node_downcast(
* @param[out] ready_queues The ready queue to initialize.
* @param maximum_priority The maximum priority in the ready queue.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_initialize(
+static inline void _Scheduler_priority_Ready_queue_initialize(
Chain_Control *ready_queues,
Priority_Control maximum_priority
)
@@ -124,7 +124,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_initialize(
* @param[in, out] ready_queue The ready queue.
* @param[out] bit_map The priority bit map of the scheduler instance.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_enqueue(
+static inline void _Scheduler_priority_Ready_queue_enqueue(
Chain_Node *node,
Scheduler_priority_Ready_queue *ready_queue,
Priority_bit_map_Control *bit_map
@@ -145,7 +145,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_enqueue(
* @param[in, out] ready_queue The ready queue.
* @param[out] bit_map The priority bit map of the scheduler instance.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_enqueue_first(
+static inline void _Scheduler_priority_Ready_queue_enqueue_first(
Chain_Node *node,
Scheduler_priority_Ready_queue *ready_queue,
Priority_bit_map_Control *bit_map
@@ -164,7 +164,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_enqueue_first(
* @param[in, out] ready_queue The ready queue.
* @param[out] bit_map The priority bit map of the scheduler instance.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_extract(
+static inline void _Scheduler_priority_Ready_queue_extract(
Chain_Node *node,
Scheduler_priority_Ready_queue *ready_queue,
Priority_bit_map_Control *bit_map
@@ -188,7 +188,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_extract(
* @param the_thread The thread of which the node will be extracted.
* @param[in, out] The node which preserves the ready queue.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_priority_Extract_body(
+static inline void _Scheduler_priority_Extract_body(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -217,7 +217,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Extract_body(
*
* @return This method returns the first node.
*/
-RTEMS_INLINE_ROUTINE Chain_Node *_Scheduler_priority_Ready_queue_first(
+static inline Chain_Node *_Scheduler_priority_Ready_queue_first(
Priority_bit_map_Control *bit_map,
Chain_Control *ready_queues
)
@@ -231,33 +231,21 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Scheduler_priority_Ready_queue_first(
}
/**
- * @brief Scheduling decision logic.
+ * @brief Gets the highest priority ready thread of the scheduler.
*
- * This kernel routine implements scheduling decision logic
- * for priority-based scheduling.
- *
- * @param[in, out] scheduler The scheduler instance.
- * @param the_thread This parameter is unused.
- * @param force_dispatch Indicates whether the dispatch happens also if
- * the currently executing thread is set as not preemptible.
+ * @param scheduler is the scheduler.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- bool force_dispatch
+static inline Thread_Control *_Scheduler_priority_Get_highest_ready(
+ const Scheduler_Control *scheduler
)
{
Scheduler_priority_Context *context =
_Scheduler_priority_Get_context( scheduler );
- Thread_Control *heir = (Thread_Control *)
- _Scheduler_priority_Ready_queue_first(
- &context->Bit_map,
- &context->Ready[ 0 ]
- );
- ( void ) the_thread;
-
- _Scheduler_Update_heir( heir, force_dispatch );
+ return (Thread_Control *) _Scheduler_priority_Ready_queue_first(
+ &context->Bit_map,
+ &context->Ready[ 0 ]
+ );
}
/**
@@ -269,7 +257,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(
* @param bit_map The priority bit map of the scheduler instance.
* @param ready_queues The ready queues of the scheduler instance.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_update(
+static inline void _Scheduler_priority_Ready_queue_update(
Scheduler_priority_Ready_queue *ready_queue,
unsigned int new_priority,
Priority_bit_map_Control *bit_map,
diff --git a/cpukit/include/rtems/score/schedulersimpleimpl.h b/cpukit/include/rtems/score/schedulersimpleimpl.h
index 2aaf0fe17e..da052ba1b4 100644
--- a/cpukit/include/rtems/score/schedulersimpleimpl.h
+++ b/cpukit/include/rtems/score/schedulersimpleimpl.h
@@ -39,7 +39,7 @@
#include <rtems/score/schedulersimple.h>
#include <rtems/score/chainimpl.h>
-#include <rtems/score/schedulerimpl.h>
+#include <rtems/score/scheduleruniimpl.h>
#ifdef __cplusplus
extern "C" {
@@ -58,7 +58,7 @@ extern "C" {
*
* @return The context of @a scheduler.
*/
-RTEMS_INLINE_ROUTINE Scheduler_simple_Context *
+static inline Scheduler_simple_Context *
_Scheduler_simple_Get_context( const Scheduler_Control *scheduler )
{
return (Scheduler_simple_Context *) _Scheduler_Get_context( scheduler );
@@ -76,7 +76,7 @@ RTEMS_INLINE_ROUTINE Scheduler_simple_Context *
* @retval true @a to_insert is smaller or equal than the priority of @a next.
* @retval false @a to_insert is greater than the priority of @a next.
*/
-RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Priority_less_equal(
+static inline bool _Scheduler_simple_Priority_less_equal(
const void *key,
const Chain_Node *to_insert,
const Chain_Node *next
@@ -99,7 +99,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Priority_less_equal(
* @param[in, out] to_insert The node to insert into @a chain.
* @param insert_priority The priority to insert @a to_insert with.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert(
+static inline void _Scheduler_simple_Insert(
Chain_Control *chain,
Thread_Control *to_insert,
unsigned int insert_priority
@@ -120,7 +120,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert(
* @param[in, out] the_thread The thread of which to extract the node out of its chain.
* @param node This parameter is unused.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_simple_Extract(
+static inline void _Scheduler_simple_Extract(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -133,28 +133,18 @@ RTEMS_INLINE_ROUTINE void _Scheduler_simple_Extract(
}
/**
- * @brief Scheduling decision logic.
+ * @brief Gets the highest priority ready thread of the scheduler.
*
- * This kernel routine implements scheduling decision logic for the simple scheduler.
- *
- * @param[in, out] scheduler The scheduler instance.
- * @param the_thread This parameter is unused.
- * @param force_dispatch Indicates whether the dispatch happens also if
- * the currently executing thread is set as not preemptible.
+ * @param scheduler is the scheduler.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_simple_Schedule_body(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- bool force_dispatch
+static inline Thread_Control *_Scheduler_simple_Get_highest_ready(
+ const Scheduler_Control *scheduler
)
{
Scheduler_simple_Context *context =
_Scheduler_simple_Get_context( scheduler );
- Thread_Control *heir = (Thread_Control *) _Chain_First( &context->Ready );
-
- ( void ) the_thread;
- _Scheduler_Update_heir( heir, force_dispatch );
+ return (Thread_Control *) _Chain_First( &context->Ready );
}
/** @} */
diff --git a/cpukit/include/rtems/score/scheduleruniimpl.h b/cpukit/include/rtems/score/scheduleruniimpl.h
new file mode 100644
index 0000000000..5cc4942fcc
--- /dev/null
+++ b/cpukit/include/rtems/score/scheduleruniimpl.h
@@ -0,0 +1,221 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreScheduler
+ *
+ * @brief This header file provides interfaces of the supporting the
+ * implementation of uniprocessor schedulers.
+ */
+
+/*
+ * Copyright (C) 2010 Gedare Bloom.
+ * Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2014, 2022 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_SCORE_SCHEDULERUNIIMPL_H
+#define _RTEMS_SCORE_SCHEDULERUNIIMPL_H
+
+#include <rtems/score/schedulerimpl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSScoreScheduler
+ *
+ * @{
+ */
+
+/**
+ * @brief Updates the heir thread of the processor.
+ *
+ * @param[in, out] heir is the current heir thread.
+ * @param[in, out] new_heir is the new heir thread.
+ */
+static inline void _Scheduler_uniprocessor_Update_heir(
+ Thread_Control *heir,
+ Thread_Control *new_heir
+)
+{
+ _Assert( heir != new_heir );
+#if defined(RTEMS_SMP)
+ /*
+ * We need this state only for _Thread_Get_CPU_time_used_locked(). Cannot
+ * use _Scheduler_Thread_change_state() since THREAD_SCHEDULER_BLOCKED to
+ * THREAD_SCHEDULER_BLOCKED state changes are illegal for the real SMP
+ * schedulers.
+ */
+ heir->Scheduler.state = THREAD_SCHEDULER_BLOCKED;
+ new_heir->Scheduler.state = THREAD_SCHEDULER_SCHEDULED;
+#endif
+ _Thread_Update_CPU_time_used( heir, _Thread_Get_CPU( heir ) );
+ _Thread_Heir = new_heir;
+ _Thread_Dispatch_necessary = true;
+}
+
+/**
+ * @brief Updates the heir thread of the processor if the current heir is
+ * not equal to the new heir thread.
+ *
+ * The update takes place even if the current heir thread is not preemptible.
+ *
+ * @param[in, out] new_heir is the new heir thread.
+ */
+static inline void _Scheduler_uniprocessor_Update_heir_if_necessary(
+ Thread_Control *new_heir
+)
+{
+ Thread_Control *heir = _Thread_Heir;
+
+ if ( heir != new_heir ) {
+ _Scheduler_uniprocessor_Update_heir( heir, new_heir );
+ }
+}
+
+/**
+ * @brief Updates the heir thread of the processor if the current heir thread
+ * is preemptible.
+ *
+ * @param[in, out] heir is the current heir thread.
+ * @param[in, out] new_heir is the new heir thread.
+ */
+static inline void _Scheduler_uniprocessor_Update_heir_if_preemptible(
+ Thread_Control *heir,
+ Thread_Control *new_heir
+)
+{
+ if ( heir != new_heir && heir->is_preemptible ) {
+ _Scheduler_uniprocessor_Update_heir( heir, new_heir );
+ }
+}
+
+/**
+ * @brief Blocks the thread.
+ *
+ * @param scheduler is the scheduler.
+ * @param the_thread is the thread to block.
+ * @param node is the scheduler node of the thread.
+ * @param extract is the handler to extract the thread.
+ * @param get_highest_ready is the handler to get the highest ready thread.
+ */
+static inline void _Scheduler_uniprocessor_Block(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node,
+ void ( *extract )(
+ const Scheduler_Control *,
+ Thread_Control *,
+ Scheduler_Node *
+ ),
+ Thread_Control *( *get_highest_ready )( const Scheduler_Control * )
+)
+{
+ ( *extract )( scheduler, the_thread, node );
+
+ /* TODO: flash critical section? */
+
+ if ( _Thread_Is_heir( the_thread ) ) {
+ Thread_Control *highest_ready;
+
+ highest_ready = ( *get_highest_ready )( scheduler );
+ _Scheduler_uniprocessor_Update_heir( _Thread_Heir, highest_ready );
+ }
+}
+
+/**
+ * @brief Schedule the unblocked thread if it is the highest ready thread.
+ *
+ * @param scheduler is the scheduler.
+ * @param the_thread is the thread.
+ * @param priority is the priority of the thread.
+ */
+static inline void _Scheduler_uniprocessor_Unblock(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Priority_Control priority
+)
+{
+ Thread_Control *heir;
+
+ heir = _Thread_Heir;
+
+ /*
+ * If the thread is more important than the heir, then we have a new heir.
+ * This may or may not result in a context switch. If the current heir
+ * thread is preemptible, then we need to do a context switch.
+ */
+ if ( priority < _Thread_Get_priority( heir ) ) {
+ _Scheduler_uniprocessor_Update_heir_if_preemptible( heir, the_thread );
+ }
+}
+
+/**
+ * @brief Schedules the highest ready thread if the current heir thread of the
+ * processor is preemptible.
+ *
+ * @param scheduler is the scheduler.
+ * @param get_highest_ready is the handler to get the highest ready thread.
+ */
+static inline void _Scheduler_uniprocessor_Schedule(
+ const Scheduler_Control *scheduler,
+ Thread_Control *( *get_highest_ready )( const Scheduler_Control * )
+)
+{
+ Thread_Control *highest_ready;
+
+ highest_ready = ( *get_highest_ready )( scheduler );
+ _Scheduler_uniprocessor_Update_heir_if_preemptible(
+ _Thread_Heir,
+ highest_ready
+ );
+}
+
+/**
+ * @brief Yields to the highest ready thread.
+ *
+ * @param scheduler is the scheduler.
+ * @param get_highest_ready is the handler to get the highest ready thread.
+ */
+static inline void _Scheduler_uniprocessor_Yield(
+ const Scheduler_Control *scheduler,
+ Thread_Control *( *get_highest_ready )( const Scheduler_Control * )
+)
+{
+ Thread_Control *highest_ready;
+
+ highest_ready = ( *get_highest_ready )( scheduler );
+ _Scheduler_uniprocessor_Update_heir_if_necessary( highest_ready );
+}
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_SCORE_SCHEDULERUNIIMPL_H */
diff --git a/cpukit/include/rtems/score/smpimpl.h b/cpukit/include/rtems/score/smpimpl.h
index 8e965968a1..ef32687bec 100644
--- a/cpukit/include/rtems/score/smpimpl.h
+++ b/cpukit/include/rtems/score/smpimpl.h
@@ -355,7 +355,7 @@ void _SMP_Synchronize( void );
*
* @return The processor mask with all online processors.
*/
-RTEMS_INLINE_ROUTINE const Processor_mask *_SMP_Get_online_processors( void )
+static inline const Processor_mask *_SMP_Get_online_processors( void )
{
#if defined(RTEMS_SMP)
return &_SMP_Online_processors;
@@ -370,7 +370,7 @@ RTEMS_INLINE_ROUTINE const Processor_mask *_SMP_Get_online_processors( void )
* @return True if inter-processor interrupts are needed for the correct system
* operation, otherwise false.
*/
-RTEMS_INLINE_ROUTINE bool _SMP_Need_inter_processor_interrupts( void )
+static inline bool _SMP_Need_inter_processor_interrupts( void )
{
/*
* Use the configured processor maximum instead of the actual to allow
diff --git a/cpukit/include/rtems/score/smplockstats.h b/cpukit/include/rtems/score/smplockstats.h
index 102fb6eac5..cebfb80bd6 100644
--- a/cpukit/include/rtems/score/smplockstats.h
+++ b/cpukit/include/rtems/score/smplockstats.h
@@ -235,7 +235,7 @@ static inline void _SMP_lock_Stats_acquire_end(
second = _CPU_Counter_read();
stats_context->acquire_instant = second;
- delta = _CPU_Counter_difference( second, acquire_context->first );
+ delta = second - acquire_context->first;
++stats->usage_count;
@@ -270,7 +270,7 @@ static inline void _SMP_lock_Stats_release_update(
stats = stats_context->stats;
first = stats_context->acquire_instant;
second = _CPU_Counter_read();
- delta = _CPU_Counter_difference( second, first );
+ delta = second - first;
stats->total_section_time += delta;
diff --git a/cpukit/include/rtems/score/stackimpl.h b/cpukit/include/rtems/score/stackimpl.h
index 3fe9d2cd33..1df2f151e1 100644
--- a/cpukit/include/rtems/score/stackimpl.h
+++ b/cpukit/include/rtems/score/stackimpl.h
@@ -63,7 +63,7 @@ extern "C" {
* @param starting_address The starting_address for the new stack.
* @param size The size of the stack in bytes.
*/
-RTEMS_INLINE_ROUTINE void _Stack_Initialize (
+static inline void _Stack_Initialize (
Stack_Control *the_stack,
void *starting_address,
size_t size
@@ -81,7 +81,7 @@ RTEMS_INLINE_ROUTINE void _Stack_Initialize (
*
* @return The minimum stack size.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Stack_Minimum (void)
+static inline uint32_t _Stack_Minimum (void)
{
return rtems_minimum_stack_size;
}
@@ -98,7 +98,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Stack_Minimum (void)
* @retval true @a size is large enough.
* @retval false @a size is not large enough.
*/
-RTEMS_INLINE_ROUTINE bool _Stack_Is_enough(
+static inline bool _Stack_Is_enough(
size_t size,
bool is_fp
)
@@ -128,7 +128,7 @@ RTEMS_INLINE_ROUTINE bool _Stack_Is_enough(
*
* @return The appropriate stack size.
*/
-RTEMS_INLINE_ROUTINE size_t _Stack_Ensure_minimum (
+static inline size_t _Stack_Ensure_minimum (
size_t size
)
{
@@ -148,7 +148,7 @@ RTEMS_INLINE_ROUTINE size_t _Stack_Ensure_minimum (
*
* @return Returns the extended stack size.
*/
-RTEMS_INLINE_ROUTINE size_t _Stack_Extend_size(
+static inline size_t _Stack_Extend_size(
size_t stack_size,
bool is_fp
)
diff --git a/cpukit/include/rtems/score/statesimpl.h b/cpukit/include/rtems/score/statesimpl.h
index 2121731430..aa90f3c27f 100644
--- a/cpukit/include/rtems/score/statesimpl.h
+++ b/cpukit/include/rtems/score/statesimpl.h
@@ -171,7 +171,7 @@ extern "C" {
*
* @return This method returns the updated states value.
*/
-RTEMS_INLINE_ROUTINE States_Control _States_Set (
+static inline States_Control _States_Set (
States_Control states_to_set,
States_Control current_state
)
@@ -190,7 +190,7 @@ RTEMS_INLINE_ROUTINE States_Control _States_Set (
*
* @return This method returns the updated states value.
*/
-RTEMS_INLINE_ROUTINE States_Control _States_Clear (
+static inline States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
@@ -209,7 +209,7 @@ RTEMS_INLINE_ROUTINE States_Control _States_Clear (
* @retval true The state is ready.
* @retval false The state is not ready.
*/
-RTEMS_INLINE_ROUTINE bool _States_Is_ready (
+static inline bool _States_Is_ready (
States_Control the_states
)
{
@@ -227,7 +227,7 @@ RTEMS_INLINE_ROUTINE bool _States_Is_ready (
* @retval true DORMANT state is set in @a the_states.
* @retval false DORMANT state is not set in @a the_states.
*/
-RTEMS_INLINE_ROUTINE bool _States_Is_dormant (
+static inline bool _States_Is_dormant (
States_Control the_states
)
{
@@ -245,7 +245,7 @@ RTEMS_INLINE_ROUTINE bool _States_Is_dormant (
* @retval true SUSPENDED state is set in @a the_states.
* @retval false SUSPENDED state is not set in @a the_states.
*/
-RTEMS_INLINE_ROUTINE bool _States_Is_suspended (
+static inline bool _States_Is_suspended (
States_Control the_states
)
{
@@ -263,7 +263,7 @@ RTEMS_INLINE_ROUTINE bool _States_Is_suspended (
* @retval true WAITING_FOR_TIME state is set in @a the_states.
* @retval false WAITING_FOR_TIME state is not set in @a the_states.
*/
-RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_rpc_reply (
+static inline bool _States_Is_waiting_for_rpc_reply (
States_Control the_states
)
{
@@ -281,7 +281,7 @@ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_rpc_reply (
* @retval true WAITING_FOR_JOIN_AT_EXIT state is set in @a the_states.
* @retval false WAITING_FOR_JOIN_AT_EXIT state is not set in @a the_states.
*/
-RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_join_at_exit(
+static inline bool _States_Is_waiting_for_join_at_exit(
States_Control the_states
)
{
@@ -299,7 +299,7 @@ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_join_at_exit(
* @retval true @a the_states is interruptible.
* @retval false @a the_states is not interruptible.
*/
-RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
+static inline bool _States_Is_interruptible_by_signal (
States_Control the_states
)
{
@@ -320,7 +320,7 @@ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
* @retval false The state indicates that the task is not blocked waiting on a
* local resource.
*/
-RTEMS_INLINE_ROUTINE bool _States_Is_locally_blocked (
+static inline bool _States_Is_locally_blocked (
States_Control the_states
)
{
diff --git a/cpukit/include/rtems/score/sysstate.h b/cpukit/include/rtems/score/sysstate.h
index 773987b14b..1086569867 100644
--- a/cpukit/include/rtems/score/sysstate.h
+++ b/cpukit/include/rtems/score/sysstate.h
@@ -95,7 +95,7 @@ extern System_state_Codes _System_state_Current;
*
* @param state The state to set.
*/
-RTEMS_INLINE_ROUTINE void _System_state_Set (
+static inline void _System_state_Set (
System_state_Codes state
)
{
@@ -107,7 +107,7 @@ RTEMS_INLINE_ROUTINE void _System_state_Set (
*
* @return The current system state.
*/
-RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
+static inline System_state_Codes _System_state_Get ( void )
{
return _System_state_Current;
}
@@ -120,7 +120,7 @@ RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
* @retval true @a state is before initialization.
* @retval false @a state is not before initialization.
*/
-RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization (
+static inline bool _System_state_Is_before_initialization (
System_state_Codes state
)
{
@@ -135,7 +135,7 @@ RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization (
* @retval true @a state is before multitasking.
* @retval false @a state is not before multitasking.
*/
-RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking (
+static inline bool _System_state_Is_before_multitasking (
System_state_Codes state
)
{
@@ -150,7 +150,7 @@ RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking (
* @retval true @a state is up.
* @retval false @a state is not up.
*/
-RTEMS_INLINE_ROUTINE bool _System_state_Is_up (
+static inline bool _System_state_Is_up (
System_state_Codes state
)
{
@@ -165,7 +165,7 @@ RTEMS_INLINE_ROUTINE bool _System_state_Is_up (
* @retval true @a state is terminated.
* @retval false @a state is not terminated.
*/
-RTEMS_INLINE_ROUTINE bool _System_state_Is_terminated (
+static inline bool _System_state_Is_terminated (
System_state_Codes state
)
{
diff --git a/cpukit/include/rtems/score/thread.h b/cpukit/include/rtems/score/thread.h
index dd32b51a5f..40fefbc79a 100644
--- a/cpukit/include/rtems/score/thread.h
+++ b/cpukit/include/rtems/score/thread.h
@@ -921,8 +921,12 @@ struct _Thread_Control {
*/
Context_Control_fp *fp_context;
#endif
+
+#ifndef _REENT_THREAD_LOCAL
/** This field points to the newlib reentrancy structure for this thread. */
struct _reent *libc_reent;
+#endif
+
/** This array contains the API extension area pointers. */
void *API_Extensions[ THREAD_API_LAST + 1 ];
@@ -1147,9 +1151,11 @@ Objects_Control *_Thread_Allocate_unlimited( Objects_Information *information );
#define THREAD_INFORMATION_DEFINE( name, api, cls, max ) \
static Objects_Control * \
name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \
-static Thread_Configured_control \
+static RTEMS_SECTION( ".noinit.rtems.content.objects." #name ) \
+Thread_Configured_control \
name##_Objects[ _Objects_Maximum_per_allocation( max ) ]; \
-static Thread_queue_Configured_heads \
+static RTEMS_SECTION( ".noinit.rtems.content.objects." #name ) \
+Thread_queue_Configured_heads \
name##_Heads[ _Objects_Maximum_per_allocation( max ) ]; \
Thread_Information name##_Information = { \
{ \
diff --git a/cpukit/include/rtems/score/threaddispatch.h b/cpukit/include/rtems/score/threaddispatch.h
index b4124ea0c2..589935823f 100644
--- a/cpukit/include/rtems/score/threaddispatch.h
+++ b/cpukit/include/rtems/score/threaddispatch.h
@@ -72,7 +72,7 @@ extern "C" {
* @retval false The executing thread is inside a thread dispatch critical
* section and dispatching is not allowed.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_is_enabled(void)
+static inline bool _Thread_Dispatch_is_enabled(void)
{
bool enabled;
@@ -96,7 +96,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_is_enabled(void)
*
* @return The value of the thread dispatch level.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_get_disable_level(void)
+static inline uint32_t _Thread_Dispatch_get_disable_level(void)
{
return _Thread_Dispatch_disable_level;
}
@@ -106,7 +106,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_get_disable_level(void)
*
* This routine initializes the thread dispatching subsystem.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void )
+static inline void _Thread_Dispatch_initialization( void )
{
_Thread_Dispatch_disable_level = 1;
}
@@ -180,7 +180,7 @@ void _Thread_Do_dispatch( Per_CPU_Control *cpu_self, ISR_Level level );
*
* @return The current processor.
*/
-RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable_with_CPU(
+static inline Per_CPU_Control *_Thread_Dispatch_disable_with_CPU(
Per_CPU_Control *cpu_self,
const ISR_lock_Context *lock_context
)
@@ -207,7 +207,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable_with_CPU(
*
* @return The current processor.
*/
-RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable_critical(
+static inline Per_CPU_Control *_Thread_Dispatch_disable_critical(
const ISR_lock_Context *lock_context
)
{
@@ -219,7 +219,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable_critical(
*
* @return The current processor.
*/
-RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable( void )
+static inline Per_CPU_Control *_Thread_Dispatch_disable( void )
{
Per_CPU_Control *cpu_self;
ISR_lock_Context lock_context;
@@ -251,7 +251,7 @@ void _Thread_Dispatch_enable( Per_CPU_Control *cpu_self );
*
* @param[in, out] cpu_self The current processor.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Dispatch_unnest( Per_CPU_Control *cpu_self )
+static inline void _Thread_Dispatch_unnest( Per_CPU_Control *cpu_self )
{
_Assert( cpu_self->thread_dispatch_disable_level > 0 );
--cpu_self->thread_dispatch_disable_level;
@@ -263,7 +263,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_unnest( Per_CPU_Control *cpu_self )
* @param[in, out] cpu_self The current processor.
* @param[in, out] cpu_target The target processor to request a thread dispatch.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Dispatch_request(
+static inline void _Thread_Dispatch_request(
Per_CPU_Control *cpu_self,
Per_CPU_Control *cpu_target
)
diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h
index 10800aa023..01c3860db8 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -380,15 +380,23 @@ RTEMS_NO_RETURN void _Thread_Exit(
);
/**
- * @brief Joins the currently executing thread with the given thread to wait
- * for.
+ * @brief Joins the currently executing thread with the thread.
*
- * @param[in, out] the_thread The thread to wait for.
- * @param waiting_for_join The states control for the join.
- * @param[in, out] executing The currently executing thread.
- * @param queue_context The thread queue context.
+ * @param[in, out] the_thread is the thread to join.
+ *
+ * @param waiting_for_join is the thread state for the currently executing
+ * thread.
+ *
+ * @param[in, out] executing is the currently executing thread.
+ *
+ * @param queue_context[in, out] is the thread queue context. The caller shall
+ * have acquired the thread state lock using the thread queue context.
+ *
+ * @retval STATUS_SUCCESSFUL The operation was successful.
+ *
+ * @retval STATUS_DEADLOCK A deadlock occurred.
*/
-void _Thread_Join(
+Status_Control _Thread_Join(
Thread_Control *the_thread,
States_Control waiting_for_join,
Thread_Control *executing,
@@ -396,23 +404,38 @@ void _Thread_Join(
);
/**
+ * @brief Indicates the resulting state of _Thread_Cancel().
+ */
+typedef enum {
+ /**
+ * @brief Indicates that the thread cancel operation is done.
+ */
+ THREAD_CANCEL_DONE,
+
+ /**
+ * @brief Indicates that the thread cancel operation is in progress.
+ *
+ * The cancelled thread is terminating. It may be joined.
+ */
+ THREAD_CANCEL_IN_PROGRESS
+} Thread_Cancel_state;
+
+/**
* @brief Cancels the thread.
*
- * @param[in, out] the_thread The thread to cancel.
- * @param executing The currently executing thread.
- * @param exit_value The exit value for the thread.
+ * @param[in, out] the_thread is the thread to cancel.
+
+ * @param[in, out] executing is the currently executing thread.
+
+ * @param[in, out] life_states_to_clear is the set of thread life states to
+ * clear for the thread to cancel.
*/
-void _Thread_Cancel(
- Thread_Control *the_thread,
- Thread_Control *executing,
- void *exit_value
+Thread_Cancel_state _Thread_Cancel(
+ Thread_Control *the_thread,
+ Thread_Control *executing,
+ Thread_Life_state life_states_to_clear
);
-typedef struct {
- Thread_queue_Context Base;
- Thread_Control *cancel;
-} Thread_Close_context;
-
/**
* @brief Closes the thread.
*
@@ -420,14 +443,21 @@ typedef struct {
* case the executing thread is not terminated, then this function waits until
* the terminating thread reached the zombie state.
*
- * @param the_thread The thread to close.
- * @param executing The currently executing thread.
- * @param[in, out] context The thread close context.
+ * @param the_thread is the thread to close.
+ *
+ * @param[in, out] executing is the currently executing thread.
+ *
+ * @param[in, out] queue_context is the thread queue context. The caller shall
+ * have disabled interrupts using the thread queue context.
+ *
+ * @retval STATUS_SUCCESSFUL The operation was successful.
+ *
+ * @retval STATUS_DEADLOCK A deadlock occurred.
*/
-void _Thread_Close(
+Status_Control _Thread_Close(
Thread_Control *the_thread,
Thread_Control *executing,
- Thread_Close_context *context
+ Thread_queue_Context *queue_context
);
/**
@@ -438,7 +468,7 @@ void _Thread_Close(
* @retval true The thread is currently in the ready state.
* @retval false The thread is currently not ready.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_ready( const Thread_Control *the_thread )
+static inline bool _Thread_Is_ready( const Thread_Control *the_thread )
{
return _States_Is_ready( the_thread->current_state );
}
@@ -565,7 +595,7 @@ void _Thread_Handler( void );
* @param the_thread The thread to acquire the lock context.
* @param lock_context The lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_State_acquire_critical(
+static inline void _Thread_State_acquire_critical(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -579,7 +609,7 @@ RTEMS_INLINE_ROUTINE void _Thread_State_acquire_critical(
* @param the_thread The thread to acquire the lock context.
* @param lock_context The lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_State_acquire(
+static inline void _Thread_State_acquire(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -596,7 +626,7 @@ RTEMS_INLINE_ROUTINE void _Thread_State_acquire(
*
* @return The currently executing thread.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_State_acquire_for_executing(
+static inline Thread_Control *_Thread_State_acquire_for_executing(
ISR_lock_Context *lock_context
)
{
@@ -615,7 +645,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Thread_State_acquire_for_executing(
* @param the_thread The thread to release the lock context.
* @param lock_context The lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_State_release_critical(
+static inline void _Thread_State_release_critical(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -629,7 +659,7 @@ RTEMS_INLINE_ROUTINE void _Thread_State_release_critical(
* @param[in, out] the_thread The thread to release the lock context.
* @param[out] lock_context The lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_State_release(
+static inline void _Thread_State_release(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -647,7 +677,7 @@ RTEMS_INLINE_ROUTINE void _Thread_State_release(
* @retval false The thread is not owner of the lock of the join queue.
*/
#if defined(RTEMS_DEBUG)
-RTEMS_INLINE_ROUTINE bool _Thread_State_is_owner(
+static inline bool _Thread_State_is_owner(
const Thread_Control *the_thread
)
{
@@ -761,7 +791,7 @@ void _Thread_Priority_changed(
*
* @see _Thread_Wait_acquire().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Priority_change(
+static inline void _Thread_Priority_change(
Thread_Control *the_thread,
Priority_Node *priority_node,
Priority_Control new_priority,
@@ -778,6 +808,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Priority_change(
);
}
+#if defined(RTEMS_SMP)
/**
* @brief Replaces the victim priority node with the replacement priority node
* in the corresponding thread priority aggregation.
@@ -795,6 +826,7 @@ void _Thread_Priority_replace(
Priority_Node *victim_node,
Priority_Node *replacement_node
);
+#endif
/**
* @brief Updates the priority of all threads in the set
@@ -844,7 +876,7 @@ void _Thread_Priority_update_ignore_sticky( Thread_Control *the_thread );
* @retval true The left priority is less in the intuitive sense.
* @retval false The left priority is greater or equal in the intuitive sense.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Priority_less_than(
+static inline bool _Thread_Priority_less_than(
Priority_Control left,
Priority_Control right
)
@@ -861,7 +893,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Priority_less_than(
*
* @return The highest priority in the intuitive sense of priority.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _Thread_Priority_highest(
+static inline Priority_Control _Thread_Priority_highest(
Priority_Control left,
Priority_Control right
)
@@ -881,7 +913,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Thread_Priority_highest(
* @return Returns the thread object information associated with the API of the
* object identifier.
*/
-RTEMS_INLINE_ROUTINE Objects_Information *_Thread_Get_objects_information_by_id(
+static inline Objects_Information *_Thread_Get_objects_information_by_id(
Objects_Id id
)
{
@@ -909,7 +941,7 @@ RTEMS_INLINE_ROUTINE Objects_Information *_Thread_Get_objects_information_by_id(
*
* @return Returns the thread object information of the thread.
*/
-RTEMS_INLINE_ROUTINE Thread_Information *_Thread_Get_objects_information(
+static inline Thread_Information *_Thread_Get_objects_information(
Thread_Control *the_thread
)
{
@@ -953,7 +985,7 @@ Objects_Id _Thread_Self_id( void );
*
* @return The cpu of the thread's scheduler.
*/
-RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Get_CPU(
+static inline Per_CPU_Control *_Thread_Get_CPU(
const Thread_Control *thread
)
{
@@ -972,7 +1004,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Get_CPU(
* @param[out] thread The thread.
* @param cpu The cpu to set.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Set_CPU(
+static inline void _Thread_Set_CPU(
Thread_Control *thread,
Per_CPU_Control *cpu
)
@@ -996,7 +1028,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Set_CPU(
* @retval true @a the_thread is the currently executing one.
* @retval false @a the_thread is not the currently executing one.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
+static inline bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
@@ -1016,7 +1048,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
* @retval true @a the_thread is the currently executing one.
* @retval false @a the_thread is not the currently executing one.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_on_a_processor(
+static inline bool _Thread_Is_executing_on_a_processor(
const Thread_Control *the_thread
)
{
@@ -1035,7 +1067,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_on_a_processor(
* @retval true @a the_thread is the heir.
* @retval false @a the_thread is not the heir.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_heir (
+static inline bool _Thread_Is_heir (
const Thread_Control *the_thread
)
{
@@ -1051,7 +1083,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_heir (
*
* @param[in, out] the_thread The thread to unblock.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Unblock (
+static inline void _Thread_Unblock (
Thread_Control *the_thread
)
{
@@ -1074,7 +1106,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Unblock (
* loaded in the floating point unit.
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
-RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp (
+static inline bool _Thread_Is_allocated_fp (
const Thread_Control *the_thread
)
{
@@ -1100,7 +1132,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp (
*
* @param executing The currently executing thread.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Save_fp( Thread_Control *executing )
+static inline void _Thread_Save_fp( Thread_Control *executing )
{
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH != TRUE )
@@ -1115,7 +1147,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Save_fp( Thread_Control *executing )
*
* @param executing The currently executing thread.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Restore_fp( Thread_Control *executing )
+static inline void _Thread_Restore_fp( Thread_Control *executing )
{
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
@@ -1140,7 +1172,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Restore_fp( Thread_Control *executing )
* point context is now longer associated with an active thread.
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
-RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void )
+static inline void _Thread_Deallocate_fp( void )
{
_Thread_Allocated_fp = NULL;
}
@@ -1155,7 +1187,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void )
* @retval true Dispatching is disabled.
* @retval false Dispatching is enabled.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_context_switch_necessary( void )
+static inline bool _Thread_Is_context_switch_necessary( void )
{
return ( _Thread_Dispatch_necessary );
}
@@ -1165,7 +1197,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_context_switch_necessary( void )
*
* @return The maximum number of internal threads.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Thread_Get_maximum_internal_threads(void)
+static inline uint32_t _Thread_Get_maximum_internal_threads(void)
{
/* Idle threads */
uint32_t maximum_internal_threads =
@@ -1187,7 +1219,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Thread_Get_maximum_internal_threads(void)
* @retval pointer Pointer to the allocated Thread_Control.
* @retval NULL The operation failed.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Internal_allocate( void )
+static inline Thread_Control *_Thread_Internal_allocate( void )
{
return (Thread_Control *)
_Objects_Allocate_unprotected( &_Thread_Information.Objects );
@@ -1206,7 +1238,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Internal_allocate( void )
* @see _Thread_Dispatch(), _Thread_Start_multitasking() and
* _Thread_Dispatch_update_heir().
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get_heir_and_make_it_executing(
+static inline Thread_Control *_Thread_Get_heir_and_make_it_executing(
Per_CPU_Control *cpu_self
)
{
@@ -1226,7 +1258,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get_heir_and_make_it_executing(
* used.
* @param cpu The cpu.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Update_CPU_time_used(
+static inline void _Thread_Update_CPU_time_used(
Thread_Control *the_thread,
Per_CPU_Control *cpu
)
@@ -1248,7 +1280,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Update_CPU_time_used(
* @param heir The new heir for @a cpu_for_heir.
*/
#if defined( RTEMS_SMP )
-RTEMS_INLINE_ROUTINE void _Thread_Dispatch_update_heir(
+static inline void _Thread_Dispatch_update_heir(
Per_CPU_Control *cpu_self,
Per_CPU_Control *cpu_for_heir,
Thread_Control *heir
@@ -1305,7 +1337,7 @@ Timestamp_Control _Thread_Get_CPU_time_used_after_last_reset(
*
* @param[out] action_control The action control to initialize.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Action_control_initialize(
+static inline void _Thread_Action_control_initialize(
Thread_Action_control *action_control
)
{
@@ -1317,7 +1349,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Action_control_initialize(
*
* @param[out] action The Thread_Action to initialize.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Action_initialize(
+static inline void _Thread_Action_initialize(
Thread_Action *action
)
{
@@ -1336,7 +1368,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Action_initialize(
*
* @param handler is the handler for the action.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Add_post_switch_action(
+static inline void _Thread_Add_post_switch_action(
Thread_Control *the_thread,
Thread_Action *action,
Thread_Action_handler handler
@@ -1369,7 +1401,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Add_post_switch_action(
*
* @param[in, out] action is the action to add.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Append_post_switch_action(
+static inline void _Thread_Append_post_switch_action(
Thread_Control *the_thread,
Thread_Action *action
)
@@ -1391,7 +1423,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Append_post_switch_action(
* @retval true @a life_state is restarting.
* @retval false @a life_state is not restarting.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_life_restarting(
+static inline bool _Thread_Is_life_restarting(
Thread_Life_state life_state
)
{
@@ -1406,7 +1438,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_life_restarting(
* @retval true @a life_state is terminating.
* @retval false @a life_state is not terminating.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_life_terminating(
+static inline bool _Thread_Is_life_terminating(
Thread_Life_state life_state
)
{
@@ -1421,7 +1453,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_life_terminating(
* @retval true @a life_state allows life change.
* @retval false @a life_state does not allow life change.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_life_change_allowed(
+static inline bool _Thread_Is_life_change_allowed(
Thread_Life_state life_state
)
{
@@ -1437,7 +1469,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_life_change_allowed(
* @retval true @a life_state is life changing.
* @retval false @a life_state is not life changing.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_life_changing(
+static inline bool _Thread_Is_life_changing(
Thread_Life_state life_state
)
{
@@ -1453,7 +1485,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_life_changing(
* @retval true @a life_state is joinable.
* @retval false @a life_state is not joinable.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Is_joinable(
+static inline bool _Thread_Is_joinable(
const Thread_Control *the_thread
)
{
@@ -1466,7 +1498,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_joinable(
*
* @param[in, out] the_thread The thread to increase the resource count of.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Resource_count_increment(
+static inline void _Thread_Resource_count_increment(
Thread_Control *the_thread
)
{
@@ -1482,7 +1514,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Resource_count_increment(
*
* @param[in, out] the_thread The thread to decrement the resource count of.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Resource_count_decrement(
+static inline void _Thread_Resource_count_decrement(
Thread_Control *the_thread
)
{
@@ -1505,7 +1537,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Resource_count_decrement(
* @retval true The thread owns resources.
* @retval false The thread does not own resources.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Owns_resources(
+static inline bool _Thread_Owns_resources(
const Thread_Control *the_thread
)
{
@@ -1520,7 +1552,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Owns_resources(
*
* @return The thread's home scheduler.
*/
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Thread_Scheduler_get_home(
+static inline const Scheduler_Control *_Thread_Scheduler_get_home(
const Thread_Control *the_thread
)
{
@@ -1539,7 +1571,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_Thread_Scheduler_get_home(
*
* @return The thread's home node.
*/
-RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_home_node(
+static inline Scheduler_Node *_Thread_Scheduler_get_home_node(
const Thread_Control *the_thread
)
{
@@ -1561,7 +1593,7 @@ RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_home_node(
*
* @return The scheduler node with the specified index.
*/
-RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_node_by_index(
+static inline Scheduler_Node *_Thread_Scheduler_get_node_by_index(
const Thread_Control *the_thread,
size_t scheduler_index
)
@@ -1584,7 +1616,7 @@ RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_node_by_index(
* @param the_thread The thread to acquire the lock context.
* @param lock_context The lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Scheduler_acquire_critical(
+static inline void _Thread_Scheduler_acquire_critical(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -1598,7 +1630,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Scheduler_acquire_critical(
* @param the_thread The thread to release the lock context.
* @param lock_context The lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Scheduler_release_critical(
+static inline void _Thread_Scheduler_release_critical(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -1620,7 +1652,7 @@ void _Thread_Scheduler_process_requests( Thread_Control *the_thread );
* @param[in, out] scheduler_node The scheduler node for the request.
* @param request The request to add.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Scheduler_add_request(
+static inline void _Thread_Scheduler_add_request(
Thread_Control *the_thread,
Scheduler_Node *scheduler_node,
Scheduler_Node_request request
@@ -1663,7 +1695,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Scheduler_add_request(
* @param[in, out] the_thread The thread to add the wait node to.
* @param scheduler_node The scheduler node which provides the wait node.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Scheduler_add_wait_node(
+static inline void _Thread_Scheduler_add_wait_node(
Thread_Control *the_thread,
Scheduler_Node *scheduler_node
)
@@ -1686,7 +1718,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Scheduler_add_wait_node(
* @param the_thread The thread to add the request to remove a wait node.
* @param scheduler_node The scheduler node to remove a wait node from.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Scheduler_remove_wait_node(
+static inline void _Thread_Scheduler_remove_wait_node(
Thread_Control *the_thread,
Scheduler_Node *scheduler_node
)
@@ -1711,7 +1743,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Scheduler_remove_wait_node(
*
* @return The priority of the thread.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_priority(
+static inline Priority_Control _Thread_Get_priority(
const Thread_Control *the_thread
)
{
@@ -1728,7 +1760,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_priority(
*
* @return The unmapped priority of the thread.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_unmapped_priority(
+static inline Priority_Control _Thread_Get_unmapped_priority(
const Thread_Control *the_thread
)
{
@@ -1742,7 +1774,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_unmapped_priority(
*
* @return The unmapped real priority of the thread.
*/
-RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_unmapped_real_priority(
+static inline Priority_Control _Thread_Get_unmapped_real_priority(
const Thread_Control *the_thread
)
{
@@ -1759,7 +1791,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_unmapped_real_priority(
*
* @see _Thread_Wait_release_default_critical().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_default_critical(
+static inline void _Thread_Wait_acquire_default_critical(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -1778,7 +1810,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_default_critical(
*
* @see _Thread_Wait_release_default().
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Wait_acquire_default_for_executing(
+static inline Thread_Control *_Thread_Wait_acquire_default_for_executing(
ISR_lock_Context *lock_context
)
{
@@ -1800,7 +1832,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Wait_acquire_default_for_executing(
*
* @see _Thread_Wait_release_default().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_default(
+static inline void _Thread_Wait_acquire_default(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -1819,7 +1851,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_default(
* @param lock_context The lock context used for the corresponding lock
* acquire.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_release_default_critical(
+static inline void _Thread_Wait_release_default_critical(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -1835,7 +1867,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_release_default_critical(
* @param[out] lock_context The lock context used for the corresponding lock
* acquire.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_release_default(
+static inline void _Thread_Wait_release_default(
Thread_Control *the_thread,
ISR_lock_Context *lock_context
)
@@ -1854,7 +1886,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_release_default(
* @param the_thread The thread to remove the request from.
* @param queue_lock_context The queue lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_remove_request_locked(
+static inline void _Thread_Wait_remove_request_locked(
Thread_Control *the_thread,
Thread_queue_Lock_context *queue_lock_context
)
@@ -1875,7 +1907,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_remove_request_locked(
* @param queue The queue that acquires.
* @param queue_lock_context The queue lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_queue_critical(
+static inline void _Thread_Wait_acquire_queue_critical(
Thread_queue_Queue *queue,
Thread_queue_Lock_context *queue_lock_context
)
@@ -1893,7 +1925,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_queue_critical(
* @param queue The queue that releases.
* @param queue_lock_context The queue lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_release_queue_critical(
+static inline void _Thread_Wait_release_queue_critical(
Thread_queue_Queue *queue,
Thread_queue_Lock_context *queue_lock_context
)
@@ -1913,7 +1945,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_release_queue_critical(
* @param[in, out] queue_context The thread queue context for the corresponding
* _Thread_Wait_release_critical().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_critical(
+static inline void _Thread_Wait_acquire_critical(
Thread_Control *the_thread,
Thread_queue_Context *queue_context
)
@@ -1969,7 +2001,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_critical(
* @param[in, out] queue_context The thread queue context for the corresponding
* _Thread_Wait_release().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire(
+static inline void _Thread_Wait_acquire(
Thread_Control *the_thread,
Thread_queue_Context *queue_context
)
@@ -1988,7 +2020,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire(
* @param[in, out] queue_context The thread queue context used for corresponding
* _Thread_Wait_acquire_critical().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_release_critical(
+static inline void _Thread_Wait_release_critical(
Thread_Control *the_thread,
Thread_queue_Context *queue_context
)
@@ -2030,7 +2062,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_release_critical(
* @param[in, out] queue_context The thread queue context used for corresponding
* _Thread_Wait_acquire().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_release(
+static inline void _Thread_Wait_release(
Thread_Control *the_thread,
Thread_queue_Context *queue_context
)
@@ -2053,7 +2085,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_release(
*
* @see _Thread_Wait_claim_finalize() and _Thread_Wait_restore_default().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_claim(
+static inline void _Thread_Wait_claim(
Thread_Control *the_thread,
Thread_queue_Queue *queue
)
@@ -2082,7 +2114,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_claim(
* @param[in, out] the_thread The thread.
* @param operations The corresponding thread queue operations.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_claim_finalize(
+static inline void _Thread_Wait_claim_finalize(
Thread_Control *the_thread,
const Thread_queue_Operations *operations
)
@@ -2101,7 +2133,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_claim_finalize(
* @param[in, out] queue_lock_context The thread queue lock context used for
* corresponding _Thread_Wait_acquire().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_remove_request(
+static inline void _Thread_Wait_remove_request(
Thread_Control *the_thread,
Thread_queue_Lock_context *queue_lock_context
)
@@ -2130,7 +2162,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_remove_request(
*
* @see _Thread_Wait_claim().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_restore_default(
+static inline void _Thread_Wait_restore_default(
Thread_Control *the_thread
)
{
@@ -2189,7 +2221,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_restore_default(
*
* @param the_thread The thread.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_tranquilize(
+static inline void _Thread_Wait_tranquilize(
Thread_Control *the_thread
)
{
@@ -2207,7 +2239,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_tranquilize(
* @param queue_context The thread queue context used for corresponding
* _Thread_Wait_acquire().
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_cancel(
+static inline void _Thread_Wait_cancel(
Thread_Control *the_thread,
Thread_queue_Context *queue_context
)
@@ -2294,7 +2326,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_cancel(
* @param[in, out] the_thread The thread to set the wait flags of.
* @param flags The flags to set.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Wait_flags_set(
+static inline void _Thread_Wait_flags_set(
Thread_Control *the_thread,
Thread_Wait_flags flags
)
@@ -2313,7 +2345,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_flags_set(
*
* @return The thread's wait flags.
*/
-RTEMS_INLINE_ROUTINE Thread_Wait_flags _Thread_Wait_flags_get(
+static inline Thread_Wait_flags _Thread_Wait_flags_get(
const Thread_Control *the_thread
)
{
@@ -2331,7 +2363,7 @@ RTEMS_INLINE_ROUTINE Thread_Wait_flags _Thread_Wait_flags_get(
*
* @return The thread's wait flags.
*/
-RTEMS_INLINE_ROUTINE Thread_Wait_flags _Thread_Wait_flags_get_acquire(
+static inline Thread_Wait_flags _Thread_Wait_flags_get_acquire(
const Thread_Control *the_thread
)
{
@@ -2358,7 +2390,7 @@ RTEMS_INLINE_ROUTINE Thread_Wait_flags _Thread_Wait_flags_get_acquire(
* @retval true The wait flags were equal to the expected wait flags.
* @retval false The wait flags were not equal to the expected wait flags.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Wait_flags_try_change_release(
+static inline bool _Thread_Wait_flags_try_change_release(
Thread_Control *the_thread,
Thread_Wait_flags expected_flags,
Thread_Wait_flags desired_flags
@@ -2398,7 +2430,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Wait_flags_try_change_release(
* @retval true The wait flags were equal to the expected wait flags.
* @retval false The wait flags were not equal to the expected wait flags.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_Wait_flags_try_change_acquire(
+static inline bool _Thread_Wait_flags_try_change_acquire(
Thread_Control *the_thread,
Thread_Wait_flags expected_flags,
Thread_Wait_flags desired_flags
@@ -2452,7 +2484,7 @@ Objects_Id _Thread_Wait_get_id( const Thread_Control *the_thread );
*
* @param the_thread The thread to get the status of the wait return code of.
*/
-RTEMS_INLINE_ROUTINE Status_Control _Thread_Wait_get_status(
+static inline Status_Control _Thread_Wait_get_status(
const Thread_Control *the_thread
)
{
@@ -2486,7 +2518,7 @@ void _Thread_Timeout( Watchdog_Control *the_watchdog );
* @param [in, out] timer The timer to initialize.
* @param cpu The cpu for the operation.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Timer_initialize(
+static inline void _Thread_Timer_initialize(
Thread_Timer_information *timer,
Per_CPU_Control *cpu
)
@@ -2503,7 +2535,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Timer_initialize(
* @param cpu The cpu for the operation.
* @param ticks The ticks to add to the timeout ticks.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Add_timeout_ticks(
+static inline void _Thread_Add_timeout_ticks(
Thread_Control *the_thread,
Per_CPU_Control *cpu,
Watchdog_Interval ticks
@@ -2529,7 +2561,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Add_timeout_ticks(
* @param routine The watchdog routine for the thread.
* @param expire Expiration for the watchdog.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_realtime(
+static inline void _Thread_Timer_insert_realtime(
Thread_Control *the_thread,
Per_CPU_Control *cpu,
Watchdog_Service_routine_entry routine,
@@ -2554,7 +2586,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Timer_insert_realtime(
*
* @param[in, out] the_thread The thread to remove the watchdog from.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Timer_remove( Thread_Control *the_thread )
+static inline void _Thread_Timer_remove( Thread_Control *the_thread )
{
ISR_lock_Context lock_context;
@@ -2580,7 +2612,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Timer_remove( Thread_Control *the_thread )
* if necessary.
* @param queue The thread queue.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Remove_timer_and_unblock(
+static inline void _Thread_Remove_timer_and_unblock(
Thread_Control *the_thread,
Thread_queue_Queue *queue
)
@@ -2651,7 +2683,7 @@ void _Thread_Do_unpin(
*
* @param executing The currently executing thread.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Pin( Thread_Control *executing )
+static inline void _Thread_Pin( Thread_Control *executing )
{
#if defined(RTEMS_SMP)
_Assert( executing == _Thread_Get_executing() );
@@ -2668,7 +2700,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Pin( Thread_Control *executing )
* @param executing The currently executing thread.
* @param cpu_self The cpu for the operation.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Unpin(
+static inline void _Thread_Unpin(
Thread_Control *executing,
Per_CPU_Control *cpu_self
)
@@ -2720,7 +2752,7 @@ extern "C" {
*
* @param status is the thread wait status.
*/
-RTEMS_INLINE_ROUTINE void _Thread_Timer_remove_and_continue(
+static inline void _Thread_Timer_remove_and_continue(
Thread_Control *the_thread,
Status_Control status
)
diff --git a/cpukit/include/rtems/score/threadmp.h b/cpukit/include/rtems/score/threadmp.h
index 59c2ea675c..30c7c84bd4 100644
--- a/cpukit/include/rtems/score/threadmp.h
+++ b/cpukit/include/rtems/score/threadmp.h
@@ -145,7 +145,7 @@ void _Thread_MP_Free_proxy( Thread_Control *the_thread );
* @retval false The object if is not valid or the thread MP with this object
* id is not remote.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_MP_Is_remote( Objects_Id id )
+static inline bool _Thread_MP_Is_remote( Objects_Id id )
{
Objects_Information *information;
diff --git a/cpukit/include/rtems/score/threadqimpl.h b/cpukit/include/rtems/score/threadqimpl.h
index 95289dc872..44b2010226 100644
--- a/cpukit/include/rtems/score/threadqimpl.h
+++ b/cpukit/include/rtems/score/threadqimpl.h
@@ -166,7 +166,7 @@ void _Thread_queue_Deadlock_fatal( Thread_Control *the_thread );
*
* @param[out] queue_context The thread queue context to initialize.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Context_initialize(
+static inline void _Thread_queue_Context_initialize(
Thread_queue_Context *queue_context
)
{
@@ -191,7 +191,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Context_initialize(
*
* @see _Thread_queue_Enqueue().
*/
-RTEMS_INLINE_ROUTINE void
+static inline void
_Thread_queue_Context_set_thread_state(
Thread_queue_Context *queue_context,
States_Control thread_state
@@ -208,7 +208,7 @@ _Thread_queue_Context_set_thread_state(
*
* @see _Thread_queue_Enqueue().
*/
-RTEMS_INLINE_ROUTINE void
+static inline void
_Thread_queue_Context_set_timeout_ticks(
Thread_queue_Context *queue_context,
Watchdog_Interval ticks
@@ -229,7 +229,7 @@ _Thread_queue_Context_set_timeout_ticks(
*
* @see _Thread_queue_Enqueue().
*/
-RTEMS_INLINE_ROUTINE void
+static inline void
_Thread_queue_Context_set_timeout_argument(
Thread_queue_Context *queue_context,
const void *arg,
@@ -248,7 +248,7 @@ _Thread_queue_Context_set_timeout_argument(
*
* @see _Thread_queue_Enqueue().
*/
-RTEMS_INLINE_ROUTINE void
+static inline void
_Thread_queue_Context_set_enqueue_callout(
Thread_queue_Context *queue_context,
Thread_queue_Enqueue_callout enqueue_callout
@@ -264,7 +264,7 @@ _Thread_queue_Context_set_enqueue_callout(
*
* @see _Thread_queue_Enqueue().
*/
-RTEMS_INLINE_ROUTINE void
+static inline void
_Thread_queue_Context_set_enqueue_do_nothing_extra(
Thread_queue_Context *queue_context
)
@@ -281,7 +281,7 @@ _Thread_queue_Context_set_enqueue_do_nothing_extra(
*
* @see _Thread_queue_Enqueue().
*/
-RTEMS_INLINE_ROUTINE void
+static inline void
_Thread_queue_Context_set_enqueue_timeout_ticks(
Thread_queue_Context *queue_context,
Watchdog_Interval ticks
@@ -304,7 +304,7 @@ _Thread_queue_Context_set_enqueue_timeout_ticks(
*
* @see _Thread_queue_Enqueue().
*/
-RTEMS_INLINE_ROUTINE void
+static inline void
_Thread_queue_Context_set_enqueue_timeout_monotonic_timespec(
Thread_queue_Context *queue_context,
const struct timespec *timeout,
@@ -330,7 +330,7 @@ _Thread_queue_Context_set_enqueue_timeout_monotonic_timespec(
*
* @see _Thread_queue_Enqueue().
*/
-RTEMS_INLINE_ROUTINE void
+static inline void
_Thread_queue_Context_set_enqueue_timeout_realtime_timespec(
Thread_queue_Context *queue_context,
const struct timespec *timeout,
@@ -356,7 +356,7 @@ _Thread_queue_Context_set_enqueue_timeout_realtime_timespec(
*
* @see _Thread_queue_Enqueue().
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_deadlock_callout(
+static inline void _Thread_queue_Context_set_deadlock_callout(
Thread_queue_Context *queue_context,
Thread_queue_Deadlock_callout deadlock_callout
)
@@ -370,7 +370,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_deadlock_callout(
* @param[out] queue_context The thread queue context to clear the priority
* update count.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Context_clear_priority_updates(
+static inline void _Thread_queue_Context_clear_priority_updates(
Thread_queue_Context *queue_context
)
{
@@ -385,7 +385,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Context_clear_priority_updates(
*
* @return The priority update count of @a queue_context.
*/
-RTEMS_INLINE_ROUTINE size_t _Thread_queue_Context_get_priority_updates(
+static inline size_t _Thread_queue_Context_get_priority_updates(
const Thread_queue_Context *queue_context
)
{
@@ -399,7 +399,7 @@ RTEMS_INLINE_ROUTINE size_t _Thread_queue_Context_get_priority_updates(
* update count of.
* @param update_count The priority update count.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Context_restore_priority_updates(
+static inline void _Thread_queue_Context_restore_priority_updates(
Thread_queue_Context *queue_context,
size_t update_count
)
@@ -415,7 +415,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Context_restore_priority_updates(
* array.
* @param the_thread The thread for the priority update.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Context_add_priority_update(
+static inline void _Thread_queue_Context_add_priority_update(
Thread_queue_Context *queue_context,
Thread_Control *the_thread
)
@@ -443,7 +443,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Context_add_priority_update(
* @param[out] queue_context The thread queue context to set the ISR level of.
* @param level The ISR level to set @a queue_context to.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_ISR_level(
+static inline void _Thread_queue_Context_set_ISR_level(
Thread_queue_Context *queue_context,
ISR_Level level
)
@@ -461,7 +461,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_ISR_level(
*
* @return The current processor.
*/
-RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_queue_Dispatch_disable(
+static inline Per_CPU_Control *_Thread_queue_Dispatch_disable(
Thread_queue_Context *queue_context
)
{
@@ -480,7 +480,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_queue_Dispatch_disable(
* objects with multiprocessing (MP) support.
*/
#if defined(RTEMS_MULTIPROCESSING)
-RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_MP_callout(
+static inline void _Thread_queue_Context_set_MP_callout(
Thread_queue_Context *queue_context,
Thread_queue_MP_callout mp_callout
)
@@ -500,7 +500,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_MP_callout(
*
* @param[out] gate The gate to close.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Gate_close(
+static inline void _Thread_queue_Gate_close(
Thread_queue_Gate *gate
)
{
@@ -513,7 +513,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Gate_close(
* @param[in, out] chain The chain to add the gate to.
* @param gate The gate to add to the chain.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Gate_add(
+static inline void _Thread_queue_Gate_add(
Chain_Control *chain,
Thread_queue_Gate *gate
)
@@ -526,7 +526,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Gate_add(
*
* @param[out] gate The gate to open.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Gate_open(
+static inline void _Thread_queue_Gate_open(
Thread_queue_Gate *gate
)
{
@@ -540,7 +540,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Gate_open(
*
* @param gate The gate to wait for.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Gate_wait(
+static inline void _Thread_queue_Gate_wait(
Thread_queue_Gate *gate
)
{
@@ -555,7 +555,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Gate_wait(
*
* @param[out] heads The thread queue heads to initialize.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Heads_initialize(
+static inline void _Thread_queue_Heads_initialize(
Thread_queue_Heads *heads
)
{
@@ -579,7 +579,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Heads_initialize(
* @param[out] queue The thread queue queue to initialize.
* @param name The name for the @a queue.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_initialize(
+static inline void _Thread_queue_Queue_initialize(
Thread_queue_Queue *queue,
const char *name
)
@@ -599,7 +599,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_initialize(
* @param lock_stats The lock statistics.
* @param[out] lock_context The interrupt lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_do_acquire_critical(
+static inline void _Thread_queue_Queue_do_acquire_critical(
Thread_queue_Queue *queue,
#if defined(RTEMS_SMP) && defined(RTEMS_PROFILING)
SMP_lock_Stats *lock_stats,
@@ -635,7 +635,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_do_acquire_critical(
* @param queue The thread queue queue to release in a critical section.
* @param[out] lock_context The interrupt lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_release_critical(
+static inline void _Thread_queue_Queue_release_critical(
Thread_queue_Queue *queue,
ISR_lock_Context *lock_context
)
@@ -657,7 +657,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_release_critical(
* @param queue The thread queue queue to release.
* @param[out] lock_context The interrupt lock context to enable interrupts.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_release(
+static inline void _Thread_queue_Queue_release(
Thread_queue_Queue *queue,
ISR_lock_Context *lock_context
)
@@ -697,7 +697,7 @@ void _Thread_queue_Do_acquire_critical(
ISR_lock_Context *lock_context
);
#else
-RTEMS_INLINE_ROUTINE void _Thread_queue_Do_acquire_critical(
+static inline void _Thread_queue_Do_acquire_critical(
Thread_queue_Control *the_thread_queue,
ISR_lock_Context *lock_context
)
@@ -713,7 +713,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Do_acquire_critical(
* @param the_thread_queue The thread queue control to acquire.
* @param[out] lock_context The interrupt lock context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire_critical(
+static inline void _Thread_queue_Acquire_critical(
Thread_queue_Control *the_thread_queue,
Thread_queue_Context *queue_context
)
@@ -736,7 +736,7 @@ void _Thread_queue_Acquire(
Thread_queue_Context *queue_context
);
#else
-RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire(
+static inline void _Thread_queue_Acquire(
Thread_queue_Control *the_thread_queue,
Thread_queue_Context *queue_context
)
@@ -755,7 +755,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire(
* @retval false The thread queue control is not the owner of the lock.
*/
#if defined(RTEMS_DEBUG)
-RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_lock_owner(
+static inline bool _Thread_queue_Is_lock_owner(
const Thread_queue_Control *the_thread_queue
)
{
@@ -779,7 +779,7 @@ void _Thread_queue_Do_release_critical(
ISR_lock_Context *lock_context
);
#else
-RTEMS_INLINE_ROUTINE void _Thread_queue_Do_release_critical(
+static inline void _Thread_queue_Do_release_critical(
Thread_queue_Control *the_thread_queue,
ISR_lock_Context *lock_context
)
@@ -796,7 +796,7 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Do_release_critical(
* @param the_thread_queue The thread queue control to release.
* @param[out] queue_context The thread queue context.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Release_critical(
+static inline void _Thread_queue_Release_critical(
Thread_queue_Control *the_thread_queue,
Thread_queue_Context *queue_context
)
@@ -819,7 +819,7 @@ void _Thread_queue_Release(
Thread_queue_Context *queue_context
);
#else
-RTEMS_INLINE_ROUTINE void _Thread_queue_Release(
+static inline void _Thread_queue_Release(
Thread_queue_Control *the_thread_queue,
Thread_queue_Context *queue_context
)
@@ -1107,7 +1107,7 @@ void _Thread_queue_Surrender_sticky(
* @retval true @a queue is empty.
* @retval false @a queue is not empty.
*/
-RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_empty(
+static inline bool _Thread_queue_Is_empty(
const Thread_queue_Queue *queue
)
{
@@ -1305,7 +1305,7 @@ void _Thread_queue_Initialize(
*
* @param[out] the_thread_queue The thread queue to destroy.
*/
-RTEMS_INLINE_ROUTINE void _Thread_queue_Destroy(
+static inline void _Thread_queue_Destroy(
Thread_queue_Control *the_thread_queue
)
{
diff --git a/cpukit/include/rtems/score/timestampimpl.h b/cpukit/include/rtems/score/timestampimpl.h
index 22df1dd3a1..fee1994bfd 100644
--- a/cpukit/include/rtems/score/timestampimpl.h
+++ b/cpukit/include/rtems/score/timestampimpl.h
@@ -63,7 +63,7 @@ extern "C" {
* @param _seconds The seconds portion of the timestamp.
* @param _nanoseconds The nanoseconds portion of the timestamp.
*/
-RTEMS_INLINE_ROUTINE void _Timestamp_Set(
+static inline void _Timestamp_Set(
Timestamp_Control *_time,
time_t _seconds,
long _nanoseconds
@@ -86,7 +86,7 @@ RTEMS_INLINE_ROUTINE void _Timestamp_Set(
* @param[out] _time The timestamp instance to zero.
*/
-RTEMS_INLINE_ROUTINE void _Timestamp_Set_to_zero(
+static inline void _Timestamp_Set_to_zero(
Timestamp_Control *_time
)
{
@@ -105,7 +105,7 @@ RTEMS_INLINE_ROUTINE void _Timestamp_Set_to_zero(
* @retval false @a _lhs is greater or equal than @a rhs.
*/
-RTEMS_INLINE_ROUTINE bool _Timestamp_Less_than(
+static inline bool _Timestamp_Less_than(
const Timestamp_Control *_lhs,
const Timestamp_Control *_rhs
)
@@ -125,7 +125,7 @@ RTEMS_INLINE_ROUTINE bool _Timestamp_Less_than(
* @retval false @a _lhs is less or equal than @a _rhs.
*/
-RTEMS_INLINE_ROUTINE bool _Timestamp_Greater_than(
+static inline bool _Timestamp_Greater_than(
const Timestamp_Control *_lhs,
const Timestamp_Control *_rhs
)
@@ -145,7 +145,7 @@ RTEMS_INLINE_ROUTINE bool _Timestamp_Greater_than(
* @retval false @a _lhs is not equal to @a _rhs.
*/
-RTEMS_INLINE_ROUTINE bool _Timestamp_Equal_to(
+static inline bool _Timestamp_Equal_to(
const Timestamp_Control *_lhs,
const Timestamp_Control *_rhs
)
@@ -162,7 +162,7 @@ RTEMS_INLINE_ROUTINE bool _Timestamp_Equal_to(
* @param[in, out] _time The base time to be added to.
* @param _add points The timestamp to add to the first argument.
*/
-RTEMS_INLINE_ROUTINE void _Timestamp_Add_to(
+static inline void _Timestamp_Add_to(
Timestamp_Control *_time,
const Timestamp_Control *_add
)
@@ -181,7 +181,7 @@ RTEMS_INLINE_ROUTINE void _Timestamp_Add_to(
* @param[out] _result Contains the difference between starting and ending
* time after the method call.
*/
-RTEMS_INLINE_ROUTINE void _Timestamp_Subtract(
+static inline void _Timestamp_Subtract(
const Timestamp_Control *_start,
const Timestamp_Control *_end,
Timestamp_Control *_result
@@ -201,7 +201,7 @@ RTEMS_INLINE_ROUTINE void _Timestamp_Subtract(
* @param[out] _ival_percentage The integer portion of the average.
* @param[out] _fval_percentage The thousandths of percentage.
*/
-RTEMS_INLINE_ROUTINE void _Timestamp_Divide(
+static inline void _Timestamp_Divide(
const Timestamp_Control *_lhs,
const Timestamp_Control *_rhs,
uint32_t *_ival_percentage,
@@ -231,7 +231,7 @@ RTEMS_INLINE_ROUTINE void _Timestamp_Divide(
*
* @return The seconds portion of @a _time.
*/
-RTEMS_INLINE_ROUTINE time_t _Timestamp_Get_seconds(
+static inline time_t _Timestamp_Get_seconds(
const Timestamp_Control *_time
)
{
@@ -247,7 +247,7 @@ RTEMS_INLINE_ROUTINE time_t _Timestamp_Get_seconds(
*
* @return The nanoseconds portion of @a _time.
*/
-RTEMS_INLINE_ROUTINE uint32_t _Timestamp_Get_nanoseconds(
+static inline uint32_t _Timestamp_Get_nanoseconds(
const Timestamp_Control *_time
)
{
@@ -267,7 +267,7 @@ RTEMS_INLINE_ROUTINE uint32_t _Timestamp_Get_nanoseconds(
*
* @return The time in nanoseconds.
*/
-RTEMS_INLINE_ROUTINE uint64_t _Timestamp_Get_as_nanoseconds(
+static inline uint64_t _Timestamp_Get_as_nanoseconds(
const Timestamp_Control *_time
)
{
@@ -284,7 +284,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Timestamp_Get_as_nanoseconds(
* @param _timestamp The timestamp.
* @param[out] _timespec The timespec to be filled in by the method.
*/
-RTEMS_INLINE_ROUTINE void _Timestamp_To_timespec(
+static inline void _Timestamp_To_timespec(
const Timestamp_Control *_timestamp,
struct timespec *_timespec
)
@@ -298,7 +298,7 @@ RTEMS_INLINE_ROUTINE void _Timestamp_To_timespec(
* @param _timestamp The timestamp.
* @param[out] _timeval The timeval to be filled in by the method.
*/
-RTEMS_INLINE_ROUTINE void _Timestamp_To_timeval(
+static inline void _Timestamp_To_timeval(
const Timestamp_Control *_timestamp,
struct timeval *_timeval
)
diff --git a/cpukit/include/rtems/score/tls.h b/cpukit/include/rtems/score/tls.h
index f3bcb2c96a..ee4fb9a22e 100644
--- a/cpukit/include/rtems/score/tls.h
+++ b/cpukit/include/rtems/score/tls.h
@@ -241,7 +241,7 @@ static inline void *_TLS_TCB_at_area_begin_initialize( void *tls_area )
{
void *tls_block = (char *) tls_area
+ _TLS_Get_thread_control_block_area_size( (uintptr_t) _TLS_Alignment );
- TLS_Thread_control_block *tcb = tls_area;
+ TLS_Thread_control_block *tcb = (TLS_Thread_control_block *) tls_area;
uintptr_t aligned_size = _TLS_Align_up( (uintptr_t) _TLS_Size );
TLS_Dynamic_thread_vector *dtv = (TLS_Dynamic_thread_vector *)
((char *) tls_block + aligned_size);
diff --git a/cpukit/include/rtems/score/todimpl.h b/cpukit/include/rtems/score/todimpl.h
index 5d1e0613a1..ce75ff681f 100644
--- a/cpukit/include/rtems/score/todimpl.h
+++ b/cpukit/include/rtems/score/todimpl.h
@@ -374,7 +374,7 @@ static inline uint32_t _TOD_Seconds_since_epoch( void )
*
* @param[out] time The timeval to be filled in by the method.
*/
-RTEMS_INLINE_ROUTINE void _TOD_Get_timeval(
+static inline void _TOD_Get_timeval(
struct timeval *time
)
{
@@ -402,7 +402,7 @@ Status_Control _TOD_Adjust(
* @retval true The time is set.
* @retval false The time is not set.
*/
-RTEMS_INLINE_ROUTINE bool _TOD_Is_set( void )
+static inline bool _TOD_Is_set( void )
{
return _TOD.is_set;
}
diff --git a/cpukit/include/rtems/score/userextimpl.h b/cpukit/include/rtems/score/userextimpl.h
index bedc82606a..70a612f402 100644
--- a/cpukit/include/rtems/score/userextimpl.h
+++ b/cpukit/include/rtems/score/userextimpl.h
@@ -123,7 +123,7 @@ void _User_extensions_Add_set(
*
* @param extension The user extension to add.
*/
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set(
+static inline void _User_extensions_Add_API_set(
User_extensions_Control *extension
)
{
@@ -136,7 +136,7 @@ RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set(
* @param[in, out] extension The user extension to add.
* @param extension_table Is set as callouts for @a extension.
*/
-RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table(
+static inline void _User_extensions_Add_set_with_table(
User_extensions_Control *extension,
const User_extensions_Table *extension_table
)
diff --git a/cpukit/include/rtems/score/watchdogimpl.h b/cpukit/include/rtems/score/watchdogimpl.h
index 65259674ae..df479aeeed 100644
--- a/cpukit/include/rtems/score/watchdogimpl.h
+++ b/cpukit/include/rtems/score/watchdogimpl.h
@@ -114,7 +114,7 @@ typedef enum {
*
* @param[out] header The header to initialize.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Header_initialize(
+static inline void _Watchdog_Header_initialize(
Watchdog_Header *header
)
{
@@ -129,7 +129,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Header_initialize(
*
* @return The first of @a header.
*/
-RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Header_first(
+static inline Watchdog_Control *_Watchdog_Header_first(
const Watchdog_Header *header
)
{
@@ -141,7 +141,7 @@ RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Header_first(
*
* @param header The watchdog header to destroy.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Header_destroy(
+static inline void _Watchdog_Header_destroy(
Watchdog_Header *header
)
{
@@ -163,7 +163,7 @@ void _Watchdog_Tick( struct Per_CPU_Control *cpu );
*
* @return The RB_COLOR of @a the_watchdog.
*/
-RTEMS_INLINE_ROUTINE Watchdog_State _Watchdog_Get_state(
+static inline Watchdog_State _Watchdog_Get_state(
const Watchdog_Control *the_watchdog
)
{
@@ -176,7 +176,7 @@ RTEMS_INLINE_ROUTINE Watchdog_State _Watchdog_Get_state(
* @param[out] the_watchdog The watchdog to set the state of.
* @param state The state to set the watchdog to.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Set_state(
+static inline void _Watchdog_Set_state(
Watchdog_Control *the_watchdog,
Watchdog_State state
)
@@ -191,7 +191,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Set_state(
*
* @return The cpu of the watchdog.
*/
-RTEMS_INLINE_ROUTINE Per_CPU_Control *_Watchdog_Get_CPU(
+static inline Per_CPU_Control *_Watchdog_Get_CPU(
const Watchdog_Control *the_watchdog
)
{
@@ -208,7 +208,7 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Watchdog_Get_CPU(
* @param[out] the_watchdog The watchdog to set the cpu of.
* @param cpu The cpu to be set as @a the_watchdog's cpu.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Set_CPU(
+static inline void _Watchdog_Set_CPU(
Watchdog_Control *the_watchdog,
Per_CPU_Control *cpu
)
@@ -228,7 +228,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Set_CPU(
*
* @param[out] the_watchdog The uninitialized watchdog.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Preinitialize(
+static inline void _Watchdog_Preinitialize(
Watchdog_Control *the_watchdog,
Per_CPU_Control *cpu
)
@@ -250,7 +250,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Preinitialize(
* @param[out] the_watchdog The watchdog to initialize.
* @param routing The service routine for @a the_watchdog.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Initialize(
+static inline void _Watchdog_Initialize(
Watchdog_Control *the_watchdog,
Watchdog_Service_routine_entry routine
)
@@ -332,7 +332,7 @@ void _Watchdog_Remove(
* @retval 0 The now time is greater than or equal to the expiration time of
* the watchdog.
*/
-RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Cancel(
+static inline uint64_t _Watchdog_Cancel(
Watchdog_Header *header,
Watchdog_Control *the_watchdog,
uint64_t now
@@ -362,7 +362,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Cancel(
* @retval true The watchdog is scheduled.
* @retval false The watchdog is inactive.
*/
-RTEMS_INLINE_ROUTINE bool _Watchdog_Is_scheduled(
+static inline bool _Watchdog_Is_scheduled(
const Watchdog_Control *the_watchdog
)
{
@@ -381,7 +381,7 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_scheduled(
* @param first is the current first watchdog which should be removed
* afterwards.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Next_first(
+static inline void _Watchdog_Next_first(
Watchdog_Header *header,
const Watchdog_Control *first
)
@@ -450,7 +450,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Next_first(
* @retval true The timespec is a valid timespec.
* @retval false The timespec is invalid.
*/
-RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_timespec(
+static inline bool _Watchdog_Is_valid_timespec(
const struct timespec *ts
)
{
@@ -466,7 +466,7 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_timespec(
* @retval true The timespec is a valid interval timespec.
* @retval false The timespec is invalid.
*/
-RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_interval_timespec(
+static inline bool _Watchdog_Is_valid_interval_timespec(
const struct timespec *ts
)
{
@@ -483,7 +483,7 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_interval_timespec(
* @retval pointer Pointer to the now timespec.
* @retval NULL @a delta is not a valid interval timespec.
*/
-RTEMS_INLINE_ROUTINE const struct timespec * _Watchdog_Future_timespec(
+static inline const struct timespec * _Watchdog_Future_timespec(
struct timespec *now,
const struct timespec *delta
)
@@ -521,7 +521,7 @@ RTEMS_INLINE_ROUTINE const struct timespec * _Watchdog_Future_timespec(
* @retval true @a ts is too far in the future.
* @retval false @a ts is not too far in the future.
*/
-RTEMS_INLINE_ROUTINE bool _Watchdog_Is_far_future_timespec(
+static inline bool _Watchdog_Is_far_future_timespec(
const struct timespec *ts
)
{
@@ -535,7 +535,7 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_far_future_timespec(
*
* @return @a seconds converted to ticks.
*/
-RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_seconds(
+static inline uint64_t _Watchdog_Ticks_from_seconds(
uint32_t seconds
)
{
@@ -553,7 +553,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_seconds(
*
* @return @a ts converted to ticks.
*/
-RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_timespec(
+static inline uint64_t _Watchdog_Ticks_from_timespec(
const struct timespec *ts
)
{
@@ -577,7 +577,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_timespec(
*
* @param[out] ts is the timespec to return the converted ticks.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Ticks_to_timespec(
+static inline void _Watchdog_Ticks_to_timespec(
uint64_t ticks,
struct timespec *ts
)
@@ -593,7 +593,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Ticks_to_timespec(
*
* @return @a sbt converted to ticks.
*/
-RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_sbintime( int64_t sbt )
+static inline uint64_t _Watchdog_Ticks_from_sbintime( int64_t sbt )
{
uint64_t ticks = ( sbt >> 32 ) << WATCHDOG_BITS_FOR_1E9_NANOSECONDS;
@@ -608,7 +608,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_sbintime( int64_t sbt )
* @param cpu The cpu to acquire the watchdog lock of.
* @param lock_context The lock context.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_acquire_critical(
+static inline void _Watchdog_Per_CPU_acquire_critical(
Per_CPU_Control *cpu,
ISR_lock_Context *lock_context
)
@@ -622,7 +622,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_acquire_critical(
* @param cpu The cpu to release the watchdog lock of.
* @param lock_context The lock context.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_release_critical(
+static inline void _Watchdog_Per_CPU_release_critical(
Per_CPU_Control *cpu,
ISR_lock_Context *lock_context
)
@@ -640,7 +640,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_release_critical(
*
* @return The new expiration time of the watchdog.
*/
-RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_ticks(
+static inline uint64_t _Watchdog_Per_CPU_insert_ticks(
Watchdog_Control *the_watchdog,
Per_CPU_Control *cpu,
Watchdog_Interval ticks
@@ -672,7 +672,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_ticks(
*
* @return The expiration time of the watchdog.
*/
-RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert(
+static inline uint64_t _Watchdog_Per_CPU_insert(
Watchdog_Control *the_watchdog,
Per_CPU_Control *cpu,
Watchdog_Header *header,
@@ -696,7 +696,7 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert(
* @param cpu The cpu to remove the watchdog from.
* @param[in, out] The scheduled watchdogs.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove(
+static inline void _Watchdog_Per_CPU_remove(
Watchdog_Control *the_watchdog,
Per_CPU_Control *cpu,
Watchdog_Header *header
@@ -717,7 +717,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove(
*
* @param[in, out] the_watchdog The watchdog to remove.
*/
-RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_ticks(
+static inline void _Watchdog_Per_CPU_remove_ticks(
Watchdog_Control *the_watchdog
)
{
diff --git a/cpukit/include/rtems/score/wkspaceinitmulti.h b/cpukit/include/rtems/score/wkspaceinitmulti.h
index 18520199ce..44a6b08445 100644
--- a/cpukit/include/rtems/score/wkspaceinitmulti.h
+++ b/cpukit/include/rtems/score/wkspaceinitmulti.h
@@ -57,7 +57,7 @@ extern "C" {
* memory area via _Memory_Get() to implement
* _Workspace_Handler_initialization().
*/
-RTEMS_INLINE_ROUTINE void _Workspace_Initialize_for_multiple_areas( void )
+static inline void _Workspace_Initialize_for_multiple_areas( void )
{
const Memory_Information *mem;
Heap_Initialization_or_extend_handler init_or_extend;
diff --git a/cpukit/include/rtems/score/wkspaceinitone.h b/cpukit/include/rtems/score/wkspaceinitone.h
index ce26a1cf8f..47ea4efb5e 100644
--- a/cpukit/include/rtems/score/wkspaceinitone.h
+++ b/cpukit/include/rtems/score/wkspaceinitone.h
@@ -57,7 +57,7 @@ extern "C" {
* This implementation should be used by BSPs which provide exactly one memory
* area via _Memory_Get() to implement _Workspace_Handler_initialization().
*/
-RTEMS_INLINE_ROUTINE void _Workspace_Initialize_for_one_area( void )
+static inline void _Workspace_Initialize_for_one_area( void )
{
uintptr_t page_size;
uintptr_t wkspace_size;
diff --git a/cpukit/include/rtems/shellconfig.h b/cpukit/include/rtems/shellconfig.h
index b09d5ae1d3..a013840ee7 100644
--- a/cpukit/include/rtems/shellconfig.h
+++ b/cpukit/include/rtems/shellconfig.h
@@ -110,6 +110,7 @@ extern rtems_shell_cmd_t rtems_shell_STACKUSE_Command;
extern rtems_shell_cmd_t rtems_shell_PERIODUSE_Command;
extern rtems_shell_cmd_t rtems_shell_PROFREPORT_Command;
extern rtems_shell_cmd_t rtems_shell_WKSPACE_INFO_Command;
+extern rtems_shell_cmd_t rtems_shell_RTEMS_Command;
extern rtems_shell_cmd_t rtems_shell_MALLOC_INFO_Command;
extern rtems_shell_cmd_t rtems_shell_RTRACE_Command;
#if RTEMS_NETWORKING
@@ -489,6 +490,11 @@ extern rtems_shell_alias_t * const rtems_shell_Initial_aliases[];
defined(CONFIGURE_SHELL_COMMAND_WKSPACE_INFO)
&rtems_shell_WKSPACE_INFO_Command,
#endif
+ #if (defined(CONFIGURE_SHELL_COMMANDS_ALL) && \
+ !defined(CONFIGURE_SHELL_NO_COMMAND_RTEMS)) || \
+ defined(CONFIGURE_SHELL_COMMAND_RTEMS)
+ &rtems_shell_RTEMS_Command,
+ #endif
/*
* Malloc family commands
diff --git a/cpukit/include/rtems/termiostypes.h b/cpukit/include/rtems/termiostypes.h
index 33fcf4b2da..67f3461b1f 100644
--- a/cpukit/include/rtems/termiostypes.h
+++ b/cpukit/include/rtems/termiostypes.h
@@ -129,7 +129,7 @@ void rtems_termios_device_lock_release_default(
* string persistent throughout the life time of this lock. The name is only
* used if profiling is enabled.
*/
-RTEMS_INLINE_ROUTINE void rtems_termios_device_context_initialize(
+static inline void rtems_termios_device_context_initialize(
rtems_termios_device_context *context,
const char *name
)
@@ -448,7 +448,7 @@ rtems_status_code rtems_termios_device_install(
*
* @param[in] tty The Termios control.
*/
-RTEMS_INLINE_ROUTINE void *rtems_termios_get_device_context(
+static inline void *rtems_termios_get_device_context(
const rtems_termios_tty *tty
)
{
@@ -462,7 +462,7 @@ RTEMS_INLINE_ROUTINE void *rtems_termios_get_device_context(
* @param[in] lock_context The local interrupt lock context for an acquire and
* release pair.
*/
-RTEMS_INLINE_ROUTINE void rtems_termios_device_lock_acquire(
+static inline void rtems_termios_device_lock_acquire(
rtems_termios_device_context *context,
rtems_interrupt_lock_context *lock_context
)
@@ -477,7 +477,7 @@ RTEMS_INLINE_ROUTINE void rtems_termios_device_lock_acquire(
* @param[in] lock_context The local interrupt lock context for an acquire and
* release pair.
*/
-RTEMS_INLINE_ROUTINE void rtems_termios_device_lock_release(
+static inline void rtems_termios_device_lock_release(
rtems_termios_device_context *context,
rtems_interrupt_lock_context *lock_context
)
diff --git a/cpukit/include/rtems/test-info.h b/cpukit/include/rtems/test-info.h
index 1bc963249c..3b839533c2 100644
--- a/cpukit/include/rtems/test-info.h
+++ b/cpukit/include/rtems/test-info.h
@@ -70,7 +70,7 @@ void rtems_test_fatal_extension(
* @brief Initial extension for tests.
*/
#define RTEMS_TEST_INITIAL_EXTENSION \
- { NULL, NULL, NULL, NULL, NULL, NULL, NULL, rtems_test_fatal_extension }
+ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, rtems_test_fatal_extension, NULL }
/**
* @brief Test states.
@@ -108,14 +108,14 @@ typedef enum
/**
* @brief Prints a begin of test message using printf().
*
- * @returns As specified by printf().
+ * @return As specified by printf().
*/
int rtems_test_begin(const char* name, const RTEMS_TEST_STATE state);
/**
* @brief Prints an end of test message using printf().
*
- * @returns As specified by printf().
+ * @return As specified by printf().
*/
int rtems_test_end(const char* name);
@@ -128,7 +128,7 @@ RTEMS_NO_RETURN void rtems_test_exit(int status);
/**
* @brief Prints via the RTEMS printer.
*
- * @returns As specified by printf().
+ * @return As specified by printf().
*/
int rtems_test_printf(const char* format, ...) RTEMS_PRINTFLIKE(1, 2);
@@ -331,6 +331,12 @@ RTEMS_NO_RETURN void rtems_test_run(
const RTEMS_TEST_STATE state
);
+/**
+ * @brief Dumps the gcov information as a base64 encoded gcfn and gcda data
+ * stream using rtems_put_char().
+ */
+void rtems_test_gcov_dump_info( void );
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h
index 305fe3f5f3..aa6b4f88b2 100644
--- a/cpukit/include/rtems/test.h
+++ b/cpukit/include/rtems/test.h
@@ -187,42 +187,42 @@ extern const T_check_context T_special;
T_flags_true(flags, \
(a) != (T_VA_ARGS_FIRST(__VA_ARGS__)) T_VA_ARGS_MORE(__VA_ARGS__))
-void T_check_eq_ptr(const T_check_context_msg *, const void *, const void *);
+void T_check_eq_ptr(const T_check_context_msg *, uintptr_t, uintptr_t);
#define T_flags_eq_ptr(a, e, flags, sa, se) \
{ \
static const T_check_context_msg T_check_instance = { \
{ T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, \
sa " == " se }; \
- T_check_eq_ptr(&T_check_instance, a, e); \
+ T_check_eq_ptr(&T_check_instance, (uintptr_t)a, (uintptr_t)e); \
}
-void T_check_ne_ptr(const T_check_context_msg *, const void *, const void *);
+void T_check_ne_ptr(const T_check_context_msg *, uintptr_t, uintptr_t);
#define T_flags_ne_ptr(a, e, flags, sa, se) \
{ \
static const T_check_context_msg T_check_instance = { \
{ T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, \
sa " != " se }; \
- T_check_ne_ptr(&T_check_instance, a, e); \
+ T_check_ne_ptr(&T_check_instance, (uintptr_t)a, (uintptr_t)e); \
}
-void T_check_null(const T_check_context_msg *, const void *);
+void T_check_null(const T_check_context_msg *, uintptr_t);
#define T_flags_null(a, flags, sa) \
{ \
static const T_check_context_msg T_check_instance = { \
{ T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, sa }; \
- T_check_null(&T_check_instance, a); \
+ T_check_null(&T_check_instance, (uintptr_t)a); \
}
-void T_check_not_null(const T_check_context_msg *, const void *);
+void T_check_not_null(const T_check_context_msg *, uintptr_t);
#define T_flags_not_null(a, flags, sa) \
{ \
static const T_check_context_msg T_check_instance = { \
{ T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, sa }; \
- T_check_not_null(&T_check_instance, a); \
+ T_check_not_null(&T_check_instance, (uintptr_t)a); \
}
void T_check_eq_mem(const T_check_context_msg *, const void *, const void *,
@@ -2464,6 +2464,8 @@ T_thread_switch_log *T_thread_switch_record_10(T_thread_switch_log_10 *);
void T_report_hash_sha256(T_event, const char *);
+void T_report_hash_sha256_update(char c);
+
void T_check_heap(T_event, const char *);
#ifdef __rtems__
diff --git a/cpukit/include/rtems/timecounter.h b/cpukit/include/rtems/timecounter.h
index 2dc94bad4e..4ca17a6708 100644
--- a/cpukit/include/rtems/timecounter.h
+++ b/cpukit/include/rtems/timecounter.h
@@ -86,7 +86,7 @@ extern "C" {
* }
* @endcode
*/
-RTEMS_INLINE_ROUTINE void rtems_timecounter_install(
+static inline void rtems_timecounter_install(
struct timecounter *tc
)
{
@@ -96,7 +96,7 @@ RTEMS_INLINE_ROUTINE void rtems_timecounter_install(
/**
* @copydoc _Timecounter_Tick()
*/
-RTEMS_INLINE_ROUTINE void rtems_timecounter_tick(void)
+static inline void rtems_timecounter_tick(void)
{
_Timecounter_Tick();
}
@@ -219,7 +219,7 @@ void rtems_timecounter_simple_install(
*
* @return The scaled value.
*/
-RTEMS_INLINE_ROUTINE uint32_t rtems_timecounter_simple_scale(
+static inline uint32_t rtems_timecounter_simple_scale(
const rtems_timecounter_simple *tc,
uint32_t value
)
@@ -235,7 +235,7 @@ RTEMS_INLINE_ROUTINE uint32_t rtems_timecounter_simple_scale(
* @param[in] at_tick The method to perform work under timecounter lock
* protection at this tick, e.g. clear a pending flag.
*/
-RTEMS_INLINE_ROUTINE void rtems_timecounter_simple_downcounter_tick(
+static inline void rtems_timecounter_simple_downcounter_tick(
rtems_timecounter_simple *tc,
rtems_timecounter_simple_get get,
rtems_timecounter_simple_at_tick at_tick
@@ -264,7 +264,7 @@ RTEMS_INLINE_ROUTINE void rtems_timecounter_simple_downcounter_tick(
* @param[in] at_tick The method to perform work under timecounter lock
* protection at this tick, e.g. clear a pending flag.
*/
-RTEMS_INLINE_ROUTINE void rtems_timecounter_simple_upcounter_tick(
+static inline void rtems_timecounter_simple_upcounter_tick(
rtems_timecounter_simple *tc,
rtems_timecounter_simple_get get,
rtems_timecounter_simple_at_tick at_tick
@@ -291,7 +291,7 @@ RTEMS_INLINE_ROUTINE void rtems_timecounter_simple_upcounter_tick(
* @param[in] is_pending The method which indicates if the interrupt of the
* simple timecounter is pending.
*/
-RTEMS_INLINE_ROUTINE uint32_t rtems_timecounter_simple_downcounter_get(
+static inline uint32_t rtems_timecounter_simple_downcounter_get(
struct timecounter *tc_base,
rtems_timecounter_simple_get get,
rtems_timecounter_simple_is_pending is_pending
@@ -322,7 +322,7 @@ RTEMS_INLINE_ROUTINE uint32_t rtems_timecounter_simple_downcounter_get(
* @param[in] is_pending The method which indicates if the interrupt of the
* simple timecounter is pending.
*/
-RTEMS_INLINE_ROUTINE uint32_t rtems_timecounter_simple_upcounter_get(
+static inline uint32_t rtems_timecounter_simple_upcounter_get(
struct timecounter *tc_base,
rtems_timecounter_simple_get get,
rtems_timecounter_simple_is_pending is_pending
diff --git a/cpukit/include/rtems/timespec.h b/cpukit/include/rtems/timespec.h
index 879b106d7b..8d49a8e6c2 100644
--- a/cpukit/include/rtems/timespec.h
+++ b/cpukit/include/rtems/timespec.h
@@ -64,7 +64,7 @@ extern "C" {
* @retval true The timespec is valid.
* @retval false The timespec is not valid.
*/
-RTEMS_INLINE_ROUTINE bool rtems_timespec_is_valid(
+static inline bool rtems_timespec_is_valid(
const struct timespec *time
)
{
@@ -83,7 +83,7 @@ RTEMS_INLINE_ROUTINE bool rtems_timespec_is_valid(
* @retval false @a lhs is not less than @a rhs.
*
*/
-RTEMS_INLINE_ROUTINE bool rtems_timespec_less_than(
+static inline bool rtems_timespec_less_than(
const struct timespec *lhs,
const struct timespec *rhs
)
@@ -102,7 +102,7 @@ RTEMS_INLINE_ROUTINE bool rtems_timespec_less_than(
*
* @return This method returns the number of seconds @a time increased by.
*/
-RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_add_to(
+static inline uint32_t rtems_timespec_add_to(
struct timespec *time,
const struct timespec *add
)
@@ -120,7 +120,7 @@ RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_add_to(
*
* @return This method returns the number of ticks computed.
*/
-RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_to_ticks(
+static inline uint32_t rtems_timespec_to_ticks(
const struct timespec *time
)
{
@@ -137,7 +137,7 @@ RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_to_ticks(
* @param[in] ticks is the number of ticks to convert
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_from_ticks(
+static inline void rtems_timespec_from_ticks(
uint32_t ticks,
struct timespec *time
)
@@ -157,7 +157,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_from_ticks(
*
* @return This method fills in @a result.
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_subtract(
+static inline void rtems_timespec_subtract(
const struct timespec *start,
const struct timespec *end,
struct timespec *result
@@ -179,7 +179,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_subtract(
*
* @return This method fills in @a result.
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_divide_by_integer(
+static inline void rtems_timespec_divide_by_integer(
const struct timespec *time,
uint32_t iterations,
struct timespec *result
@@ -201,7 +201,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_divide_by_integer(
*
* @return This method fills in @a result.
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_divide(
+static inline void rtems_timespec_divide(
const struct timespec *lhs,
const struct timespec *rhs,
uint32_t *ival_percentage,
@@ -221,7 +221,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_divide(
* @param[in] _seconds is the seconds portion of the timespec
* @param[in] _nanoseconds is the nanoseconds portion of the timespec
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_set(
+static inline void rtems_timespec_set(
struct timespec *_time,
time_t _seconds,
uint32_t _nanoseconds
@@ -238,7 +238,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_set(
*
* @param[in] _time points to the timespec instance to zero.
*/
-RTEMS_INLINE_ROUTINE void rtems_timespec_zero(
+static inline void rtems_timespec_zero(
struct timespec *_time
)
{
@@ -254,7 +254,7 @@ RTEMS_INLINE_ROUTINE void rtems_timespec_zero(
*
* @return The seconds portion of @a _time.
*/
-RTEMS_INLINE_ROUTINE time_t rtems_timespec_get_seconds(
+static inline time_t rtems_timespec_get_seconds(
struct timespec *_time
)
{
@@ -270,7 +270,7 @@ RTEMS_INLINE_ROUTINE time_t rtems_timespec_get_seconds(
*
* @return The nanoseconds portion of @a _time.
*/
-RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_get_nanoseconds(
+static inline uint32_t rtems_timespec_get_nanoseconds(
struct timespec *_time
)
{
@@ -288,7 +288,7 @@ RTEMS_INLINE_ROUTINE uint32_t rtems_timespec_get_nanoseconds(
* @retval true @a _lhs is greater than @a _rhs.
* @retval false @a _lhs is not greater than @a _rhs.
*/
-RTEMS_INLINE_ROUTINE bool rtems_timespec_greater_than(
+static inline bool rtems_timespec_greater_than(
const struct timespec *_lhs,
const struct timespec *_rhs
)
@@ -306,7 +306,7 @@ RTEMS_INLINE_ROUTINE bool rtems_timespec_greater_than(
* @retval true @a lhs is equal to @a rhs.
* @retval false @a lhs is not equal to @a rhs.
*/
-RTEMS_INLINE_ROUTINE bool rtems_timespec_equal_to(
+static inline bool rtems_timespec_equal_to(
const struct timespec *lhs,
const struct timespec *rhs
)
diff --git a/cpukit/include/sha224.h b/cpukit/include/sha224.h
new file mode 100644
index 0000000000..3085c7fcb2
--- /dev/null
+++ b/cpukit/include/sha224.h
@@ -0,0 +1,62 @@
+/*-
+ * Copyright 2005 Colin Percival
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SHA224_H_
+#define _SHA224_H_
+
+#ifndef _KERNEL
+#include <sys/types.h>
+#endif
+
+#define SHA224_BLOCK_LENGTH 64
+#define SHA224_DIGEST_LENGTH 28
+#define SHA224_DIGEST_STRING_LENGTH (SHA224_DIGEST_LENGTH * 2 + 1)
+
+typedef struct SHA224Context {
+ uint32_t state[8];
+ uint64_t count;
+ uint8_t buf[SHA224_BLOCK_LENGTH];
+} SHA224_CTX;
+
+__BEGIN_DECLS
+
+void SHA224_Init(SHA224_CTX *);
+void SHA224_Update(SHA224_CTX *, const void *, size_t);
+void SHA224_Final(unsigned char [__min_size(SHA224_DIGEST_LENGTH)],
+ SHA224_CTX *);
+#ifndef _KERNEL
+char *SHA224_End(SHA224_CTX *, char *);
+char *SHA224_Data(const void *, unsigned int, char *);
+char *SHA224_Fd(int, char *);
+char *SHA224_FdChunk(int, char *, off_t, off_t);
+char *SHA224_File(const char *, char *);
+char *SHA224_FileChunk(const char *, char *, off_t, off_t);
+#endif
+__END_DECLS
+
+#endif /* !_SHA224_H_ */
diff --git a/cpukit/include/sha256.h b/cpukit/include/sha256.h
index 1b6a4f4c57..f612713f3d 100644
--- a/cpukit/include/sha256.h
+++ b/cpukit/include/sha256.h
@@ -29,22 +29,32 @@
#ifndef _SHA256_H_
#define _SHA256_H_
+#ifndef _KERNEL
#include <sys/types.h>
+#endif
+
+#define SHA256_BLOCK_LENGTH 64
+#define SHA256_DIGEST_LENGTH 32
+#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1)
typedef struct SHA256Context {
uint32_t state[8];
uint64_t count;
- unsigned char buf[64];
+ uint8_t buf[SHA256_BLOCK_LENGTH];
} SHA256_CTX;
__BEGIN_DECLS
+
void SHA256_Init(SHA256_CTX *);
void SHA256_Update(SHA256_CTX *, const void *, size_t);
-void SHA256_Final(unsigned char [32], SHA256_CTX *);
+void SHA256_Final(unsigned char [__min_size(SHA256_DIGEST_LENGTH)],
+ SHA256_CTX *);
+#ifndef _KERNEL
char *SHA256_End(SHA256_CTX *, char *);
+char *SHA256_Data(const void *, unsigned int, char *);
char *SHA256_File(const char *, char *);
char *SHA256_FileChunk(const char *, char *, off_t, off_t);
-char *SHA256_Data(const void *, unsigned int, char *);
+#endif
__END_DECLS
#endif /* !_SHA256_H_ */
diff --git a/cpukit/include/sha384.h b/cpukit/include/sha384.h
new file mode 100644
index 0000000000..4306d4195b
--- /dev/null
+++ b/cpukit/include/sha384.h
@@ -0,0 +1,61 @@
+/*-
+ * Copyright 2005 Colin Percival
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SHA384_H_
+#define _SHA384_H_
+
+#ifndef _KERNEL
+#include <sys/types.h>
+#endif
+
+#define SHA384_BLOCK_LENGTH 128
+#define SHA384_DIGEST_LENGTH 48
+#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1)
+
+typedef struct SHA384Context {
+ uint64_t state[8];
+ uint64_t count[2];
+ uint8_t buf[SHA384_BLOCK_LENGTH];
+} SHA384_CTX;
+
+__BEGIN_DECLS
+
+void SHA384_Init(SHA384_CTX *);
+void SHA384_Update(SHA384_CTX *, const void *, size_t);
+void SHA384_Final(unsigned char [__min_size(SHA384_DIGEST_LENGTH)],
+ SHA384_CTX *);
+#ifndef _KERNEL
+char *SHA384_End(SHA384_CTX *, char *);
+char *SHA384_Data(const void *, unsigned int, char *);
+char *SHA384_File(const char *, char *);
+char *SHA384_FileChunk(const char *, char *, off_t, off_t);
+#endif
+
+__END_DECLS
+
+#endif /* !_SHA384_H_ */
diff --git a/cpukit/include/sha512.h b/cpukit/include/sha512.h
index 8998f4c5bf..89fbe0516e 100644
--- a/cpukit/include/sha512.h
+++ b/cpukit/include/sha512.h
@@ -29,22 +29,33 @@
#ifndef _SHA512_H_
#define _SHA512_H_
+#ifndef _KERNEL
#include <sys/types.h>
+#endif
+
+#define SHA512_BLOCK_LENGTH 128
+#define SHA512_DIGEST_LENGTH 64
+#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
typedef struct SHA512Context {
uint64_t state[8];
uint64_t count[2];
- unsigned char buf[128];
+ uint8_t buf[SHA512_BLOCK_LENGTH];
} SHA512_CTX;
__BEGIN_DECLS
+
void SHA512_Init(SHA512_CTX *);
void SHA512_Update(SHA512_CTX *, const void *, size_t);
-void SHA512_Final(unsigned char [64], SHA512_CTX *);
+void SHA512_Final(unsigned char [__min_size(SHA512_DIGEST_LENGTH)],
+ SHA512_CTX *);
+#ifndef _KERNEL
char *SHA512_End(SHA512_CTX *, char *);
+char *SHA512_Data(const void *, unsigned int, char *);
char *SHA512_File(const char *, char *);
char *SHA512_FileChunk(const char *, char *, off_t, off_t);
-char *SHA512_Data(const void *, unsigned int, char *);
+#endif
+
__END_DECLS
#endif /* !_SHA512_H_ */
diff --git a/cpukit/include/sha512t.h b/cpukit/include/sha512t.h
new file mode 100644
index 0000000000..f48606a393
--- /dev/null
+++ b/cpukit/include/sha512t.h
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 2015 Allan Jude <allanjude@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SHA512T_H_
+#define _SHA512T_H_
+
+#include "sha512.h"
+
+#ifndef _KERNEL
+#include <sys/types.h>
+#endif
+
+#define SHA512_224_DIGEST_LENGTH 28
+#define SHA512_224_DIGEST_STRING_LENGTH (SHA512_224_DIGEST_LENGTH * 2 + 1)
+#define SHA512_256_DIGEST_LENGTH 32
+#define SHA512_256_DIGEST_STRING_LENGTH (SHA512_256_DIGEST_LENGTH * 2 + 1)
+
+__BEGIN_DECLS
+
+void SHA512_224_Init(SHA512_CTX *);
+void SHA512_224_Update(SHA512_CTX *, const void *, size_t);
+void SHA512_224_Final(unsigned char [__min_size(SHA512_224_DIGEST_LENGTH)],
+ SHA512_CTX *);
+#ifndef _KERNEL
+char *SHA512_224_End(SHA512_CTX *, char *);
+char *SHA512_224_Data(const void *, unsigned int, char *);
+char *SHA512_224_File(const char *, char *);
+char *SHA512_224_FileChunk(const char *, char *, off_t, off_t);
+#endif
+void SHA512_256_Init(SHA512_CTX *);
+void SHA512_256_Update(SHA512_CTX *, const void *, size_t);
+void SHA512_256_Final(unsigned char [__min_size(SHA512_256_DIGEST_LENGTH)],
+ SHA512_CTX *);
+#ifndef _KERNEL
+char *SHA512_256_End(SHA512_CTX *, char *);
+char *SHA512_256_Data(const void *, unsigned int, char *);
+char *SHA512_256_File(const char *, char *);
+char *SHA512_256_FileChunk(const char *, char *, off_t, off_t);
+#endif
+
+__END_DECLS
+
+#endif /* !_SHA512T_H_ */
diff --git a/cpukit/include/sys/exec_elf.h b/cpukit/include/sys/exec_elf.h
index 4242415f54..dc56237f16 100644
--- a/cpukit/include/sys/exec_elf.h
+++ b/cpukit/include/sys/exec_elf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_elf.h,v 1.102 2010/03/01 11:27:29 skrll Exp $ */
+/* $NetBSD: exec_elf.h,v 1.168 2020/10/19 19:33:02 christos Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@
#include <sys/types.h>
#else
#include <inttypes.h>
+#include <stddef.h>
#endif /* _KERNEL || _STANDALONE */
#if defined(ELFSIZE)
@@ -60,49 +61,41 @@
#include <machine/elf_machdep.h>
#endif
-typedef uint8_t Elf_Byte;
-
-typedef uint32_t Elf32_Addr;
-#define ELF32_FSZ_ADDR 4
-typedef uint32_t Elf32_Off;
-typedef int32_t Elf32_SOff;
-#define ELF32_FSZ_OFF 4
-typedef int32_t Elf32_Sword;
-#define ELF32_FSZ_SWORD 4
-typedef uint32_t Elf32_Word;
-#define ELF32_FSZ_WORD 4
-typedef uint16_t Elf32_Half;
-#define ELF32_FSZ_HALF 2
-typedef uint64_t Elf32_Lword;
-#define ELF32_FSZ_LWORD 8
-
-typedef uint64_t Elf64_Addr;
-#define ELF64_FSZ_ADDR 8
-typedef uint64_t Elf64_Off;
-typedef int64_t Elf64_SOff;
-#define ELF64_FSZ_OFF 8
-typedef int32_t Elf64_Shalf;
-#define ELF64_FSZ_SHALF 4
-
-#ifndef ELF64_FSZ_SWORD
-typedef int32_t Elf64_Sword;
-#define ELF64_FSZ_SWORD 4
-#endif /* ELF64_FSZ_SWORD */
-#ifndef ELF64_FSZ_WORD
-typedef uint32_t Elf64_Word;
-#define ELF64_FSZ_WORD 4
-#endif /* ELF64_FSZ_WORD */
-
-typedef int64_t Elf64_Sxword;
-#define ELF64_FSZ_SXWORD 8
-typedef uint64_t Elf64_Xword;
-#define ELF64_FSZ_XWORD 8
-typedef uint64_t Elf64_Lword;
-#define ELF64_FSZ_LWORD 8
-typedef uint32_t Elf64_Half;
-#define ELF64_FSZ_HALF 4
-typedef uint16_t Elf64_Quarter;
-#define ELF64_FSZ_QUARTER 2
+typedef uint8_t Elf_Byte;
+
+typedef uint32_t Elf32_Addr;
+#define ELF32_FSZ_ADDR 4
+typedef uint32_t Elf32_Off;
+typedef int32_t Elf32_SOff;
+#define ELF32_FSZ_OFF 4
+typedef int32_t Elf32_Sword;
+#define ELF32_FSZ_SWORD 4
+typedef uint32_t Elf32_Word;
+#define ELF32_FSZ_WORD 4
+typedef uint16_t Elf32_Half;
+#define ELF32_FSZ_HALF 2
+typedef uint64_t Elf32_Lword;
+#define ELF32_FSZ_LWORD 8
+
+typedef uint64_t Elf64_Addr;
+#define ELF64_FSZ_ADDR 8
+typedef uint64_t Elf64_Off;
+typedef int64_t Elf64_SOff;
+#define ELF64_FSZ_OFF 8
+
+typedef int32_t Elf64_Sword;
+#define ELF64_FSZ_SWORD 4
+typedef uint32_t Elf64_Word;
+#define ELF64_FSZ_WORD 4
+
+typedef int64_t Elf64_Sxword;
+#define ELF64_FSZ_SXWORD 8
+typedef uint64_t Elf64_Xword;
+#define ELF64_FSZ_XWORD 8
+typedef uint64_t Elf64_Lword;
+#define ELF64_FSZ_LWORD 8
+typedef uint16_t Elf64_Half;
+#define ELF64_FSZ_HALF 2
/*
* ELF Header
@@ -118,29 +111,29 @@ typedef struct {
Elf32_Off e_phoff; /* Program hdr offset */
Elf32_Off e_shoff; /* Section hdr offset */
Elf32_Word e_flags; /* Processor flags */
- Elf32_Half e_ehsize; /* sizeof ehdr */
- Elf32_Half e_phentsize; /* Program header entry size */
- Elf32_Half e_phnum; /* Number of program headers */
- Elf32_Half e_shentsize; /* Section header entry size */
- Elf32_Half e_shnum; /* Number of section headers */
- Elf32_Half e_shstrndx; /* String table index */
+ Elf32_Half e_ehsize; /* sizeof ehdr */
+ Elf32_Half e_phentsize; /* Program header entry size */
+ Elf32_Half e_phnum; /* Number of program headers */
+ Elf32_Half e_shentsize; /* Section header entry size */
+ Elf32_Half e_shnum; /* Number of section headers */
+ Elf32_Half e_shstrndx; /* String table index */
} Elf32_Ehdr;
typedef struct {
unsigned char e_ident[ELF_NIDENT]; /* Id bytes */
- Elf64_Quarter e_type; /* file type */
- Elf64_Quarter e_machine; /* machine type */
- Elf64_Half e_version; /* version number */
+ Elf64_Half e_type; /* file type */
+ Elf64_Half e_machine; /* machine type */
+ Elf64_Word e_version; /* version number */
Elf64_Addr e_entry; /* entry point */
Elf64_Off e_phoff; /* Program hdr offset */
Elf64_Off e_shoff; /* Section hdr offset */
- Elf64_Half e_flags; /* Processor flags */
- Elf64_Quarter e_ehsize; /* sizeof ehdr */
- Elf64_Quarter e_phentsize; /* Program header entry size */
- Elf64_Quarter e_phnum; /* Number of program headers */
- Elf64_Quarter e_shentsize; /* Section header entry size */
- Elf64_Quarter e_shnum; /* Number of section headers */
- Elf64_Quarter e_shstrndx; /* String table index */
+ Elf64_Word e_flags; /* Processor flags */
+ Elf64_Half e_ehsize; /* sizeof ehdr */
+ Elf64_Half e_phentsize; /* Program header entry size */
+ Elf64_Half e_phnum; /* Number of program headers */
+ Elf64_Half e_shentsize; /* Section header entry size */
+ Elf64_Half e_shnum; /* Number of section headers */
+ Elf64_Half e_shstrndx; /* String table index */
} Elf64_Ehdr;
/* e_ident offsets */
@@ -184,11 +177,11 @@ typedef struct {
#define ELFOSABI_SYSV 0 /* UNIX System V ABI */
#define ELFOSABI_HPUX 1 /* HP-UX operating system */
#define ELFOSABI_NETBSD 2 /* NetBSD */
-#define ELFOSABI_LINUX 3 /* GNU/Linux */
-#define ELFOSABI_HURD 4 /* GNU/Hurd */
-#define ELFOSABI_86OPEN 5 /* 86Open */
+#define ELFOSABI_GNU 3 /* GNU/Linux */
+#define ELFOSABI_HURD 4 /* GNU/Hurd - historical */
+#define ELFOSABI_86OPEN 5 /* 86Open - historical */
#define ELFOSABI_SOLARIS 6 /* Solaris */
-#define ELFOSABI_MONTEREY 7 /* Monterey */
+#define ELFOSABI_AIX 7 /* AIX */
#define ELFOSABI_IRIX 8 /* IRIX */
#define ELFOSABI_FREEBSD 9 /* FreeBSD */
#define ELFOSABI_TRU64 10 /* TRU64 UNIX */
@@ -197,12 +190,18 @@ typedef struct {
#define ELFOSABI_OPENVMS 13 /* OpenVMS */
#define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */
#define ELFOSABI_AROS 15 /* Amiga Research OS */
+#define ELFOSABI_FENIXOS 16 /* The FenixOS highly scalable multi-core OS */
+#define ELFOSABI_CLOUDABI 17 /* Nuxi CloudABI */
+#define ELFOSABI_OPENVOS 18 /* Stratus Technologies OpenVOS */
/* Unofficial OSABIs follow */
#define ELFOSABI_ARM 97 /* ARM */
#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
#define ELFOSABI_NONE ELFOSABI_SYSV
-#define ELFOSABI_AIX ELFOSABI_MONTEREY
+
+/* Historical aliases. */
+#define ELFOSABI_LINUX ELFOSABI_GNU
+#define ELFOSABI_MONTEREY ELFOSABI_AIX
/* e_type */
#define ET_NONE 0 /* No file type */
@@ -224,7 +223,8 @@ typedef struct {
#define EM_386 3 /* Intel 80386 */
#define EM_68K 4 /* Motorola 68000 */
#define EM_88K 5 /* Motorola 88000 */
-#define EM_486 6 /* Intel 80486 */
+#define EM_486 6 /* Intel 80486 [old] */
+#define EM_IAMCU 6 /* Intel MCU. */
#define EM_860 7 /* Intel 80860 */
#define EM_MIPS 8 /* MIPS I Architecture */
#define EM_S370 9 /* Amdahl UTS on System/370 */
@@ -238,14 +238,15 @@ typedef struct {
#define EM_960 19 /* Intel 80960 */
#define EM_PPC 20 /* PowerPC */
#define EM_PPC64 21 /* 64-bit PowerPC */
- /* 22-35 - Reserved */
-#define EM_S390 22 /* System/390 XXX reserved */
+#define EM_S390 22 /* IBM System/390 Processor */
+#define EM_SPU 23 /* IBM SPU/SPC */
+ /* 24-35 - Reserved */
#define EM_V800 36 /* NEC V800 */
#define EM_FR20 37 /* Fujitsu FR20 */
#define EM_RH32 38 /* TRW RH-32 */
#define EM_RCE 39 /* Motorola RCE */
#define EM_ARM 40 /* Advanced RISC Machines ARM */
-#define EM_ALPHA 41 /* DIGITAL Alpha */
+#define EM_OLD_ALPHA 41 /* DIGITAL Alpha (obsolete) */
#define EM_SH 42 /* Hitachi Super-H */
#define EM_SPARCV9 43 /* SPARC Version 9 */
#define EM_TRICORE 44 /* Siemens Tricore */
@@ -296,7 +297,8 @@ typedef struct {
#define EM_MN10300 89 /* Matsushita MN10300 */
#define EM_MN10200 90 /* Matsushita MN10200 */
#define EM_PJ 91 /* picoJava */
-#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
+#define EM_OR1K 92 /* OpenRISC 32-bit embedded processor */
+#define EM_OPENRISC EM_OR1K
#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */
@@ -318,19 +320,96 @@ typedef struct {
#define EM_EXCESS 111 /* eXcess: 16/32/64-bit configurable embedded CPU */
#define EM_DXP 112 /* Icera Semiconductor Inc. Deep Execution Processor */
#define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */
-#define EM_CRX 114 /* National Semiconductor CRX */
+#define EM_CRX 114 /* National Semiconductor CompactRISC CRX microprocessor */
#define EM_XGATE 115 /* Motorola XGATE embedded processor */
#define EM_C166 116 /* Infineon C16x/XC16x processor */
#define EM_M16C 117 /* Renesas M16C series microprocessors */
#define EM_DSPIC30F 118 /* Microchip Technology dsPIC30F Digital Signal Controller */
#define EM_CE 119 /* Freescale Communication Engine RISC core */
#define EM_M32C 120 /* Renesas M32C series microprocessors */
-
-#define EM_LATTICEMICO32 138 /* RICS processor for Lattice FPGA architecture */
-
-#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze 32-bit RISC soft processor core */
-
-#define EM_MOXIE 0xFEED
+ /* 121-130 - Reserved */
+#define EM_TSK3000 131 /* Altium TSK3000 core */
+#define EM_RS08 132 /* Freescale RS08 embedded processor */
+#define EM_SHARC 133 /* Analog Devices SHARC family of 32-bit DSP processors */
+#define EM_ECOG2 134 /* Cyan Technology eCOG2 microprocessor */
+#define EM_SCORE7 135 /* Sunplus S+core7 RISC processor */
+#define EM_DSP24 136 /* New Japan Radio (NJR) 24-bit DSP Processor */
+#define EM_VIDEOCORE3 137 /* Broadcom VideoCore III processor */
+#define EM_LATTICEMICO32 138 /* RISC processor for Lattice FPGA architecture */
+#define EM_SE_C17 139 /* Seiko Epson C17 family */
+#define EM_TI_C6000 140 /* The Texas Instruments TMS320C6000 DSP family */
+#define EM_TI_C2000 141 /* The Texas Instruments TMS320C2000 DSP family */
+#define EM_TI_C5500 142 /* The Texas Instruments TMS320C55x DSP family */
+#define EM_TI_ARP32 143 /* Texas Instruments Application Specific RISC Processor, 32bit fetch */
+#define EM_TI_PRU 144 /* Texas Instruments Programmable Realtime Unit */
+ /* 145-159 - Reserved */
+#define EM_MMDSP_PLUS 160 /* STMicroelectronics 64bit VLIW Data Signal Processor */
+#define EM_CYPRESS_M8C 161 /* Cypress M8C microprocessor */
+#define EM_R32C 162 /* Renesas R32C series microprocessors */
+#define EM_TRIMEDIA 163 /* NXP Semiconductors TriMedia architecture family */
+#define EM_QDSP6 164 /* QUALCOMM DSP6 Processor */
+#define EM_8051 165 /* Intel 8051 and variants */
+#define EM_STXP7X 166 /* STMicroelectronics STxP7x family of configurable and extensible RISC processors */
+#define EM_NDS32 167 /* Andes Technology compact code size embedded RISC processor family */
+#define EM_ECOG1 168 /* Cyan Technology eCOG1X family */
+#define EM_ECOG1X 168 /* Cyan Technology eCOG1X family */
+#define EM_MAXQ30 169 /* Dallas Semiconductor MAXQ30 Core Micro-controllers */
+#define EM_XIMO16 170 /* New Japan Radio (NJR) 16-bit DSP Processor */
+#define EM_MANIK 171 /* M2000 Reconfigurable RISC Microprocessor */
+#define EM_CRAYNV2 172 /* Cray Inc. NV2 vector architecture */
+#define EM_RX 173 /* Renesas RX family */
+#define EM_METAG 174 /* Imagination Technologies META processor architecture */
+#define EM_MCST_ELBRUS 175 /* MCST Elbrus general purpose hardware architecture */
+#define EM_ECOG16 176 /* Cyan Technology eCOG16 family */
+#define EM_CR16 177 /* National Semiconductor CompactRISC CR16 16-bit microprocessor */
+#define EM_ETPU 178 /* Freescale Extended Time Processing Unit */
+#define EM_SLE9X 179 /* Infineon Technologies SLE9X core */
+#define EM_L10M 180 /* Intel L10M */
+#define EM_K10M 181 /* Intel K10M */
+ /* 182 - Reserved */
+#define EM_AARCH64 183 /* AArch64 64-bit ARM microprocessor */
+ /* 184 - Reserved */
+//#define EM_AVR32 185 /* Atmel Corporation 32-bit microprocessor family*/
+#define EM_TILE64 187 /* Tilera TILE64 multicore architecture family */
+#define EM_TILEPRO 188 /* Tilera TILEPro multicore architecture family */
+#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze 32-bit RISC soft processor core */
+#define EM_CUDA 190 /* NVIDIA CUDA architecture */
+#define EM_TILEGX 191 /* Tilera TILE-GX multicore architecture family */
+#define EM_CLOUDSHIELD 192 /* CloudShield architecture family */
+#define EM_COREA_1ST 193 /* KIPO-KAIST Core-A 1st generation processor family */
+#define EM_COREA_2ND 194 /* KIPO-KAIST Core-A 2nd generation processor family */
+#define EM_ARC_COMPACT2 195 /* Synopsys ARCompact V2 */
+#define EM_OPEN8 196 /* Open8 8-bit RISC soft processor core */
+#define EM_RL78 197 /* Renesas RL78 family */
+#define EM_VIDEOCORE5 198 /* Broadcom VideoCore V processor */
+#define EM_78KOR 199 /* Renesas 78KOR family */
+#define EM_56800EX 200 /* Freescale 56800EX Digital Signal Controller (DSC) */
+#define EM_BA1 201 /* Beyond BA1 CPU architecture */
+#define EM_BA2 202 /* Beyond BA2 CPU architecture */
+#define EM_XCORE 203 /* XMOS xCORE processor family */
+#define EM_MCHP_PIC 204 /* Microchip 8-bit PIC(r) family */
+#define EM_INTEL205 205 /* Reserved by Intel */
+#define EM_INTEL206 206 /* Reserved by Intel */
+#define EM_INTEL207 207 /* Reserved by Intel */
+#define EM_INTEL208 208 /* Reserved by Intel */
+#define EM_INTEL209 209 /* Reserved by Intel */
+#define EM_KM32 210 /* KM211 KM32 32-bit processor */
+#define EM_KMX32 211 /* KM211 KMX32 32-bit processor */
+#define EM_KMX16 212 /* KM211 KMX16 16-bit processor */
+#define EM_KMX8 213 /* KM211 KMX8 8-bit processor */
+#define EM_KVARC 214 /* KM211 KVARC processor */
+#define EM_CDP 215 /* Paneve CDP architecture family */
+#define EM_COGE 216 /* Cognitive Smart Memory Processor */
+#define EM_COOL 217 /* Bluechip Systems CoolEngine */
+#define EM_NORC 218 /* Nanoradio Optimized RISC */
+#define EM_CSR_KALIMBA 219 /* CSR Kalimba architecture family */
+#define EM_Z80 220 /* Zilog Z80 */
+#define EM_VISIUM 221 /* Controls and Data Services VISIUMcore processor */
+#define EM_FT32 222 /* FTDI Chip FT32 high performance 32-bit RISC architecture */
+#define EM_MOXIE 223 /* Moxie processor family */
+#define EM_AMDGPU 224 /* AMD GPU architecture */
+ /* 225-242 - Reserved */
+#define EM_RISCV 243 /* RISC-V */
/* Unofficial machine types follow */
#define EM_AVR32 6317 /* used by NetBSD/avr32 */
@@ -352,8 +431,8 @@ typedef struct {
} Elf32_Phdr;
typedef struct {
- Elf64_Half p_type; /* entry type */
- Elf64_Half p_flags; /* flags */
+ Elf64_Word p_type; /* entry type */
+ Elf64_Word p_flags; /* flags */
Elf64_Off p_offset; /* offset */
Elf64_Addr p_vaddr; /* virtual address */
Elf64_Addr p_paddr; /* physical address */
@@ -370,14 +449,22 @@ typedef struct {
#define PT_NOTE 4 /* Auxiliary information */
#define PT_SHLIB 5 /* Reserved, unspecified semantics */
#define PT_PHDR 6 /* Entry for header table itself */
-#define PT_NUM 7
+#define PT_TLS 7 /* TLS initialisation image */
+#define PT_NUM 8
+
+#define PT_LOOS 0x60000000 /* OS-specific range */
-#define PT_LOOS 0x60000000 /* OS-specific range */
-#define PT_HIOS 0x6fffffff
-#define PT_LOPROC 0x70000000 /* Processor-specific range */
-#define PT_HIPROC 0x7fffffff
+/* GNU-specific */
+#define PT_GNU_EH_FRAME 0x6474e550 /* EH frame segment */
+#define PT_GNU_STACK 0x6474e551 /* Indicate executable stack */
+#define PT_GNU_RELRO 0x6474e552 /* Make read-only after relocation */
+
+#define PT_HIOS 0x6fffffff
+#define PT_LOPROC 0x70000000 /* Processor-specific range */
+#define PT_HIPROC 0x7fffffff
#define PT_MIPS_REGINFO 0x70000000
+#define PT_MIPS_ABIFLAGS 0x70000003
/* p_flags */
#define PF_R 0x4 /* Segment is readable */
@@ -407,66 +494,91 @@ typedef struct {
} Elf32_Shdr;
typedef struct {
- Elf64_Half sh_name; /* section name (.shstrtab index) */
- Elf64_Half sh_type; /* section type */
+ Elf64_Word sh_name; /* section name (.shstrtab index) */
+ Elf64_Word sh_type; /* section type */
Elf64_Xword sh_flags; /* section flags */
Elf64_Addr sh_addr; /* virtual address */
Elf64_Off sh_offset; /* file offset */
Elf64_Xword sh_size; /* section size */
- Elf64_Half sh_link; /* link to another */
- Elf64_Half sh_info; /* misc info */
+ Elf64_Word sh_link; /* link to another */
+ Elf64_Word sh_info; /* misc info */
Elf64_Xword sh_addralign; /* memory alignment */
Elf64_Xword sh_entsize; /* table entry size */
} Elf64_Shdr;
/* sh_type */
-#define SHT_NULL 0 /* Section header table entry unused */
-#define SHT_PROGBITS 1 /* Program information */
-#define SHT_SYMTAB 2 /* Symbol table */
-#define SHT_STRTAB 3 /* String table */
-#define SHT_RELA 4 /* Relocation information w/ addend */
-#define SHT_HASH 5 /* Symbol hash table */
-#define SHT_DYNAMIC 6 /* Dynamic linking information */
-#define SHT_NOTE 7 /* Auxiliary information */
-#define SHT_NOBITS 8 /* No space allocated in file image */
-#define SHT_REL 9 /* Relocation information w/o addend */
-#define SHT_SHLIB 10 /* Reserved, unspecified semantics */
-#define SHT_DYNSYM 11 /* Symbol table for dynamic linker */
-#define SHT_INIT_ARRAY 14 /* Initialization function pointers */
-#define SHT_FINI_ARRAY 15 /* Termination function pointers */
-#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs */
-#define SHT_GROUP 17 /* Section group */
-#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX) */
-#define SHT_NUM 19
-
-#define SHT_LOOS 0x60000000 /* Operating system specific range */
-#define SHT_SUNW_move 0x6ffffffa
-#define SHT_SUNW_syminfo 0x6ffffffc
-#define SHT_SUNW_verdef 0x6ffffffd /* Versions defined by file */
-#define SHT_GNU_verdef SHT_SUNW_verdef
-#define SHT_SUNW_verneed 0x6ffffffe /* Versions needed by file */
-#define SHT_GNU_verneed SHT_SUNW_verneed
-#define SHT_SUNW_versym 0x6fffffff /* Symbol versions */
-#define SHT_GNU_versym SHT_SUNW_versym
-#define SHT_HIOS 0x6fffffff
-#define SHT_LOPROC 0x70000000 /* Processor-specific range */
-#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */
-#define SHT_HIPROC 0x7fffffff
-#define SHT_LOUSER 0x80000000 /* Application-specific range */
-#define SHT_HIUSER 0xffffffff
+#define SHT_NULL 0 /* Section header table entry unused */
+#define SHT_PROGBITS 1 /* Program information */
+#define SHT_SYMTAB 2 /* Symbol table */
+#define SHT_STRTAB 3 /* String table */
+#define SHT_RELA 4 /* Relocation information w/ addend */
+#define SHT_HASH 5 /* Symbol hash table */
+#define SHT_DYNAMIC 6 /* Dynamic linking information */
+#define SHT_NOTE 7 /* Auxiliary information */
+#define SHT_NOBITS 8 /* No space allocated in file image */
+#define SHT_REL 9 /* Relocation information w/o addend */
+#define SHT_SHLIB 10 /* Reserved, unspecified semantics */
+#define SHT_DYNSYM 11 /* Symbol table for dynamic linker */
+#define SHT_INIT_ARRAY 14 /* Initialization function pointers */
+#define SHT_FINI_ARRAY 15 /* Termination function pointers */
+#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs */
+#define SHT_GROUP 17 /* Section group */
+#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX) */
+#define SHT_NUM 19
+
+#define SHT_LOOS 0x60000000 /* Operating system specific range */
+#define SHT_GNU_INCREMENTAL_INPUTS 0x6fff4700 /* GNU incremental build data */
+#define SHT_LOSUNW 0x6ffffff4
+#define SHT_SUNW_dof 0x6ffffff4
+#define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* GNU object attributes */
+#define SHT_SUNW_cap 0x6ffffff5
+#define SHT_SUNW_SIGNATURE 0x6ffffff6
+#define SHT_GNU_HASH 0x6ffffff6 /* GNU style symbol hash table */
+#define SHT_GNU_LIBLIST 0x6ffffff7 /* GNU list of prelink dependencies */
+#define SHT_SUNW_move 0x6ffffffa
+#define SHT_SUNW_COMDAT 0x6ffffffb
+#define SHT_SUNW_syminfo 0x6ffffffc
+#define SHT_SUNW_verdef 0x6ffffffd /* Versions defined by file */
+#define SHT_GNU_verdef SHT_SUNW_verdef
+#define SHT_SUNW_verneed 0x6ffffffe /* Versions needed by file */
+#define SHT_GNU_verneed SHT_SUNW_verneed
+#define SHT_SUNW_versym 0x6fffffff /* Symbol versions */
+#define SHT_GNU_versym SHT_SUNW_versym
+#define SHT_HISUNW 0x6fffffff
+#define SHT_HIOS 0x6fffffff
+#define SHT_LOPROC 0x70000000 /* Processor-specific range */
+#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */
+#define SHT_ARM_EXIDX 0x70000001 /* exception index table */
+#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking
+ * pre-emption map */
+#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility
+ * attributes */
+#define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details */
+#define SHT_ARM_OVERLAYSECTION 0x70000005
+#define SHT_MIPS_REGINFO 0x70000006
+#define SHT_MIPS_OPTIONS 0x7000000d
+#define SHT_MIPS_DWARF 0x7000001e /* MIPS gcc uses MIPS_DWARF */
+#define SHT_MIPS_XHASH 0x7000002b /* MIPS version of GNU_HASH */
+#define SHT_HIPROC 0x7fffffff
+#define SHT_LOUSER 0x80000000 /* Application-specific range */
+#define SHT_HIUSER 0xffffffff
/* sh_flags */
-#define SHF_WRITE 0x1 /* Section contains writable data */
-#define SHF_ALLOC 0x2 /* Section occupies memory */
-#define SHF_EXECINSTR 0x4 /* Section contains executable insns */
-#define SHF_MERGE 0x10 /* Section contains data that can be merged */
-#define SHF_STRINGS 0x20 /* Section contains null-terminated strings */
-#define SHF_INFO_LINK 0x40 /* Section header's sh_info holds table index */
-#define SHF_LINK_ORDER 0x80 /* Section has special ordering requirements */
-
-#define SHF_MASKOS 0x0f000000 /* Operating system specific values */
-#define SHF_MASKPROC 0xf0000000 /* Processor-specific values */
-
+#define SHF_WRITE 0x00000001 /* Contains writable data */
+#define SHF_ALLOC 0x00000002 /* Occupies memory */
+#define SHF_EXECINSTR 0x00000004 /* Contains executable insns */
+#define SHF_MERGE 0x00000010 /* Might be merged */
+#define SHF_STRINGS 0x00000020 /* Contains nul terminated strings */
+#define SHF_INFO_LINK 0x00000040 /* "sh_info" contains SHT index */
+#define SHF_LINK_ORDER 0x00000080 /* Preserve order after combining */
+#define SHF_OS_NONCONFORMING 0x00000100 /* OS specific handling required */
+#define SHF_GROUP 0x00000200 /* Is member of a group */
+#define SHF_TLS 0x00000400 /* Holds thread-local data */
+#define SHF_MASKOS 0x0ff00000 /* Operating system specific values */
+#define SHF_MASKPROC 0xf0000000 /* Processor-specific values */
+#define SHF_ORDERED 0x40000000 /* Ordering requirement (Solaris) */
+#define SHF_EXCLUDE 0x80000000 /* Excluded unless unles ref/alloc
+ (Solaris).*/
/*
* Symbol Table
*/
@@ -480,10 +592,10 @@ typedef struct {
} Elf32_Sym;
typedef struct {
- Elf64_Half st_name; /* Symbol name (.strtab index) */
+ Elf64_Word st_name; /* Symbol name (.strtab index) */
Elf_Byte st_info; /* type / binding attrs */
Elf_Byte st_other; /* unused */
- Elf64_Quarter st_shndx; /* section index of symbol */
+ Elf64_Half st_shndx; /* section index of symbol */
Elf64_Addr st_value; /* value of symbol */
Elf64_Xword st_size; /* size of symbol */
} Elf64_Sym;
@@ -515,6 +627,7 @@ typedef struct {
#define STT_NUM 7
#define STT_LOOS 10 /* Operating system specific range */
+#define STT_GNU_IFUNC 10 /* GNU extension: indirect function */
#define STT_HIOS 12
#define STT_LOPROC 13 /* Processor-specific range */
#define STT_HIPROC 15
@@ -610,8 +723,8 @@ typedef struct {
Elf64_Lword m_value; /* symbol value */
Elf64_Xword m_info; /* size + index */
Elf64_Xword m_poffset; /* symbol offset */
- Elf64_Half m_repeat; /* repeat count */
- Elf64_Half m_stride; /* stride info */
+ Elf64_Word m_repeat; /* repeat count */
+ Elf64_Word m_stride; /* stride info */
} Elf64_Move;
#define ELF64_M_SYM(info) ((info) >> 8)
@@ -686,9 +799,15 @@ typedef struct {
#define DT_FINI_ARRAY 26 /* Size, in bytes, of DT_INIT_ARRAY array */
#define DT_INIT_ARRAYSZ 27 /* Address of termination function array */
#define DT_FINI_ARRAYSZ 28 /* Size, in bytes, of DT_FINI_ARRAY array*/
-#define DT_NUM 29
+#define DT_RUNPATH 29 /* overrides DT_RPATH */
+#define DT_FLAGS 30 /* Encodes ORIGIN, SYMBOLIC, TEXTREL, BIND_NOW, STATIC_TLS */
+#define DT_ENCODING 31 /* ??? */
+#define DT_PREINIT_ARRAY 32 /* Address of pre-init function array */
+#define DT_PREINIT_ARRAYSZ 33 /* Size, in bytes, of DT_PREINIT_ARRAY array */
+#define DT_NUM 34
#define DT_LOOS 0x60000000 /* Operating system specific range */
+#define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table */
#define DT_VERSYM 0x6ffffff0 /* Symbol versions */
#define DT_FLAGS_1 0x6ffffffb /* ELF dynamic flags */
#define DT_VERDEF 0x6ffffffc /* Versions defined by file */
@@ -697,10 +816,44 @@ typedef struct {
#define DT_VERNEEDNUM 0x6fffffff /* Number of versions needed by file */
#define DT_HIOS 0x6fffffff
#define DT_LOPROC 0x70000000 /* Processor-specific range */
+#define DT_MIPS_XHASH 0x70000036 /* MIPS version of GNU_HASH */
#define DT_HIPROC 0x7fffffff
-/* Flag values for DT_FLAGS_1 (incomplete) */
-#define DF_1_INITFIRST 0x00000020 /* Object's init/fini take priority */
+/* Flag values for DT_FLAGS */
+#define DF_ORIGIN 0x00000001 /* uses $ORIGIN */
+#define DF_SYMBOLIC 0x00000002 /* */
+#define DF_TEXTREL 0x00000004 /* */
+#define DF_BIND_NOW 0x00000008 /* */
+#define DF_STATIC_TLS 0x00000010 /* */
+
+/* Flag values for DT_FLAGS_1 */
+#define DF_1_NOW 0x00000001 /* Same as DF_BIND_NOW */
+#define DF_1_GLOBAL 0x00000002 /* Unused */
+#define DF_1_GROUP 0x00000004 /* Is member of group */
+#define DF_1_NODELETE 0x00000008 /* Cannot be deleted from process */
+#define DF_1_LOADFLTR 0x00000010 /* Immediate loading of filters */
+#define DF_1_INITFIRST 0x00000020 /* init/fini takes priority */
+#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */
+#define DF_1_ORIGIN 0x00000080 /* Require $ORIGIN processing */
+#define DF_1_DIRECT 0x00000100 /* Enable direct bindings */
+#define DF_1_INTERPOSE 0x00000400 /* Is an interposer */
+#define DF_1_NODEFLIB 0x00000800 /* Ignore default library search path */
+#define DF_1_NODUMP 0x00001000 /* Cannot be dumped with dldump(3C) */
+#define DF_1_CONFALT 0x00002000 /* Configuration alternative */
+#define DF_1_ENDFILTEE 0x00004000 /* Filtee ends filter's search */
+#define DF_1_DISPRELDNE 0x00008000 /* Did displacement relocation */
+#define DF_1_DISPRELPND 0x00010000 /* Pending displacement relocation */
+#define DF_1_NODIRECT 0x00020000 /* Has non-direct bindings */
+#define DF_1_IGNMULDEF 0x00040000 /* Used internally */
+#define DF_1_NOKSYMS 0x00080000 /* Used internally */
+#define DF_1_NOHDR 0x00100000 /* Used internally */
+#define DF_1_EDITED 0x00200000 /* Has been modified since build */
+#define DF_1_NORELOC 0x00400000 /* Used internally */
+#define DF_1_SYMINTPOSE 0x00800000 /* Has individual symbol interposers */
+#define DF_1_GLOBAUDIT 0x01000000 /* Require global auditing */
+#define DF_1_SINGLETON 0x02000000 /* Has singleton symbols */
+#define DF_1_STUB 0x04000000 /* Stub */
+#define DF_1_PIE 0x08000000 /* Position Independent Executable */
/*
* Auxiliary Vectors
@@ -711,8 +864,8 @@ typedef struct {
} Aux32Info;
typedef struct {
- Elf64_Half a_type; /* 32-bit id */
- Elf64_Xword a_v; /* 64-bit id */
+ Elf64_Word a_type; /* 32-bit id */
+ Elf64_Xword a_v; /* 64-bit id */
} Aux64Info;
/* a_type */
@@ -729,6 +882,7 @@ typedef struct {
#define AT_DCACHEBSIZE 10 /* Data cache block size */
#define AT_ICACHEBSIZE 11 /* Instruction cache block size */
#define AT_UCACHEBSIZE 12 /* Unified cache block size */
+#define AT_STACKBASE 13 /* Base address of the main thread */
/* Vendor specific */
#define AT_MIPS_NOTELF 10 /* XXX a_val != 0 -> MIPS XCOFF executable */
@@ -756,6 +910,16 @@ typedef struct {
#define AT_SUN_EXECNAME 2014
/*
+ * The header for GNU-style hash sections.
+ */
+typedef struct {
+ uint32_t gh_nbuckets; /* Number of hash buckets. */
+ uint32_t gh_symndx; /* First visible symbol in .dynsym. */
+ uint32_t gh_maskwords; /* #maskwords used in bloom filter. */
+ uint32_t gh_shift2; /* Bloom filter shift count. */
+} Elf_GNU_Hash_Header;
+
+/*
* Note Headers
*/
typedef struct {
@@ -765,42 +929,155 @@ typedef struct {
} Elf32_Nhdr;
typedef struct {
- Elf64_Half n_namesz;
- Elf64_Half n_descsz;
- Elf64_Half n_type;
+ Elf64_Word n_namesz;
+ Elf64_Word n_descsz;
+ Elf64_Word n_type;
} Elf64_Nhdr;
-#define ELF_NOTE_TYPE_ABI_TAG 1
+#define ELF_NOTE_GNU_NAMESZ 4
+#define ELF_NOTE_GNU_NAME "GNU\0"
+/*
+ * GNU-specific note type: ABI tag
+ * name: GNU\0
+ * namesz: 4
+ * desc:
+ * word[0]: OS tag
+ * word[1]: major version
+ * word[2]: minor version
+ * word[3]: teeny version
+ * descsz: 16
+ */
/* GNU-specific note name and description sizes */
-#define ELF_NOTE_ABI_NAMESZ 4
-#define ELF_NOTE_ABI_DESCSZ 16
-/* GNU-specific note name */
-#define ELF_NOTE_ABI_NAME "GNU\0"
-
+#define ELF_NOTE_TYPE_ABI_TAG 1
+#define ELF_NOTE_ABI_NAME ELF_NOTE_GNU_NAME
+#define ELF_NOTE_ABI_NAMESZ ELF_NOTE_GNU_NAMESZ
+#define ELF_NOTE_ABI_DESCSZ 16
/* GNU-specific OS/version value stuff */
-#define ELF_NOTE_ABI_OS_LINUX 0
-#define ELF_NOTE_ABI_OS_HURD 1
-#define ELF_NOTE_ABI_OS_SOLARIS 2
+#define ELF_NOTE_ABI_OS_LINUX 0
+#define ELF_NOTE_ABI_OS_HURD 1
+#define ELF_NOTE_ABI_OS_SOLARIS 2
+#define ELF_NOTE_ABI_OS_KFREEBSD 3
+#define ELF_NOTE_ABI_OS_KNETBSD 4
+
+/* Old gcc style, under the ABI tag */
+#define ELF_NOTE_OGCC_NAMESZ 8
+#define ELF_NOTE_OGCC_NAME "01.01\0\0\0\0"
+#define ELF_NOTE_OGCC_DESCSZ 0
+
+/*
+ * GNU-specific note type: Hardware capabilities
+ * name: GNU\0
+ * namesz: 4
+ * desc:
+ * word[0]: Number of entries
+ * word[1]: Bitmask of enabled entries
+ * Followed by a byte id, and a NUL terminated string per entry
+ * descsz: variable
+ */
+#define ELF_NOTE_TYPE_GNU_HWCAP 2
-/* NetBSD-specific note type: Emulation name. desc is emul name string. */
-#define ELF_NOTE_TYPE_NETBSD_TAG 1
+/*
+ * GNU-specific note type: Build ID generated by ld
+ * name: GNU\0
+ * desc:
+ * word[0..4] SHA1 [default]
+ * or
+ * word[0..3] md5 or uuid
+ * descsz: 16 or 20
+ */
+#define ELF_NOTE_TYPE_GNU_BUILD_ID 3
+
+/* SuSE-specific note type: ABI
+ * name: SuSE\0
+ * namesz: 5
+ * desc:
+ * half[0] = MMmm
+ *
+ * M = product major version
+ * m = product minor version
+ * descsz: 2
+ */
+#define ELF_NOTE_TYPE_SUSE_TAG 1
+/* SuSE-specific note name and description sizes */
+#define ELF_NOTE_SUSE_NAMESZ 5
+#define ELF_NOTE_SUSE_DESCSZ 2
+/* SuSE-specific note name */
+#define ELF_NOTE_SUSE_NAME "SuSE\0"
+
+/* SuSE-specific note type: version
+ * name: SuSE\0\0\0\0
+ * namesz: 8
+ * desc:
+ * word[0] = VVTTMMmm
+ *
+ * V = version of following data
+ * T = product type: [box, sles, nld, whatever]
+ * M = product major version
+ * m = product minor version
+ * descsz: 8
+ */
+#define ELF_NOTE_TYPE_SUSE_VERSION_TAG 0x45537553 /* SuSE in LE */
+/* SuSE-specific note name and description sizes */
+#define ELF_NOTE_SUSE_VERSION_NAMESZ 8
+#define ELF_NOTE_SUSE_VERSION_DESCSZ 8
+/* SuSE-specific note name */
+#define ELF_NOTE_SUSE_VERSION_NAME "SuSE\0\0\0\0"
+
+/* Go-specific note type: buildid
+ * name: Go\0\0
+ * namesz: 4
+ * desc:
+ * words[10]
+ * descsz: 40
+ */
+#define ELF_NOTE_TYPE_GO_BUILDID_TAG 4
+#define ELF_NOTE_GO_BUILDID_NAMESZ 4
+#define ELF_NOTE_GO_BUILDID_DESCSZ 40
+#define ELF_NOTE_GO_BUILDID_NAME "Go\0\0"
+
+/* NetBSD-specific note type: NetBSD ABI version.
+ * name: NetBSD\0\0
+ * namesz: 8
+ * desc:
+ * word[0]: MMmmrrpp00
+ *
+ * M = major version
+ * m = minor version
+ * r = release ["",A-Z,Z[A-Z] but numeric]
+ * p = patchlevel
+ * descsz: 4
+ */
+#define ELF_NOTE_TYPE_NETBSD_TAG 1
/* NetBSD-specific note name and description sizes */
#define ELF_NOTE_NETBSD_NAMESZ 7
#define ELF_NOTE_NETBSD_DESCSZ 4
/* NetBSD-specific note name */
-#define ELF_NOTE_NETBSD_NAME "NetBSD\0\0"
-
-/* NetBSD-specific note type: Checksum. There should be 1 NOTE per PT_LOAD
- section. desc is a tuple of <phnum>(16),<chk-type>(16),<chk-value>. */
-#define ELF_NOTE_TYPE_CHECKSUM_TAG 2
-#define ELF_NOTE_CHECKSUM_CRC32 1
-#define ELF_NOTE_CHECKSUM_MD5 2
-#define ELF_NOTE_CHECKSUM_SHA1 3
-#define ELF_NOTE_CHECKSUM_SHA256 4
-
-/* NetBSD-specific note type: PaX. There should be 1 NOTE per executable.
- section. desc is a 32 bit bitmask */
+#define ELF_NOTE_NETBSD_NAME "NetBSD\0\0"
+
+/* NetBSD-specific note type: Emulation (obsolete; last used early 2000)
+ * name: NetBSD\0\0
+ * namesz: 8
+ * desc:
+ * "netbsd\0"
+ *
+ * descsz: 8
+ */
+#define ELF_NOTE_TYPE_NETBSD_EMUL_TAG 2
+#define ELF_NOTE_NETBSD_EMUL_NAMESZ 7
+#define ELF_NOTE_NETBSD_EMUL_DESCSZ 7
+/* NetBSD-specific note name */
+#define ELF_NOTE_NETBSD_EMUL_NAME "NetBSD\0\0"
+
+/*
+ * NetBSD-specific note type: PaX.
+ * There should be 1 NOTE per executable.
+ * name: PaX\0
+ * namesz: 4
+ * desc:
+ * word[0]: capability bitmask
+ * descsz: 4
+ */
#define ELF_NOTE_TYPE_PAX_TAG 3
#define ELF_NOTE_PAX_MPROTECT 0x01 /* Force enable Mprotect */
#define ELF_NOTE_PAX_NOMPROTECT 0x02 /* Force disable Mprotect */
@@ -825,6 +1102,8 @@ typedef struct {
*
* ELF_NOTE_NETBSD_CORE_PROCINFO
* Note is a "netbsd_elfcore_procinfo" structure.
+ * ELF_NOTE_NETBSD_CORE_AUXV
+ * Note is an array of AuxInfo structures.
*
* We also use ptrace(2) request numbers (the ones that exist in
* machine-dependent space) to identify register info notes. The
@@ -838,6 +1117,7 @@ typedef struct {
#define ELF_NOTE_NETBSD_CORE_NAME "NetBSD-CORE"
#define ELF_NOTE_NETBSD_CORE_PROCINFO 1
+#define ELF_NOTE_NETBSD_CORE_AUXV 2
#define NETBSD_ELFCORE_PROCINFO_VERSION 1
@@ -849,8 +1129,8 @@ struct netbsd_elfcore_procinfo {
uint32_t cpi_sigcode; /* signal code */
uint32_t cpi_sigpend[4]; /* pending signals */
uint32_t cpi_sigmask[4]; /* blocked signals */
- uint32_t cpi_sigignore[4];/* blocked signals */
- uint32_t cpi_sigcatch[4];/* blocked signals */
+ uint32_t cpi_sigignore[4];/* ignored signals */
+ uint32_t cpi_sigcatch[4];/* caught signals */
int32_t cpi_pid; /* process ID */
int32_t cpi_ppid; /* parent process ID */
int32_t cpi_pgrp; /* process group ID */
@@ -867,46 +1147,108 @@ struct netbsd_elfcore_procinfo {
int32_t cpi_siglwp; /* LWP target of killing signal */
};
+/*
+ * NetBSD-specific note type: MACHINE_ARCH.
+ * There should be 1 NOTE per executable.
+ * name: NetBSD\0
+ * namesz: 7
+ * desc: string
+ * descsz: variable
+ */
+#define ELF_NOTE_TYPE_MARCH_TAG 5
+/* NetBSD-specific note name and description sizes */
+#define ELF_NOTE_MARCH_NAMESZ ELF_NOTE_NETBSD_NAMESZ
+/* NetBSD-specific note name */
+#define ELF_NOTE_MARCH_NAME ELF_NOTE_NETBSD_NAME
+
+/*
+ * NetBSD-specific note type: MCMODEL
+ * There should be 1 NOTE per executable.
+ * name: NetBSD\0
+ * namesz: 7
+ * code model: string
+ */
+
+#define ELF_NOTE_TYPE_MCMODEL_TAG 6
+/* NetBSD-specific note name and description sizes */
+#define ELF_NOTE_MCMODEL_NAMESZ ELF_NOTE_NETBSD_NAMESZ
+/* NetBSD-specific note name */
+#define ELF_NOTE_MCMODEL_NAME ELF_NOTE_NETBSD_NAME
+
+
+#if !defined(ELFSIZE)
+# if defined(_RUMPKERNEL) || !defined(_KERNEL)
+# define ELFSIZE ARCH_ELFSIZE
+# else
+# define ELFSIZE KERN_ELFSIZE
+# endif
+#endif
+
+#if defined(ELFSIZE)
+#define CONCAT(x,y) __CONCAT(x,y)
+#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
+#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y))))
+#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE))
+#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
+#define ElfW(x) CONCAT(Elf,CONCAT(ELFSIZE,CONCAT(_,x)))
+#endif
+
#if defined(ELFSIZE) && (ELFSIZE == 32)
-#define Elf_Ehdr Elf32_Ehdr
-#define Elf_Phdr Elf32_Phdr
-#define Elf_Shdr Elf32_Shdr
-#define Elf_Sym Elf32_Sym
-#define Elf_Rel Elf32_Rel
-#define Elf_Rela Elf32_Rela
-#define Elf_Dyn Elf32_Dyn
-#define Elf_Word Elf32_Word
-#define Elf_Sword Elf32_Sword
-#define Elf_Addr Elf32_Addr
-#define Elf_Off Elf32_Off
-#define Elf_SOff Elf32_SOff
-#define Elf_Nhdr Elf32_Nhdr
-
-#define ELF_R_SYM ELF32_R_SYM
-#define ELF_R_TYPE ELF32_R_TYPE
-#define ELFCLASS ELFCLASS32
-
-#define AuxInfo Aux32Info
+#define Elf_Ehdr Elf32_Ehdr
+#define Elf_Phdr Elf32_Phdr
+#define Elf_Shdr Elf32_Shdr
+#define Elf_Sym Elf32_Sym
+#define Elf_Rel Elf32_Rel
+#define Elf_Rela Elf32_Rela
+#define Elf_Dyn Elf32_Dyn
+#define Elf_Word Elf32_Word
+#define Elf_Sword Elf32_Sword
+#define Elf_Half Elf32_Half
+#define Elf_Addr Elf32_Addr
+#define Elf_Off Elf32_Off
+#define Elf_SOff Elf32_SOff
+#define Elf_Nhdr Elf32_Nhdr
+#define Elf_Verdef Elf32_Verdef
+#define Elf_Verdaux Elf32_Verdaux
+#define Elf_Verneed Elf32_Verneed
+#define Elf_Vernaux Elf32_Vernaux
+#define Elf_Versym Elf32_Versym
+
+#define ELF_R_SYM ELF32_R_SYM
+#define ELF_R_TYPE ELF32_R_TYPE
+#define ELFCLASS ELFCLASS32
+
+#define AuxInfo Aux32Info
#elif defined(ELFSIZE) && (ELFSIZE == 64)
-#define Elf_Ehdr Elf64_Ehdr
-#define Elf_Phdr Elf64_Phdr
-#define Elf_Shdr Elf64_Shdr
-#define Elf_Sym Elf64_Sym
-#define Elf_Rel Elf64_Rel
-#define Elf_Rela Elf64_Rela
-#define Elf_Dyn Elf64_Dyn
-#define Elf_Word Elf64_Word
-#define Elf_Sword Elf64_Sword
-#define Elf_Addr Elf64_Addr
-#define Elf_Off Elf64_Off
-#define Elf_SOff Elf64_SOff
-#define Elf_Nhdr Elf64_Nhdr
-
-#define ELF_R_SYM ELF64_R_SYM
-#define ELF_R_TYPE ELF64_R_TYPE
-#define ELFCLASS ELFCLASS64
-
-#define AuxInfo Aux64Info
+#define Elf_Ehdr Elf64_Ehdr
+#define Elf_Phdr Elf64_Phdr
+#define Elf_Shdr Elf64_Shdr
+#define Elf_Sym Elf64_Sym
+#define Elf_Rel Elf64_Rel
+#define Elf_Rela Elf64_Rela
+#define Elf_Dyn Elf64_Dyn
+#define Elf_Word Elf64_Word
+#define Elf_Sword Elf64_Sword
+#define Elf_Half Elf64_Half
+#define Elf_Addr Elf64_Addr
+#define Elf_Off Elf64_Off
+#define Elf_SOff Elf64_SOff
+#define Elf_Nhdr Elf64_Nhdr
+#define Elf_Verdef Elf64_Verdef
+#define Elf_Verdaux Elf64_Verdaux
+#define Elf_Verneed Elf64_Verneed
+#define Elf_Vernaux Elf64_Vernaux
+#define Elf_Versym Elf64_Versym
+
+#define ELF_R_SYM ELF64_R_SYM
+#define ELF_R_TYPE ELF64_R_TYPE
+#define ELFCLASS ELFCLASS64
+
+#define AuxInfo Aux64Info
+#endif
+
+#ifndef Elf_Symindx
+#define Elf_Symindx uint32_t
#endif
#define ELF32_ST_BIND(info) ELF_ST_BIND(info)
@@ -925,8 +1267,8 @@ typedef struct {
} Elf32_Syminfo;
typedef struct {
- Elf64_Half si_boundto; /* direct bindings - symbol bound to */
- Elf64_Half si_flags; /* per symbol flags */
+ Elf64_Word si_boundto; /* direct bindings - symbol bound to */
+ Elf64_Word si_flags; /* per symbol flags */
} Elf64_Syminfo;
#define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association
@@ -956,7 +1298,12 @@ typedef struct {
* These constants are used for Elf32_Verdef struct's version number.
*/
#define VER_DEF_NONE 0
-#define VER_DEF_CURRENT 1
+#define VER_DEF_CURRENT 1
+
+/*
+ * These constants are used for Elf32_Verdef struct's vd_ndx.
+ */
+#define VER_DEF_IDX(x) VER_NDX(x)
/*
* These constants are used for Elf32_Verdef struct's vd_flags.
@@ -967,8 +1314,9 @@ typedef struct {
/*
* These are used in an Elf32_Versym field.
*/
-#define VER_NDX_LOCAL 0
-#define VER_NDX_GLOBAL 1
+#define VER_NDX_LOCAL 0
+#define VER_NDX_GLOBAL 1
+#define VER_NDX_GIVEN 2
/*
* These constants are used for Elf32_Verneed struct's version number.
@@ -977,10 +1325,20 @@ typedef struct {
#define VER_NEED_CURRENT 1
/*
- * GNU Extension hidding symb
+ * These constants are used for Elf32_Vernaux struct's vna_other.
*/
-#define VERSYM_HIDDEN 0x8000
-#define VERSYM_VERSION 0x7fff
+#define VER_NEED_HIDDEN VER_NDX_HIDDEN
+#define VER_NEED_IDX(x) VER_NDX(x)
+
+/* index */
+#define VER_NDX_HIDDEN 0x8000
+#define VER_NDX(x) ((x) & ~VER_NDX_HIDDEN)
+
+/*
+ * GNU Extension hidding symbol
+ */
+#define VERSYM_HIDDEN 0x8000
+#define VERSYM_VERSION 0x7fff
#define ELF_VER_CHR '@'
@@ -1030,7 +1388,14 @@ typedef Elf32_Versym Elf64_Versym;
#ifdef _KERNEL
-#define ELF_AUX_ENTRIES 14 /* Max size of aux array passed to loader */
+/*
+ * Arbitrary limits to avoid DoS for excessive memory allocation.
+ */
+#define ELF_MAXPHNUM 128
+#define ELF_MAXSHNUM 32768
+#define ELF_MAXNOTESIZE 1024
+
+#define ELF_AUX_ENTRIES 15 /* Max size of aux array passed to loader */
#define ELF32_NO_ADDR (~(Elf32_Addr)0) /* Indicates addr. not yet filled in */
#define ELF32_LINK_ADDR ((Elf32_Addr)-2) /* advises to use link address */
#define ELF64_NO_ADDR (~(Elf64_Addr)0) /* Indicates addr. not yet filled in */
@@ -1060,11 +1425,11 @@ typedef Elf32_Versym Elf64_Versym;
#if defined(ELFSIZE)
struct elf_args {
- Elf_Addr arg_entry; /* program entry point */
- Elf_Addr arg_interp; /* Interpreter load address */
- Elf_Addr arg_phaddr; /* program header address */
- Elf_Addr arg_phentsize; /* Size of program header */
- Elf_Addr arg_phnum; /* Number of program headers */
+ Elf_Addr arg_entry; /* program entry point */
+ Elf_Addr arg_interp; /* Interpreter load address */
+ Elf_Addr arg_phaddr; /* program header address */
+ Elf_Addr arg_phentsize; /* Size of program header */
+ Elf_Addr arg_phnum; /* Number of program headers */
};
#endif
@@ -1072,30 +1437,41 @@ struct elf_args {
#include "opt_execfmt.h"
#endif
+struct ps_strings;
+struct coredump_iostate;
+struct note_state;
+struct exec_package;
+
#ifdef EXEC_ELF32
int exec_elf32_makecmds(struct lwp *, struct exec_package *);
+int elf32_populate_auxv(struct lwp *, struct exec_package *, char **);
int elf32_copyargs(struct lwp *, struct exec_package *,
struct ps_strings *, char **, void *);
-int coredump_elf32(struct lwp *, void *);
-int coredump_writenote_elf32(struct proc *, void *, Elf32_Nhdr *,
- const char *, void *);
-
-int elf32_check_header(Elf32_Ehdr *, int);
+int elf32_check_header(Elf32_Ehdr *);
#endif
+int real_coredump_elf32(struct lwp *, struct coredump_iostate *);
+int coredump_elf32(struct lwp *, struct coredump_iostate *);
+void coredump_savenote_elf32(struct note_state *, unsigned int,
+ const char *, void *, size_t);
+
+
#ifdef EXEC_ELF64
int exec_elf64_makecmds(struct lwp *, struct exec_package *);
+int elf64_populate_auxv(struct lwp *, struct exec_package *, char **);
int elf64_copyargs(struct lwp *, struct exec_package *,
struct ps_strings *, char **, void *);
-int coredump_elf64(struct lwp *, void *);
-int coredump_writenote_elf64(struct proc *, void *, Elf64_Nhdr *,
- const char *, void *);
-
-int elf64_check_header(Elf64_Ehdr *, int);
+int elf64_check_header(Elf64_Ehdr *);
#endif
+int real_coredump_elf64(struct lwp *, struct coredump_iostate *);
+int coredump_elf64(struct lwp *, struct coredump_iostate *);
+void coredump_savenote_elf64(struct note_state *, unsigned int,
+ const char *, void *, size_t);
+
+
#endif /* _KERNEL */
#endif /* !_SYS_EXEC_ELF_H_ */
diff --git a/cpukit/libcrypt/crypt-md5.c b/cpukit/libcrypt/crypt-md5.c
index c60dcf8973..ca86bcd9b7 100644
--- a/cpukit/libcrypt/crypt-md5.c
+++ b/cpukit/libcrypt/crypt-md5.c
@@ -1,4 +1,6 @@
/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 2003 Poul-Henning Kamp
* All rights reserved.
*
diff --git a/cpukit/libcrypt/crypt-sha256.c b/cpukit/libcrypt/crypt-sha256.c
index 7a677284b5..24373680f7 100644
--- a/cpukit/libcrypt/crypt-sha256.c
+++ b/cpukit/libcrypt/crypt-sha256.c
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 2011 The FreeBSD Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,15 +69,12 @@ crypt_sha256_r(const char *key, const char *salt, struct crypt_data *data)
uint8_t alt_result[32], temp_result[32];
SHA256_CTX ctx, alt_ctx;
size_t salt_len, key_len, cnt, rounds;
- char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp;
+ char *cp, *p_bytes, *s_bytes, *endp;
const char *num;
bool rounds_custom;
char *buffer = &data->buffer[0];
int buflen = (int)sizeof(data->buffer);
- copied_key = NULL;
- copied_salt = NULL;
-
/* Default number of rounds. */
rounds = ROUNDS_DEFAULT;
rounds_custom = false;
@@ -258,12 +257,6 @@ crypt_sha256_r(const char *key, const char *salt, struct crypt_data *data)
memset(temp_result, '\0', sizeof(temp_result));
memset(p_bytes, '\0', key_len);
memset(s_bytes, '\0', salt_len);
- memset(&ctx, '\0', sizeof(ctx));
- memset(&alt_ctx, '\0', sizeof(alt_ctx));
- if (copied_key != NULL)
- memset(copied_key, '\0', key_len);
- if (copied_salt != NULL)
- memset(copied_salt, '\0', salt_len);
return buffer;
}
diff --git a/cpukit/libcrypt/crypt-sha512.c b/cpukit/libcrypt/crypt-sha512.c
index d418b8946a..da8acd7790 100644
--- a/cpukit/libcrypt/crypt-sha512.c
+++ b/cpukit/libcrypt/crypt-sha512.c
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 2011 The FreeBSD Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,15 +69,12 @@ crypt_sha512_r(const char *key, const char *salt, struct crypt_data *data)
uint8_t alt_result[64], temp_result[64];
SHA512_CTX ctx, alt_ctx;
size_t salt_len, key_len, cnt, rounds;
- char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp;
+ char *cp, *p_bytes, *s_bytes, *endp;
const char *num;
bool rounds_custom;
char *buffer = &data->buffer[0];
int buflen = (int)sizeof(data->buffer);
- copied_key = NULL;
- copied_salt = NULL;
-
/* Default number of rounds. */
rounds = ROUNDS_DEFAULT;
rounds_custom = false;
@@ -270,12 +269,6 @@ crypt_sha512_r(const char *key, const char *salt, struct crypt_data *data)
memset(temp_result, '\0', sizeof(temp_result));
memset(p_bytes, '\0', key_len);
memset(s_bytes, '\0', salt_len);
- memset(&ctx, '\0', sizeof(ctx));
- memset(&alt_ctx, '\0', sizeof(alt_ctx));
- if (copied_key != NULL)
- memset(copied_key, '\0', key_len);
- if (copied_salt != NULL)
- memset(copied_salt, '\0', salt_len);
return buffer;
}
diff --git a/cpukit/libcrypt/misc.c b/cpukit/libcrypt/misc.c
index 5daffba391..b553068f10 100644
--- a/cpukit/libcrypt/misc.c
+++ b/cpukit/libcrypt/misc.c
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 1999
* University of California. All rights reserved.
*
diff --git a/cpukit/libcsupport/src/gcovfork.c b/cpukit/libcsupport/src/gcovfork.c
new file mode 100644
index 0000000000..763412d735
--- /dev/null
+++ b/cpukit/libcsupport/src/gcovfork.c
@@ -0,0 +1,94 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup libcsupport
+ *
+ * @brief This source file contains functions required by GCC if code and
+ * branch coverage instrumentation (gcov) is enabled.
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+
+#include <errno.h>
+
+#include <rtems/seterr.h>
+
+int __gcov_execl( const char *, char *, ... );
+
+int __gcov_execl( const char *path, char *arg, ... )
+{
+ rtems_set_errno_and_return_minus_one( ENOSYS );
+}
+
+int __gcov_execlp( const char *, char *, ... );
+
+int __gcov_execlp( const char *path, char *arg, ... )
+{
+ rtems_set_errno_and_return_minus_one( ENOSYS );
+}
+
+int __gcov_execle( const char *, char *, ... );
+
+int __gcov_execle( const char *path, char *arg, ... )
+{
+ rtems_set_errno_and_return_minus_one( ENOSYS );
+}
+
+int __gcov_execv( const char *, char *const[] );
+
+int __gcov_execv( const char *path, char *const argv[] )
+{
+ rtems_set_errno_and_return_minus_one( ENOSYS );
+}
+
+int __gcov_execvp( const char *, char *const[] );
+
+int __gcov_execvp( const char *path, char *const argv[] )
+{
+ rtems_set_errno_and_return_minus_one( ENOSYS );
+}
+
+int __gcov_execve( const char *, char *const[], char *const[] );
+
+int __gcov_execve( const char *path, char *const argv[], char *const envp[] )
+{
+ rtems_set_errno_and_return_minus_one( ENOSYS );
+}
+
+pid_t __gcov_fork( void );
+
+pid_t __gcov_fork( void )
+{
+ rtems_set_errno_and_return_minus_one( ENOSYS );
+}
diff --git a/cpukit/libcsupport/src/getreentglobal.c b/cpukit/libcsupport/src/getreentglobal.c
index 72b513ee81..c64f09ac2c 100644
--- a/cpukit/libcsupport/src/getreentglobal.c
+++ b/cpukit/libcsupport/src/getreentglobal.c
@@ -15,8 +15,10 @@
#if defined(RTEMS_NEWLIB)
#include <sys/reent.h>
+#ifndef _REENT_THREAD_LOCAL
struct _reent *__getreent(void)
{
return _GLOBAL_REENT;
}
#endif
+#endif
diff --git a/cpukit/libcsupport/src/newlibc_reent.c b/cpukit/libcsupport/src/newlibc_reent.c
index 2dccfd0375..ee82f00858 100644
--- a/cpukit/libcsupport/src/newlibc_reent.c
+++ b/cpukit/libcsupport/src/newlibc_reent.c
@@ -29,6 +29,7 @@
#include <rtems/libcsupport.h>
#include <rtems/score/threadimpl.h>
+#ifndef _REENT_THREAD_LOCAL
bool newlib_create_hook(
rtems_tcb *current_task RTEMS_UNUSED,
rtems_tcb *creating_task
@@ -38,12 +39,17 @@ bool newlib_create_hook(
return true;
}
+#endif
void newlib_terminate_hook(
rtems_tcb *current_task
)
{
+#ifdef _REENT_THREAD_LOCAL
+ _reclaim_reent(NULL);
+#else
_reclaim_reent(current_task->libc_reent);
+#endif
}
#endif
diff --git a/cpukit/libdebugger/rtems-debugger-aarch64.c b/cpukit/libdebugger/rtems-debugger-aarch64.c
index 279c2d61ef..9a53da0de9 100644
--- a/cpukit/libdebugger/rtems-debugger-aarch64.c
+++ b/cpukit/libdebugger/rtems-debugger-aarch64.c
@@ -34,7 +34,9 @@
#include <inttypes.h>
#include <stdlib.h>
-/* Defined by linkcmds.base */
+/* Defined by linkcmds.base. This should be taken from <bsp/linker-symbols.h> */
+extern char bsp_section_start_begin[];
+extern char bsp_section_start_end[];
extern char bsp_section_text_begin[];
extern char bsp_section_text_end[];
extern char bsp_section_fast_text_begin[];
@@ -1231,6 +1233,8 @@ static rtems_status_code rtems_debugger_target_set_text_writable(
bool writable
)
{
+ uintptr_t start_begin = (uintptr_t) bsp_section_start_begin;
+ uintptr_t start_end = (uintptr_t) bsp_section_start_end;
uintptr_t text_begin = (uintptr_t) bsp_section_text_begin;
uintptr_t text_end = (uintptr_t) bsp_section_text_end;
uintptr_t fast_text_begin = (uintptr_t) bsp_section_fast_text_begin;
@@ -1243,6 +1247,23 @@ static rtems_status_code rtems_debugger_target_set_text_writable(
}
target_printk(
+ "[} MMU edit: start_begin: 0x%016" PRIxPTR
+ " start_end: 0x%016" PRIxPTR "\n",
+ start_begin,
+ start_end
+ );
+ sc = aarch64_mmu_map(
+ start_begin,
+ start_end - start_begin,
+ mmu_flags
+ );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ target_printk( "[} MMU edit failed\n" );
+ return sc;
+ }
+
+ target_printk(
"[} MMU edit: text_begin: 0x%016" PRIxPTR
" text_end: 0x%016" PRIxPTR "\n",
text_begin,
diff --git a/cpukit/libdl/rtl-elf.c b/cpukit/libdl/rtl-elf.c
index 37d9f4575e..8a21c5df73 100644
--- a/cpukit/libdl/rtl-elf.c
+++ b/cpukit/libdl/rtl-elf.c
@@ -1171,7 +1171,7 @@ rtems_rtl_elf_symbols_load (rtems_rtl_obj* obj,
rtems_chain_set_off_chain (&osym->node);
memcpy (string, name, strlen (name) + 1);
osym->name = string;
- osym->value = (uint8_t*) value;
+ osym->value = (void*) (intptr_t) value;
osym->data = symbol.st_shndx;
if (rtems_rtl_trace (RTEMS_RTL_TRACE_SYMBOL))
diff --git a/cpukit/libdl/rtl-elf.h b/cpukit/libdl/rtl-elf.h
index c7c17c525a..0476c1ecd7 100644
--- a/cpukit/libdl/rtl-elf.h
+++ b/cpukit/libdl/rtl-elf.h
@@ -51,7 +51,7 @@ extern "C" {
/*
* Do not add '()'. Leave plain.
*/
-#if defined(__powerpc64__) || defined(__arch64__) || (__riscv_xlen == 64)
+#if defined(__powerpc64__) || defined(__aarch64__) || (__riscv_xlen == 64)
#define ELFSIZE 64
#else
#define ELFSIZE 32
diff --git a/cpukit/libdl/rtl-mdreloc-aarch64.c b/cpukit/libdl/rtl-mdreloc-aarch64.c
new file mode 100644
index 0000000000..c60ecb31c9
--- /dev/null
+++ b/cpukit/libdl/rtl-mdreloc-aarch64.c
@@ -0,0 +1,520 @@
+/*
+ * Taken from NetBSD and stripped of the relocations not needed on RTEMS.
+ */
+
+/* $NetBSD: mdreloc.c,v 1.14 2020/06/16 21:01:30 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 2014-2015 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: mdreloc.c,v 1.14 2020/06/16 21:01:30 joerg Exp $");
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <sys/endian.h>
+
+#include <rtems/rtl/rtl.h>
+#include "rtl-elf.h"
+#include "rtl-error.h"
+#include <rtems/rtl/rtl-trace.h>
+#include "rtl-unwind-arm.h"
+
+struct tls_data {
+ size_t td_tlsindex;
+ Elf_Addr td_tlsoffs;
+};
+
+rtems_rtl_elf_rel_status
+rtems_rtl_elf_reloc_rela (
+ rtems_rtl_obj* obj,
+ const Elf_Rela* rela,
+ const rtems_rtl_obj_sect* sect,
+ const char* symname,
+ const Elf_Byte syminfo,
+ const Elf_Word symvalue,
+ const bool parsing
+);
+
+#define __BITS(hi,lo) ((~((~(Elf_Addr)0)<<((hi)+1)))&((~(Elf_Addr)0)<<(lo)))
+#define WIDTHMASK(w) (0xffffffffffffffffUL >> (64 - (w)))
+
+static inline bool
+checkoverflow(Elf_Addr addr, int bitwidth, Elf_Addr targetaddr,
+ const char *bitscale, void *where, Elf64_Addr off)
+{
+ const Elf_Addr mask = ~__BITS(bitwidth - 1, 0);
+
+ if (((addr & mask) != 0) && ((addr & mask) != mask)) {
+ printf("kobj_reloc: Relocation 0x%jx too far from %p"
+ " (base+0x%jx) for %dbit%s\n",
+ (uintptr_t)targetaddr, where, off, bitwidth, bitscale);
+ return true;
+ }
+
+ return false;
+}
+
+static inline bool
+checkalign(Elf_Addr addr, int alignbyte, void *where, Elf64_Addr off)
+{
+ if ((addr & (alignbyte - 1)) != 0) {
+ printf("kobj_reloc: Relocation 0x%jx unaligned at %p"
+ " (base+0x%jx). must be aligned %d\n",
+ (uintptr_t)addr, where, off, alignbyte);
+ return true;
+ }
+ return false;
+}
+
+/*
+ * Set to 1 to allow untested relocations. If you tested one and it
+ * works or you fixed the relocation please remove the guard.
+ */
+#define ALLOW_UNTESTED_RELOCS 1
+
+static void*
+set_veneer(void* tramopline, Elf_Addr target)
+{
+ /*
+ * http://shell-storm.org/online/Online-Assembler-and-Disassembler/
+ *
+ * ldr x9, #8
+ * br x9
+ *
+ */
+ uint64_t* tramp = (uint64_t*) tramopline;
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ *tramp++ = 0xd61f012058000049;
+#else
+ *tramp++ = 0xd61f012058000049; /* not tested */
+#endif
+ *tramp++ = (uint64_t) target;
+ return tramp;
+}
+
+static size_t
+get_veneer_size(int type)
+{
+ (void) type;
+ return 16;
+}
+
+size_t
+rtems_rtl_elf_relocate_tramp_max_size (void)
+{
+ return 16;
+}
+
+uint32_t
+rtems_rtl_elf_section_flags (const rtems_rtl_obj* obj,
+ const Elf_Shdr* shdr)
+{
+ return 0;
+}
+
+uint32_t
+rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
+ int section,
+ const char* name,
+ const Elf_Shdr* shdr,
+ const uint32_t flags)
+{
+ (void) obj;
+ (void) section;
+ (void) name;
+ (void) shdr;
+ return flags;
+}
+
+bool
+rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
+ rtems_rtl_obj_sect* sect)
+{
+ (void) obj;
+ (void) sect;
+ return false;
+}
+
+bool
+rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
+ rtems_rtl_obj_sect* sect)
+{
+ (void) obj;
+ (void) sect;
+ return false;
+}
+
+bool
+rtems_rtl_elf_rel_resolve_sym (Elf_Word type)
+{
+ return true;
+}
+
+rtems_rtl_elf_rel_status
+rtems_rtl_elf_reloc_rela (rtems_rtl_obj* obj,
+ const Elf_Rela* rela,
+ const rtems_rtl_obj_sect* sect,
+ const char* symname,
+ const Elf_Byte syminfo,
+ const Elf_Word symvalue,
+ const bool parsing)
+{
+ Elf64_Addr *where;
+ Elf32_Addr *where32;
+ Elf_Addr off = rela->r_offset;
+ Elf_Addr target;
+ Elf_Addr raddr;
+ uint32_t *insn, immhi, immlo, shift;
+
+ where = (Elf_Addr *)(sect->base + rela->r_offset);
+ where32 = (void *)where;
+
+ insn = (uint32_t *)where;
+
+ /*
+ * S - the address of the symbol
+ * A - the addend of the reolcation
+ * P - the address of the place being relocated (derived from r_offset)
+ * Page(expr) - the page address of the expression expr, defined as (expr & ~0xFFF).
+ */
+ switch (ELF_R_TYPE(rela->r_info)) {
+ case R_TYPE(NONE):
+ if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) {
+ printf ("rtl: NONE %p in %s\n", where, rtems_rtl_obj_oname (obj));
+ }
+ break;
+
+ case R_TYPE(ABS64): /* word S + A */
+ case R_TYPE(GLOB_DAT): /* word S + A */
+ if (!parsing) {
+ target = (Elf_Addr)symvalue + rela->r_addend;
+
+ if (*where != target)
+ *where = target;
+
+ if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
+ printf ("rtl: reloc 64/GLOB_DAT in %s --> %p in %s\n",
+ sect->name, (void *)*where,
+ rtems_rtl_obj_oname (obj));
+ }
+ break;
+
+ /*
+ * If S is a normal symbol, resolves to the difference between the static
+ * link address of S and the execution address of S. If S is the null symbol
+ * (ELF symbol index 0), resolves to the difference between the static link
+ * address of P and the execution address of P.
+ */
+ case R_TYPE(RELATIVE): /* Delta(S) + A */
+ if (!parsing) {
+ *where = (Elf_Addr)(sect->base + rela->r_addend);
+ if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
+ printf ("rtl: reloc RELATIVE in %s --> %p in %s\n",
+ sect->name, (void *)*where,
+ rtems_rtl_obj_oname (obj));
+ }
+ break;
+
+ case R_TYPE(COPY):
+ /*
+ * These are deferred until all other relocations have
+ * been done. All we do here is make sure that the
+ * COPY relocation is not in a shared library. They
+ * are allowed only in executable files.
+ */
+ printf("rtl: reloc COPY (please report)\n");
+ break;
+
+ case R_AARCH64_ADD_ABS_LO12_NC: /* S + A */
+ case R_AARCH64_LDST8_ABS_LO12_NC:
+ case R_AARCH_LDST16_ABS_LO12_NC:
+ case R_AARCH_LDST32_ABS_LO12_NC:
+ case R_AARCH_LDST64_ABS_LO12_NC:
+ switch (ELF_R_TYPE(rela->r_info)) {
+ case R_AARCH64_ADD_ABS_LO12_NC:
+ case R_AARCH64_LDST8_ABS_LO12_NC:
+ shift = 0;
+ break;
+ case R_AARCH_LDST16_ABS_LO12_NC:
+ shift = 1;
+ break;
+ case R_AARCH_LDST32_ABS_LO12_NC:
+ shift = 2;
+ break;
+ case R_AARCH_LDST64_ABS_LO12_NC:
+ shift = 3;
+ break;
+ default:
+ printf("illegal rtype: %ld\n", ELF_R_TYPE(rela->r_info));
+ break;
+ }
+
+ /*
+ * S + A
+ * e.g.) add x0,x0,#:lo12:<sym>+<addend>
+ * ldrb w0,[x0,#:lo12:<sym>+<addend>]
+ * ldrh w0,[x0,#:lo12:<sym>+<addend>]
+ * ldr w0,[x0,#:lo12:<sym>+<addend>]
+ * ldr x0,[x0,#:lo12:<sym>+<addend>]
+ */
+ if (!parsing) {
+ target = (Elf_Addr)symvalue + rela->r_addend;
+ if (checkalign(target, 1 << shift, where, off)) {
+ printf ("rtl: reloc checkalign failed in %s --> %p in %s\n",
+ sect->name, (void *)*where,
+ rtems_rtl_obj_oname (obj));
+ printf("ELF_R_TYPE is : %ld\n", ELF_R_TYPE(rela->r_info));
+ break;
+ }
+ target &= WIDTHMASK(12);
+ target >>= shift;
+ *insn = htole32(
+ (le32toh(*insn) & ~__BITS(21,10)) | (target << 10));
+ }
+ break;
+
+ case R_AARCH64_ADR_PREL_PG_HI21:
+ /*
+ * Page(S + A) - Page(P)
+ * e.g.) adrp x0,<sym>+<addend>
+ */
+ if (!parsing) {
+ target = (Elf_Addr)symvalue + rela->r_addend;
+ target = target >> 12;
+ raddr = target << 12;
+ target -= (uintptr_t)where >> 12;
+
+ if (checkoverflow(target, 21, raddr, " x 4k", where, off)) {
+ return rtems_rtl_elf_rel_failure;
+ }
+
+ immlo = target & WIDTHMASK(2);
+ immhi = (target >> 2) & WIDTHMASK(19);
+ *insn = htole32((le32toh(*insn) &
+ ~(__BITS(30,29) | __BITS(23,5))) |
+ (immlo << 29) | (immhi << 5));
+ }
+ break;
+
+ case R_AARCH_JUMP26:
+ case R_AARCH_CALL26:
+ /*
+ * S + A - P
+ * e.g.) b <sym>+<addend>
+ * bl <sym>+<addend>
+ */
+ if (parsing && sect->base == 0) {
+ if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
+ printf ("rtl: JUMP26/PC26/CALL tramp cache\n");
+ return rtems_rtl_elf_rel_tramp_cache;
+ }
+
+ raddr = (Elf_Addr)symvalue + rela->r_addend;
+ target = raddr - (uintptr_t)where;
+ if (checkalign(target, 4, where, off)) {
+ return rtems_rtl_elf_rel_failure;
+ }
+
+ target = (intptr_t)target >> 2;
+
+ if (((Elf_Sword)target > 0x1FFFFFF) || ((Elf_Sword)target < -0x2000000)) {
+ Elf_Word tramp_addr;
+ size_t tramp_size = get_veneer_size(ELF_R_TYPE(rela->r_info));
+
+ if (parsing) {
+ if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
+ printf ("rtl: JUMP26/PC26/CALL tramp add\n");
+ return rtems_rtl_elf_rel_tramp_add;
+ }
+
+ if (!rtems_rtl_obj_has_tramp_space (obj, tramp_size)) {
+ rtems_rtl_set_error (EINVAL,
+ "%s: CALL/JUMP26: overflow: no tramp memory",
+ sect->name);
+ return rtems_rtl_elf_rel_failure;
+ }
+
+ tramp_addr = ((Elf_Addr) obj->tramp_brk) | (symvalue & 1);
+ obj->tramp_brk = set_veneer(obj->tramp_brk, symvalue);
+
+ target = tramp_addr + rela->r_addend - (uintptr_t)where;
+ target = (uintptr_t)target >> 2;
+ }
+
+ if (checkoverflow(target, 26, raddr, " word", where, off)) {
+ return rtems_rtl_elf_rel_failure;
+ }
+
+ if (!parsing) {
+ target &= WIDTHMASK(26);
+ *insn = htole32((le32toh(*insn) & ~__BITS(25,0)) | target);
+ }
+
+ break;
+
+ case R_AARCH64_PREL32:
+ /*
+ * S + A - P
+ * e.g.) 1: .word <sym>+<addend>-1b
+ */
+ if (!parsing) {
+ raddr = (Elf_Addr)symvalue + rela->r_addend;
+ target = raddr - (uintptr_t)where;
+ if (checkoverflow(target, 32, raddr, "", where, off)) {
+ return rtems_rtl_elf_rel_failure;
+ }
+ *where32 = target;
+ }
+ break;
+
+ case R_TYPE(TLSDESC):
+ printf ("rtl: reloc TLSDESC in %s --> %p in %s\n",
+ sect->name, (void *)*where,
+ rtems_rtl_obj_oname (obj));
+ break;
+
+ case R_TLS_TYPE(TLS_DTPREL):
+ printf ("rtl: reloc TLS_DTPREL in %s --> %p in %s\n",
+ sect->name, (void *)*where,
+ rtems_rtl_obj_oname (obj));
+ break;
+ case R_TLS_TYPE(TLS_DTPMOD):
+ printf ("rtl: reloc TLS_DTPMOD in %s --> %p in %s\n",
+ sect->name, (void *)*where,
+ rtems_rtl_obj_oname (obj));
+ break;
+
+ case R_TLS_TYPE(TLS_TPREL):
+ printf ("rtl: reloc TLS_TPREL in %s --> %p in %s\n",
+ sect->name, (void *)*where,
+ rtems_rtl_obj_oname (obj));
+ break;
+
+ default:
+ printf ("rtl: Unsupported relocation type in %s --> %p in %s\n",
+ sect->name, (void *)where,
+ rtems_rtl_obj_oname (obj));
+ return rtems_rtl_elf_rel_failure;
+ }
+
+ return rtems_rtl_elf_rel_no_error;
+}
+
+rtems_rtl_elf_rel_status
+rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj,
+ const Elf_Rela* rela,
+ const rtems_rtl_obj_sect* sect,
+ const char* symname,
+ const Elf_Byte syminfo,
+ const Elf_Word symvalue)
+{
+ return rtems_rtl_elf_reloc_rela (obj,
+ rela,
+ sect,
+ symname,
+ syminfo,
+ symvalue,
+ true);
+}
+
+rtems_rtl_elf_rel_status
+rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj,
+ const Elf_Rela* rela,
+ const rtems_rtl_obj_sect* sect,
+ const char* symname,
+ const Elf_Byte syminfo,
+ const Elf_Word symvalue)
+{
+ return rtems_rtl_elf_reloc_rela (obj,
+ rela,
+ sect,
+ symname,
+ syminfo,
+ symvalue,
+ false);
+}
+
+rtems_rtl_elf_rel_status
+rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj,
+ const Elf_Rel* rel,
+ const rtems_rtl_obj_sect* sect,
+ const char* symname,
+ const Elf_Byte syminfo,
+ const Elf_Word symvalue)
+{
+ rtems_rtl_set_error (EINVAL, "rela type record not supported");
+ return rtems_rtl_elf_rel_failure;
+}
+
+rtems_rtl_elf_rel_status
+rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj,
+ const Elf_Rel* rel,
+ const rtems_rtl_obj_sect* sect,
+ const char* symname,
+ const Elf_Byte syminfo,
+ const Elf_Word symvalue)
+{
+ rtems_rtl_set_error (EINVAL, "rela type record not supported");
+ return rtems_rtl_elf_rel_failure;
+}
diff --git a/cpukit/libdl/rtl-mdreloc-arm.c b/cpukit/libdl/rtl-mdreloc-arm.c
index 4950dcdab1..fbfd42dc58 100644
--- a/cpukit/libdl/rtl-mdreloc-arm.c
+++ b/cpukit/libdl/rtl-mdreloc-arm.c
@@ -12,14 +12,12 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unwind.h>
-#include <unwind-arm-common.h>
#include <rtems/rtl/rtl.h>
#include "rtl-elf.h"
#include "rtl-error.h"
#include <rtems/rtl/rtl-trace.h>
-#include "rtl-unwind.h"
+#include "rtl-unwind-arm.h"
/*
* Set to 1 to allow untested relocations. If you tested one and it
@@ -597,78 +595,3 @@ rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj,
symvalue,
false);
}
-
-bool
-rtems_rtl_elf_unwind_parse (const rtems_rtl_obj* obj,
- const char* name,
- uint32_t flags)
-{
- /*
- * We location the EH sections in section flags.
- */
- return false;
-}
-
-bool
-rtems_rtl_elf_unwind_register (rtems_rtl_obj* obj)
-{
- return true;
-}
-
-bool
-rtems_rtl_elf_unwind_deregister (rtems_rtl_obj* obj)
-{
- obj->loader = NULL;
- return true;
-}
-
-/* An exception index table entry. */
-typedef struct __EIT_entry
-{
- _uw fnoffset;
- _uw content;
-} __EIT_entry;
-
-/* The exception index table location in the base module */
-extern __EIT_entry __exidx_start;
-extern __EIT_entry __exidx_end;
-
-/*
- * A weak reference is in libgcc, provide a real version and provide a way to
- * manage loaded modules.
- *
- * Passed in the return address and a reference to the number of records
- * found. We set the start of the exidx data and the number of records.
- */
-_Unwind_Ptr __gnu_Unwind_Find_exidx (_Unwind_Ptr return_address,
- int* nrec) __attribute__ ((__noinline__,
- __used__,
- __noclone__));
-
-_Unwind_Ptr __gnu_Unwind_Find_exidx (_Unwind_Ptr return_address,
- int* nrec)
-{
- rtems_rtl_data* rtl;
- rtems_chain_node* node;
- __EIT_entry* exidx_start = &__exidx_start;
- __EIT_entry* exidx_end = &__exidx_end;
-
- rtl = rtems_rtl_lock ();
-
- node = rtems_chain_first (&rtl->objects);
- while (!rtems_chain_is_tail (&rtl->objects, node)) {
- rtems_rtl_obj* obj = (rtems_rtl_obj*) node;
- if (rtems_rtl_obj_text_inside (obj, (void*) return_address)) {
- exidx_start = (__EIT_entry*) obj->eh_base;
- exidx_end = (__EIT_entry*) (obj->eh_base + obj->eh_size);
- break;
- }
- node = rtems_chain_next (node);
- }
-
- rtems_rtl_unlock ();
-
- *nrec = exidx_end - exidx_start;
-
- return (_Unwind_Ptr) exidx_start;
-}
diff --git a/cpukit/libdl/rtl-obj-comp.c b/cpukit/libdl/rtl-obj-comp.c
index ea408527b7..001d416e80 100644
--- a/cpukit/libdl/rtl-obj-comp.c
+++ b/cpukit/libdl/rtl-obj-comp.c
@@ -115,7 +115,7 @@ rtems_rtl_obj_comp_read (rtems_rtl_obj_comp* comp,
}
if (rtems_rtl_trace (RTEMS_RTL_TRACE_COMP))
- printf ("rtl: comp: %2d: fd=%d length=%zu level=%u offset=%" PRIdoff_t " area=[%"
+ printf ("rtl: comp: %2d: fd=%d length=%zu level=%zu offset=%" PRIdoff_t " area=[%"
PRIdoff_t ",%" PRIdoff_t "] read=%" PRIu32 " size=%zu\n",
comp->fd, comp->cache->fd, length, comp->level, comp->offset,
comp->offset, comp->offset + length,
@@ -143,7 +143,7 @@ rtems_rtl_obj_comp_read (rtems_rtl_obj_comp* comp,
if ((comp->level - buffer_level) != 0)
{
if (rtems_rtl_trace (RTEMS_RTL_TRACE_COMP))
- printf ("rtl: comp: copy-down: level=%u length=%zu\n",
+ printf ("rtl: comp: copy-down: level=%zu length=%zu\n",
comp->level, comp->level - buffer_level);
memmove (comp->buffer,
@@ -221,7 +221,7 @@ rtems_rtl_obj_comp_read (rtems_rtl_obj_comp* comp,
if (rtems_rtl_trace (RTEMS_RTL_TRACE_COMP))
printf ("rtl: comp: expand: offset=%" PRIdoff_t \
- " level=%u read=%" PRIu32 "\n",
+ " level=%zu read=%" PRIu32 "\n",
comp->offset, comp->level, comp->read);
}
}
diff --git a/cpukit/libdl/rtl-shell.c b/cpukit/libdl/rtl-shell.c
index 732f66131e..69de6bad83 100644
--- a/cpukit/libdl/rtl-shell.c
+++ b/cpukit/libdl/rtl-shell.c
@@ -406,7 +406,7 @@ typedef struct
const rtems_rtl_obj_print* print; /**< The print data. */
bool first; /**< Is this the first line printed. */
bool show_name; /**< Show the object name. */
- size_t indent; /**< The indent. */
+ int indent; /**< The indent. */
} rtems_rtl_dep_data;
static bool
@@ -849,7 +849,7 @@ rtems_rtl_shell_archive (const rtems_printer* printer, int argc, char* argv[])
while (!rtems_chain_is_tail (&rtl->archives.archives, node))
{
- #define SYM_DUPLICATE (1 << ((8 * sizeof (size_t)) - 1))
+ #define SYM_DUPLICATE (((size_t) 1) << ((8 * sizeof (size_t)) - 1))
rtems_rtl_archive* archive = (rtems_rtl_archive*) node;
diff --git a/cpukit/libdl/rtl-sym.c b/cpukit/libdl/rtl-sym.c
index c29c8c49d6..5c9c3981df 100644
--- a/cpukit/libdl/rtl-sym.c
+++ b/cpukit/libdl/rtl-sym.c
@@ -124,7 +124,7 @@ rtems_rtl_symbol_global_add (rtems_rtl_obj* obj,
return false;
}
++count;
- s += l + sizeof (unsigned long) + 1;
+ s += l + sizeof (void *) + 1;
}
/*
diff --git a/cpukit/libdl/rtl-unresolved.c b/cpukit/libdl/rtl-unresolved.c
index a774c7f1c9..43a05e9887 100644
--- a/cpukit/libdl/rtl-unresolved.c
+++ b/cpukit/libdl/rtl-unresolved.c
@@ -810,8 +810,8 @@ rtems_rtl_unresolved_dump_iterator (rtems_rtl_unresolv_rec* rec,
case rtems_rtl_trampoline_reloc:
if (dd->show_relocs)
printf (" %3zu: 2:reloc%c: obj:%s name:%2d: sect:%d\n",
- rec->type == rtems_rtl_unresolved_reloc ? 'R' : 'T',
dd->rec,
+ rec->type == rtems_rtl_unresolved_reloc ? 'R' : 'T',
rec->rec.reloc.obj == NULL ? "resolved" : rec->rec.reloc.obj->oname,
rec->rec.reloc.name,
rec->rec.reloc.sect);
diff --git a/cpukit/libdl/rtl-unwind-arm.c b/cpukit/libdl/rtl-unwind-arm.c
new file mode 100644
index 0000000000..35361fe8d5
--- /dev/null
+++ b/cpukit/libdl/rtl-unwind-arm.c
@@ -0,0 +1,65 @@
+#include "rtl-unwind-arm.h"
+
+bool
+rtems_rtl_elf_unwind_parse (const rtems_rtl_obj* obj,
+ const char* name,
+ uint32_t flags)
+{
+ /*
+ * We location the EH sections in section flags.
+ */
+ return false;
+}
+
+bool
+rtems_rtl_elf_unwind_register (rtems_rtl_obj* obj)
+{
+ return true;
+}
+
+bool
+rtems_rtl_elf_unwind_deregister (rtems_rtl_obj* obj)
+{
+ obj->loader = NULL;
+ return true;
+}
+
+/*
+ * A weak reference is in libgcc, provide a real version and provide a way to
+ * manage loaded modules.
+ *
+ * Passed in the return address and a reference to the number of records
+ * found. We set the start of the exidx data and the number of records.
+ */
+_Unwind_Ptr __gnu_Unwind_Find_exidx (_Unwind_Ptr return_address,
+ int* nrec) __attribute__ ((__noinline__,
+ __used__,
+ __noclone__));
+
+_Unwind_Ptr __gnu_Unwind_Find_exidx (_Unwind_Ptr return_address,
+ int* nrec)
+{
+ rtems_rtl_data* rtl;
+ rtems_chain_node* node;
+ __EIT_entry* exidx_start = &__exidx_start;
+ __EIT_entry* exidx_end = &__exidx_end;
+
+ rtl = rtems_rtl_lock ();
+
+ node = rtems_chain_first (&rtl->objects);
+ while (!rtems_chain_is_tail (&rtl->objects, node)) {
+ rtems_rtl_obj* obj = (rtems_rtl_obj*) node;
+ if (rtems_rtl_obj_text_inside (obj, (void*) return_address)) {
+ exidx_start = (__EIT_entry*) obj->eh_base;
+ exidx_end = (__EIT_entry*) (obj->eh_base + obj->eh_size);
+ break;
+ }
+ node = rtems_chain_next (node);
+ }
+
+ rtems_rtl_unlock ();
+
+ *nrec = exidx_end - exidx_start;
+
+ return (_Unwind_Ptr) exidx_start;
+}
diff --git a/cpukit/libdl/rtl-unwind-arm.h b/cpukit/libdl/rtl-unwind-arm.h
new file mode 100644
index 0000000000..08a2660560
--- /dev/null
+++ b/cpukit/libdl/rtl-unwind-arm.h
@@ -0,0 +1,46 @@
+#include <unwind.h>
+
+#include <rtems/rtl/rtl.h>
+#include "rtl-unwind.h"
+
+typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
+typedef _Unwind_Word _uw;
+
+bool
+rtems_rtl_elf_unwind_parse (const rtems_rtl_obj* obj,
+ const char* name,
+ uint32_t flags);
+
+bool
+rtems_rtl_elf_unwind_register (rtems_rtl_obj* obj);
+
+bool
+rtems_rtl_elf_unwind_deregister (rtems_rtl_obj* obj);
+
+/* An exception index table entry. */
+typedef struct __EIT_entry
+{
+ _uw fnoffset;
+ _uw content;
+} __EIT_entry;
+
+/* The exception index table location in the base module */
+extern __EIT_entry __exidx_start;
+extern __EIT_entry __exidx_end;
+
+/*
+ * A weak reference is in libgcc, provide a real version and provide a way to
+ * manage loaded modules.
+ *
+ * Passed in the return address and a reference to the number of records
+ * found. We set the start of the exidx data and the number of records.
+ */
+_Unwind_Ptr
+__gnu_Unwind_Find_exidx (_Unwind_Ptr return_address,
+ int* nrec) __attribute__ ((__noinline__,
+ __used__,
+ __noclone__));
+
+_Unwind_Ptr
+__gnu_Unwind_Find_exidx (_Unwind_Ptr return_address,
+ int* nrec);
diff --git a/cpukit/libfs/src/dosfs/msdos.h b/cpukit/libfs/src/dosfs/msdos.h
index df9600a02d..afdcd57ef5 100644
--- a/cpukit/libfs/src/dosfs/msdos.h
+++ b/cpukit/libfs/src/dosfs/msdos.h
@@ -72,12 +72,12 @@ typedef struct msdos_fs_info_s
rtems_dosfs_convert_control *converter;
} msdos_fs_info_t;
-RTEMS_INLINE_ROUTINE void msdos_fs_lock(msdos_fs_info_t *fs_info)
+static inline void msdos_fs_lock(msdos_fs_info_t *fs_info)
{
rtems_recursive_mutex_lock(&fs_info->vol_mutex);
}
-RTEMS_INLINE_ROUTINE void msdos_fs_unlock(msdos_fs_info_t *fs_info)
+static inline void msdos_fs_unlock(msdos_fs_info_t *fs_info)
{
rtems_recursive_mutex_unlock(&fs_info->vol_mutex);
}
diff --git a/cpukit/libfs/src/imfs/imfs_add_node.c b/cpukit/libfs/src/imfs/imfs_add_node.c
index 814736284d..d12ed03077 100644
--- a/cpukit/libfs/src/imfs/imfs_add_node.c
+++ b/cpukit/libfs/src/imfs/imfs_add_node.c
@@ -37,7 +37,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
int IMFS_add_node( const char *path, IMFS_jnode_t *node, void *arg )
{
diff --git a/cpukit/libfs/src/imfs/imfs_chown.c b/cpukit/libfs/src/imfs/imfs_chown.c
index 5a0049ba2d..20210470a1 100644
--- a/cpukit/libfs/src/imfs/imfs_chown.c
+++ b/cpukit/libfs/src/imfs/imfs_chown.c
@@ -38,7 +38,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
#include <unistd.h>
diff --git a/cpukit/libfs/src/imfs/imfs_fchmod.c b/cpukit/libfs/src/imfs/imfs_fchmod.c
index 7f885a1987..6f6c57ff23 100644
--- a/cpukit/libfs/src/imfs/imfs_fchmod.c
+++ b/cpukit/libfs/src/imfs/imfs_fchmod.c
@@ -38,7 +38,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
int IMFS_fchmod(
const rtems_filesystem_location_info_t *loc,
diff --git a/cpukit/libfs/src/imfs/imfs_fifo.c b/cpukit/libfs/src/imfs/imfs_fifo.c
index a3154e18bd..be86187663 100644
--- a/cpukit/libfs/src/imfs/imfs_fifo.c
+++ b/cpukit/libfs/src/imfs/imfs_fifo.c
@@ -37,7 +37,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
#include <sys/filio.h>
diff --git a/cpukit/libfs/src/imfs/imfs_linfile.c b/cpukit/libfs/src/imfs/imfs_linfile.c
index 4f961d19e8..c9b1ec9e90 100644
--- a/cpukit/libfs/src/imfs/imfs_linfile.c
+++ b/cpukit/libfs/src/imfs/imfs_linfile.c
@@ -38,7 +38,7 @@
#include <string.h>
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
static ssize_t IMFS_linfile_read(
rtems_libio_t *iop,
diff --git a/cpukit/libfs/src/imfs/imfs_link.c b/cpukit/libfs/src/imfs/imfs_link.c
index 301a280211..3ea05b0807 100644
--- a/cpukit/libfs/src/imfs/imfs_link.c
+++ b/cpukit/libfs/src/imfs/imfs_link.c
@@ -38,7 +38,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
static const IMFS_node_control IMFS_node_control_hard_link;
diff --git a/cpukit/libfs/src/imfs/imfs_make_generic_node.c b/cpukit/libfs/src/imfs/imfs_make_generic_node.c
index abecf5ec53..23beee431d 100644
--- a/cpukit/libfs/src/imfs/imfs_make_generic_node.c
+++ b/cpukit/libfs/src/imfs/imfs_make_generic_node.c
@@ -37,7 +37,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
#include <string.h>
diff --git a/cpukit/libfs/src/imfs/imfs_memfile.c b/cpukit/libfs/src/imfs/imfs_memfile.c
index 769a570ecf..66c67c6ba0 100644
--- a/cpukit/libfs/src/imfs/imfs_memfile.c
+++ b/cpukit/libfs/src/imfs/imfs_memfile.c
@@ -38,7 +38,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
#include <stdlib.h>
#include <string.h>
diff --git a/cpukit/libfs/src/imfs/imfs_mknod.c b/cpukit/libfs/src/imfs/imfs_mknod.c
index 17aa1d3802..cd027fe7f6 100644
--- a/cpukit/libfs/src/imfs/imfs_mknod.c
+++ b/cpukit/libfs/src/imfs/imfs_mknod.c
@@ -41,7 +41,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
static const IMFS_mknod_control *get_control(
const IMFS_mknod_controls *controls,
diff --git a/cpukit/libfs/src/imfs/imfs_node.c b/cpukit/libfs/src/imfs/imfs_node.c
index 91bd89d66c..10e9e72d01 100644
--- a/cpukit/libfs/src/imfs/imfs_node.c
+++ b/cpukit/libfs/src/imfs/imfs_node.c
@@ -41,7 +41,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
IMFS_jnode_t *IMFS_initialize_node(
IMFS_jnode_t *node,
diff --git a/cpukit/libfs/src/imfs/imfs_rename.c b/cpukit/libfs/src/imfs/imfs_rename.c
index d925591b32..94876d9217 100644
--- a/cpukit/libfs/src/imfs/imfs_rename.c
+++ b/cpukit/libfs/src/imfs/imfs_rename.c
@@ -38,7 +38,7 @@
#include "config.h"
#endif
-#include <rtems/imfs.h>
+#include <rtems/imfsimpl.h>
#include <string.h>
#include <stdlib.h>
diff --git a/cpukit/libmd/sha256c.c b/cpukit/libmd/sha256c.c
index 4c0371dda7..563f9e2099 100644
--- a/cpukit/libmd/sha256c.c
+++ b/cpukit/libmd/sha256c.c
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
+#include "sha224.h"
#include "sha256.h"
#if BYTE_ORDER == BIG_ENDIAN
@@ -74,6 +75,26 @@ be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len)
#endif /* BYTE_ORDER != BIG_ENDIAN */
+/* SHA256 round constants. */
+static const uint32_t K[64] = {
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
+ 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
+ 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
+ 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
+ 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
+ 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
+ 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
+ 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
+ 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
+ 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
+ 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
+ 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
+ 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
+ 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
+};
+
/* Elementary functions used by SHA256 */
#define Ch(x, y, z) ((x & (y ^ z)) ^ z)
#define Maj(x, y, z) ((x & (y | z)) | (y & z))
@@ -86,18 +107,21 @@ be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len)
/* SHA256 round function */
#define RND(a, b, c, d, e, f, g, h, k) \
- t0 = h + S1(e) + Ch(e, f, g) + k; \
- t1 = S0(a) + Maj(a, b, c); \
- d += t0; \
- h = t0 + t1;
+ h += S1(e) + Ch(e, f, g) + k; \
+ d += h; \
+ h += S0(a) + Maj(a, b, c);
/* Adjusted round function for rotating state */
-#define RNDr(S, W, i, k) \
+#define RNDr(S, W, i, ii) \
RND(S[(64 - i) % 8], S[(65 - i) % 8], \
S[(66 - i) % 8], S[(67 - i) % 8], \
S[(68 - i) % 8], S[(69 - i) % 8], \
S[(70 - i) % 8], S[(71 - i) % 8], \
- W[i] + k)
+ W[i + ii] + K[i + ii])
+
+/* Message schedule computation */
+#define MSCH(W, ii, i) \
+ W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) + W[i + ii]
/*
* SHA256 block compression function. The 256-bit state is transformed via
@@ -108,82 +132,52 @@ SHA256_Transform(uint32_t * state, const unsigned char block[64])
{
uint32_t W[64];
uint32_t S[8];
- uint32_t t0, t1;
int i;
- /* 1. Prepare message schedule W. */
+ /* 1. Prepare the first part of the message schedule W. */
be32dec_vect(W, block, 64);
- for (i = 16; i < 64; i++)
- W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16];
/* 2. Initialize working variables. */
memcpy(S, state, 32);
/* 3. Mix. */
- RNDr(S, W, 0, 0x428a2f98);
- RNDr(S, W, 1, 0x71374491);
- RNDr(S, W, 2, 0xb5c0fbcf);
- RNDr(S, W, 3, 0xe9b5dba5);
- RNDr(S, W, 4, 0x3956c25b);
- RNDr(S, W, 5, 0x59f111f1);
- RNDr(S, W, 6, 0x923f82a4);
- RNDr(S, W, 7, 0xab1c5ed5);
- RNDr(S, W, 8, 0xd807aa98);
- RNDr(S, W, 9, 0x12835b01);
- RNDr(S, W, 10, 0x243185be);
- RNDr(S, W, 11, 0x550c7dc3);
- RNDr(S, W, 12, 0x72be5d74);
- RNDr(S, W, 13, 0x80deb1fe);
- RNDr(S, W, 14, 0x9bdc06a7);
- RNDr(S, W, 15, 0xc19bf174);
- RNDr(S, W, 16, 0xe49b69c1);
- RNDr(S, W, 17, 0xefbe4786);
- RNDr(S, W, 18, 0x0fc19dc6);
- RNDr(S, W, 19, 0x240ca1cc);
- RNDr(S, W, 20, 0x2de92c6f);
- RNDr(S, W, 21, 0x4a7484aa);
- RNDr(S, W, 22, 0x5cb0a9dc);
- RNDr(S, W, 23, 0x76f988da);
- RNDr(S, W, 24, 0x983e5152);
- RNDr(S, W, 25, 0xa831c66d);
- RNDr(S, W, 26, 0xb00327c8);
- RNDr(S, W, 27, 0xbf597fc7);
- RNDr(S, W, 28, 0xc6e00bf3);
- RNDr(S, W, 29, 0xd5a79147);
- RNDr(S, W, 30, 0x06ca6351);
- RNDr(S, W, 31, 0x14292967);
- RNDr(S, W, 32, 0x27b70a85);
- RNDr(S, W, 33, 0x2e1b2138);
- RNDr(S, W, 34, 0x4d2c6dfc);
- RNDr(S, W, 35, 0x53380d13);
- RNDr(S, W, 36, 0x650a7354);
- RNDr(S, W, 37, 0x766a0abb);
- RNDr(S, W, 38, 0x81c2c92e);
- RNDr(S, W, 39, 0x92722c85);
- RNDr(S, W, 40, 0xa2bfe8a1);
- RNDr(S, W, 41, 0xa81a664b);
- RNDr(S, W, 42, 0xc24b8b70);
- RNDr(S, W, 43, 0xc76c51a3);
- RNDr(S, W, 44, 0xd192e819);
- RNDr(S, W, 45, 0xd6990624);
- RNDr(S, W, 46, 0xf40e3585);
- RNDr(S, W, 47, 0x106aa070);
- RNDr(S, W, 48, 0x19a4c116);
- RNDr(S, W, 49, 0x1e376c08);
- RNDr(S, W, 50, 0x2748774c);
- RNDr(S, W, 51, 0x34b0bcb5);
- RNDr(S, W, 52, 0x391c0cb3);
- RNDr(S, W, 53, 0x4ed8aa4a);
- RNDr(S, W, 54, 0x5b9cca4f);
- RNDr(S, W, 55, 0x682e6ff3);
- RNDr(S, W, 56, 0x748f82ee);
- RNDr(S, W, 57, 0x78a5636f);
- RNDr(S, W, 58, 0x84c87814);
- RNDr(S, W, 59, 0x8cc70208);
- RNDr(S, W, 60, 0x90befffa);
- RNDr(S, W, 61, 0xa4506ceb);
- RNDr(S, W, 62, 0xbef9a3f7);
- RNDr(S, W, 63, 0xc67178f2);
+ for (i = 0; i < 64; i += 16) {
+ RNDr(S, W, 0, i);
+ RNDr(S, W, 1, i);
+ RNDr(S, W, 2, i);
+ RNDr(S, W, 3, i);
+ RNDr(S, W, 4, i);
+ RNDr(S, W, 5, i);
+ RNDr(S, W, 6, i);
+ RNDr(S, W, 7, i);
+ RNDr(S, W, 8, i);
+ RNDr(S, W, 9, i);
+ RNDr(S, W, 10, i);
+ RNDr(S, W, 11, i);
+ RNDr(S, W, 12, i);
+ RNDr(S, W, 13, i);
+ RNDr(S, W, 14, i);
+ RNDr(S, W, 15, i);
+
+ if (i == 48)
+ break;
+ MSCH(W, 0, i);
+ MSCH(W, 1, i);
+ MSCH(W, 2, i);
+ MSCH(W, 3, i);
+ MSCH(W, 4, i);
+ MSCH(W, 5, i);
+ MSCH(W, 6, i);
+ MSCH(W, 7, i);
+ MSCH(W, 8, i);
+ MSCH(W, 9, i);
+ MSCH(W, 10, i);
+ MSCH(W, 11, i);
+ MSCH(W, 12, i);
+ MSCH(W, 13, i);
+ MSCH(W, 14, i);
+ MSCH(W, 15, i);
+ }
/* 4. Mix local working variables into global state */
for (i = 0; i < 8; i++)
@@ -201,22 +195,29 @@ static const unsigned char PAD[64] = {
static void
SHA256_Pad(SHA256_CTX * ctx)
{
- unsigned char len[8];
- uint32_t r, plen;
-
- /*
- * Convert length to a vector of bytes -- we do this now rather
- * than later because the length will change after we pad.
- */
- be64enc(len, ctx->count);
+ size_t r;
- /* Add 1--64 bytes so that the resulting length is 56 mod 64 */
+ /* Figure out how many bytes we have buffered. */
r = (ctx->count >> 3) & 0x3f;
- plen = (r < 56) ? (56 - r) : (120 - r);
- SHA256_Update(ctx, PAD, (size_t)plen);
- /* Add the terminating bit-count */
- SHA256_Update(ctx, len, 8);
+ /* Pad to 56 mod 64, transforming if we finish a block en route. */
+ if (r < 56) {
+ /* Pad to 56 mod 64. */
+ memcpy(&ctx->buf[r], PAD, 56 - r);
+ } else {
+ /* Finish the current block and mix. */
+ memcpy(&ctx->buf[r], PAD, 64 - r);
+ SHA256_Transform(ctx->state, ctx->buf);
+
+ /* The start of the final block is all zeroes. */
+ memset(&ctx->buf[0], 0, 56);
+ }
+
+ /* Add the terminating bit-count. */
+ be64enc(&ctx->buf[56], ctx->count);
+
+ /* Mix in the final block. */
+ SHA256_Transform(ctx->state, ctx->buf);
}
/* SHA-256 initialization. Begins a SHA-256 operation. */
@@ -283,7 +284,7 @@ SHA256_Update(SHA256_CTX * ctx, const void *in, size_t len)
* and clears the context state.
*/
void
-SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx)
+SHA256_Final(unsigned char digest[static SHA256_DIGEST_LENGTH], SHA256_CTX *ctx)
{
/* Add padding */
@@ -291,7 +292,58 @@ SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx)
/* Write the hash */
be32enc_vect(digest, ctx->state, 32);
+ be32enc_vect(digest, ctx->state, SHA256_DIGEST_LENGTH);
+
+ /* Clear the context state */
+ explicit_bzero(ctx, sizeof(*ctx));
+}
+
+/*** SHA-224: *********************************************************/
+/*
+ * the SHA224 and SHA256 transforms are identical
+ */
+
+/* SHA-224 initialization. Begins a SHA-224 operation. */
+void
+SHA224_Init(SHA224_CTX * ctx)
+{
+
+ /* Zero bits processed so far */
+ ctx->count = 0;
+
+ /* Magic initialization constants */
+ ctx->state[0] = 0xC1059ED8;
+ ctx->state[1] = 0x367CD507;
+ ctx->state[2] = 0x3070DD17;
+ ctx->state[3] = 0xF70E5939;
+ ctx->state[4] = 0xFFC00B31;
+ ctx->state[5] = 0x68581511;
+ ctx->state[6] = 0x64f98FA7;
+ ctx->state[7] = 0xBEFA4FA4;
+}
+
+/* Add bytes into the SHA-224 hash */
+void
+SHA224_Update(SHA224_CTX * ctx, const void *in, size_t len)
+{
+
+ SHA256_Update((SHA256_CTX *)ctx, in, len);
+}
+
+/*
+ * SHA-224 finalization. Pads the input data, exports the hash value,
+ * and clears the context state.
+ */
+void
+SHA224_Final(unsigned char digest[static SHA224_DIGEST_LENGTH], SHA224_CTX *ctx)
+{
+
+ /* Add padding */
+ SHA256_Pad((SHA256_CTX *)ctx);
+
+ /* Write the hash */
+ be32enc_vect(digest, ctx->state, SHA224_DIGEST_LENGTH);
/* Clear the context state */
- memset((void *)ctx, 0, sizeof(*ctx));
+ explicit_bzero(ctx, sizeof(*ctx));
}
diff --git a/cpukit/libmd/sha512c.c b/cpukit/libmd/sha512c.c
index a4f268045a..0b03d09fa9 100644
--- a/cpukit/libmd/sha512c.c
+++ b/cpukit/libmd/sha512c.c
@@ -1,5 +1,6 @@
/*-
* Copyright 2005 Colin Percival
+ * Copyright (c) 2015 Allan Jude <allanjude@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,6 +34,8 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include "sha512.h"
+#include "sha512t.h"
+#include "sha384.h"
#if BYTE_ORDER == BIG_ENDIAN
@@ -74,6 +77,50 @@ be64dec_vect(uint64_t *dst, const unsigned char *src, size_t len)
#endif /* BYTE_ORDER != BIG_ENDIAN */
+/* SHA512 round constants. */
+static const uint64_t K[80] = {
+ 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL,
+ 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL,
+ 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
+ 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL,
+ 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL,
+ 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL,
+ 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL,
+ 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL,
+ 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL,
+ 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL,
+ 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL,
+ 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL,
+ 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL,
+ 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL,
+ 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL,
+ 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL,
+ 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL,
+ 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL,
+ 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL,
+ 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL,
+ 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL,
+ 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL,
+ 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL,
+ 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL,
+ 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL,
+ 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL,
+ 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL,
+ 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL,
+ 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL,
+ 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL,
+ 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL,
+ 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL,
+ 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL,
+ 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL,
+ 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL,
+ 0x113f9804bef90daeULL, 0x1b710b35131c471bULL,
+ 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL,
+ 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL,
+ 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL,
+ 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL
+};
+
/* Elementary functions used by SHA512 */
#define Ch(x, y, z) ((x & (y ^ z)) ^ z)
#define Maj(x, y, z) ((x & (y | z)) | (y & z))
@@ -86,127 +133,84 @@ be64dec_vect(uint64_t *dst, const unsigned char *src, size_t len)
/* SHA512 round function */
#define RND(a, b, c, d, e, f, g, h, k) \
- t0 = h + S1(e) + Ch(e, f, g) + k; \
- t1 = S0(a) + Maj(a, b, c); \
- d += t0; \
- h = t0 + t1;
+ h += S1(e) + Ch(e, f, g) + k; \
+ d += h; \
+ h += S0(a) + Maj(a, b, c);
/* Adjusted round function for rotating state */
-#define RNDr(S, W, i, k) \
+#define RNDr(S, W, i, ii) \
RND(S[(80 - i) % 8], S[(81 - i) % 8], \
S[(82 - i) % 8], S[(83 - i) % 8], \
S[(84 - i) % 8], S[(85 - i) % 8], \
S[(86 - i) % 8], S[(87 - i) % 8], \
- W[i] + k)
+ W[i + ii] + K[i + ii])
+
+/* Message schedule computation */
+#define MSCH(W, ii, i) \
+ W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) + W[i + ii]
/*
* SHA512 block compression function. The 512-bit state is transformed via
* the 512-bit input block to produce a new state.
*/
static void
-SHA512_Transform(uint64_t * state, const unsigned char block[128])
+SHA512_Transform(uint64_t * state, const unsigned char block[SHA512_BLOCK_LENGTH])
{
uint64_t W[80];
uint64_t S[8];
- uint64_t t0, t1;
int i;
- /* 1. Prepare message schedule W. */
- be64dec_vect(W, block, 128);
- for (i = 16; i < 80; i++)
- W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16];
+ /* 1. Prepare the first part of the message schedule W. */
+ be64dec_vect(W, block, SHA512_BLOCK_LENGTH);
/* 2. Initialize working variables. */
- memcpy(S, state, 64);
+ memcpy(S, state, SHA512_DIGEST_LENGTH);
/* 3. Mix. */
- RNDr(S, W, 0, 0x428a2f98d728ae22ULL);
- RNDr(S, W, 1, 0x7137449123ef65cdULL);
- RNDr(S, W, 2, 0xb5c0fbcfec4d3b2fULL);
- RNDr(S, W, 3, 0xe9b5dba58189dbbcULL);
- RNDr(S, W, 4, 0x3956c25bf348b538ULL);
- RNDr(S, W, 5, 0x59f111f1b605d019ULL);
- RNDr(S, W, 6, 0x923f82a4af194f9bULL);
- RNDr(S, W, 7, 0xab1c5ed5da6d8118ULL);
- RNDr(S, W, 8, 0xd807aa98a3030242ULL);
- RNDr(S, W, 9, 0x12835b0145706fbeULL);
- RNDr(S, W, 10, 0x243185be4ee4b28cULL);
- RNDr(S, W, 11, 0x550c7dc3d5ffb4e2ULL);
- RNDr(S, W, 12, 0x72be5d74f27b896fULL);
- RNDr(S, W, 13, 0x80deb1fe3b1696b1ULL);
- RNDr(S, W, 14, 0x9bdc06a725c71235ULL);
- RNDr(S, W, 15, 0xc19bf174cf692694ULL);
- RNDr(S, W, 16, 0xe49b69c19ef14ad2ULL);
- RNDr(S, W, 17, 0xefbe4786384f25e3ULL);
- RNDr(S, W, 18, 0x0fc19dc68b8cd5b5ULL);
- RNDr(S, W, 19, 0x240ca1cc77ac9c65ULL);
- RNDr(S, W, 20, 0x2de92c6f592b0275ULL);
- RNDr(S, W, 21, 0x4a7484aa6ea6e483ULL);
- RNDr(S, W, 22, 0x5cb0a9dcbd41fbd4ULL);
- RNDr(S, W, 23, 0x76f988da831153b5ULL);
- RNDr(S, W, 24, 0x983e5152ee66dfabULL);
- RNDr(S, W, 25, 0xa831c66d2db43210ULL);
- RNDr(S, W, 26, 0xb00327c898fb213fULL);
- RNDr(S, W, 27, 0xbf597fc7beef0ee4ULL);
- RNDr(S, W, 28, 0xc6e00bf33da88fc2ULL);
- RNDr(S, W, 29, 0xd5a79147930aa725ULL);
- RNDr(S, W, 30, 0x06ca6351e003826fULL);
- RNDr(S, W, 31, 0x142929670a0e6e70ULL);
- RNDr(S, W, 32, 0x27b70a8546d22ffcULL);
- RNDr(S, W, 33, 0x2e1b21385c26c926ULL);
- RNDr(S, W, 34, 0x4d2c6dfc5ac42aedULL);
- RNDr(S, W, 35, 0x53380d139d95b3dfULL);
- RNDr(S, W, 36, 0x650a73548baf63deULL);
- RNDr(S, W, 37, 0x766a0abb3c77b2a8ULL);
- RNDr(S, W, 38, 0x81c2c92e47edaee6ULL);
- RNDr(S, W, 39, 0x92722c851482353bULL);
- RNDr(S, W, 40, 0xa2bfe8a14cf10364ULL);
- RNDr(S, W, 41, 0xa81a664bbc423001ULL);
- RNDr(S, W, 42, 0xc24b8b70d0f89791ULL);
- RNDr(S, W, 43, 0xc76c51a30654be30ULL);
- RNDr(S, W, 44, 0xd192e819d6ef5218ULL);
- RNDr(S, W, 45, 0xd69906245565a910ULL);
- RNDr(S, W, 46, 0xf40e35855771202aULL);
- RNDr(S, W, 47, 0x106aa07032bbd1b8ULL);
- RNDr(S, W, 48, 0x19a4c116b8d2d0c8ULL);
- RNDr(S, W, 49, 0x1e376c085141ab53ULL);
- RNDr(S, W, 50, 0x2748774cdf8eeb99ULL);
- RNDr(S, W, 51, 0x34b0bcb5e19b48a8ULL);
- RNDr(S, W, 52, 0x391c0cb3c5c95a63ULL);
- RNDr(S, W, 53, 0x4ed8aa4ae3418acbULL);
- RNDr(S, W, 54, 0x5b9cca4f7763e373ULL);
- RNDr(S, W, 55, 0x682e6ff3d6b2b8a3ULL);
- RNDr(S, W, 56, 0x748f82ee5defb2fcULL);
- RNDr(S, W, 57, 0x78a5636f43172f60ULL);
- RNDr(S, W, 58, 0x84c87814a1f0ab72ULL);
- RNDr(S, W, 59, 0x8cc702081a6439ecULL);
- RNDr(S, W, 60, 0x90befffa23631e28ULL);
- RNDr(S, W, 61, 0xa4506cebde82bde9ULL);
- RNDr(S, W, 62, 0xbef9a3f7b2c67915ULL);
- RNDr(S, W, 63, 0xc67178f2e372532bULL);
- RNDr(S, W, 64, 0xca273eceea26619cULL);
- RNDr(S, W, 65, 0xd186b8c721c0c207ULL);
- RNDr(S, W, 66, 0xeada7dd6cde0eb1eULL);
- RNDr(S, W, 67, 0xf57d4f7fee6ed178ULL);
- RNDr(S, W, 68, 0x06f067aa72176fbaULL);
- RNDr(S, W, 69, 0x0a637dc5a2c898a6ULL);
- RNDr(S, W, 70, 0x113f9804bef90daeULL);
- RNDr(S, W, 71, 0x1b710b35131c471bULL);
- RNDr(S, W, 72, 0x28db77f523047d84ULL);
- RNDr(S, W, 73, 0x32caab7b40c72493ULL);
- RNDr(S, W, 74, 0x3c9ebe0a15c9bebcULL);
- RNDr(S, W, 75, 0x431d67c49c100d4cULL);
- RNDr(S, W, 76, 0x4cc5d4becb3e42b6ULL);
- RNDr(S, W, 77, 0x597f299cfc657e2aULL);
- RNDr(S, W, 78, 0x5fcb6fab3ad6faecULL);
- RNDr(S, W, 79, 0x6c44198c4a475817ULL);
+ for (i = 0; i < 80; i += 16) {
+ RNDr(S, W, 0, i);
+ RNDr(S, W, 1, i);
+ RNDr(S, W, 2, i);
+ RNDr(S, W, 3, i);
+ RNDr(S, W, 4, i);
+ RNDr(S, W, 5, i);
+ RNDr(S, W, 6, i);
+ RNDr(S, W, 7, i);
+ RNDr(S, W, 8, i);
+ RNDr(S, W, 9, i);
+ RNDr(S, W, 10, i);
+ RNDr(S, W, 11, i);
+ RNDr(S, W, 12, i);
+ RNDr(S, W, 13, i);
+ RNDr(S, W, 14, i);
+ RNDr(S, W, 15, i);
+
+ if (i == 64)
+ break;
+ MSCH(W, 0, i);
+ MSCH(W, 1, i);
+ MSCH(W, 2, i);
+ MSCH(W, 3, i);
+ MSCH(W, 4, i);
+ MSCH(W, 5, i);
+ MSCH(W, 6, i);
+ MSCH(W, 7, i);
+ MSCH(W, 8, i);
+ MSCH(W, 9, i);
+ MSCH(W, 10, i);
+ MSCH(W, 11, i);
+ MSCH(W, 12, i);
+ MSCH(W, 13, i);
+ MSCH(W, 14, i);
+ MSCH(W, 15, i);
+ }
/* 4. Mix local working variables into global state */
for (i = 0; i < 8; i++)
state[i] += S[i];
}
-static const unsigned char PAD[128] = {
+static const unsigned char PAD[SHA512_BLOCK_LENGTH] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -221,22 +225,29 @@ static const unsigned char PAD[128] = {
static void
SHA512_Pad(SHA512_CTX * ctx)
{
- unsigned char len[16];
- uint64_t r, plen;
-
- /*
- * Convert length to a vector of bytes -- we do this now rather
- * than later because the length will change after we pad.
- */
- be64enc_vect(len, ctx->count, 16);
+ size_t r;
- /* Add 1--128 bytes so that the resulting length is 112 mod 128 */
+ /* Figure out how many bytes we have buffered. */
r = (ctx->count[1] >> 3) & 0x7f;
- plen = (r < 112) ? (112 - r) : (240 - r);
- SHA512_Update(ctx, PAD, (size_t)plen);
- /* Add the terminating bit-count */
- SHA512_Update(ctx, len, 16);
+ /* Pad to 112 mod 128, transforming if we finish a block en route. */
+ if (r < 112) {
+ /* Pad to 112 mod 128. */
+ memcpy(&ctx->buf[r], PAD, 112 - r);
+ } else {
+ /* Finish the current block and mix. */
+ memcpy(&ctx->buf[r], PAD, 128 - r);
+ SHA512_Transform(ctx->state, ctx->buf);
+
+ /* The start of the final block is all zeroes. */
+ memset(&ctx->buf[0], 0, 112);
+ }
+
+ /* Add the terminating bit-count. */
+ be64enc_vect(&ctx->buf[112], ctx->count, 16);
+
+ /* Mix in the final block. */
+ SHA512_Transform(ctx->state, ctx->buf);
}
/* SHA-512 initialization. Begins a SHA-512 operation. */
@@ -279,22 +290,22 @@ SHA512_Update(SHA512_CTX * ctx, const void *in, size_t len)
ctx->count[0] += bitlen[0];
/* Handle the case where we don't need to perform any transforms */
- if (len < 128 - r) {
+ if (len < SHA512_BLOCK_LENGTH - r) {
memcpy(&ctx->buf[r], src, len);
return;
}
/* Finish the current block */
- memcpy(&ctx->buf[r], src, 128 - r);
+ memcpy(&ctx->buf[r], src, SHA512_BLOCK_LENGTH - r);
SHA512_Transform(ctx->state, ctx->buf);
- src += 128 - r;
- len -= 128 - r;
+ src += SHA512_BLOCK_LENGTH - r;
+ len -= SHA512_BLOCK_LENGTH - r;
/* Perform complete blocks */
- while (len >= 128) {
+ while (len >= SHA512_BLOCK_LENGTH) {
SHA512_Transform(ctx->state, src);
- src += 128;
- len -= 128;
+ src += SHA512_BLOCK_LENGTH;
+ len -= SHA512_BLOCK_LENGTH;
}
/* Copy left over data into buffer */
@@ -306,15 +317,147 @@ SHA512_Update(SHA512_CTX * ctx, const void *in, size_t len)
* and clears the context state.
*/
void
-SHA512_Final(unsigned char digest[64], SHA512_CTX * ctx)
+SHA512_Final(unsigned char digest[static SHA512_DIGEST_LENGTH], SHA512_CTX *ctx)
+{
+
+ /* Add padding */
+ SHA512_Pad(ctx);
+
+ /* Write the hash */
+ be64enc_vect(digest, ctx->state, SHA512_DIGEST_LENGTH);
+
+ /* Clear the context state */
+ explicit_bzero(ctx, sizeof(*ctx));
+}
+
+/*** SHA-512t: *********************************************************/
+/*
+ * the SHA512t transforms are identical to SHA512 so reuse the existing function
+ */
+void
+SHA512_224_Init(SHA512_CTX * ctx)
+{
+
+ /* Zero bits processed so far */
+ ctx->count[0] = ctx->count[1] = 0;
+
+ /* Magic initialization constants */
+ ctx->state[0] = 0x8c3d37c819544da2ULL;
+ ctx->state[1] = 0x73e1996689dcd4d6ULL;
+ ctx->state[2] = 0x1dfab7ae32ff9c82ULL;
+ ctx->state[3] = 0x679dd514582f9fcfULL;
+ ctx->state[4] = 0x0f6d2b697bd44da8ULL;
+ ctx->state[5] = 0x77e36f7304c48942ULL;
+ ctx->state[6] = 0x3f9d85a86a1d36c8ULL;
+ ctx->state[7] = 0x1112e6ad91d692a1ULL;
+}
+
+void
+SHA512_224_Update(SHA512_CTX * ctx, const void *in, size_t len)
+{
+
+ SHA512_Update(ctx, in, len);
+}
+
+void
+SHA512_224_Final(unsigned char digest[static SHA512_224_DIGEST_LENGTH], SHA512_CTX * ctx)
{
/* Add padding */
SHA512_Pad(ctx);
/* Write the hash */
- be64enc_vect(digest, ctx->state, 64);
+ be64enc_vect(digest, ctx->state, SHA512_224_DIGEST_LENGTH);
+
+ /* Clear the context state */
+ explicit_bzero(ctx, sizeof(*ctx));
+}
+
+void
+SHA512_256_Init(SHA512_CTX * ctx)
+{
+
+ /* Zero bits processed so far */
+ ctx->count[0] = ctx->count[1] = 0;
+
+ /* Magic initialization constants */
+ ctx->state[0] = 0x22312194fc2bf72cULL;
+ ctx->state[1] = 0x9f555fa3c84c64c2ULL;
+ ctx->state[2] = 0x2393b86b6f53b151ULL;
+ ctx->state[3] = 0x963877195940eabdULL;
+ ctx->state[4] = 0x96283ee2a88effe3ULL;
+ ctx->state[5] = 0xbe5e1e2553863992ULL;
+ ctx->state[6] = 0x2b0199fc2c85b8aaULL;
+ ctx->state[7] = 0x0eb72ddc81c52ca2ULL;
+}
+
+void
+SHA512_256_Update(SHA512_CTX * ctx, const void *in, size_t len)
+{
+
+ SHA512_Update(ctx, in, len);
+}
+
+void
+SHA512_256_Final(unsigned char digest[static SHA512_256_DIGEST_LENGTH], SHA512_CTX * ctx)
+{
+
+ /* Add padding */
+ SHA512_Pad(ctx);
+
+ /* Write the hash */
+ be64enc_vect(digest, ctx->state, SHA512_256_DIGEST_LENGTH);
+
+ /* Clear the context state */
+ explicit_bzero(ctx, sizeof(*ctx));
+}
+
+/*** SHA-384: *********************************************************/
+/*
+ * the SHA384 and SHA512 transforms are identical, so SHA384 is skipped
+ */
+
+/* SHA-384 initialization. Begins a SHA-384 operation. */
+void
+SHA384_Init(SHA384_CTX * ctx)
+{
+
+ /* Zero bits processed so far */
+ ctx->count[0] = ctx->count[1] = 0;
+
+ /* Magic initialization constants */
+ ctx->state[0] = 0xcbbb9d5dc1059ed8ULL;
+ ctx->state[1] = 0x629a292a367cd507ULL;
+ ctx->state[2] = 0x9159015a3070dd17ULL;
+ ctx->state[3] = 0x152fecd8f70e5939ULL;
+ ctx->state[4] = 0x67332667ffc00b31ULL;
+ ctx->state[5] = 0x8eb44a8768581511ULL;
+ ctx->state[6] = 0xdb0c2e0d64f98fa7ULL;
+ ctx->state[7] = 0x47b5481dbefa4fa4ULL;
+}
+
+/* Add bytes into the SHA-384 hash */
+void
+SHA384_Update(SHA384_CTX * ctx, const void *in, size_t len)
+{
+
+ SHA512_Update((SHA512_CTX *)ctx, in, len);
+}
+
+/*
+ * SHA-384 finalization. Pads the input data, exports the hash value,
+ * and clears the context state.
+ */
+void
+SHA384_Final(unsigned char digest[static SHA384_DIGEST_LENGTH], SHA384_CTX *ctx)
+{
+
+ /* Add padding */
+ SHA512_Pad((SHA512_CTX *)ctx);
+
+ /* Write the hash */
+ be64enc_vect(digest, ctx->state, SHA384_DIGEST_LENGTH);
/* Clear the context state */
- memset((void *)ctx, 0, sizeof(*ctx));
+ explicit_bzero(ctx, sizeof(*ctx));
}
diff --git a/cpukit/libmisc/rtems-fdt/rtems-fdt.c b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
index 7dd2bc1047..bea01dbf78 100644
--- a/cpukit/libmisc/rtems-fdt/rtems-fdt.c
+++ b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
@@ -182,7 +182,7 @@ rtems_fdt_init_index (rtems_fdt_handle* fdt, rtems_fdt_blob* blob)
}
names = calloc(1, total_name_memory);
- if (!entries)
+ if (!names)
{
free(entries);
return -RTEMS_FDT_ERR_NO_MEMORY;
@@ -700,14 +700,14 @@ rtems_fdt_unload (rtems_fdt_handle* handle)
rtems_chain_extract_unprotected (&handle->blob->node);
+ rtems_fdt_release_index(&handle->blob->index);
+
free (handle->blob);
handle->blob = NULL;
rtems_fdt_unlock (fdt);
- rtems_fdt_release_index(&handle->blob->index);
-
return 0;
}
diff --git a/cpukit/libmisc/shell/main_rtems.c b/cpukit/libmisc/shell/main_rtems.c
new file mode 100644
index 0000000000..956c6bcb72
--- /dev/null
+++ b/cpukit/libmisc/shell/main_rtems.c
@@ -0,0 +1,156 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup
+ *
+ * @brief This source file contains the kernel command.
+ */
+
+/*
+ * Copyright (c) 2022 Chris Johns. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include <rtems.h>
+#include <rtems/shell.h>
+#include <rtems/version.h>
+
+static void kernel_summary(void) {
+ printf(
+ "RTEMS: %d.%d.%d",
+ rtems_version_major(), rtems_version_minor(), rtems_version_revision());
+ if (rtems_version_control_key_is_valid(rtems_version_control_key())) {
+ printf(" (%s)", rtems_version_control_key());
+ }
+#if RTEMS_SMP
+ printf(" SMP:%d cores", rtems_scheduler_get_processor_maximum());
+#endif
+ printf("\n");
+}
+
+static void cpu_summary(void) {
+ printf("CPU: " CPU_NAME " (" CPU_MODEL_NAME ")\n");
+}
+
+static void bsp_summary(void) {
+ printf("BSP: %s\n", rtems_board_support_package());
+}
+
+static void tools_summary(void) {
+ printf( "Tools: " __VERSION__ "\n");
+}
+
+static void opts_summary(void) {
+ printf("Options:"
+#if RTEMS_DEBUG
+ " DEBUG"
+#endif
+#if RTEMS_MULTIPROCESSING
+ " MULTIPROCESSING"
+#endif
+#if RTEMS_NETWORKING
+ " NETWORKING"
+#endif
+#if RTEMS_PARAVIRT
+ " PARAVIRT"
+#endif
+#if RTEMS_POSIX_API
+ " POSIX"
+#endif
+#if RTEMS_PROFILING
+ " PROFILING"
+#endif
+#if RTEMS_SMP
+ " SMP"
+#endif
+ "\n");
+}
+
+static void help(void) {
+ printf( "Usage:: rtems <command>\n");
+ printf( " where <command> is:\n");
+ printf( " help : this help\n");
+ printf( " ver : kernel version\n");
+ printf( " cpu : kernel version\n");
+ printf( " bsp : BSP name\n");
+ printf( " tools : tools version\n");
+ printf( " opts : options\n");
+ printf( " all : all commands\n");
+}
+
+static int rtems_shell_main_rtems(
+ int argc, char *argv[]) {
+
+ if (argc == 1) {
+ kernel_summary();
+ } else if (argc == 2) {
+ if (strcmp(argv[1], "help") == 0) {
+ help();
+ } else if (strcmp(argv[1], "ver") == 0) {
+ kernel_summary();
+ } else if (strcmp(argv[1], "cpu") == 0) {
+ cpu_summary();
+ } else if (strcmp(argv[1], "bsp") == 0) {
+ bsp_summary();
+ } else if (strcmp(argv[1], "tools") == 0) {
+ tools_summary();
+ } else if (strcmp(argv[1], "opts") == 0) {
+ opts_summary();
+ } else if (strcmp(argv[1], "all") == 0) {
+ kernel_summary();
+ cpu_summary();
+ bsp_summary();
+ tools_summary();
+ opts_summary();
+ } else {
+ printf("error: invalid command\n");
+ return 1;
+ }
+ } else {
+ printf("error: invalid command\n");
+ return 1;
+ }
+ return 0;
+}
+
+#define HELP_LINE \
+ "rtems <command> (eg. help)"
+
+rtems_shell_cmd_t rtems_shell_RTEMS_Command = {
+ "rtems", /* name */
+ HELP_LINE, /* usage */
+ "rtems", /* topic */
+ rtems_shell_main_rtems, /* command */
+ NULL, /* alias */
+ NULL, /* next */
+ 0500, /* mode */
+ 0, /* uid */
+ 0 /* gid */
+};
diff --git a/cpukit/libtest/t-test-checks.c b/cpukit/libtest/t-test-checks.c
index c86596521b..1a278b55ec 100644
--- a/cpukit/libtest/t-test-checks.c
+++ b/cpukit/libtest/t-test-checks.c
@@ -30,27 +30,27 @@
#include <inttypes.h>
void
-T_check_eq_ptr(const T_check_context_msg *t, const void *a, const void *e)
+T_check_eq_ptr(const T_check_context_msg *t, uintptr_t a, uintptr_t e)
{
T_check(&t->base, a == e, "%s", t->msg);
}
void
-T_check_ne_ptr(const T_check_context_msg *t, const void *a, const void *e)
+T_check_ne_ptr(const T_check_context_msg *t, uintptr_t a, uintptr_t e)
{
T_check(&t->base, a != e, "%s", t->msg);
}
void
-T_check_null(const T_check_context_msg *t, const void *a)
+T_check_null(const T_check_context_msg *t, uintptr_t a)
{
- T_check(&t->base, a == NULL, "%s == NULL", t->msg);
+ T_check(&t->base, a == 0, "%s == NULL", t->msg);
}
void
-T_check_not_null(const T_check_context_msg *t, const void *a)
+T_check_not_null(const T_check_context_msg *t, uintptr_t a)
{
- T_check(&t->base, a != NULL, "%s != NULL", t->msg);
+ T_check(&t->base, a != 0, "%s != NULL", t->msg);
}
void
diff --git a/cpukit/libtest/t-test-hash-sha256.c b/cpukit/libtest/t-test-hash-sha256.c
index 32e946b4cf..a023d3969c 100644
--- a/cpukit/libtest/t-test-hash-sha256.c
+++ b/cpukit/libtest/t-test-has