summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cpukit/dev/can/can.c505
-rw-r--r--cpukit/doxygen/appl-config.h239
-rw-r--r--cpukit/include/adainclude/rtems-io.adb21
-rw-r--r--cpukit/include/dev/can/can-msg.h105
-rw-r--r--cpukit/include/dev/can/can.h284
-rw-r--r--cpukit/include/dev/can/canqueueimpl.h231
-rw-r--r--cpukit/include/drvmgr/drvmgr.h29
-rw-r--r--cpukit/include/drvmgr/drvmgr_confdefs.h25
-rw-r--r--cpukit/include/drvmgr/drvmgr_list.h25
-rw-r--r--cpukit/include/drvmgr/pci_bus.h25
-rw-r--r--cpukit/include/link_elf.h8
-rw-r--r--cpukit/include/linux/rbtree.h10
-rw-r--r--cpukit/include/pci.h25
-rw-r--r--cpukit/include/pci/access.h45
-rw-r--r--cpukit/include/pci/cfg.h25
-rw-r--r--cpukit/include/pci/cfg_auto.h25
-rw-r--r--cpukit/include/pci/cfg_peripheral.h25
-rw-r--r--cpukit/include/pci/cfg_read.h25
-rw-r--r--cpukit/include/pci/cfg_static.h25
-rw-r--r--cpukit/include/pci/ids_extra.h30
-rw-r--r--cpukit/include/pci/irq.h35
-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/inittask.h3
-rw-r--r--cpukit/include/rtems/confdefs/libpci.h25
-rw-r--r--cpukit/include/rtems/confdefs/percpu.h14
-rw-r--r--cpukit/include/rtems/confdefs/scheduler.h10
-rw-r--r--cpukit/include/rtems/confdefs/threads.h19
-rw-r--r--cpukit/include/rtems/confdefs/wkspace.h50
-rw-r--r--cpukit/include/rtems/config.h631
-rw-r--r--cpukit/include/rtems/counter.h8
-rw-r--r--cpukit/include/rtems/debugger/rtems-debugger-server.h1
-rw-r--r--cpukit/include/rtems/extensionimpl.h6
-rw-r--r--cpukit/include/rtems/fatal.h2
-rw-r--r--cpukit/include/rtems/init.h2
-rw-r--r--cpukit/include/rtems/ioimpl.h4
-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.h2
-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-debugger.h8
-rw-r--r--cpukit/include/rtems/rtems-fdt.h127
-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.h14
-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.h36
-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/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.h5
-rw-r--r--cpukit/include/rtems/score/isrlock.h2
-rw-r--r--cpukit/include/rtems/score/memory.h26
-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/objectimpl.h46
-rw-r--r--cpukit/include/rtems/score/percpu.h14
-rw-r--r--cpukit/include/rtems/score/priority.h4
-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.h22
-rw-r--r--cpukit/include/rtems/score/schedulerimpl.h62
-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.h22
-rw-r--r--cpukit/include/rtems/score/schedulersimpleimpl.h10
-rw-r--r--cpukit/include/rtems/score/scheduleruniimpl.h14
-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/stack.h75
-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.h18
-rw-r--r--cpukit/include/rtems/score/threaddispatch.h16
-rw-r--r--cpukit/include/rtems/score/threadimpl.h166
-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.h210
-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/stackchk.h89
-rw-r--r--cpukit/include/rtems/termiostypes.h8
-rw-r--r--cpukit/include/rtems/test-info.h6
-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/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/libdebugger/rtems-debugger-aarch64.c23
-rw-r--r--cpukit/libdebugger/rtems-debugger-arm.c808
-rw-r--r--cpukit/libdebugger/rtems-debugger-server.c72
-rw-r--r--cpukit/libdl/rtl-mdreloc-aarch64.c81
-rw-r--r--cpukit/libdl/rtl-mdreloc-arm.c79
-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/libmd/sha256c.c231
-rw-r--r--cpukit/libmd/sha512c.c377
-rw-r--r--cpukit/libmisc/rtems-fdt/rtems-fdt-shell.c350
-rw-r--r--cpukit/libmisc/rtems-fdt/rtems-fdt.c255
-rw-r--r--cpukit/libmisc/shell/main_drvmgr.c25
-rw-r--r--cpukit/libmisc/shell/main_edit.c17
-rw-r--r--cpukit/libmisc/shell/main_help.c94
-rw-r--r--cpukit/libmisc/shell/main_pci.c25
-rw-r--r--cpukit/libmisc/shell/shell.c83
-rw-r--r--cpukit/libmisc/stackchk/check.c158
-rw-r--r--cpukit/libtest/t-test-checks.c12
-rw-r--r--cpukit/libtest/t-test-hash-sha256.c9
-rw-r--r--cpukit/posix/src/psxtimercreate.c31
-rw-r--r--cpukit/posix/src/pthreadatfork.c13
-rw-r--r--cpukit/rtems/src/clockgettickssinceboot.c53
-rw-r--r--cpukit/rtems/src/rtemsbuildname.c2
-rw-r--r--cpukit/sapi/src/interrtext.c5
-rw-r--r--cpukit/score/cpu/aarch64/aarch64-exception-default.c20
-rw-r--r--cpukit/score/cpu/aarch64/cpu.c2
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/score/cpu.h32
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h9
-rw-r--r--cpukit/score/cpu/arm/__aeabi_read_tp.c6
-rw-r--r--cpukit/score/cpu/arm/__tls_get_addr.c6
-rw-r--r--cpukit/score/cpu/arm/armv7m-context-initialize.c2
-rw-r--r--cpukit/score/cpu/arm/cpu.c17
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/cpu.h20
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/cpuimpl.h8
-rw-r--r--cpukit/score/cpu/bfin/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/bfin/include/rtems/score/cpuimpl.h12
-rw-r--r--cpukit/score/cpu/i386/cpu.c2
-rw-r--r--cpukit/score/cpu/i386/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/i386/include/rtems/score/cpuimpl.h12
-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.h12
-rw-r--r--cpukit/score/cpu/m68k/__m68k_read_tp.c4
-rw-r--r--cpukit/score/cpu/m68k/cpu.c5
-rw-r--r--cpukit/score/cpu/m68k/include/rtems/score/cpu.h11
-rw-r--r--cpukit/score/cpu/m68k/include/rtems/score/cpuimpl.h12
-rw-r--r--cpukit/score/cpu/microblaze/__tls_get_addr.c10
-rw-r--r--cpukit/score/cpu/microblaze/cpu.c2
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/score/cpu.h11
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/score/cpuimpl.h9
-rw-r--r--cpukit/score/cpu/mips/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/mips/include/rtems/score/cpuimpl.h12
-rw-r--r--cpukit/score/cpu/moxie/include/rtems/score/cpu.h12
-rw-r--r--cpukit/score/cpu/moxie/include/rtems/score/cpuimpl.h12
-rw-r--r--cpukit/score/cpu/nios2/include/rtems/score/cpu.h8
-rw-r--r--cpukit/score/cpu/nios2/include/rtems/score/cpuimpl.h8
-rw-r--r--cpukit/score/cpu/nios2/nios2-context-initialize.c5
-rw-r--r--cpukit/score/cpu/nios2/nios2-iic-irq.c2
-rw-r--r--cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h44
-rw-r--r--cpukit/score/cpu/no_cpu/include/rtems/score/cpuimpl.h24
-rw-r--r--cpukit/score/cpu/or1k/include/rtems/score/cpu.h12
-rw-r--r--cpukit/score/cpu/or1k/include/rtems/score/cpuimpl.h8
-rw-r--r--cpukit/score/cpu/powerpc/cpu.c6
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/score/cpu.h44
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/score/cpuimpl.h8
-rw-r--r--cpukit/score/cpu/powerpc/ppc-context-validate.S77
-rw-r--r--cpukit/score/cpu/riscv/cpu.c12
-rw-r--r--cpukit/score/cpu/riscv/include/libcpu/access.h25
-rw-r--r--cpukit/score/cpu/riscv/include/rtems/score/cpu.h42
-rw-r--r--cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h20
-rw-r--r--cpukit/score/cpu/riscv/riscv-context-initialize.c2
-rw-r--r--cpukit/score/cpu/sh/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/sh/include/rtems/score/cpuimpl.h12
-rw-r--r--cpukit/score/cpu/sparc/cpu.c2
-rw-r--r--cpukit/score/cpu/sparc/include/libcpu/byteorder.h16
-rw-r--r--cpukit/score/cpu/sparc/include/libcpu/grlib-tn-0018.h2
-rw-r--r--cpukit/score/cpu/sparc/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/sparc/include/rtems/score/cpuimpl.h8
-rw-r--r--cpukit/score/cpu/sparc64/cpu.c2
-rw-r--r--cpukit/score/cpu/sparc64/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/sparc64/include/rtems/score/cpuimpl.h12
-rw-r--r--cpukit/score/cpu/v850/include/rtems/score/cpu.h10
-rw-r--r--cpukit/score/cpu/v850/include/rtems/score/cpuimpl.h12
-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.h12
-rw-r--r--cpukit/score/src/percpuasm.c7
-rw-r--r--cpukit/score/src/percpudata.c9
-rw-r--r--cpukit/score/src/profilingisrentryexit.c5
-rw-r--r--cpukit/score/src/stackallocatorforidle.c44
-rw-r--r--cpukit/score/src/stackallocatorforidlewkspace.c60
-rw-r--r--cpukit/score/src/threadcreateidle.c43
-rw-r--r--cpukit/score/src/threadinitialize.c6
-rw-r--r--cpukit/score/src/tlsallocsize.c44
265 files changed, 6617 insertions, 2942 deletions
diff --git a/cpukit/dev/can/can.c b/cpukit/dev/can/can.c
new file mode 100644
index 0000000000..2e6d5df65b
--- /dev/null
+++ b/cpukit/dev/can/can.c
@@ -0,0 +1,505 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup CANBus
+ *
+ * @brief Controller Area Network (CAN) Bus Implementation
+ *
+ */
+
+/*
+ * Copyright (C) 2022 Prashanth S (fishesprashanth@gmail.com)
+ *
+ * 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 <string.h>
+#include <stdlib.h>
+
+#include <fcntl.h>
+
+#include <rtems/imfs.h>
+#include <rtems/thread.h>
+
+#include <dev/can/canqueueimpl.h>
+#include <dev/can/can.h>
+
+#define can_interrupt_lock_acquire(bus) \
+ do { \
+ CAN_DEBUG_LOCK("acquiring lock\n"); \
+ real_can_interrupt_lock_acquire(bus); \
+ } while (0);
+
+#define can_interrupt_lock_release(bus) \
+ do { \
+ CAN_DEBUG_LOCK("releasing lock\n"); \
+ real_can_interrupt_lock_release(bus); \
+ } while (0);
+
+static ssize_t
+can_bus_open(rtems_libio_t *iop, const char *path, int oflag, mode_t mode);
+static ssize_t
+can_bus_read(rtems_libio_t *iop, void *buffer, size_t count);
+static ssize_t
+can_bus_write(rtems_libio_t *iop, const void *buffer, size_t count);
+static ssize_t
+can_bus_ioctl(rtems_libio_t *iop, ioctl_command_t request, void *buffer);
+
+static int can_xmit(struct can_bus *bus);
+
+static int can_bus_create_sem(struct can_bus *);
+static int try_sem(struct can_bus *);
+static int take_sem(struct can_bus *);
+static int give_sem(struct can_bus *);
+
+
+static void can_bus_obtain(can_bus *bus)
+{
+ CAN_DEBUG("can_bus_obtain Entry\n");
+ rtems_mutex_lock(&bus->mutex);
+ CAN_DEBUG("can_bus_obtain Exit\n");
+}
+
+static void can_bus_release(can_bus *bus)
+{
+ CAN_DEBUG("can_bus_release Entry\n");
+ rtems_mutex_unlock(&bus->mutex);
+ CAN_DEBUG("can_bus_release Exit\n");
+}
+
+static void can_bus_destroy_mutex(struct can_bus *bus)
+{
+ rtems_mutex_destroy(&bus->mutex);
+}
+
+static int can_bus_create_sem(struct can_bus *bus)
+{
+ int ret = 0;
+
+ ret = rtems_semaphore_create(rtems_build_name('c', 'a', 'n', bus->index),
+ CAN_TX_BUF_COUNT, RTEMS_FIFO | RTEMS_COUNTING_SEMAPHORE | RTEMS_LOCAL,
+ 0, &bus->tx_fifo_sem_id);
+
+ if (ret != 0) {
+ CAN_ERR("can_create_sem: rtems_semaphore_create failed %d\n", ret);
+ }
+
+ return ret;
+}
+
+static void can_bus_free_tx_semaphore(struct can_bus *bus)
+{
+ rtems_semaphore_delete(bus->tx_fifo_sem_id);
+}
+
+static void real_can_interrupt_lock_acquire(struct can_bus *bus)
+{
+ bus->can_dev_ops->dev_int(bus->priv, false);
+ can_bus_obtain(bus);
+}
+
+static void real_can_interrupt_lock_release(struct can_bus *bus)
+{
+ can_bus_release(bus);
+ bus->can_dev_ops->dev_int(bus->priv, true);
+}
+
+static int take_sem(struct can_bus *bus)
+{
+ int ret = rtems_semaphore_obtain(bus->tx_fifo_sem_id, RTEMS_WAIT,
+ RTEMS_NO_TIMEOUT);
+#ifdef CAN_DEBUG_LOCK
+ if (ret == RTEMS_SUCCESSFUL) {
+ bus->sem_count++;
+ CAN_DEBUG_LOCK("take_sem: Semaphore count = %d\n", bus->sem_count);
+ if (bus->sem_count > CAN_TX_BUF_COUNT) {
+ CAN_ERR("take_sem error: sem_count is misleading\n");
+ return RTEMS_INTERNAL_ERROR;
+ }
+ }
+#endif /* CAN_DEBUG_LOCK */
+
+ return ret;
+}
+
+static int give_sem(struct can_bus *bus)
+{
+ int ret = rtems_semaphore_release(bus->tx_fifo_sem_id);
+
+#ifdef CAN_DEBUG_LOCK
+ if (ret == RTEMS_SUCCESSFUL) {
+ bus->sem_count--;
+ CAN_DEBUG_LOCK("give_sem: Semaphore count = %d\n", bus->sem_count);
+ if (bus->sem_count < 0) {
+ CAN_ERR("give_sem error: sem_count is misleading\n");
+ return RTEMS_INTERNAL_ERROR;
+ }
+ }
+#endif /* CAN_DEBUG_LOCK */
+
+ return ret;
+}
+
+static int try_sem(struct can_bus *bus)
+{
+ int ret = rtems_semaphore_obtain(bus->tx_fifo_sem_id, RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT);
+#ifdef CAN_DEBUG_LOCK
+ if (ret == RTEMS_SUCCESSFUL) {
+ bus->sem_count++;
+ CAN_DEBUG_LOCK("try_sem: Semaphore count = %d\n", bus->sem_count);
+ if (bus->sem_count > CAN_TX_BUF_COUNT) {
+ CAN_ERR("take_sem error: sem_count is misleading\n");
+ return RTEMS_INTERNAL_ERROR;
+ }
+ }
+#endif /* CAN_DEBUG_LOCK */
+
+ return ret;
+}
+
+static ssize_t
+can_bus_open(rtems_libio_t *iop, const char *path, int oflag, mode_t mode)
+{
+ CAN_DEBUG("can_bus_open\n");
+
+ return 0;
+}
+
+/* Should be called only with CAN interrupts disabled */
+int can_receive(struct can_bus *bus, struct can_msg *msg)
+{
+ memcpy(&bus->can_rx_msg, msg, CAN_MSG_LEN(msg));
+
+ return CAN_MSG_LEN(msg);
+}
+
+/* FIXME: Should be modified to read count number of bytes, Now sending one can_msg */
+static ssize_t can_bus_read(rtems_libio_t *iop, void *buffer, size_t count)
+{
+ int len;
+
+ can_bus *bus = IMFS_generic_get_context_by_iop(iop);
+ if (bus == NULL) {
+ return -RTEMS_NOT_DEFINED;
+ }
+
+ struct can_msg *msg = (struct can_msg *)buffer;
+
+ len = CAN_MSG_LEN(&bus->can_rx_msg);
+
+ if (count < len) {
+ CAN_DEBUG("can_bus_read: buffer size is small min sizeof(struct can_msg) = %u\n",
+ sizeof(struct can_msg));
+ return -RTEMS_INVALID_SIZE;
+ }
+
+ can_interrupt_lock_acquire(bus);
+ memcpy(msg, &bus->can_rx_msg, len);
+ can_interrupt_lock_release(bus);
+
+ return len;
+}
+
+/* This function is a critical section and should be called
+ * with CAN interrupts disabled and mutually exclusive
+ */
+static int can_xmit(struct can_bus *bus)
+{
+ int ret = RTEMS_SUCCESSFUL;
+
+ struct can_msg *msg = NULL;
+
+ CAN_DEBUG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> can_xmit Entry\n");
+
+ while (1) {
+ CAN_DEBUG("can_dev_ops->dev_tx_ready\n");
+ if (bus->can_dev_ops->dev_tx_ready(bus->priv) != true) {
+ break;
+ }
+
+ CAN_DEBUG("can_tx_get_data_buf\n");
+ msg = can_bus_tx_get_data_buf(bus);
+ if (msg == NULL) {
+ break;
+ }
+
+ CAN_DEBUG("can_dev_ops->dev_tx\n");
+ ret = bus->can_dev_ops->dev_tx(bus->priv, msg);
+ if (ret != RTEMS_SUCCESSFUL) {
+ CAN_ERR("can_xmit: dev_send failed\n");
+ break;
+ }
+
+ ret = give_sem(bus);
+ if (ret != RTEMS_SUCCESSFUL) {
+ CAN_ERR("can_xmit: rtems_semaphore_release failed = %d\n", ret);
+ break;
+ }
+ }
+
+ CAN_DEBUG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> can_xmit Exit\n");
+
+ return ret;
+}
+
+void can_print_msg(struct can_msg const *msg)
+{
+#ifdef CAN_DEBUG
+ CAN_DEBUG("\n----------------------------------------------------------------\n");
+ CAN_DEBUG("id = %d len = %d flags = 0x%08X\n", msg->id, msg->len, msg->flags);
+
+ CAN_DEBUG("msg->data[0] = 0x%08x\n", ((uint32_t *)msg->data)[0]);
+ CAN_DEBUG("msg->data[1] = 0x%08x\n", ((uint32_t *)msg->data)[1]);
+
+ for (int i = 0; i < msg->len; i++) {
+ CAN_DEBUG("%02x\n", ((char *)msg->data)[i]);
+ }
+
+ CAN_DEBUG("\n-----------------------------------------------------------------\n");
+#endif /* CAN_DEBUG */
+}
+
+/* can_tx_done should be called only with CAN interrupts disabled */
+int can_tx_done(struct can_bus *bus)
+{
+ CAN_DEBUG("------------ can_tx_done Entry\n");
+ int ret = RTEMS_SUCCESSFUL;
+
+ if (bus->can_dev_ops->dev_tx_ready(bus->priv) == true) {
+ ret = can_xmit(bus);
+ }
+ CAN_DEBUG("------------ can_tx_done Exit\n");
+
+ return ret;
+}
+
+/* FIXME: Add support to send multiple CAN msgs for can_bus_write */
+static ssize_t
+can_bus_write(rtems_libio_t *iop, const void *buffer, size_t count)
+{
+ can_bus *bus = IMFS_generic_get_context_by_iop(iop);
+
+ if (bus == NULL || bus->can_dev_ops->dev_tx == NULL) {
+ return -RTEMS_NOT_DEFINED;
+ }
+
+ int ret = RTEMS_SUCCESSFUL;
+
+ struct can_msg const *msg = buffer;
+ struct can_msg *fifo_buf = NULL;
+
+ uint32_t msg_size = CAN_MSG_LEN(msg);
+
+ CAN_DEBUG_TX("can_bus_write: can_msg_size = %u\n", msg_size);
+ if (msg_size > sizeof(struct can_msg)) {
+ CAN_ERR("can_bus_write:"
+ "can message len error msg_size = %u struct can_msg = %u\n",
+ msg_size, sizeof(struct can_msg));
+ return -RTEMS_INVALID_SIZE;
+ }
+
+ if ((iop->flags & O_NONBLOCK) != 0) {
+ ret = try_sem(bus);
+ if (ret != RTEMS_SUCCESSFUL) {
+ return -ret;
+ }
+ } else {
+ ret = take_sem(bus);
+ if (ret != RTEMS_SUCCESSFUL) {
+ CAN_ERR("can_bus_write: cannot take semaphore\n");
+ return -ret;
+ }
+ }
+
+ can_interrupt_lock_acquire(bus);
+
+ fifo_buf = can_bus_tx_get_empty_buf(bus);
+ if (fifo_buf == NULL) {
+ /* This error will not happen until buffer counts are not synchronized */
+ CAN_ERR("can_bus_write: Buffer counts are not synchronized with semaphore count\n");
+ ret = -RTEMS_INTERNAL_ERROR;
+ goto release_lock_and_return;
+ }
+
+ CAN_DEBUG_TX("can_bus_write: empty_count = %u\n", bus->tx_fifo.empty_count);
+
+ CAN_DEBUG_TX("can_bus_write: copying msg from application to driver buffer\n");
+ memcpy(fifo_buf, msg, msg_size);
+
+ if (bus->can_dev_ops->dev_tx_ready(bus->priv) == true) {
+ ret = can_xmit(bus);
+ if (ret != RTEMS_SUCCESSFUL) {
+ ret = -ret;
+ goto release_lock_and_return;
+ }
+ }
+
+ ret = msg_size;
+
+release_lock_and_return:
+ can_interrupt_lock_release(bus);
+ return ret;
+}
+
+static ssize_t
+can_bus_ioctl(rtems_libio_t *iop, ioctl_command_t request, void *buffer)
+{
+ can_bus *bus = IMFS_generic_get_context_by_iop(iop);
+
+ if (bus == NULL || bus->can_dev_ops->dev_ioctl == NULL) {
+ return -RTEMS_NOT_DEFINED;
+ }
+
+ can_bus_obtain(bus);
+
+ bus->can_dev_ops->dev_ioctl(bus->priv, NULL, 0);
+
+ can_bus_release(bus);
+
+ return RTEMS_SUCCESSFUL;
+}
+
+static const rtems_filesystem_file_handlers_r can_bus_handler = {
+ .open_h = can_bus_open,
+ .close_h = rtems_filesystem_default_close,
+ .read_h = can_bus_read,
+ .write_h = can_bus_write,
+ .ioctl_h = can_bus_ioctl,
+ .lseek_h = rtems_filesystem_default_lseek,
+ .fstat_h = IMFS_stat,
+ .ftruncate_h = rtems_filesystem_default_ftruncate,
+ .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
+ .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
+ .fcntl_h = rtems_filesystem_default_fcntl,
+ .kqfilter_h = rtems_filesystem_default_kqfilter,
+ .mmap_h = rtems_filesystem_default_mmap,
+ .poll_h = rtems_filesystem_default_poll,
+ .readv_h = rtems_filesystem_default_readv,
+ .writev_h = rtems_filesystem_default_writev
+};
+
+static void can_bus_node_destroy(IMFS_jnode_t *node)
+{
+ can_bus *bus;
+
+ bus = IMFS_generic_get_context_by_node(node);
+ (*bus->destroy)(bus);
+
+ IMFS_node_destroy_default(node);
+}
+
+static const
+IMFS_node_control can_bus_node_control = IMFS_GENERIC_INITIALIZER(&can_bus_handler,
+ IMFS_node_initialize_generic, can_bus_node_destroy);
+
+rtems_status_code can_bus_register(can_bus *bus, const char *bus_path)
+{
+ int ret = RTEMS_SUCCESSFUL;
+
+ static uint8_t index = 0;
+
+ if (index == CAN_BUS_REG_MAX) {
+ CAN_ERR("can_bus_register: can bus registration limit reached\n");
+ return RTEMS_TOO_MANY;
+ }
+
+ bus->index = index++;
+ CAN_DEBUG("Registering CAN bus index = %u\n", bus->index);
+
+ ret = IMFS_make_generic_node(bus_path, S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
+ &can_bus_node_control, bus);
+ if (ret != RTEMS_SUCCESSFUL) {
+ CAN_ERR("can_bus_register: Creating node failed = %d\n", ret);
+ goto fail;
+ }
+
+ if ((ret = can_bus_create_sem(bus)) != RTEMS_SUCCESSFUL) {
+ CAN_ERR("can_bus_register: can_create_sem failed = %d\n", ret);
+ goto fail;
+ }
+
+ if ((ret = can_bus_create_tx_buffers(bus)) != RTEMS_SUCCESSFUL) {
+ CAN_ERR("can_bus_register: can_create_tx_buffers failed = %d\n", ret);
+ goto free_tx_semaphore;
+ }
+
+ return ret;
+
+free_tx_semaphore:
+ rtems_semaphore_delete(bus->tx_fifo_sem_id);
+
+fail:
+ can_bus_destroy_mutex(bus);
+ return ret;
+
+}
+
+static void can_bus_destroy(can_bus *bus)
+{
+ can_bus_free_tx_buffers(bus);
+ can_bus_free_tx_semaphore(bus);
+ can_bus_destroy_mutex(bus);
+}
+
+static int can_bus_do_init(can_bus *bus, void (*destroy)(can_bus *bus))
+{
+ rtems_mutex_init(&bus->mutex, "CAN Bus");
+ bus->destroy = can_bus_destroy;
+
+ return RTEMS_SUCCESSFUL;
+}
+
+static void can_bus_destroy_and_free(can_bus *bus)
+{
+ can_bus_destroy(bus);
+ free(bus);
+}
+
+int can_bus_init(can_bus *bus)
+{
+ memset(bus, 0, sizeof(*bus));
+
+ return can_bus_do_init(bus, can_bus_destroy);
+}
+
+can_bus *can_bus_alloc_and_init(size_t size)
+{
+ can_bus *bus = NULL;
+
+ if (size >= sizeof(*bus)) {
+ bus = calloc(1, size);
+ if (bus == NULL) {
+ CAN_ERR("can_bus_alloc_and_init: calloc failed\b");
+ return NULL;
+ }
+
+ int rv = can_bus_do_init(bus, can_bus_destroy_and_free);
+ if (rv != 0) {
+ CAN_ERR("can_bus_alloc_and_init: can_bus_do_init failed\n");
+ return NULL;
+ }
+ }
+ return bus;
+}
diff --git a/cpukit/doxygen/appl-config.h b/cpukit/doxygen/appl-config.h
index 85290fd4bc..88cd03d328 100644
--- a/cpukit/doxygen/appl-config.h
+++ b/cpukit/doxygen/appl-config.h
@@ -918,53 +918,6 @@
*/
#define CONFIGURE_MAXIMUM_TASKS
-/* Generated from spec:/acfg/if/max-thread-local-storage-size */
-
-/**
- * @brief This configuration option is an integer define.
- *
- * If the value of this configuration option is greater than zero, then it
- * defines the maximum thread-local storage size, otherwise the thread-local
- * storage size is defined by the linker depending on the thread-local storage
- * objects used by the application in the statically-linked executable.
- *
- * @par Default Value
- * The default value is 0.
- *
- * @par Value Constraints
- * @parblock
- * The value of this configuration option shall satisfy all of the following
- * constraints:
- *
- * * It shall be greater than or equal to zero.
- *
- * * It shall be less than or equal to <a
- * href="https://en.cppreference.com/w/c/types/limits">SIZE_MAX</a>.
- *
- * * It shall be an integral multiple of #RTEMS_TASK_STORAGE_ALIGNMENT.
- * @endparblock
- *
- * @par Notes
- * @parblock
- * This configuration option can be used to reserve space for the dynamic
- * linking of modules with thread-local storage objects.
- *
- * If the thread-local storage size defined by the thread-local storage objects
- * used by the application in the statically-linked executable is greater than
- * a non-zero value of this configuration option, then a fatal error will occur
- * during system initialization.
- *
- * Use RTEMS_ALIGN_UP() and #RTEMS_TASK_STORAGE_ALIGNMENT to adjust the size to
- * meet the minimum alignment requirement of a thread-local storage area.
- *
- * The actual thread-local storage size is determined when the application
- * executable is linked. The ``rtems-exeinfo`` command line tool included in
- * the RTEMS Tools can be used to obtain the thread-local storage size and
- * alignment of an application executable.
- * @endparblock
- */
-#define CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE
-
/* Generated from spec:/acfg/if/max-timers */
/**
@@ -1995,6 +1948,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 */
/**
@@ -2845,6 +2847,54 @@
*/
#define CONFIGURE_MAXIMUM_PROCESSORS
+/* Generated from spec:/acfg/if/max-thread-local-storage-size */
+
+/**
+ * @brief This configuration option is an integer define.
+ *
+ * If the value of this configuration option is greater than zero, then it
+ * defines the maximum thread-local storage size, otherwise the thread-local
+ * storage size is defined by the linker depending on the thread-local storage
+ * objects used by the application in the statically-linked executable.
+ *
+ * @par Default Value
+ * The default value is 0.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this configuration option:
+ *
+ * * The value of the configuration option shall be greater than or equal to
+ * zero.
+ *
+ * * The value of the configuration option shall be less than or equal to <a
+ * href="https://en.cppreference.com/w/c/types/limits">SIZE_MAX</a>.
+ *
+ * * The value of the configuration option shall be an integral multiple of
+ * #RTEMS_TASK_STORAGE_ALIGNMENT.
+ * @endparblock
+ *
+ * @par Notes
+ * @parblock
+ * This configuration option can be used to reserve space for the dynamic
+ * linking of modules with thread-local storage objects.
+ *
+ * If the thread-local storage size defined by the thread-local storage objects
+ * used by the application in the statically-linked executable is greater than
+ * a non-zero value of this configuration option, then a fatal error will occur
+ * during system initialization.
+ *
+ * Use RTEMS_ALIGN_UP() and #RTEMS_TASK_STORAGE_ALIGNMENT to adjust the size to
+ * meet the minimum alignment requirement of a thread-local storage area.
+ *
+ * The actual thread-local storage size is determined when the application
+ * executable is linked. The ``rtems-exeinfo`` command line tool included in
+ * the RTEMS Tools can be used to obtain the thread-local storage size and
+ * alignment of an application executable.
+ * @endparblock
+ */
+#define CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE
+
/* Generated from spec:/acfg/if/max-thread-name-size */
/**
@@ -3381,6 +3431,59 @@
*/
#define CONFIGURE_IDLE_TASK_STACK_SIZE
+/* Generated from spec:/acfg/if/idle-task-storage-size */
+
+/**
+ * @brief This configuration option is an integer define.
+ *
+ * If this configuration option is specified, then the task storage areas for
+ * the IDLE tasks are statically allocated by <rtems/confdefs.h>. The value of
+ * this configuration option defines the size in bytes of the task storage area
+ * of each IDLE task in the system.
+ *
+ * @par Default Value
+ * This configuration option has no default value. If it is not specified,
+ * then the task storage area for each IDLE task will allocated from the RTEMS
+ * Workspace or through a custom IDLE task stack allocator.
+ *
+ * @par Constraints
+ * The value of the configuration option shall be greater than or equal to
+ * #CONFIGURE_IDLE_TASK_STACK_SIZE.
+ *
+ * @par Notes
+ * @parblock
+ * By default, the IDLE task storage areas are allocated from the RTEMS
+ * Workspace. Applications which do not want to use a heap allocator can use
+ * this configuration option to use statically allocated memory for the IDLE
+ * task storage areas. The task storage area contains the task stack, the
+ * thread-local storage, and the floating-point context on architectures with a
+ * separate floating-point context. The size of the thread-local storage area
+ * is defined at link time or by the
+ * #CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE configuration option. You have
+ * to estimate the actual thread-local storage size if you want to use this
+ * configuration option. If the IDLE task stack size would be less than the
+ * value defined by the #CONFIGURE_IDLE_TASK_STACK_SIZE configuration option,
+ * for example because the thread-local storage size is larger than expected,
+ * then the system terminates with the INTERNAL_ERROR_CORE fatal source and the
+ * INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL fatal code during system
+ * initialization.
+ *
+ * The value of this configuration option is passed to
+ * RTEMS_TASK_STORAGE_SIZE() by <rtems/confdefs.h> to determine the actual size
+ * of the statically allocated area to take architecture-specific overheads
+ * into account.
+ *
+ * The
+ *
+ * * ``CONFIGURE_IDLE_TASK_STORAGE_SIZE``, and
+ *
+ * * #CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
+ *
+ * configuration options are mutually exclusive.
+ * @endparblock
+ */
+#define CONFIGURE_IDLE_TASK_STORAGE_SIZE
+
/** @} */
/* Generated from spec:/acfg/if/group-mpci */
@@ -4776,23 +4879,45 @@
* @brief This configuration option is an initializer define.
*
* The value of this configuration option is the address for the stack
- * allocator allocate handler used to allocate the task stack of each IDLE
- * task.
+ * allocator allocate handler used to allocate the task storage area of each
+ * IDLE task.
*
* @par Default Value
- * The default value is ``_Stack_Allocator_allocate_for_idle_default``, which
- * indicates that IDLE task stacks will be allocated from an area statically
- * allocated by ``<rtems/confdefs.h>``.
+ * By default, the IDLE task storage area will be allocated from the RTEMS
+ * Workspace.
*
* @par Value Constraints
- * The value of this configuration option shall be defined to a valid function
- * pointer of the type ``void *( *allocate )( uint32_t, size_t )``.
+ * @parblock
+ * The following constraints apply to this configuration option:
+ *
+ * * The value of the configuration option shall be defined to a valid function
+ * pointer of the type ``void *( *allocate )( uint32_t, size_t * )``.
+ *
+ * * The IDLE task stack allocator shall return a pointer to the allocated
+ * memory area or terminate the system with a fatal error if the allocation
+ * request cannot be satisfied.
+ *
+ * * The IDLE task stack allocator may increase the size of the allocated
+ * memory area.
+ * @endparblock
*
* @par Notes
+ * @parblock
* This configuration option is independent of the other thread stack allocator
- * configuration options. It is assumed that any memory allocated for the
- * stack of an IDLE task will not be from the RTEMS Workspace or the memory
- * statically allocated by default.
+ * configuration options. It is assumed that any memory allocated for the task
+ * storage area of an IDLE task will not be from the RTEMS Workspace.
+ *
+ * The IDLE task stack allocator may increase the size of the allocated memory
+ * area to account for the actually allocated memory area.
+ *
+ * The
+ *
+ * * #CONFIGURE_IDLE_TASK_STORAGE_SIZE, and
+ *
+ * * ``CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE``
+ *
+ * configuration options are mutually exclusive.
+ * @endparblock
*/
#define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
diff --git a/cpukit/include/adainclude/rtems-io.adb b/cpukit/include/adainclude/rtems-io.adb
index 41a315c93a..addc2e2540 100644
--- a/cpukit/include/adainclude/rtems-io.adb
+++ b/cpukit/include/adainclude/rtems-io.adb
@@ -67,27 +67,6 @@ package body RTEMS.IO is
end Register_Name;
- procedure Lookup_Name
- (Name : in String;
- Device_Info : out RTEMS.Driver_Name_t;
- Result : out RTEMS.Status_Codes)
- is
- function Lookup_Name_Base
- (Name : Interfaces.C.char_array;
- Device_Info : access RTEMS.Driver_Name_t)
- return RTEMS.Status_Codes;
- pragma Import (C, Lookup_Name_Base, "rtems_io_lookup_name");
- Device_Info_Base : aliased RTEMS.Driver_Name_t;
- begin
-
- Result :=
- Lookup_Name_Base
- (Interfaces.C.To_C (Name),
- Device_Info_Base'Unchecked_Access);
- Device_Info := Device_Info_Base;
-
- end Lookup_Name;
-
procedure Open
(Major : in RTEMS.Device_Major_Number;
Minor : in RTEMS.Device_Minor_Number;
diff --git a/cpukit/include/dev/can/can-msg.h b/cpukit/include/dev/can/can-msg.h
new file mode 100644
index 0000000000..9863e14d84
--- /dev/null
+++ b/cpukit/include/dev/can/can-msg.h
@@ -0,0 +1,105 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup CANBus
+ *
+ * @brief Controller Area Network (CAN) Bus Implementation
+ *
+ */
+
+/*
+ * Copyright (C) 2022 Prashanth S <fishesprashanth@gmail.com>
+ *
+ * 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 _DEV_CAN_CAN_MSG_H
+#define _DEV_CAN_CAN_MSG_H
+
+/**
+ * @defgroup Controller Area Network (CAN) Driver
+ *
+ * @ingroup RTEMSDeviceDrivers
+ *
+ * @brief Controller Area Network (CAN) bus and device driver support.
+ *
+ * @{
+ */
+
+/**
+ * @defgroup CANBus CAN Bus Driver
+ *
+ * @ingroup CAN
+ *
+ * @{
+ */
+
+/**
+ * @brief CAN message size
+ */
+#define CAN_MSG_MAX_SIZE (8u)
+
+/**
+ * @brief Number of CAN tx buffers
+ */
+#define CAN_TX_BUF_COUNT (10u)
+
+/**
+ * @brief Number of CAN rx buffers
+ */
+#define CAN_RX_BUF_COUNT (2u)
+
+#define CAN_MSGLEN(msg) (sizeof(struct can_msg) - (CAN_MSG_MAX_SIZE - msg->len))
+
+/**
+ * @brief CAN message structure.
+ */
+struct can_msg {
+ /**
+ * @brief CAN message id.
+ */
+ uint32_t id;
+ /**
+ * @brief CAN message timestamp.
+ */
+ uint32_t timestamp;
+ /**
+ * @brief CAN message flags RTR | BRS | EXT.
+ */
+ uint16_t flags;
+ /**
+ * @brief CAN message length.
+ */
+ uint16_t len;
+ /**
+ * @brief CAN message.
+ */
+ uint8_t data[CAN_MSG_MAX_SIZE];
+};
+
+/** @} */ /* end of CAN message */
+
+/** @} */
+
+#endif /* _DEV_CAN_CAN_MSG_H */
diff --git a/cpukit/include/dev/can/can.h b/cpukit/include/dev/can/can.h
new file mode 100644
index 0000000000..9e55395039
--- /dev/null
+++ b/cpukit/include/dev/can/can.h
@@ -0,0 +1,284 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup CANBus
+ *
+ * @brief Controller Area Network (CAN) Bus Implementation
+ *
+ */
+
+/*
+ * Copyright (C) 2022 Prashanth S (fishesprashanth@gmail.com)
+ *
+ * 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 _DEV_CAN_CAN_H
+#define _DEV_CAN_CAN_H
+
+#include <rtems/imfs.h>
+#include <rtems/thread.h>
+#include <semaphore.h>
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <dev/can/can-msg.h>
+
+#define DEBUG(str, ...) \
+ do { \
+ printf("CAN: %s:%d ID: %08X ", __FILE__, __LINE__, rtems_task_self()); \
+ printf(str, ##__VA_ARGS__); \
+ } while (false);
+
+#define CAN_DEBUG(str, ...) DEBUG(str, ##__VA_ARGS__)
+#define CAN_DEBUG_BUF(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)
+#define CAN_DEBUG_ISR(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)
+#define CAN_DEBUG_LOCK(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)
+#define CAN_DEBUG_RX(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)
+#define CAN_DEBUG_TX(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)
+#define CAN_DEBUG_REG(str, ...) //CAN_DEBUG(str, ##__VA_ARGS__)
+#define CAN_ERR(str, ...) DEBUG(str, ##__VA_ARGS__)
+
+#define CAN_MSG_LEN(msg) ((char *)(&((struct can_msg *)msg)->data[(uint16_t)((struct can_msg *)msg)->len]) - (char *)(msg))
+
+/* Maximum Bus Reg (255) */
+#define CAN_BUS_REG_MAX (255)
+
+/**
+ * @defgroup Controller Area Network (CAN) Driver
+ *
+ * @ingroup RTEMSDeviceDrivers
+ *
+ * @brief Controller Area Network (CAN) bus and device driver support.
+ *
+ * @{
+ */
+
+/**
+ * @defgroup CANBus CAN Bus Driver
+ *
+ * @ingroup CAN
+ *
+ * @{
+ */
+
+/**
+ * @brief CAN tx fifo data structure.
+ */
+struct ring_buf {
+ /**
+ * @brief Pointer to array of can_msg structure.
+ */
+ struct can_msg *pbuf;
+ /**
+ * @brief Index of the next free buffer.
+ */
+ uint32_t head;
+ /**
+ * @brief Index of the produced buffer.
+ */
+ uint32_t tail;
+ /**
+ * @brief Number of empty buffers.
+ */
+ uint32_t empty_count;
+};
+
+/**
+ * @brief CAN Controller device specific operations.
+ * These function pointers are initialized by the CAN device driver while
+ * registering (can_bus_register).
+ */
+typedef struct can_dev_ops {
+ /**
+ * @brief Transfers CAN messages to device fifo.
+ *
+ * @param[in] priv device control structure.
+ * @param[in] msg can_msg message structure.
+ *
+ * @retval 0 Successful operation.
+ * @retval >0 error number in case of an error.
+ */
+ int32_t (*dev_tx)(void *priv, struct can_msg *msg);
+ /**
+ * @brief Check device is ready to transfer a CAN message
+ *
+ * @param[in] priv device control structure.
+ *
+ * @retval true device ready.
+ * @retval false device not ready.
+ */
+ bool (*dev_tx_ready)(void *priv);
+ /**
+ * @brief Enable/Disable CAN interrupts.
+ *
+ * @param[in] priv device control structure.
+ * @param[in] flag true/false to Enable/Disable CAN interrupts.
+ *
+ */
+ void (*dev_int)(void *priv, bool flag);
+ /**
+ * @brief CAN device specific I/O controls.
+ *
+ * @param[in] priv device control structure.
+ * @param[in] buffer This depends on the cmd.
+ * @param[in] cmd Device specific I/O commands.
+ *
+ * @retval 0 Depends on the cmd.
+ */
+ int32_t (*dev_ioctl)(void *priv, void *buffer, size_t cmd);
+} can_dev_ops;
+
+/**
+ * @name CAN bus control
+ *
+ * @{
+ */
+
+/**
+ * @brief Obtains the bus.
+ *
+ * This command has no argument.
+ */
+typedef struct can_bus {
+ /**
+ * @brief Device specific control.
+ */
+ void *priv;
+ /**
+ * @brief Device controller index.
+ */
+ uint8_t index;
+ /**
+ * @brief Device specific operations.
+ */
+ struct can_dev_ops *can_dev_ops;
+ /**
+ * @brief tx fifo.
+ */
+ struct ring_buf tx_fifo;
+ /**
+ * @brief Counting semaphore id (for fifo sync).
+ */
+ rtems_id tx_fifo_sem_id;
+
+ /* FIXME: Using only one CAN msg buffer, Should create a ring buffer */
+ /**
+ * @brief rx fifo.
+ */
+ struct can_msg can_rx_msg;
+ /**
+ * @brief Mutex to handle bus concurrency.
+ */
+ rtems_mutex mutex;
+ /**
+ * @brief Destroys the bus.
+ *
+ * @param[in] bus control structure.
+ */
+ void (*destroy)(struct can_bus *bus);
+#ifdef CAN_DEBUG_LOCK
+
+ /**
+ * @brief For debugging semaphore obtain/release.
+ */
+ int sem_count;
+
+#endif /* CAN_DEBUG_LOCK */
+
+} can_bus;
+
+/** @} */
+
+/**
+ * @brief Register a CAN node with the CAN bus driver.
+ *
+ * @param[in] bus bus control structure.
+ * @param[in] bus_path path of device node.
+ *
+ * @retval >=0 rtems status.
+ */
+rtems_status_code can_bus_register(can_bus *bus, const char *bus_path);
+
+/**
+ * @brief Allocate and initilaize bus control structure.
+ *
+ * @param[in] size Size of the bus control structure.
+ *
+ * @retval NULL No memory available.
+ * @retval Address Pointer to the allocated bus control structure.
+ */
+can_bus *can_bus_alloc_and_init(size_t size);
+
+/**
+ * @brief initilaize bus control structure.
+ *
+ * @param[in] bus bus control structure.
+ *
+ * @retval 0 success.
+ * @retval >0 error number.
+ */
+int can_bus_init(can_bus *bus);
+
+/**
+ * @brief Initiates CAN message transfer.
+ *
+ * Should be called with CAN interrupt disabled.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ * @retval 0 success.
+ * @retval >0 error number.
+ */
+int can_tx_done(struct can_bus *bus);
+
+/**
+ * @brief Sends the received CAN message to the application.
+ *
+ * Should be called by the device when CAN message should be sent to applicaiton.
+ * Should be called only with CAN interrupts disabled.
+ *
+ * @param[in] bus bus control structure.
+ * @param[in] msg can_msg structure.
+ *
+ * @retval 0 success.
+ * @retval >0 error number.
+ */
+int can_receive(struct can_bus *bus, struct can_msg *msg);
+
+/**
+ * @brief Prints the can_msg values pointed by msg.
+ *
+ * @param[in] msg can_msg structure.
+ *
+ */
+void can_print_msg(struct can_msg const *msg);
+
+/** @} */ /* end of CAN device driver */
+
+/** @} */
+
+#endif /* _DEV_CAN_CAN_H */
diff --git a/cpukit/include/dev/can/canqueueimpl.h b/cpukit/include/dev/can/canqueueimpl.h
new file mode 100644
index 0000000000..ef0d56fe31
--- /dev/null
+++ b/cpukit/include/dev/can/canqueueimpl.h
@@ -0,0 +1,231 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup CANBus
+ *
+ * @brief Controller Area Network (CAN) Bus Implementation
+ *
+ */
+
+/*
+ * Copyright (C) 2022 Prashanth S <fishesprashanth@gmail.com>
+ *
+ * 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 _DEV_CAN_CAN_QUEUE_H
+#define _DEV_CAN_CAN_QUEUE_H
+
+#include <rtems/imfs.h>
+#include <rtems/thread.h>
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <dev/can/can-msg.h>
+#include <dev/can/can.h>
+
+/**
+ * @defgroup Controller Area Network (CAN) Driver
+ *
+ * @ingroup RTEMSDeviceDrivers
+ *
+ * @brief Controller Area Network (CAN) bus and device driver support.
+ *
+ * @{
+ */
+
+/**
+ * @defgroup CANBus CAN Bus Driver
+ *
+ * @ingroup CAN
+ *
+ * @{
+ */
+
+/**
+ * @brief Create CAN tx buffers.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ * @retval 0 Successful operation.
+ * @retval >0 error number in case of an error.
+ */
+static rtems_status_code can_bus_create_tx_buffers(struct can_bus *bus);
+
+/**
+ * @brief Free CAN tx buffers.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ */
+static void can_bus_free_tx_buffers(struct can_bus *bus);
+
+/**
+ * @brief Check for atleast one empty CAN tx buffer.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ * @retval true If atleast one CAN buffer is empty.
+ * @retval false If no CAN buffer is empty.
+ */
+static bool can_bus_tx_buf_is_empty(struct can_bus *bus);
+
+/**
+ * @brief Get a produced tx buffer to transmit from the tx fifo.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ * @retval can_msg Pointer to can_msg structure buffer.
+ * @retval NULL If no can_msg buffer.
+ */
+static struct can_msg *can_bus_tx_get_data_buf(struct can_bus *bus);
+
+/**
+ * @brief Get a empty tx buffer.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ * @retval can_msg Pointer to can_msg structure buffer.
+ * @retval NULL If no empty can_msg buffer.
+ */
+static struct can_msg *can_bus_tx_get_empty_buf(struct can_bus *bus);
+
+/**
+ * @brief Creates tx buffers for the CAN bus driver.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ * @retval rtems_status_code
+ */
+static rtems_status_code can_bus_create_tx_buffers(struct can_bus *bus)
+{
+ bus->tx_fifo.pbuf = (struct can_msg *)malloc(CAN_TX_BUF_COUNT *
+ sizeof(struct can_msg));
+ if (bus->tx_fifo.pbuf == NULL) {
+ CAN_ERR("can_create_tx_buffers: malloc failed\n");
+ return RTEMS_NO_MEMORY;
+ }
+
+ bus->tx_fifo.empty_count = CAN_TX_BUF_COUNT;
+
+ return RTEMS_SUCCESSFUL;
+}
+
+/**
+ * @brief Free tx buffers for the CAN bus driver.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ */
+static void can_bus_free_tx_buffers(struct can_bus *bus)
+{
+ free(bus->tx_fifo.pbuf);
+}
+
+/**
+ * @brief Check if there is atleast one tx buffer in the CAN
+ * bus driver.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ * @retval true - If there is at least one free tx buffer.
+ * false - If there is no free tx buffer.
+ */
+static bool can_bus_tx_buf_is_empty(struct can_bus *bus)
+{
+ if (bus->tx_fifo.empty_count == 0) {
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * @brief To get a can_msg tx buf which contains valid data to send in
+ * in the CAN bus.
+ *
+ * Note: freeing the returned data buf is done in the same function,
+ * So the returned buffer should be sent before releasing the
+ * lock acquired while calling this function.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ * @retval *can_msg - If there is atleast one tx buffer to send in the CAN bus.
+ * NULL - If there is no valid tx buffer.
+ */
+static struct can_msg *can_bus_tx_get_data_buf(struct can_bus *bus)
+{
+ struct can_msg *msg = NULL;
+
+ if (bus->tx_fifo.empty_count == CAN_TX_BUF_COUNT ||
+ bus->tx_fifo.tail >= CAN_TX_BUF_COUNT) {
+ CAN_DEBUG_BUF("can_bus_tx_get_data_buf: All buffers are empty\n");
+ return NULL;
+ }
+
+ msg = &bus->tx_fifo.pbuf[bus->tx_fifo.tail];
+ bus->tx_fifo.empty_count++;
+ bus->tx_fifo.tail = (bus->tx_fifo.tail + 1) % CAN_TX_BUF_COUNT;
+
+ return msg;
+}
+
+/**
+ * @brief To get a can_msg tx buf which is empty (contains no valid data).
+ *
+ * Note: marking the returned buf valid is done in the same function
+ * So a valid CAN message should be copied to the returned buffer before
+ * releasing the lock acquired while calling this function.
+ *
+ * @param[in] bus Bus control structure.
+ *
+ * @retval *can_msg - If there is atleast one empty tx buffer.
+ * NULL - If there is no empty tx buffer.
+ */
+static struct can_msg *can_bus_tx_get_empty_buf(struct can_bus *bus)
+{
+ struct can_msg *msg = NULL;
+
+ /* Check whether there is a empty CAN msg buffer */
+ if (can_bus_tx_buf_is_empty(bus) == false) {
+ CAN_DEBUG_BUF("can_bus_tx_get_empty_buf: No empty buffer\n");
+ return NULL;
+ }
+
+ bus->tx_fifo.empty_count--;
+
+ /* tx_fifo.head always points to a empty buffer if there is atleast one */
+ msg = &bus->tx_fifo.pbuf[bus->tx_fifo.head];
+ bus->tx_fifo.head = (bus->tx_fifo.head + 1) % CAN_TX_BUF_COUNT;
+
+ return msg;
+}
+
+/** @} */ /* end of CAN device driver */
+
+/** @} */
+
+#endif /*_DEV_CAN_CAN_QUEUE_H */
diff --git a/cpukit/include/drvmgr/drvmgr.h b/cpukit/include/drvmgr/drvmgr.h
index 8573159af6..bb17c0065f 100644
--- a/cpukit/include/drvmgr/drvmgr.h
+++ b/cpukit/include/drvmgr/drvmgr.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2009 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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 _DRIVER_MANAGER_H_
@@ -485,7 +504,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 +514,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/drvmgr/drvmgr_confdefs.h b/cpukit/include/drvmgr/drvmgr_confdefs.h
index 805e44633c..bd6fa4c3c0 100644
--- a/cpukit/include/drvmgr/drvmgr_confdefs.h
+++ b/cpukit/include/drvmgr/drvmgr_confdefs.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2009 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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.
*/
/*
diff --git a/cpukit/include/drvmgr/drvmgr_list.h b/cpukit/include/drvmgr/drvmgr_list.h
index 102154a56b..a5eb927ec6 100644
--- a/cpukit/include/drvmgr/drvmgr_list.h
+++ b/cpukit/include/drvmgr/drvmgr_list.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2009 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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.
*/
/*
diff --git a/cpukit/include/drvmgr/pci_bus.h b/cpukit/include/drvmgr/pci_bus.h
index 425bac885e..2e3940f1e5 100644
--- a/cpukit/include/drvmgr/pci_bus.h
+++ b/cpukit/include/drvmgr/pci_bus.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2008 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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.
*
*/
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/pci.h b/cpukit/include/pci.h
index 169b581eb3..4046168a39 100644
--- a/cpukit/include/pci.h
+++ b/cpukit/include/pci.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -11,9 +13,26 @@
/*
* COPYRIGHT (c) 2009 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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 __PCI_H__
diff --git a/cpukit/include/pci/access.h b/cpukit/include/pci/access.h
index 9a53c7e3a3..96409150cd 100644
--- a/cpukit/include/pci/access.h
+++ b/cpukit/include/pci/access.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -10,9 +12,26 @@
/*
* COPYRIGHT (c) 2010 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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.
*/
@@ -134,32 +153,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 +204,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/cfg.h b/cpukit/include/pci/cfg.h
index daa992d695..5d6d1c085c 100644
--- a/cpukit/include/pci/cfg.h
+++ b/cpukit/include/pci/cfg.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2010 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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.
*/
/* Four versions of the library exists:
diff --git a/cpukit/include/pci/cfg_auto.h b/cpukit/include/pci/cfg_auto.h
index 4c75a4f8c6..a9de3684d0 100644
--- a/cpukit/include/pci/cfg_auto.h
+++ b/cpukit/include/pci/cfg_auto.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2010 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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 __PCI_CFG_AUTO_H__
diff --git a/cpukit/include/pci/cfg_peripheral.h b/cpukit/include/pci/cfg_peripheral.h
index d68c730a00..693735ca38 100644
--- a/cpukit/include/pci/cfg_peripheral.h
+++ b/cpukit/include/pci/cfg_peripheral.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2010 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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 __PCI_CFG_PERIPHERAL_H__
diff --git a/cpukit/include/pci/cfg_read.h b/cpukit/include/pci/cfg_read.h
index cbd31e4480..6f40288c14 100644
--- a/cpukit/include/pci/cfg_read.h
+++ b/cpukit/include/pci/cfg_read.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -9,9 +11,26 @@
/*
* COPYRIGHT (c) 2010 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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.
*/
diff --git a/cpukit/include/pci/cfg_static.h b/cpukit/include/pci/cfg_static.h
index 12a1264911..f510e35d7e 100644
--- a/cpukit/include/pci/cfg_static.h
+++ b/cpukit/include/pci/cfg_static.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2010 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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 __PCI_CFG_STATIC_H__
diff --git a/cpukit/include/pci/ids_extra.h b/cpukit/include/pci/ids_extra.h
index 41907ba33b..aa0605758a 100644
--- a/cpukit/include/pci/ids_extra.h
+++ b/cpukit/include/pci/ids_extra.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,16 +9,26 @@
/*
* Copyright (C) 2011 Daniel Hellstrom Gaisler <daniel@gaisler.com>
*
- * Permission to use, copy, modify, and/or distribute this software
- * for any purpose with or without fee is hereby granted.
+ * 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.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
- * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
- * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * 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.
*/
/* Only included from pci_ids.h */
diff --git a/cpukit/include/pci/irq.h b/cpukit/include/pci/irq.h
index b7c4a77aab..4069f1ffa8 100644
--- a/cpukit/include/pci/irq.h
+++ b/cpukit/include/pci/irq.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2010 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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.
*/
/* IRQ handling does not have so much with PCI to do, this library depends
@@ -53,7 +72,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 +87,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 +104,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 +120,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 +134,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/inittask.h b/cpukit/include/rtems/confdefs/inittask.h
index 9dbf0b967b..006cbb781f 100644
--- a/cpukit/include/rtems/confdefs/inittask.h
+++ b/cpukit/include/rtems/confdefs/inittask.h
@@ -122,8 +122,9 @@ RTEMS_STATIC_ASSERT(
CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE_IS_TOO_SMALL
);
+static RTEMS_SECTION( ".rtemsstack.userinit" )
RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT )
-static char _RTEMS_tasks_User_task_storage[ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE ];
+char _RTEMS_tasks_User_task_storage[ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE ];
const RTEMS_tasks_User_task_config _RTEMS_tasks_User_task_config = {
{
diff --git a/cpukit/include/rtems/confdefs/libpci.h b/cpukit/include/rtems/confdefs/libpci.h
index 2da6fbccfa..07bf346f69 100644
--- a/cpukit/include/rtems/confdefs/libpci.h
+++ b/cpukit/include/rtems/confdefs/libpci.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -10,9 +12,26 @@
/*
* Copyright (C) 2011 Cobham Gaisler AB
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * 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_LIBPCI_H
diff --git a/cpukit/include/rtems/confdefs/percpu.h b/cpukit/include/rtems/confdefs/percpu.h
index b91590bfd9..a6b35e0eaf 100644
--- a/cpukit/include/rtems/confdefs/percpu.h
+++ b/cpukit/include/rtems/confdefs/percpu.h
@@ -136,20 +136,6 @@ RTEMS_DEFINE_GLOBAL_SYMBOL(
const size_t _Thread_Idle_stack_size = CONFIGURE_IDLE_TASK_STACK_SIZE;
-/*
- * If the user provides a custom idle stack allocator, then we do not need
- * memory reserved for the stacks but the symbol is still referenced in
- * threadcreateidle.c. The code path just never uses it. Make it minimal
- * size to proceed.
- */
-#ifndef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
- char _Thread_Idle_stacks[
- _CONFIGURE_MAXIMUM_PROCESSORS
- * ( CONFIGURE_IDLE_TASK_STACK_SIZE + CPU_IDLE_TASK_IS_FP * CONTEXT_FP_SIZE )
- ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT )
- RTEMS_SECTION( ".rtemsstack.idle" );
-#endif
-
#if defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) && \
!defined(CONFIGURE_IDLE_TASK_BODY)
#error "If you define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION, then you must define CONFIGURE_IDLE_TASK_BODY as well"
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 8e4537f90b..5ccfffaf6e 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
@@ -211,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 ];
};
@@ -220,6 +235,10 @@ const size_t _Thread_Control_add_on_count =
#endif
const size_t _Thread_Initial_thread_count =
+#if !defined(CONFIGURE_IDLE_TASK_STORAGE_SIZE) && \
+ !defined(CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE)
+ _CONFIGURE_MAXIMUM_PROCESSORS +
+#endif
rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) +
rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS );
diff --git a/cpukit/include/rtems/confdefs/wkspace.h b/cpukit/include/rtems/confdefs/wkspace.h
index 82de8633bf..da766fd8af 100644
--- a/cpukit/include/rtems/confdefs/wkspace.h
+++ b/cpukit/include/rtems/confdefs/wkspace.h
@@ -47,6 +47,7 @@
#include <rtems/confdefs/inittask.h>
#include <rtems/confdefs/initthread.h>
#include <rtems/confdefs/objectsposix.h>
+#include <rtems/confdefs/percpu.h>
#include <rtems/confdefs/threads.h>
#include <rtems/confdefs/wkspacesupport.h>
#include <rtems/score/coremsg.h>
@@ -111,8 +112,18 @@
+ 1024 * CONFIGURE_MEMORY_OVERHEAD \
+ _CONFIGURE_HEAP_HANDLER_OVERHEAD )
+#if defined(CONFIGURE_IDLE_TASK_STORAGE_SIZE) || \
+ defined(CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE)
+ #define _CONFIGURE_IDLE_TASK_STACKS 0
+#else
+ #define _CONFIGURE_IDLE_TASK_STACKS \
+ ( _CONFIGURE_MAXIMUM_PROCESSORS * \
+ _Configure_From_stackspace( CONFIGURE_IDLE_TASK_STACK_SIZE ) )
+#endif
+
#define _CONFIGURE_STACK_SPACE_SIZE \
( _CONFIGURE_INIT_TASK_STACK_EXTRA \
+ + _CONFIGURE_IDLE_TASK_STACKS \
+ _CONFIGURE_POSIX_INIT_THREAD_STACK_EXTRA \
+ _CONFIGURE_LIBBLOCK_TASKS_STACK_EXTRA \
+ CONFIGURE_EXTRA_TASK_STACKS \
@@ -212,15 +223,40 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE;
#error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined"
#endif
-/*
- * Custom IDLE thread stacks allocator. If this is provided, it is assumed
- * that the allocator is providing its own memory for these stacks.
- */
-#ifdef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
- const Stack_Allocator_allocate_for_idle _Stack_Allocator_allocate_for_idle =
- CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE;
+#ifdef CONFIGURE_IDLE_TASK_STORAGE_SIZE
+ #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
+ #error "CONFIGURE_IDLE_TASK_STORAGE_SIZE and CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE are mutually exclusive"
+ #endif
+
+ #define _CONFIGURE_IDLE_TASK_STORAGE_SIZE \
+ RTEMS_ALIGN_UP( \
+ RTEMS_TASK_STORAGE_SIZE( \
+ CONFIGURE_IDLE_TASK_STORAGE_SIZE, \
+ RTEMS_DEFAULT_ATTRIBUTES \
+ ), \
+ CPU_INTERRUPT_STACK_ALIGNMENT \
+ )
+
+ const size_t _Stack_Allocator_allocate_for_idle_storage_size =
+ _CONFIGURE_IDLE_TASK_STORAGE_SIZE;
+
+ char _Stack_Allocator_allocate_for_idle_storage_areas[
+ _CONFIGURE_MAXIMUM_PROCESSORS * _CONFIGURE_IDLE_TASK_STORAGE_SIZE
+ ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT )
+ RTEMS_SECTION( ".rtemsstack.idle" );
+
+ #define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE \
+ _Stack_Allocator_allocate_for_idle_static
#endif
+#ifndef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
+ #define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE \
+ _Stack_Allocator_allocate_for_idle_workspace
+#endif
+
+const Stack_Allocator_allocate_for_idle _Stack_Allocator_allocate_for_idle =
+ CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE;
+
#ifdef CONFIGURE_DIRTY_MEMORY
RTEMS_SYSINIT_ITEM(
_Memory_Dirty_free_areas,
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/debugger/rtems-debugger-server.h b/cpukit/include/rtems/debugger/rtems-debugger-server.h
index 2189aac873..4d0407a951 100644
--- a/cpukit/include/rtems/debugger/rtems-debugger-server.h
+++ b/cpukit/include/rtems/debugger/rtems-debugger-server.h
@@ -103,6 +103,7 @@ extern "C" {
#define RTEMS_DEBUGGER_FLAG_MULTIPROCESS (1 << 4)
#define RTEMS_DEBUGGER_FLAG_VERBOSE_LOCK (1 << 5)
#define RTEMS_DEBUGGER_FLAG_VERBOSE_CMDS (1 << 6)
+#define RTEMS_DEBUGGER_FLAG_BREAK_WAITER (1 << 7)
/**
* Forward decl for the threads and targets.
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/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/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 ce26787294..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
)
{
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-debugger.h b/cpukit/include/rtems/rtems-debugger.h
index 1fc8b3d522..7627e83382 100644
--- a/cpukit/include/rtems/rtems-debugger.h
+++ b/cpukit/include/rtems/rtems-debugger.h
@@ -54,6 +54,14 @@ extern int rtems_debugger_start(const char* remote,
const rtems_printer* printer);
/**
+ * Suspend all running threads including the caller if not
+ * excluded. Returns when the debugger has connected and continued.
+ *
+ * If wait is true and there is no remote connected wait then break.
+ */
+extern int rtems_debugger_break(bool wait);
+
+/**
* Stop the Debugger.
*/
extern int rtems_debugger_stop(void);
diff --git a/cpukit/include/rtems/rtems-fdt.h b/cpukit/include/rtems/rtems-fdt.h
index 62db32e912..e3ebfe3ba4 100644
--- a/cpukit/include/rtems/rtems-fdt.h
+++ b/cpukit/include/rtems/rtems-fdt.h
@@ -64,6 +64,21 @@ typedef struct
rtems_fdt_blob* blob; /**< The blob the handle references. */
} rtems_fdt_handle;
+/**
+ * FDT Address property. It is an address an optionally a size.
+ *
+ * Only 32bit addresses and sizes on 32bit machine. Ignore the upper
+ * 32bits.
+ */
+typedef struct
+{
+ int node;
+ uint64_t address;
+ uint64_t size;
+ int address_cells;
+ int size_cells;
+} rtems_fdt_address_map;
+
/*
* The following are mappings to the standard FDT calls.
*/
@@ -165,9 +180,13 @@ typedef struct
* The blob cannot be unloaded as it is referenced.
*/
#define RTEMS_FDT_ERR_REFERENCED 104
+/**
+ * The property length is invalid
+ */
+#define RTEMS_FDT_ERR_BADLENGTH 105
#define RTEMS_FDT_ERR_RTEMS_MIN 100
-#define RTEMS_FDT_ERR_MAX 104
+#define RTEMS_FDT_ERR_MAX 105
/**
* Initialise a handle to a default state.
@@ -237,7 +256,7 @@ int rtems_fdt_register (const void* blob, rtems_fdt_handle* handle);
/**
* Unload a device tree blob or DTB file and release any memory allocated when
- * loading. The blob is removed from the list of registered.
+ * loading. The blob is removed from the list if registered.
*
* @param blob_desc A valid blob descriptor.
* @return int If less than 0 it is an error code else 0 is return on success.
@@ -277,7 +296,7 @@ int rtems_fdt_get_mem_rsv (rtems_fdt_handle* handle,
* larger string, such as a full path.
*
* @param blob_desc A valid blob descriptor.
- * @param arentoffset Structure block offset of a node
+ * @param parentoffset Structure block offset of a node
* @param name Name of the subnode to locate.
* @param namelen Number of characters of name to consider.
* @return int If less than 0 it is an error code else the node offset is
@@ -326,7 +345,9 @@ int rtems_fdt_path_offset (rtems_fdt_handle* handle, const char* path);
*
* @param handle The FDT handle to the current blob.
* @param nodeoffset Structure block offset of the starting node.
- * @param length Pointer to an integer variable (will be overwritten) or NULL.
+ * @param length Pointer to an integer variable or NULL. If non-NULL, this will
+ * be overwritten with either the length in bytes or the error
+ * code.
* @return const char* The node's name on success or NULL on error. The length
* if non-NULL will hold the error code.
*/
@@ -335,6 +356,41 @@ const char* rtems_fdt_get_name (rtems_fdt_handle* handle,
int* length);
/**
+ * Retrieve the offset for the first property for a node.
+ *
+ * @param handle The FDT handle to the current blob.
+ * @param nodeoffset Structure block offset of the starting node.
+ * @return int The offset of a node's first property.
+ */
+int rtems_fdt_first_prop_offset(rtems_fdt_handle* handle, int nodeoffset);
+
+/**
+ * Retrieve the next property of a node relative to the property
+ *
+ * @param handle The FDT handle to the current blob.
+ * @param propoffset Property offset to search from
+ * @return int Property offset or end if less than 0.
+ */
+int rtems_fdt_next_prop_offset(rtems_fdt_handle* handle, int propoffset);
+
+/**
+ * Retrieve the property value, name and length of name given a
+ * property offset.
+ *
+ * @param handle The FDT handle to the current blob.
+ * @param propoffset Property offset
+ * @param name If not NULL set the pointer to the name string.
+ * @param length Pointer to an integer variable or NULL. If non-NULL, this will
+ * be overwritten with either the length in bytes or the error
+ * code.
+ * @return const void* The node's value data.
+ */
+const void* rtems_fdt_getprop_by_offset(rtems_fdt_handle* handle,
+ int propoffset,
+ const char** name,
+ int* length);
+
+/**
* Get property value based on substring. Identical to rtems_fdt_getprop(), but
* only examine the first namelen characters of name for matching the property
* name.
@@ -343,8 +399,9 @@ const char* rtems_fdt_get_name (rtems_fdt_handle* handle,
* @param nodeoffset Offset of the node whose property to find
* @param name The name of the property to find
* @param namelen The number of characters of name to consider
- * @param length A pointer to an integer variable (will be overwritten) or
- * NULL.
+ * @param length Pointer to an integer variable or NULL. If non-NULL, this will
+ * be overwritten with either the length in bytes or the error
+ * code.
* @return const void* The node's property on success or NULL on error. The
* length if non-NULL will hold the error code.
*/
@@ -364,8 +421,9 @@ const void *rtems_fdt_getprop_namelen (rtems_fdt_handle* handle,
* @param handle The FDT handle to the current blob.
* @param nodeoffset The offset of the node whose property to find.
* @param name The name of the property to find.
- * @param length A pointer to an integer variable (will be overwritten) or
- * NULL.
+ * @param length Pointer to an integer variable or NULL. If non-NULL, this will
+ * be overwritten with either the length in bytes or the error
+ * code.
* @return const void* The node's property on success or NULL on error. The
* length if non-NULL will hold the error code.
*/
@@ -375,7 +433,7 @@ const void *rtems_fdt_getprop (rtems_fdt_handle* handle,
int* length);
/**
- * Retrieve the phandle of a given of the device tree node at structure block
+ * Retrieve the phandle of the device tree node at structure block
* offset nodeoffset.
*
* @param handle The FDT handle to the current blob.
@@ -586,6 +644,14 @@ int rtems_fdt_next_node (rtems_fdt_handle* handle, int offset, int* depth);
const char* rtems_fdt_strerror (int errval);
/**
+ * Return a parent property given a node offset. Travel up until found
+ * or the root node is reached
+ */
+bool rtems_fdt_get_parent_prop_value(rtems_fdt_handle* handle,
+ int nodeoffset,
+ const char* name,
+ uint32_t* value);
+/**
* Return a property given a path.
*/
int rtems_fdt_prop_value(const char* const path,
@@ -600,7 +666,7 @@ int rtems_fdt_prop_value(const char* const path,
int rtems_fdt_prop_map (const char* const path,
const char* const propname,
const char* const names[],
- uint32_t* values,
+ uintptr_t* values,
size_t count);
/*
@@ -609,7 +675,7 @@ int rtems_fdt_prop_map (const char* const path,
int rtems_fdt_get_value (const char* const path,
const char* const property,
size_t size,
- uint32_t* value);
+ uintptr_t* value);
/**
* Get the number of entries in an FDT handle.
@@ -629,9 +695,46 @@ const char *rtems_fdt_entry_name(rtems_fdt_handle* handle, int id);
int rtems_fdt_entry_offset(rtems_fdt_handle* handle, int id);
/*
+ * Helper function to convert the void* property result of unknown
+ * length to an unsigned int pointer value.
+ */
+uintptr_t rtems_fdt_get_offset_len_uintptr(const void* prop, int offset, int len);
+
+/*
* Helper function to convert the void* property result to a 32bit unsigned int.
*/
-uint32_t rtems_fdt_get_uint32 (const void* prop);
+uint32_t rtems_fdt_get_uint32(const void* prop);
+uint32_t rtems_fdt_get_offset_uint32(const void* prop, int offset);
+
+/*
+ * Helper function to convert the void* property result to a 64bit unsigned int.
+ */
+uint64_t rtems_fdt_get_uint64(const void* prop);
+uint64_t rtems_fdt_get_offset_uint64(const void* prop, int offset);
+
+/*
+ * Helper function to convert the void* property result to a uintptr_t
+ */
+uintptr_t rtems_fdt_get_uintptr(const void* prop);
+uintptr_t rtems_fdt_get_offset_uintptr(const void* prop, int offset);
+
+/*
+ * Find the address cells property in parent nodes.
+ */
+int rtems_fdt_getprop_address_cells(rtems_fdt_handle* handle, int nodeoffset);
+
+/*
+ * Find the size cells property in parent nodes.
+ */
+int rtems_fdt_getprop_size_cells(rtems_fdt_handle* handle, int nodeoffset);
+
+/*
+ * Get an address space property.
+ */
+int rtems_fdt_getprop_address_map(rtems_fdt_handle* handle,
+ const char* path,
+ const char* name,
+ rtems_fdt_address_map* addr_map);
#ifdef __cplusplus
}
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..2f541d46a2 100644
--- a/cpukit/include/rtems/rtems/clock.h
+++ b/cpukit/include/rtems/rtems/clock.h
@@ -909,7 +909,7 @@ rtems_interval rtems_clock_get_ticks_since_boot( void );
* @brief Gets the seconds and nanoseconds elapsed since some time point during
* the system initialization using CLOCK_MONOTONIC.
*
- * @param[out] uptime is the pointer to a struct timeval object. When the
+ * @param[out] uptime is the pointer to a struct timespec object. When the
* directive call is successful, the seconds and nanoseconds elapsed since
* some time point during the system initialization and some point during the
* directive call using CLOCK_MONOTONIC will be stored in this object.
@@ -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 ba05d92531..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 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/create */
/**
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/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..003e80e0bd 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;
/**
@@ -229,6 +229,9 @@ typedef enum {
INTERNAL_ERROR_NO_MEMORY_FOR_PER_CPU_DATA = 40,
INTERNAL_ERROR_TOO_LARGE_TLS_SIZE = 41,
INTERNAL_ERROR_RTEMS_INIT_TASK_CONSTRUCT_FAILED = 42,
+ INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED = 43,
+ INTERNAL_ERROR_NO_MEMORY_FOR_IDLE_TASK_STORAGE = 44,
+ INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL = 45
} Internal_errors_Core_list;
typedef CPU_Uint32ptr Internal_errors_t;
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 fa17ea164c..7eceef360b 100644
--- a/cpukit/include/rtems/score/memory.h
+++ b/cpukit/include/rtems/score/memory.h
@@ -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
)
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/objectimpl.h b/cpukit/include/rtems/score/objectimpl.h
index 7938996df8..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
)
@@ -922,7 +922,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Free(
* allocated block of objects.
* @retval false Otherwise.
*/
-RTEMS_INLINE_ROUTINE bool _Objects_Is_in_allocated_block(
+static inline bool _Objects_Is_in_allocated_block(
Objects_Maximum index,
Objects_Maximum objects_per_block
)
@@ -939,7 +939,7 @@ RTEMS_INLINE_ROUTINE bool _Objects_Is_in_allocated_block(
* @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
)
@@ -971,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 6f6cc12bac..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
*
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 06a35ae95f..8aa0388537 100644
--- a/cpukit/include/rtems/score/scheduleredfimpl.h
+++ b/cpukit/include/rtems/score/scheduleredfimpl.h
@@ -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
@@ -220,7 +220,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract_body(
*
* @param scheduler is the scheduler.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_EDF_Get_highest_ready(
+static inline Thread_Control *_Scheduler_EDF_Get_highest_ready(
const Scheduler_Control *scheduler
)
{
diff --git a/cpukit/include/rtems/score/schedulerimpl.h b/cpukit/include/rtems/score/schedulerimpl.h
index 33070651db..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,
@@ -675,7 +675,7 @@ Status_Control _Scheduler_Set_affinity(
*
* @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
)
{
@@ -697,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,
@@ -714,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 );
@@ -728,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
)
{
@@ -750,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
)
{
@@ -787,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
)
@@ -810,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
@@ -838,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,
@@ -870,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
@@ -898,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,
@@ -928,7 +928,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Discard_idle_thread(
* @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 06d2027a45..eef0de59b1 100644
--- a/cpukit/include/rtems/score/schedulerpriorityimpl.h
+++ b/cpukit/include/rtems/score/schedulerpriorityimpl.h
@@ -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
)
@@ -235,7 +235,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Scheduler_priority_Ready_queue_first(
*
* @param scheduler is the scheduler.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_priority_Get_highest_ready(
+static inline Thread_Control *_Scheduler_priority_Get_highest_ready(
const Scheduler_Control *scheduler
)
{
@@ -257,7 +257,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_priority_Get_highest_ready(
* @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 2293433870..da052ba1b4 100644
--- a/cpukit/include/rtems/score/schedulersimpleimpl.h
+++ b/cpukit/include/rtems/score/schedulersimpleimpl.h
@@ -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
@@ -137,7 +137,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_simple_Extract(
*
* @param scheduler is the scheduler.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_simple_Get_highest_ready(
+static inline Thread_Control *_Scheduler_simple_Get_highest_ready(
const Scheduler_Control *scheduler
)
{
diff --git a/cpukit/include/rtems/score/scheduleruniimpl.h b/cpukit/include/rtems/score/scheduleruniimpl.h
index faa719ce45..5cc4942fcc 100644
--- a/cpukit/include/rtems/score/scheduleruniimpl.h
+++ b/cpukit/include/rtems/score/scheduleruniimpl.h
@@ -57,7 +57,7 @@ extern "C" {
* @param[in, out] heir is the current heir thread.
* @param[in, out] new_heir is the new heir thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Update_heir(
+static inline void _Scheduler_uniprocessor_Update_heir(
Thread_Control *heir,
Thread_Control *new_heir
)
@@ -86,7 +86,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Update_heir(
*
* @param[in, out] new_heir is the new heir thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Update_heir_if_necessary(
+static inline void _Scheduler_uniprocessor_Update_heir_if_necessary(
Thread_Control *new_heir
)
{
@@ -104,7 +104,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Update_heir_if_necessary(
* @param[in, out] heir is the current heir thread.
* @param[in, out] new_heir is the new heir thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Update_heir_if_preemptible(
+static inline void _Scheduler_uniprocessor_Update_heir_if_preemptible(
Thread_Control *heir,
Thread_Control *new_heir
)
@@ -123,7 +123,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Update_heir_if_preemptible(
* @param extract is the handler to extract the thread.
* @param get_highest_ready is the handler to get the highest ready thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Block(
+static inline void _Scheduler_uniprocessor_Block(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node,
@@ -154,7 +154,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Block(
* @param the_thread is the thread.
* @param priority is the priority of the thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Unblock(
+static inline void _Scheduler_uniprocessor_Unblock(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Priority_Control priority
@@ -181,7 +181,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Unblock(
* @param scheduler is the scheduler.
* @param get_highest_ready is the handler to get the highest ready thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Schedule(
+static inline void _Scheduler_uniprocessor_Schedule(
const Scheduler_Control *scheduler,
Thread_Control *( *get_highest_ready )( const Scheduler_Control * )
)
@@ -201,7 +201,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Schedule(
* @param scheduler is the scheduler.
* @param get_highest_ready is the handler to get the highest ready thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_uniprocessor_Yield(
+static inline void _Scheduler_uniprocessor_Yield(
const Scheduler_Control *scheduler,
Thread_Control *( *get_highest_ready )( const Scheduler_Control * )
)
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/stack.h b/cpukit/include/rtems/score/stack.h
index 360e4d61f6..9326480373 100644
--- a/cpukit/include/rtems/score/stack.h
+++ b/cpukit/include/rtems/score/stack.h
@@ -11,8 +11,8 @@
*/
/*
- * COPYRIGHT (c) 1989-2006.
- * On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2022 embedded brains GmbH
+ * Copyright (C) 1989, 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
@@ -105,15 +105,22 @@ typedef void ( *Stack_Allocator_free )( void *addr );
* The allocate for idle handler is optional even when the user thread stack
* allocator and deallocator are configured.
*
- * @param cpu Index of the CPU for the IDLE thread using this stack
- * @param stack_size The size of the stack area to allocate in bytes.
+ * @param cpu is the index of the CPU for the IDLE thread using this stack.
*
- * @retval NULL Not enough memory.
- * @retval other Pointer to begin of stack area.
+ * @param stack_size[in, out] is pointer to a size_t object. On function
+ * entry, the object contains the proposed size of the stack area to allocate
+ * in bytes. The proposed size does not take the actual thread-local storage
+ * size of the application into account. The stack allocator can modify the
+ * size to ensure that there is enough space available in the stack area for
+ * the thread-local storage.
+ *
+ * @retval NULL There was not enough memory available to allocate a stack area.
+ *
+ * @return Returns the pointer to begin of the allocated stack area.
*/
typedef void *( *Stack_Allocator_allocate_for_idle )(
uint32_t cpu,
- size_t stack_size
+ size_t *stack_size
);
/**
@@ -165,7 +172,57 @@ extern const Stack_Allocator_free _Stack_Allocator_free;
*/
void _Stack_Allocator_do_initialize( void );
-/** @} */
+/**
+ * @brief Allocates the IDLE thread storage area from the workspace.
+ *
+ * If the thread storage area cannot be allocated, then the
+ * ::INTERNAL_ERROR_NO_MEMORY_FOR_IDLE_TASK_STACK fatal error will occur.
+ *
+ * @param unused is an unused parameter.
+ *
+ * @param stack_size[in] is pointer to a size_t object. On function entry, the
+ * object contains the size of the task storage area to allocate in bytes.
+ *
+ * @return Returns a pointer to the begin of the allocated task storage area.
+ */
+void *_Stack_Allocator_allocate_for_idle_workspace(
+ uint32_t unused,
+ size_t *storage_size
+);
+
+/**
+ * @brief The size in bytes of the idle thread storage area used by
+ * _Stack_Allocator_allocate_for_idle_static().
+ *
+ * Application provided via <rtems/confdefs.h>.
+ */
+extern const size_t _Stack_Allocator_allocate_for_idle_storage_size;
+
+/**
+ * @brief The thread storage areas used by
+ * _Stack_Allocator_allocate_for_idle_static().
+ *
+ * Application provided via <rtems/confdefs.h>.
+ */
+extern char _Stack_Allocator_allocate_for_idle_storage_areas[];
+
+/**
+ * @brief Allocates the IDLE thread storage from the memory statically
+ * allocated by <rtems/confdefs.h>.
+ *
+ * @param cpu_index is the index of the CPU for the IDLE thread using this stack.
+ *
+ * @param stack_size[out] is pointer to a size_t object. On function return, the
+ * object value is set to the value of
+ * ::_Stack_Allocator_allocate_for_idle_storage_size.
+ *
+ * @return Returns a pointer to the begin of the allocated task storage area.
+ */
+void *_Stack_Allocator_allocate_for_idle_static(
+ uint32_t cpu_index,
+ size_t *storage_size
+);
+
/**
* @brief The stack allocator allocate stack for idle thread handler.
*
@@ -174,6 +231,8 @@ void _Stack_Allocator_do_initialize( void );
extern const Stack_Allocator_allocate_for_idle
_Stack_Allocator_allocate_for_idle;
+/** @} */
+
#ifdef __cplusplus
}
#endif
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 40fefbc79a..2b4d6823f0 100644
--- a/cpukit/include/rtems/score/thread.h
+++ b/cpukit/include/rtems/score/thread.h
@@ -858,6 +858,15 @@ struct _Thread_Control {
#endif
/*================= end of common block =================*/
+ /**
+ * @brief This member contains the context of this thread.
+ *
+ * This member is placed directly after the end of the common block so that
+ * the structure offsets are as small as possible. This helps on instruction
+ * set architectures with a very limited range for intermediate values.
+ */
+ Context_Control Registers;
+
#if defined(RTEMS_SMP) && defined(RTEMS_PROFILING)
/**
* @brief Potpourri lock statistics.
@@ -913,8 +922,6 @@ struct _Thread_Control {
Thread_Action_control Post_switch_actions;
- /** This field contains the context of this thread. */
- Context_Control Registers;
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
/** This field points to the floating point context for this thread.
* If NULL, the thread is integer only.
@@ -1179,13 +1186,6 @@ Thread_Information name##_Information = { \
} \
}
-/**
- * @brief The idle thread stacks.
- *
- * Provided by the application via <rtems/confdefs.h>.
- */
-extern char _Thread_Idle_stacks[];
-
#if defined(RTEMS_MULTIPROCESSING)
/**
* @brief The configured thread control block.
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 638815237f..01c3860db8 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -468,7 +468,7 @@ Status_Control _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 );
}
@@ -595,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
)
@@ -609,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
)
@@ -626,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
)
{
@@ -645,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
)
@@ -659,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
)
@@ -677,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
)
{
@@ -791,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,
@@ -876,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
)
@@ -893,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
)
@@ -913,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
)
{
@@ -941,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
)
{
@@ -985,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
)
{
@@ -1004,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
)
@@ -1028,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
)
{
@@ -1048,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
)
{
@@ -1067,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
)
{
@@ -1083,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
)
{
@@ -1106,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
)
{
@@ -1132,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 )
@@ -1147,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 )
@@ -1172,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;
}
@@ -1187,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 );
}
@@ -1197,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 =
@@ -1219,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 );
@@ -1238,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
)
{
@@ -1258,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
)
@@ -1280,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
@@ -1337,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
)
{
@@ -1349,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
)
{
@@ -1368,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
@@ -1401,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
)
@@ -1423,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
)
{
@@ -1438,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
)
{
@@ -1453,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
)
{
@@ -1469,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
)
{
@@ -1485,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
)
{
@@ -1498,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
)
{
@@ -1514,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
)
{
@@ -1537,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
)
{
@@ -1552,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
)
{
@@ -1571,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
)
{
@@ -1593,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
)
@@ -1616,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
)
@@ -1630,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
)
@@ -1652,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
@@ -1695,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
)
@@ -1718,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
)
@@ -1743,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
)
{
@@ -1760,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
)
{
@@ -1774,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
)
{
@@ -1791,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
)
@@ -1810,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
)
{
@@ -1832,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
)
@@ -1851,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
)
@@ -1867,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
)
@@ -1886,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
)
@@ -1907,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
)
@@ -1925,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
)
@@ -1945,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
)
@@ -2001,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
)
@@ -2020,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
)
@@ -2062,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
)
@@ -2085,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
)
@@ -2114,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
)
@@ -2133,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
)
@@ -2162,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
)
{
@@ -2221,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
)
{
@@ -2239,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
)
@@ -2326,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
)
@@ -2345,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
)
{
@@ -2363,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
)
{
@@ -2390,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
@@ -2430,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
@@ -2484,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
)
{
@@ -2518,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
)
@@ -2535,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
@@ -2561,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,
@@ -2586,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;
@@ -2612,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
)
@@ -2683,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() );
@@ -2700,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
)
@@ -2752,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..abb0a748ad 100644
--- a/cpukit/include/rtems/score/tls.h
+++ b/cpukit/include/rtems/score/tls.h
@@ -10,7 +10,7 @@
*/
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * 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
@@ -37,7 +37,7 @@
#ifndef _RTEMS_SCORE_TLS_H
#define _RTEMS_SCORE_TLS_H
-#include <rtems/score/cpu.h>
+#include <rtems/score/cpuimpl.h>
#include <string.h>
@@ -116,9 +116,9 @@ typedef struct {
} TLS_Index;
/**
- * @brief Gets the TLS size.
+ * @brief Gets the size of the thread-local storage data in bytes.
*
- * @return The TLS size.
+ * @return Returns the size of the thread-local storage data in bytes.
*/
static inline uintptr_t _TLS_Get_size( void )
{
@@ -135,82 +135,60 @@ static inline uintptr_t _TLS_Get_size( void )
}
/**
- * @brief Returns the value aligned up to the stack alignment.
+ * @brief Gets the size of the thread control block area in bytes.
*
- * @param val The value to align.
- *
- * @return The value aligned to the stack alignment.
+ * @return Returns the size of the thread control block area in bytes.
*/
-static inline uintptr_t _TLS_Align_up( uintptr_t val )
+static inline uintptr_t _TLS_Get_thread_control_block_area_size( void )
{
- uintptr_t alignment = CPU_STACK_ALIGNMENT;
+#if CPU_THREAD_LOCAL_STORAGE_VARIANT == 11
+ uintptr_t alignment;
- return RTEMS_ALIGN_UP( val, alignment );
-}
+ alignment = (uintptr_t) _TLS_Alignment;
-/**
- * @brief Returns the size of the thread control block area size for this
- * alignment, or the minimum size if alignment is too small.
- *
- * @param alignment The alignment for the operation.
- *
- * @return The size of the thread control block area.
- */
-static inline uintptr_t _TLS_Get_thread_control_block_area_size(
- uintptr_t alignment
-)
-{
- return alignment <= sizeof(TLS_Thread_control_block) ?
- sizeof(TLS_Thread_control_block) : alignment;
+ return RTEMS_ALIGN_UP( sizeof( TLS_Thread_control_block ), alignment );
+#else
+ return sizeof( TLS_Thread_control_block );
+#endif
}
/**
- * @brief Return the TLS area allocation size.
+ * @brief Gets the allocation size of the thread-local storage area in bytes.
*
- * @return The TLS area allocation size.
+ * @return Returns the allocation size of the thread-local storage area in
+ * bytes.
*/
uintptr_t _TLS_Get_allocation_size( void );
/**
- * @brief Copies TLS size bytes from the address tls_area and returns a pointer
- * to the start of the area after clearing it.
- *
- * @param tls_area The starting address of the area to clear.
+ * @brief Initializes the thread-local storage data.
*
- * @return The pointer to the beginning of the cleared section.
+ * @param[out] tls_data is the thread-local storage data to initialize.
*/
-static inline void *_TLS_Copy_and_clear( void *tls_area )
+static inline void _TLS_Copy_and_clear( void *tls_data )
{
- tls_area = memcpy(
- tls_area,
- _TLS_Data_begin,
- (size_t) ((uintptr_t)_TLS_Data_size)
- );
-
+ tls_data = memcpy( tls_data, _TLS_Data_begin, (uintptr_t) _TLS_Data_size );
memset(
- (char *) tls_area + (size_t)((intptr_t) _TLS_BSS_begin) -
- (size_t)((intptr_t) _TLS_Data_begin),
+ (char *) tls_data +
+ (uintptr_t) _TLS_BSS_begin - (uintptr_t) _TLS_Data_begin,
0,
- ((size_t) (intptr_t)_TLS_BSS_size)
+ (uintptr_t) _TLS_BSS_size
);
-
- return tls_area;
}
/**
- * @brief Initializes the dynamic thread vector.
+ * @brief Initializes the thread control block and the dynamic thread vector.
*
- * @param tls_block The tls block for @a dtv.
- * @param tcb The thread control block for @a dtv.
- * @param[out] dtv The dynamic thread vector to initialize.
+ * @param tls_data is the thread-local storage data address.
*
- * @return Pointer to an area that was copied and cleared from tls_block
- * onwards (@see _TLS_Copy_and_clear).
+ * @param[out] tcb is the thread control block to initialize.
+ *
+ * @param[out] dtv is the dynamic thread vector to initialize.
*/
-static inline void *_TLS_Initialize(
- void *tls_block,
- TLS_Thread_control_block *tcb,
+static inline void _TLS_Initialize_TCB_and_DTV(
+ void *tls_data,
+ TLS_Thread_control_block *tcb,
TLS_Dynamic_thread_vector *dtv
)
{
@@ -220,86 +198,70 @@ static inline void *_TLS_Initialize(
#else
tcb->dtv = dtv;
dtv->generation_number = 1;
- dtv->tls_blocks[0] = tls_block;
+ dtv->tls_blocks[0] = tls_data;
#endif
-
- return _TLS_Copy_and_clear( tls_block );
}
/**
- * @brief Initializes a dynamic thread vector beginning at the given starting
- * address.
+ * @brief Initializes the thread-local storage area.
*
- * Use Variant I, TLS offsets emitted by linker takes the TCB into account.
+ * @param tls_area[out] is the thread-local storage area to initialize.
*
- * @param tls_area The tls area for the initialization.
- *
- * @return Pointer to an area that was copied and cleared from tls_block
- * onwards (@see _TLS_Copy_and_clear).
+ * @return Where the architectures uses Variant I and the TLS offsets emitted
+ * by the linker neglect the TCB, returns the address of the thread-local
+ * storage data. Otherwise, returns the address of the thread control block.
*/
-static inline void *_TLS_TCB_at_area_begin_initialize( void *tls_area )
+static inline void *_TLS_Initialize_area( 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;
- 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);
-
- return _TLS_Initialize( tls_block, tcb, dtv );
-}
+ uintptr_t alignment;
+ void *tls_data;
+ TLS_Thread_control_block *tcb;
+ TLS_Dynamic_thread_vector *dtv;
+ void *return_value;
+#if CPU_THREAD_LOCAL_STORAGE_VARIANT == 11
+ uintptr_t tcb_size;
+#endif
+#if CPU_THREAD_LOCAL_STORAGE_VARIANT == 20
+ uintptr_t size;
+ uintptr_t alignment_2;
+#endif
-/**
- * @brief Initializes a dynamic thread vector with the area before a given
- * starting address as thread control block.
- *
- * Use Variant I, TLS offsets emitted by linker neglects the TCB.
- *
- * @param tls_area The tls area for the initialization.
- *
- * @return Pointer to an area that was copied and cleared from tls_block
- * onwards (@see _TLS_Copy_and_clear).
- */
-static inline void *_TLS_TCB_before_TLS_block_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_Thread_control_block *)
- ((char *) tls_block - sizeof(*tcb));
- 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);
-
- return _TLS_Initialize( tls_block, tcb, dtv );
-}
+ alignment = (uintptr_t) _TLS_Alignment;
-/**
- * @brief Initializes a dynamic thread vector with the area after a given
- * starting address as thread control block.
- *
- * Use Variant II
- *
- * @param tls_area The tls area for the initialization.
- *
- * @return Pointer to an area that was copied and cleared from tls_block
- * onwards (@see _TLS_Copy_and_clear).
- */
-static inline void *_TLS_TCB_after_TLS_block_initialize( void *tls_area )
-{
- uintptr_t size = (uintptr_t) _TLS_Size;
- uintptr_t tls_align = (uintptr_t) _TLS_Alignment;
- uintptr_t tls_mask = tls_align - 1;
- uintptr_t heap_align = _TLS_Align_up( tls_align );
- uintptr_t heap_mask = heap_align - 1;
- TLS_Thread_control_block *tcb = (TLS_Thread_control_block *)
- ((char *) tls_area + ((size + heap_mask) & ~heap_mask));
- void *tls_block = (char *) tcb - ((size + tls_mask) & ~tls_mask);
- TLS_Dynamic_thread_vector *dtv = (TLS_Dynamic_thread_vector *)
- ((char *) tcb + sizeof(*tcb));
-
- _TLS_Initialize( tls_block, tcb, dtv );
-
- return tcb;
+#ifdef __i386__
+ dtv = NULL;
+#else
+ dtv = (TLS_Dynamic_thread_vector *) tls_area;
+ tls_area = (char *) tls_area + sizeof( *dtv );
+#endif
+
+#if CPU_THREAD_LOCAL_STORAGE_VARIANT == 10
+ tls_data = (void *)
+ RTEMS_ALIGN_UP( (uintptr_t) tls_area + sizeof( *tcb ), alignment );
+ tcb = (TLS_Thread_control_block *) ((char *) tls_data - sizeof( *tcb ));
+ return_value = tls_data;
+#elif CPU_THREAD_LOCAL_STORAGE_VARIANT == 11
+ tcb_size = RTEMS_ALIGN_UP( sizeof( *tcb ), alignment );
+ tls_data = (void *)
+ RTEMS_ALIGN_UP( (uintptr_t) tls_area + tcb_size, alignment );
+ tcb = (TLS_Thread_control_block *) ((char *) tls_data - tcb_size);
+ return_value = tcb;
+#elif CPU_THREAD_LOCAL_STORAGE_VARIANT == 20
+ alignment_2 = RTEMS_ALIGN_UP( alignment, CPU_SIZEOF_POINTER );
+ tls_area = (void *) RTEMS_ALIGN_UP( (uintptr_t) tls_area, alignment_2 );
+ size = _TLS_Get_size();
+ tcb = (TLS_Thread_control_block *)
+ ((char *) tls_area + RTEMS_ALIGN_UP( size, alignment_2 ));
+ tls_data = (char *) tcb - RTEMS_ALIGN_UP( size, alignment );
+ return_value = tcb;
+#else
+#error "unexpected CPU_THREAD_LOCAL_STORAGE_VARIANT value"
+#endif
+
+ _TLS_Initialize_TCB_and_DTV( tls_data, tcb, dtv );
+ _TLS_Copy_and_clear( tls_data );
+
+ return return_value;
}
/** @} */
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/stackchk.h b/cpukit/include/rtems/stackchk.h
index 22d48c9d2b..c836263925 100644
--- a/cpukit/include/rtems/stackchk.h
+++ b/cpukit/include/rtems/stackchk.h
@@ -40,9 +40,7 @@
#ifndef _RTEMS_STACKCHK_H
#define _RTEMS_STACKCHK_H
-#include <stdbool.h> /* bool */
-
-#include <rtems/score/thread.h> /* Thread_Control */
+#include <rtems.h>
#include <rtems/print.h>
/**
@@ -92,6 +90,81 @@ void rtems_stack_checker_report_usage_with_plugin(
const rtems_printer *printer
);
+/**
+ * @brief This structure contains the stack information provided by the stack
+ * checker for a stack.
+ */
+typedef struct {
+ /**
+ * @brief This member contains the object identifier associated with the
+ * object using the stack.
+ *
+ * For interrupt stacks, the object identifier is the processor index.
+ */
+ rtems_id id;
+
+ /**
+ * @brief This member provides the object name associated with the
+ * object using the stack.
+ *
+ * For interrupt stacks, the object name is "Interrupt Stack".
+ */
+ const char *name;
+
+ /**
+ * @brief This member provides the begin address of the stack area.
+ */
+ const void *begin;
+
+ /**
+ * @brief This member contains the size in byes of the stack area.
+ */
+ uintptr_t size;
+
+ /**
+ * @brief This member provides the current stack pointer of the stack.
+ *
+ * If the current stack pointer is not available, then the value is set to
+ * NULL.
+ */
+ const void *current;
+
+ /**
+ * @brief This member contains the size in byes of the used stack area.
+ *
+ * If the stack checker is not initialized, then the value is set to
+ * UINTPTR_MAX.
+ */
+ uintptr_t used;
+} rtems_stack_checker_info;
+
+/**
+ * @brief Visitor routines invoked by rtems_stack_checker_iterate() shall have
+ * this type.
+ *
+ * @param info is the stack information.
+ *
+ * @param arg is the argument passed to rtems_stack_checker_iterate().
+ */
+typedef void ( *rtems_stack_checker_visitor )(
+ const rtems_stack_checker_info *info,
+ void *arg
+);
+
+/**
+ * @brief Iterates over all stacks used by the system and invokes the visitor
+ * routine for each stack.
+ *
+ * This method prints a stack usage report for the curently executing
+ * task.
+ *
+ * @param visitor is the visitor routine invoked for each stack.
+ *
+ * @param arg is the argument passed to each visitor routine invocation during
+ * the iteration.
+ */
+void rtems_stack_checker_iterate( rtems_stack_checker_visitor visit, void *arg );
+
/*************************************************************
*************************************************************
** Prototyped only so the user extension can be installed **
@@ -110,11 +183,11 @@ void rtems_stack_checker_report_usage_with_plugin(
* will automatically intialize itself.
*/
bool rtems_stack_checker_create_extension(
- Thread_Control *running,
- Thread_Control *the_thread
+ rtems_tcb *running,
+ rtems_tcb *the_thread
);
-void rtems_stack_checker_begin_extension( Thread_Control *executing );
+void rtems_stack_checker_begin_extension( rtems_tcb *executing );
/**
* @brief Stack Checker Task Context Switch Extension
@@ -128,8 +201,8 @@ void rtems_stack_checker_begin_extension( Thread_Control *executing );
* @note This is called from the internal method _Thread_Dispatch.
*/
void rtems_stack_checker_switch_extension(
- Thread_Control *running,
- Thread_Control *heir
+ rtems_tcb *running,
+ rtems_tcb *heir
);
/**
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 ca96241e2e..3b839533c2 100644
--- a/cpukit/include/rtems/test-info.h
+++ b/cpukit/include/rtems/test-info.h
@@ -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);
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/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/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/libdebugger/rtems-debugger-arm.c b/cpukit/libdebugger/rtems-debugger-arm.c
index ba01a860c8..cdc615ce64 100644
--- a/cpukit/libdebugger/rtems-debugger-arm.c
+++ b/cpukit/libdebugger/rtems-debugger-arm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2019 Chris Johns <chrisj@rtems.org>.
+ * Copyright (c) 2016-2022 Chris Johns <chrisj@rtems.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -86,14 +86,26 @@
#define ARM_SWITCH_REG uint32_t arm_switch_reg
#define ARM_SWITCH_REG_ASM [arm_switch_reg] "=&r" (arm_switch_reg)
#define ARM_SWITCH_REG_ASM_L ARM_SWITCH_REG_ASM,
+ #define ASM_ARM_ASM ".align 2\n.arm\n"
#define ASM_ARM_MODE ".align 2\nbx pc\n.arm\n"
#define ASM_THUMB_MODE "add %[arm_switch_reg], pc, #1\nbx %[arm_switch_reg]\n.thumb\n"
+ #define ARM_THUMB_MODE() __asm__ volatile(ASM_THUMB_MODE : ARM_SWITCH_REG_ASM : :);
+ #define ARM_ARM_MODE() __asm__ volatile(ASM_ARM_MODE : : :);
#else
#define ARM_SWITCH_REG
#define ARM_SWITCH_REG_ASM
#define ARM_SWITCH_REG_ASM_L
+ #define ASM_ARM_ASM
#define ASM_ARM_MODE
#define ASM_THUMB_MODE
+ #define ARM_THUMB_MODE()
+ #define ARM_ARM_MODE()
+#endif
+
+#ifdef ARM_MULTILIB_HAS_BARRIER_INSTRUCTIONS
+#define ARM_SYNC_INST "isb\n"
+#else
+#define ARM_SYNC_INST
#endif
/*
@@ -287,29 +299,19 @@ static const size_t exc_offsets[2][5] =
static bool debug_session_active;
/*
- * ARM debug hardware.
+ * ARM debug hardware. These variables are directly access
+ * from assembler so do not change types.
*/
static int debug_version;
static void* debug_registers;
static int debug_revision;
-static bool debug_disable_ints;
+static int debug_disable_ints;
static int hw_breakpoints;
static int hw_watchpoints;
/**
* Hardware break and watch points.
*/
-typedef struct
-{
- bool enabled;
- bool loaded;
- void* address;
- size_t length;
- CPU_Exception_frame* frame;
- uint32_t control;
- uint32_t value;
-} arm_debug_hwbreak;
-
#define ARM_HW_BREAKPOINT_MAX (16)
#define ARM_HW_WATCHPOINT_MAX (16)
@@ -327,8 +329,23 @@ typedef struct
#define ARM_HW_BP_PRIV_PL0_ONLY (0x02)
#define ARM_HW_BP_PRIV_ALL_MODES (0x03)
-static arm_debug_hwbreak hw_breaks[ARM_HW_BREAKPOINT_MAX];
-//static arm_debug_hwbreak hw_watches[ARM_HW_WATCHPOINT_MAX];
+/*
+ * A hw breakpoint has DBGBCR and DBGBVR registers. Allocate memory
+ * for each.
+ *
+ * Maintian the values ready to load into the hardware. The loader is
+ * a load of the value and then control for enabled BPs.
+ */
+static uint32_t hw_breaks[ARM_HW_BREAKPOINT_MAX * 2];
+
+/*
+ * The order in the array is important
+ */
+#define ARM_HWB_BCR(_bp) (hw_breaks[((_bp) * 2) + 1])
+#define ARM_HWB_VCR(_bp) (hw_breaks[(_bp) * 2])
+#define ARM_HWB_ENALBED(_bp) ((ARM_HWB_BCR(_bp) & 1) != 0)
+#define ARM_HWB_CLEAR(_bp) ARM_HWB_BCR(_bp) = 0; ARM_HWB_VCR(_bp) = 0
+#define ARM_HWB_CLEAR_ALL() memset(&hw_breaks[0], 0, sizeof(hw_breaks))
/*
* Method of entry (MOE) to debug mode. Bits [5:2] of DBGDSCR.
@@ -439,6 +456,7 @@ arm_moe_label(uint32_t moe)
asm volatile( \
ASM_ARM_MODE \
ARM_CP_INSTR(mcr, _cp, _op1, val, _CRn, _CRm, _op2) \
+ ARM_SYNC_INST \
ASM_THUMB_MODE \
: ARM_SWITCH_REG_ASM \
: [val] "r" (_val)); \
@@ -449,6 +467,7 @@ arm_moe_label(uint32_t moe)
ARM_SWITCH_REG; \
asm volatile( \
ASM_ARM_MODE \
+ ARM_SYNC_INST \
ARM_CP_INSTR(mrc, _cp, _op1, val, _CRn, _CRm, _op2) \
ASM_THUMB_MODE \
: ARM_SWITCH_REG_ASM_L \
@@ -491,9 +510,21 @@ arm_moe_label(uint32_t moe)
* Read and write a memory mapped debug register. The register number is a word
* offset from the base address.
*/
-#define ARM_MMAP_ADDR(reg) (((volatile uint32_t*) debug_registers) + (reg))
-#define ARM_MMAP_WRITE(reg, val) *ARM_MMAP_ADDR(reg) = (val); _ARM_Data_synchronization_barrier()
-#define ARM_MMAP_READ(reg) *ARM_MMAP_ADDR(reg)
+#define ARM_MMAP_ADDR(reg) \
+ (((volatile uint32_t*) debug_registers) + (reg))
+#define ARM_MMAP_WRITE(reg, val) *ARM_MMAP_ADDR(reg) = (val)
+#define ARM_MMAP_READ(reg) *ARM_MMAP_ADDR(reg)
+#define ARM_MMAP_WRITE_SYNC(reg, val) \
+ ARM_MMAP_WRITE(reg, val); \
+ _ARM_Data_synchronization_barrier(); \
+ _ARM_Instruction_synchronization_barrier()
+
+/*
+ * Debug hardware breakpoint registers.
+ */
+#define ARM_MMAP_DBGDSCR 34
+#define ARM_MMAP_DBGBCR 80
+#define ARM_MMAP_DBGBVR 64
static bool
arm_debug_authentication(uint32_t dbgauthstatus)
@@ -902,16 +933,17 @@ arm_debug_mmap_enable(rtems_debugger_target* target, uint32_t dbgdidr)
* which seems to make the debug hardware work.
*/
if (ARM_MMAP_READ(1005) == 3) {
- ARM_MMAP_WRITE(1004, 0xC5ACCE55);
+ ARM_MMAP_WRITE_SYNC(1004, 0xC5ACCE55);
}
/*
* Are we already in debug mode?
*/
- val = ARM_MMAP_READ(34);
+ val = ARM_MMAP_READ(ARM_MMAP_DBGDSCR);
if ((val & (1 << 15)) == 0) {
rtems_debugger_printf("rtems-db: arm debug: enable debug mode\n");
- val = ARM_MMAP_READ(34);
- ARM_MMAP_WRITE(34, ARM_MMAP_READ(34) | (1 << 15));
+ val = ARM_MMAP_READ(ARM_MMAP_DBGDSCR);
+ ARM_MMAP_WRITE_SYNC(ARM_MMAP_DBGDSCR,
+ ARM_MMAP_READ(ARM_MMAP_DBGDSCR) | (1 << 15));
arm_debug_retries = 0;
}
}
@@ -1002,139 +1034,125 @@ arm_debug_probe(rtems_debugger_target* target)
}
static inline void
-arm_debug_break_setup(arm_debug_hwbreak* bp,
- uint32_t address,
- uint32_t type,
- uint32_t byte_address_select,
- uint32_t privilege)
+arm_debug_break_setup(int bp,
+ uint32_t address,
+ uint32_t type,
+ uint32_t byte_address_select,
+ uint32_t privilege)
{
- bp->control = (((type & 0xf) << 20) |
- ((byte_address_select & 0xf) << 5) |
- ((privilege & 0x3) << 1) | 1);
- bp->value = (intptr_t) address;
+ ARM_HWB_BCR(bp) = (((type & 0xf) << 20) |
+ ((byte_address_select & 0xf) << 5) |
+ ((privilege & 0x3) << 1) | 1);
+ ARM_HWB_VCR(bp) = (intptr_t) (address & (~3));
}
static void
-arm_debug_break_write_control(int bp, uint32_t control)
+arm_debug_break_c14_write_control(int bp, uint32_t control)
{
- if (bp < 15) {
- if (debug_registers != NULL) {
- ARM_MMAP_WRITE(80 + bp, control);
- }
- else {
- switch (bp) {
- case 0:
- ARM_CP14_WRITE(control, 0, 0, 5);
- break;
- case 1:
- ARM_CP14_WRITE(control, 0, 1, 5);
- break;
- case 2:
- ARM_CP14_WRITE(control, 0, 2, 5);
- break;
- case 3:
- ARM_CP14_WRITE(control, 0, 3, 5);
- break;
- case 4:
- ARM_CP14_WRITE(control, 0, 4, 5);
- break;
- case 5:
- ARM_CP14_WRITE(control, 0, 5, 5);
- break;
- case 6:
- ARM_CP14_WRITE(control, 0, 6, 5);
- break;
- case 7:
- ARM_CP14_WRITE(control, 0, 7, 5);
- break;
- case 8:
- ARM_CP14_WRITE(control, 0, 8, 5);
- break;
- case 9:
- ARM_CP14_WRITE(control, 0, 9, 5);
- break;
- case 10:
- ARM_CP14_WRITE(control, 0, 10, 5);
- break;
- case 11:
- ARM_CP14_WRITE(control, 0, 11, 5);
- break;
- case 12:
- ARM_CP14_WRITE(control, 0, 12, 5);
- break;
- case 13:
- ARM_CP14_WRITE(control, 0, 13, 5);
- break;
- case 14:
- ARM_CP14_WRITE(control, 0, 14, 5);
- break;
- case 15:
- ARM_CP14_WRITE(control, 0, 15, 5);
- break;
- }
- }
+ switch (bp) {
+ case 0:
+ ARM_CP14_WRITE(control, 0, 0, 5);
+ break;
+ case 1:
+ ARM_CP14_WRITE(control, 0, 1, 5);
+ break;
+ case 2:
+ ARM_CP14_WRITE(control, 0, 2, 5);
+ break;
+ case 3:
+ ARM_CP14_WRITE(control, 0, 3, 5);
+ break;
+ case 4:
+ ARM_CP14_WRITE(control, 0, 4, 5);
+ break;
+ case 5:
+ ARM_CP14_WRITE(control, 0, 5, 5);
+ break;
+ case 6:
+ ARM_CP14_WRITE(control, 0, 6, 5);
+ break;
+ case 7:
+ ARM_CP14_WRITE(control, 0, 7, 5);
+ break;
+ case 8:
+ ARM_CP14_WRITE(control, 0, 8, 5);
+ break;
+ case 9:
+ ARM_CP14_WRITE(control, 0, 9, 5);
+ break;
+ case 10:
+ ARM_CP14_WRITE(control, 0, 10, 5);
+ break;
+ case 11:
+ ARM_CP14_WRITE(control, 0, 11, 5);
+ break;
+ case 12:
+ ARM_CP14_WRITE(control, 0, 12, 5);
+ break;
+ case 13:
+ ARM_CP14_WRITE(control, 0, 13, 5);
+ break;
+ case 14:
+ ARM_CP14_WRITE(control, 0, 14, 5);
+ break;
+ case 15:
+ ARM_CP14_WRITE(control, 0, 15, 5);
+ break;
}
}
static void
-arm_debug_break_write_value(int bp, uint32_t value)
+arm_debug_break_c14_write_value(int bp, uint32_t value)
{
- if (bp < 15) {
- if (debug_registers != NULL) {
- ARM_MMAP_WRITE(64 + bp, value);
- }
- else {
- switch (bp) {
- case 0:
- ARM_CP14_WRITE(value, 0, 0, 4);
- break;
- case 1:
- ARM_CP14_WRITE(value, 0, 1, 4);
- break;
- case 2:
- ARM_CP14_WRITE(value, 0, 2, 4);
- break;
- case 3:
- ARM_CP14_WRITE(value, 0, 3, 4);
- break;
- case 4:
- ARM_CP14_WRITE(value, 0, 4, 4);
- break;
- case 5:
- ARM_CP14_WRITE(value, 0, 5, 4);
- break;
- case 6:
- ARM_CP14_WRITE(value, 0, 6, 4);
- break;
- case 7:
- ARM_CP14_WRITE(value, 0, 7, 4);
- break;
- case 8:
- ARM_CP14_WRITE(value, 0, 8, 4);
- break;
- case 9:
- ARM_CP14_WRITE(value, 0, 9, 4);
- break;
- case 10:
- ARM_CP14_WRITE(value, 0, 10, 4);
- break;
- case 11:
- ARM_CP14_WRITE(value, 0, 11, 4);
- break;
- case 12:
- ARM_CP14_WRITE(value, 0, 12, 4);
- break;
- case 13:
- ARM_CP14_WRITE(value, 0, 13, 4);
- break;
- case 14:
- ARM_CP14_WRITE(value, 0, 14, 4);
- break;
- case 15:
- ARM_CP14_WRITE(value, 0, 15, 4);
- break;
- }
- }
+ switch (bp) {
+ case 0:
+ ARM_CP14_WRITE(value, 0, 0, 4);
+ break;
+ case 1:
+ ARM_CP14_WRITE(value, 0, 1, 4);
+ break;
+ case 2:
+ ARM_CP14_WRITE(value, 0, 2, 4);
+ break;
+ case 3:
+ ARM_CP14_WRITE(value, 0, 3, 4);
+ break;
+ case 4:
+ ARM_CP14_WRITE(value, 0, 4, 4);
+ break;
+ case 5:
+ ARM_CP14_WRITE(value, 0, 5, 4);
+ break;
+ case 6:
+ ARM_CP14_WRITE(value, 0, 6, 4);
+ break;
+ case 7:
+ ARM_CP14_WRITE(value, 0, 7, 4);
+ break;
+ case 8:
+ ARM_CP14_WRITE(value, 0, 8, 4);
+ break;
+ case 9:
+ ARM_CP14_WRITE(value, 0, 9, 4);
+ break;
+ case 10:
+ ARM_CP14_WRITE(value, 0, 10, 4);
+ break;
+ case 11:
+ ARM_CP14_WRITE(value, 0, 11, 4);
+ break;
+ case 12:
+ ARM_CP14_WRITE(value, 0, 12, 4);
+ break;
+ case 13:
+ ARM_CP14_WRITE(value, 0, 13, 4);
+ break;
+ case 14:
+ ARM_CP14_WRITE(value, 0, 14, 4);
+ break;
+ case 15:
+ ARM_CP14_WRITE(value, 0, 15, 4);
+ break;
}
}
@@ -1143,7 +1161,7 @@ arm_debug_dbgdscr_read(void)
{
uint32_t val;
if (debug_registers != NULL) {
- val = ARM_MMAP_READ(34);
+ val = ARM_MMAP_READ(ARM_MMAP_DBGDSCR);
}
else {
ARM_CP14_READ(val, 0, 1, 0);
@@ -1155,7 +1173,7 @@ static void
arm_debug_dbgdscr_write(uint32_t val)
{
if (debug_registers != NULL) {
- ARM_MMAP_WRITE(34, val);
+ ARM_MMAP_WRITE_SYNC(ARM_MMAP_DBGDSCR, val);
}
else {
ARM_CP14_WRITE(val, 0, 1, 0);
@@ -1171,35 +1189,30 @@ arm_debug_method_of_entry(void)
static void
arm_debug_disable_interrupts(void)
{
- debug_disable_ints = true;
+ debug_disable_ints = 1;
}
static void
-arm_debug_commit_interrupt_disable(void)
+arm_debug_enable_interrupts(void)
{
- if (debug_disable_ints) {
- arm_debug_dbgdscr_write(arm_debug_dbgdscr_read() | (1 << 11));
- debug_disable_ints = false;
- }
+ arm_debug_dbgdscr_write(arm_debug_dbgdscr_read() & ~(1 << 11));
}
static void
-arm_debug_enable_interrupts(void)
+arm_debug_break_clear(int bp)
{
- arm_debug_dbgdscr_write(arm_debug_dbgdscr_read() & ~(1 << 11));
+ rtems_interrupt_lock_context lock_context;
+ rtems_interrupt_lock_acquire(&target_lock, &lock_context);
+ ARM_HWB_CLEAR(bp);
+ rtems_interrupt_lock_release(&target_lock, &lock_context);
}
static void
-arm_debug_break_clear(void)
+arm_debug_break_clear_all(void)
{
rtems_interrupt_lock_context lock_context;
- arm_debug_hwbreak* bp = &hw_breaks[0];
- int i;
rtems_interrupt_lock_acquire(&target_lock, &lock_context);
- for (i = 0; i < hw_breakpoints; ++i, ++bp) {
- bp->enabled = false;
- bp->loaded = false;
- }
+ ARM_HWB_CLEAR_ALL();
rtems_interrupt_lock_release(&target_lock, &lock_context);
}
@@ -1211,58 +1224,81 @@ arm_debug_set_context_id(const uint32_t id)
#endif
}
-/*
- * You can only load the hardware breaks points when in the SVC mode or the
- * single step inverted break point will trigger.
- */
static void
-arm_debug_break_load(void)
+arm_debug_break_unload(void)
{
rtems_interrupt_lock_context lock_context;
- arm_debug_hwbreak* bp = &hw_breaks[0];
- int i;
+ int i;
rtems_interrupt_lock_acquire(&target_lock, &lock_context);
- if (bp->enabled && !bp->loaded) {
- arm_debug_set_context_id(0xdead1111);
- arm_debug_break_write_value(0, bp->value);
- arm_debug_break_write_control(0, bp->control);
- }
- ++bp;
- for (i = 1; i < hw_breakpoints; ++i, ++bp) {
- if (bp->enabled && !bp->loaded) {
- bp->loaded = true;
- arm_debug_break_write_value(i, bp->value);
- arm_debug_break_write_control(i, bp->control);
+ if (debug_registers != NULL) {
+ for (i = 0; i < hw_breakpoints; ++i) {
+ ARM_MMAP_WRITE(ARM_MMAP_DBGBCR + i, 0);
+ ARM_MMAP_WRITE(ARM_MMAP_DBGBVR + i, 0);
+ }
+ } else {
+ for (i = 0; i < hw_breakpoints; ++i) {
+ arm_debug_break_c14_write_control(i, 0);
+ arm_debug_break_c14_write_value(i, 0);
}
}
rtems_interrupt_lock_release(&target_lock, &lock_context);
}
static void
-arm_debug_break_unload(void)
-{
- rtems_interrupt_lock_context lock_context;
- arm_debug_hwbreak* bp = &hw_breaks[0];
- int i;
- rtems_interrupt_lock_acquire(&target_lock, &lock_context);
- arm_debug_set_context_id(0);
- for (i = 0; i < hw_breakpoints; ++i, ++bp) {
- bp->loaded = false;
- arm_debug_break_write_control(i, 0);
+arm_debug_break_exec_enable(int bp, uintptr_t addr, bool thumb, bool step) {
+ uint32_t bas;
+
+ /*
+ * See table C3-2 Effect of byte address selection on Breakpoint
+ * generation and "Instruction address comparision programming
+ * examples.
+ */
+ if (thumb) {
+ /*
+ * Thumb
+ */
+ if ((addr & (1 << 1)) == 0) {
+ /*
+ * Instruction address: DBGBVR[31:2]:00 BAS: 0bxx11 Mismatch: Miss
+ */
+ bas = 0x3; /* bxx11 */
+ }
+ else {
+ /*
+ * Instruction address: DBGBVR[31:2]:10 BAS: 0b11xx Mismatch: Miss
+ */
+ bas = 0xc; /* b11xx */
+ }
}
- rtems_interrupt_lock_release(&target_lock, &lock_context);
+ else {
+ /*
+ * ARM
+ *
+ * Instruction address: DBGBVR[31:2]:00 BAS: 0b1111 Mismatch: Miss
+ */
+ bas = 0xf; /* b1111 */
+ }
+
+ target_printk("[} break: addr:%08x bas:%x thumb:%s\n",
+ addr, bas, thumb ? "yes" : "no");
+
+ arm_debug_break_setup(
+ bp,
+ addr,
+ step ? ARM_HW_BP_UNLINKED_INSTR_MISMATCH : ARM_HW_BP_UNLINKED_INSTR_MATCH,
+ bas,
+ ARM_HW_BP_PRIV_PL0_SUP_SYS);
}
static void
arm_debug_break_dump(void)
{
#if TARGET_DEBUG
- arm_debug_hwbreak* bp = &hw_breaks[0];
int i;
- for (i = 0; i < hw_breakpoints; ++i, ++bp) {
- if (bp->enabled) {
+ for (i = 0; i < hw_breakpoints; ++i) {
+ if (ARM_HWB_ENALBED(i)) {
target_printk("[} bp: %d: control: %08x addr: %08x\n",
- i, bp->control, bp->value);
+ i, ARM_HWB_BCR(i), ARM_HWB_VCR(i));
}
}
#endif
@@ -1314,6 +1350,8 @@ target_exception(CPU_Exception_frame* frame)
#if TARGET_DEBUG
#if ARM_CP15
const uint32_t ifsr = arm_cp15_get_instruction_fault_status();
+ const uint32_t dfsr = arm_cp15_get_data_fault_status();
+ const void* far = arm_cp15_get_fault_address();
#else
const uint32_t ifsr = 0;
#endif
@@ -1341,18 +1379,20 @@ target_exception(CPU_Exception_frame* frame)
target_printk("[} > frame = %08" PRIx32 \
" sig=%d vector=%u (%u) dbgdscr=%08" PRIx32 " moe=%s" \
- " ifsr=%08" PRIx32 " pra=%08x\n",
- (uint32_t) frame,
+ " far=%p ifsr=%08" PRIx32 " dfsr=%08" PRIx32
+ " exc-ret-pc=%08x\n", (uint32_t) frame,
rtems_debugger_target_exception_to_signal(frame),
frame->vector, mvector, dbgdscr, arm_moe_label(moe),
- ifsr, (intptr_t) frame->register_pc);
+ far, ifsr, dfsr, (intptr_t) frame->register_pc);
+
+ arm_debug_break_dump();
frame->register_pc = (void*) ((intptr_t) frame->register_pc - exc_offset);
target_print_frame(frame);
+ arm_debug_break_clear(0);
arm_debug_enable_interrupts();
- arm_debug_break_clear();
if (!debug_session_active)
_ARM_Exception_default(frame);
@@ -1373,10 +1413,16 @@ target_exception(CPU_Exception_frame* frame)
" PC = %08" PRIxPTR " CPSR = %08" PRIx32 "\n",
(uint32_t) frame, (intptr_t) frame->register_pc, FRAME_SR(frame));
target_print_frame(frame);
- arm_debug_break_dump();
}
/**
+ * Exception Handlers
+ *
+ * The entry and exit is all assembler and ARM code. This avoids any
+ * compiler related optimisations effecting the various pieces.
+ */
+
+/**
* Exception stack frame size.
*
* The size is the exception stack frame plus the CPSR from the exception. We
@@ -1408,15 +1454,89 @@ target_exception(CPU_Exception_frame* frame)
*/
#define EXCEPTION_ENTRY_EXC() \
__asm__ volatile( \
- ASM_ARM_MODE \
+ ASM_ARM_MODE /* force ARM mode for thumb systems */ \
"sub sp, %[frame_size]\n" /* alloc the frame and CPSR */ \
"stm sp, {r0-r12}\n" /* store r0-r12 */ \
- "sub sp, #4\n" \
- "str lr, [sp]\n" /* save the link reg */ \
- ASM_THUMB_MODE \
- : ARM_SWITCH_REG_ASM \
+ : \
: [frame_size] "i" (EXCEPTION_FRAME_SIZE) \
- : "memory")
+ : "cc", "memory")
+
+/**
+ * Debugger entry
+ *
+ * Check if using debug registers else use CP14.
+ *
+ * Set all the break point registers to 0. Enable interrupts.
+ */
+#if ARM_CP15
+#define ARM_HW_BP_UNLOAD(_bp) \
+ "cmp r0, #" #_bp "\n" \
+ "ble 3f\n" \
+ "mcr p14, 0, r1, c0, c" #_bp ", 5\n" \
+ "mcr p14, 0, r1, c0, c" #_bp ", 4\n"
+#define ARM_DGB_ENABLE_INTS \
+ "mrc p14, 0, r1, c0, c1, 0\n" /* Get the DBGDSCR */ \
+ "bic r1, r1, #(1 << 11)\n" /* enable interrupts */ \
+ "mcr p14, 0, r1, c0, c1, 0\n" /* Set the DBGDSCR */
+#else
+#define ARM_HW_BP_UNLOAD(_bp)
+#define ARM_DGB_ENABLE_INTS
+#endif
+
+#define EXCEPTION_ENTRY_DEBUGGER() \
+ __asm__ volatile( \
+ /* Set up r0 and r1 */ \
+ "movw r0, #:lower16:hw_breakpoints\n" /* get the num hw breaks */ \
+ "movt r0, #:upper16:hw_breakpoints\n" \
+ "ldr r0, [r0]\n" /* r0 = hw_breakpoints */ \
+ "mov r1, #0\n" /* write zero */ \
+ /* Check if debug registers are being used */ \
+ "movw r2, #:lower16:debug_registers\n" /* get the debug regs */ \
+ "movt r2, #:upper16:debug_registers\n" \
+ "ldr r2, [r2]\n" /* r2 = debug_registers */ \
+ "cmp r2, #0\n" /* NULL? */ \
+ "beq 2f\n" /* if NULL use cp14 */ \
+ /* Debug registers */ \
+ "add r3, r2, %[dbgbvr] - 4\n" /* a3 = DBGBCR0, adjusted */ \
+ "add r2, r2, %[dbgbcr] - 4\n" /* a2 = DBGBVR0, adjusted */ \
+ "1:\n" \
+ "str r1, [r3, #4]!\n" /* Store DBGBVR, pre-indexed, modified */ \
+ "str r1, [r2, #4]!\n" /* Store DBGBCR, pre-indexed, modified */ \
+ "sub r0, r0, #1\n" /* one less */ \
+ "cmp r0, #0\n" /* all done? */ \
+ "bne 1b\n" \
+ "ldr r1, [r2, %[dbgdscr]]\n" /* Get the DBGDSCR */ \
+ "bic r1, r1, #(1 << 11)\n" /* enable interrupts */ \
+ "str r1, [r2, %[dbgdscr]]\n" /* Set the DBGDSCR */ \
+ "b 4f\n" \
+ /* CP14 */ \
+ "2:\n" \
+ ARM_HW_BP_UNLOAD(0) \
+ ARM_HW_BP_UNLOAD(1) \
+ ARM_HW_BP_UNLOAD(2) \
+ ARM_HW_BP_UNLOAD(3) \
+ ARM_HW_BP_UNLOAD(4) \
+ ARM_HW_BP_UNLOAD(5) \
+ ARM_HW_BP_UNLOAD(6) \
+ ARM_HW_BP_UNLOAD(7) \
+ ARM_HW_BP_UNLOAD(8) \
+ ARM_HW_BP_UNLOAD(9) \
+ ARM_HW_BP_UNLOAD(10) \
+ ARM_HW_BP_UNLOAD(11) \
+ ARM_HW_BP_UNLOAD(12) \
+ ARM_HW_BP_UNLOAD(12) \
+ ARM_HW_BP_UNLOAD(13) \
+ ARM_HW_BP_UNLOAD(14) \
+ ARM_HW_BP_UNLOAD(15) \
+ "3:\n" \
+ ARM_DGB_ENABLE_INTS \
+ "4:\n" \
+ ARM_SYNC_INST \
+ : \
+ : [dbgdscr] "i" (ARM_MMAP_DBGDSCR * sizeof(uint32_t)), \
+ [dbgbcr] "i" (ARM_MMAP_DBGBCR * sizeof(uint32_t)), \
+ [dbgbvr] "i" (ARM_MMAP_DBGBVR * sizeof(uint32_t)) \
+ : "cc", "r0", "r1", "r2", "r3", "memory")
/*
* FPU entry. Conditionally D16 or D32 support.
@@ -1430,10 +1550,10 @@ target_exception(CPU_Exception_frame* frame)
"mov r3, #0\n" \
"mov r4, #0\n" \
"adds r6, r5, #128\n" \
- "3:\n" \
+ "1:\n" \
"stmia r5!, {r3-r4}\n" \
"cmp r5, r6\n" \
- "bne 3b\n"
+ "bne 1b\n"
#endif /* ARM_MULTILIB_VFP_D32 */
#define EXCEPTION_ENTRY_FPU(frame_fpu_size) \
"sub sp, %[frame_fpu_size]\n" /* size includes alignment size */ \
@@ -1453,9 +1573,6 @@ target_exception(CPU_Exception_frame* frame)
#define EXCEPTION_ENTRY_THREAD(_frame) \
__asm__ volatile( \
- ASM_ARM_MODE \
- "ldr lr, [sp]\n" /* recover the link reg */ \
- "add sp, #4\n" \
"add r0, sp, %[r0_r12_size]\n" /* get the sp in the frame */ \
"mrs r1, spsr\n" /* get the saved sr */ \
"mov r6, r1\n" /* stash it for later */ \
@@ -1468,7 +1585,7 @@ target_exception(CPU_Exception_frame* frame)
"mov r4, lr\n" /* get the link reg */ \
"msr cpsr, r2\n" /* back to exc mode */ \
"mov r5, lr\n" /* get the PRA */ \
- "stm r0, {r3-r6}\n" /* save into the frame */ \
+ "stm r0, {r3-r6}\n" /* save into the frame: sp,lr,pc,cpsr */ \
"sub r4, r3, %[frame_size]\n" /* destination address */ \
"mov r6, r4\n" /* save the frame */ \
"sub r4, #1\n" /* one before the start */ \
@@ -1491,8 +1608,7 @@ target_exception(CPU_Exception_frame* frame)
EXCEPTION_ENTRY_FPU(frame_fpu_size) \
"bic r1, r1, %[psr_i]\n" /* clear irq mask, debug checks */ \
"msr cpsr, r1\n" /* restore the state with irq mask clear */ \
- ASM_THUMB_MODE \
- : ARM_SWITCH_REG_ASM_L \
+ : \
[o_frame] "=r" (_frame) \
: [psr_t] "i" (ARM_PSR_T), \
[psr_i] "i" (ARM_PSR_I), \
@@ -1501,7 +1617,7 @@ target_exception(CPU_Exception_frame* frame)
[frame_size] "i" (EXCEPTION_FRAME_SIZE), \
[o_frame_fpu] "i" (EXCEPTION_FRAME_FPU_OFFSET), \
[frame_fpu_size] "i" (EXCEPTION_FRAME_FPU_SIZE + 4) \
- : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "memory")
+ : "cc", "r0", "r1", "r2", "r3", "r4", "r5", "r6", "memory")
/*
* FPU exit. Conditionally D16 or D32 support.
@@ -1537,9 +1653,8 @@ target_exception(CPU_Exception_frame* frame)
*/
#define EXCEPTION_EXIT_THREAD(_frame) \
__asm__ volatile( \
- ASM_ARM_MODE \
"mov r0, %[i_frame]\n" /* get the frame */ \
- "ldr r0, [r0, %[frame_fpu]]\n" /* recover FPU frame pointer */ \
+ "ldr r0, [r0, %[frame_fpu]]\n" /* recover aligned FPU frame ptr */ \
EXCEPTION_EXIT_FPU(frame_fpu_size) \
"ldr r2, [sp, %[frame_cpsr]]\n" /* recover exc CPSR from thread */ \
"mov r0, sp\n" /* get the thread frame pointer */ \
@@ -1562,11 +1677,8 @@ target_exception(CPU_Exception_frame* frame)
"mov lr, r4\n" /* set the link reg */ \
"msr cpsr, r2\n" /* switch back to the exc's context */ \
"msr spsr, r6\n" /* set the thread's CPSR */ \
- "sub sp, #4\n" \
"mov lr, r5\n" /* get the PC */ \
- "str lr, [sp]\n" /* save the link reg */ \
- ASM_THUMB_MODE \
- : ARM_SWITCH_REG_ASM \
+ : \
: [psr_i] "i" (ARM_PSR_I), \
[r0_r12_size] "i" (13 * sizeof(uint32_t)), \
[frame_cpsr] "i" (EXCEPTION_FRAME_SIZE - sizeof(uint32_t)), \
@@ -1574,19 +1686,135 @@ target_exception(CPU_Exception_frame* frame)
[frame_fpu] "i" (EXCEPTION_FRAME_FPU_OFFSET), \
[frame_fpu_size] "i" (EXCEPTION_FRAME_FPU_SIZE + 4), \
[i_frame] "r" (_frame) \
- : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "memory")
+ : "cc", "r0", "r1", "r2", "r3", "r4", "r5", "r6", "memory")
+
+/*
+ * Debugger exit
+ *
+ * Check if using debug registers else use CP14.
+ *
+ * Set all the break point registers to settgins. Disable interrupts
+ * if debug_disable_ints is true. Clear debug_disable_ints.
+ */
+#if ARM_CP15
+#define ARM_HW_BP_LOAD(_bp) \
+ "cmp r0, #" #_bp "\n" \
+ "ble 5f\n" \
+ "ldm r1!, {r2-r3}\n" \
+ "mcr p14, 0, r2, c0, c" #_bp ", 4\n" /* value */ \
+ "mcr p14, 0, r3, c0, c" #_bp ", 5\n" /* control */
+#define ARM_DGB_DISABLE_INTS \
+ "mrc p14, 0, r4, c0, c1, 0\n" /* Get the DBGDSCR */ \
+ "orr r4, r4, #(1 << 11)\n" /* disable interrupts */ \
+ "mcr p14, 0, r4, c0, c1, 0\n" /* Set the DBGDSCR */
+#else
+#define ARM_HW_BP_LOAD(_bp)
+#define ARM_DGB_DISABLE_INTS
+#endif
+
+#define EXCEPTION_EXIT_DEBUGGER() \
+ __asm__ volatile( \
+ /* Set up r0, r1, r4 and r5 */ \
+ "movw r0, #:lower16:hw_breakpoints\n" /* get the num hw breaks */ \
+ "movt r0, #:upper16:hw_breakpoints\n" \
+ "ldr r0, [r0]\n" /* r0 = hw_breakpoints */ \
+ "movw r1, #:lower16:hw_breaks\n" /* get the hw_breaks pointer */ \
+ "movt r1, #:upper16:hw_breaks\n" \
+ "movw r4, #:lower16:debug_disable_ints\n" /* get disable ints */ \
+ "movt r4, #:upper16:debug_disable_ints\n" \
+ "ldr r5, [r4]\n" \
+ "mov r3, #0\n" /* clear debug ints */ \
+ "str r3, [r4]\n" \
+ /* Check if debug registers are being used */ \
+ "movw r2, #:lower16:debug_registers\n" /* get the debug regs */ \
+ "movt r2, #:upper16:debug_registers\n" \
+ "ldr r2, [r2]\n" /* r2 = debug_registers */ \
+ "cmp r2, #0\n" /* NULL? */ \
+ "beq 3f\n" /* if NULL use cp14 */ \
+ /* Debug registers */ \
+ "cmp r5, #0\n" /* false? */ \
+ "beq 1f\n" /* if false do not set ints disable */ \
+ "ldr r4, [r2, %[dbgdscr]]\n" /* Get the DBGDSCR */ \
+ "orr r4, r4, #(1 << 11)\n" /* disable interrupts */ \
+ "str r4, [r2, %[dbgdscr]]\n" /* Set the DBGDSCR */ \
+ "1:\n" \
+ "add r3, r2, %[dbgbvr] - 4\n" /* a3 = DBGBCR0, adjusted */ \
+ "add r2, r2, %[dbgbcr] - 4\n" /* a2 = DBGBVR0, adjusted */ \
+ "2:\n" \
+ "ldm r1!, {r4-r5}\n" /* load vr and cr */ \
+ "str r4, [r3, #4]!\n" /* Store DBGBVR, pre-indexed, modified */ \
+ "str r5, [r2, #4]!\n" /* Store DBGBCR, pre-indexed, modified */ \
+ "sub r0, r0, #1\n" /* one less? */ \
+ "cmp r0, #1\n" /* all done? */ \
+ "bne 2b\n" \
+ "b 5f\n" \
+ /* CP14 */ \
+ "3:\n" \
+ "cmp r5, #0\n" /* false? */ \
+ "beq 4f\n" /* if false do not set ints disable */ \
+ ARM_DGB_DISABLE_INTS \
+ "4:\n" \
+ ARM_HW_BP_LOAD(0) \
+ ARM_HW_BP_LOAD(1) \
+ ARM_HW_BP_LOAD(2) \
+ ARM_HW_BP_LOAD(3) \
+ ARM_HW_BP_LOAD(4) \
+ ARM_HW_BP_LOAD(5) \
+ ARM_HW_BP_LOAD(6) \
+ ARM_HW_BP_LOAD(7) \
+ ARM_HW_BP_LOAD(8) \
+ ARM_HW_BP_LOAD(9) \
+ ARM_HW_BP_LOAD(10) \
+ ARM_HW_BP_LOAD(11) \
+ ARM_HW_BP_LOAD(12) \
+ ARM_HW_BP_LOAD(13) \
+ ARM_HW_BP_LOAD(14) \
+ ARM_HW_BP_LOAD(15) \
+ "5:\n" \
+ ARM_SYNC_INST \
+ : \
+ : [disints] "X" (debug_disable_ints), /* make the sym available */ \
+ [dbgdscr] "i" (ARM_MMAP_DBGDSCR * sizeof(uint32_t)), \
+ [dbgbcr] "i" (ARM_MMAP_DBGBCR * sizeof(uint32_t)), \
+ [dbgbvr] "i" (ARM_MMAP_DBGBVR * sizeof(uint32_t)) \
+ : "cc", "r0", "r1", "r2", "r3", "r4", "r5", "memory")
#define EXCEPTION_EXIT_EXC() \
__asm__ volatile( \
- ASM_ARM_MODE \
- "ldr lr, [sp]\n" /* recover the link reg */ \
- "add sp, #4\n" \
"ldm sp, {r0-r12}\n" /* restore the thread's context */ \
"add sp, %[frame_size]\n" /* free the frame */ \
"subs pc, lr, #0\n" /* return from the exc */ \
+ ARM_SYNC_INST \
: \
: [frame_size] "i" (EXCEPTION_FRAME_SIZE) \
- : "memory")
+ : "cc", "memory")
+
+#define ARM_PUSH_LR() \
+ __asm__ volatile( \
+ "push {lr}\n" \
+ : : : )
+
+#define ARM_POP_LR() \
+ __asm__ volatile( \
+ "pop {lr}\n" \
+ : : : )
+
+/*
+ * Entry and exit stacks
+ */
+#define EXCEPTION_ENTRY(_frame) \
+ EXCEPTION_ENTRY_EXC(); \
+ EXCEPTION_ENTRY_DEBUGGER(); \
+ EXCEPTION_ENTRY_THREAD(_frame); \
+ ARM_THUMB_MODE() \
+ ARM_PUSH_LR()
+
+#define EXCEPTION_EXIT(_frame) \
+ ARM_POP_LR(); \
+ ARM_ARM_MODE(); \
+ EXCEPTION_EXIT_THREAD(_frame); \
+ EXCEPTION_EXIT_DEBUGGER(); \
+ EXCEPTION_EXIT_EXC()
/*
* This is used to catch faulting accesses.
@@ -1596,9 +1824,10 @@ static void __attribute__((naked))
arm_debug_unlock_abort(void)
{
CPU_Exception_frame* frame;
- ARM_SWITCH_REG;
+ ARM_SWITCH_REGISTERS;
EXCEPTION_ENTRY_EXC();
EXCEPTION_ENTRY_THREAD(frame);
+ ARM_SWITCH_BACK;
longjmp(unlock_abort_jmpbuf, -1);
}
#endif
@@ -1608,16 +1837,10 @@ target_exception_undefined_instruction(void)
{
CPU_Exception_frame* frame;
ARM_SWITCH_REG;
- EXCEPTION_ENTRY_EXC();
- arm_debug_break_unload();
- arm_debug_enable_interrupts();
- EXCEPTION_ENTRY_THREAD(frame);
+ EXCEPTION_ENTRY(frame);
frame->vector = 1;
target_exception(frame);
- EXCEPTION_EXIT_THREAD(frame);
- arm_debug_commit_interrupt_disable();
- arm_debug_break_load();
- EXCEPTION_EXIT_EXC();
+ EXCEPTION_EXIT(frame);
}
static void __attribute__((naked))
@@ -1631,16 +1854,10 @@ target_exception_supervisor_call(void)
* this exception is used by the BKPT instruction in the prefetch abort
* handler to signal a TRAP.
*/
- EXCEPTION_ENTRY_EXC();
- arm_debug_break_unload();
- arm_debug_enable_interrupts();
- EXCEPTION_ENTRY_THREAD(frame);
+ EXCEPTION_ENTRY(frame);
frame->vector = 2;
target_exception(frame);
- EXCEPTION_EXIT_THREAD(frame);
- arm_debug_commit_interrupt_disable();
- arm_debug_break_load();
- EXCEPTION_EXIT_EXC();
+ EXCEPTION_EXIT(frame);
}
static void __attribute__((naked))
@@ -1648,16 +1865,10 @@ target_exception_prefetch_abort(void)
{
CPU_Exception_frame* frame;
ARM_SWITCH_REG;
- EXCEPTION_ENTRY_EXC();
- arm_debug_break_unload();
- arm_debug_enable_interrupts();
- EXCEPTION_ENTRY_THREAD(frame);
+ EXCEPTION_ENTRY(frame);
frame->vector = 3;
target_exception(frame);
- EXCEPTION_EXIT_THREAD(frame);
- arm_debug_commit_interrupt_disable();
- arm_debug_break_load();
- EXCEPTION_EXIT_EXC();
+ EXCEPTION_EXIT(frame);
}
static void __attribute__((naked))
@@ -1665,16 +1876,10 @@ target_exception_data_abort(void)
{
CPU_Exception_frame* frame;
ARM_SWITCH_REG;
- EXCEPTION_ENTRY_EXC();
- arm_debug_break_unload();
- arm_debug_enable_interrupts();
- EXCEPTION_ENTRY_THREAD(frame);
+ EXCEPTION_ENTRY(frame);
frame->vector = 4;
target_exception(frame);
- EXCEPTION_EXIT_THREAD(frame);
- arm_debug_commit_interrupt_disable();
- arm_debug_break_load();
- EXCEPTION_EXIT_EXC();
+ EXCEPTION_EXIT(frame);
}
#if ARM_CP15
@@ -1776,13 +1981,13 @@ int
rtems_debugger_target_enable(void)
{
rtems_interrupt_lock_context lock_context;
- debug_session_active = true;
arm_debug_break_unload();
- arm_debug_break_clear();
+ arm_debug_break_clear_all();
rtems_interrupt_lock_acquire(&target_lock, &lock_context);
rtems_debugger_target_set_mmu();
rtems_debugger_target_set_vectors();
rtems_interrupt_lock_release(&target_lock, &lock_context);
+ debug_session_active = true;
return 0;
}
@@ -1795,8 +2000,9 @@ rtems_debugger_target_disable(void)
void* text_end;
#endif
arm_debug_break_unload();
- arm_debug_break_clear();
+ arm_debug_break_clear_all();
rtems_interrupt_lock_acquire(&target_lock, &lock_context);
+ debug_disable_ints = 0;
debug_session_active = false;
#if DOES_NOT_WORK
text_begin = &bsp_section_text_begin[0];
@@ -1979,57 +2185,13 @@ rtems_debugger_target_thread_stepping(rtems_debugger_thread* thread)
* 0. This is reserved for single stepping.
*/
CPU_Exception_frame* frame = thread->frame;
- arm_debug_hwbreak* bp = &hw_breaks[0];
- target_printk("[} stepping: %s\n", bp->enabled ? "yes" : "no");
+ target_printk("[} stepping: hbp[0] enabled: %s\n", ARM_HWB_ENALBED(0) ? "yes" : "no");
- if (!bp->enabled) {
+ if (!ARM_HWB_ENALBED(0)) {
const uint32_t addr = (intptr_t) frame->register_pc;
const bool thumb = (FRAME_SR(frame) & (1 << 5)) != 0 ? true : false;
- uint32_t bas;
-
- bp->enabled = true;
- bp->loaded = false;
- bp->address = frame->register_pc;
- bp->frame = frame;
- bp->length = sizeof(uint32_t);
-
- if (thumb) {
- uint16_t instr = *((uint16_t*) frame->register_pc);
- switch (instr & 0xf800) {
- case 0xe800:
- case 0xf000:
- case 0xf800:
- break;
- default:
- bp->length = sizeof(uint16_t);
- break;
- }
- }
-
- /*
- * See table C3-2 Effect of byte address selection on Breakpoint
- * generation and "Instruction address comparision programming
- * examples.
- */
- if (thumb) {
- if ((addr & (1 << 1)) == 0) {
- bas = 0x3; /* b0011 */
- }
- else {
- bas = 0xc; /* b1100 */
- }
- }
- else {
- bas = 0xf; /* b1111 */
- }
-
- arm_debug_break_setup(bp,
- addr & ~0x3,
- ARM_HW_BP_UNLINKED_INSTR_MISMATCH,
- bas,
- ARM_HW_BP_PRIV_PL0_SUP_SYS);
-
+ arm_debug_break_exec_enable(0, addr, thumb, true);
arm_debug_disable_interrupts();
}
}
@@ -2085,6 +2247,7 @@ rtems_debugger_target_hwbreak_insert(void)
int
rtems_debugger_target_hwbreak_remove(void)
{
+ target_printk("[} hbreak: remove: unload\n");
arm_debug_break_unload();
return 0;
}
@@ -2095,15 +2258,34 @@ rtems_debugger_target_hwbreak_control(rtems_debugger_target_watchpoint wp,
DB_UINT addr,
DB_UINT kind)
{
- /*
- * To do.
- */
+ rtems_interrupt_lock_context lock_context;
+ int i;
+ if (wp != rtems_debugger_target_hw_execute) {
+ errno = EIO;
+ return -1;
+ }
+ rtems_interrupt_lock_acquire(&target_lock, &lock_context);
+ for (i = 1; i < hw_breakpoints; ++i) {
+ if (insert && !ARM_HWB_ENALBED(i)) {
+ arm_debug_break_exec_enable(i, addr, kind == 1, false);
+ break;
+ } else if (!insert && ARM_HWB_ENALBED(i) && ARM_HWB_VCR(i) == (addr & ~3)) {
+ arm_debug_break_clear(i);
+ break;
+ }
+ }
+ rtems_interrupt_lock_release(&target_lock, &lock_context);
+ if (!insert && i == hw_breakpoints) {
+ errno = EIO;
+ return -1;
+ }
return 0;
}
int
rtems_debugger_target_cache_sync(rtems_debugger_target_swbreak* swbreak)
{
+ target_printk("[} cache: sync: %p\n", swbreak->address);
/*
* Flush the data cache and invalidate the instruction cache.
*/
diff --git a/cpukit/libdebugger/rtems-debugger-server.c b/cpukit/libdebugger/rtems-debugger-server.c
index 9de9421b6b..b7b9727d84 100644
--- a/cpukit/libdebugger/rtems-debugger-server.c
+++ b/cpukit/libdebugger/rtems-debugger-server.c
@@ -1678,18 +1678,30 @@ rtems_debugger_events(rtems_task_argument arg)
rtems_debugger_target_enable();
- while (rtems_debugger_server_events_running()) {
- rtems_debugger_server_events_wait();
- if (rtems_debugger_verbose())
- rtems_debugger_printf("rtems-db: event woken\n");
- if (!rtems_debugger_server_events_running())
- break;
+ if (rtems_debugger_server_flag(RTEMS_DEBUGGER_FLAG_BREAK_WAITER)) {
+ rtems_debugger->flags &= ~RTEMS_DEBUGGER_FLAG_BREAK_WAITER;
r = rtems_debugger_thread_system_suspend();
- if (r < 0)
- break;
- r = remote_stop_reason(NULL, 0);
- if (r < 0)
- break;
+ if (rtems_debugger_verbose())
+ rtems_debugger_printf("rtems-db: break waiter\n");
+ rtems_debugger_server_events_signal();
+ if (rtems_debugger_verbose())
+ rtems_debugger_printf("rtems-db: break waiter: signalled\n");
+ }
+
+ if (r == 0) {
+ while (rtems_debugger_server_events_running()) {
+ rtems_debugger_server_events_wait();
+ if (rtems_debugger_verbose())
+ rtems_debugger_printf("rtems-db: event woken\n");
+ if (!rtems_debugger_server_events_running())
+ break;
+ r = rtems_debugger_thread_system_suspend();
+ if (r < 0)
+ break;
+ r = remote_stop_reason(NULL, 0);
+ if (r < 0)
+ break;
+ }
}
if (r < 0)
@@ -1973,6 +1985,30 @@ rtems_debugger_server_crash(void)
}
int
+rtems_debugger_break(bool wait)
+{
+ int r = 0;
+ if (!rtems_debugger_running()) {
+ errno = EIO;
+ r = -1;
+ } else {
+ rtems_debugger_lock();
+ if (rtems_debugger_server_events_running()) {
+ rtems_debugger_server_events_signal();
+ } else if (
+ wait && !rtems_debugger_server_flag(RTEMS_DEBUGGER_FLAG_BREAK_WAITER)) {
+ rtems_debugger->flags |= RTEMS_DEBUGGER_FLAG_BREAK_WAITER;
+ rtems_debugger_server_events_wait();
+ } else {
+ errno = EIO;
+ r = -1;
+ }
+ rtems_debugger_unlock();
+ }
+ return r;
+}
+
+int
rtems_debugger_stop(void)
{
return rtems_debugger_destroy();
@@ -1998,10 +2034,14 @@ rtems_debugger_set_verbose(bool on)
int
rtems_debugger_remote_debug(bool state)
{
- rtems_debugger_lock();
- rtems_debugger->remote_debug = state;
- rtems_debugger_printf("rtems-db: remote-debug is %s\n",
- rtems_debugger->remote_debug ? "on" : "off");
- rtems_debugger_unlock();
+ if (rtems_debugger_running()) {
+ rtems_debugger_lock();
+ rtems_debugger->remote_debug = state;
+ rtems_debugger_printf("rtems-db: remote-debug is %s\n",
+ rtems_debugger->remote_debug ? "on" : "off");
+ rtems_debugger_unlock();
+ } else {
+ rtems_debugger_printf("rtems-db: debug server not running\n");
+ }
return 0;
}
diff --git a/cpukit/libdl/rtl-mdreloc-aarch64.c b/cpukit/libdl/rtl-mdreloc-aarch64.c
index 41147e285c..c60ecb31c9 100644
--- a/cpukit/libdl/rtl-mdreloc-aarch64.c
+++ b/cpukit/libdl/rtl-mdreloc-aarch64.c
@@ -73,16 +73,12 @@ __RCSID("$NetBSD: mdreloc.c,v 1.14 2020/06/16 21:01:30 joerg Exp $");
#include <inttypes.h>
#include <sys/stat.h>
#include <sys/endian.h>
-#include <unwind.h>
#include <rtems/rtl/rtl.h>
#include "rtl-elf.h"
#include "rtl-error.h"
#include <rtems/rtl/rtl-trace.h>
-#include "rtl-unwind.h"
-
-typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
-typedef _Unwind_Word _uw;
+#include "rtl-unwind-arm.h"
struct tls_data {
size_t td_tlsindex;
@@ -522,78 +518,3 @@ rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj,
rtems_rtl_set_error (EINVAL, "rela type record not supported");
return rtems_rtl_elf_rel_failure;
}
-
-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-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-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;