summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/Makefile.am1829
-rw-r--r--cpukit/automake/compile.am5
-rw-r--r--cpukit/automake/multilib.am34
-rw-r--r--cpukit/configure.ac387
-rw-r--r--cpukit/header-dirs.am82
-rw-r--r--cpukit/headers.am452
-rw-r--r--cpukit/include/rtems.h2
-rw-r--r--cpukit/include/rtems/bspIo.h373
-rw-r--r--cpukit/include/rtems/confdefs/percpu.h18
-rw-r--r--cpukit/include/rtems/confdefs/wkspace.h16
-rw-r--r--cpukit/include/rtems/config.h12
-rw-r--r--cpukit/include/rtems/counter.h5
-rw-r--r--cpukit/include/rtems/cpuuse.h219
-rw-r--r--cpukit/include/rtems/extension.h765
-rw-r--r--cpukit/include/rtems/monitor.h2
-rw-r--r--cpukit/include/rtems/posix/muteximpl.h50
-rw-r--r--cpukit/include/rtems/posix/posixapi.h7
-rw-r--r--cpukit/include/rtems/posix/timer.h1
-rw-r--r--cpukit/include/rtems/rtems/asrdata.h4
-rw-r--r--cpukit/include/rtems/rtems/attr.h2
-rw-r--r--cpukit/include/rtems/rtems/barrier.h2
-rw-r--r--cpukit/include/rtems/rtems/cache.h662
-rw-r--r--cpukit/include/rtems/rtems/clock.h19
-rw-r--r--cpukit/include/rtems/rtems/message.h24
-rw-r--r--cpukit/include/rtems/rtems/partdata.h15
-rw-r--r--cpukit/include/rtems/rtems/ratemon.h2
-rw-r--r--cpukit/include/rtems/rtems/sem.h2
-rw-r--r--cpukit/include/rtems/rtems/statusimpl.h8
-rw-r--r--cpukit/include/rtems/rtems/tasks.h2
-rw-r--r--cpukit/include/rtems/rtems/types.h10
-rw-r--r--cpukit/include/rtems/score/basedefs.h2
-rw-r--r--cpukit/include/rtems/score/coremsgimpl.h20
-rw-r--r--cpukit/include/rtems/score/coremuteximpl.h53
-rw-r--r--cpukit/include/rtems/score/coresemimpl.h20
-rw-r--r--cpukit/include/rtems/score/hash.h2
-rw-r--r--cpukit/include/rtems/score/priorityimpl.h44
-rw-r--r--cpukit/include/rtems/score/scheduler.h91
-rw-r--r--cpukit/include/rtems/score/schedulercbs.h4
-rw-r--r--cpukit/include/rtems/score/scheduleredf.h4
-rw-r--r--cpukit/include/rtems/score/scheduleredfsmp.h2
-rw-r--r--cpukit/include/rtems/score/schedulerimpl.h38
-rw-r--r--cpukit/include/rtems/score/schedulernode.h14
-rw-r--r--cpukit/include/rtems/score/schedulernodeimpl.h107
-rw-r--r--cpukit/include/rtems/score/schedulerpriority.h4
-rw-r--r--cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h4
-rw-r--r--cpukit/include/rtems/score/schedulerprioritysmp.h6
-rw-r--r--cpukit/include/rtems/score/schedulersimple.h4
-rw-r--r--cpukit/include/rtems/score/schedulersimplesmp.h6
-rw-r--r--cpukit/include/rtems/score/schedulerstrongapa.h4
-rw-r--r--cpukit/include/rtems/score/smpimpl.h3
-rw-r--r--cpukit/include/rtems/score/stack.h24
-rw-r--r--cpukit/include/rtems/score/threadimpl.h50
-rw-r--r--cpukit/include/rtems/score/threadq.h49
-rw-r--r--cpukit/include/rtems/score/threadqimpl.h239
-rw-r--r--cpukit/include/rtems/score/todimpl.h79
-rw-r--r--cpukit/include/rtems/score/wkspace.h10
-rw-r--r--cpukit/include/rtems/score/wkspacedata.h10
-rw-r--r--cpukit/include/rtems/seterr.h10
-rw-r--r--cpukit/include/rtems/sysinit.h1
-rw-r--r--cpukit/include/rtems/test.h2
-rw-r--r--cpukit/libcsupport/src/getchark.c2
-rw-r--r--cpukit/libcsupport/src/posix_devctl.c80
-rw-r--r--cpukit/libcsupport/src/printk.c7
-rw-r--r--cpukit/libcsupport/src/printk_plugin.c9
-rw-r--r--cpukit/libcsupport/src/putk.c7
-rw-r--r--cpukit/libcsupport/src/rtems_put_char.c8
-rw-r--r--cpukit/libcsupport/src/rtems_putc.c2
-rw-r--r--cpukit/libcsupport/src/vprintk.c7
-rw-r--r--cpukit/libdl/rtl-mdreloc-h8300.c212
-rw-r--r--cpukit/libmisc/monitor/mon-part.c5
-rw-r--r--cpukit/libmisc/rtems-fdt/rtems-fdt.c2
-rw-r--r--cpukit/libmisc/shell/shell_cmdset.c5
-rw-r--r--cpukit/libtest/t-test-time.c45
-rw-r--r--cpukit/libtest/t-test.c3
-rw-r--r--cpukit/mghttpd/mongoose.c31
-rw-r--r--cpukit/posix/src/adjtime.c6
-rw-r--r--cpukit/posix/src/clocksettime.c5
-rw-r--r--cpukit/posix/src/condsignalsupp.c31
-rw-r--r--cpukit/posix/src/confstr.c127
-rw-r--r--cpukit/posix/src/psxtimercreate.c3
-rw-r--r--cpukit/posix/src/pthreadsetschedparam.c2
-rw-r--r--cpukit/posix/src/pthreadsetschedprio.c2
-rw-r--r--cpukit/posix/src/sempost.c14
-rw-r--r--cpukit/posix/src/timergettime.c48
-rw-r--r--cpukit/rtems/src/clockgettod.c37
-rw-r--r--cpukit/rtems/src/clockgettodtimeval.c6
-rw-r--r--cpukit/rtems/src/clocktodtoseconds.c33
-rw-r--r--cpukit/rtems/src/clocktodvalidate.c52
-rw-r--r--cpukit/rtems/src/partcreate.c10
-rw-r--r--cpukit/rtems/src/partreturnbuffer.c17
-rw-r--r--cpukit/rtems/src/ratemoncancel.c1
-rw-r--r--cpukit/rtems/src/ratemoncreate.c1
-rw-r--r--cpukit/rtems/src/ratemonperiod.c2
-rw-r--r--cpukit/rtems/src/tasksetpriority.c2
-rw-r--r--cpukit/score/cpu/aarch64/aarch64-context-validate.S159
-rw-r--r--cpukit/score/cpu/aarch64/aarch64-context-volatile-clobber.S19
-rw-r--r--cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S6
-rw-r--r--cpukit/score/cpu/aarch64/cpu.c4
-rw-r--r--cpukit/score/cpu/aarch64/cpu_asm.S78
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/asm.h5
-rw-r--r--[-rwxr-xr-x]cpukit/score/cpu/aarch64/include/rtems/score/aarch64-system-registers.h0
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/score/cpu.h17
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h67
-rw-r--r--cpukit/score/cpu/arm/headers.am14
-rw-r--r--cpukit/score/cpu/bfin/headers.am11
-rw-r--r--cpukit/score/cpu/i386/cpu.c8
-rw-r--r--cpukit/score/cpu/i386/headers.am11
-rw-r--r--cpukit/score/cpu/lm32/headers.am8
-rw-r--r--cpukit/score/cpu/m68k/headers.am11
-rw-r--r--cpukit/score/cpu/microblaze/__tls_get_addr.c54
-rw-r--r--cpukit/score/cpu/microblaze/cpu.c121
-rw-r--r--cpukit/score/cpu/microblaze/cpu_asm.S194
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/asm.h138
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/score/cpu.h305
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/score/cpuatomic.h41
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/score/cpuimpl.h96
-rw-r--r--cpukit/score/cpu/microblaze/include/rtems/score/microblaze.h57
-rw-r--r--cpukit/score/cpu/microblaze/microblaze-context-switch.S107
-rw-r--r--cpukit/score/cpu/microblaze/microblaze-context-validate.S117
-rw-r--r--cpukit/score/cpu/microblaze/microblaze-context-volatile-clobber.S28
-rw-r--r--cpukit/score/cpu/mips/headers.am9
-rw-r--r--cpukit/score/cpu/moxie/headers.am7
-rw-r--r--cpukit/score/cpu/nios2/headers.am10
-rw-r--r--cpukit/score/cpu/no_cpu/headers.am6
-rw-r--r--cpukit/score/cpu/or1k/headers.am8
-rw-r--r--cpukit/score/cpu/powerpc/headers.am9
-rw-r--r--cpukit/score/cpu/riscv/headers.am11
-rw-r--r--cpukit/score/cpu/sh/headers.am7
-rw-r--r--cpukit/score/cpu/sparc/headers.am11
-rw-r--r--cpukit/score/cpu/sparc64/headers.am6
-rw-r--r--cpukit/score/cpu/v850/headers.am8
-rw-r--r--cpukit/score/cpu/x86_64/headers.am9
-rw-r--r--cpukit/score/src/coremsgseize.c20
-rw-r--r--cpukit/score/src/coretodadjust.c12
-rw-r--r--cpukit/score/src/coretodcheck.c59
-rw-r--r--cpukit/score/src/coretodset.c22
-rw-r--r--cpukit/score/src/coretodtickspersec.c30
-rw-r--r--cpukit/score/src/futex.c42
-rw-r--r--cpukit/score/src/mutex.c16
-rw-r--r--cpukit/score/src/percpujobs.c1
-rw-r--r--cpukit/score/src/rbtreemax.c55
-rw-r--r--cpukit/score/src/rbtreemin.c55
-rw-r--r--cpukit/score/src/rbtreenext.c48
-rw-r--r--cpukit/score/src/rbtreeprev.c47
-rw-r--r--cpukit/score/src/schedulerdefaultaskforhelp.c61
-rw-r--r--cpukit/score/src/schedulerdefaultnodedestroy.c4
-rw-r--r--cpukit/score/src/schedulerdefaultpinunpin.c31
-rw-r--r--cpukit/score/src/schedulerdefaultpinunpindonothing.c73
-rw-r--r--cpukit/score/src/scheduleredfreleasejob.c2
-rw-r--r--cpukit/score/src/semaphore.c28
-rw-r--r--cpukit/score/src/smp.c5
-rw-r--r--cpukit/score/src/stackallocatorforidle.c59
-rw-r--r--cpukit/score/src/threadchangepriority.c45
-rw-r--r--cpukit/score/src/threadcreateidle.c20
-rw-r--r--cpukit/score/src/threaddispatch.c21
-rw-r--r--cpukit/score/src/threadinitialize.c180
-rw-r--r--cpukit/score/src/threadplaindispatch.c60
-rw-r--r--cpukit/score/src/threadqenqueue.c313
-rw-r--r--cpukit/score/src/threadqfirst.c10
-rw-r--r--cpukit/score/src/threadqflush.c22
-rw-r--r--cpukit/score/src/threadqops.c42
-rw-r--r--cpukit/score/src/threadrestart.c44
-rw-r--r--cpukit/version-vc-key.h.in7
163 files changed, 5230 insertions, 4722 deletions
diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
deleted file mode 100644
index dfa5fb2412..0000000000
--- a/cpukit/Makefile.am
+++ /dev/null
@@ -1,1829 +0,0 @@
-ACLOCAL_AMFLAGS = -I aclocal
-
-include $(top_srcdir)/automake/compile.am
-include $(top_srcdir)/automake/multilib.am
-include $(srcdir)/header-dirs.am
-include $(srcdir)/headers.am
-
-# This file is in the build tree
-include_rtems_score_HEADERS += ../include/rtems/score/cpuopts.h
-
-project_lib_LIBRARIES =
-
-project_lib_LIBRARIES += librtemscpu.a
-
-librtemscpu_a_SOURCES =
-librtemscpu_a_SOURCES += dev/i2c/eeprom.c
-librtemscpu_a_SOURCES += dev/i2c/fpga-i2c-slave.c
-librtemscpu_a_SOURCES += dev/i2c/gpio-nxp-pca9535.c
-librtemscpu_a_SOURCES += dev/i2c/i2c-bus.c
-librtemscpu_a_SOURCES += dev/i2c/i2c-dev.c
-librtemscpu_a_SOURCES += dev/i2c/sensor-lm75a.c
-librtemscpu_a_SOURCES += dev/i2c/switch-nxp-pca9548a.c
-librtemscpu_a_SOURCES += dev/i2c/ti-ads-16bit-adc.c
-librtemscpu_a_SOURCES += dev/i2c/ti-lm25066a.c
-librtemscpu_a_SOURCES += dev/i2c/ti-tmp112.c
-librtemscpu_a_SOURCES += dev/i2c/xilinx-axi-i2c.c
-librtemscpu_a_SOURCES += dev/serial/sc16is752.c
-librtemscpu_a_SOURCES += dev/serial/sc16is752-spi.c
-librtemscpu_a_SOURCES += dev/spi/spi-bus.c
-librtemscpu_a_SOURCES += dtc/libfdt/fdt_addresses.c
-librtemscpu_a_SOURCES += dtc/libfdt/fdt.c
-librtemscpu_a_SOURCES += dtc/libfdt/fdt_empty_tree.c
-librtemscpu_a_SOURCES += dtc/libfdt/fdt_ro.c
-librtemscpu_a_SOURCES += dtc/libfdt/fdt_rw.c
-librtemscpu_a_SOURCES += dtc/libfdt/fdt_strerror.c
-librtemscpu_a_SOURCES += dtc/libfdt/fdt_sw.c
-librtemscpu_a_SOURCES += dtc/libfdt/fdt_wip.c
-librtemscpu_a_SOURCES += libblock/src/bdbuf.c
-librtemscpu_a_SOURCES += libblock/src/bdpart-create.c
-librtemscpu_a_SOURCES += libblock/src/bdpart-dump.c
-librtemscpu_a_SOURCES += libblock/src/bdpart-read.c
-librtemscpu_a_SOURCES += libblock/src/bdpart-register.c
-librtemscpu_a_SOURCES += libblock/src/bdpart-sort.c
-librtemscpu_a_SOURCES += libblock/src/bdpart-write.c
-librtemscpu_a_SOURCES += libblock/src/blkdev-blkstats.c
-librtemscpu_a_SOURCES += libblock/src/blkdev.c
-librtemscpu_a_SOURCES += libblock/src/blkdev-imfs.c
-librtemscpu_a_SOURCES += libblock/src/blkdev-ioctl.c
-librtemscpu_a_SOURCES += libblock/src/blkdev-ops.c
-librtemscpu_a_SOURCES += libblock/src/blkdev-print-stats.c
-librtemscpu_a_SOURCES += libblock/src/diskdevs.c
-librtemscpu_a_SOURCES += libblock/src/diskdevs-init.c
-librtemscpu_a_SOURCES += libblock/src/flashdisk.c
-librtemscpu_a_SOURCES += libblock/src/ide_part_table.c
-librtemscpu_a_SOURCES += libblock/src/media.c
-librtemscpu_a_SOURCES += libblock/src/media-desc.c
-librtemscpu_a_SOURCES += libblock/src/media-dev-ident.c
-librtemscpu_a_SOURCES += libblock/src/media-path.c
-librtemscpu_a_SOURCES += libblock/src/media-server.c
-librtemscpu_a_SOURCES += libblock/src/nvdisk.c
-librtemscpu_a_SOURCES += libblock/src/nvdisk-sram.c
-librtemscpu_a_SOURCES += libblock/src/ramdisk-config.c
-librtemscpu_a_SOURCES += libblock/src/ramdisk-driver.c
-librtemscpu_a_SOURCES += libblock/src/ramdisk-init.c
-librtemscpu_a_SOURCES += libblock/src/ramdisk-register.c
-librtemscpu_a_SOURCES += libblock/src/sparse-disk.c
-librtemscpu_a_SOURCES += libcrypt/crypt.c
-librtemscpu_a_SOURCES += libcrypt/crypt-md5.c
-librtemscpu_a_SOURCES += libcrypt/crypt-sha256.c
-librtemscpu_a_SOURCES += libcrypt/crypt-sha512.c
-librtemscpu_a_SOURCES += libcrypt/misc.c
-librtemscpu_a_SOURCES += libcsupport/src/access.c
-librtemscpu_a_SOURCES += libcsupport/src/arc4random_getentropy_fail.c
-librtemscpu_a_SOURCES += libcsupport/src/alignedalloc.c
-librtemscpu_a_SOURCES += libcsupport/src/__assert.c
-librtemscpu_a_SOURCES += libcsupport/src/assoc32tostring.c
-librtemscpu_a_SOURCES += libcsupport/src/assoclocalbyname.c
-librtemscpu_a_SOURCES += libcsupport/src/assoclocalbyremotebitfield.c
-librtemscpu_a_SOURCES += libcsupport/src/assoclocalbyremote.c
-librtemscpu_a_SOURCES += libcsupport/src/assocnamebad.c
-librtemscpu_a_SOURCES += libcsupport/src/assocnamebylocalbitfield.c
-librtemscpu_a_SOURCES += libcsupport/src/assocnamebylocal.c
-librtemscpu_a_SOURCES += libcsupport/src/assocnamebyremotebitfield.c
-librtemscpu_a_SOURCES += libcsupport/src/assocnamebyremote.c
-librtemscpu_a_SOURCES += libcsupport/src/assocptrbylocal.c
-librtemscpu_a_SOURCES += libcsupport/src/assocptrbyname.c
-librtemscpu_a_SOURCES += libcsupport/src/assocptrbyremote.c
-librtemscpu_a_SOURCES += libcsupport/src/assocremotebylocalbitfield.c
-librtemscpu_a_SOURCES += libcsupport/src/assocremotebylocal.c
-librtemscpu_a_SOURCES += libcsupport/src/assocremotebyname.c
-librtemscpu_a_SOURCES += libcsupport/src/assocthreadstatestostring.c
-librtemscpu_a_SOURCES += libcsupport/src/base_fs.c
-librtemscpu_a_SOURCES += libcsupport/src/cachealignedalloc.c
-librtemscpu_a_SOURCES += libcsupport/src/cachecoherentalloc.c
-librtemscpu_a_SOURCES += libcsupport/src/calloc.c
-librtemscpu_a_SOURCES += libcsupport/src/_calloc_r.c
-librtemscpu_a_SOURCES += libcsupport/src/cfgetispeed.c
-librtemscpu_a_SOURCES += libcsupport/src/cfgetospeed.c
-librtemscpu_a_SOURCES += libcsupport/src/cfmakeraw.c
-librtemscpu_a_SOURCES += libcsupport/src/cfmakesane.c
-librtemscpu_a_SOURCES += libcsupport/src/cfsetispeed.c
-librtemscpu_a_SOURCES += libcsupport/src/cfsetospeed.c
-librtemscpu_a_SOURCES += libcsupport/src/cfsetspeed.c
-librtemscpu_a_SOURCES += libcsupport/src/chdir.c
-librtemscpu_a_SOURCES += libcsupport/src/chmod.c
-librtemscpu_a_SOURCES += libcsupport/src/chown.c
-librtemscpu_a_SOURCES += libcsupport/src/chroot.c
-librtemscpu_a_SOURCES += libcsupport/src/clock.c
-librtemscpu_a_SOURCES += libcsupport/src/clonenode.c
-librtemscpu_a_SOURCES += libcsupport/src/close.c
-librtemscpu_a_SOURCES += libcsupport/src/consolesimple.c
-librtemscpu_a_SOURCES += libcsupport/src/consolesimpleread.c
-librtemscpu_a_SOURCES += libcsupport/src/consolesimpletask.c
-librtemscpu_a_SOURCES += libcsupport/src/ctermid.c
-librtemscpu_a_SOURCES += libcsupport/src/dup2.c
-librtemscpu_a_SOURCES += libcsupport/src/dup.c
-librtemscpu_a_SOURCES += libcsupport/src/error.c
-librtemscpu_a_SOURCES += libcsupport/src/fchdir.c
-librtemscpu_a_SOURCES += libcsupport/src/fchmod.c
-librtemscpu_a_SOURCES += libcsupport/src/fchown.c
-librtemscpu_a_SOURCES += libcsupport/src/fcntl.c
-librtemscpu_a_SOURCES += libcsupport/src/fdatasync.c
-librtemscpu_a_SOURCES += libcsupport/src/flockfile.c
-librtemscpu_a_SOURCES += libcsupport/src/fpathconf.c
-librtemscpu_a_SOURCES += libcsupport/src/free.c
-librtemscpu_a_SOURCES += libcsupport/src/freenode.c
-librtemscpu_a_SOURCES += libcsupport/src/_free_r.c
-librtemscpu_a_SOURCES += libcsupport/src/fstat.c
-librtemscpu_a_SOURCES += libcsupport/src/fsync.c
-librtemscpu_a_SOURCES += libcsupport/src/ftruncate.c
-librtemscpu_a_SOURCES += libcsupport/src/ftrylockfile.c
-librtemscpu_a_SOURCES += libcsupport/src/funlockfile.c
-librtemscpu_a_SOURCES += libcsupport/src/getchark.c
-librtemscpu_a_SOURCES += libcsupport/src/getdents.c
-librtemscpu_a_SOURCES += libcsupport/src/getegid.c
-librtemscpu_a_SOURCES += libcsupport/src/geteuid.c
-librtemscpu_a_SOURCES += libcsupport/src/getgid.c
-librtemscpu_a_SOURCES += libcsupport/src/getgrent.c
-librtemscpu_a_SOURCES += libcsupport/src/getgrnam.c
-librtemscpu_a_SOURCES += libcsupport/src/getgroups.c
-librtemscpu_a_SOURCES += libcsupport/src/getlogin.c
-librtemscpu_a_SOURCES += libcsupport/src/getpagesize.c
-librtemscpu_a_SOURCES += libcsupport/src/getpgrp.c
-librtemscpu_a_SOURCES += libcsupport/src/__getpid.c
-librtemscpu_a_SOURCES += libcsupport/src/getpid.c
-librtemscpu_a_SOURCES += libcsupport/src/getppid.c
-librtemscpu_a_SOURCES += libcsupport/src/getpwent.c
-librtemscpu_a_SOURCES += libcsupport/src/getreentglobal.c
-librtemscpu_a_SOURCES += libcsupport/src/getrusage.c
-librtemscpu_a_SOURCES += libcsupport/src/__gettod.c
-librtemscpu_a_SOURCES += libcsupport/src/getuid.c
-librtemscpu_a_SOURCES += libcsupport/src/gxx_wrappers.c
-librtemscpu_a_SOURCES += libcsupport/src/ioctl.c
-librtemscpu_a_SOURCES += libcsupport/src/isatty_r.c
-librtemscpu_a_SOURCES += libcsupport/src/issetugid.c
-librtemscpu_a_SOURCES += libcsupport/src/kill_noposix.c
-librtemscpu_a_SOURCES += libcsupport/src/lchown.c
-librtemscpu_a_SOURCES += libcsupport/src/libio.c
-librtemscpu_a_SOURCES += libcsupport/src/libio_exit.c
-librtemscpu_a_SOURCES += libcsupport/src/libio_init.c
-librtemscpu_a_SOURCES += libcsupport/src/libiozeroiops.c
-librtemscpu_a_SOURCES += libcsupport/src/link.c
-librtemscpu_a_SOURCES += libcsupport/src/lseek.c
-librtemscpu_a_SOURCES += libcsupport/src/lstat.c
-librtemscpu_a_SOURCES += libcsupport/src/malloc.c
-librtemscpu_a_SOURCES += libcsupport/src/malloc_deferred.c
-librtemscpu_a_SOURCES += libcsupport/src/malloc_dirtier.c
-librtemscpu_a_SOURCES += libcsupport/src/mallocdirtydefault.c
-librtemscpu_a_SOURCES += libcsupport/src/mallocextenddefault.c
-librtemscpu_a_SOURCES += libcsupport/src/mallocfreespace.c
-librtemscpu_a_SOURCES += libcsupport/src/mallocgetheapptr.c
-librtemscpu_a_SOURCES += libcsupport/src/mallocheap.c
-librtemscpu_a_SOURCES += libcsupport/src/mallocinfo.c
-librtemscpu_a_SOURCES += libcsupport/src/malloc_initialize.c
-librtemscpu_a_SOURCES += libcsupport/src/_malloc_r.c
-librtemscpu_a_SOURCES += libcsupport/src/mallocsetheapptr.c
-librtemscpu_a_SOURCES += libcsupport/src/malloc_walk.c
-librtemscpu_a_SOURCES += libcsupport/src/mkdir.c
-librtemscpu_a_SOURCES += libcsupport/src/mkfifo.c
-librtemscpu_a_SOURCES += libcsupport/src/mknod.c
-librtemscpu_a_SOURCES += libcsupport/src/mount.c
-librtemscpu_a_SOURCES += libcsupport/src/mount-mgr.c
-librtemscpu_a_SOURCES += libcsupport/src/mount-mktgt.c
-librtemscpu_a_SOURCES += libcsupport/src/newlibc_exit.c
-librtemscpu_a_SOURCES += libcsupport/src/newlibc_reent.c
-librtemscpu_a_SOURCES += libcsupport/src/open.c
-librtemscpu_a_SOURCES += libcsupport/src/open_dev_console.c
-librtemscpu_a_SOURCES += libcsupport/src/pathconf.c
-librtemscpu_a_SOURCES += libcsupport/src/posix_devctl.c
-librtemscpu_a_SOURCES += libcsupport/src/posix_memalign.c
-librtemscpu_a_SOURCES += libcsupport/src/printerfprintfputc.c
-librtemscpu_a_SOURCES += libcsupport/src/printertask.c
-librtemscpu_a_SOURCES += libcsupport/src/printf_plugin.c
-librtemscpu_a_SOURCES += libcsupport/src/print_fprintf.c
-librtemscpu_a_SOURCES += libcsupport/src/printk.c
-librtemscpu_a_SOURCES += libcsupport/src/printk_plugin.c
-librtemscpu_a_SOURCES += libcsupport/src/print_printf.c
-librtemscpu_a_SOURCES += libcsupport/src/privateenv.c
-librtemscpu_a_SOURCES += libcsupport/src/putk.c
-librtemscpu_a_SOURCES += libcsupport/src/pwdgrp.c
-librtemscpu_a_SOURCES += libcsupport/src/read.c
-librtemscpu_a_SOURCES += libcsupport/src/readlink.c
-librtemscpu_a_SOURCES += libcsupport/src/readv.c
-librtemscpu_a_SOURCES += libcsupport/src/realloc.c
-librtemscpu_a_SOURCES += libcsupport/src/_realloc_r.c
-librtemscpu_a_SOURCES += libcsupport/src/realpath.c
-librtemscpu_a_SOURCES += libcsupport/src/_rename_r.c
-librtemscpu_a_SOURCES += libcsupport/src/resource_snapshot.c
-librtemscpu_a_SOURCES += libcsupport/src/rmdir.c
-librtemscpu_a_SOURCES += libcsupport/src/rtemscalloc.c
-librtemscpu_a_SOURCES += libcsupport/src/rtems_heap_extend.c
-librtemscpu_a_SOURCES += libcsupport/src/rtems_heap_extend_via_sbrk.c
-librtemscpu_a_SOURCES += libcsupport/src/rtems_heap_greedy.c
-librtemscpu_a_SOURCES += libcsupport/src/rtems_heap_null_extend.c
-librtemscpu_a_SOURCES += libcsupport/src/rtems_heap_sbrk_greedy.c
-librtemscpu_a_SOURCES += libcsupport/src/rtems_memalign.c
-librtemscpu_a_SOURCES += libcsupport/src/rtems_mkdir.c
-librtemscpu_a_SOURCES += libcsupport/src/rtems_putc.c
-librtemscpu_a_SOURCES += libcsupport/src/rtems_put_char.c
-librtemscpu_a_SOURCES += libcsupport/src/setegid.c
-librtemscpu_a_SOURCES += libcsupport/src/seteuid.c
-librtemscpu_a_SOURCES += libcsupport/src/setgid.c
-librtemscpu_a_SOURCES += libcsupport/src/setgroups.c
-librtemscpu_a_SOURCES += libcsupport/src/setpgid.c
-librtemscpu_a_SOURCES += libcsupport/src/setsid.c
-librtemscpu_a_SOURCES += libcsupport/src/setuid.c
-librtemscpu_a_SOURCES += libcsupport/src/stat.c
-librtemscpu_a_SOURCES += libcsupport/src/statvfs.c
-librtemscpu_a_SOURCES += libcsupport/src/sup_fs_check_permissions.c
-librtemscpu_a_SOURCES += libcsupport/src/sup_fs_deviceio.c
-librtemscpu_a_SOURCES += libcsupport/src/sup_fs_eval_path.c
-librtemscpu_a_SOURCES += libcsupport/src/sup_fs_eval_path_generic.c
-librtemscpu_a_SOURCES += libcsupport/src/sup_fs_exist_in_same_instance.c
-librtemscpu_a_SOURCES += libcsupport/src/sup_fs_location.c
-librtemscpu_a_SOURCES += libcsupport/src/sup_fs_mount_iterate.c
-librtemscpu_a_SOURCES += libcsupport/src/sup_fs_next_token.c
-librtemscpu_a_SOURCES += libcsupport/src/symlink.c
-librtemscpu_a_SOURCES += libcsupport/src/sync.c
-librtemscpu_a_SOURCES += libcsupport/src/tcdrain.c
-librtemscpu_a_SOURCES += libcsupport/src/tcflow.c
-librtemscpu_a_SOURCES += libcsupport/src/tcflush.c
-librtemscpu_a_SOURCES += libcsupport/src/tcgetattr.c
-librtemscpu_a_SOURCES += libcsupport/src/tcgetpgrp.c
-librtemscpu_a_SOURCES += libcsupport/src/tcsendbreak.c
-librtemscpu_a_SOURCES += libcsupport/src/tcsetattr.c
-librtemscpu_a_SOURCES += libcsupport/src/tcsetpgrp.c
-librtemscpu_a_SOURCES += libcsupport/src/termios_baud2index.c
-librtemscpu_a_SOURCES += libcsupport/src/termios_baud2num.c
-librtemscpu_a_SOURCES += libcsupport/src/termios_baudtable.c
-librtemscpu_a_SOURCES += libcsupport/src/termios.c
-librtemscpu_a_SOURCES += libcsupport/src/termiosinitialize.c
-librtemscpu_a_SOURCES += libcsupport/src/termios_num2baud.c
-librtemscpu_a_SOURCES += libcsupport/src/termios_posix_isig_handler.c
-librtemscpu_a_SOURCES += libcsupport/src/termios_setbestbaud.c
-librtemscpu_a_SOURCES += libcsupport/src/termios_setinitialbaud.c
-librtemscpu_a_SOURCES += libcsupport/src/__times.c
-librtemscpu_a_SOURCES += libcsupport/src/truncate.c
-librtemscpu_a_SOURCES += libcsupport/src/uenvgetgroups.c
-librtemscpu_a_SOURCES += libcsupport/src/umask.c
-librtemscpu_a_SOURCES += libcsupport/src/unlink.c
-librtemscpu_a_SOURCES += libcsupport/src/unmount.c
-librtemscpu_a_SOURCES += libcsupport/src/__usrenv.c
-librtemscpu_a_SOURCES += libcsupport/src/utime.c
-librtemscpu_a_SOURCES += libcsupport/src/utimes.c
-librtemscpu_a_SOURCES += libcsupport/src/futimens.c
-librtemscpu_a_SOURCES += libcsupport/src/utimensat.c
-librtemscpu_a_SOURCES += libcsupport/src/utsname.c
-librtemscpu_a_SOURCES += libcsupport/src/vprintk.c
-librtemscpu_a_SOURCES += libcsupport/src/write.c
-librtemscpu_a_SOURCES += libcsupport/src/write_r.c
-librtemscpu_a_SOURCES += libcsupport/src/writev.c
-librtemscpu_a_SOURCES += libmisc/bspcmdline/bspcmdline_get.c
-librtemscpu_a_SOURCES += libmisc/bspcmdline/bspcmdline_getparam.c
-librtemscpu_a_SOURCES += libmisc/bspcmdline/bspcmdline_getparamraw.c
-librtemscpu_a_SOURCES += libmisc/bspcmdline/bspcmdline_getparamrhs.c
-librtemscpu_a_SOURCES += libmisc/capture/capture_buffer.c
-librtemscpu_a_SOURCES += libmisc/capture/capture.c
-librtemscpu_a_SOURCES += libmisc/capture/capture-cli.c
-librtemscpu_a_SOURCES += libmisc/capture/capture_support.c
-librtemscpu_a_SOURCES += libmisc/capture/capture_user_extension.c
-librtemscpu_a_SOURCES += libmisc/capture/rtems-trace-buffer-default.c
-librtemscpu_a_SOURCES += libmisc/capture/rtems-trace-buffer-vars.c
-librtemscpu_a_SOURCES += libmisc/cpuuse/cpuinforeport.c
-librtemscpu_a_SOURCES += libmisc/cpuuse/cpuusagedata.c
-librtemscpu_a_SOURCES += libmisc/cpuuse/cpuusagereport.c
-librtemscpu_a_SOURCES += libmisc/cpuuse/cpuusagereset.c
-librtemscpu_a_SOURCES += libmisc/cpuuse/cpuusagetop.c
-librtemscpu_a_SOURCES += libmisc/devnull/devnull.c
-librtemscpu_a_SOURCES += libmisc/devnull/devzero.c
-librtemscpu_a_SOURCES += libmisc/dumpbuf/dumpbuf.c
-librtemscpu_a_SOURCES += libmisc/fb/mw_print.c
-librtemscpu_a_SOURCES += libmisc/fb/mw_uid.c
-librtemscpu_a_SOURCES += libmisc/fsmount/fsmount.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-command.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-config.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-driver.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-editor.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-extension.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-itask.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-manager.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-monitor.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-object.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-part.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-prmisc.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-queue.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-region.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-sema.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-server.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-symbols.c
-librtemscpu_a_SOURCES += libmisc/monitor/mon-task.c
-librtemscpu_a_SOURCES += libmisc/mouse/mouse_parser.c
-librtemscpu_a_SOURCES += libmisc/mouse/serial_mouse.c
-librtemscpu_a_SOURCES += libmisc/redirector/stdio-redirect.c
-librtemscpu_a_SOURCES += libmisc/rtems-fdt/rtems-fdt.c
-librtemscpu_a_SOURCES += libmisc/rtems-fdt/rtems-fdt-shell.c
-librtemscpu_a_SOURCES += libmisc/stackchk/check.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtodouble.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtofloat.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtoint.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtolong.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtolongdouble.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtolonglong.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtopointer.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtounsignedchar.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtounsignedint.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtounsignedlong.c
-librtemscpu_a_SOURCES += libmisc/stringto/stringtounsignedlonglong.c
-librtemscpu_a_SOURCES += libmisc/untar/untar.c
-librtemscpu_a_SOURCES += libmisc/untar/untar_tgz.c
-librtemscpu_a_SOURCES += libmisc/untar/untar_txz.c
-librtemscpu_a_SOURCES += libmisc/uuid/clear.c
-librtemscpu_a_SOURCES += libmisc/uuid/compare.c
-librtemscpu_a_SOURCES += libmisc/uuid/copy.c
-librtemscpu_a_SOURCES += libmisc/uuid/gen_uuid.c
-librtemscpu_a_SOURCES += libmisc/uuid/isnull.c
-librtemscpu_a_SOURCES += libmisc/uuid/pack.c
-librtemscpu_a_SOURCES += libmisc/uuid/parse.c
-librtemscpu_a_SOURCES += libmisc/uuid/unpack.c
-librtemscpu_a_SOURCES += libmisc/uuid/unparse.c
-librtemscpu_a_SOURCES += libmisc/uuid/uuid_time.c
-librtemscpu_a_SOURCES += libmisc/xz/xz_crc32.c
-librtemscpu_a_SOURCES += libmisc/xz/xz_dec_lzma2.c
-librtemscpu_a_SOURCES += libmisc/xz/xz_dec_stream.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_are_nodes_equal.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_chown.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_clone.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_close.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_eval_path.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_fchmod.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_fcntl.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_freenode.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_fstat.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_fsunmount.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_fsync.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_fsync_success.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_ftruncate.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_ftruncate_directory.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_handlers.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_ioctl.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_kqfilter.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_link.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_lock_and_unlock.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_lseek.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_lseek_directory.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_lseek_file.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_mknod.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_mmap.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_mount.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_open.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_ops.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_poll.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_read.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_readlink.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_readv.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_rename.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_rmnod.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_statvfs.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_symlink.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_unmount.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_utimens.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_write.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_writev.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/fat.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/fat_fat_operations.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/fat_file.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_conv.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_conv_default.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_conv_utf8.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_create.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_dir.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_eval.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_file.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_format.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_free.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_fsunmount.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_handlers_dir.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_handlers_file.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_init.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_initsupp.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_misc.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_mknod.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_rename.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_rmnod.c
-librtemscpu_a_SOURCES += libfs/src/dosfs/msdos_statvfs.c
-librtemscpu_a_SOURCES += libfs/src/imfs/deviceio.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_add_node.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_chown.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_config.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_creat.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_dir.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_dir_default.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_dir_minimal.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_eval.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_eval_devfs.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_fchmod.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_fifo.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_fsunmount.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_handlers_device.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_init.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_initsupp.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_linfile.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_link.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_load_tar.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_make_generic_node.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_make_linfile.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_memfile.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_mknod.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_mount.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_node.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_node_destroy_default.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_rename.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_rmnod.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_stat.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_stat_file.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_symlink.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_unmount.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_utimens.c
-librtemscpu_a_SOURCES += libfs/src/imfs/ioman.c
-librtemscpu_a_SOURCES += libfs/src/pipe/fifo.c
-librtemscpu_a_SOURCES += libfs/src/pipe/pipe.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-bitmaps.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-block.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-buffer-bdbuf.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-buffer.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-dir.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-dir-hash.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-file.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-file-system.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-format.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-group.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-inode.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-link.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-mutex.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-rtems.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-rtems-dev.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-rtems-dir.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-rtems-file.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-rtems-utils.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-shell.c
-librtemscpu_a_SOURCES += libfs/src/rfs/rtems-rfs-trace.c
-librtemscpu_a_SOURCES += libi2c/libi2c.c
-librtemscpu_a_SOURCES += libmd/md4.c
-librtemscpu_a_SOURCES += libmd/md5.c
-librtemscpu_a_SOURCES += libmd/sha256c.c
-librtemscpu_a_SOURCES += libmd/sha512c.c
-librtemscpu_a_SOURCES += libstdthreads/call_once.c
-librtemscpu_a_SOURCES += libstdthreads/cnd.c
-librtemscpu_a_SOURCES += libstdthreads/mtx.c
-librtemscpu_a_SOURCES += libstdthreads/thrd.c
-librtemscpu_a_SOURCES += libstdthreads/tss.c
-librtemscpu_a_SOURCES += libtrace/record/record.c
-librtemscpu_a_SOURCES += libtrace/record/record-client.c
-librtemscpu_a_SOURCES += libtrace/record/record-dump.c
-librtemscpu_a_SOURCES += libtrace/record/record-dump-fatal.c
-librtemscpu_a_SOURCES += libtrace/record/record-dump-zfatal.c
-librtemscpu_a_SOURCES += libtrace/record/record-dump-base64.c
-librtemscpu_a_SOURCES += libtrace/record/record-dump-zbase64.c
-librtemscpu_a_SOURCES += libtrace/record/record-server.c
-librtemscpu_a_SOURCES += libtrace/record/record-stream-header.c
-librtemscpu_a_SOURCES += libtrace/record/record-sysinit.c
-librtemscpu_a_SOURCES += libtrace/record/record-text.c
-librtemscpu_a_SOURCES += libtrace/record/record-userext.c
-librtemscpu_a_SOURCES += libtrace/record/record-util.c
-librtemscpu_a_SOURCES += posix/src/adjtime.c
-librtemscpu_a_SOURCES += posix/src/aio_suspend.c
-librtemscpu_a_SOURCES += posix/src/barrierattrdestroy.c
-librtemscpu_a_SOURCES += posix/src/barrierattrgetpshared.c
-librtemscpu_a_SOURCES += posix/src/barrierattrinit.c
-librtemscpu_a_SOURCES += posix/src/barrierattrsetpshared.c
-librtemscpu_a_SOURCES += posix/src/cancel.c
-librtemscpu_a_SOURCES += posix/src/cleanuppush.c
-librtemscpu_a_SOURCES += posix/src/clockgetcpuclockid.c
-librtemscpu_a_SOURCES += posix/src/clockgetres.c
-librtemscpu_a_SOURCES += posix/src/clockgettime.c
-librtemscpu_a_SOURCES += posix/src/clocknanosleep.c
-librtemscpu_a_SOURCES += posix/src/clocksettime.c
-librtemscpu_a_SOURCES += posix/src/condattrdestroy.c
-librtemscpu_a_SOURCES += posix/src/condattrgetclock.c
-librtemscpu_a_SOURCES += posix/src/condattrgetpshared.c
-librtemscpu_a_SOURCES += posix/src/condattrinit.c
-librtemscpu_a_SOURCES += posix/src/condattrsetclock.c
-librtemscpu_a_SOURCES += posix/src/condattrsetpshared.c
-librtemscpu_a_SOURCES += posix/src/condbroadcast.c
-librtemscpu_a_SOURCES += posix/src/conddefaultattributes.c
-librtemscpu_a_SOURCES += posix/src/conddestroy.c
-librtemscpu_a_SOURCES += posix/src/condinit.c
-librtemscpu_a_SOURCES += posix/src/condsignal.c
-librtemscpu_a_SOURCES += posix/src/condsignalsupp.c
-librtemscpu_a_SOURCES += posix/src/condtimedwait.c
-librtemscpu_a_SOURCES += posix/src/condwait.c
-librtemscpu_a_SOURCES += posix/src/condwaitsupp.c
-librtemscpu_a_SOURCES += posix/src/_execve.c
-librtemscpu_a_SOURCES += posix/src/fork.c
-librtemscpu_a_SOURCES += posix/src/key.c
-librtemscpu_a_SOURCES += posix/src/keycreate.c
-librtemscpu_a_SOURCES += posix/src/keydelete.c
-librtemscpu_a_SOURCES += posix/src/keygetspecific.c
-librtemscpu_a_SOURCES += posix/src/keysetspecific.c
-librtemscpu_a_SOURCES += posix/src/keyzerokvp.c
-librtemscpu_a_SOURCES += posix/src/lio_listio.c
-librtemscpu_a_SOURCES += posix/src/mlockall.c
-librtemscpu_a_SOURCES += posix/src/mlock.c
-librtemscpu_a_SOURCES += posix/src/mmap.c
-librtemscpu_a_SOURCES += posix/src/mprotect.c
-librtemscpu_a_SOURCES += posix/src/mqueue.c
-librtemscpu_a_SOURCES += posix/src/mqueueclose.c
-librtemscpu_a_SOURCES += posix/src/mqueueconfig.c
-librtemscpu_a_SOURCES += posix/src/mqueuedeletesupp.c
-librtemscpu_a_SOURCES += posix/src/mqueuegetattr.c
-librtemscpu_a_SOURCES += posix/src/mqueueopen.c
-librtemscpu_a_SOURCES += posix/src/mqueuereceive.c
-librtemscpu_a_SOURCES += posix/src/mqueuerecvsupp.c
-librtemscpu_a_SOURCES += posix/src/mqueuesend.c
-librtemscpu_a_SOURCES += posix/src/mqueuesendsupp.c
-librtemscpu_a_SOURCES += posix/src/mqueuesetattr.c
-librtemscpu_a_SOURCES += posix/src/mqueuetimedreceive.c
-librtemscpu_a_SOURCES += posix/src/mqueuetimedsend.c
-librtemscpu_a_SOURCES += posix/src/mqueueunlink.c
-librtemscpu_a_SOURCES += posix/src/msync.c
-librtemscpu_a_SOURCES += posix/src/munlockall.c
-librtemscpu_a_SOURCES += posix/src/munlock.c
-librtemscpu_a_SOURCES += posix/src/munmap.c
-librtemscpu_a_SOURCES += posix/src/mutexattrdestroy.c
-librtemscpu_a_SOURCES += posix/src/mutexattrgetprioceiling.c
-librtemscpu_a_SOURCES += posix/src/mutexattrgetprotocol.c
-librtemscpu_a_SOURCES += posix/src/mutexattrgetpshared.c
-librtemscpu_a_SOURCES += posix/src/mutexattrgettype.c
-librtemscpu_a_SOURCES += posix/src/mutexattrinit.c
-librtemscpu_a_SOURCES += posix/src/mutexattrsetprioceiling.c
-librtemscpu_a_SOURCES += posix/src/mutexattrsetprotocol.c
-librtemscpu_a_SOURCES += posix/src/mutexattrsetpshared.c
-librtemscpu_a_SOURCES += posix/src/mutexattrsettype.c
-librtemscpu_a_SOURCES += posix/src/mutexdestroy.c
-librtemscpu_a_SOURCES += posix/src/mutexgetprioceiling.c
-librtemscpu_a_SOURCES += posix/src/mutexinit.c
-librtemscpu_a_SOURCES += posix/src/mutexlock.c
-librtemscpu_a_SOURCES += posix/src/mutexlocksupp.c
-librtemscpu_a_SOURCES += posix/src/mutexsetprioceiling.c
-librtemscpu_a_SOURCES += posix/src/mutextimedlock.c
-librtemscpu_a_SOURCES += posix/src/mutextrylock.c
-librtemscpu_a_SOURCES += posix/src/mutexunlock.c
-librtemscpu_a_SOURCES += posix/src/nanosleep.c
-librtemscpu_a_SOURCES += posix/src/pbarrierdestroy.c
-librtemscpu_a_SOURCES += posix/src/pbarrierinit.c
-librtemscpu_a_SOURCES += posix/src/pbarrierwait.c
-librtemscpu_a_SOURCES += posix/src/posix_madvise.c
-librtemscpu_a_SOURCES += posix/src/prwlockdestroy.c
-librtemscpu_a_SOURCES += posix/src/prwlockinit.c
-librtemscpu_a_SOURCES += posix/src/prwlockrdlock.c
-librtemscpu_a_SOURCES += posix/src/prwlocktimedrdlock.c
-librtemscpu_a_SOURCES += posix/src/prwlocktimedwrlock.c
-librtemscpu_a_SOURCES += posix/src/prwlocktryrdlock.c
-librtemscpu_a_SOURCES += posix/src/prwlocktrywrlock.c
-librtemscpu_a_SOURCES += posix/src/prwlockunlock.c
-librtemscpu_a_SOURCES += posix/src/prwlockwrlock.c
-librtemscpu_a_SOURCES += posix/src/psignalconfig.c
-librtemscpu_a_SOURCES += posix/src/pspindestroy.c
-librtemscpu_a_SOURCES += posix/src/pspininit.c
-librtemscpu_a_SOURCES += posix/src/pspinlock.c
-librtemscpu_a_SOURCES += posix/src/pspinunlock.c
-librtemscpu_a_SOURCES += posix/src/psxnametoid.c
-librtemscpu_a_SOURCES += posix/src/psxpriorityisvalid.c
-librtemscpu_a_SOURCES += posix/src/psxsemaphore.c
-librtemscpu_a_SOURCES += posix/src/psxsemaphoreconfig.c
-librtemscpu_a_SOURCES += posix/src/psxtimerconfig.c
-librtemscpu_a_SOURCES += posix/src/psxtransschedparam.c
-librtemscpu_a_SOURCES += posix/src/pthreadatfork.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrdefault.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrdestroy.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetaffinitynp.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetdetachstate.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetguardsize.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetinheritsched.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetschedparam.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetschedpolicy.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetscope.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetstackaddr.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetstack.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrgetstacksize.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrinit.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetaffinitynp.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetdetachstate.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetguardsize.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetinheritsched.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetschedparam.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetschedpolicy.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetscope.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetstackaddr.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetstack.c
-librtemscpu_a_SOURCES += posix/src/pthreadattrsetstacksize.c
-librtemscpu_a_SOURCES += posix/src/pthread.c
-librtemscpu_a_SOURCES += posix/src/pthreadconcurrency.c
-librtemscpu_a_SOURCES += posix/src/pthreadconfig.c
-librtemscpu_a_SOURCES += posix/src/pthreadcreate.c
-librtemscpu_a_SOURCES += posix/src/pthreaddetach.c
-librtemscpu_a_SOURCES += posix/src/pthreadequal.c
-librtemscpu_a_SOURCES += posix/src/pthreadexit.c
-librtemscpu_a_SOURCES += posix/src/pthreadgetaffinitynp.c
-librtemscpu_a_SOURCES += posix/src/pthreadgetattrnp.c
-librtemscpu_a_SOURCES += posix/src/pthreadgetcpuclockid.c
-librtemscpu_a_SOURCES += posix/src/pthreadgetnamenp.c
-librtemscpu_a_SOURCES += posix/src/pthreadgetschedparam.c
-librtemscpu_a_SOURCES += posix/src/pthreadinitthreads.c
-librtemscpu_a_SOURCES += posix/src/pthreadjoin.c
-librtemscpu_a_SOURCES += posix/src/pthreadonce.c
-librtemscpu_a_SOURCES += posix/src/pthreadsetaffinitynp.c
-librtemscpu_a_SOURCES += posix/src/pthreadsetnamenp.c
-librtemscpu_a_SOURCES += posix/src/pthreadsetschedparam.c
-librtemscpu_a_SOURCES += posix/src/pthreadsetschedprio.c
-librtemscpu_a_SOURCES += posix/src/rwlockattrdestroy.c
-librtemscpu_a_SOURCES += posix/src/rwlockattrgetpshared.c
-librtemscpu_a_SOURCES += posix/src/rwlockattrinit.c
-librtemscpu_a_SOURCES += posix/src/rwlockattrsetpshared.c
-librtemscpu_a_SOURCES += posix/src/sched_getparam.c
-librtemscpu_a_SOURCES += posix/src/sched_getprioritymax.c
-librtemscpu_a_SOURCES += posix/src/sched_getprioritymin.c
-librtemscpu_a_SOURCES += posix/src/sched_getscheduler.c
-librtemscpu_a_SOURCES += posix/src/sched_rr_get_interval.c
-librtemscpu_a_SOURCES += posix/src/sched_setparam.c
-librtemscpu_a_SOURCES += posix/src/sched_setscheduler.c
-librtemscpu_a_SOURCES += posix/src/sched_yield.c
-librtemscpu_a_SOURCES += posix/src/semaphoredeletesupp.c
-librtemscpu_a_SOURCES += posix/src/semclose.c
-librtemscpu_a_SOURCES += posix/src/semdestroy.c
-librtemscpu_a_SOURCES += posix/src/semgetvalue.c
-librtemscpu_a_SOURCES += posix/src/seminit.c
-librtemscpu_a_SOURCES += posix/src/semopen.c
-librtemscpu_a_SOURCES += posix/src/sempost.c
-librtemscpu_a_SOURCES += posix/src/semtimedwait.c
-librtemscpu_a_SOURCES += posix/src/semtrywait.c
-librtemscpu_a_SOURCES += posix/src/semunlink.c
-librtemscpu_a_SOURCES += posix/src/semwait.c
-librtemscpu_a_SOURCES += posix/src/setcancelstate.c
-librtemscpu_a_SOURCES += posix/src/setcanceltype.c
-librtemscpu_a_SOURCES += posix/src/shm.c
-librtemscpu_a_SOURCES += posix/src/shmconfig.c
-librtemscpu_a_SOURCES += posix/src/shmheap.c
-librtemscpu_a_SOURCES += posix/src/shmopen.c
-librtemscpu_a_SOURCES += posix/src/shmops.c
-librtemscpu_a_SOURCES += posix/src/shmunlink.c
-librtemscpu_a_SOURCES += posix/src/shmwkspace.c
-librtemscpu_a_SOURCES += posix/src/sigaddset.c
-librtemscpu_a_SOURCES += posix/src/sigdelset.c
-librtemscpu_a_SOURCES += posix/src/sigemptyset.c
-librtemscpu_a_SOURCES += posix/src/sigfillset.c
-librtemscpu_a_SOURCES += posix/src/sigismember.c
-librtemscpu_a_SOURCES += posix/src/sigprocmask.c
-librtemscpu_a_SOURCES += posix/src/sysconf.c
-librtemscpu_a_SOURCES += posix/src/testcancel.c
-librtemscpu_a_SOURCES += posix/src/vfork.c
-librtemscpu_a_SOURCES += posix/src/wait.c
-librtemscpu_a_SOURCES += posix/src/waitpid.c
-librtemscpu_a_SOURCES += rtems/src/barrier.c
-librtemscpu_a_SOURCES += rtems/src/barriercreate.c
-librtemscpu_a_SOURCES += rtems/src/barrierdelete.c
-librtemscpu_a_SOURCES += rtems/src/barrierident.c
-librtemscpu_a_SOURCES += rtems/src/barrierrelease.c
-librtemscpu_a_SOURCES += rtems/src/barrierwait.c
-librtemscpu_a_SOURCES += rtems/src/clockgetsecondssinceepoch.c
-librtemscpu_a_SOURCES += rtems/src/clockgettickspersecond.c
-librtemscpu_a_SOURCES += rtems/src/clockgettod.c
-librtemscpu_a_SOURCES += rtems/src/clockgettodtimeval.c
-librtemscpu_a_SOURCES += rtems/src/clockgetuptime.c
-librtemscpu_a_SOURCES += rtems/src/clockgetuptimenanoseconds.c
-librtemscpu_a_SOURCES += rtems/src/clockgetuptimeseconds.c
-librtemscpu_a_SOURCES += rtems/src/clockgetuptimetimeval.c
-librtemscpu_a_SOURCES += rtems/src/clockset.c
-librtemscpu_a_SOURCES += rtems/src/clocktick.c
-librtemscpu_a_SOURCES += rtems/src/clocktodtoseconds.c
-librtemscpu_a_SOURCES += rtems/src/clocktodvalidate.c
-librtemscpu_a_SOURCES += rtems/src/dpmem.c
-librtemscpu_a_SOURCES += rtems/src/dpmemcreate.c
-librtemscpu_a_SOURCES += rtems/src/dpmemdelete.c
-librtemscpu_a_SOURCES += rtems/src/dpmemexternal2internal.c
-librtemscpu_a_SOURCES += rtems/src/dpmemident.c
-librtemscpu_a_SOURCES += rtems/src/dpmeminternal2external.c
-librtemscpu_a_SOURCES += rtems/src/eventreceive.c
-librtemscpu_a_SOURCES += rtems/src/eventseize.c
-librtemscpu_a_SOURCES += rtems/src/eventsend.c
-librtemscpu_a_SOURCES += rtems/src/eventsurrender.c
-librtemscpu_a_SOURCES += rtems/src/getapiconfig.c
-librtemscpu_a_SOURCES += rtems/src/intrbody.c
-librtemscpu_a_SOURCES += rtems/src/intrcatch.c
-librtemscpu_a_SOURCES += rtems/src/modes.c
-librtemscpu_a_SOURCES += rtems/src/msg.c
-librtemscpu_a_SOURCES += rtems/src/msgqbroadcast.c
-librtemscpu_a_SOURCES += rtems/src/msgqconstruct.c
-librtemscpu_a_SOURCES += rtems/src/msgqcreate.c
-librtemscpu_a_SOURCES += rtems/src/msgqdelete.c
-librtemscpu_a_SOURCES += rtems/src/msgqflush.c
-librtemscpu_a_SOURCES += rtems/src/msgqgetnumberpending.c
-librtemscpu_a_SOURCES += rtems/src/msgqident.c
-librtemscpu_a_SOURCES += rtems/src/msgqreceive.c
-librtemscpu_a_SOURCES += rtems/src/msgqsend.c
-librtemscpu_a_SOURCES += rtems/src/msgqurgent.c
-librtemscpu_a_SOURCES += rtems/src/part.c
-librtemscpu_a_SOURCES += rtems/src/partcreate.c
-librtemscpu_a_SOURCES += rtems/src/partdelete.c
-librtemscpu_a_SOURCES += rtems/src/partgetbuffer.c
-librtemscpu_a_SOURCES += rtems/src/partident.c
-librtemscpu_a_SOURCES += rtems/src/partreturnbuffer.c
-librtemscpu_a_SOURCES += rtems/src/ratemon.c
-librtemscpu_a_SOURCES += rtems/src/ratemoncancel.c
-librtemscpu_a_SOURCES += rtems/src/ratemoncreate.c
-librtemscpu_a_SOURCES += rtems/src/ratemondelete.c
-librtemscpu_a_SOURCES += rtems/src/ratemongetstatistics.c
-librtemscpu_a_SOURCES += rtems/src/ratemongetstatus.c
-librtemscpu_a_SOURCES += rtems/src/ratemonident.c
-librtemscpu_a_SOURCES += rtems/src/ratemonperiod.c
-librtemscpu_a_SOURCES += rtems/src/ratemonreportstatistics.c
-librtemscpu_a_SOURCES += rtems/src/ratemonresetall.c
-librtemscpu_a_SOURCES += rtems/src/ratemonresetstatistics.c
-librtemscpu_a_SOURCES += rtems/src/ratemontimeout.c
-librtemscpu_a_SOURCES += rtems/src/region.c
-librtemscpu_a_SOURCES += rtems/src/regioncreate.c
-librtemscpu_a_SOURCES += rtems/src/regiondelete.c
-librtemscpu_a_SOURCES += rtems/src/regionextend.c
-librtemscpu_a_SOURCES += rtems/src/regiongetfreeinfo.c
-librtemscpu_a_SOURCES += rtems/src/regiongetinfo.c
-librtemscpu_a_SOURCES += rtems/src/regiongetsegment.c
-librtemscpu_a_SOURCES += rtems/src/regiongetsegmentsize.c
-librtemscpu_a_SOURCES += rtems/src/regionident.c
-librtemscpu_a_SOURCES += rtems/src/regionprocessqueue.c
-librtemscpu_a_SOURCES += rtems/src/regionresizesegment.c
-librtemscpu_a_SOURCES += rtems/src/regionreturnsegment.c
-librtemscpu_a_SOURCES += rtems/src/rtemsbuildid.c
-librtemscpu_a_SOURCES += rtems/src/rtemsbuildname.c
-librtemscpu_a_SOURCES += rtems/src/rtemsmaxprio.c
-librtemscpu_a_SOURCES += rtems/src/rtemsnametoid.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectapimaximumclass.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectapiminimumclass.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectgetapiclassname.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectgetapiname.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectgetclassicname.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectgetclassinfo.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectgetname.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectidapimaximum.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectidapiminimum.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectidgetapi.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectidgetclass.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectidgetindex.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectidgetnode.c
-librtemscpu_a_SOURCES += rtems/src/rtemsobjectsetname.c
-librtemscpu_a_SOURCES += rtems/src/rtemstimer.c
-librtemscpu_a_SOURCES += rtems/src/scheduleraddprocessor.c
-librtemscpu_a_SOURCES += rtems/src/schedulergetmaxprio.c
-librtemscpu_a_SOURCES += rtems/src/schedulergetprocessorset.c
-librtemscpu_a_SOURCES += rtems/src/scheduleridentbyprocessor.c
-librtemscpu_a_SOURCES += rtems/src/scheduleridentbyprocessorset.c
-librtemscpu_a_SOURCES += rtems/src/schedulerident.c
-librtemscpu_a_SOURCES += rtems/src/schedulermapfromposix.c
-librtemscpu_a_SOURCES += rtems/src/schedulermaptoposix.c
-librtemscpu_a_SOURCES += rtems/src/schedulerremoveprocessor.c
-librtemscpu_a_SOURCES += rtems/src/sem.c
-librtemscpu_a_SOURCES += rtems/src/semcreate.c
-librtemscpu_a_SOURCES += rtems/src/semdelete.c
-librtemscpu_a_SOURCES += rtems/src/semflush.c
-librtemscpu_a_SOURCES += rtems/src/semident.c
-librtemscpu_a_SOURCES += rtems/src/semobtain.c
-librtemscpu_a_SOURCES += rtems/src/semrelease.c
-librtemscpu_a_SOURCES += rtems/src/semsetpriority.c
-librtemscpu_a_SOURCES += rtems/src/signalcatch.c
-librtemscpu_a_SOURCES += rtems/src/signalsend.c
-librtemscpu_a_SOURCES += rtems/src/statustext.c
-librtemscpu_a_SOURCES += rtems/src/statustoerrno.c
-librtemscpu_a_SOURCES += rtems/src/systemeventreceive.c
-librtemscpu_a_SOURCES += rtems/src/systemeventsend.c
-librtemscpu_a_SOURCES += rtems/src/taskconstruct.c
-librtemscpu_a_SOURCES += rtems/src/taskconstructuser.c
-librtemscpu_a_SOURCES += rtems/src/taskcreate.c
-librtemscpu_a_SOURCES += rtems/src/taskdelete.c
-librtemscpu_a_SOURCES += rtems/src/taskexit.c
-librtemscpu_a_SOURCES += rtems/src/taskgetaffinity.c
-librtemscpu_a_SOURCES += rtems/src/taskgetpriority.c
-librtemscpu_a_SOURCES += rtems/src/taskgetscheduler.c
-librtemscpu_a_SOURCES += rtems/src/taskident.c
-librtemscpu_a_SOURCES += rtems/src/taskinitdefault.c
-librtemscpu_a_SOURCES += rtems/src/taskinitusers.c
-librtemscpu_a_SOURCES += rtems/src/taskissuspended.c
-librtemscpu_a_SOURCES += rtems/src/taskiterate.c
-librtemscpu_a_SOURCES += rtems/src/taskmode.c
-librtemscpu_a_SOURCES += rtems/src/taskrestart.c
-librtemscpu_a_SOURCES += rtems/src/taskresume.c
-librtemscpu_a_SOURCES += rtems/src/tasks.c
-librtemscpu_a_SOURCES += rtems/src/tasksetaffinity.c
-librtemscpu_a_SOURCES += rtems/src/tasksetpriority.c
-librtemscpu_a_SOURCES += rtems/src/tasksetscheduler.c
-librtemscpu_a_SOURCES += rtems/src/taskstart.c
-librtemscpu_a_SOURCES += rtems/src/tasksuspend.c
-librtemscpu_a_SOURCES += rtems/src/taskwakeafter.c
-librtemscpu_a_SOURCES += rtems/src/taskwakewhen.c
-librtemscpu_a_SOURCES += rtems/src/timercancel.c
-librtemscpu_a_SOURCES += rtems/src/timercreate.c
-librtemscpu_a_SOURCES += rtems/src/timerdelete.c
-librtemscpu_a_SOURCES += rtems/src/timerfireafter.c
-librtemscpu_a_SOURCES += rtems/src/timerfirewhen.c
-librtemscpu_a_SOURCES += rtems/src/timergetinfo.c
-librtemscpu_a_SOURCES += rtems/src/timerident.c
-librtemscpu_a_SOURCES += rtems/src/timerreset.c
-librtemscpu_a_SOURCES += rtems/src/timerserver.c
-librtemscpu_a_SOURCES += rtems/src/timerserverfireafter.c
-librtemscpu_a_SOURCES += rtems/src/timerserverfirewhen.c
-librtemscpu_a_SOURCES += rtems/src/workspace.c
-librtemscpu_a_SOURCES += rtems/src/workspacegreedy.c
-librtemscpu_a_SOURCES += score/src/allocatormutex.c
-librtemscpu_a_SOURCES += score/src/apimutexisowner.c
-librtemscpu_a_SOURCES += score/src/apimutexlock.c
-librtemscpu_a_SOURCES += score/src/apimutexunlock.c
-librtemscpu_a_SOURCES += score/src/corebarrier.c
-librtemscpu_a_SOURCES += score/src/corebarrierwait.c
-librtemscpu_a_SOURCES += score/src/coremsg.c
-librtemscpu_a_SOURCES += score/src/coremsgbroadcast.c
-librtemscpu_a_SOURCES += score/src/coremsgclose.c
-librtemscpu_a_SOURCES += score/src/coremsgflush.c
-librtemscpu_a_SOURCES += score/src/coremsgflushwait.c
-librtemscpu_a_SOURCES += score/src/coremsginsert.c
-librtemscpu_a_SOURCES += score/src/coremsgseize.c
-librtemscpu_a_SOURCES += score/src/coremsgsubmit.c
-librtemscpu_a_SOURCES += score/src/coremsgwkspace.c
-librtemscpu_a_SOURCES += score/src/coremutexseize.c
-librtemscpu_a_SOURCES += score/src/percpu.c
-librtemscpu_a_SOURCES += score/src/percpuasm.c
-librtemscpu_a_SOURCES += score/src/percpudata.c
-librtemscpu_a_SOURCES += score/src/corerwlock.c
-librtemscpu_a_SOURCES += score/src/corerwlockobtainread.c
-librtemscpu_a_SOURCES += score/src/corerwlockobtainwrite.c
-librtemscpu_a_SOURCES += score/src/corerwlockrelease.c
-librtemscpu_a_SOURCES += score/src/coresem.c
-librtemscpu_a_SOURCES += score/src/hash.c
-librtemscpu_a_SOURCES += score/src/heap.c
-librtemscpu_a_SOURCES += score/src/heapallocate.c
-librtemscpu_a_SOURCES += score/src/heapextend.c
-librtemscpu_a_SOURCES += score/src/heapfree.c
-librtemscpu_a_SOURCES += score/src/heapsizeofuserarea.c
-librtemscpu_a_SOURCES += score/src/heapwalk.c
-librtemscpu_a_SOURCES += score/src/heapgetinfo.c
-librtemscpu_a_SOURCES += score/src/heapgetfreeinfo.c
-librtemscpu_a_SOURCES += score/src/heapresizeblock.c
-librtemscpu_a_SOURCES += score/src/heapiterate.c
-librtemscpu_a_SOURCES += score/src/heapgreedy.c
-librtemscpu_a_SOURCES += score/src/heapnoextend.c
-librtemscpu_a_SOURCES += score/src/memoryallocate.c
-librtemscpu_a_SOURCES += score/src/memorydirtyfreeareas.c
-librtemscpu_a_SOURCES += score/src/memoryfill.c
-librtemscpu_a_SOURCES += score/src/memoryzerobeforeuse.c
-librtemscpu_a_SOURCES += score/src/memoryzerofreeareas.c
-librtemscpu_a_SOURCES += score/src/objectallocate.c
-librtemscpu_a_SOURCES += score/src/objectallocatenone.c
-librtemscpu_a_SOURCES += score/src/objectallocatestatic.c
-librtemscpu_a_SOURCES += score/src/objectallocateunlimited.c
-librtemscpu_a_SOURCES += score/src/objectclose.c
-librtemscpu_a_SOURCES += score/src/objectextendinformation.c
-librtemscpu_a_SOURCES += score/src/objectfree.c
-librtemscpu_a_SOURCES += score/src/objectfreenothing.c
-librtemscpu_a_SOURCES += score/src/objectfreestatic.c
-librtemscpu_a_SOURCES += score/src/objectgetnext.c
-librtemscpu_a_SOURCES += score/src/objectinitializeinformation.c
-librtemscpu_a_SOURCES += score/src/objectnametoid.c
-librtemscpu_a_SOURCES += score/src/objectnametoidstring.c
-librtemscpu_a_SOURCES += score/src/objectshrinkinformation.c
-librtemscpu_a_SOURCES += score/src/objectgetnoprotection.c
-librtemscpu_a_SOURCES += score/src/objectidtoname.c
-librtemscpu_a_SOURCES += score/src/objectgetnameasstring.c
-librtemscpu_a_SOURCES += score/src/objectsetname.c
-librtemscpu_a_SOURCES += score/src/objectgetinfo.c
-librtemscpu_a_SOURCES += score/src/objectgetinfoid.c
-librtemscpu_a_SOURCES += score/src/objectapimaximumclass.c
-librtemscpu_a_SOURCES += score/src/objectnamespaceremove.c
-librtemscpu_a_SOURCES += score/src/objectactivecount.c
-librtemscpu_a_SOURCES += score/src/objectgetlocal.c
-librtemscpu_a_SOURCES += score/src/log2table.c
-librtemscpu_a_SOURCES += score/src/scheduler.c
-librtemscpu_a_SOURCES += score/src/schedulergetaffinity.c
-librtemscpu_a_SOURCES += score/src/schedulersetaffinity.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaultmappriority.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaultnodedestroy.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaultnodeinit.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaultreleasejob.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaultschedule.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaultstartidle.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaulttick.c
-librtemscpu_a_SOURCES += score/src/schedulerpriority.c
-librtemscpu_a_SOURCES += score/src/schedulerpriorityblock.c
-librtemscpu_a_SOURCES += score/src/schedulerprioritychangepriority.c
-librtemscpu_a_SOURCES += score/src/schedulerpriorityschedule.c
-librtemscpu_a_SOURCES += score/src/schedulerpriorityunblock.c
-librtemscpu_a_SOURCES += score/src/schedulerpriorityyield.c
-librtemscpu_a_SOURCES += score/src/schedulersimple.c
-librtemscpu_a_SOURCES += score/src/schedulersimpleblock.c
-librtemscpu_a_SOURCES += score/src/schedulersimplechangepriority.c
-librtemscpu_a_SOURCES += score/src/schedulersimpleschedule.c
-librtemscpu_a_SOURCES += score/src/schedulersimpleunblock.c
-librtemscpu_a_SOURCES += score/src/schedulersimpleyield.c
-librtemscpu_a_SOURCES += score/src/scheduleredf.c
-librtemscpu_a_SOURCES += score/src/scheduleredfnodeinit.c
-librtemscpu_a_SOURCES += score/src/scheduleredfblock.c
-librtemscpu_a_SOURCES += score/src/scheduleredfchangepriority.c
-librtemscpu_a_SOURCES += score/src/scheduleredfreleasejob.c
-librtemscpu_a_SOURCES += score/src/scheduleredfschedule.c
-librtemscpu_a_SOURCES += score/src/scheduleredfunblock.c
-librtemscpu_a_SOURCES += score/src/scheduleredfyield.c
-librtemscpu_a_SOURCES += score/src/schedulercbs.c
-librtemscpu_a_SOURCES += score/src/schedulercbsnodeinit.c
-librtemscpu_a_SOURCES += score/src/schedulercbsattachthread.c
-librtemscpu_a_SOURCES += score/src/schedulercbscleanup.c
-librtemscpu_a_SOURCES += score/src/schedulercbscreateserver.c
-librtemscpu_a_SOURCES += score/src/schedulercbsdestroyserver.c
-librtemscpu_a_SOURCES += score/src/schedulercbsdetachthread.c
-librtemscpu_a_SOURCES += score/src/schedulercbsgetapprovedbudget.c
-librtemscpu_a_SOURCES += score/src/schedulercbsgetexecutiontime.c
-librtemscpu_a_SOURCES += score/src/schedulercbsgetparameters.c
-librtemscpu_a_SOURCES += score/src/schedulercbsgetremainingbudget.c
-librtemscpu_a_SOURCES += score/src/schedulercbsgetserverid.c
-librtemscpu_a_SOURCES += score/src/schedulercbssetparameters.c
-librtemscpu_a_SOURCES += score/src/schedulercbsreleasejob.c
-librtemscpu_a_SOURCES += score/src/schedulercbsunblock.c
-librtemscpu_a_SOURCES += score/src/stackallocator.c
-librtemscpu_a_SOURCES += score/src/stackallocatorfree.c
-librtemscpu_a_SOURCES += score/src/stackallocatorinit.c
-librtemscpu_a_SOURCES += score/src/pheapallocate.c
-librtemscpu_a_SOURCES += score/src/pheapextend.c
-librtemscpu_a_SOURCES += score/src/pheapfree.c
-librtemscpu_a_SOURCES += score/src/pheapgetsize.c
-librtemscpu_a_SOURCES += score/src/pheapgetblocksize.c
-librtemscpu_a_SOURCES += score/src/pheapgetfreeinfo.c
-librtemscpu_a_SOURCES += score/src/pheapgetinfo.c
-librtemscpu_a_SOURCES += score/src/pheapresizeblock.c
-librtemscpu_a_SOURCES += score/src/pheapwalk.c
-librtemscpu_a_SOURCES += score/src/pheapiterate.c
-librtemscpu_a_SOURCES += score/src/freechain.c
-librtemscpu_a_SOURCES += score/src/rbtreeextract.c
-librtemscpu_a_SOURCES += score/src/rbtreeinsert.c
-librtemscpu_a_SOURCES += score/src/rbtreeiterate.c
-librtemscpu_a_SOURCES += score/src/rbtreenext.c
-librtemscpu_a_SOURCES += score/src/rbtreepostorder.c
-librtemscpu_a_SOURCES += score/src/rbtreereplace.c
-librtemscpu_a_SOURCES += score/src/threadallocateunlimited.c
-librtemscpu_a_SOURCES += score/src/thread.c
-librtemscpu_a_SOURCES += score/src/threadchangepriority.c
-librtemscpu_a_SOURCES += score/src/threadclearstate.c
-librtemscpu_a_SOURCES += score/src/threadcreateidle.c
-librtemscpu_a_SOURCES += score/src/threaddispatch.c
-librtemscpu_a_SOURCES += score/src/threadget.c
-librtemscpu_a_SOURCES += score/src/threadhandler.c
-librtemscpu_a_SOURCES += score/src/threadinitialize.c
-librtemscpu_a_SOURCES += score/src/threadidledefault.c
-librtemscpu_a_SOURCES += score/src/threadloadenv.c
-librtemscpu_a_SOURCES += score/src/threadrestart.c
-librtemscpu_a_SOURCES += score/src/threadselfid.c
-librtemscpu_a_SOURCES += score/src/threadsetstate.c
-librtemscpu_a_SOURCES += score/src/threadstackallocate.c
-librtemscpu_a_SOURCES += score/src/threadstackfree.c
-librtemscpu_a_SOURCES += score/src/threadstart.c
-librtemscpu_a_SOURCES += score/src/threadstartmultitasking.c
-librtemscpu_a_SOURCES += score/src/iterateoverthreads.c
-librtemscpu_a_SOURCES += score/src/threadentryadaptoridle.c
-librtemscpu_a_SOURCES += score/src/threadentryadaptornumeric.c
-librtemscpu_a_SOURCES += score/src/threadentryadaptorpointer.c
-librtemscpu_a_SOURCES += score/src/threadgetcputimeused.c
-librtemscpu_a_SOURCES += score/src/threaditerate.c
-librtemscpu_a_SOURCES += score/src/threadname.c
-librtemscpu_a_SOURCES += score/src/threadscheduler.c
-librtemscpu_a_SOURCES += score/src/threadtimeout.c
-librtemscpu_a_SOURCES += score/src/threadwaitgetid.c
-librtemscpu_a_SOURCES += score/src/threadyield.c
-librtemscpu_a_SOURCES += score/src/threadq.c
-librtemscpu_a_SOURCES += score/src/threadqenqueue.c
-librtemscpu_a_SOURCES += score/src/threadqextractwithproxy.c
-librtemscpu_a_SOURCES += score/src/threadqfirst.c
-librtemscpu_a_SOURCES += score/src/threadqflush.c
-librtemscpu_a_SOURCES += score/src/threadqgetnameandid.c
-librtemscpu_a_SOURCES += score/src/threadqops.c
-librtemscpu_a_SOURCES += score/src/threadqtimeout.c
-librtemscpu_a_SOURCES += score/src/timespecaddto.c
-librtemscpu_a_SOURCES += score/src/timespecfromticks.c
-librtemscpu_a_SOURCES += score/src/timespecisvalid.c
-librtemscpu_a_SOURCES += score/src/timespeclessthan.c
-librtemscpu_a_SOURCES += score/src/timespecsubtract.c
-librtemscpu_a_SOURCES += score/src/timespectoticks.c
-librtemscpu_a_SOURCES += score/src/timespecdivide.c
-librtemscpu_a_SOURCES += score/src/timespecisnonnegative.c
-librtemscpu_a_SOURCES += score/src/timespecdividebyinteger.c
-librtemscpu_a_SOURCES += score/src/timespecgetasnanoseconds.c
-librtemscpu_a_SOURCES += score/src/coretod.c
-librtemscpu_a_SOURCES += score/src/coretodset.c
-librtemscpu_a_SOURCES += score/src/coretodtickspersec.c
-librtemscpu_a_SOURCES += score/src/coretodadjust.c
-librtemscpu_a_SOURCES += score/src/watchdoginsert.c
-librtemscpu_a_SOURCES += score/src/coretodhookdata.c
-librtemscpu_a_SOURCES += score/src/coretodhookregister.c
-librtemscpu_a_SOURCES += score/src/coretodhookrun.c
-librtemscpu_a_SOURCES += score/src/coretodhookunregister.c
-librtemscpu_a_SOURCES += score/src/watchdogremove.c
-librtemscpu_a_SOURCES += score/src/watchdogtick.c
-librtemscpu_a_SOURCES += score/src/watchdogtickssinceboot.c
-librtemscpu_a_SOURCES += score/src/watchdogtimeslicedefault.c
-librtemscpu_a_SOURCES += score/src/userextaddset.c
-librtemscpu_a_SOURCES += score/src/userext.c
-librtemscpu_a_SOURCES += score/src/userextremoveset.c
-librtemscpu_a_SOURCES += score/src/userextiterate.c
-librtemscpu_a_SOURCES += score/src/chain.c
-librtemscpu_a_SOURCES += score/src/chainnodecount.c
-librtemscpu_a_SOURCES += score/src/debugisthreaddispatchingallowed.c
-librtemscpu_a_SOURCES += score/src/interr.c
-librtemscpu_a_SOURCES += score/src/isr.c
-librtemscpu_a_SOURCES += score/src/isrvectortable.c
-librtemscpu_a_SOURCES += score/src/wkspace.c
-librtemscpu_a_SOURCES += score/src/wkspaceisunifieddefault.c
-librtemscpu_a_SOURCES += score/src/wkspacemallocinitdefault.c
-librtemscpu_a_SOURCES += score/src/wkspacemallocinitunified.c
-librtemscpu_a_SOURCES += score/src/wkstringduplicate.c
-librtemscpu_a_SOURCES += score/src/iobase64.c
-librtemscpu_a_SOURCES += score/src/ioprintf.c
-librtemscpu_a_SOURCES += score/src/iovprintf.c
-librtemscpu_a_SOURCES += score/src/isrisinprogress.c
-librtemscpu_a_SOURCES += score/src/condition.c
-librtemscpu_a_SOURCES += score/src/configstackspacesize.c
-librtemscpu_a_SOURCES += score/src/futex.c
-librtemscpu_a_SOURCES += score/src/profilingisrentryexit.c
-librtemscpu_a_SOURCES += score/src/mutex.c
-librtemscpu_a_SOURCES += score/src/once.c
-librtemscpu_a_SOURCES += score/src/sched.c
-librtemscpu_a_SOURCES += score/src/semaphore.c
-librtemscpu_a_SOURCES += score/src/smpbarrierwait.c
-librtemscpu_a_SOURCES += score/src/kern_tc.c
-librtemscpu_a_SOURCES += score/src/libatomic.c
-librtemscpu_a_SOURCES += score/src/processormaskcopy.c
-librtemscpu_a_SOURCES += score/src/tlsallocsize.c
-librtemscpu_a_SOURCES += sapi/src/chainappendnotify.c
-librtemscpu_a_SOURCES += sapi/src/chaingetnotify.c
-librtemscpu_a_SOURCES += sapi/src/chaingetwait.c
-librtemscpu_a_SOURCES += sapi/src/chainprependnotify.c
-librtemscpu_a_SOURCES += sapi/src/chainprotected.c
-librtemscpu_a_SOURCES += sapi/src/cpucounterconverter.c
-librtemscpu_a_SOURCES += sapi/src/delaynano.c
-librtemscpu_a_SOURCES += sapi/src/delayticks.c
-librtemscpu_a_SOURCES += sapi/src/exinit.c
-librtemscpu_a_SOURCES += sapi/src/exshutdown.c
-librtemscpu_a_SOURCES += sapi/src/extension.c
-librtemscpu_a_SOURCES += sapi/src/extensioncreate.c
-librtemscpu_a_SOURCES += sapi/src/extensiondelete.c
-librtemscpu_a_SOURCES += sapi/src/extensionident.c
-librtemscpu_a_SOURCES += sapi/src/fatal.c
-librtemscpu_a_SOURCES += sapi/src/fatalsrctext.c
-librtemscpu_a_SOURCES += sapi/src/getbuildlabel.c
-librtemscpu_a_SOURCES += sapi/src/getconfigmax.c
-librtemscpu_a_SOURCES += sapi/src/getcopyrightnotice.c
-librtemscpu_a_SOURCES += sapi/src/getversionstring.c
-librtemscpu_a_SOURCES += sapi/src/interrtext.c
-librtemscpu_a_SOURCES += sapi/src/io.c
-librtemscpu_a_SOURCES += sapi/src/iodefault.c
-librtemscpu_a_SOURCES += sapi/src/ioclose.c
-librtemscpu_a_SOURCES += sapi/src/iocontrol.c
-librtemscpu_a_SOURCES += sapi/src/ioinitialize.c
-librtemscpu_a_SOURCES += sapi/src/ioopen.c
-librtemscpu_a_SOURCES += sapi/src/ioread.c
-librtemscpu_a_SOURCES += sapi/src/ioregisterdriver.c
-librtemscpu_a_SOURCES += sapi/src/iounregisterdriver.c
-librtemscpu_a_SOURCES += sapi/src/iowrite.c
-librtemscpu_a_SOURCES += sapi/src/panic.c
-librtemscpu_a_SOURCES += sapi/src/profilingiterate.c
-librtemscpu_a_SOURCES += sapi/src/profilingreportxml.c
-librtemscpu_a_SOURCES += sapi/src/rbheap.c
-librtemscpu_a_SOURCES += sapi/src/rbtree.c
-librtemscpu_a_SOURCES += sapi/src/rbtreefind.c
-librtemscpu_a_SOURCES += sapi/src/sapirbtreeinsert.c
-librtemscpu_a_SOURCES += sapi/src/sysinitverbose.c
-librtemscpu_a_SOURCES += sapi/src/tcsimpleinstall.c
-librtemscpu_a_SOURCES += sapi/src/version.c
-
-if HAS_MP
-
-librtemscpu_a_SOURCES += libmisc/monitor/mon-mpci.c
-librtemscpu_a_SOURCES += rtems/src/eventmp.c
-librtemscpu_a_SOURCES += rtems/src/mp.c
-librtemscpu_a_SOURCES += rtems/src/msgmp.c
-librtemscpu_a_SOURCES += rtems/src/partmp.c
-librtemscpu_a_SOURCES += rtems/src/semmp.c
-librtemscpu_a_SOURCES += rtems/src/signalmp.c
-librtemscpu_a_SOURCES += rtems/src/taskmp.c
-librtemscpu_a_SOURCES += score/src/mpci.c
-librtemscpu_a_SOURCES += score/src/mpcidefault.c
-librtemscpu_a_SOURCES += score/src/objectmp.c
-librtemscpu_a_SOURCES += score/src/threadmp.c
-
-endif
-
-if HAS_PTHREADS
-
-librtemscpu_a_SOURCES += posix/src/aio_cancel.c
-librtemscpu_a_SOURCES += posix/src/aio_error.c
-librtemscpu_a_SOURCES += posix/src/aio_fsync.c
-librtemscpu_a_SOURCES += posix/src/aio_misc.c
-librtemscpu_a_SOURCES += posix/src/aio_read.c
-librtemscpu_a_SOURCES += posix/src/aio_return.c
-librtemscpu_a_SOURCES += posix/src/aio_write.c
-librtemscpu_a_SOURCES += posix/src/alarm.c
-librtemscpu_a_SOURCES += posix/src/getitimer.c
-librtemscpu_a_SOURCES += posix/src/kill.c
-librtemscpu_a_SOURCES += posix/src/killinfo.c
-librtemscpu_a_SOURCES += posix/src/kill_r.c
-librtemscpu_a_SOURCES += posix/src/mqueuenotify.c
-librtemscpu_a_SOURCES += posix/src/pause.c
-librtemscpu_a_SOURCES += posix/src/psignal.c
-librtemscpu_a_SOURCES += posix/src/psignalclearprocesssignals.c
-librtemscpu_a_SOURCES += posix/src/psignalclearsignals.c
-librtemscpu_a_SOURCES += posix/src/psignalsetprocesssignals.c
-librtemscpu_a_SOURCES += posix/src/psignalunblockthread.c
-librtemscpu_a_SOURCES += posix/src/psxpriorityisvalid.c
-librtemscpu_a_SOURCES += posix/src/psxtimercreate.c
-librtemscpu_a_SOURCES += posix/src/psxtimerdelete.c
-librtemscpu_a_SOURCES += posix/src/pthreadkill.c
-librtemscpu_a_SOURCES += posix/src/pthreadsigmask.c
-librtemscpu_a_SOURCES += posix/src/ptimer.c
-librtemscpu_a_SOURCES += posix/src/setitimer.c
-librtemscpu_a_SOURCES += posix/src/sigaction.c
-librtemscpu_a_SOURCES += posix/src/signal_2.c
-librtemscpu_a_SOURCES += posix/src/sigpending.c
-librtemscpu_a_SOURCES += posix/src/sigqueue.c
-librtemscpu_a_SOURCES += posix/src/sigsuspend.c
-librtemscpu_a_SOURCES += posix/src/sigtimedwait.c
-librtemscpu_a_SOURCES += posix/src/sigwait.c
-librtemscpu_a_SOURCES += posix/src/sigwaitinfo.c
-librtemscpu_a_SOURCES += posix/src/timergetoverrun.c
-librtemscpu_a_SOURCES += posix/src/timergettime.c
-librtemscpu_a_SOURCES += posix/src/timersettime.c
-librtemscpu_a_SOURCES += posix/src/ualarm.c
-
-endif
-
-if HAS_SMP
-
-librtemscpu_a_SOURCES += score/src/percpujobs.c
-librtemscpu_a_SOURCES += score/src/percpustatewait.c
-librtemscpu_a_SOURCES += score/src/profilingsmplock.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaultpinunpin.c
-librtemscpu_a_SOURCES += score/src/scheduleredfsmp.c
-librtemscpu_a_SOURCES += score/src/schedulerpriorityaffinitysmp.c
-librtemscpu_a_SOURCES += score/src/schedulerprioritysmp.c
-librtemscpu_a_SOURCES += score/src/schedulersimplesmp.c
-librtemscpu_a_SOURCES += score/src/schedulerstrongapa.c
-librtemscpu_a_SOURCES += score/src/smp.c
-librtemscpu_a_SOURCES += score/src/smpbroadcastaction.c
-librtemscpu_a_SOURCES += score/src/smplock.c
-librtemscpu_a_SOURCES += score/src/smpmulticastaction.c
-librtemscpu_a_SOURCES += score/src/smpothercastaction.c
-librtemscpu_a_SOURCES += score/src/smpsychronize.c
-librtemscpu_a_SOURCES += score/src/smpunicastaction.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaultaskforhelp.c
-librtemscpu_a_SOURCES += score/src/schedulerdefaultsetaffinity.c
-librtemscpu_a_SOURCES += score/src/schedulersmp.c
-librtemscpu_a_SOURCES += score/src/schedulersmpstartidle.c
-librtemscpu_a_SOURCES += score/src/threadunpin.c
-
-endif
-
-if LIBDL
-
-librtemscpu_a_SOURCES += libdl/dlfcn.c
-librtemscpu_a_SOURCES += libdl/dlfcn-shell.c
-librtemscpu_a_SOURCES += libdl/fastlz.c
-librtemscpu_a_SOURCES += libdl/rap.c
-librtemscpu_a_SOURCES += libdl/rap-shell.c
-librtemscpu_a_SOURCES += libdl/rtl-allocator.c
-librtemscpu_a_SOURCES += libdl/rtl-alloc-heap.c
-librtemscpu_a_SOURCES += libdl/rtl-archive.c
-librtemscpu_a_SOURCES += libdl/rtl-bit-alloc.c
-librtemscpu_a_SOURCES += libdl/rtl.c
-librtemscpu_a_SOURCES += libdl/rtl-chain-iterator.c
-librtemscpu_a_SOURCES += libdl/rtl-debugger.c
-librtemscpu_a_SOURCES += libdl/rtl-elf.c
-librtemscpu_a_SOURCES += libdl/rtl-error.c
-librtemscpu_a_SOURCES += libdl/rtl-find-file.c
-librtemscpu_a_SOURCES += libdl/rtl-mdreloc-@RTEMS_CPU@.c
-librtemscpu_a_SOURCES += libdl/rtl-obj.c
-librtemscpu_a_SOURCES += libdl/rtl-obj-cache.c
-librtemscpu_a_SOURCES += libdl/rtl-obj-comp.c
-librtemscpu_a_SOURCES += libdl/rtl-rap.c
-librtemscpu_a_SOURCES += libdl/rtl-shell.c
-librtemscpu_a_SOURCES += libdl/rtl-string.c
-librtemscpu_a_SOURCES += libdl/rtl-sym.c
-librtemscpu_a_SOURCES += libdl/rtl-trace.c
-librtemscpu_a_SOURCES += libdl/rtl-unresolved.c
-librtemscpu_a_SOURCES += libdl/rtl-unwind-dw2.c
-
-endif
-
-if LIBDRVMGR
-
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_by_id.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_by_name.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_dev_by_name.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_drvinf.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_for_each_dev.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_for_each_list_dev.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_func.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_func_call.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_init.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_list.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_lock.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_print.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_res.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_rw.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_translate.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_translate_check.c
-librtemscpu_a_SOURCES += libdrvmgr/drvmgr_unregister.c
-
-endif
-
-if LIBGNAT
-
-librtemscpu_a_SOURCES += libgnat/ada_intrsupp.c
-librtemscpu_a_SOURCES += libgnat/adasupp.c
-
-endif
-
-if LIBPCI
-
-librtemscpu_a_SOURCES += libpci/pci_access.c
-librtemscpu_a_SOURCES += libpci/pci_access_func.c
-librtemscpu_a_SOURCES += libpci/pci_access_io.c
-librtemscpu_a_SOURCES += libpci/pci_access_mem_be.c
-librtemscpu_a_SOURCES += libpci/pci_access_mem.c
-librtemscpu_a_SOURCES += libpci/pci_access_mem_le.c
-librtemscpu_a_SOURCES += libpci/pci_bus.c
-librtemscpu_a_SOURCES += libpci/pci_cfg_auto.c
-librtemscpu_a_SOURCES += libpci/pci_cfg.c
-librtemscpu_a_SOURCES += libpci/pci_cfg_peripheral.c
-librtemscpu_a_SOURCES += libpci/pci_cfg_print_code.c
-librtemscpu_a_SOURCES += libpci/pci_cfg_read.c
-librtemscpu_a_SOURCES += libpci/pci_cfg_static.c
-librtemscpu_a_SOURCES += libpci/pci_find.c
-librtemscpu_a_SOURCES += libpci/pci_find_dev.c
-librtemscpu_a_SOURCES += libpci/pci_for_each.c
-librtemscpu_a_SOURCES += libpci/pci_for_each_child.c
-librtemscpu_a_SOURCES += libpci/pci_for_each_dev.c
-librtemscpu_a_SOURCES += libpci/pci_get_dev.c
-librtemscpu_a_SOURCES += libpci/pci_irq.c
-librtemscpu_a_SOURCES += libpci/pci_print.c
-
-endif
-
-if LIBSHELL
-
-librtemscpu_a_SOURCES += libmisc/shell/cat_file.c
-librtemscpu_a_SOURCES += libmisc/shell/cmds.c
-librtemscpu_a_SOURCES += libmisc/shell/main_alias.c
-librtemscpu_a_SOURCES += libmisc/shell/main_cat.c
-librtemscpu_a_SOURCES += libmisc/shell/main_cd.c
-librtemscpu_a_SOURCES += libmisc/shell/cmp-ls.c
-librtemscpu_a_SOURCES += libmisc/shell/main_chdir.c
-librtemscpu_a_SOURCES += libmisc/shell/main_chmod.c
-librtemscpu_a_SOURCES += libmisc/shell/main_chroot.c
-librtemscpu_a_SOURCES += libmisc/shell/main_cp.c
-librtemscpu_a_SOURCES += libmisc/shell/main_cpuuse.c
-librtemscpu_a_SOURCES += libmisc/shell/main_date.c
-librtemscpu_a_SOURCES += libmisc/shell/main_dir.c
-librtemscpu_a_SOURCES += libmisc/shell/main_echo.c
-librtemscpu_a_SOURCES += libmisc/shell/main_exit.c
-librtemscpu_a_SOURCES += libmisc/shell/main_halt.c
-librtemscpu_a_SOURCES += libmisc/shell/main_help.c
-librtemscpu_a_SOURCES += libmisc/shell/main_id.c
-librtemscpu_a_SOURCES += libmisc/shell/main_logoff.c
-librtemscpu_a_SOURCES += libmisc/shell/main_ln.c
-librtemscpu_a_SOURCES += libmisc/shell/main_ls.c
-librtemscpu_a_SOURCES += libmisc/shell/main_mallocinfo.c
-librtemscpu_a_SOURCES += libmisc/shell/main_md5.c
-librtemscpu_a_SOURCES += libmisc/shell/main_mdump.c
-librtemscpu_a_SOURCES += libmisc/shell/main_medit.c
-librtemscpu_a_SOURCES += libmisc/shell/main_mfill.c
-librtemscpu_a_SOURCES += libmisc/shell/main_mkdir.c
-librtemscpu_a_SOURCES += libmisc/shell/main_mount.c
-librtemscpu_a_SOURCES += libmisc/shell/main_mmove.c
-librtemscpu_a_SOURCES += libmisc/shell/main_msdosfmt.c
-librtemscpu_a_SOURCES += libmisc/shell/main_mv.c
-librtemscpu_a_SOURCES += libmisc/shell/main_perioduse.c
-librtemscpu_a_SOURCES += libmisc/shell/main_top.c
-librtemscpu_a_SOURCES += libmisc/shell/main_pwd.c
-librtemscpu_a_SOURCES += libmisc/shell/main_rm.c
-librtemscpu_a_SOURCES += libmisc/shell/main_rmdir.c
-librtemscpu_a_SOURCES += libmisc/shell/main_sleep.c
-librtemscpu_a_SOURCES += libmisc/shell/main_stackuse.c
-librtemscpu_a_SOURCES += libmisc/shell/main_tty.c
-librtemscpu_a_SOURCES += libmisc/shell/main_umask.c
-librtemscpu_a_SOURCES += libmisc/shell/main_unmount.c
-librtemscpu_a_SOURCES += libmisc/shell/main_blksync.c
-librtemscpu_a_SOURCES += libmisc/shell/main_whoami.c
-librtemscpu_a_SOURCES += libmisc/shell/shell.c
-librtemscpu_a_SOURCES += libmisc/shell/shell_cmdset.c
-librtemscpu_a_SOURCES += libmisc/shell/shell_getchar.c
-librtemscpu_a_SOURCES += libmisc/shell/shell_getprompt.c
-librtemscpu_a_SOURCES += libmisc/shell/shellconfig.c
-librtemscpu_a_SOURCES += libmisc/shell/shell_makeargs.c
-librtemscpu_a_SOURCES += libmisc/shell/filemode.c
-librtemscpu_a_SOURCES += libmisc/shell/pwcache.c
-librtemscpu_a_SOURCES += libmisc/shell/print-ls.c
-librtemscpu_a_SOURCES += libmisc/shell/write_file.c
-librtemscpu_a_SOURCES += libmisc/shell/utils-cp.c
-librtemscpu_a_SOURCES += libmisc/shell/utils-ls.c
-librtemscpu_a_SOURCES += libmisc/shell/err.c
-librtemscpu_a_SOURCES += libmisc/shell/errx.c
-librtemscpu_a_SOURCES += libmisc/shell/verr.c
-librtemscpu_a_SOURCES += libmisc/shell/vis.c
-librtemscpu_a_SOURCES += libmisc/shell/verrx.c
-librtemscpu_a_SOURCES += libmisc/shell/vwarn.c
-librtemscpu_a_SOURCES += libmisc/shell/vwarnx.c
-librtemscpu_a_SOURCES += libmisc/shell/warn.c
-librtemscpu_a_SOURCES += libmisc/shell/warnx.c
-librtemscpu_a_SOURCES += libmisc/shell/fts.c
-librtemscpu_a_SOURCES += libmisc/shell/print_heapinfo.c
-librtemscpu_a_SOURCES += libmisc/shell/main_wkspaceinfo.c
-librtemscpu_a_SOURCES += libmisc/shell/shell_script.c
-librtemscpu_a_SOURCES += libmisc/shell/login_prompt.c
-librtemscpu_a_SOURCES += libmisc/shell/login_check.c
-librtemscpu_a_SOURCES += libmisc/shell/fdisk.c
-librtemscpu_a_SOURCES += libmisc/shell/main_rtc.c
-librtemscpu_a_SOURCES += libmisc/shell/main_spi.c
-librtemscpu_a_SOURCES += libmisc/shell/main_i2cdetect.c
-librtemscpu_a_SOURCES += libmisc/shell/main_i2cset.c
-librtemscpu_a_SOURCES += libmisc/shell/main_i2cget.c
-librtemscpu_a_SOURCES += libmisc/shell/dd-args.c
-librtemscpu_a_SOURCES += libmisc/shell/main_dd.c
-librtemscpu_a_SOURCES += libmisc/shell/dd-conv.c
-librtemscpu_a_SOURCES += libmisc/shell/dd-conv_tab.c
-librtemscpu_a_SOURCES += libmisc/shell/dd-misc.c
-librtemscpu_a_SOURCES += libmisc/shell/dd-position.c
-librtemscpu_a_SOURCES += libmisc/shell/main_hexdump.c
-librtemscpu_a_SOURCES += libmisc/shell/hexdump-conv.c
-librtemscpu_a_SOURCES += libmisc/shell/hexdump-display.c
-librtemscpu_a_SOURCES += libmisc/shell/hexdump-odsyntax.c
-librtemscpu_a_SOURCES += libmisc/shell/hexdump-parse.c
-librtemscpu_a_SOURCES += libmisc/shell/hexsyntax.c
-librtemscpu_a_SOURCES += libmisc/shell/main_time.c
-librtemscpu_a_SOURCES += libmisc/shell/main_mknod.c
-librtemscpu_a_SOURCES += libmisc/shell/main_setenv.c
-librtemscpu_a_SOURCES += libmisc/shell/main_getenv.c
-librtemscpu_a_SOURCES += libmisc/shell/main_unsetenv.c
-librtemscpu_a_SOURCES += libmisc/shell/main_mkrfs.c
-librtemscpu_a_SOURCES += libmisc/shell/main_debugrfs.c
-librtemscpu_a_SOURCES += libmisc/shell/main_df.c
-librtemscpu_a_SOURCES += libmisc/shell/main_lsof.c
-librtemscpu_a_SOURCES += libmisc/shell/main_edit.c
-librtemscpu_a_SOURCES += libmisc/shell/main_blkstats.c
-librtemscpu_a_SOURCES += libmisc/shell/main_rtrace.c
-librtemscpu_a_SOURCES += libmisc/shell/shell-wait-for-input.c
-librtemscpu_a_SOURCES += libmisc/shell/main_cmdls.c
-librtemscpu_a_SOURCES += libmisc/shell/main_cmdchown.c
-librtemscpu_a_SOURCES += libmisc/shell/main_cmdchmod.c
-librtemscpu_a_SOURCES += libmisc/shell/main_cpuinfo.c
-librtemscpu_a_SOURCES += libmisc/shell/main_profreport.c
-
-if LIBDRVMGR
-
-librtemscpu_a_SOURCES += libmisc/shell/main_drvmgr.c
-
-endif
-
-if LIBPCI
-
-librtemscpu_a_SOURCES += libmisc/shell/main_pci.c
-
-endif
-
-endif
-
-if LIBUTF8PROC
-
-librtemscpu_a_SOURCES += libmisc/utf8proc/utf8proc.c
-
-endif
-
-if CPU_ARM
-
-include $(srcdir)/score/cpu/arm/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/arm/__aeabi_read_tp.c
-librtemscpu_a_SOURCES += score/cpu/arm/arm-context-validate.S
-librtemscpu_a_SOURCES += score/cpu/arm/arm-context-volatile-clobber.S
-librtemscpu_a_SOURCES += score/cpu/arm/arm_exc_abort.S
-librtemscpu_a_SOURCES += score/cpu/arm/arm-exception-default.c
-librtemscpu_a_SOURCES += score/cpu/arm/arm-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/arm/arm_exc_interrupt.S
-librtemscpu_a_SOURCES += score/cpu/arm/armv4-exception-default.S
-librtemscpu_a_SOURCES += score/cpu/arm/armv4-sync-synchronize.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-context-initialize.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-context-restore.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-context-switch.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-exception-default.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-exception-handler-get.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-exception-handler-set.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-exception-priority-get.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-exception-priority-handler.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-exception-priority-set.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-initialize.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-isr-dispatch.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-isr-enter-leave.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-isr-level-get.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-isr-level-set.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-isr-vector-install.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7m-multitasking-start-stop.c
-librtemscpu_a_SOURCES += score/cpu/arm/armv7-thread-idle.c
-librtemscpu_a_SOURCES += score/cpu/arm/cpu_asm.S
-librtemscpu_a_SOURCES += score/cpu/arm/cpu.c
-librtemscpu_a_SOURCES += score/cpu/arm/__tls_get_addr.c
-
-endif
-
-if CPU_BFIN
-
-include $(srcdir)/score/cpu/bfin/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/bfin/bfin-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/bfin/cpu_asm.S
-librtemscpu_a_SOURCES += score/cpu/bfin/cpu.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-
-endif
-
-if CPU_I386
-
-include $(srcdir)/score/cpu/i386/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/i386/cpu_asm.S
-librtemscpu_a_SOURCES += score/cpu/i386/cpu.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-
-endif
-
-if CPU_LM32
-
-include $(srcdir)/score/cpu/lm32/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/lm32/cpu_asm.S
-librtemscpu_a_SOURCES += score/cpu/lm32/cpu.c
-librtemscpu_a_SOURCES += score/cpu/lm32/irq.c
-librtemscpu_a_SOURCES += score/cpu/lm32/lm32-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-
-endif
-
-if CPU_M68K
-
-include $(srcdir)/score/cpu/m68k/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/m68k/cpu_asm.S
-librtemscpu_a_SOURCES += score/cpu/m68k/cpu.c
-librtemscpu_a_SOURCES += score/cpu/m68k/m68k-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/m68k/__m68k_read_tp.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-
-endif
-
-if CPU_MIPS
-
-include $(srcdir)/score/cpu/mips/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/mips/cpu.c
-librtemscpu_a_SOURCES += score/cpu/mips/cpu_asm.S
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-
-endif
-
-if CPU_MOXIE
-
-include $(srcdir)/score/cpu/moxie/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/moxie/cpu.c
-librtemscpu_a_SOURCES += score/cpu/moxie/moxie-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/moxie/cpu_asm.S
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-
-endif
-
-if CPU_NIOS2
-
-include $(srcdir)/score/cpu/nios2/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-context-initialize.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-context-switch.S
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-context-validate.S
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-context-volatile-clobber.S
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-eic-il-low-level.S
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-fatal-halt.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-iic-low-level.S
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-iic-irq.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-initialize.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-isr-get-level.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-isr-install-vector.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-isr-is-in-progress.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-isr-set-level.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-mpu-add-region.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-mpu-configuration.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-mpu-descriptor.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-mpu-disable-protected.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-mpu-reset.c
-librtemscpu_a_SOURCES += score/cpu/nios2/nios2-thread-dispatch-disabled.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-
-endif
-
-if CPU_NO_CPU
-
-include $(srcdir)/score/cpu/no_cpu/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpu.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpu_asm.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-
-endif
-
-if CPU_OR1K
-
-include $(srcdir)/score/cpu/or1k/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/or1k/cpu.c
-librtemscpu_a_SOURCES += score/cpu/or1k/or1k-context-initialize.c
-librtemscpu_a_SOURCES += score/cpu/or1k/or1k-context-switch.S
-librtemscpu_a_SOURCES += score/cpu/or1k/or1k-context-validate.S
-librtemscpu_a_SOURCES += score/cpu/or1k/or1k-context-volatile-clobber.S
-librtemscpu_a_SOURCES += score/cpu/or1k/or1k-exception-default.c
-librtemscpu_a_SOURCES += score/cpu/or1k/or1k-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/or1k/or1k-exception-handler-low.S
-
-endif
-
-if CPU_POWERPC
-
-include $(srcdir)/score/cpu/powerpc/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-librtemscpu_a_SOURCES += score/cpu/powerpc/cpu.c
-librtemscpu_a_SOURCES += score/cpu/powerpc/ppc-context-volatile-clobber.S
-librtemscpu_a_SOURCES += score/cpu/powerpc/ppc-context-validate.S
-librtemscpu_a_SOURCES += score/cpu/powerpc/ppc-isr-disable-mask.S
-
-endif
-
-if CPU_RISCV
-
-include $(srcdir)/score/cpu/riscv/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/riscv/cpu.c
-librtemscpu_a_SOURCES += score/cpu/riscv/riscv-exception-handler.S
-librtemscpu_a_SOURCES += score/cpu/riscv/riscv-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/riscv/riscv-context-switch.S
-librtemscpu_a_SOURCES += score/cpu/riscv/riscv-context-initialize.c
-librtemscpu_a_SOURCES += score/cpu/riscv/riscv-context-validate.S
-librtemscpu_a_SOURCES += score/cpu/riscv/riscv-context-volatile-clobber.S
-librtemscpu_a_SOURCES += score/cpu/riscv/riscv-counter.S
-
-endif
-
-if CPU_SH
-
-include $(srcdir)/score/cpu/sh/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-librtemscpu_a_SOURCES += score/cpu/sh/cpu.c
-librtemscpu_a_SOURCES += score/cpu/sh/context.c
-librtemscpu_a_SOURCES += score/cpu/sh/sh-exception-frame-print.c
-
-endif
-
-if CPU_SPARC64
-
-include $(srcdir)/score/cpu/sparc64/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-librtemscpu_a_SOURCES += score/cpu/sparc64/context.S
-librtemscpu_a_SOURCES += score/cpu/sparc64/cpu.c
-librtemscpu_a_SOURCES += score/cpu/sparc64/interrupt.S
-librtemscpu_a_SOURCES += score/cpu/sparc64/sparc64-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/sparc64/sparc64-syscall.S
-
-endif
-
-if CPU_SPARC
-
-include $(srcdir)/score/cpu/sparc/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-librtemscpu_a_SOURCES += score/cpu/sparc/access_le.c
-librtemscpu_a_SOURCES += score/cpu/sparc/cpu.c
-librtemscpu_a_SOURCES += score/cpu/sparc/cpu_asm.S
-librtemscpu_a_SOURCES += score/cpu/sparc/sparc-access.S
-librtemscpu_a_SOURCES += score/cpu/sparc/sparc-bad-trap.S
-librtemscpu_a_SOURCES += score/cpu/sparc/sparc-context-validate.S
-librtemscpu_a_SOURCES += score/cpu/sparc/sparc-context-volatile-clobber.S
-librtemscpu_a_SOURCES += score/cpu/sparc/sparc-counter-asm.S
-librtemscpu_a_SOURCES += score/cpu/sparc/sparc-exception-frame-print.c
-librtemscpu_a_SOURCES += score/cpu/sparc/sparc-isr-handler.S
-librtemscpu_a_SOURCES += score/cpu/sparc/sparc-isr-install.c
-librtemscpu_a_SOURCES += score/cpu/sparc/syscall.S
-librtemscpu_a_SOURCES += score/cpu/sparc/window.S
-
-endif
-
-if CPU_V850
-
-include $(srcdir)/score/cpu/v850/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-librtemscpu_a_SOURCES += score/cpu/v850/cpu.c
-librtemscpu_a_SOURCES += score/cpu/v850/cpu_asm.S
-librtemscpu_a_SOURCES += score/cpu/v850/v850-exception-frame-print.c
-
-endif
-
-if CPU_X86_64
-
-include $(srcdir)/score/cpu/x86_64/headers.am
-
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterfrequency.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpucounterread.c
-librtemscpu_a_SOURCES += score/cpu/no_cpu/cpuidle.c
-librtemscpu_a_SOURCES += score/cpu/x86_64/cpu.c
-librtemscpu_a_SOURCES += score/cpu/x86_64/x86_64-context-initialize.c
-librtemscpu_a_SOURCES += score/cpu/x86_64/x86_64-context-switch.S
-
-endif
-
-#
-# Create a new Version VC Key header if the VC state has changed.
-#
-stamp_vc_key = stamp-vc-key
-
-BUILT_SOURCES = version-vc-key.h
-
-.PHONY: generate-vc-key
-
-generate-vc-key:
- @+current_vc_key=""; \
- if test -f $(stamp_vc_key); then \
- current_vc_key=`cat $(stamp_vc_key)`; \
- fi; \
- vc_key=`$(top_srcdir)/vc-key.sh $(top_srcdir) $$current_vc_key`; \
- if test "$$vc_key" != "matches"; then \
- echo "Generating version-vc-key.h"; \
- if test "$$vc_key" == "release"; then \
- vc_header_key="\/\* No version control key found; release\? \*\/"; \
- else \
- vc_header_key="#define RTEMS_VERSION_VC_KEY \"$$vc_key\""; \
- fi; \
- cat $(top_srcdir)/version-vc-key.h.in | \
- sed -e "s/@VERSION_VC_KEY@/$$vc_header_key/g" > version-vc-key.h; \
- echo "$$vc_key" > $(stamp_vc_key); \
- fi
-
-version-vc-key.h: generate-vc-key
-
-$(top_srcdir)/sapi/src/version.c: version-vc-key.h
-
-all-local: generate-vc-key
-
-project_lib_LIBRARIES += librtemsdefaultconfig.a
-
-librtemsdefaultconfig_a_SOURCES =
-librtemsdefaultconfig_a_SOURCES += libmisc/dummy/default-configuration.c
-
-project_lib_LIBRARIES += librtemstest.a
-
-librtemstest_a_SOURCES =
-librtemstest_a_SOURCES += libtest/testbeginend.c
-librtemstest_a_SOURCES += libtest/testbusy.c
-librtemstest_a_SOURCES += libtest/testextension.c
-librtemstest_a_SOURCES += libtest/testparallel.c
-librtemstest_a_SOURCES += libtest/testrun.c
-librtemstest_a_SOURCES += libtest/testwrappers.c
-librtemstest_a_SOURCES += libtest/t-test.c
-librtemstest_a_SOURCES += libtest/t-test-busy.c
-librtemstest_a_SOURCES += libtest/t-test-busy-tick.c
-librtemstest_a_SOURCES += libtest/t-test-checks.c
-librtemstest_a_SOURCES += libtest/t-test-checks-eno.c
-librtemstest_a_SOURCES += libtest/t-test-checks-psx.c
-librtemstest_a_SOURCES += libtest/t-test-hash-sha256.c
-librtemstest_a_SOURCES += libtest/t-test-interrupt.c
-librtemstest_a_SOURCES += libtest/t-test-rtems.c
-librtemstest_a_SOURCES += libtest/t-test-rtems-context.c
-librtemstest_a_SOURCES += libtest/t-test-rtems-fds.c
-librtemstest_a_SOURCES += libtest/t-test-rtems-heap.c
-librtemstest_a_SOURCES += libtest/t-test-rtems-measure.c
-librtemstest_a_SOURCES += libtest/t-test-rtems-objs.c
-librtemstest_a_SOURCES += libtest/t-test-rtems-posix-keys.c
-librtemstest_a_SOURCES += libtest/t-test-time.c
-librtemstest_a_SOURCES += libtest/t-test-thread-switch.c
-
-project_lib_LIBRARIES += libftpd.a
-
-libftpd_a_SOURCES =
-libftpd_a_SOURCES += ftpd/ftpd.c
-libftpd_a_SOURCES += ftpd/ftpd-init.c
-
-project_lib_LIBRARIES += libftpfs.a
-
-libftpfs_a_SOURCES =
-libftpfs_a_SOURCES += libfs/src/ftpfs/ftpfs.c
-
-project_lib_LIBRARIES += libtftpfs.a
-
-libtftpfs_a_SOURCES =
-libtftpfs_a_SOURCES += libfs/src/ftpfs/tftpDriver.c
-
-project_lib_LIBRARIES += libtelnetd.a
-
-libtelnetd_a_SOURCES =
-libtelnetd_a_SOURCES += telnetd/check_passwd.c
-libtelnetd_a_SOURCES += telnetd/des.c
-libtelnetd_a_SOURCES += telnetd/pty.c
-libtelnetd_a_SOURCES += telnetd/telnetd.c
-libtelnetd_a_SOURCES += telnetd/telnetd-init.c
-
-if LIBDEBUGGER
-
-project_lib_LIBRARIES += libdebugger.a
-
-libdebugger_a_SOURCES =
-libdebugger_a_SOURCES += libdebugger/rtems-debugger-block.c
-libdebugger_a_SOURCES += libdebugger/rtems-debugger-bsp.c
-libdebugger_a_SOURCES += libdebugger/rtems-debugger-cmd.c
-libdebugger_a_SOURCES += libdebugger/rtems-debugger-remote.c
-libdebugger_a_SOURCES += libdebugger/rtems-debugger-remote-tcp.c
-libdebugger_a_SOURCES += libdebugger/rtems-debugger-@RTEMS_CPU@.c
-libdebugger_a_SOURCES += libdebugger/rtems-debugger-server.c
-libdebugger_a_SOURCES += libdebugger/rtems-debugger-target.c
-libdebugger_a_SOURCES += libdebugger/rtems-debugger-threads.c
-
-endif
-
-project_lib_LIBRARIES += libjffs2.a
-
-libjffs2_a_SOURCES =
-libjffs2_a_SOURCES += libfs/src/jffs2/src/build.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/compat-crc32.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/compr.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/compr_rtime.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/compr_zlib.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/debug.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/dir-rtems.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/erase.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/flashio.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/fs-rtems.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/gc.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/malloc-rtems.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/nodelist.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/nodemgmt.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/read.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/readinode.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/scan.c
-libjffs2_a_SOURCES += libfs/src/jffs2/src/write.c
-libjffs2_a_CFLAGS =
-libjffs2_a_CFLAGS += -Wno-pointer-sign
-libjffs2_a_CPPFLAGS =
-libjffs2_a_CPPFLAGS += $(AM_CPPFLAGS)
-libjffs2_a_CPPFLAGS += -I$(srcdir)/libfs/src/jffs2/include
-
-project_lib_LIBRARIES += libmghttpd.a
-
-libmghttpd_a_SOURCES =
-libmghttpd_a_SOURCES += mghttpd/mongoose.c
-
-project_lib_LIBRARIES += libz.a
-
-libz_a_SOURCES =
-libz_a_SOURCES += zlib/adler32.c
-libz_a_SOURCES += zlib/compress.c
-libz_a_SOURCES += zlib/crc32.c
-libz_a_SOURCES += zlib/deflate.c
-libz_a_SOURCES += zlib/gzclose.c
-libz_a_SOURCES += zlib/gzlib.c
-libz_a_SOURCES += zlib/gzread.c
-libz_a_SOURCES += zlib/gzwrite.c
-libz_a_SOURCES += zlib/infback.c
-libz_a_SOURCES += zlib/inffast.c
-libz_a_SOURCES += zlib/inflate.c
-libz_a_SOURCES += zlib/inftrees.c
-libz_a_SOURCES += zlib/trees.c
-libz_a_SOURCES += zlib/uncompr.c
-libz_a_SOURCES += zlib/zutil.c
-
-if HACK_TO_AVOID_LONG_ARG_LIST
-
-librtemscpu.a: $(librtemscpu_a_OBJECTS) $(librtemscpu_a_DEPENDENCIES) $(EXTRA_librtemscpu_a_DEPENDENCIES)
- -rm -f librtemscpu.a librtemscpu.txt
- for i in $(librtemscpu_a_OBJECTS) ; do echo "$$i" >>librtemscpu.txt ; done
- $(librtemscpu_a_AR) librtemscpu.a @librtemscpu.txt $(librtemscpu_a_LIBADD)
- $(RANLIB) librtemscpu.a
-
-endif
diff --git a/cpukit/automake/compile.am b/cpukit/automake/compile.am
deleted file mode 100644
index 4fc133e7aa..0000000000
--- a/cpukit/automake/compile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-AM_CPPFLAGS = @RTEMS_CPPFLAGS@
-AM_CFLAGS =
-AM_CCASFLAGS = @RTEMS_CCASFLAGS@
-
-ARFLAGS = crD
diff --git a/cpukit/automake/multilib.am b/cpukit/automake/multilib.am
deleted file mode 100644
index 007d20a8e0..0000000000
--- a/cpukit/automake/multilib.am
+++ /dev/null
@@ -1,34 +0,0 @@
-if MULTILIB
-MULTISRCTOP =
-MULTIDIRS =
-MULTIDO = true
-MULTICLEAN = true
-endif
-
-# Multilib support rules
-.PHONY: all-multi install-multi mostlyclean-multi clean-multi distclean-multi \
- maintainer-clean-multi
-
-if MULTILIB
-all-recursive: all-multi
-install-recursive: install-multi
-
-mostlyclean-recursive: mostlyclean-multi
-clean-recursive: clean-multi
-distclean-recursive: distclean-multi
-maintainer-clean-recursive: maintainer-clean-multi
-
-all-multi:
- $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
-install-multi:
- $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
-
-mostlyclean-multi:
- $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
-clean-multi:
- $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
-distclean-multi:
- $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
-maintainer-clean-multi:
- $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
-endif
diff --git a/cpukit/configure.ac b/cpukit/configure.ac
deleted file mode 100644
index e3c039383c..0000000000
--- a/cpukit/configure.ac
+++ /dev/null
@@ -1,387 +0,0 @@
-## Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.69])
-AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
-AC_CONFIG_SRCDIR([score])
-RTEMS_TOP([..],[])
-RTEMS_SOURCE_TOP
-RTEMS_BUILD_TOP
-
-RTEMS_CANONICAL_TARGET_CPU
-
-AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.12.2])
-AM_MAINTAINER_MODE
-
-RTEMS_ENABLE_MULTIPROCESSING
-RTEMS_ENABLE_POSIX
-RTEMS_ENABLE_RTEMS_DEBUG
-RTEMS_ENABLE_NETWORKING
-RTEMS_ENABLE_PARAVIRT
-RTEMS_ENABLE_PROFILING
-RTEMS_ENABLE_DRVMGR
-
-RTEMS_ENV_RTEMSCPU
-RTEMS_CHECK_RTEMS_DEBUG
-
-AC_DEFUN([RTEMS_TOOL_CHAIN_ERROR],AC_MSG_ERROR([please update your tool chain via the RSB <https://docs.rtems.org/branches/master/rsb/quick-start.html>]))
-
-# Is this a supported CPU?
-AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
-if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_ERROR(no)
-fi
-
-RTEMS_PROG_CC_FOR_TARGET
-AM_PROG_CC_C_O
-RTEMS_CANONICALIZE_TOOLS
-RTEMS_PROG_CCAS
-AC_PROG_RANLIB
-
-AC_MSG_CHECKING([for a need to avoid a long argument list])
-
-hack_to_avoid_long_arg_list=no
-case "${build_os}" in
- *cygwin*|*mingw*|*msys*)
- hack_to_avoid_long_arg_list=yes
- ;;
- *)
- ;;
-esac
-
-AC_MSG_RESULT([${hack_to_avoid_long_arg_list}])
-AM_CONDITIONAL([HACK_TO_AVOID_LONG_ARG_LIST], [test "${hack_to_avoid_long_arg_list}" = yes])
-
-RTEMS_CHECK_NEWLIB
-
-# Newlib proprietary
-AC_CHECK_MEMBER([struct _Thread_queue_Queue._name],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <sys/lock.h>])
-
-# pthread-functions not declared in some versions of newlib.
-RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
-RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
-RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
-RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
-
-# These are SMP related and were added to newlib by RTEMS.
-RTEMS_CHECK_FUNC([pthread_attr_setaffinity_np],[
- #define _GNU_SOURCE
- #include <pthread.h>])
-RTEMS_CHECK_FUNC([pthread_attr_getaffinity_np],[
- #define _GNU_SOURCE
- #include <pthread.h>])
-RTEMS_CHECK_FUNC([pthread_setaffinity_np],[
- #define _GNU_SOURCE
- #include <pthread.h>])
-RTEMS_CHECK_FUNC([pthread_getaffinity_np],[
- #define _GNU_SOURCE
- #include <pthread.h>])
-RTEMS_CHECK_FUNC([pthread_getattr_np],[
- #define _GNU_SOURCE
- #include <pthread.h>])
-
-AC_LANG_PUSH(C)
-AC_MSG_CHECKING([for mprotect(const void *, ...)])
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#include <sys/mman.h>
-int mprotect(const void *, size_t, int);
-])],[
-AC_MSG_RESULT([yes])
-AC_DEFINE(HAVE_MPROTECT_CONST, [], [mprotect(const void *, ...)])
-],[
-AC_MSG_RESULT([no])
-])
-AC_MSG_CHECKING([for pthread_mutex_getprioceiling(const pthread_mutex_t *, ...)])
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#include <pthread.h>
-int pthread_mutex_getprioceiling(const pthread_mutex_t *__restrict, int *);
-])],[
-AC_MSG_RESULT([yes])
-AC_DEFINE(HAVE_PTHREAD_MUTEX_GETCEILING_CONST, [], [pthread_mutex_getprioceiling(const pthread_mutex_t *, ...)])
-],[
-AC_MSG_RESULT([no])
-])
-AC_MSG_CHECKING([for pthread_setschedparam(..., const struct sched_param *)])
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#include <pthread.h>
-int pthread_setschedparam(pthread_t, int, const struct sched_param *);
-])],[
-AC_MSG_RESULT([yes])
-AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM_CONST, [], [pthread_setschedparam(..., const struct sched_param *)])
-],[
-AC_MSG_RESULT([no])
-])
-AC_LANG_POP(C)
-
-# Some toolchain sanity checks and diagnostics
-RTEMS_CHECK_GCC_SANITY
-
-# These are conditionally defined by the toolchain
-# FIXME: we should either conditionally compile those parts in
-# RTEMS depending on them, or abort - For now, simply check.
-AC_CHECK_HEADER([pthread.h],[
- AC_CHECK_TYPES([pthread_rwlock_t])
- AC_CHECK_TYPES([pthread_barrier_t])
- AC_CHECK_TYPES([pthread_spinlock_t])
- AC_CHECK_TYPES([struct _pthread_cleanup_context],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <pthread.h>])
- AC_CHECK_TYPES([struct _Priority_Node],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <pthread.h>])
-])
-
-RTEMS_CHECK_MULTIPROCESSING
-RTEMS_CHECK_POSIX_API
-RTEMS_CHECK_NETWORKING
-RTEMS_CHECK_SMP
-if test "${RTEMS_HAS_SMP}" = "yes"; then
- AC_CHECK_HEADERS([stdatomic.h],[],[RTEMS_TOOL_CHAIN_ERROR])
-fi
-
-rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
-rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
-rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/[[\.\-]].*//"`
-
-_RTEMS_CPUOPT_INIT
-
-RTEMS_CPUOPT([RTEMS_DEBUG],
- [test x"${enable_rtems_debug}" = x"yes"],
- [1],
- [if RTEMS_DEBUG is enabled])
-
-RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
- [test x"$enable_multiprocessing" = xyes],
- [1],
- [if multiprocessing is enabled])
-
-RTEMS_CPUOPT([RTEMS_NEWLIB],
- [test x"$RTEMS_USE_NEWLIB" = xyes],
- [1],
- [if using newlib])
-
-RTEMS_CPUOPT([RTEMS_POSIX_API],
- [test x"$rtems_cv_HAS_POSIX_API" = xyes],
- [1],
- [if posix api is supported])
-
-RTEMS_CPUOPT([RTEMS_SMP],
- [test x"$RTEMS_HAS_SMP" = xyes],
- [1],
- [if SMP is enabled])
-
-RTEMS_CPUOPT([RTEMS_PARAVIRT],
- [test x"$RTEMS_HAS_PARAVIRT" = xyes],
- [1],
- [PARAVIRT is enabled])
-
-RTEMS_CPUOPT([RTEMS_PROFILING],
- [test x"$RTEMS_HAS_PROFILING" = xyes],
- [1],
- [if profiling is enabled])
-
-RTEMS_CPUOPT([RTEMS_NETWORKING],
- [test x"$rtems_cv_HAS_NETWORKING" = xyes],
- [1],
- [if networking is enabled])
-
-RTEMS_CPUOPT([RTEMS_DRVMGR_STARTUP],
- [test x"$enable_drvmgr" = xyes],
- [1],
- [if driver manager api is supported])
-
-RTEMS_CPUOPT([RTEMS_VERSION],
- [true],
- ["]_RTEMS_VERSION["],
- [RTEMS version string])
-
-## Header file differences that need to be known in .h after install
-
-## Deactivate ada bindings
-RTEMS_CPUOPT([__RTEMS_ADA__],
- [test x"${enable_ada}" = x"yes"],
- [1],
- [Define to 1 if ada/gnat bindings are built-in])
-
-# These are used to provide <rtems/inttypes.h
-AC_CHECK_SIZEOF([mode_t])
-AC_CHECK_SIZEOF([off_t])
-AC_CHECK_SIZEOF([time_t])
-AC_CHECK_SIZEOF([size_t])
-AC_CHECK_SIZEOF([blksize_t])
-AC_CHECK_SIZEOF([blkcnt_t])
-
-## Provide sizeof(mode_t) information via cpuopts.h
-RTEMS_CPUOPT([__RTEMS_SIZEOF_MODE_T__],
- [true],
- [${ac_cv_sizeof_mode_t}],
- [sizeof(mode_t)])
-
-## Provide sizeof(off_t) information via cpuopts.h
-RTEMS_CPUOPT([__RTEMS_SIZEOF_OFF_T__],
- [true],
- [${ac_cv_sizeof_off_t}],
- [sizeof(off_t)])
-
-## Provide sizeof(time_t) information via cpuopts.h
-RTEMS_CPUOPT([__RTEMS_SIZEOF_TIME_T__],
- [true],
- [${ac_cv_sizeof_time_t}],
- [sizeof(time_t)])
-
-## Provide sizeof(blksize_t) information via cpuopts.h
-RTEMS_CPUOPT([__RTEMS_SIZEOF_BLKSIZE_T__],
- [true],
- [${ac_cv_sizeof_blksize_t}],
- [sizeof(blksize_t)])
-
-## Provide sizeof(blkcnt_t) information via cpuopts.h
-RTEMS_CPUOPT([__RTEMS_SIZEOF_BLKCNT_T__],
- [true],
- [${ac_cv_sizeof_blkcnt_t}],
- [sizeof(blkcnt_t)])
-
-## Then we propagate a private copy of the value into cpuopts.h
-## so it is always available to the RTEMS header files.
-
-RTEMS_CPUOPT([__RTEMS_MAJOR__],
- [true],
- [$rtems_major],
- [major version portion of an RTEMS release])
-
-RTEMS_CPUOPT([__RTEMS_MINOR__],
- [true],
- [$rtems_minor],
- [minor version portion of an RTEMS release])
-
-RTEMS_CPUOPT([__RTEMS_REVISION__],
- [true],
- [$rtems_revision],
- [revision version portion of an RTEMS release])
-
-_RTEMS_CPUOPT_FINI
-
-_RTEMS_TESTOPT_INIT
-RTEMS_TESTOPT([RTEMS_TEST_VERBOSITY],
- [true],
- [T_NORMAL],
- [RTEMS Test Framework verbosity])
-_RTEMS_TESTOPT_FINI
-
-AC_ENABLE_MULTILIB([Makefile],[..])
-
-# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
-AC_MSG_CHECKING([for assignable stdio])
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [#include <stdio.h>],
- [stdin = fopen("/tmp", "r")])],
- [HAVE_ASSIGNABLE_STDIO=yes],
- [HAVE_ASSIGNABLE_STDIO=no])
-AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
-
-# libmisc/serdbg exploits weak symbols
-RTEMS_CHECK_GCC_WEAK
-
-# Used by legacy network stack
-AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
-
-# Ensure that Newlib does not provide things now in <machine/_timecounter.h>
-AC_CHECK_DECLS([_Timecounter_Time_second],[RTEMS_TOOL_CHAIN_ERROR],,[#include <sys/time.h>])
-
-# ... far too many conditionals ...
-AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
-
-AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
-AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
-
-AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
-
-AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
-AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
-AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
-&& test x"$enable_ada" = x"yes"])
-
-AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
-
-AC_CONFIG_HEADER(config.h)
-
-## These are needed by the NFS Client
-AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
-AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
-&& test -n "$AWK" \
-&& test "$enable_rpcgen" = yes])
-
-# Filter dynamic loading to only build for architectures that have
-# reloc backends
-AC_MSG_CHECKING([whether CPU supports libdl])
-case $RTEMS_CPU in
- arm | i386 | m68k | mips | moxie | powerpc | riscv | sparc)
- HAVE_LIBDL=yes ;;
- # bfin has an issue to resolve with libdl. See ticket #2252
- bfin)
- HAVE_LIBDL=no ;;
- # lm32 has an issue to resolve with libdl. See ticket #2283
- lm32)
- HAVE_LIBDL=no ;;
- # v850 has an issue to resolve with libdl. See ticket #2260
- v850)
- HAVE_LIBDL=no ;;
- *)
- HAVE_LIBDL=no ;;
-esac
-AM_CONDITIONAL(LIBDL,[test x"$HAVE_LIBDL" = x"yes"])
-AC_MSG_RESULT([$HAVE_LIBDL])
-
-# Filter debugger to only build for architectures that have a target backend
-AC_MSG_CHECKING([whether CPU supports libdebugger])
-case $RTEMS_CPU in
- arm | i386)
- HAVE_LIBDEBUGGER=yes ;;
- *)
- HAVE_LIBDEBUGGER=no ;;
-esac
-AM_CONDITIONAL(LIBDEBUGGER,[test x"$HAVE_LIBDEBUGGER" = x"yes"])
-AC_MSG_RESULT([$HAVE_LIBDEBUGGER])
-
-# Filter libpci to only build for architectures that have support for it
-AC_MSG_CHECKING([whether CPU supports libpci])
-case $RTEMS_CPU in
- sparc)
- HAVE_LIBPCI=yes ;;
- *)
- HAVE_LIBPCI=no ;;
-esac
-AM_CONDITIONAL(LIBPCI,[test x"$HAVE_LIBPCI" = x"yes"])
-AC_MSG_RESULT([$HAVE_LIBPCI])
-
-# Filter libdrvmgr to only build for architectures that have support for it
-AC_MSG_CHECKING([whether CPU supports libdrvmgr])
-case $RTEMS_CPU in
- riscv | sparc)
- HAVE_LIBDRVMGR=yes ;;
- *)
- HAVE_LIBDRVMGR=no ;;
-esac
-AM_CONDITIONAL(LIBDRVMGR,[test x"$HAVE_LIBDRVMGR" = x"yes"])
-AC_MSG_RESULT([$HAVE_LIBDRVMGR])
-
-AM_CONDITIONAL([CPU_ARM],[test $RTEMS_CPU = "arm"])
-AM_CONDITIONAL([CPU_BFIN],[test $RTEMS_CPU = "bfin"])
-AM_CONDITIONAL([CPU_I386],[test $RTEMS_CPU = "i386"])
-AM_CONDITIONAL([CPU_LM32],[test $RTEMS_CPU = "lm32"])
-AM_CONDITIONAL([CPU_M68K],[test $RTEMS_CPU = "m68k"])
-AM_CONDITIONAL([CPU_MIPS],[test $RTEMS_CPU = "mips"])
-AM_CONDITIONAL([CPU_MOXIE],[test $RTEMS_CPU = "moxie"])
-AM_CONDITIONAL([CPU_NIOS2],[test $RTEMS_CPU = "nios2"])
-AM_CONDITIONAL([CPU_NO_CPU],[test $RTEMS_CPU = "no_cpu"])
-AM_CONDITIONAL([CPU_OR1K],[test $RTEMS_CPU = "or1k"])
-AM_CONDITIONAL([CPU_POWERPC],[test $RTEMS_CPU = "powerpc"])
-AM_CONDITIONAL([CPU_RISCV],[test $RTEMS_CPU = "riscv"])
-AM_CONDITIONAL([CPU_SH],[test $RTEMS_CPU = "sh"])
-AM_CONDITIONAL([CPU_SPARC64],[test $RTEMS_CPU = "sparc64"])
-AM_CONDITIONAL([CPU_SPARC],[test $RTEMS_CPU = "sparc"])
-AM_CONDITIONAL([CPU_V850],[test $RTEMS_CPU = "v850"])
-AM_CONDITIONAL([CPU_X86_64],[test $RTEMS_CPU = "x86_64"])
-
-# Explicitly list all Makefiles here
-AC_CONFIG_FILES([Makefile])
-
-AC_OUTPUT
diff --git a/cpukit/header-dirs.am b/cpukit/header-dirs.am
deleted file mode 100644
index d90271be9e..0000000000
--- a/cpukit/header-dirs.am
+++ /dev/null
@@ -1,82 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_HEADERS =
-include_adaincludedir = $(includedir)/adainclude
-include_adainclude_HEADERS =
-include_arpadir = $(includedir)/arpa
-include_arpa_HEADERS =
-include_devdir = $(includedir)/dev
-include_dev_HEADERS =
-include_dev_i2cdir = $(includedir)/dev/i2c
-include_dev_i2c_HEADERS =
-include_dev_miidir = $(includedir)/dev/mii
-include_dev_mii_HEADERS =
-include_dev_serialdir = $(includedir)/dev/serial
-include_dev_serial_HEADERS =
-include_dev_spidir = $(includedir)/dev/spi
-include_dev_spi_HEADERS =
-include_drvmgrdir = $(includedir)/drvmgr
-include_drvmgr_HEADERS =
-include_kerndir = $(includedir)/kern
-include_kern_HEADERS =
-include_libdir = $(includedir)/lib
-include_lib_HEADERS =
-include_libcdir = $(includedir)/libc
-include_libc_HEADERS =
-include_libcpudir = $(includedir)/libcpu
-include_libcpu_HEADERS =
-include_linuxdir = $(includedir)/linux
-include_linux_HEADERS =
-include_linux_spidir = $(includedir)/linux/spi
-include_linux_spi_HEADERS =
-include_machinedir = $(includedir)/machine
-include_machine_HEADERS =
-include_mghttpddir = $(includedir)/mghttpd
-include_mghttpd_HEADERS =
-include_netdir = $(includedir)/net
-include_net_HEADERS =
-include_netinetdir = $(includedir)/netinet
-include_netinet_HEADERS =
-include_nfsdir = $(includedir)/nfs
-include_nfs_HEADERS =
-include_nfsclientdir = $(includedir)/nfsclient
-include_nfsclient_HEADERS =
-include_pcidir = $(includedir)/pci
-include_pci_HEADERS =
-include_rpcdir = $(includedir)/rpc
-include_rpc_HEADERS =
-include_rtemsdir = $(includedir)/rtems
-include_rtems_HEADERS =
-include_rtems_bfindir = $(includedir)/rtems/bfin
-include_rtems_bfin_HEADERS =
-include_rtems_bsdnetdir = $(includedir)/rtems/bsdnet
-include_rtems_bsdnet_HEADERS =
-include_rtems_confdefsdir = $(includedir)/rtems/confdefs
-include_rtems_confdefs_HEADERS =
-include_rtems_debuggerdir = $(includedir)/rtems/debugger
-include_rtems_debugger_HEADERS =
-include_rtems_m68kdir = $(includedir)/rtems/m68k
-include_rtems_m68k_HEADERS =
-include_rtems_mipsdir = $(includedir)/rtems/mips
-include_rtems_mips_HEADERS =
-include_rtems_posixdir = $(includedir)/rtems/posix
-include_rtems_posix_HEADERS =
-include_rtems_powerpcdir = $(includedir)/rtems/powerpc
-include_rtems_powerpc_HEADERS =
-include_rtems_rfsdir = $(includedir)/rtems/rfs
-include_rtems_rfs_HEADERS =
-include_rtems_rtemsdir = $(includedir)/rtems/rtems
-include_rtems_rtems_HEADERS =
-include_rtems_rtldir = $(includedir)/rtems/rtl
-include_rtems_rtl_HEADERS =
-include_rtems_scoredir = $(includedir)/rtems/score
-include_rtems_score_HEADERS =
-include_rtems_tracedir = $(includedir)/rtems/trace
-include_rtems_trace_HEADERS =
-include_sysdir = $(includedir)/sys
-include_sys_HEADERS =
-include_utf8procdir = $(includedir)/utf8proc
-include_utf8proc_HEADERS =
-include_uuiddir = $(includedir)/uuid
-include_uuid_HEADERS =
-include_vmdir = $(includedir)/vm
-include_vm_HEADERS =
diff --git a/cpukit/headers.am b/cpukit/headers.am
deleted file mode 100644
index 96bc9faca7..0000000000
--- a/cpukit/headers.am
+++ /dev/null
@@ -1,452 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_HEADERS += include/aio.h
-include_HEADERS += include/crypt.h
-include_HEADERS += include/dlfcn.h
-include_HEADERS += include/endian.h
-include_HEADERS += include/fdt.h
-include_HEADERS += include/libfdt.h
-include_HEADERS += include/libfdt_env.h
-include_HEADERS += include/link.h
-include_HEADERS += include/link_elf.h
-include_HEADERS += include/md4.h
-include_HEADERS += include/md5.h
-include_HEADERS += include/memory.h
-include_HEADERS += include/mqueue.h
-include_HEADERS += include/pci.h
-include_HEADERS += include/poll.h
-include_HEADERS += include/rtems.h
-include_HEADERS += include/sha256.h
-include_HEADERS += include/sha512.h
-include_HEADERS += include/xz.h
-include_HEADERS += include/zconf.h
-include_HEADERS += include/zlib.h
-include_arpa_HEADERS += include/arpa/ftp.h
-include_dev_i2c_HEADERS += include/dev/i2c/eeprom.h
-include_dev_i2c_HEADERS += include/dev/i2c/fpga-i2c-slave.h
-include_dev_i2c_HEADERS += include/dev/i2c/gpio-nxp-pca9535.h
-include_dev_i2c_HEADERS += include/dev/i2c/i2c.h
-include_dev_i2c_HEADERS += include/dev/i2c/sensor-lm75a.h
-include_dev_i2c_HEADERS += include/dev/i2c/switch-nxp-pca9548a.h
-include_dev_i2c_HEADERS += include/dev/i2c/ti-ads-16bit-adc.h
-include_dev_i2c_HEADERS += include/dev/i2c/ti-lm25066a.h
-include_dev_i2c_HEADERS += include/dev/i2c/ti-tmp112.h
-include_dev_i2c_HEADERS += include/dev/i2c/xilinx-axi-i2c.h
-include_dev_serial_HEADERS += include/dev/serial/sc16is752.h
-include_dev_spi_HEADERS += include/dev/spi/spi.h
-include_drvmgr_HEADERS += include/drvmgr/drvmgr.h
-include_drvmgr_HEADERS += include/drvmgr/drvmgr_confdefs.h
-include_drvmgr_HEADERS += include/drvmgr/drvmgr_list.h
-include_drvmgr_HEADERS += include/drvmgr/pci_bus.h
-include_linux_HEADERS += include/linux/i2c-dev.h
-include_linux_HEADERS += include/linux/i2c.h
-include_linux_HEADERS += include/linux/rbtree.h
-include_linux_spi_HEADERS += include/linux/spi/spidev.h
-include_machine_HEADERS += include/machine/_kernel_cpuset.h
-include_machine_HEADERS += include/machine/_kernel_in.h
-include_machine_HEADERS += include/machine/_kernel_in6.h
-include_machine_HEADERS += include/machine/_kernel_mman.h
-include_machine_HEADERS += include/machine/_kernel_param.h
-include_machine_HEADERS += include/machine/_kernel_time.h
-include_machine_HEADERS += include/machine/_kernel_types.h
-include_machine_HEADERS += include/machine/_kernel_uio.h
-include_machine_HEADERS += include/machine/_timecounter.h
-include_mghttpd_HEADERS += include/mghttpd/mongoose.h
-include_pci_HEADERS += include/pci/access.h
-include_pci_HEADERS += include/pci/cfg.h
-include_pci_HEADERS += include/pci/cfg_auto.h
-include_pci_HEADERS += include/pci/cfg_peripheral.h
-include_pci_HEADERS += include/pci/cfg_read.h
-include_pci_HEADERS += include/pci/cfg_static.h
-include_pci_HEADERS += include/pci/ids.h
-include_pci_HEADERS += include/pci/ids_extra.h
-include_pci_HEADERS += include/pci/irq.h
-include_pci_HEADERS += include/pci/pcireg.h
-include_rtems_HEADERS += include/rtems/assoc.h
-include_rtems_HEADERS += include/rtems/bdbuf.h
-include_rtems_HEADERS += include/rtems/bdpart.h
-include_rtems_HEADERS += include/rtems/blkdev.h
-include_rtems_HEADERS += include/rtems/bsd.h
-include_rtems_HEADERS += include/rtems/bspIo.h
-include_rtems_HEADERS += include/rtems/bspcmdline.h
-include_rtems_HEADERS += include/rtems/btimer.h
-include_rtems_HEADERS += include/rtems/capture-cli.h
-include_rtems_HEADERS += include/rtems/capture.h
-include_rtems_HEADERS += include/rtems/captureimpl.h
-include_rtems_HEADERS += include/rtems/cbs.h
-include_rtems_HEADERS += include/rtems/chain.h
-include_rtems_HEADERS += include/rtems/clockdrv.h
-include_rtems_HEADERS += include/rtems/concat.h
-include_rtems_HEADERS += include/rtems/confdefs.h
-include_rtems_HEADERS += include/rtems/config.h
-include_rtems_HEADERS += include/rtems/console.h
-include_rtems_HEADERS += include/rtems/counter.h
-include_rtems_HEADERS += include/rtems/cpuuse.h
-include_rtems_HEADERS += include/rtems/deviceio.h
-include_rtems_HEADERS += include/rtems/devnull.h
-include_rtems_HEADERS += include/rtems/devzero.h
-include_rtems_HEADERS += include/rtems/diskdevs.h
-include_rtems_HEADERS += include/rtems/dosfs.h
-include_rtems_HEADERS += include/rtems/dumpbuf.h
-include_rtems_HEADERS += include/rtems/endian.h
-include_rtems_HEADERS += include/rtems/error.h
-include_rtems_HEADERS += include/rtems/extension.h
-include_rtems_HEADERS += include/rtems/extensiondata.h
-include_rtems_HEADERS += include/rtems/extensionimpl.h
-include_rtems_HEADERS += include/rtems/fatal.h
-include_rtems_HEADERS += include/rtems/fb.h
-include_rtems_HEADERS += include/rtems/flashdisk.h
-include_rtems_HEADERS += include/rtems/framebuffer.h
-include_rtems_HEADERS += include/rtems/fs.h
-include_rtems_HEADERS += include/rtems/fsmount.h
-include_rtems_HEADERS += include/rtems/ftpd.h
-include_rtems_HEADERS += include/rtems/ftpfs.h
-include_rtems_HEADERS += include/rtems/gxx_wrappers.h
-include_rtems_HEADERS += include/rtems/ide_part_table.h
-include_rtems_HEADERS += include/rtems/imfs.h
-include_rtems_HEADERS += include/rtems/init.h
-include_rtems_HEADERS += include/rtems/inttypes.h
-include_rtems_HEADERS += include/rtems/io.h
-include_rtems_HEADERS += include/rtems/ioimpl.h
-include_rtems_HEADERS += include/rtems/iosupp.h
-include_rtems_HEADERS += include/rtems/irq-extension.h
-include_rtems_HEADERS += include/rtems/irq.h
-include_rtems_HEADERS += include/rtems/jffs2.h
-include_rtems_HEADERS += include/rtems/libcsupport.h
-include_rtems_HEADERS += include/rtems/libi2c.h
-include_rtems_HEADERS += include/rtems/libio.h
-include_rtems_HEADERS += include/rtems/libio_.h
-include_rtems_HEADERS += include/rtems/linkersets.h
-include_rtems_HEADERS += include/rtems/malloc.h
-include_rtems_HEADERS += include/rtems/media.h
-include_rtems_HEADERS += include/rtems/monitor.h
-include_rtems_HEADERS += include/rtems/mouse_parser.h
-include_rtems_HEADERS += include/rtems/mptables.h
-include_rtems_HEADERS += include/rtems/mw_uid.h
-include_rtems_HEADERS += include/rtems/nvdisk-sram.h
-include_rtems_HEADERS += include/rtems/nvdisk.h
-include_rtems_HEADERS += include/rtems/passwd.h
-include_rtems_HEADERS += include/rtems/pci.h
-include_rtems_HEADERS += include/rtems/pipe.h
-include_rtems_HEADERS += include/rtems/print.h
-include_rtems_HEADERS += include/rtems/printer.h
-include_rtems_HEADERS += include/rtems/profiling.h
-include_rtems_HEADERS += include/rtems/pty.h
-include_rtems_HEADERS += include/rtems/qreslib.h
-include_rtems_HEADERS += include/rtems/ramdisk.h
-include_rtems_HEADERS += include/rtems/rbheap.h
-include_rtems_HEADERS += include/rtems/rbtree.h
-include_rtems_HEADERS += include/rtems/record.h
-include_rtems_HEADERS += include/rtems/recordclient.h
-include_rtems_HEADERS += include/rtems/recorddata.h
-include_rtems_HEADERS += include/rtems/recorddump.h
-include_rtems_HEADERS += include/rtems/recordserver.h
-include_rtems_HEADERS += include/rtems/ringbuf.h
-include_rtems_HEADERS += include/rtems/rtc.h
-include_rtems_HEADERS += include/rtems/rtems-debugger-remote-tcp.h
-include_rtems_HEADERS += include/rtems/rtems-debugger.h
-include_rtems_HEADERS += include/rtems/rtems-fdt-shell.h
-include_rtems_HEADERS += include/rtems/rtems-fdt.h
-include_rtems_HEADERS += include/rtems/rtems-rfs-format.h
-include_rtems_HEADERS += include/rtems/rtems-rfs-shell.h
-include_rtems_HEADERS += include/rtems/rtems-rfs.h
-include_rtems_HEADERS += include/rtems/rtemsdialer.h
-include_rtems_HEADERS += include/rtems/scheduler.h
-include_rtems_HEADERS += include/rtems/serdbg.h
-include_rtems_HEADERS += include/rtems/serdbgcnf.h
-include_rtems_HEADERS += include/rtems/serial_mouse.h
-include_rtems_HEADERS += include/rtems/seterr.h
-include_rtems_HEADERS += include/rtems/shell.h
-include_rtems_HEADERS += include/rtems/shellconfig.h
-include_rtems_HEADERS += include/rtems/sparse-disk.h
-include_rtems_HEADERS += include/rtems/spurious.h
-include_rtems_HEADERS += include/rtems/stackchk.h
-include_rtems_HEADERS += include/rtems/status-checks.h
-include_rtems_HEADERS += include/rtems/stdio-redirect.h
-include_rtems_HEADERS += include/rtems/stringto.h
-include_rtems_HEADERS += include/rtems/sysinit.h
-include_rtems_HEADERS += include/rtems/telnetd.h
-include_rtems_HEADERS += include/rtems/termios_printk.h
-include_rtems_HEADERS += include/rtems/termios_printk_cnf.h
-include_rtems_HEADERS += include/rtems/termiostypes.h
-include_rtems_HEADERS += include/rtems/test-info.h
-include_rtems_HEADERS += include/rtems/test.h
-include_rtems_HEADERS += include/rtems/tftp.h
-include_rtems_HEADERS += include/rtems/thread.h
-include_rtems_HEADERS += include/rtems/timecounter.h
-include_rtems_HEADERS += include/rtems/timespec.h
-include_rtems_HEADERS += include/rtems/tm27-default.h
-include_rtems_HEADERS += include/rtems/tod.h
-include_rtems_HEADERS += include/rtems/untar.h
-include_rtems_HEADERS += include/rtems/userenv.h
-include_rtems_HEADERS += include/rtems/version.h
-include_rtems_HEADERS += include/rtems/vmeintr.h
-include_rtems_HEADERS += include/rtems/watchdogdrv.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/bdbuf.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/clock.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/console.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/extensions.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/inittask.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/initthread.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/iodrivers.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/mpci.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/newlib.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/objectsclassic.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/objectsposix.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/percpu.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/scheduler.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/threads.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/unlimited.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/wkspace.h
-include_rtems_confdefs_HEADERS += include/rtems/confdefs/wkspacesupport.h
-include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-bsp.h
-include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-remote.h
-include_rtems_debugger_HEADERS += include/rtems/debugger/rtems-debugger-server.h
-include_rtems_posix_HEADERS += include/rtems/posix/aio_misc.h
-include_rtems_posix_HEADERS += include/rtems/posix/barrierimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/condimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/key.h
-include_rtems_posix_HEADERS += include/rtems/posix/keyimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/mmanimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/mqueue.h
-include_rtems_posix_HEADERS += include/rtems/posix/mqueueimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/muteximpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/posixapi.h
-include_rtems_posix_HEADERS += include/rtems/posix/priorityimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/psignal.h
-include_rtems_posix_HEADERS += include/rtems/posix/psignalimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/pthread.h
-include_rtems_posix_HEADERS += include/rtems/posix/pthreadattrimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/pthreadimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/rwlockimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/semaphore.h
-include_rtems_posix_HEADERS += include/rtems/posix/semaphoreimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/shm.h
-include_rtems_posix_HEADERS += include/rtems/posix/shmimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/sigset.h
-include_rtems_posix_HEADERS += include/rtems/posix/spinlockimpl.h
-include_rtems_posix_HEADERS += include/rtems/posix/threadsup.h
-include_rtems_posix_HEADERS += include/rtems/posix/timer.h
-include_rtems_posix_HEADERS += include/rtems/posix/timerimpl.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-bitmaps.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-block-pos.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-block.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-buffer.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-data.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-dir-hash.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-dir.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-file-system-fwd.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-file-system.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-file.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-group.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-inode.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-link.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-mutex.h
-include_rtems_rfs_HEADERS += include/rtems/rfs/rtems-rfs-trace.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/asr.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/asrdata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/attr.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/attrimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/barrier.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/barrierdata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/barrierimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/cache.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/clock.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/clockimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/config.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/dpmem.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/dpmemdata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/dpmemimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/event.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/eventdata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/eventimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/eventmp.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/intr.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/mainpage.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/message.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/messagedata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/messageimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/modes.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/modesimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/mp.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/msgmp.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/object.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/objectimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/options.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/optionsimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/part.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/partdata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/partimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/partmp.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/ratemon.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/ratemondata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/ratemonimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/region.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/regiondata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/regionimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/sem.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/semdata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/semimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/semmp.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/signal.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/signalimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/signalmp.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/status.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/statusimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/support.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/taskmp.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/tasks.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/tasksdata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/tasksimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/timer.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/timerdata.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/timerimpl.h
-include_rtems_rtems_HEADERS += include/rtems/rtems/types.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/dlfcn-shell.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rap-shell.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rap.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-allocator.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-archive.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-fwd.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-indirect-ptr.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-obj-cache.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-obj-comp.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-obj-fwd.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-obj.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-shell.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-sym.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-trace.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl-unresolved.h
-include_rtems_rtl_HEADERS += include/rtems/rtl/rtl.h
-include_rtems_score_HEADERS += include/rtems/score/address.h
-include_rtems_score_HEADERS += include/rtems/score/apimutex.h
-include_rtems_score_HEADERS += include/rtems/score/assert.h
-include_rtems_score_HEADERS += include/rtems/score/atomic.h
-include_rtems_score_HEADERS += include/rtems/score/basedefs.h
-include_rtems_score_HEADERS += include/rtems/score/chain.h
-include_rtems_score_HEADERS += include/rtems/score/chainimpl.h
-include_rtems_score_HEADERS += include/rtems/score/context.h
-include_rtems_score_HEADERS += include/rtems/score/copyrt.h
-include_rtems_score_HEADERS += include/rtems/score/corebarrier.h
-include_rtems_score_HEADERS += include/rtems/score/corebarrierimpl.h
-include_rtems_score_HEADERS += include/rtems/score/coremsg.h
-include_rtems_score_HEADERS += include/rtems/score/coremsgbuffer.h
-include_rtems_score_HEADERS += include/rtems/score/coremsgimpl.h
-include_rtems_score_HEADERS += include/rtems/score/coremutex.h
-include_rtems_score_HEADERS += include/rtems/score/coremuteximpl.h
-include_rtems_score_HEADERS += include/rtems/score/corerwlockimpl.h
-include_rtems_score_HEADERS += include/rtems/score/coresem.h
-include_rtems_score_HEADERS += include/rtems/score/coresemimpl.h
-include_rtems_score_HEADERS += include/rtems/score/cpustdatomic.h
-include_rtems_score_HEADERS += include/rtems/score/freechain.h
-include_rtems_score_HEADERS += include/rtems/score/freechainimpl.h
-include_rtems_score_HEADERS += include/rtems/score/hash.h
-include_rtems_score_HEADERS += include/rtems/score/heap.h
-include_rtems_score_HEADERS += include/rtems/score/heapimpl.h
-include_rtems_score_HEADERS += include/rtems/score/heapinfo.h
-include_rtems_score_HEADERS += include/rtems/score/interr.h
-include_rtems_score_HEADERS += include/rtems/score/io.h
-include_rtems_score_HEADERS += include/rtems/score/isr.h
-include_rtems_score_HEADERS += include/rtems/score/isrlevel.h
-include_rtems_score_HEADERS += include/rtems/score/isrlock.h
-include_rtems_score_HEADERS += include/rtems/score/memory.h
-include_rtems_score_HEADERS += include/rtems/score/mpci.h
-include_rtems_score_HEADERS += include/rtems/score/mpciimpl.h
-include_rtems_score_HEADERS += include/rtems/score/mppkt.h
-include_rtems_score_HEADERS += include/rtems/score/mrsp.h
-include_rtems_score_HEADERS += include/rtems/score/mrspimpl.h
-include_rtems_score_HEADERS += include/rtems/score/muteximpl.h
-include_rtems_score_HEADERS += include/rtems/score/object.h
-include_rtems_score_HEADERS += include/rtems/score/objectdata.h
-include_rtems_score_HEADERS += include/rtems/score/objectimpl.h
-include_rtems_score_HEADERS += include/rtems/score/objectmp.h
-include_rtems_score_HEADERS += include/rtems/score/onceimpl.h
-include_rtems_score_HEADERS += include/rtems/score/percpu.h
-include_rtems_score_HEADERS += include/rtems/score/percpudata.h
-include_rtems_score_HEADERS += include/rtems/score/priority.h
-include_rtems_score_HEADERS += include/rtems/score/prioritybitmap.h
-include_rtems_score_HEADERS += include/rtems/score/prioritybitmapimpl.h
-include_rtems_score_HEADERS += include/rtems/score/priorityimpl.h
-include_rtems_score_HEADERS += include/rtems/score/processormask.h
-include_rtems_score_HEADERS += include/rtems/score/profiling.h
-include_rtems_score_HEADERS += include/rtems/score/protectedheap.h
-include_rtems_score_HEADERS += include/rtems/score/rbtree.h
-include_rtems_score_HEADERS += include/rtems/score/rbtreeimpl.h
-include_rtems_score_HEADERS += include/rtems/score/scheduler.h
-include_rtems_score_HEADERS += include/rtems/score/schedulercbs.h
-include_rtems_score_HEADERS += include/rtems/score/schedulercbsimpl.h
-include_rtems_score_HEADERS += include/rtems/score/scheduleredf.h
-include_rtems_score_HEADERS += include/rtems/score/scheduleredfimpl.h
-include_rtems_score_HEADERS += include/rtems/score/scheduleredfsmp.h
-include_rtems_score_HEADERS += include/rtems/score/schedulerimpl.h
-include_rtems_score_HEADERS += include/rtems/score/schedulernode.h
-include_rtems_score_HEADERS += include/rtems/score/schedulernodeimpl.h
-include_rtems_score_HEADERS += include/rtems/score/schedulerpriority.h
-include_rtems_score_HEADERS += include/rtems/score/schedulerpriorityaffinitysmp.h
-include_rtems_score_HEADERS += include/rtems/score/schedulerpriorityimpl.h
-include_rtems_score_HEADERS += include/rtems/score/schedulerprioritysmp.h
-include_rtems_score_HEADERS += include/rtems/score/schedulerprioritysmpimpl.h
-include_rtems_score_HEADERS += include/rtems/score/schedulersimple.h
-include_rtems_score_HEADERS += include/rtems/score/schedulersimpleimpl.h
-include_rtems_score_HEADERS += include/rtems/score/schedulersimplesmp.h
-include_rtems_score_HEADERS += include/rtems/score/schedulersmp.h
-include_rtems_score_HEADERS += include/rtems/score/schedulersmpimpl.h
-include_rtems_score_HEADERS += include/rtems/score/schedulerstrongapa.h
-include_rtems_score_HEADERS += include/rtems/score/semaphoreimpl.h
-include_rtems_score_HEADERS += include/rtems/score/smp.h
-include_rtems_score_HEADERS += include/rtems/score/smpbarrier.h
-include_rtems_score_HEADERS += include/rtems/score/smpimpl.h
-include_rtems_score_HEADERS += include/rtems/score/smplock.h
-include_rtems_score_HEADERS += include/rtems/score/smplockmcs.h
-include_rtems_score_HEADERS += include/rtems/score/smplockseq.h
-include_rtems_score_HEADERS += include/rtems/score/smplockstats.h
-include_rtems_score_HEADERS += include/rtems/score/smplockticket.h
-include_rtems_score_HEADERS += include/rtems/score/stack.h
-include_rtems_score_HEADERS += include/rtems/score/stackimpl.h
-include_rtems_score_HEADERS += include/rtems/score/states.h
-include_rtems_score_HEADERS += include/rtems/score/statesimpl.h
-include_rtems_score_HEADERS += include/rtems/score/status.h
-include_rtems_score_HEADERS += include/rtems/score/sysstate.h
-include_rtems_score_HEADERS += include/rtems/score/thread.h
-include_rtems_score_HEADERS += include/rtems/score/threaddispatch.h
-include_rtems_score_HEADERS += include/rtems/score/threadidledata.h
-include_rtems_score_HEADERS += include/rtems/score/threadimpl.h
-include_rtems_score_HEADERS += include/rtems/score/threadmp.h
-include_rtems_score_HEADERS += include/rtems/score/threadq.h
-include_rtems_score_HEADERS += include/rtems/score/threadqimpl.h
-include_rtems_score_HEADERS += include/rtems/score/threadqops.h
-include_rtems_score_HEADERS += include/rtems/score/timecounter.h
-include_rtems_score_HEADERS += include/rtems/score/timecounterimpl.h
-include_rtems_score_HEADERS += include/rtems/score/timespec.h
-include_rtems_score_HEADERS += include/rtems/score/timestamp.h
-include_rtems_score_HEADERS += include/rtems/score/timestampimpl.h
-include_rtems_score_HEADERS += include/rtems/score/tls.h
-include_rtems_score_HEADERS += include/rtems/score/todimpl.h
-include_rtems_score_HEADERS += include/rtems/score/userext.h
-include_rtems_score_HEADERS += include/rtems/score/userextdata.h
-include_rtems_score_HEADERS += include/rtems/score/userextimpl.h
-include_rtems_score_HEADERS += include/rtems/score/watchdog.h
-include_rtems_score_HEADERS += include/rtems/score/watchdogimpl.h
-include_rtems_score_HEADERS += include/rtems/score/watchdogticks.h
-include_rtems_score_HEADERS += include/rtems/score/wkspace.h
-include_rtems_score_HEADERS += include/rtems/score/wkspacedata.h
-include_rtems_trace_HEADERS += include/rtems/trace/rtems-trace-buffer-vars.h
-include_sys_HEADERS += include/sys/_ffcounter.h
-include_sys_HEADERS += include/sys/cdefs_elf.h
-include_sys_HEADERS += include/sys/endian.h
-include_sys_HEADERS += include/sys/event.h
-include_sys_HEADERS += include/sys/exec_elf.h
-include_sys_HEADERS += include/sys/poll.h
-include_sys_HEADERS += include/sys/priority.h
-include_sys_HEADERS += include/sys/statvfs.h
-include_sys_HEADERS += include/sys/timeffc.h
-include_sys_HEADERS += include/sys/timepps.h
-include_sys_HEADERS += include/sys/timetc.h
-include_sys_HEADERS += include/sys/timex.h
-include_sys_HEADERS += include/sys/utsname.h
-include_utf8proc_HEADERS += include/utf8proc/utf8proc.h
-include_uuid_HEADERS += include/uuid/uuid.h
diff --git a/cpukit/include/rtems.h b/cpukit/include/rtems.h
index 29716e9eaf..32d7769150 100644
--- a/cpukit/include/rtems.h
+++ b/cpukit/include/rtems.h
@@ -96,7 +96,7 @@ extern "C" {
*
* @ingroup RTEMSAPI
*
- * @brief This group contains the Classic API groups.
+ * @brief This group contains the Classic API managers.
*/
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/bspIo.h b/cpukit/include/rtems/bspIo.h
index ad196dfd34..b8a48e8237 100644
--- a/cpukit/include/rtems/bspIo.h
+++ b/cpukit/include/rtems/bspIo.h
@@ -1,154 +1,373 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
- * @brief Interface to Kernel Print Methods
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief This header file provides the kernel character input/output support
+ * API.
+ */
+
+/*
+ * Copyright (C) 2020, 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2015 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 include file defines the interface to kernel print methods.
+ * 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.
*/
/*
- * COPYRIGHT (c) 1998 valette@crf.canon.fr
- * COPYRIGHT (c) 2011 On-Line Applications Research Corporation.
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
*
- * 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.
+ * https://docs.rtems.org
*/
+/* Generated from spec:/rtems/io/if/header-3 */
+
#ifndef _RTEMS_BSPIO_H
#define _RTEMS_BSPIO_H
-#include <rtems/score/basedefs.h>
-
#include <stdarg.h>
+#include <rtems/score/basedefs.h>
#ifdef __cplusplus
extern "C" {
#endif
+/* Generated from spec:/rtems/io/if/group-3 */
+
/**
- * @defgroup BSPIO Kernel Print Support
+ * @defgroup RTEMSAPIKernelCharIO Kernel Character I/O Support
*
- * @ingroup RTEMSAPIPrintSupport
+ * @ingroup RTEMSAPIClassicIO
*
- * This module contains all methods and support related to providing
- * kernel level print support.
+ * @brief The kernel character input/output support is an extension of the @ref
+ * RTEMSAPIClassicIO to output characters to the kernel character output
+ * device and receive characters from the kernel character input device using
+ * a polled and non-blocking implementation.
*
- * The following variables below are declared as extern and
- * MUST be declared and initialized in each BSP. Using this indirect
- * function, the functionality in this group is tailored for the BSP.
- *
- * - BSP_output_char
- * - BSP_poll_char
+ * The directives may be used to print debug and test information. The kernel
+ * character input/output support should work even if no Console Driver is
+ * configured, see #CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER. The kernel
+ * character input and output device is provided by the BSP. Applications may
+ * change the device.
*/
+/* Generated from spec:/rtems/io/if/bsp-output-char-function-type */
+
/**
- * This type defines the prototype for the BSP provided method to
- * print a single character. It is assumed to be polled.
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief Polled character output functions shall have this type.
*/
-typedef void (*BSP_output_char_function_type) (char c);
+typedef void ( *BSP_output_char_function_type )( char );
+
+/* Generated from spec:/rtems/io/if/bsp-output-char */
/**
- * This type defines the prototype for the BSP provided method to
- * input a single character. It is assumed to be polled.
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief This function pointer references the kernel character output
+ * implementation.
+ *
+ * This function pointer shall never be NULL. It shall be provided by the BSP
+ * and statically initialized. The referenced function shall output exactly
+ * the character specified by the parameter. In particular, it shall not
+ * perform character translations, for example ``NL`` to ``CR`` followed by
+ * ``NR``. The function shall not block.
*/
-typedef int (*BSP_polling_getchar_function_type) (void);
+extern BSP_output_char_function_type BSP_output_char;
+
+/* Generated from spec:/rtems/io/if/putc */
/**
- * This variable points to the BSP provided method to output a
- * character for the purposes of debug output.
+ * @ingroup RTEMSAPIKernelCharIO
*
- * It must output only the specific character. It must not perform character
- * translations, e.g. "\n" to "\r\n".
+ * @brief Outputs the character to the kernel character output device.
+ *
+ * @param c is the character to output.
+ *
+ * The directive outputs the character specified by ``c`` to the kernel
+ * character output device using the polled character output implementation
+ * provided by #BSP_output_char. The directive performs a character
+ * translation from ``NL`` to ``CR`` followed by ``NR``.
+ *
+ * If the kernel character output device is concurrently accessed, then
+ * interleaved output may occur.
+ *
+ * @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
*/
-extern BSP_output_char_function_type BSP_output_char;
+void rtems_putc( char c );
+
+/* Generated from spec:/rtems/io/if/put-char */
/**
- * This variable points to the BSP provided method to input a
- * character for the purposes of debug input.
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief Puts the character using rtems_putc()
+ *
+ * @param c is the character to output.
+ *
+ * @param unused is an unused argument.
+ *
+ * @par Notes
+ * The directive is provided to support the RTEMS Testing Framework.
+ *
+ * @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
*/
-extern BSP_polling_getchar_function_type BSP_poll_char;
+void rtems_put_char( int c, void *unused );
+
+/* Generated from spec:/rtems/io/if/putk */
/**
- * @brief Get Character (kernel I/O)
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief Outputs the characters of the string and a newline character to the
+ * kernel character output device.
+ *
+ * @param s is the string to output.
+ *
+ * @return Returns the number of characters output to the kernel character
+ * output device.
+ *
+ * @par Notes
+ * @parblock
+ * The directive may be used to print debug and test information. It uses
+ * rtems_putc() to output the characters. This directive performs a character
+ * translation from ``NL`` to ``CR`` followed by ``NR``.
+ *
+ * If the kernel character output device is concurrently accessed, then
+ * interleaved output may occur.
+ * @endparblock
*
- * This method polls for a key in the simplest possible fashion
- * from whatever the debug console device is.
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * @return If a character is available, it is returned. Otherwise
- * this method returns -1.
+ * * The directive may be called from within any runtime context.
*
- * @note This method uses the BSP_poll_char pointer to a BSP
- * provided method.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-extern int getchark(void);
+int putk( const char *s );
+
+/* Generated from spec:/rtems/io/if/printk */
/**
- * @brief Variable Argument printk()
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief Outputs the characters defined by the format string and the arguments
+ * to the kernel character output device.
+ *
+ * @param fmt is a printf()-style format string.
+ *
+ * @param ... is a list of optional parameters required by the format string.
+ *
+ * @return Returns the number of characters output to the kernel character
+ * output device.
*
- * This method allows the user to access printk() functionality
- * with a va_list style argument.
+ * @par Notes
+ * @parblock
+ * The directive may be used to print debug and test information. It uses
+ * rtems_putc() to output the characters. This directive performs a character
+ * translation from ``NL`` to ``CR`` followed by ``NR``.
*
- * @param[in] fmt is a printf()-style format string
- * @param[in] ap is a va_list pointer to arguments
+ * If the kernel character output device is concurrently accessed, then
+ * interleaved output may occur.
+ * @endparblock
*
- * @return The number of characters output.
+ * @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.
+ *
+ * * Formatting of floating point numbers is not supported.
+ * @endparblock
*/
-extern int vprintk(const char *fmt, va_list ap);
+RTEMS_PRINTFLIKE( 1, 2 ) int printk( const char *fmt, ... );
-int rtems_printk_printer(
- void *ignored,
- const char *format,
- va_list ap
-);
+/* Generated from spec:/rtems/io/if/vprintk */
/**
- * @brief Kernel Print
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief Outputs the characters defined by the format string and the variable
+ * argument list to the kernel character output device.
+ *
+ * @param fmt is a printf()-style format string.
*
- * This method allows the user to perform a debug printk(). It performs a
- * character translation from "\n" to "\r\n".
+ * @param ap is the variable argument list required by the format string.
*
- * @param[in] fmt is a printf()-style format string
+ * @return Returns the number of characters output to the kernel character
+ * output device.
*
- * @return The number of characters output.
+ * @par Notes
+ * @parblock
+ * The directive may be used to print debug and test information. It uses
+ * rtems_putc() to output the characters. This directive performs a character
+ * translation from ``NL`` to ``CR`` followed by ``NR``.
+ *
+ * If the kernel character output device is concurrently accessed, then
+ * interleaved output may occur.
+ * @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.
+ *
+ * * Formatting of floating point numbers is not supported.
+ * @endparblock
*/
-extern int printk(const char *fmt, ...) RTEMS_PRINTFLIKE(1, 2);
+int vprintk( const char *fmt, va_list ap );
+
+/* Generated from spec:/rtems/io/if/printk-printer */
/**
- * @brief Kernel Put String
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief Outputs the characters defined by the format string and the variable
+ * argument list to the kernel character output device.
+ *
+ * @param unused is an unused argument.
+ *
+ * @param fmt is a printf()-style format string.
+ *
+ * @param ap is the variable argument list required by the format string.
*
- * This method allows the user to perform a debug puts().
+ * @return Returns the number of characters output to the kernel character
+ * output device.
*
- * @param[in] s is the string to print
+ * @par Notes
+ * @parblock
+ * The directive may be used to print debug and test information. It uses
+ * rtems_putc() to output the characters. This directive performs a character
+ * translation from ``NL`` to ``CR`` followed by ``NR``.
*
- * @return The number of characters output.
+ * If the kernel character output device is concurrently accessed, then
+ * interleaved output may occur.
+ * @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.
+ *
+ * * Formatting of floating point numbers is not supported.
+ * @endparblock
*/
-extern int putk(const char *s);
+int rtems_printk_printer( void *unused, const char *fmt, va_list ap );
+
+/* Generated from spec:/rtems/io/if/bsp-polling-getchar-function-type */
/**
- * @brief Kernel Put Character
+ * @ingroup RTEMSAPIKernelCharIO
*
- * This method allows the user to perform a debug putc(). It performs a
- * character translation from "\n" to "\r\n".
- *
- * @param[in] c is the character to print
+ * @brief Polled character input functions shall have this type.
*/
-extern void rtems_putc(char c);
+typedef int (* BSP_polling_getchar_function_type )( void );
+
+/* Generated from spec:/rtems/io/if/bsp-poll-char */
/**
- * @brief Puts the character via rtems_putc().
+ * @ingroup RTEMSAPIKernelCharIO
*
- * This is a compatibility function to support an internal API.
+ * @brief This function pointer may reference the kernel character input
+ * implementation.
*
- * @param c The character to put.
- * @param arg Ignored.
+ * This function pointer may be NULL. It may reference a function provided by
+ * the BSP. Referenced functions shall dequeue the least recently received
+ * character from the device and return it as an unsigned character. If no
+ * character is enqueued on the device, then the function shall immediately
+ * return the value minus one.
*/
-void rtems_put_char( int c, void *arg );
+extern BSP_polling_getchar_function_type BSP_poll_char;
-/**@}*/
+/* Generated from spec:/rtems/io/if/getchark */
+
+/**
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief Tries to dequeue a character from the kernel character input device.
+ *
+ * The directive tries to dequeue a character from the kernel character input
+ * device using the polled character input implementation referenced by
+ * #BSP_poll_char if it is available.
+ *
+ * @retval -1 The #BSP_poll_char pointer was equal to NULL.
+ *
+ * @retval -1 There was no character enqueued on the kernel character input
+ * device.
+ *
+ * @return Returns the character least recently enqueued on the kernel
+ * character input device as an unsigned character value.
+ *
+ * @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
+ */
+int getchark( void );
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* _RTEMS_BSPIO_H */
diff --git a/cpukit/include/rtems/confdefs/percpu.h b/cpukit/include/rtems/confdefs/percpu.h
index badb616988..3bea8340cb 100644
--- a/cpukit/include/rtems/confdefs/percpu.h
+++ b/cpukit/include/rtems/confdefs/percpu.h
@@ -134,11 +134,19 @@ RTEMS_DEFINE_GLOBAL_SYMBOL(
const size_t _Thread_Idle_stack_size = CONFIGURE_IDLE_TASK_STACK_SIZE;
-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" );
+/*
+ * 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)
diff --git a/cpukit/include/rtems/confdefs/wkspace.h b/cpukit/include/rtems/confdefs/wkspace.h
index 1db4f2d09d..82de8633bf 100644
--- a/cpukit/include/rtems/confdefs/wkspace.h
+++ b/cpukit/include/rtems/confdefs/wkspace.h
@@ -167,12 +167,14 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE;
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wtautological-pointer-compare"
+ /* Custom allocator may or may not use the work space. */
#ifdef CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
const bool _Stack_Allocator_avoids_workspace = true;
#else
const bool _Stack_Allocator_avoids_workspace = false;
#endif
+ /* Custom allocator may or may not need initialization. */
#ifdef CONFIGURE_TASK_STACK_ALLOCATOR_INIT
const Stack_Allocator_initialize _Stack_Allocator_initialize =
_CONFIGURE_ASSERT_NOT_NULL(
@@ -187,6 +189,7 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE;
);
#endif
+ /* Custom allocator must include allocate and free */
const Stack_Allocator_allocate _Stack_Allocator_allocate =
_CONFIGURE_ASSERT_NOT_NULL(
Stack_Allocator_allocate,
@@ -200,11 +203,24 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE;
);
#pragma GCC diagnostic pop
+
+/*
+ * Must provide both a custom stack allocator and deallocator
+ */
#elif defined(CONFIGURE_TASK_STACK_ALLOCATOR) \
|| defined(CONFIGURE_TASK_STACK_DEALLOCATOR)
#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;
+#endif
+
#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 afcee4381b..7b15bc34a2 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -368,6 +368,18 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
*/
#define rtems_configuration_get_stack_free_hook() _Stack_Allocator_free
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief Gets the IDLE thread stack allocator hook configured for this
+ * application.
+ *
+ * @return Returns the IDLE thread stack allocator hook configured for this
+ * application.
+ */
+#define rtems_configuration_get_stack_allocate_for_idle_hook() \
+ (_Stack_Allocator_allocate_for_idle)
+
/* Generated from spec:/rtems/config/if/get-stack-space-size */
/**
diff --git a/cpukit/include/rtems/counter.h b/cpukit/include/rtems/counter.h
index 5bf7736e4a..0053afcbd5 100644
--- a/cpukit/include/rtems/counter.h
+++ b/cpukit/include/rtems/counter.h
@@ -1,9 +1,10 @@
/**
* @file
*
- * @ingroup ClassicCounter
+ * @ingroup RTEMSAPICounter
*
- * @brief Free-Running Counter and Busy Wait Delay API
+ * @brief This header file defines the Free-Running Counter and Busy Wait Delay
+ * API.
*/
/*
diff --git a/cpukit/include/rtems/cpuuse.h b/cpukit/include/rtems/cpuuse.h
index 50c986671d..86338a7332 100644
--- a/cpukit/include/rtems/cpuuse.h
+++ b/cpukit/include/rtems/cpuuse.h
@@ -1,87 +1,228 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
* @ingroup libmisc_cpuuse
*
- * @brief CPU Usage Report
+ * @brief This header file provides the CPU usage reporting API.
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * This include file contains information necessary to utilize
- * and install the cpu usage reporting mechanism.
+ * 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.
*/
/*
- * COPYRIGHT (c) 1989-2011.
- * On-Line Applications Research Corporation (OAR).
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
*
- * 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.
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
*/
-#ifndef __RTEMS_CPUUSE_h
-#define __RTEMS_CPUUSE_h
+/* Generated from spec:/rtems/cpuuse/if/header */
-#include <rtems.h>
-#include <rtems/print.h>
+#ifndef _RTEMS_CPUUSE_H
+#define _RTEMS_CPUUSE_H
-/**
- * @defgroup libmisc_cpuuse CPU Usage
- *
- * @ingroup RTEMSAPIClassic
- */
-/**@{*/
#ifdef __cplusplus
extern "C" {
#endif
-/*
- * rtems_cpu_usage_report_with_handler
+/* Generated from spec:/rtems/cpuuse/if/group */
+
+/**
+ * @defgroup libmisc_cpuuse CPU Usage Reporting
+ *
+ * @ingroup RTEMSAPI
+ *
+ * @brief The CPU usage reporting directives can be used to report and reset
+ * the CPU usage of threads.
*/
-void rtems_cpu_usage_report_with_plugin( const rtems_printer *printer );
+/* Generated from spec:/rtems/cpuuse/if/printer */
+
+/* Forward declaration */
+struct rtems_printer;
+
+/* Generated from spec:/rtems/cpuuse/if/cpu-info-report */
/**
- * @brief Report CPU usage.
+ * @ingroup libmisc_cpuuse
+ *
+ * @brief Reports the CPU information using the printer plugin.
+ *
+ * @param printer is the printer plugin to output the report.
+ *
+ * @return Returns the number of characters printed.
*
- * CPU Usage Reporter
+ * @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
*/
+int rtems_cpu_info_report( const struct rtems_printer *printer );
+/* Generated from spec:/rtems/cpuuse/if/report */
+
+/**
+ * @ingroup libmisc_cpuuse
+ *
+ * @brief Reports the CPU usage of each thread using the printk() printer.
+ *
+ * @par Notes
+ * See also rtems_cpu_usage_report_with_plugin().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
+ */
void rtems_cpu_usage_report( void );
+/* Generated from spec:/rtems/cpuuse/if/report-with-plugin */
+
/**
- * @brief CPU usage Top plugin
+ * @ingroup libmisc_cpuuse
+ *
+ * @brief Reports the CPU usage of each thread using the printer plugin.
+ *
+ * @param printer is the printer plugin to output the report.
*
- * Report CPU Usage in top format to
- * to a print plugin.
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
*/
-void rtems_cpu_usage_top_with_plugin( const rtems_printer *printer );
+void rtems_cpu_usage_report_with_plugin( const struct rtems_printer *printer );
+
+/* Generated from spec:/rtems/cpuuse/if/reset */
/**
- * @brief CPU usage top.
+ * @ingroup libmisc_cpuuse
+ *
+ * @brief Resets the CPU usage of each thread.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
*
- * CPU Usage top
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
*/
+void rtems_cpu_usage_reset( void );
-void rtems_cpu_usage_top( void );
+/* Generated from spec:/rtems/cpuuse/if/top */
/**
- * @brief Reset CPU usage.
+ * @ingroup libmisc_cpuuse
*
- * CPU Usage Reporter
+ * @brief Starts an interactive CPU usage reporting using the printk() printer.
+ *
+ * @par Notes
+ * See also rtems_cpu_usage_top_with_plugin().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ *
+ * * The directive sends a request to another task and waits for a response.
+ * This may cause the calling task to be blocked and unblocked.
+ * @endparblock
*/
+void rtems_cpu_usage_top( void );
-void rtems_cpu_usage_reset( void );
+/* Generated from spec:/rtems/cpuuse/if/top-with-plugin */
/**
- * @brief Reports per-processor information.
+ * @ingroup libmisc_cpuuse
*
- * @return The number of characters printed.
+ * @brief Starts an interactive CPU usage reporting using the printer plugin.
+ *
+ * @param printer is the printer plugin to output the report.
+ *
+ * @par Notes
+ * The directive starts a task to do the reporting. The getchar() function is
+ * used to get commands from the user.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ *
+ * * The directive sends a request to another task and waits for a response.
+ * This may cause the calling task to be blocked and unblocked.
+ * @endparblock
*/
-int rtems_cpu_info_report( const rtems_printer *printer );
+void rtems_cpu_usage_top_with_plugin( const struct rtems_printer *printer );
#ifdef __cplusplus
}
#endif
-/**@}*/
-#endif
-/* end of include file */
+
+#endif /* _RTEMS_CPUUSE_H */
diff --git a/cpukit/include/rtems/extension.h b/cpukit/include/rtems/extension.h
index 6f97ebe24c..0117a41b8a 100644
--- a/cpukit/include/rtems/extension.h
+++ b/cpukit/include/rtems/extension.h
@@ -1,190 +1,314 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
* @ingroup RTEMSImplClassicUserExt
*
- * @brief User Extensions API.
+ * @brief This header file defines the User Extensions Manager API.
+ */
+
+/*
+ * Copyright (C) 2009, 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1988, 2008 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.
*/
/*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
*
- * 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.
+ * https://docs.rtems.org
*/
+/* Generated from spec:/rtems/userext/if/header */
+
#ifndef _RTEMS_EXTENSION_H
#define _RTEMS_EXTENSION_H
#include <rtems/rtems/status.h>
#include <rtems/rtems/types.h>
-#include <rtems/score/userext.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/userextdata.h>
#ifdef __cplusplus
extern "C" {
#endif
+/* Generated from spec:/rtems/userext/if/group */
+
/**
* @defgroup RTEMSAPIClassicUserExt User Extensions Manager
*
* @ingroup RTEMSAPIClassic
*
* @brief The User Extensions Manager allows the application developer to
- * augment the executive by allowing them to supply extension routines which
- * are invoked at critical system events.
- *
- * @section RTEMSAPIClassicUserExtSets Extension Sets
- *
- * An @ref User_extensions_Table "extension set" is defined as a set of
- * routines which are invoked at each of the critical system events at which
- * user extension routines are invoked. Together a set of these routines
- * typically perform a specific functionality such as performance monitoring or
- * debugger support.
- *
- * RTEMS allows the user to have multiple extension sets active at the same
- * time. First, a single static extension set may be defined as the
- * application's User Extension Table which is included as part of the
- * Configuration Table. This extension set is active for the entire life of the
- * system and may not be deleted. This extension set is especially important
- * because it is the only way the application can provided a fatal error
- * extension which is invoked if RTEMS fails during the
- * rtems_initialize_data_structures() directive. The static extension set is
- * optional and may be configured as @c NULL if no static extension set is
- * required.
- *
- * Second, the user can install dynamic extensions using the
- * rtems_extension_create() directive. These extensions are RTEMS objects in
- * that they have a name, an ID, and can be dynamically created and deleted. In
- * contrast to the static extension set, these extensions can only be created
- * and installed after the rtems_initialize_data_structures() directive
- * successfully completes execution. Dynamic extensions are useful for
- * encapsulating the functionality of an extension set. For example, the
- * application could use extensions to manage a special coprocessor, do
- * performance monitoring, and to do stack bounds checking. Each of these
- * extension sets could be written and installed independently of the others.
- *
- * All user extensions are optional and RTEMS places no naming restrictions on
- * the user. The user extension entry points are copied into an internal RTEMS
- * structure. This means the user does not need to keep the table after
- * creating it, and changing the handler entry points dynamically in a table
- * once created has no effect. Creating a table local to a function can save
- * space in space limited applications.
- *
- * Extension switches do not effect the context switch overhead if no switch
- * handler is installed.
- *
- * @section RTEMSAPIClassicUserExtTCB Task Control Block Area
- *
- * RTEMS provides for a pointer to a user-defined data area for each extension
- * set to be linked to each task's control block (TCB). This area is only
- * available for the dynamic extensions. This set of pointers is an extension
- * of the TCB and can be used to store additional data required by the user's
- * extension functions.
- *
- * The TCB extension is an array of pointers in the TCB. The index into the
- * table can be obtained from the extension identifier returned when the
- * extension is created:
- *
- * @code
- * rtems_tcb *task = some_task;
- * size_t index = rtems_object_id_get_index(extension_id);
- * void *extension_data = task->extensions [index];
- * @endcode
- *
- * The number of pointers in the area is the same as the number of user
- * extension sets configured. This allows an application to augment the TCB
- * with user-defined information. For example, an application could implement
- * task profiling by storing timing statistics in the TCB's extended memory
- * area. When a task context switch is being executed, the task switch
- * extension could read a real-time clock to calculate how long the task being
- * swapped out has run as well as timestamp the starting time for the task
- * being swapped in.
- *
- * If used, the extended memory area for the TCB should be allocated and the
- * TCB extension pointer should be set at the time the task is created or
- * started by either the task create or task start extension. The application
- * is responsible for managing this extended memory area for the TCBs. The
- * memory may be reinitialized by the task restart extension and should be
- * deallocated by the task delete extension when the task is deleted. Since the
- * TCB extension buffers would most likely be of a fixed size, the RTEMS
- * partition manager could be used to manage the application's extended memory
- * area. The application could create a partition of fixed size TCB extension
- * buffers and use the partition manager's allocation and deallocation
- * directives to obtain and release the extension buffers.
- *
- * @section RTEMSAPIClassicUserExtOrder Order of Invokation
- *
- * When one of the critical system events occur, the user extensions are
- * invoked in either @a forward or @a reverse order. Forward order indicates
- * that the static extension set is invoked followed by the dynamic extension
- * sets in the order in which they were created. Reverse order means that the
- * dynamic extension sets are invoked in the opposite of the order in which
- * they were created followed by the static extension set. By invoking the
- * extension sets in this order, extensions can be built upon one another. At
- * the following system events, the extensions are invoked in forward order:
- *
- * - Task creation
- * - Task start
- * - Task restart
- * - Task context switch
- * - Post task context switch
- * - Task begins to execute
- *
- * At the following system events, the extensions are invoked in reverse order:
- *
- * - Task exit
- * - Task deletion
- * - Fatal error detection
- *
- * At these system events, the extensions are invoked in reverse order to
- * insure that if an extension set is built upon another, the more complicated
- * extension is invoked before the extension set it is built upon. For example,
- * by invoking the static extension set last it is known that the "system"
- * fatal error extension will be the last fatal error extension executed.
- * Another example is use of the task delete extension by the Standard C
- * Library. Extension sets which are installed after the Standard C Library
- * will operate correctly even if they utilize the C Library because the C
- * Library's task delete extension is invoked after that of the other
- * extensions.
- */
-/**@{**/
-
-typedef User_extensions_thread_create_extension rtems_task_create_extension;
-typedef User_extensions_thread_delete_extension rtems_task_delete_extension;
-typedef User_extensions_thread_start_extension rtems_task_start_extension;
-typedef User_extensions_thread_restart_extension rtems_task_restart_extension;
-typedef User_extensions_thread_switch_extension rtems_task_switch_extension;
-typedef User_extensions_thread_begin_extension rtems_task_begin_extension;
-typedef User_extensions_thread_exitted_extension rtems_task_exitted_extension;
-typedef User_extensions_fatal_extension rtems_fatal_extension;
-typedef User_extensions_thread_terminate_extension rtems_task_terminate_extension;
+ * augment the executive by allowing them to supply extension routines which
+ * are invoked at critical system events.
+ */
-typedef User_extensions_Table rtems_extensions_table;
+/* Generated from spec:/rtems/userext/if/delete */
-typedef Internal_errors_Source rtems_fatal_source;
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Deletes the extension set.
+ *
+ * @param id is the extension set identifier.
+ *
+ * This directive deletes the extension set specified by ``id``.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no extension set associated with the
+ * identifier specified by ``id``.
+ *
+ * @par Notes
+ * The ESCB for the deleted extension set is reclaimed by RTEMS.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ *
+ * * The calling task does not have to be the task that created the object.
+ * Any local task that knows the object identifier can delete the object.
+ * @endparblock
+ */
+rtems_status_code rtems_extension_delete( rtems_id id );
+
+/* Generated from spec:/rtems/userext/if/fatal */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Fatal extensions are invoked when the system should terminate.
+ *
+ * @param source is the system termination source. The source indicates the
+ * component which caused the system termination request, see
+ * ::rtems_fatal_source. The system termination code may provide additional
+ * information related to the system termination request.
+ *
+ * @param always_set_to_false is a value equal to false.
+ *
+ * @param code is the system termination code. This value must be interpreted
+ * with respect to the source.
+ *
+ * @par Notes
+ * @parblock
+ * The fatal extensions are invoked in extension forward order.
+ *
+ * The fatal extension should be extremely careful with respect to the RTEMS
+ * directives it calls. Depending on the system termination source, the system
+ * may be in an undefined and corrupt state.
+ *
+ * It is recommended to register fatal extensions through initial extension
+ * sets, see #CONFIGURE_INITIAL_EXTENSIONS.
+ * @endparblock
+ */
+typedef User_extensions_fatal_extension rtems_fatal_extension;
+
+/* Generated from spec:/rtems/userext/if/fatal-code */
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief This integer type represents system termination codes.
+ *
+ * This integer type is large enough to store a 32-bit integer or a pointer.
+ *
+ * @par Notes
+ * The interpretation of a system termination code depends on the system
+ * termination source, see ::rtems_fatal_source.
+ */
typedef Internal_errors_t rtems_fatal_code;
+/* Generated from spec:/rtems/userext/if/fatal-source */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief This enumeration represents system termination sources.
+ *
+ * @par Notes
+ * The system termination code may provide additional information depending on
+ * the system termination source, see ::rtems_fatal_code.
+ */
+typedef Internal_errors_Source rtems_fatal_source;
+
+/* Generated from spec:/rtems/userext/if/ident */
+
/**
- * @brief Creates an extension set object.
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Identifies an extension set by the object name.
+ *
+ * @param name is the object name to look up.
+ *
+ * @param[out] id is the pointer to an ::rtems_id object. When the directive
+ * call is successful, the object identifier of an object with the specified
+ * name will be stored in this object.
+ *
+ * This directive obtains an extension set identifier associated with the
+ * extension set name specified in ``name``.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_NAME The ``name`` parameter was 0.
+ *
+ * @retval ::RTEMS_INVALID_NAME There was no object with the specified name on
+ * the local node.
*
- * This directive creates a extension set object from the extension table
- * @a extension_table. The assigned extension set identifier is returned in
- * @a id. The identifier is used to access this extension set in other
- * extension set related directives. The name @a name will be assigned to the
- * extension set object.
+ * @par Notes
+ * @parblock
+ * If the extension set name is not unique, then the extension set identifier
+ * will match the first extension set with that name in the search order.
+ * However, this extension set identifier is not guaranteed to correspond to
+ * the desired extension set.
*
- * Newly created extension sets are immediately installed and are invoked upon
- * the next system event supporting an extension.
+ * The objects are searched from lowest to the highest index. Only the local
+ * node is searched.
*
- * This directive will not cause the calling task to be preempted.
+ * The extension set identifier is used with other extension related directives
+ * to access the extension set.
+ * @endparblock
*
- * @retval RTEMS_SUCCESSFUL Extension set created successfully.
- * @retval RTEMS_INVALID_ADDRESS Identifier pointer is @c NULL.
- * @retval RTEMS_INVALID_NAME Invalid extension set name.
- * @retval RTEMS_TOO_MANY Too many extension sets created.
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_extension_ident( rtems_name name, rtems_id *id );
+
+/* Generated from spec:/rtems/userext/if/table */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief The extensions table contains a set of extensions which may be
+ * registered in the system through the #CONFIGURE_INITIAL_EXTENSIONS
+ * application configuration option or the rtems_extension_create()
+ * directive.
+ */
+typedef User_extensions_Table rtems_extensions_table;
+
+/* Generated from spec:/rtems/userext/if/create */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Creates an extension set.
+ *
+ * @param name is the object name of the extension set.
+ *
+ * @param extension_table is the table with the extensions to be used by the
+ * extension set.
+ *
+ * @param[out] id is the pointer to an ::rtems_id object. When the directive
+ * call is successful, the identifier of the created extension set will be
+ * stored in this object.
+ *
+ * This directive creates an extension set which resides on the local node.
+ * The extension set has the user-defined object name specified in ``name``.
+ * The assigned object identifier is returned in ``id``. This identifier is
+ * used to access the extension set with other extension set related
+ * directives.
+ *
+ * The extension set is initialized using the extension table specified in
+ * ``extension_table``.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_NAME The ``name`` parameter was invalid.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``extension_table`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL.
+ *
+ * @retval ::RTEMS_TOO_MANY There was no inactive object available to create an
+ * extension set. The number of extension sets available to the application
+ * is configured through the #CONFIGURE_MAXIMUM_USER_EXTENSIONS application
+ * configuration option.
+ *
+ * @par Notes
+ * @parblock
+ * The user-provided extension table is not used after the return of the
+ * directive.
+ *
+ * Each extension of the extension table is optional and may be NULL. All
+ * extensions except the task switch extension of the extension table are
+ * atomically and immediately installed. A task switch extension is separately
+ * installed after the other extensions. The extensions of the extension table
+ * are invoked upon the next system event supporting an extension.
+ *
+ * An alternative to dynamically created extension sets are initial extensions,
+ * see #CONFIGURE_INITIAL_EXTENSIONS. Initial extensions are recommended for
+ * extension sets which provide a fatal error extension.
+ *
+ * For control and maintenance of the extension set, RTEMS allocates a ESCB
+ * from the local ESCB free pool and initializes it.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ *
+ * * The number of extension sets available to the application is configured
+ * through the #CONFIGURE_MAXIMUM_USER_EXTENSIONS application configuration
+ * option.
+ * @endparblock
*/
rtems_status_code rtems_extension_create(
rtems_name name,
@@ -192,47 +316,334 @@ rtems_status_code rtems_extension_create(
rtems_id *id
);
+/* Generated from spec:/rtems/userext/if/task-begin */
+
/**
- * @brief Identifies an extension set object by a name.
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Task begin extensions are invoked when a task begins execution.
*
- * This directive obtains an extension set identifier in @a id associated with
- * the extension set name @a name. If the extension set name is not unique,
- * then the extension set identifier will match one of the extension sets with
- * that name. However, this extension set identifier is not guaranteed to
- * correspond to the desired extension set. The extension set identifier is
- * used to access this extension set in other extension set related directives.
+ * @param executing is the TCB of the executing thread.
*
- * This directive will not cause the calling task to be preempted.
+ * @par Notes
+ * @parblock
+ * The task begin extensions are invoked in extension forward order.
*
- * @retval RTEMS_SUCCESSFUL Extension set identified successfully.
- * @retval RTEMS_INVALID_ADDRESS Identifier pointer is @c NULL.
- * @retval RTEMS_INVALID_NAME Extension set name not found or invalid name.
+ * Task begin extensions are invoked with thread dispatching enabled. This
+ * allows the use of dynamic memory allocation, creation of POSIX keys, and use
+ * of C++ thread-local storage. Blocking synchronization primitives are
+ * allowed also.
+ *
+ * The task begin extensions are invoked before the global construction.
+ *
+ * The task begin extensions may be called as a result of a task restart
+ * through rtems_task_restart().
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to functions of this type:
+ *
+ * * Thread dispatching is enabled.
+ *
+ * * The executing thread is not the owner of the object allocator mutex.
+ * @endparblock
*/
-rtems_status_code rtems_extension_ident(
- rtems_name name,
- rtems_id *id
-);
+typedef User_extensions_thread_begin_extension rtems_task_begin_extension;
+
+/* Generated from spec:/rtems/userext/if/task-create */
/**
- * @brief Deletes an extension set object specified by the identifier @a id.
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Task create extensions are invoked when a task is created.
+ *
+ * @param executing is the TCB of the executing thread. When the idle thread
+ * is created, the executing thread is equal to NULL.
+ *
+ * @param created is the TCB of the created thread.
+ *
+ * @return Returns true, if the task create extension was successful, otherwise
+ * false.
+ *
+ * @par Notes
+ * @parblock
+ * The task create extensions are invoked in extension forward order.
*
- * Any subsequent references to the extension's name and identifier are
- * invalid.
+ * The task create extensions are invoked after a new task has been completely
+ * initialized, but before it is started.
*
- * This directive will not cause the calling task to be preempted.
+ * While normal tasks are created, the executing thread is the owner of the
+ * object allocator mutex. The object allocator mutex allows nesting, so the
+ * normal memory allocation routines can be used allocate memory for the
+ * created thread.
*
- * @retval RTEMS_SUCCESSFUL Extension set deleted successfully.
- * @retval RTEMS_INVALID_ID Invalid extension set identifier.
+ * If the task create extension returns false, then the task create operation
+ * stops immediately and the entire task create operation will fail. In this
+ * case, all task delete extensions are invoked, see
+ * ::rtems_task_delete_extension.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to functions of this type:
+ *
+ * * While the system is initialized, thread dispatching is disabled.
+ *
+ * * While the system is in the multitasking state, thread dispatching is
+ * enabled.
+ *
+ * * While an idle thread or another internal system thread is created, the
+ * object allocator mutex has no owner.
+ *
+ * * While a task is created by rtems_task_create(), the executing thread is
+ * the owner of the object allocator mutex.
+ *
+ * * While a task is constructed by rtems_task_construct(), the executing
+ * thread is the owner of the object allocator mutex.
+ *
+ * * While a task is created by pthread_create(), the executing thread is the
+ * owner of the object allocator mutex.
+ * @endparblock
*/
-rtems_status_code rtems_extension_delete(
- rtems_id id
-);
+typedef User_extensions_thread_create_extension rtems_task_create_extension;
+
+/* Generated from spec:/rtems/userext/if/task-delete */
-/** @} */
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Task delete extensions are invoked when a task is deleted.
+ *
+ * @param executing is the TCB of the executing thread. If the idle thread is
+ * created and one of the initial task create extension fails, then the
+ * executing thread is equal to NULL.
+ *
+ * @param created is the TCB of the deleted thread. The executing and deleted
+ * arguments are never equal.
+ *
+ * @par Notes
+ * @parblock
+ * The task delete extensions are invoked in extension reverse order.
+ *
+ * The task delete extensions are invoked by task create directives before an
+ * attempt to allocate a TCB is made.
+ *
+ * If a task create extension failed, then a task delete extension may be
+ * invoked without a previous invocation of the corresponding task create
+ * extension of the extension set.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to functions of this type:
+ *
+ * * While the system is initialized, thread dispatching is disabled.
+ *
+ * * While the system is in the multitasking state, thread dispatching is
+ * enabled.
+ *
+ * * While an idle thread or another internal system thread is created, the
+ * object allocator mutex has no owner.
+ *
+ * * While a task is created by rtems_task_create(), the executing thread is
+ * the owner of the object allocator mutex.
+ *
+ * * While a task is constructed by rtems_task_construct(), the executing
+ * thread is the owner of the object allocator mutex.
+ *
+ * * While a task is created by pthread_create(), the executing thread is the
+ * owner of the object allocator mutex.
+ * @endparblock
+ */
+typedef User_extensions_thread_delete_extension rtems_task_delete_extension;
+
+/* Generated from spec:/rtems/userext/if/task-exitted */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Task exitted extensions are invoked when a task entry returns.
+ *
+ * @param executing is the TCB of the executing thread.
+ *
+ * @par Notes
+ * The task exitted extensions are invoked in extension forward order.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to functions of this type:
+ *
+ * * Thread dispatching is enabled.
+ * @endparblock
+ */
+typedef User_extensions_thread_exitted_extension rtems_task_exitted_extension;
+
+/* Generated from spec:/rtems/userext/if/task-restart */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Task restart extensions are invoked when a task restarts.
+ *
+ * @param executing is the TCB of the executing thread.
+ *
+ * @param restarted is the TCB of the executing thread. Yes, the executing
+ * thread.
+ *
+ * @par Notes
+ * @parblock
+ * The task restart extensions are invoked in extension forward order.
+ *
+ * The task restart extensions are invoked in the context of the restarted
+ * thread right before the execution context is reloaded. The thread stack
+ * reflects the previous execution context.
+ *
+ * Thread restart and delete requests issued by restart extensions lead to
+ * recursion.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to functions of this type:
+ *
+ * * Thread dispatching is enabled.
+ *
+ * * Thread life is protected.
+ *
+ * * The executing thread is not the owner of the object allocator mutex.
+ * @endparblock
+ */
+typedef User_extensions_thread_restart_extension rtems_task_restart_extension;
+
+/* Generated from spec:/rtems/userext/if/task-start */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Task start extensions are invoked when a task was made ready for the
+ * first time.
+ *
+ * @param executing is the TCB of the executing thread.
+ *
+ * @param started is the TCB of the started thread.
+ *
+ * @par Notes
+ * @parblock
+ * The task start extensions are invoked in extension forward order.
+ *
+ * In SMP configurations, the thread may already run on another processor
+ * before the task start extensions are actually invoked. Task switch and task
+ * begin extensions may run before or in parallel with the thread start
+ * extension in SMP configurations, see ::rtems_task_switch_extension and
+ * ::rtems_task_begin_extension.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to functions of this type:
+ *
+ * * Thread dispatching is disabled.
+ * @endparblock
+ */
+typedef User_extensions_thread_start_extension rtems_task_start_extension;
+
+/* Generated from spec:/rtems/userext/if/task-switch */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Task switch extensions are invoked when a thread switch from an
+ * executing thread to a heir thread takes place.
+ *
+ * @param executing is the TCB of the executing thread. In SMP configurations,
+ * this is the previously executing thread also known as the ancestor thread.
+ *
+ * @param heir is the TCB of the heir thread. In SMP configurations, this is
+ * the executing thread.
+ *
+ * @par Notes
+ * @parblock
+ * The task switch extensions are invoked in extension forward order.
+ *
+ * The invocation conditions of the task switch extensions depend on whether
+ * RTEMS was built with SMP support enabled or disabled. A user must pay
+ * attention to the differences to correctly implement a task switch extension.
+ *
+ * Where the system was built with SMP support disabled, the task switch
+ * extensions are invoked before the context switch from the currently
+ * executing thread to the heir thread. The executing is a pointer to the TCB
+ * of the currently executing thread. The heir is a pointer to the TCB of the
+ * heir thread. The context switch initiated through the multitasking start is
+ * not covered by the task switch extensions.
+ *
+ * Where the system was built with SMP support enabled, the task switch
+ * extensions are invoked after the context switch to the heir thread. The
+ * executing is a pointer to the TCB of the previously executing thread.
+ * Despite the name, this is not the currently executing thread. The heir is a
+ * pointer to the TCB of the newly executing thread. This is the currently
+ * executing thread. The context switches initiated through the multitasking
+ * start are covered by the task switch extensions. The reason for the
+ * differences to uniprocessor configurations is that the context switch may
+ * update the heir thread of the processor. The task switch extensions are
+ * invoked with maskable interrupts disabled and with ownership of a
+ * processor-specific SMP lock. Task switch extensions may run in parallel on
+ * multiple processors. It is recommended to use thread-local or
+ * processor-specific data structures for task switch extensions. A global SMP
+ * lock should be avoided for performance reasons, see
+ * rtems_interrupt_lock_initialize().
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to functions of this type:
+ *
+ * * Thread dispatching is disabled.
+ *
+ * * Where the system was built with SMP support enabled, maskable interrupts
+ * are disabled for the executing thread.
+ * @endparblock
+ */
+typedef User_extensions_thread_switch_extension rtems_task_switch_extension;
+
+/* Generated from spec:/rtems/userext/if/task-terminate */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Task terminate extensions are invoked when a task terminates.
+ *
+ * @param executing is the TCB of the executing thread. This is the
+ * terminating thread.
+ *
+ * @par Notes
+ * @parblock
+ * The task terminate extensions are invoked in extension reverse order.
+ *
+ * The task terminate extensions are invoked in the context of the terminating
+ * thread right before the thread dispatch to the heir thread should take
+ * place. The thread stack reflects the previous execution context. The POSIX
+ * cleanup and key destructors execute in this context.
+ *
+ * Thread restart and delete requests issued by terminate extensions lead to
+ * recursion.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to functions of this type:
+ *
+ * * Thread dispatching is enabled.
+ *
+ * * Thread life is protected.
+ *
+ * * The executing thread is not the owner of the object allocator mutex.
+ * @endparblock
+ */
+typedef User_extensions_thread_terminate_extension rtems_task_terminate_extension;
#ifdef __cplusplus
}
#endif
-#endif
-/* end of include file */
+#endif /* _RTEMS_EXTENSION_H */
diff --git a/cpukit/include/rtems/monitor.h b/cpukit/include/rtems/monitor.h
index d0a79c03be..9367e2b6e8 100644
--- a/cpukit/include/rtems/monitor.h
+++ b/cpukit/include/rtems/monitor.h
@@ -192,7 +192,7 @@ typedef struct {
rtems_name name;
/* end of common portion */
rtems_attribute attribute;
- void * start_addr;
+ const void * start_addr;
uint32_t length;
uint32_t buf_size;
uint32_t used_blocks;
diff --git a/cpukit/include/rtems/posix/muteximpl.h b/cpukit/include/rtems/posix/muteximpl.h
index 435b43634d..3decb6f4ac 100644
--- a/cpukit/include/rtems/posix/muteximpl.h
+++ b/cpukit/include/rtems/posix/muteximpl.h
@@ -273,7 +273,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Set_priority(
owner,
&the_mutex->Priority_ceiling,
priority_ceiling,
- false,
+ PRIORITY_GROUP_LAST,
queue_context
);
_Thread_Wait_release( owner, queue_context );
@@ -382,10 +382,7 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_surrender(
Thread_queue_Context *queue_context
)
{
- unsigned int nest_level;
- ISR_lock_Context lock_context;
- Per_CPU_Control *cpu_self;
- Thread_queue_Heads *heads;
+ unsigned int nest_level;
if ( !_POSIX_Mutex_Is_owner( the_mutex, executing ) ) {
_POSIX_Mutex_Release( the_mutex, queue_context );
@@ -400,48 +397,13 @@ RTEMS_INLINE_ROUTINE Status_Control _POSIX_Mutex_Ceiling_surrender(
return STATUS_SUCCESSFUL;
}
- _Thread_Resource_count_decrement( executing );
-
- _Thread_queue_Context_clear_priority_updates( queue_context );
- _Thread_Wait_acquire_default_critical( executing, &lock_context );
- _Thread_Priority_remove(
+ return _Thread_queue_Surrender_priority_ceiling(
+ &the_mutex->Recursive.Mutex.Queue.Queue,
executing,
&the_mutex->Priority_ceiling,
- queue_context
+ queue_context,
+ POSIX_MUTEX_PRIORITY_CEILING_TQ_OPERATIONS
);
- _Thread_Wait_release_default_critical( executing, &lock_context );
-
- cpu_self = _Thread_queue_Dispatch_disable( queue_context );
-
- heads = the_mutex->Recursive.Mutex.Queue.Queue.heads;
-
- if ( heads != NULL ) {
- const Thread_queue_Operations *operations;
- Thread_Control *new_owner;
-
- operations = POSIX_MUTEX_PRIORITY_CEILING_TQ_OPERATIONS;
- new_owner = ( *operations->first )( heads );
- _POSIX_Mutex_Set_owner( the_mutex, new_owner );
- _Thread_Resource_count_increment( new_owner );
- _Thread_Priority_add(
- new_owner,
- &the_mutex->Priority_ceiling,
- queue_context
- );
- _Thread_queue_Extract_critical(
- &the_mutex->Recursive.Mutex.Queue.Queue,
- operations,
- new_owner,
- queue_context
- );
- } else {
- _POSIX_Mutex_Set_owner( the_mutex, NULL );
- _POSIX_Mutex_Release( the_mutex, queue_context );
- }
-
- _Thread_Priority_update( queue_context );
- _Thread_Dispatch_enable( cpu_self );
- return STATUS_SUCCESSFUL;
}
#define POSIX_MUTEX_ABSTIME_TRY_LOCK ((uintptr_t) 1)
diff --git a/cpukit/include/rtems/posix/posixapi.h b/cpukit/include/rtems/posix/posixapi.h
index 122dd644e6..8d30ee21e5 100644
--- a/cpukit/include/rtems/posix/posixapi.h
+++ b/cpukit/include/rtems/posix/posixapi.h
@@ -28,14 +28,15 @@
#include <pthread.h>
/**
- * @defgroup POSIXAPI RTEMS POSIX API
+ * @defgroup POSIXAPI POSIX API
*
* @ingroup RTEMSImpl
*
- * RTEMS POSIX API definitions and modules.
+ * @brief This group contains definitions and modules which are used to
+ * implement the POSIX APIs supported by RTEMS.
*
+ * @{
*/
-/**@{**/
extern const int _POSIX_Get_by_name_error_table[ 3 ];
diff --git a/cpukit/include/rtems/posix/timer.h b/cpukit/include/rtems/posix/timer.h
index bcbf07a65a..7ae089173a 100644
--- a/cpukit/include/rtems/posix/timer.h
+++ b/cpukit/include/rtems/posix/timer.h
@@ -48,6 +48,7 @@ typedef struct {
uint32_t ticks; /* Number of ticks of the initialization */
uint32_t overrun; /* Number of expirations of the timer */
struct timespec time; /* Time at which the timer was started */
+ clockid_t clock_type; /* The type of timer */
} POSIX_Timer_Control;
/**
diff --git a/cpukit/include/rtems/rtems/asrdata.h b/cpukit/include/rtems/rtems/asrdata.h
index 3f44d3b030..924e616a9a 100644
--- a/cpukit/include/rtems/rtems/asrdata.h
+++ b/cpukit/include/rtems/rtems/asrdata.h
@@ -1,7 +1,7 @@
/**
* @file
*
- * @ingroup RTEMSImplClassicASR
+ * @ingroup RTEMSImplClassicSignal
*
* @brief This header file provides data structures used by the implementation
* and the @ref RTEMSImplApplConfig to ultimately define
@@ -26,7 +26,7 @@ extern "C" {
#endif
/**
- * @addtogroup RTEMSImplClassicASR
+ * @addtogroup RTEMSImplClassicSignal
*
* @{
*/
diff --git a/cpukit/include/rtems/rtems/attr.h b/cpukit/include/rtems/rtems/attr.h
index 18a3820e0e..24b49247ee 100644
--- a/cpukit/include/rtems/rtems/attr.h
+++ b/cpukit/include/rtems/rtems/attr.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicAttr
+ *
* @brief This header file provides Classic API directive attributes.
*/
diff --git a/cpukit/include/rtems/rtems/barrier.h b/cpukit/include/rtems/rtems/barrier.h
index 6327a7c831..348610d886 100644
--- a/cpukit/include/rtems/rtems/barrier.h
+++ b/cpukit/include/rtems/rtems/barrier.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicBarrier
+ *
* @brief This header file defines the Barrier Manager API.
*/
diff --git a/cpukit/include/rtems/rtems/cache.h b/cpukit/include/rtems/rtems/cache.h
index dfcb8f64d1..c7c19b80e2 100644
--- a/cpukit/include/rtems/rtems/cache.h
+++ b/cpukit/include/rtems/rtems/cache.h
@@ -1,294 +1,656 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
- * @ingroup ClassicCache
+ * @brief This header file defines the Cache Manager API.
+ */
+
+/*
+ * Copyright (C) 2016 Pavel Pisa
+ * Copyright (C) 2014, 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2000, 2008 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.
*/
-/* COPYRIGHT (c) 1989-2013.
- * On-Line Applications Research Corporation (OAR).
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
*
- * 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.
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
*/
+/* Generated from spec:/rtems/cache/if/header */
+
#ifndef _RTEMS_RTEMS_CACHE_H
#define _RTEMS_RTEMS_CACHE_H
-#include <rtems/score/basedefs.h>
-
-#if defined( RTEMS_SMP )
-#include <sys/cpuset.h>
-#endif
+#include <stddef.h>
+#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
+/* Generated from spec:/rtems/cache/if/group */
+
/**
- * @defgroup ClassicCache Cache
+ * @defgroup RTEMSAPIClassicCache Cache Manager
*
* @ingroup RTEMSAPIClassic
*
* @brief The Cache Manager provides functions to perform maintenance
- * operations for data and instruction caches.
+ * operations for data and instruction caches.
*
* The actual actions of the Cache Manager operations depend on the hardware
* and the implementation provided by the CPU architecture port or a board
* support package. Cache implementations tend to be highly hardware
* dependent.
+ */
+
+/* Generated from spec:/rtems/cache/if/coherent-add-area */
+
+/**
+ * @brief Adds a cache coherent memory area to the cache coherent allocator.
+ *
+ * @param begin is the begin address of the cache coherent memory area to add.
+ *
+ * @param size is the size in bytes of the cache coherent memory area to add.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * @{
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
*/
+void rtems_cache_coherent_add_area( void *begin, uintptr_t size );
+
+/* Generated from spec:/rtems/cache/if/coherent-allocate */
/**
- * @brief Returns the data cache line size in bytes.
+ * @brief Allocates a memory area from cache coherent memory.
*
- * For multi-level caches this is the maximum of the cache line sizes of all
- * levels.
+ * @param size is the requested size in bytes of the memory area to allocate.
*
- * @retval 0 No data cache is present.
- * @retval positive The data cache line size in bytes.
+ * @param alignment is the requested alignment in bytes of the memory area to
+ * allocate. If the alignment parameter is not equal to zero, the allocated
+ * memory area will begin at an address aligned by this value.
+ *
+ * @param boundary is the requested boundary in bytes of the memory area to
+ * allocate. If the boundary parameter is not equal to zero, the allocated
+ * memory area will comply with a boundary constraint. The boundary value
+ * specifies the set of addresses which are aligned by the boundary value.
+ * The interior of the allocated memory area will not contain an element of
+ * this set. The begin or end address of the area may be a member of the
+ * set.
+ *
+ * @retval NULL There is not enough memory available to satisfy the allocation
+ * request.
+ *
+ * @return Returns the begin address of the allocated memory.
+ *
+ * @par Notes
+ * @parblock
+ * A size value of zero will return a unique address which may be freed with
+ * rtems_cache_coherent_free().
+ *
+ * The memory allocated by the directive may be released with a call to
+ * rtems_cache_coherent_free().
+ *
+ * By default the C Program Heap allocator is used. In case special memory
+ * areas must be used, then the BSP or the application should add cache
+ * coherent memory areas for the allocator via rtems_cache_coherent_add_area().
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
*/
-size_t rtems_cache_get_data_line_size( void );
+void *rtems_cache_coherent_allocate(
+ size_t size,
+ uintptr_t alignment,
+ uintptr_t boundary
+);
+
+/* Generated from spec:/rtems/cache/if/coherent-free */
/**
- * @brief Returns the instruction cache line size in bytes.
+ * @brief Frees memory allocated by rtems_cache_coherent_allocate().
+ *
+ * @param ptr is a pointer returned by rtems_cache_coherent_allocate().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * For multi-level caches this is the maximum of the cache line sizes of all
- * levels.
+ * * The directive may be called from within device driver initialization
+ * context.
*
- * @retval 0 No instruction cache is present.
- * @retval positive The instruction cache line size in bytes.
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
*/
-size_t rtems_cache_get_instruction_line_size( void );
+void rtems_cache_coherent_free( void *ptr );
+
+/* Generated from spec:/rtems/cache/if/freeze-data */
/**
- * @brief Returns the maximal cache line size of all cache kinds in bytes.
+ * @brief Freezes the data caches.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * Returns computed or obtained maximal cache line size of all
- * all caches in the system.
+ * * The directive may be called from within any runtime context.
*
- * @retval 0 No cache is present
- * @retval positive The maximal cache line size in bytes.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-size_t rtems_cache_get_maximal_line_size( void );
+void rtems_cache_freeze_data( void );
+
+/* Generated from spec:/rtems/cache/if/freeze-instruction */
+
+/**
+ * @brief Freezes the instruction caches.
+ *
+ * @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
+ */
+void rtems_cache_freeze_instruction( void );
+
+/* Generated from spec:/rtems/cache/if/unfreeze-data */
/**
- * @brief Returns the data cache size in bytes.
+ * @brief Unfreezes the data cache.
*
- * @param[in] level The cache level of interest. The cache level zero
- * specifies the entire data cache.
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * @returns The data cache size in bytes of the specified level.
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-size_t rtems_cache_get_data_cache_size( uint32_t level );
+void rtems_cache_unfreeze_data( void );
+
+/* Generated from spec:/rtems/cache/if/unfreeze-instruction */
/**
- * @brief Returns the instruction cache size in bytes.
+ * @brief Unfreezes the instruction cache.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * @param[in] level The cache level of interest. The cache level zero
- * specifies the entire instruction cache.
+ * * The directive may be called from within any runtime context.
*
- * @returns The instruction cache size in bytes of the specified level.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-size_t rtems_cache_get_instruction_cache_size( uint32_t level );
+void rtems_cache_unfreeze_instruction( void );
+
+/* Generated from spec:/rtems/cache/if/flush-multiple-data-lines */
/**
- * @brief Flushes multiple data cache lines.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Flushes the data cache lines covering the memory area.
+ *
+ * @param begin is the begin address of the memory area to flush.
+ *
+ * @param size is the size in bytes of the memory area to flush.
+ *
+ * Dirty data cache lines covering the area are transfered to memory.
+ * Depending on the cache implementation this may mark the lines as invalid.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * Dirty cache lines covering the area are transfered to memory. Depending on
- * the cache implementation this may mark the lines as invalid.
+ * * The directive may be called from within any runtime context.
*
- * @param[in] addr The start address of the area to flush.
- * @param[in] size The size in bytes of the area to flush.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-void rtems_cache_flush_multiple_data_lines( const void *addr, size_t size );
+void rtems_cache_flush_multiple_data_lines( const void *begin, size_t size );
+
+/* Generated from spec:/rtems/cache/if/invalidate-multiple-data-lines */
/**
- * @brief Invalidates multiple data cache lines.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Invalidates the data cache lines covering the memory area.
+ *
+ * @param begin is the begin address of the memory area to invalidate.
+ *
+ * @param size is the size in bytes of the memory area to invalidate.
*
* The cache lines covering the area are marked as invalid. A later read
* access in the area will load the data from memory.
*
+ * @par Notes
+ * @parblock
* In case the area is not aligned on cache line boundaries, then this
* operation may destroy unrelated data.
*
- * @param[in] addr The start address of the area to invalidate.
- * @param[in] size The size in bytes of the area to invalidate.
+ * On some systems, the cache lines may be flushed before they are invalidated.
+ * @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
*/
void rtems_cache_invalidate_multiple_data_lines(
- const void *addr,
- size_t size
+ const void *begin,
+ size_t size
);
+/* Generated from spec:/rtems/cache/if/invalidate-multiple-instruction-lines */
+
/**
- * @brief Invalidates multiple instruction cache lines.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Invalidates the instruction cache lines covering the memory area.
+ *
+ * @param begin is the begin address of the memory area to invalidate.
+ *
+ * @param size is the size in bytes of the memory area to invalidate.
*
* The cache lines covering the area are marked as invalid. A later
* instruction fetch from the area will result in a load from memory.
- * In SMP mode, on processors without instruction cache snooping, this
- * operation will invalidate the instruction cache lines on all processors.
- * It should not be called from interrupt context in such case.
*
- * @param[in] addr The start address of the area to invalidate.
- * @param[in] size The size in bytes of the area to invalidate.
+ * @par Notes
+ * In SMP configurations, on processors without instruction cache snooping,
+ * this operation will invalidate the instruction cache lines on all
+ * processors.
+ *
+ * @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
*/
void rtems_cache_invalidate_multiple_instruction_lines(
- const void *addr,
- size_t size
+ const void *begin,
+ size_t size
);
+/* Generated from spec:/rtems/cache/if/instruction-sync-after-code-change */
/**
- * @brief Ensure necessary synchronization required after code changes
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Ensures necessary synchronization required after code changes.
+ *
+ * @param begin is the begin address of the code area to synchronize.
+ *
+ * @param size is the size in bytes of the code area to synchronize.
+ *
+ * @par Notes
+ * When code is loaded or modified, then most systems require synchronization
+ * instructions to update the instruction caches so that the loaded or modified
+ * code is fetched. For example, systems with separate data and instruction
+ * caches or systems without instruction cache snooping. The directives should
+ * be used by run time loader for example.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * When code is loaded or modified then many Harvard cache equipped
- * systems require synchronization of main memory and or updated
- * code in data cache to ensure visibility of change in all
- * connected CPUs instruction memory view. This operation
- * should be used by run time loader for example.
+ * * The directive may be called from within any runtime context.
*
- * @param[in] addr The start address of the area to invalidate.
- * @param[in] size The size in bytes of the area to invalidate.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
void rtems_cache_instruction_sync_after_code_change(
- const void * code_addr,
- size_t n_bytes
+ const void *begin,
+ size_t size
);
+/* Generated from spec:/rtems/cache/if/get-maximal-line-size */
+
/**
- * @brief Flushes the entire data cache.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Gets the maximal cache line size in bytes of all caches (data,
+ * instruction, or unified).
+ *
+ * @retval 0 There is no cache present.
+ *
+ * @return Returns the maximal cache line size in bytes of all caches (data,
+ * instruction, or unified).
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * @see rtems_cache_flush_multiple_data_lines().
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-void rtems_cache_flush_entire_data( void );
+size_t rtems_cache_get_maximal_line_size( void );
+
+/* Generated from spec:/rtems/cache/if/get-data-line-size */
/**
- * @brief Invalidates the entire instruction cache.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Gets the data cache line size in bytes.
*
- * @see rtems_cache_invalidate_multiple_instruction_lines().
+ * @retval 0 There is no data cache present.
+ *
+ * @return Returns the data cache line size in bytes. For multi-level caches
+ * this is the maximum of the cache line sizes of all levels.
+ *
+ * @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
*/
-void rtems_cache_invalidate_entire_instruction( void );
+size_t rtems_cache_get_data_line_size( void );
-/**
- * This function is responsible for performing a data cache
- * invalidate. It invalidates the entire cache.
- */
-void rtems_cache_invalidate_entire_data( void );
+/* Generated from spec:/rtems/cache/if/get-instruction-line-size */
/**
- * This function freezes the data cache.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Gets the instruction cache line size in bytes.
+ *
+ * @retval 0 There is no instruction cache present.
+ *
+ * @return Returns the instruction cache line size in bytes. For multi-level
+ * caches this is the maximum of the cache line sizes of all levels.
+ *
+ * @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
*/
-void rtems_cache_freeze_data( void );
+size_t rtems_cache_get_instruction_line_size( void );
-/**
- * This function unfreezes the data cache.
- */
-void rtems_cache_unfreeze_data( void );
+/* Generated from spec:/rtems/cache/if/get-data-size */
/**
- * This function enables the data cache.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Gets the data cache size in bytes for the cache level.
+ *
+ * @param level is the requested data cache level. The cache level zero
+ * specifies the entire data cache.
+ *
+ * @retval 0 There is no data cache present at the requested cache level.
+ *
+ * @return Returns the data cache size in bytes of the requested cache level.
+ *
+ * @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
*/
-void rtems_cache_enable_data( void );
+size_t rtems_cache_get_data_cache_size( uint32_t level );
-/**
- * This function disables the data cache.
- */
-void rtems_cache_disable_data( void );
+/* Generated from spec:/rtems/cache/if/get-instruction-size */
/**
- * This function freezes the instruction cache.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Gets the instruction cache size in bytes for the cache level.
+ *
+ * @param level is the requested instruction cache level. The cache level zero
+ * specifies the entire instruction cache.
+ *
+ * @retval 0 There is no instruction cache present at the requested cache
+ * level.
+ *
+ * @return Returns the instruction cache size in bytes of the requested cache
+ * level.
+ *
+ * @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
*/
-void rtems_cache_freeze_instruction( void );
+size_t rtems_cache_get_instruction_cache_size( uint32_t level );
+
+/* Generated from spec:/rtems/cache/if/flush-entire-data */
/**
- * This function unfreezes the instruction cache.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Flushes the entire data cache.
+ *
+ * @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
*/
-void rtems_cache_unfreeze_instruction( void );
+void rtems_cache_flush_entire_data( void );
+
+/* Generated from spec:/rtems/cache/if/invalidate-entire-data */
/**
- * This function enables the instruction cache.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Invalidates the entire data cache.
+ *
+ * @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
*/
-void rtems_cache_enable_instruction( void );
+void rtems_cache_invalidate_entire_data( void );
+
+/* Generated from spec:/rtems/cache/if/invalidate-entire-instruction */
/**
- * This function disables the instruction cache.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Invalidates the entire instruction cache.
+ *
+ * @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
*/
-void rtems_cache_disable_instruction( void );
+void rtems_cache_invalidate_entire_instruction( void );
+
+/* Generated from spec:/rtems/cache/if/enable-data */
/**
- * This function is used to allocate storage that spans an
- * integral number of cache blocks.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Enables the data cache.
+ *
+ * @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
*/
-void *rtems_cache_aligned_malloc ( size_t nbytes );
+void rtems_cache_enable_data( void );
+
+/* Generated from spec:/rtems/cache/if/disable-data */
/**
- * @brief Allocates a memory area of size @a size bytes from cache coherent
- * memory.
+ * @ingroup RTEMSAPIClassicCache
*
- * A size value of zero will return a unique address which may be freed with
- * rtems_cache_coherent_free().
+ * @brief Disables the data cache.
*
- * The memory allocated by this function can be released with a call to
- * rtems_cache_coherent_free().
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * By default the C program heap allocator is used. In case special memory
- * areas must be used, then the BSP or the application must add cache coherent
- * memory areas for the allocator via rtems_cache_coherent_add_area().
+ * * The directive may be called from within any runtime context.
*
- * This function must be called from driver initialization or task context
- * only.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+void rtems_cache_disable_data( void );
+
+/* Generated from spec:/rtems/cache/if/enable-instruction */
+
+/**
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Enables the instruction cache.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * @param[in] alignment If the alignment parameter is not equal to zero, the
- * allocated memory area will begin at an address aligned by this value.
- * @param[in] boundary If the boundary parameter is not equal to zero, the
- * allocated memory area will comply with a boundary constraint. The
- * boundary value specifies the set of addresses which are aligned by the
- * boundary value. The interior of the allocated memory area will not
- * contain an element of this set. The begin or end address of the area may
- * be a member of the set.
+ * * The directive may be called from within any runtime context.
*
- * @retval NULL If no memory is available or the parameters are inconsistent.
- * @retval other A pointer to the begin of the allocated memory area.
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-void *rtems_cache_coherent_allocate(
- size_t size,
- uintptr_t alignment,
- uintptr_t boundary
-);
+void rtems_cache_enable_instruction( void );
+
+/* Generated from spec:/rtems/cache/if/disable-instruction */
/**
- * @brief Frees memory allocated by rtems_cache_coherent_allocate().
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Disables the instruction cache.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
*
- * This function must be called from driver initialization or task context
- * only.
+ * * The directive may be called from within any runtime context.
*
- * @param[in] ptr A pointer returned by rtems_cache_coherent_allocate().
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
*/
-void rtems_cache_coherent_free( void *ptr );
+void rtems_cache_disable_instruction( void );
+
+/* Generated from spec:/rtems/cache/if/aligned-malloc */
/**
- * @brief Adds a cache coherent memory area to the cache coherent allocator.
+ * @ingroup RTEMSAPIClassicCache
+ *
+ * @brief Allocates memory from the C Program Heap which begins at a cache line
+ * boundary.
+ *
+ * @param size is the size in bytes of the memory area to allocate.
*
- * This function must be called from BSP initialization, driver initialization
- * or task context only.
+ * @retval NULL There is not enough memory available to satisfy the allocation
+ * request.
*
- * @param[in] area_begin The area begin address.
- * @param[in] area_size The area size in bytes.
+ * @return Returns the begin address of the allocated memory. The begin
+ * address is on a cache line boundary.
*
- * @see rtems_cache_coherent_allocate().
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
*/
-void rtems_cache_coherent_add_area(
- void *area_begin,
- uintptr_t area_size
-);
-
-/**@}*/
+void *rtems_cache_aligned_malloc( size_t size );
#ifdef __cplusplus
}
#endif
-#endif
-/* end of include file */
+#endif /* _RTEMS_RTEMS_CACHE_H */
diff --git a/cpukit/include/rtems/rtems/clock.h b/cpukit/include/rtems/rtems/clock.h
index 1eeb0ce54c..e158b18947 100644
--- a/cpukit/include/rtems/rtems/clock.h
+++ b/cpukit/include/rtems/rtems/clock.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicClock
+ *
* @brief This header file defines the Clock Manager API.
*/
@@ -101,10 +103,13 @@ extern "C" {
* range-checked, and an error is returned if any one is out of its valid
* range.
*
- * RTEMS can represent time points of this clock in nanoseconds ranging from
- * 1988-01-01T00:00:00.000000000Z to 2514-05-31T01:53:03.999999999Z. The
- * future uptime of the system shall be in this range, otherwise the system
- * behaviour is undefined.
+ * RTEMS can represent time points of the CLOCK_REALTIME clock in nanoseconds
+ * ranging from 1988-01-01T00:00:00.000000000Z to
+ * 2514-05-31T01:53:03.999999999Z. The future uptime of the system shall be in
+ * this range, otherwise the system behaviour is undefined. Due to
+ * implementation constraints, the time of day set by the directive shall be
+ * before 2100-01-01:00:00.000000000Z. The latest valid time of day accepted
+ * by the POSIX clock_settime() is 2400-01-01T00:00:00.999999999Z.
*
* The specified time is based on the configured clock tick rate, see the
* #CONFIGURE_MICROSECONDS_PER_TICK application configuration option.
@@ -133,6 +138,12 @@ extern "C" {
*
* * The directive may unblock a task. This may cause the calling task to be
* preempted.
+ *
+ * * The time of day set by the directive shall be
+ * 1988-01-01T00:00:00.000000000Z or later.
+ *
+ * * The time of day set by the directive shall be before
+ * 2100-01-01T00:00:00.000000000Z.
* @endparblock
*/
rtems_status_code rtems_clock_set( const rtems_time_of_day *time_of_day );
diff --git a/cpukit/include/rtems/rtems/message.h b/cpukit/include/rtems/rtems/message.h
index 01173d4029..0a76b1f9b8 100644
--- a/cpukit/include/rtems/rtems/message.h
+++ b/cpukit/include/rtems/rtems/message.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicMessage
+ *
* @brief This header file defines the Message Manager API.
*/
@@ -773,9 +775,6 @@ rtems_status_code rtems_message_queue_broadcast(
*
* @retval ::RTEMS_UNSATISFIED The queue was empty.
*
- * @retval ::RTEMS_UNSATISFIED The queue was flushed while the calling task was
- * waiting to receive a message.
- *
* @retval ::RTEMS_TIMEOUT The timeout happened while the calling task was
* waiting to receive a message
*
@@ -862,8 +861,8 @@ rtems_status_code rtems_message_queue_get_number_pending(
* @param id is the queue identifier.
*
* @param[out] count is the pointer to an uint32_t object. When the directive
- * call is successful, the number of unblocked tasks will be stored in this
- * object.
+ * call is successful, the number of pending messages removed from the queue
+ * will be stored in this object.
*
* This directive removes all pending messages from the queue specified by
* ``id``. The number of messages removed is returned in ``count``. If no
@@ -876,17 +875,22 @@ rtems_status_code rtems_message_queue_get_number_pending(
*
* @retval ::RTEMS_INVALID_ADDRESS The ``count`` parameter was NULL.
*
+ * @par Notes
+ * The directive does not flush tasks waiting to receive a message from the
+ * wait queue of the message queue.
+ *
* @par Constraints
* @parblock
* The following constraints apply to this directive:
*
- * * The directive may be called from within task context.
- *
* * The directive may be called from within interrupt context.
*
- * * When the directive operates on a remote object, the directive sends a
- * message to the remote node and waits for a reply. This will preempt the
- * calling task.
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
* @endparblock
*/
rtems_status_code rtems_message_queue_flush( rtems_id id, uint32_t *count );
diff --git a/cpukit/include/rtems/rtems/partdata.h b/cpukit/include/rtems/rtems/partdata.h
index 73babd36f4..196c2142ae 100644
--- a/cpukit/include/rtems/rtems/partdata.h
+++ b/cpukit/include/rtems/rtems/partdata.h
@@ -48,15 +48,20 @@ typedef struct {
ISR_LOCK_MEMBER( Lock )
/**
- * @brief This member contains the physical starting address of the buffer
- * area.
+ * @brief This member contains the base address of the buffer area.
+ *
+ * The base address is the address of the first byte contained in the buffer
+ * area.
*/
- void *starting_address;
+ const void *base_address;
/**
- * @brief This member contains the size of the buffer area in bytes.
+ * @brief This member contains the limit address of the buffer area.
+ *
+ * The limit address is the address of the last byte contained in the buffer
+ * area.
*/
- uintptr_t length;
+ const void *limit_address;
/**
* @brief This member contains the size of each buffer in bytes.
diff --git a/cpukit/include/rtems/rtems/ratemon.h b/cpukit/include/rtems/rtems/ratemon.h
index 54c2709ab8..8823d72c55 100644
--- a/cpukit/include/rtems/rtems/ratemon.h
+++ b/cpukit/include/rtems/rtems/ratemon.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicRateMonotonic
+ *
* @brief This header file defines the Rate-Monotonic Manager API.
*/
diff --git a/cpukit/include/rtems/rtems/sem.h b/cpukit/include/rtems/rtems/sem.h
index 2cf3ba232b..31156b5e43 100644
--- a/cpukit/include/rtems/rtems/sem.h
+++ b/cpukit/include/rtems/rtems/sem.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicSemaphore
+ *
* @brief This header file defines the Semaphore Manager API.
*/
diff --git a/cpukit/include/rtems/rtems/statusimpl.h b/cpukit/include/rtems/rtems/statusimpl.h
index f1944179e9..8b63eca742 100644
--- a/cpukit/include/rtems/rtems/statusimpl.h
+++ b/cpukit/include/rtems/rtems/statusimpl.h
@@ -26,6 +26,14 @@ extern "C" {
#endif
/**
+ * @defgroup RTEMSImplClassic Classic API
+ *
+ * @ingroup RTEMSImpl
+ *
+ * @brief This group contains the Classic API implementation.
+ */
+
+/**
* @defgroup RTEMSImplClassicStatus Directive Status
*
* @ingroup RTEMSImplClassic
diff --git a/cpukit/include/rtems/rtems/tasks.h b/cpukit/include/rtems/rtems/tasks.h
index ff7b4c0988..8c6e8a3bca 100644
--- a/cpukit/include/rtems/rtems/tasks.h
+++ b/cpukit/include/rtems/rtems/tasks.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicTask
+ *
* @brief This header file defines the main parts of the Tasks Manager API.
*/
diff --git a/cpukit/include/rtems/rtems/types.h b/cpukit/include/rtems/rtems/types.h
index bf656b623e..caa75b4f0d 100644
--- a/cpukit/include/rtems/rtems/types.h
+++ b/cpukit/include/rtems/rtems/types.h
@@ -71,16 +71,6 @@
extern "C" {
#endif
-/* Generated from spec:/rtems/req/group */
-
-/**
- * @defgroup RTEMSImplClassic Classic API
- *
- * @ingroup RTEMSImpl
- *
- * @brief This group contains the Classic API implementation.
- */
-
/* Generated from spec:/rtems/type/if/group */
/**
diff --git a/cpukit/include/rtems/score/basedefs.h b/cpukit/include/rtems/score/basedefs.h
index c682106c53..7a37299eee 100644
--- a/cpukit/include/rtems/score/basedefs.h
+++ b/cpukit/include/rtems/score/basedefs.h
@@ -68,7 +68,7 @@
extern "C" {
#endif
-/* Generated from spec:/if/api */
+/* Generated from spec:/if/group */
/**
* @defgroup RTEMSAPI API
diff --git a/cpukit/include/rtems/score/coremsgimpl.h b/cpukit/include/rtems/score/coremsgimpl.h
index 161cf8f124..7f01769010 100644
--- a/cpukit/include/rtems/score/coremsgimpl.h
+++ b/cpukit/include/rtems/score/coremsgimpl.h
@@ -616,7 +616,8 @@ RTEMS_INLINE_ROUTINE Thread_Control *_CORE_message_queue_Dequeue_receiver(
Thread_queue_Context *queue_context
)
{
- Thread_Control *the_thread;
+ Thread_queue_Heads *heads;
+ Thread_Control *the_thread;
/*
* If there are pending messages, then there can't be threads
@@ -634,14 +635,18 @@ RTEMS_INLINE_ROUTINE Thread_Control *_CORE_message_queue_Dequeue_receiver(
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
- the_thread = _Thread_queue_First_locked(
- &the_message_queue->Wait_queue,
- the_message_queue->operations
- );
- if ( the_thread == NULL ) {
+ heads = the_message_queue->Wait_queue.Queue.heads;
+ if ( heads == NULL ) {
return NULL;
}
+ the_thread = ( *the_message_queue->operations->surrender )(
+ &the_message_queue->Wait_queue.Queue,
+ heads,
+ NULL,
+ queue_context
+ );
+
*(size_t *) the_thread->Wait.return_argument = size;
the_thread->Wait.count = (uint32_t) submit_type;
@@ -651,9 +656,8 @@ RTEMS_INLINE_ROUTINE Thread_Control *_CORE_message_queue_Dequeue_receiver(
size
);
- _Thread_queue_Extract_critical(
+ _Thread_queue_Resume(
&the_message_queue->Wait_queue.Queue,
- the_message_queue->operations,
the_thread,
queue_context
);
diff --git a/cpukit/include/rtems/score/coremuteximpl.h b/cpukit/include/rtems/score/coremuteximpl.h
index cbc1e720fb..757efbde9b 100644
--- a/cpukit/include/rtems/score/coremuteximpl.h
+++ b/cpukit/include/rtems/score/coremuteximpl.h
@@ -375,7 +375,7 @@ RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Set_priority(
owner,
&the_mutex->Priority_ceiling,
priority_ceiling,
- false,
+ PRIORITY_GROUP_LAST,
queue_context
);
_Thread_Wait_release( owner, queue_context );
@@ -529,10 +529,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Surrender(
Thread_queue_Context *queue_context
)
{
- unsigned int nest_level;
- ISR_lock_Context lock_context;
- Per_CPU_Control *cpu_self;
- Thread_Control *new_owner;
+ unsigned int nest_level;
_CORE_mutex_Acquire_critical( &the_mutex->Recursive.Mutex, queue_context );
@@ -549,53 +546,13 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Surrender(
return STATUS_SUCCESSFUL;
}
- _Thread_Resource_count_decrement( executing );
-
- _Thread_queue_Context_clear_priority_updates( queue_context );
- _Thread_Wait_acquire_default_critical( executing, &lock_context );
- _Thread_Priority_remove(
+ return _Thread_queue_Surrender_priority_ceiling(
+ &the_mutex->Recursive.Mutex.Wait_queue.Queue,
executing,
&the_mutex->Priority_ceiling,
- queue_context
- );
- _Thread_Wait_release_default_critical( executing, &lock_context );
-
- new_owner = _Thread_queue_First_locked(
- &the_mutex->Recursive.Mutex.Wait_queue,
+ queue_context,
CORE_MUTEX_TQ_OPERATIONS
);
- _CORE_mutex_Set_owner( &the_mutex->Recursive.Mutex, new_owner );
-
- cpu_self = _Thread_Dispatch_disable_critical(
- &queue_context->Lock_context.Lock_context
- );
-
- if ( new_owner != NULL ) {
-#if defined(RTEMS_MULTIPROCESSING)
- if ( _Objects_Is_local_id( new_owner->Object.id ) )
-#endif
- {
- _Thread_Resource_count_increment( new_owner );
- _Thread_Priority_add(
- new_owner,
- &the_mutex->Priority_ceiling,
- queue_context
- );
- }
-
- _Thread_queue_Extract_critical(
- &the_mutex->Recursive.Mutex.Wait_queue.Queue,
- CORE_MUTEX_TQ_OPERATIONS,
- new_owner,
- queue_context
- );
- } else {
- _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );
- }
-
- _Thread_Priority_update( queue_context );
- _Thread_Dispatch_enable( cpu_self );
- return STATUS_SUCCESSFUL;
}
/** @} */
diff --git a/cpukit/include/rtems/score/coresemimpl.h b/cpukit/include/rtems/score/coresemimpl.h
index ba4825bce9..40b58cbda7 100644
--- a/cpukit/include/rtems/score/coresemimpl.h
+++ b/cpukit/include/rtems/score/coresemimpl.h
@@ -133,23 +133,21 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_semaphore_Surrender(
Thread_queue_Context *queue_context
)
{
- Thread_Control *the_thread;
- Status_Control status;
+ Status_Control status;
+ Thread_queue_Heads *heads;
status = STATUS_SUCCESSFUL;
_CORE_semaphore_Acquire_critical( the_semaphore, queue_context );
- the_thread = _Thread_queue_First_locked(
- &the_semaphore->Wait_queue,
- operations
- );
- if ( the_thread != NULL ) {
- _Thread_queue_Extract_critical(
+ heads = the_semaphore->Wait_queue.Queue.heads;
+
+ if ( heads != NULL ) {
+ _Thread_queue_Surrender_no_priority(
&the_semaphore->Wait_queue.Queue,
- operations,
- the_thread,
- queue_context
+ heads,
+ queue_context,
+ operations
);
} else {
if ( the_semaphore->count < maximum_count )
diff --git a/cpukit/include/rtems/score/hash.h b/cpukit/include/rtems/score/hash.h
index 8a269cc548..c6f9ebf463 100644
--- a/cpukit/include/rtems/score/hash.h
+++ b/cpukit/include/rtems/score/hash.h
@@ -49,6 +49,8 @@ extern "C" {
/**
* @defgroup RTEMSScoreHash Hash Handler
*
+ * @ingroup RTEMSScore
+ *
* @brief This group contains the Hash Handler implementation.
*
* @{
diff --git a/cpukit/include/rtems/score/priorityimpl.h b/cpukit/include/rtems/score/priorityimpl.h
index 7a14ec97b8..2895a0c4a5 100644
--- a/cpukit/include/rtems/score/priorityimpl.h
+++ b/cpukit/include/rtems/score/priorityimpl.h
@@ -37,6 +37,29 @@ extern "C" {
* @{
*/
+ /**
+ * @brief The priority group order determines if a priority node is inserted
+ * as the first or last node into its priority group.
+ *
+ * The values of the enumerators matter. The least significant bit of a
+ * ::Priority_Control value is not used for the actual priority of a node.
+ * During insertion the least significant bit is used to determine the
+ * ordering within a priority group based on the enumerator values.
+ */
+typedef enum {
+ /**
+ * @brief Priority group first option requests that the priority node is
+ * inserted as the first node into its priority group.
+ */
+ PRIORITY_GROUP_FIRST = 0,
+
+ /**
+ * @brief Priority group last option requests that the priority node is
+ * inserted as the last node into its priority group.
+ */
+ PRIORITY_GROUP_LAST = 1
+} Priority_Group_order;
+
/**
* @brief Initializes the priority actions empty.
*
@@ -465,7 +488,7 @@ typedef void ( *Priority_Add_handler )(
typedef void ( *Priority_Change_handler )(
Priority_Aggregation *aggregation,
- bool prepend_it,
+ Priority_Group_order group_order,
Priority_Actions *actions,
void *arg
);
@@ -482,19 +505,19 @@ typedef void ( *Priority_Remove_handler )(
* This method does nothing.
*
* @param aggregation Is ignored by the method.
- * @param prepend_it Is ignored by the method.
+ * @param group_order Is ignored by the method.
* @param actions Is ignored by the method.
* @param arg Is ignored by the method.
*/
RTEMS_INLINE_ROUTINE void _Priority_Change_nothing(
Priority_Aggregation *aggregation,
- bool prepend_it,
+ Priority_Group_order group_order,
Priority_Actions *actions,
void *arg
)
{
(void) aggregation;
- (void) prepend_it;
+ (void) group_order;
(void) actions;
(void) arg;
}
@@ -547,7 +570,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Non_empty_insert(
if ( is_new_minimum ) {
aggregation->Node.priority = node->priority;
- ( *change )( aggregation, false, actions, arg );
+ ( *change )( aggregation, PRIORITY_GROUP_LAST, actions, arg );
}
}
@@ -619,7 +642,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Extract(
if ( node->priority < min->priority ) {
aggregation->Node.priority = min->priority;
- ( *change )( aggregation, true, actions, arg );
+ ( *change )( aggregation, PRIORITY_GROUP_FIRST, actions, arg );
}
}
}
@@ -654,7 +677,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Extract_non_empty(
if ( node->priority < min->priority ) {
aggregation->Node.priority = min->priority;
- ( *change )( aggregation, true, actions, arg );
+ ( *change )( aggregation, PRIORITY_GROUP_FIRST, actions, arg );
}
}
@@ -666,8 +689,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Extract_non_empty(
*
* @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.
- * @param prepend_it Indicates whether @a change should prepend if the minimal priority is
- * incorrectly set after the change.
+ * @param group_order The priority group order which may be used by @ change.
* @param actions The actions for the case that the minimal priority is incorrectly set
* after the change.
* @param change Is called if the minimal priority is incorrectly set after the change.
@@ -676,7 +698,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Extract_non_empty(
RTEMS_INLINE_ROUTINE void _Priority_Changed(
Priority_Aggregation *aggregation,
Priority_Node *node,
- bool prepend_it,
+ Priority_Group_order group_order,
Priority_Actions *actions,
Priority_Change_handler change,
void *arg
@@ -695,7 +717,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Changed(
if ( min->priority != aggregation->Node.priority ) {
aggregation->Node.priority = min->priority;
- ( *change )( aggregation, prepend_it, actions, arg );
+ ( *change )( aggregation, group_order, actions, arg );
}
}
diff --git a/cpukit/include/rtems/score/scheduler.h b/cpukit/include/rtems/score/scheduler.h
index da1e030ab8..df9477fbeb 100644
--- a/cpukit/include/rtems/score/scheduler.h
+++ b/cpukit/include/rtems/score/scheduler.h
@@ -403,72 +403,71 @@ Priority_Control _Scheduler_default_Unmap_priority(
/**
* @brief Does nothing.
*
- * @param scheduler This parameter is unused.
- * @param the_thread This parameter is unused.
- * @param node This parameter is unused.
- *
- * @return Always returns false.
- */
- bool _Scheduler_default_Ask_for_help(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- Scheduler_Node *node
- );
-
- /**
- * @brief Does nothing.
+ * This default implementation for the thread pin or unpin operations should
+ * be used by uniprocessor schedulers if SMP support is enabled.
*
* @param scheduler This parameter is unused.
* @param the_thread This parameter is unused.
* @param node This parameter is unused.
+ * @param cpu This parameter is unused.
*/
- void _Scheduler_default_Reconsider_help_request(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- Scheduler_Node *node
- );
-
- /**
- * @brief Does nothing.
- *
- * @param scheduler This parameter is unused.
- * @param the_thread This parameter is unused..
- * @param node This parameter is unused.
- * @param next_state This parameter is unused.
- */
- void _Scheduler_default_Withdraw_node(
+ void _Scheduler_default_Pin_or_unpin_do_nothing(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node,
- Thread_Scheduler_state next_state
+ struct Per_CPU_Control *cpu
);
/**
* @brief Does nothing in a single processor system, otherwise a fatal error
* is issued.
*
+ * This default implementation for the thread pin or unpin operations should
+ * be used by SMP schedulers which do not support thread pinning.
+ *
* @param scheduler This parameter is unused.
* @param the_thread This parameter is unused.
* @param node This parameter is unused.
* @param cpu This parameter is unused.
*/
- void _Scheduler_default_Pin_or_unpin(
+ void _Scheduler_default_Pin_or_unpin_not_supported(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node,
struct Per_CPU_Control *cpu
);
+#endif
- #define SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
- _Scheduler_default_Ask_for_help, \
- _Scheduler_default_Reconsider_help_request, \
- _Scheduler_default_Withdraw_node, \
- _Scheduler_default_Pin_or_unpin, \
- _Scheduler_default_Pin_or_unpin, \
+/**
+ * @brief This define provides a set of default implementations for
+ * SMP-specific scheduler operations.
+ *
+ * The default implementations are intended for uniprocessor schedulers. SMP
+ * schedulers shall implement the operations properly.
+ *
+ * If SMP support is disabled, the define evaluates to nothing.
+ *
+ * If SMP support is enabled and the system has exactly one processor, then it
+ * may use an uniprocessor scheduler. The ask for help, reconsider help
+ * request, and withdraw node operations are NULL, since they are only used if
+ * a thread has at least one helping scheduler node. At least two schedulers
+ * are required to get a helping node and each scheduler involved must own at
+ * least one processor. This is not possible on a system with exactly one
+ * processor. The processor add operation is NULL, since there is no other
+ * processor to add. The processor remove operation is NULL, since the one and
+ * only processor cannot be removed.
+ */
+#if defined(RTEMS_SMP)
+ #define SCHEDULER_DEFAULT_SMP_OPERATIONS \
+ NULL, \
+ NULL, \
+ NULL, \
+ _Scheduler_default_Pin_or_unpin_do_nothing, \
+ _Scheduler_default_Pin_or_unpin_do_nothing, \
NULL, \
NULL,
#else
- #define SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP
+ #define SCHEDULER_DEFAULT_SMP_OPERATIONS
#endif
/**
@@ -594,11 +593,23 @@ void _Scheduler_default_Start_idle(
Scheduler_Node *node,
const Processor_mask *affinity
);
+#endif
- #define SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+/**
+ * @brief This define provides the default implementation for the
+ * SMP-specific set affinity operation.
+ *
+ * The default implementation _Scheduler_default_Set_affinity() is intended for
+ * uniprocessor schedulers and SMP schedulers which only support an affinity to
+ * all online processors.
+ *
+ * If SMP support is disabled, the define evaluates to nothing.
+ */
+#if defined(RTEMS_SMP)
+ #define SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
, _Scheduler_default_Set_affinity
#else
- #define SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY
+ #define SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION
#endif
/**
diff --git a/cpukit/include/rtems/score/schedulercbs.h b/cpukit/include/rtems/score/schedulercbs.h
index e321923c11..4b7efc8340 100644
--- a/cpukit/include/rtems/score/schedulercbs.h
+++ b/cpukit/include/rtems/score/schedulercbs.h
@@ -62,14 +62,14 @@ extern "C" {
_Scheduler_EDF_Update_priority, /* update priority entry point */ \
_Scheduler_EDF_Map_priority, /* map priority entry point */ \
_Scheduler_EDF_Unmap_priority, /* unmap priority entry point */ \
- SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
+ SCHEDULER_DEFAULT_SMP_OPERATIONS \
_Scheduler_CBS_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
_Scheduler_CBS_Release_job, /* new period of task */ \
_Scheduler_CBS_Cancel_job, /* cancel period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
_Scheduler_default_Start_idle /* start idle entry point */ \
- SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+ SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
}
/* Return values for CBS server. */
diff --git a/cpukit/include/rtems/score/scheduleredf.h b/cpukit/include/rtems/score/scheduleredf.h
index 065b511a14..9e643b93eb 100644
--- a/cpukit/include/rtems/score/scheduleredf.h
+++ b/cpukit/include/rtems/score/scheduleredf.h
@@ -61,14 +61,14 @@ extern "C" {
_Scheduler_EDF_Update_priority, /* update priority entry point */ \
_Scheduler_EDF_Map_priority, /* map priority entry point */ \
_Scheduler_EDF_Unmap_priority, /* unmap priority entry point */ \
- SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
+ SCHEDULER_DEFAULT_SMP_OPERATIONS \
_Scheduler_EDF_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
_Scheduler_EDF_Release_job, /* new period of task */ \
_Scheduler_EDF_Cancel_job, /* cancel period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
_Scheduler_default_Start_idle /* start idle entry point */ \
- SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+ SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
}
typedef struct {
diff --git a/cpukit/include/rtems/score/scheduleredfsmp.h b/cpukit/include/rtems/score/scheduleredfsmp.h
index 6fef6fb86a..1841aa4a7b 100644
--- a/cpukit/include/rtems/score/scheduleredfsmp.h
+++ b/cpukit/include/rtems/score/scheduleredfsmp.h
@@ -110,7 +110,7 @@ typedef struct {
#define SCHEDULER_EDF_SMP_ENTRY_POINTS \
{ \
_Scheduler_EDF_SMP_Initialize, \
- _Scheduler_default_Schedule, \
+ NULL, \
_Scheduler_EDF_SMP_Yield, \
_Scheduler_EDF_SMP_Block, \
_Scheduler_EDF_SMP_Unblock, \
diff --git a/cpukit/include/rtems/score/schedulerimpl.h b/cpukit/include/rtems/score/schedulerimpl.h
index 595d6291b4..98f8e337fd 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -611,12 +611,30 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Cancel_job(
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Tick( const Per_CPU_Control *cpu )
{
- const Scheduler_Control *scheduler = _Scheduler_Get_by_CPU( cpu );
- Thread_Control *executing = cpu->executing;
+ const Scheduler_Control *scheduler;
+ Thread_Control *executing;
+
+ scheduler = _Scheduler_Get_by_CPU( cpu );
- if ( scheduler != NULL && executing != NULL ) {
- ( *scheduler->Operations.tick )( scheduler, executing );
+#if defined(RTEMS_SMP)
+ if ( scheduler == NULL ) {
+ /*
+ * In SMP configurations, processors may be removed/added at runtime
+ * from/to a scheduler. There may be still clock interrupts on currently
+ * unassigned processors.
+ */
+ return;
}
+#endif
+
+ /*
+ * Each online processor has at least an idle thread as the executing thread
+ * even in case it has currently no scheduler assigned. Clock interrupts on
+ * processors which are not online would be a severe bug of the Clock Driver.
+ */
+ executing = _Per_CPU_Get_executing( cpu );
+ _Assert( executing != NULL );
+ ( *scheduler->Operations.tick )( scheduler, executing );
}
/**
@@ -1388,7 +1406,11 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set(
&new_scheduler_node->Thread.Scheduler_node.Chain
);
- _Scheduler_Node_set_priority( new_scheduler_node, priority, false );
+ _Scheduler_Node_set_priority(
+ new_scheduler_node,
+ priority,
+ PRIORITY_GROUP_LAST
+ );
if ( _States_Is_ready( current_state ) ) {
_Scheduler_Unblock( the_thread );
@@ -1398,7 +1420,11 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set(
}
#endif
- _Scheduler_Node_set_priority( new_scheduler_node, priority, false );
+ _Scheduler_Node_set_priority(
+ new_scheduler_node,
+ priority,
+ PRIORITY_GROUP_LAST
+ );
_Scheduler_Update_priority( the_thread );
return STATUS_SUCCESSFUL;
}
diff --git a/cpukit/include/rtems/score/schedulernode.h b/cpukit/include/rtems/score/schedulernode.h
index 1dba200dca..e344479718 100644
--- a/cpukit/include/rtems/score/schedulernode.h
+++ b/cpukit/include/rtems/score/schedulernode.h
@@ -28,7 +28,7 @@
#include <rtems/score/basedefs.h>
#include <rtems/score/chain.h>
#include <rtems/score/priority.h>
-#include <rtems/score/smplockseq.h>
+#include <rtems/score/isrlock.h>
/**
* @addtogroup RTEMSScoreScheduler
@@ -197,14 +197,20 @@ struct Scheduler_Node {
* least-significant bit which indicates if the thread should be appended
* (bit set) or prepended (bit cleared) to its priority group, see
* SCHEDULER_PRIORITY_APPEND().
+ *
+ * @see _Scheduler_Node_get_priority() and _Scheduler_Node_set_priority().
*/
+#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER == 8
+ Atomic_Ulong value;
+#else
Priority_Control value;
+#endif
-#if defined(RTEMS_SMP)
+#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER != 8
/**
- * @brief Sequence lock to synchronize priority value updates.
+ * @brief The lock protects the priority value.
*/
- SMP_sequence_lock_Control Lock;
+ ISR_lock_Control Lock;
#endif
} Priority;
};
diff --git a/cpukit/include/rtems/score/schedulernodeimpl.h b/cpukit/include/rtems/score/schedulernodeimpl.h
index 5d6f795912..e222de953b 100644
--- a/cpukit/include/rtems/score/schedulernodeimpl.h
+++ b/cpukit/include/rtems/score/schedulernodeimpl.h
@@ -47,12 +47,6 @@ extern "C" {
RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Priority )
/**
- * @brief Priority append indicator for the priority control used for the
- * scheduler node priority.
- */
-#define SCHEDULER_PRIORITY_APPEND_FLAG 1
-
-/**
* @brief Maps a priority value to support the append indicator.
*/
#define SCHEDULER_PRIORITY_MAP( priority ) ( ( priority ) << 1 )
@@ -66,13 +60,13 @@ extern "C" {
* @brief Clears the priority append indicator bit.
*/
#define SCHEDULER_PRIORITY_PURIFY( priority ) \
- ( ( priority ) & ~( (Priority_Control) SCHEDULER_PRIORITY_APPEND_FLAG ) )
+ ( ( priority ) & ~( (Priority_Control) PRIORITY_GROUP_LAST ) )
/**
* @brief Returns the priority control with the append indicator bit set.
*/
#define SCHEDULER_PRIORITY_APPEND( priority ) \
- ( ( priority ) | SCHEDULER_PRIORITY_APPEND_FLAG )
+ ( ( priority ) | ( (Priority_Control) PRIORITY_GROUP_LAST ) )
/**
* @brief Returns true, if the item should be appended to its priority group,
@@ -80,15 +74,18 @@ extern "C" {
* group.
*/
#define SCHEDULER_PRIORITY_IS_APPEND( priority ) \
- ( ( ( priority ) & SCHEDULER_PRIORITY_APPEND_FLAG ) != 0 )
+ ( ( ( priority ) & ( (Priority_Control) PRIORITY_GROUP_LAST ) ) != 0 )
/**
- * @brief Initializes a node.
+ * @brief Initializes the node.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[out] node is the node to initialize.
*
- * @param scheduler The scheduler for the initialization of @a node.
- * @param[out] node The node to initialize.
- * @param the_thread The thread for the initialization of @a node.
- * @param priority The priority value for @a node.
+ * @param[in, out] the_thread is the thread of the node.
+ *
+ * @param priority is the initial priority of the node.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
const struct _Scheduler_Control *scheduler,
@@ -106,7 +103,9 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
node->Wait.Priority.scheduler = scheduler;
node->user = the_thread;
node->idle = NULL;
- _SMP_sequence_lock_Initialize( &node->Priority.Lock );
+#if CPU_SIZEOF_POINTER != 8
+ _ISR_lock_Initialize( &node->Priority.Lock, "Scheduler Node Priority" );
+#endif
#else
(void) scheduler;
(void) the_thread;
@@ -114,6 +113,27 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
}
/**
+ * @brief Destroys the node.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] node is the node to destroy.
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_destroy(
+ const struct _Scheduler_Control *scheduler,
+ Scheduler_Node *node
+)
+{
+ (void) scheduler;
+
+#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER != 8
+ _ISR_lock_Destroy( &node->Priority.Lock );
+#else
+ (void) node;
+#endif
+}
+
+/**
* @brief Gets the scheduler of the node.
*
* @param node The node to get the scheduler of.
@@ -154,17 +174,18 @@ RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
{
Priority_Control priority;
-#if defined(RTEMS_SMP)
- unsigned int seq;
-
- do {
- seq = _SMP_sequence_lock_Read_begin( &node->Priority.Lock );
-#endif
-
- priority = node->Priority.value;
+#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER == 8
+ priority = _Atomic_Fetch_add_ulong(
+ &node->Priority.value,
+ 0,
+ ATOMIC_ORDER_RELAXED
+ );
+#else
+ ISR_lock_Context lock_context;
-#if defined(RTEMS_SMP)
- } while ( _SMP_sequence_lock_Read_retry( &node->Priority.Lock, seq ) );
+ _ISR_lock_Acquire( &node->Priority.Lock, &lock_context );
+ priority = node->Priority.value;
+ _ISR_lock_Release( &node->Priority.Lock, &lock_context );
#endif
return priority;
@@ -173,27 +194,31 @@ RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
/**
* @brief Sets the priority of the node.
*
- * @param[in, out] node The node to set the priority of.
- * @param new_priority The new priority for @a node.
- * @param prepend_it Indicates whether the new priority should be prepended.
+ * @param[in, out] node is the scheduler node.
+ *
+ * @param new_priority is the priority to set.
+ *
+ * @param group_order is the priority group order, see #PRIORITY_GROUP_FIRST
+ * and #PRIORITY_GROUP_LAST.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(
- Scheduler_Node *node,
- Priority_Control new_priority,
- bool prepend_it
+ Scheduler_Node *node,
+ Priority_Control new_priority,
+ Priority_Group_order group_order
)
{
-#if defined(RTEMS_SMP)
- unsigned int seq;
-
- seq = _SMP_sequence_lock_Write_begin( &node->Priority.Lock );
-#endif
-
- new_priority |= ( prepend_it ? 0 : SCHEDULER_PRIORITY_APPEND_FLAG );
- node->Priority.value = new_priority;
+#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER == 8
+ _Atomic_Store_ulong(
+ &node->Priority.value,
+ new_priority | (Priority_Control) group_order,
+ ATOMIC_ORDER_RELAXED
+ );
+#else
+ ISR_lock_Context lock_context;
-#if defined(RTEMS_SMP)
- _SMP_sequence_lock_Write_end( &node->Priority.Lock, seq );
+ _ISR_lock_Acquire( &node->Priority.Lock, &lock_context );
+ node->Priority.value = new_priority | ( (Priority_Control) group_order );
+ _ISR_lock_Release( &node->Priority.Lock, &lock_context );
#endif
}
diff --git a/cpukit/include/rtems/score/schedulerpriority.h b/cpukit/include/rtems/score/schedulerpriority.h
index 66b976ef8f..e0991f5e31 100644
--- a/cpukit/include/rtems/score/schedulerpriority.h
+++ b/cpukit/include/rtems/score/schedulerpriority.h
@@ -52,14 +52,14 @@ extern "C" {
_Scheduler_priority_Update_priority, /* update priority entry point */ \
_Scheduler_default_Map_priority, /* map priority entry point */ \
_Scheduler_default_Unmap_priority, /* unmap priority entry point */ \
- SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
+ SCHEDULER_DEFAULT_SMP_OPERATIONS \
_Scheduler_priority_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
_Scheduler_default_Release_job, /* new period of task */ \
_Scheduler_default_Cancel_job, /* cancel period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
_Scheduler_default_Start_idle /* start idle entry point */ \
- SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+ SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
}
typedef struct {
diff --git a/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
index 772a83f541..1b660fa296 100644
--- a/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -65,8 +65,8 @@ extern "C" {
_Scheduler_priority_affinity_SMP_Ask_for_help, \
_Scheduler_priority_affinity_SMP_Reconsider_help_request, \
_Scheduler_priority_affinity_SMP_Withdraw_node, \
- _Scheduler_default_Pin_or_unpin, \
- _Scheduler_default_Pin_or_unpin, \
+ _Scheduler_default_Pin_or_unpin_not_supported, \
+ _Scheduler_default_Pin_or_unpin_not_supported, \
_Scheduler_priority_affinity_SMP_Add_processor, \
_Scheduler_priority_affinity_SMP_Remove_processor, \
_Scheduler_priority_affinity_SMP_Node_initialize, \
diff --git a/cpukit/include/rtems/score/schedulerprioritysmp.h b/cpukit/include/rtems/score/schedulerprioritysmp.h
index d6ab6f6fdd..56f4aa5a5b 100644
--- a/cpukit/include/rtems/score/schedulerprioritysmp.h
+++ b/cpukit/include/rtems/score/schedulerprioritysmp.h
@@ -93,8 +93,8 @@ typedef struct {
_Scheduler_priority_SMP_Ask_for_help, \
_Scheduler_priority_SMP_Reconsider_help_request, \
_Scheduler_priority_SMP_Withdraw_node, \
- _Scheduler_default_Pin_or_unpin, \
- _Scheduler_default_Pin_or_unpin, \
+ _Scheduler_default_Pin_or_unpin_not_supported, \
+ _Scheduler_default_Pin_or_unpin_not_supported, \
_Scheduler_priority_SMP_Add_processor, \
_Scheduler_priority_SMP_Remove_processor, \
_Scheduler_priority_SMP_Node_initialize, \
@@ -103,7 +103,7 @@ typedef struct {
_Scheduler_default_Cancel_job, \
_Scheduler_default_Tick, \
_Scheduler_SMP_Start_idle \
- SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+ SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
}
/**
diff --git a/cpukit/include/rtems/score/schedulersimple.h b/cpukit/include/rtems/score/schedulersimple.h
index e201890f21..63310e9796 100644
--- a/cpukit/include/rtems/score/schedulersimple.h
+++ b/cpukit/include/rtems/score/schedulersimple.h
@@ -51,14 +51,14 @@ extern "C" {
_Scheduler_simple_Update_priority, /* update priority entry point */ \
_Scheduler_default_Map_priority, /* map priority entry point */ \
_Scheduler_default_Unmap_priority, /* unmap priority entry point */ \
- SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
+ SCHEDULER_DEFAULT_SMP_OPERATIONS \
_Scheduler_default_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
_Scheduler_default_Release_job, /* new period of task */ \
_Scheduler_default_Cancel_job, /* cancel period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
_Scheduler_default_Start_idle /* start idle entry point */ \
- SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+ SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
}
/**
diff --git a/cpukit/include/rtems/score/schedulersimplesmp.h b/cpukit/include/rtems/score/schedulersimplesmp.h
index 6b7e111208..961e60ae73 100644
--- a/cpukit/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/include/rtems/score/schedulersimplesmp.h
@@ -75,8 +75,8 @@ typedef struct {
_Scheduler_simple_SMP_Ask_for_help, \
_Scheduler_simple_SMP_Reconsider_help_request, \
_Scheduler_simple_SMP_Withdraw_node, \
- _Scheduler_default_Pin_or_unpin, \
- _Scheduler_default_Pin_or_unpin, \
+ _Scheduler_default_Pin_or_unpin_not_supported, \
+ _Scheduler_default_Pin_or_unpin_not_supported, \
_Scheduler_simple_SMP_Add_processor, \
_Scheduler_simple_SMP_Remove_processor, \
_Scheduler_simple_SMP_Node_initialize, \
@@ -85,7 +85,7 @@ typedef struct {
_Scheduler_default_Cancel_job, \
_Scheduler_default_Tick, \
_Scheduler_SMP_Start_idle \
- SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+ SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
}
/**
diff --git a/cpukit/include/rtems/score/schedulerstrongapa.h b/cpukit/include/rtems/score/schedulerstrongapa.h
index 9ee922d46d..a3a19d80c1 100644
--- a/cpukit/include/rtems/score/schedulerstrongapa.h
+++ b/cpukit/include/rtems/score/schedulerstrongapa.h
@@ -161,8 +161,8 @@ typedef struct {
_Scheduler_strong_APA_Ask_for_help, \
_Scheduler_strong_APA_Reconsider_help_request, \
_Scheduler_strong_APA_Withdraw_node, \
- _Scheduler_default_Pin_or_unpin, \
- _Scheduler_default_Pin_or_unpin, \
+ _Scheduler_default_Pin_or_unpin_not_supported, \
+ _Scheduler_default_Pin_or_unpin_not_supported, \
_Scheduler_strong_APA_Add_processor, \
_Scheduler_strong_APA_Remove_processor, \
_Scheduler_strong_APA_Node_initialize, \
diff --git a/cpukit/include/rtems/score/smpimpl.h b/cpukit/include/rtems/score/smpimpl.h
index 7c3e777299..e259105084 100644
--- a/cpukit/include/rtems/score/smpimpl.h
+++ b/cpukit/include/rtems/score/smpimpl.h
@@ -72,7 +72,8 @@ typedef enum {
SMP_FATAL_SHUTDOWN_RESPONSE,
SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED,
SMP_FATAL_SCHEDULER_PIN_OR_UNPIN_NOT_SUPPORTED,
- SMP_FATAL_WRONG_CPU_STATE_TO_PERFORM_JOBS
+ SMP_FATAL_WRONG_CPU_STATE_TO_PERFORM_JOBS,
+ SMP_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR
} SMP_Fatal_code;
/**
diff --git a/cpukit/include/rtems/score/stack.h b/cpukit/include/rtems/score/stack.h
index 23421cf7ae..ffa6368ba5 100644
--- a/cpukit/include/rtems/score/stack.h
+++ b/cpukit/include/rtems/score/stack.h
@@ -81,6 +81,23 @@ typedef void *( *Stack_Allocator_allocate )( size_t stack_size );
typedef void ( *Stack_Allocator_free )( void *addr );
/**
+ * @brief Stack allocator allocate for idle handler.
+ *
+ * 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.
+ *
+ * @retval NULL Not enough memory.
+ * @retval other Pointer to begin of stack area.
+ */
+typedef void *( *Stack_Allocator_allocate_for_idle )(
+ uint32_t cpu,
+ size_t stack_size
+);
+
+/**
* @brief The minimum stack size.
*
* Application provided via <rtems/confdefs.h>.
@@ -130,6 +147,13 @@ extern const Stack_Allocator_free _Stack_Allocator_free;
void _Stack_Allocator_do_initialize( void );
/** @} */
+/**
+ * @brief The stack allocator allocate stack for idle thread handler.
+ *
+ * Application provided via <rtems/confdefs.h>.
+ */
+extern const Stack_Allocator_allocate_for_idle
+ _Stack_Allocator_allocate_for_idle;
#ifdef __cplusplus
}
diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h
index ecc8eee058..ace42d8023 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -48,9 +48,31 @@ extern "C" {
*/
/**
- * Self for the GNU Ada Run-Time
+ * @brief The thread zombie registry is used to register threads in the
+ * #STATES_ZOMBIE state.
*/
-extern void *rtems_ada_self;
+typedef struct {
+#if defined(RTEMS_SMP)
+ /**
+ * @brief This lock protects the zombie chain.
+ */
+ ISR_lock_Control Lock;
+#endif
+
+ /**
+ * @brief This chain contains the registered zombie threads.
+ */
+ Chain_Control Chain;
+} Thread_Zombie_registry;
+
+/**
+ * @brief This object is a registry for threads in the #STATES_ZOMBIE state.
+ *
+ * The registry contains zombie threads waiting to get killed by
+ * _Thread_Kill_zombies(). Use _Thread_Add_to_zombie_registry() to add zombie
+ * threads to the registry.
+ */
+extern Thread_Zombie_registry _Thread_Zombies;
/**
* @brief Object identifier of the global constructor thread.
@@ -691,9 +713,10 @@ void _Thread_Priority_remove(
*
* @param the_thread The thread.
* @param[out] priority_node The thread priority node to change.
- * @param prepend_it In case this is true, then the thread is prepended to
- * its priority group in its home scheduler instance, otherwise it is
- * appended.
+ * @param priority_group_order The priority group order determines if the
+ * thread is inserted as the first or last node into the ready or scheduled
+ * queues of its home scheduler, see #PRIORITY_GROUP_FIRST and
+ * #PRIORITY_GROUP_LAST.
* @param queue_context The thread queue context to return an updated set of
* threads for _Thread_Priority_update(). The thread queue context must be
* initialized via _Thread_queue_Context_clear_priority_updates() before a
@@ -704,7 +727,7 @@ void _Thread_Priority_remove(
void _Thread_Priority_changed(
Thread_Control *the_thread,
Priority_Node *priority_node,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Thread_queue_Context *queue_context
);
@@ -718,9 +741,10 @@ void _Thread_Priority_changed(
* @param[out] priority_node The thread priority node to change.
* @param new_priority The new thread priority value of the thread priority
* node to change.
- * @param prepend_it In case this is true, then the thread is prepended to
- * its priority group in its home scheduler instance, otherwise it is
- * appended.
+ * @param priority_group_order The priority group order determines if the
+ * thread is inserted as the first or last node into the ready or scheduled
+ * queues of its home scheduler, see #PRIORITY_GROUP_FIRST and
+ * #PRIORITY_GROUP_LAST.
* @param queue_context The thread queue context to return an updated set of
* threads for _Thread_Priority_update(). The thread queue context must be
* initialized via _Thread_queue_Context_clear_priority_updates() before a
@@ -732,7 +756,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Priority_change(
Thread_Control *the_thread,
Priority_Node *priority_node,
Priority_Control new_priority,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Thread_queue_Context *queue_context
)
{
@@ -740,7 +764,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Priority_change(
_Thread_Priority_changed(
the_thread,
priority_node,
- prepend_it,
+ priority_group_order,
queue_context
);
}
@@ -2171,8 +2195,8 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_cancel(
queue = the_thread->Wait.queue;
-#if defined(RTEMS_SMP)
if ( queue != NULL ) {
+#if defined(RTEMS_SMP)
_Assert( queue_context->Lock_context.Wait.queue == queue );
#endif
@@ -2186,8 +2210,8 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_cancel(
#if defined(RTEMS_SMP)
_Assert( queue_context->Lock_context.Wait.queue == NULL );
queue_context->Lock_context.Wait.queue = queue;
- }
#endif
+ }
}
/**
diff --git a/cpukit/include/rtems/score/threadq.h b/cpukit/include/rtems/score/threadq.h
index 10476888d4..2fbfcd0199 100644
--- a/cpukit/include/rtems/score/threadq.h
+++ b/cpukit/include/rtems/score/threadq.h
@@ -406,6 +406,7 @@ typedef struct _Thread_queue_Heads {
} Thread_queue_Heads;
struct Thread_queue_Queue {
+#if defined(RTEMS_SMP)
/**
* @brief Lock to protect this thread queue.
*
@@ -418,7 +419,6 @@ struct Thread_queue_Queue {
* @see _Thread_queue_Acquire(), _Thread_queue_Acquire_critical() and
* _Thread_queue_Release().
*/
-#if defined(RTEMS_SMP)
SMP_ticket_lock_Control Lock;
#endif
@@ -517,37 +517,68 @@ typedef Thread_Control *( *Thread_queue_First_operation )(
);
/**
- * @brief Thread queue operations.
+ * @brief The thread queue operations are used to manage the threads of a
+ * thread queue.
+ *
+ * The standard thread queue operation variants are:
+ *
+ * * ::_Thread_queue_Operations_default
+ *
+ * * ::_Thread_queue_Operations_FIFO
+ *
+ * * ::_Thread_queue_Operations_priority
+ *
+ * * ::_Thread_queue_Operations_priority_inherit
*
* @see _Thread_wait_Set_operations().
*/
struct Thread_queue_Operations {
/**
- * @brief Thread queue priority actions operation.
+ * @brief This operation performs the thread queue priority actions.
+ *
+ * Priority actions are produced and processed during enqueue, extract, and
+ * surrender operations.
*/
Thread_queue_Priority_actions_operation priority_actions;
/**
- * @brief Thread queue enqueue operation.
+ * @brief This operation is used to enqueue the thread on the thread queue.
*
- * Called by object routines to enqueue the thread.
+ * The enqueue order is defined by the operations variant.
*/
Thread_queue_Enqueue_operation enqueue;
/**
- * @brief Thread queue extract operation.
+ * @brief This operation is used to extract the thread from the thread queue.
*
- * Called by object routines to extract a thread from a thread queue.
+ * The extract operation is intended for timeouts, thread restarts, and
+ * thread cancellation. In SMP configurations, the extract operation does
+ * not ensure FIFO fairness across schedulers for priority queues. The
+ * surrender operation should be used to dequeue a thread from the thread
+ * queue under normal conditions (no timeout, no thread restart, and no
+ * thread cancellation).
*/
Thread_queue_Extract_operation extract;
/**
- * @brief Thread queue surrender operation.
+ * @brief This operation is used to dequeue the thread from the thread queue
+ * and optionally surrender the thread queue from a previous owner to the
+ * thread.
+ *
+ * In addition to the optional surrender, there is a subtle difference
+ * between the extract and dequeue of a thread from a thread queue. In SMP
+ * configurations, FIFO fairness across schedulers for priority queues is
+ * only ensured by the dequeue done by the surrender operation and not by the
+ * extract operation.
*/
Thread_queue_Surrender_operation surrender;
/**
- * @brief Thread queue first operation.
+ * @brief This operation returns the first thread on the thread queue.
+ *
+ * This operation may be called only when the thread queue contains at least
+ * one thread. Use ::Thread_queue_Queue::heads to determine if a thread
+ * queue is empty.
*/
Thread_queue_First_operation first;
};
diff --git a/cpukit/include/rtems/score/threadqimpl.h b/cpukit/include/rtems/score/threadqimpl.h
index 44efc1fcd0..7e6f2665be 100644
--- a/cpukit/include/rtems/score/threadqimpl.h
+++ b/cpukit/include/rtems/score/threadqimpl.h
@@ -366,8 +366,8 @@ 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_save_priority_updates(
- Thread_queue_Context *queue_context
+RTEMS_INLINE_ROUTINE size_t _Thread_queue_Context_get_priority_updates(
+ const Thread_queue_Context *queue_context
)
{
return queue_context->Priority.update_count;
@@ -938,13 +938,12 @@ Status_Control _Thread_queue_Enqueue_sticky(
* @param[in, out] the_thread The thread to extract.
* @param[in, out] queue_context The thread queue context.
*
- * @return Returns the unblock indicator for _Thread_queue_Unblock_critical().
- * True indicates, that this thread must be unblocked by the scheduler later in
- * _Thread_queue_Unblock_critical(), and false otherwise. In case false is
- * returned, then the thread queue enqueue procedure was interrupted. Thus it
- * will unblock itself and the thread wait information is no longer accessible,
- * since this thread may already block on another resource in an SMP
- * configuration.
+ * @return Returns the unblock indicator. True indicates, that this thread
+ * must be unblocked by the scheduler using _Thread_Remove_timer_and_unblock(),
+ * and false otherwise. In case false is returned, then the thread queue
+ * enqueue procedure was interrupted. Thus it will unblock itself and the
+ * thread wait information is no longer accessible, since this thread may
+ * already block on another resource in an SMP configuration.
*/
bool _Thread_queue_Extract_locked(
Thread_queue_Queue *queue,
@@ -954,77 +953,23 @@ bool _Thread_queue_Extract_locked(
);
/**
- * @brief Unblocks the thread which was on the thread queue before.
- *
- * The caller must be the owner of the thread queue lock. This function will
- * release the thread queue lock. Thread dispatching is disabled before the
- * thread queue lock is released and an unblock is necessary. Thread
- * dispatching is enabled once the sequence to unblock the thread is complete.
- *
- * @param unblock The unblock indicator returned by
- * _Thread_queue_Extract_locked().
- * @param queue The actual thread queue.
- * @param[in, out] the_thread The thread to extract.
- * @param[in, out] lock_context The lock context of the lock acquire.
- */
-void _Thread_queue_Unblock_critical(
- bool unblock,
- Thread_queue_Queue *queue,
- Thread_Control *the_thread,
- ISR_lock_Context *lock_context
-);
-
-/**
- * @brief Extracts the thread from the thread queue and unblocks it.
- *
- * The caller must be the owner of the thread queue lock. This function will
- * release the thread queue lock and restore the default thread lock. Thread
- * dispatching is disabled before the thread queue lock is released and an
- * unblock is necessary. Thread dispatching is enabled once the sequence to
- * unblock the thread is complete. This makes it possible to use the thread
- * queue lock to protect the state of objects embedding the thread queue and
- * directly enter _Thread_queue_Extract_critical() to finalize an operation in
- * case a waiting thread exists.
- *
- * @code
- * #include <rtems/score/threadqimpl.h>
- *
- * typedef struct {
- * Thread_queue_Control Queue;
- * Thread_Control *owner;
- * } Mutex;
- *
- * void _Mutex_Release( Mutex *mutex )
- * {
- * Thread_queue_Context queue_context;
- * Thread_Control *first;
- *
- * _Thread_queue_Context_initialize( &queue_context, NULL );
- * _Thread_queue_Acquire( &mutex->Queue, queue_context );
+ * @brief Resumes the extracted or surrendered thread.
*
- * first = _Thread_queue_First_locked( &mutex->Queue );
- * mutex->owner = first;
+ * This function makes the thread ready again. If necessary, the thread is
+ * unblocked and its thread timer removed.
*
- * if ( first != NULL ) {
- * _Thread_queue_Extract_critical(
- * &mutex->Queue.Queue,
- * mutex->Queue.operations,
- * first,
- * &queue_context
- * );
- * }
- * @endcode
+ * The thread shall have been extracted from the thread queue or surrendered by
+ * the thread queue right before the call to this function. The caller shall
+ * be the owner of the thread queue lock.
*
- * @param queue The actual thread queue.
- * @param operations The thread queue operations.
- * @param[in, out] the_thread The thread to extract.
- * @param[in, out] queue_context The thread queue context of the lock acquire.
+ * @param queue is the actual thread queue.
+ * @param[in, out] the_thread is the thread to make ready and unblock.
+ * @param[in, out] queue_context is the thread queue context.
*/
-void _Thread_queue_Extract_critical(
- Thread_queue_Queue *queue,
- const Thread_queue_Operations *operations,
- Thread_Control *the_thread,
- Thread_queue_Context *queue_context
+void _Thread_queue_Resume(
+ Thread_queue_Queue *queue,
+ Thread_Control *the_thread,
+ Thread_queue_Context *queue_context
);
/**
@@ -1080,6 +1025,49 @@ void _Thread_queue_Surrender(
const Thread_queue_Operations *operations
);
+/**
+ * @brief Surrenders the thread queue previously owned by the thread to the
+ * first enqueued thread.
+ *
+ * The owner of the thread queue must be set to NULL by the caller.
+ *
+ * This function releases the thread queue lock. In addition it performs a
+ * thread dispatch if necessary.
+ *
+ * @param[in, out] queue The actual thread queue.
+ * @param heads The thread queue heads. It must not be NULL.
+ * @param queue_context The thread queue context of the lock acquire.
+ * @param operations The thread queue operations.
+ */
+void _Thread_queue_Surrender_no_priority(
+ Thread_queue_Queue *queue,
+ Thread_queue_Heads *heads,
+ Thread_queue_Context *queue_context,
+ const Thread_queue_Operations *operations
+);
+
+/**
+ * @brief Surrenders the thread queue previously owned by the thread to the
+ * first enqueued thread.
+ *
+ * The owner of the thread queue must be set to NULL by the caller.
+ *
+ * This function releases the thread queue lock. In addition it performs a
+ * thread dispatch if necessary.
+ *
+ * @param[in, out] queue The actual thread queue.
+ * @param heads The thread queue heads. It must not be NULL.
+ * @param queue_context The thread queue context of the lock acquire.
+ * @param operations The thread queue operations.
+ */
+Status_Control _Thread_queue_Surrender_priority_ceiling(
+ Thread_queue_Queue *queue,
+ Thread_Control *executing,
+ Priority_Node *ceiling_priority,
+ Thread_queue_Context *queue_context,
+ const Thread_queue_Operations *operations
+);
+
#if defined(RTEMS_SMP)
/**
* @brief Surrenders the thread queue previously owned by the thread to the
@@ -1129,34 +1117,6 @@ RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_empty(
* @brief Returns the first thread on the thread queue if it exists, otherwise
* @c NULL.
*
- * The caller must be the owner of the thread queue lock. The thread queue
- * lock is not released.
- *
- * @param the_thread_queue The thread queue.
- * @param operations The thread queue operations.
- *
-* @retval first The first thread on the thread queue according to the enqueue
- * order.
- * @retval NULL No thread is present on the thread queue.
- */
-RTEMS_INLINE_ROUTINE Thread_Control *_Thread_queue_First_locked(
- Thread_queue_Control *the_thread_queue,
- const Thread_queue_Operations *operations
-)
-{
- Thread_queue_Heads *heads = the_thread_queue->Queue.heads;
-
- if ( heads != NULL ) {
- return ( *operations->first )( heads );
- } else {
- return NULL;
- }
-}
-
-/**
- * @brief Returns the first thread on the thread queue if it exists, otherwise
- * @c NULL.
- *
* @param the_thread_queue The thread queue.
*
* @retval first The first thread on the thread queue according to the enqueue
@@ -1379,28 +1339,56 @@ void _Thread_queue_Unblock_proxy(
#endif
/**
- * @brief Acquires the thread queue path in a critical section.
+ * @brief This is a status code to indicate if a deadlock was detected or not.
+ */
+typedef enum {
+ /**
+ * @brief The operation did not detect a deadlock.
+ */
+ THREAD_QUEUE_NO_DEADLOCK,
+
+ /**
+ * @brief The operation detected a deadlock.
+ */
+ THREAD_QUEUE_DEADLOCK_DETECTED
+} Thread_queue_Deadlock_status;
+
+#if defined(RTEMS_SMP)
+/**
+ * @brief Acquires the thread queue path.
*
- * @param queue The thread queue queue.
- * @param the_thread The thread for the operation.
- * @param queue_context The thread queue context.
+ * The caller must own the thread queue lock.
+ *
+ * An acquired thread queue path must be released by calling
+ * _Thread_queue_Path_release() with the same thread queue context.
+ *
+ * @param queue is the thread queue queue.
*
- * @retval true The operation was successful.
- * @retval false The operation failed.
+ * @param the_thread is the thread for the operation.
+ *
+ * @param queue_context is the thread queue context.
+ *
+ * @retval THREAD_QUEUE_NO_DEADLOCK No deadlock was detected.
+ *
+ * @retval THREAD_QUEUE_DEADLOCK_DETECTED A deadlock was detected while
+ * acquiring the thread queue path. The thread queue path must still be
+ * released by _Thread_queue_Path_release() in this case.
*/
-#if defined(RTEMS_SMP)
-bool _Thread_queue_Path_acquire_critical(
+Thread_queue_Deadlock_status _Thread_queue_Path_acquire(
Thread_queue_Queue *queue,
Thread_Control *the_thread,
Thread_queue_Context *queue_context
);
/**
- * @brief Releases the thread queue path in a critical section.
+ * @brief Releases the thread queue path.
*
- * @param queue_context The thread queue context.
+ * The caller must have acquired the thread queue path with a corresponding
+ * _Thread_queue_Path_acquire().
+ *
+ * @param queue_context is the thread queue context.
*/
-void _Thread_queue_Path_release_critical(
+void _Thread_queue_Path_release(
Thread_queue_Context *queue_context
);
#endif
@@ -1436,12 +1424,33 @@ typedef struct {
Wait_queue.Queue \
)
+/**
+ * @brief The default thread queue operations are used when a thread is not
+ * enqueued on a thread queue.
+ *
+ * The default operations may be used by _Thread_Priority_apply() and
+ * _Thread_Continue() if the thread is not enqueued on a thread queue. The
+ * default operations do nothing.
+ */
extern const Thread_queue_Operations _Thread_queue_Operations_default;
+/**
+ * @brief The FIFO thread queue operations are used when a thread is enqueued
+ * on a thread queue and provide FIFO ordering of enqueued threads.
+ */
extern const Thread_queue_Operations _Thread_queue_Operations_FIFO;
+/**
+ * @brief The FIFO thread queue operations are used when a thread is enqueued
+ * on a thread queue and provide priority ordering of enqueued threads.
+ */
extern const Thread_queue_Operations _Thread_queue_Operations_priority;
+/**
+ * @brief The FIFO thread queue operations are used when a thread is enqueued
+ * on a thread queue and provide priority ordering of enqueued threads with
+ * support for priority inheritance.
+ */
extern const Thread_queue_Operations _Thread_queue_Operations_priority_inherit;
/**
diff --git a/cpukit/include/rtems/score/todimpl.h b/cpukit/include/rtems/score/todimpl.h
index 316a56ec74..acfec00186 100644
--- a/cpukit/include/rtems/score/todimpl.h
+++ b/cpukit/include/rtems/score/todimpl.h
@@ -24,6 +24,7 @@
#include <rtems/score/timestamp.h>
#include <rtems/score/timecounterimpl.h>
#include <rtems/score/watchdog.h>
+#include <rtems/score/watchdogticks.h>
#include <sys/time.h>
#include <time.h>
@@ -115,6 +116,15 @@ extern "C" {
(4 * TOD_SECONDS_PER_DAY))
/**
+ * @brief Seconds from 1970-01-01T00:00:00Z to 2400-01-01T00:00:00Z.
+ *
+ * This is the latest time of day which should be set by _TOD_Set(). The year
+ * 2400 was chosen to guarantee a defined CLOCK_REALTIME within the range of a
+ * system uptime of about 114 years.
+ */
+#define TOD_SECONDS_1970_THROUGH_2400 13569465600
+
+/**
* @brief Earliest year to which an time of day can be initialized.
*
* The following constant define the earliest year to which an
@@ -132,12 +142,16 @@ extern "C" {
* 32 bits can accept as latest point in time 2106-Feb-7 6:28:15
* but to simplify the implementation, is was decided to only
* check that the year is not greater than the year of this constant.
+ * The year 2099 was chosen because all years evenly divisible by 4 from 1988
+ * to 2099 are leap years. In this time frame, years evenly divisible by 100
+ * are no leap years unless they are evenly divisible by 400. Thus the year
+ * 2000 is a leap year.
*
- * The internal realtime clock can run centuries longer but in
+ * The internal CLOCK_REALTIME can run centuries longer but in
* contrast to the POSIX API, the RTEMS Classic API does not
* support this for efficiency reasons.
*/
-#define TOD_LATEST_YEAR 2105
+#define TOD_LATEST_YEAR 2099
/**
* @addtogroup RTEMSScoreTOD
@@ -166,6 +180,14 @@ typedef struct {
extern TOD_Control _TOD;
/**
+ * @brief This array contains the number of days in all months up to the month
+ * indicated by the index of the second dimension.
+ *
+ * The first dimension should be 0 for leap years, and 1 otherwise.
+ */
+extern const uint16_t _TOD_Days_to_date[ 2 ][ 13 ];
+
+/**
* @brief Locks the time of day mutex.
*/
void _TOD_Lock( void );
@@ -206,12 +228,39 @@ static inline void _TOD_Release( ISR_lock_Context *lock_context )
}
/**
+ * @brief Maps the year to the leap year index.
+ *
+ * @param year is the year to map.
+ *
+ * @retval 0 The year is a leap year.
+ *
+ * @retval 1 The year is not a leap year.
+ */
+static inline size_t _TOD_Get_leap_year_index( uint32_t year )
+{
+ _Assert( year % 4 != 0 || year % 100 != 0 || year % 400 == 0 );
+ return ( ( year % 4 ) + 3 ) / 4;
+}
+
+/**
+ * @brief Checks the time point is a valid new time of day for _TOD_Set().
+ *
+ * @param tod the time of day to check.
+ *
+ * @retval STATUS_SUCCESSFUL The time of day is valid.
+ *
+ * @retval STATUS_INVALID_NUMBER The time of day is invalid.
+ */
+Status_Control _TOD_Is_valid_new_time_of_day( const struct timespec *tod );
+
+/**
* @brief Sets the time of day.
*
* The caller must be the owner of the TOD lock.
*
* @param tod The new time of day in timespec format representing
- * the time since UNIX Epoch.
+ * the time since UNIX Epoch. The new time of day shall be valid according
+ * to _TOD_Is_valid_new_time_of_day().
* @param lock_context The ISR lock context used for the corresponding
* _TOD_Acquire(). The caller must be the owner of the TOD lock. This
* function will release the TOD lock.
@@ -296,26 +345,9 @@ static inline uint32_t _TOD_Seconds_since_epoch( void )
}
/**
- * @brief Gets number of ticks in a second.
- *
- * This method returns the number of ticks in a second.
- *
- * @note If the clock tick value does not multiply evenly into a second
- * then this number of ticks will be slightly shorter than a second.
- *
- * @return The number of ticks in a second.
- */
-uint32_t TOD_TICKS_PER_SECOND_method(void);
-
-/**
* @brief Gets number of ticks in a second.
- *
- * This method exists to hide the fact that TOD_TICKS_PER_SECOND can not
- * be implemented as a macro in a .h file due to visibility issues.
- * The Configuration Table is not available to SuperCore .h files but
- * is available to their .c files.
*/
-#define TOD_TICKS_PER_SECOND TOD_TICKS_PER_SECOND_method()
+#define TOD_TICKS_PER_SECOND _Watchdog_Ticks_per_second
/**
* @brief This routine returns a timeval based upon the internal timespec
@@ -337,8 +369,11 @@ RTEMS_INLINE_ROUTINE void _TOD_Get_timeval(
* specified amount.
*
* @param delta is the amount to adjust.
+ *
+ * @retval STATUS_SUCCESSFUL Successful operation.
+ * @retval other Some error occurred.
*/
-void _TOD_Adjust(
+Status_Control _TOD_Adjust(
const struct timespec *delta
);
diff --git a/cpukit/include/rtems/score/wkspace.h b/cpukit/include/rtems/score/wkspace.h
index b37f257ed6..a3af86e878 100644
--- a/cpukit/include/rtems/score/wkspace.h
+++ b/cpukit/include/rtems/score/wkspace.h
@@ -28,15 +28,7 @@ extern "C" {
#endif
/**
- * @defgroup RTEMSScoreWorkspace Workspace Handler
- *
- * @ingroup RTEMSScore
- *
- * @brief This group contains the Workspace Handler implementation.
- *
- * This handler encapsulates functionality related to the management of the
- * RTEMS Workspace. It provides mechanisms which can be used to define,
- * initialize and manipulate the RTEMS Workspace.
+ * @addtogroup RTEMSScoreWorkspace
*
* @{
*/
diff --git a/cpukit/include/rtems/score/wkspacedata.h b/cpukit/include/rtems/score/wkspacedata.h
index 3de4b02bd2..f1ca524fa0 100644
--- a/cpukit/include/rtems/score/wkspacedata.h
+++ b/cpukit/include/rtems/score/wkspacedata.h
@@ -47,7 +47,15 @@ extern "C" {
struct Heap_Control;
/**
- * @addtogroup RTEMSScoreWorkspace
+ * @defgroup RTEMSScoreWorkspace Workspace Handler
+ *
+ * @ingroup RTEMSScore
+ *
+ * @brief This group contains the Workspace Handler implementation.
+ *
+ * This handler encapsulates functionality related to the management of the
+ * RTEMS Workspace. It provides mechanisms which can be used to define,
+ * initialize and manipulate the RTEMS Workspace.
*
* @{
*/
diff --git a/cpukit/include/rtems/seterr.h b/cpukit/include/rtems/seterr.h
index 711382d732..adce762dc9 100644
--- a/cpukit/include/rtems/seterr.h
+++ b/cpukit/include/rtems/seterr.h
@@ -1,10 +1,10 @@
/**
- * @file
+ * @file
*
- * @brief Data which Ease the Burden of Consistently Setting Errno
+ * @ingroup RTEMSAPISetErrno
*
- * This file contains macros and definitions which ease the burden
- * of consistently setting errno and returning -1.
+ * @brief This header file defines macros to set ``errno`` and return minus
+ * one.
*/
/*
@@ -22,7 +22,7 @@
#include <errno.h>
/**
- * @defgroup RTEMSAPISetErrno Set Errno
+ * @defgroup RTEMSAPISetErrno Set Error Number Support
*
* @ingroup RTEMSAPI
*
diff --git a/cpukit/include/rtems/sysinit.h b/cpukit/include/rtems/sysinit.h
index 3e85aa9a2b..e3d70230c7 100644
--- a/cpukit/include/rtems/sysinit.h
+++ b/cpukit/include/rtems/sysinit.h
@@ -43,6 +43,7 @@ extern "C" {
#define RTEMS_SYSINIT_INITIAL_EXTENSIONS 000500
#define RTEMS_SYSINIT_MP_EARLY 000600
#define RTEMS_SYSINIT_DATA_STRUCTURES 000700
+#define RTEMS_SYSINIT_SCHEDULER 000780
#define RTEMS_SYSINIT_MP 000800
#define RTEMS_SYSINIT_USER_EXTENSIONS 000900
#define RTEMS_SYSINIT_CLASSIC_TASKS 000a00
diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h
index f95433bc7c..305fe3f5f3 100644
--- a/cpukit/include/rtems/test.h
+++ b/cpukit/include/rtems/test.h
@@ -2306,7 +2306,7 @@ void T_run_all(void);
void T_run_by_name(const char *);
-void T_case_begin(const char *, const T_fixture *);
+void *T_case_begin(const char *, const T_fixture *);
void T_case_end(void);
diff --git a/cpukit/libcsupport/src/getchark.c b/cpukit/libcsupport/src/getchark.c
index cfe9c022d6..2bb8bc64d2 100644
--- a/cpukit/libcsupport/src/getchark.c
+++ b/cpukit/libcsupport/src/getchark.c
@@ -1,7 +1,7 @@
/**
* @file
*
- * @ingroup BSPIO
+ * @ingroup RTEMSAPIKernelCharIO
*
* @brief This source file contains the implementation of getchark().
*/
diff --git a/cpukit/libcsupport/src/posix_devctl.c b/cpukit/libcsupport/src/posix_devctl.c
index 3ff9dd929f..fd190744e9 100644
--- a/cpukit/libcsupport/src/posix_devctl.c
+++ b/cpukit/libcsupport/src/posix_devctl.c
@@ -35,6 +35,7 @@
#include <rtems/seterr.h>
#include <unistd.h>
+#include <fcntl.h>
int posix_devctl(
int fd,
@@ -44,6 +45,15 @@ int posix_devctl(
int *__restrict dev_info_ptr
)
{
+ int rv = 0;
+
+ /*
+ * posix_devctl() is supposed to return an errno. errno needs to be
+ * preserved in spite of calling methods (e.g., close, fcntl, and ioctl)
+ * that set it.
+ */
+ int errno_copy = errno;
+
/*
* The POSIX 1003.26 standard allows for library implementations
* that implement posix_devctl() using ioctl(). In this case,
@@ -72,15 +82,69 @@ int posix_devctl(
}
/*
- * The FACE Technical Standard Edition 3.0 and newer requires the SOCKCLOSE
- * ioctl command. This is because the Security Profile does not include
- * close() and applications need a way to close sockets. Closing sockets is
- * a minimum requirement so using close() in the implementation meets that
- * requirement but also lets the application close other file types.
+ *
*/
- if (dcmd == SOCKCLOSE ) {
- return close(fd);
+ switch (dcmd) {
+
+ /*
+ * The FACE Technical Standard Edition 3.0 and newer requires the SOCKCLOSE
+ * ioctl command. This is because the Security Profile does not include
+ * close() and applications need a way to close sockets. Closing sockets is
+ * a minimum requirement so using close() in the implementation meets that
+ * requirement but also lets the application close other file types.
+ */
+ case SOCKCLOSE:
+ if (close(fd) != 0) {
+ rv = errno;
+ errno = errno_copy;
+
+ return rv;
+ }
+ break;
+
+ /*
+ * The FACE Technical Standard Edition 3.0 and newer requires the
+ * posix_devctl command to support the FIONBIO subcommand.
+ */
+ case FIONBIO: {
+ int tmp_flag;
+ int flag;
+
+ if (nbyte != sizeof(int)) {
+ return EINVAL;
+ }
+
+ tmp_flag = fcntl(fd, F_GETFL, 0);
+ if (tmp_flag == -1) {
+ rv = errno;
+ errno = errno_copy;
+
+ return rv;
+ }
+
+ flag = *(int *)dev_data_ptr;
+
+ if (flag != 0) {
+ tmp_flag |= O_NONBLOCK;
+ } else {
+ tmp_flag &= ~O_NONBLOCK;
+ }
+
+ (void) fcntl(fd, F_SETFL, tmp_flag);
+ break;
+ }
+
+ default:
+ if (ioctl(fd, dcmd, dev_data_ptr) != 0) {
+ rv = errno;
+ errno = errno_copy;
+
+ return rv;
+ }
+ break;
}
- return ioctl(fd, dcmd, dev_data_ptr);
+ errno = errno_copy;
+
+ return rv;
}
diff --git a/cpukit/libcsupport/src/printk.c b/cpukit/libcsupport/src/printk.c
index 444efab1f2..a93cd46cc1 100644
--- a/cpukit/libcsupport/src/printk.c
+++ b/cpukit/libcsupport/src/printk.c
@@ -1,8 +1,9 @@
/**
- * @file
+ * @file
*
- * @brief Kernel Printf Function
- * @ingroup libcsupport
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief This source file contains the implementation of printk().
*/
/*
diff --git a/cpukit/libcsupport/src/printk_plugin.c b/cpukit/libcsupport/src/printk_plugin.c
index 839a76e9c9..3ef3919732 100644
--- a/cpukit/libcsupport/src/printk_plugin.c
+++ b/cpukit/libcsupport/src/printk_plugin.c
@@ -1,8 +1,11 @@
/**
- * @file
+ * @file
*
- * @brief Plugin Printk
- * @ingroup libcsupport
+ * @ingroup RTEMSAPIKernelCharIO
+ * @ingroup RTEMSPrintSupport
+ *
+ * @brief This source file contains the implementation of
+ * rtems_printk_printer() and rtems_print_printer_printk().
*/
/*
diff --git a/cpukit/libcsupport/src/putk.c b/cpukit/libcsupport/src/putk.c
index 87da29667d..4407405a22 100644
--- a/cpukit/libcsupport/src/putk.c
+++ b/cpukit/libcsupport/src/putk.c
@@ -1,8 +1,9 @@
/**
- * @file
+ * @file
*
- * @brief Write Character to Stream
- * @ingroup libcsupport
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief This source file contains the implementation of putk().
*/
/*
diff --git a/cpukit/libcsupport/src/rtems_put_char.c b/cpukit/libcsupport/src/rtems_put_char.c
index 53b368fd18..5836bcb9dc 100644
--- a/cpukit/libcsupport/src/rtems_put_char.c
+++ b/cpukit/libcsupport/src/rtems_put_char.c
@@ -1,5 +1,13 @@
/* SPDX-License-Identifier: BSD-2-Clause */
+/**
+ * @file
+ *
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief This source file contains the implementation of rtems_put_char().
+ */
+
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
diff --git a/cpukit/libcsupport/src/rtems_putc.c b/cpukit/libcsupport/src/rtems_putc.c
index e27b1e4544..726893c2f1 100644
--- a/cpukit/libcsupport/src/rtems_putc.c
+++ b/cpukit/libcsupport/src/rtems_putc.c
@@ -3,7 +3,7 @@
/**
* @file
*
- * @ingroup BSPIO
+ * @ingroup RTEMSAPIKernelCharIO
*
* @brief This source file contains the implementation of rtems_putc().
*/
diff --git a/cpukit/libcsupport/src/vprintk.c b/cpukit/libcsupport/src/vprintk.c
index 308872f71e..3131390372 100644
--- a/cpukit/libcsupport/src/vprintk.c
+++ b/cpukit/libcsupport/src/vprintk.c
@@ -1,8 +1,9 @@
/**
- * @file
+ * @file
*
- * @brief Print Formatted Output
- * @ingroup libcsupport
+ * @ingroup RTEMSAPIKernelCharIO
+ *
+ * @brief This source file contains the implementation of vprintk().
*/
/*
diff --git a/cpukit/libdl/rtl-mdreloc-h8300.c b/cpukit/libdl/rtl-mdreloc-h8300.c
deleted file mode 100644
index f1a52e4f9d..0000000000
--- a/cpukit/libdl/rtl-mdreloc-h8300.c
+++ /dev/null
@@ -1,212 +0,0 @@
-#include <sys/cdefs.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.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-dw2.h"
-
-uint32_t
-rtems_rtl_elf_section_flags (const rtems_rtl_obj* obj,
- const Elf_Shdr* shdr)
-{
- return 0;
-}
-
-uint32_t
-rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
- int section,
- const char* name,
- const Elf_Shdr* shdr,
- const uint32_t flags)
-{
- (void) obj;
- (void) section;
- (void) name;
- (void) shdr;
- return flags;
-}
-
-bool
-rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
- rtems_rtl_obj_sect* sect)
-{
- (void) obj;
- (void) sect;
- return false;
-}
-
-bool
-rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
- rtems_rtl_obj_sect* sect)
-{
- (void) obj;
- (void) sect;
- return false;
-}
-
-bool
-rtems_rtl_elf_rel_resolve_sym (Elf_Word type)
-{
- return true;
-}
-
-size_t
-rtems_rtl_elf_relocate_tramp_max_size (void)
-{
- /*
- * Disable by returning 0.
- */
- return 0;
-}
-
-rtems_rtl_elf_rel_status
-rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj,
- const Elf_Rela* rela,
- const rtems_rtl_obj_sect* sect,
- const char* symname,
- const Elf_Byte syminfo,
- const Elf_Word symvalue)
-{
- (void) obj;
- (void) rela;
- (void) sect;
- (void) symname;
- (void) syminfo;
- (void) symvalue;
- return rtems_rtl_elf_rel_no_error;
-}
-
-rtems_rtl_elf_rel_status
-rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj,
- const Elf_Rela* rela,
- const rtems_rtl_obj_sect* sect,
- const char* symname,
- const Elf_Byte syminfo,
- const Elf_Word symvalue)
-{
- Elf_Addr *where;
- Elf_Word tmp;
-
- where = (Elf_Addr *)(sect->base + rela->r_offset);
-
- if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) {
- printf("rela relocation type is %ld\n", ELF_R_TYPE(rela->r_info));
- printf("relocated address 0x%08lx\n", (Elf_Addr)where);
- }
-
- tmp = symvalue;
- switch (ELF_R_TYPE(rela->r_info)) {
- case R_TYPE(NONE):
- break;
-
- case R_TYPE(DIR16):
- *(uint16_t *)where += symvalue + rela->r_addend;
- break;
-
- case R_TYPE(DIR32):
- case R_TYPE(DIR32A16):
- *where += symvalue + rela->r_addend;
- break;
-
- case R_TYPE(DIR24A8):
- if (ELF32_R_SYM(rela->r_info))
- *where += symvalue + rela->r_addend;
- break;
-
- case R_TYPE(DIR24R8):
- where = (uint32_t *)((uint32_t)where - 1);
- *where = (*where & 0xff000000) | ((*where & 0xffffff) + symvalue + rela->r_addend);
- break;
-
- case R_TYPE(PCREL8):
- /* bcc instruction */
- tmp = symvalue + rela->r_addend - (Elf_Addr)where - 1;
- if (((Elf32_Sword)tmp > 0x7f) || ((Elf32_Sword)tmp < -(Elf32_Sword)0x80)){
- printf("PCREL8 overflow\n");
- return rtems_rtl_elf_rel_failure;
- } else {
- *(uint8_t *)where = tmp;
- }
- break;
-
- case R_TYPE(PCREL16):
- /* bcc instruction */
- tmp = symvalue + rela->r_addend - (Elf_Addr)where - 2;
- if (((Elf32_Sword)tmp > 0x7fff) || ((Elf32_Sword)tmp < -(Elf32_Sword)0x8000)){
- printf("PCREL16 overflow\n");
- return rtems_rtl_elf_rel_failure;
- } else {
- *(uint16_t *)where = tmp;
- }
- break;
-
- default:
- rtems_rtl_set_error (EINVAL, "rela type record not supported");
- printf("Unsupported reloc types\n");
- return rtems_rtl_elf_rel_failure;
- }
- return rtems_rtl_elf_rel_no_error;
-}
-
-rtems_rtl_elf_rel_status
-rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj,
- const Elf_Rel* rel,
- const rtems_rtl_obj_sect* sect,
- const char* symname,
- const Elf_Byte syminfo,
- const Elf_Word symvalue)
-{
- (void) obj;
- (void) rel;
- (void) sect;
- (void) symname;
- (void) syminfo;
- (void) symvalue;
- rtems_rtl_set_error (EINVAL, "rel type record not supported");
- return rtems_rtl_elf_rel_failure;
-}
-
-rtems_rtl_elf_rel_status
-rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj,
- const Elf_Rel* rel,
- const rtems_rtl_obj_sect* sect,
- const char* symname,
- const Elf_Byte syminfo,
- const Elf_Word symvalue)
-{
- (void) obj;
- (void) rel;
- (void) sect;
- (void) symname;
- (void) syminfo;
- (void) symvalue;
- rtems_rtl_set_error (EINVAL, "rel 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)
-{
- return rtems_rtl_elf_unwind_dw2_parse (obj, name, flags);
-}
-
-bool
-rtems_rtl_elf_unwind_register (rtems_rtl_obj* obj)
-{
- return rtems_rtl_elf_unwind_dw2_register (obj);
-}
-
-bool
-rtems_rtl_elf_unwind_deregister (rtems_rtl_obj* obj)
-{
- return rtems_rtl_elf_unwind_dw2_deregister (obj);
-}
diff --git a/cpukit/libmisc/monitor/mon-part.c b/cpukit/libmisc/monitor/mon-part.c
index 18034cd58f..654700ebfc 100644
--- a/cpukit/libmisc/monitor/mon-part.c
+++ b/cpukit/libmisc/monitor/mon-part.c
@@ -22,8 +22,9 @@ rtems_monitor_part_canonical(
const Partition_Control *rtems_part = (const Partition_Control *) part_void;
canonical_part->attribute = rtems_part->attribute_set;
- canonical_part->start_addr = rtems_part->starting_address;
- canonical_part->length = rtems_part->length;
+ canonical_part->start_addr = rtems_part->base_address;
+ canonical_part->length = (uint32_t) ( (uintptr_t)
+ rtems_part->limit_address + 1 - (uintptr_t) rtems_part->base_address );
canonical_part->buf_size = rtems_part->buffer_size;
canonical_part->used_blocks = rtems_part->number_of_used_blocks;
}
diff --git a/cpukit/libmisc/rtems-fdt/rtems-fdt.c b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
index 7747ba9bf8..1cd2377967 100644
--- a/cpukit/libmisc/rtems-fdt/rtems-fdt.c
+++ b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
@@ -637,6 +637,8 @@ rtems_fdt_register (const void* dtb, rtems_fdt_handle* handle)
blob->blob = dtb;
blob->name = NULL;
+ rtems_chain_initialize_node(&blob->node);
+
fdt = rtems_fdt_lock ();
rtems_chain_append_unprotected (&fdt->blobs, &blob->node);
diff --git a/cpukit/libmisc/shell/shell_cmdset.c b/cpukit/libmisc/shell/shell_cmdset.c
index be64b83fe4..95f180bbb5 100644
--- a/cpukit/libmisc/shell/shell_cmdset.c
+++ b/cpukit/libmisc/shell/shell_cmdset.c
@@ -112,6 +112,11 @@ rtems_shell_cmd_t *rtems_shell_add_cmd_struct(
rtems_shell_cmd_t **next_ptr = &rtems_shell_first_cmd;
rtems_shell_cmd_t *existing;
+ if (shell_cmd == NULL)
+ return NULL;
+ if (shell_cmd->name == NULL)
+ return NULL;
+
/*
* Iterate through all commands and check if a command with this name is
* already present.
diff --git a/cpukit/libtest/t-test-time.c b/cpukit/libtest/t-test-time.c
index 156ceaad1f..c6a43acfc5 100644
--- a/cpukit/libtest/t-test-time.c
+++ b/cpukit/libtest/t-test-time.c
@@ -35,6 +35,7 @@
#include <time.h>
#ifdef __rtems__
+#include <rtems.h>
#include <rtems/counter.h>
#include <rtems/score/timecounter.h>
#endif
@@ -231,8 +232,52 @@ T_now_dummy(void)
memory_order_relaxed);
}
+#ifndef __rtems__
T_time
T_now_tick(void)
{
return T_ticks_to_time(T_tick());
}
+#else /* __rtems__ */
+#if defined(RTEMS_SMP)
+static rtems_interrupt_lock T_time_lock =
+ RTEMS_INTERRUPT_LOCK_INITIALIZER("Test Time Lock");
+#endif
+
+static T_ticks T_tick_last;
+
+static T_time T_tick_time;
+
+static bool T_tick_initialized;
+
+T_time
+T_now_tick(void)
+{
+ rtems_interrupt_lock_context lock_context;
+ T_ticks ticks;
+ T_time now;
+
+ ticks = T_tick();
+
+ rtems_interrupt_lock_acquire(&T_time_lock, &lock_context);
+
+ if (T_tick_initialized) {
+ T_ticks last;
+
+ last = T_tick_last;
+ T_tick_last = ticks;
+
+ now = T_tick_time;
+ now += T_ticks_to_time(ticks - last);
+ T_tick_time = now;
+ } else {
+ T_tick_initialized = true;
+ T_tick_last = ticks;
+ now = 0;
+ }
+
+ rtems_interrupt_lock_release(&T_time_lock, &lock_context);
+
+ return now;
+}
+#endif /* __rtems__ */
diff --git a/cpukit/libtest/t-test.c b/cpukit/libtest/t-test.c
index 910d965235..0935a5ceb1 100644
--- a/cpukit/libtest/t-test.c
+++ b/cpukit/libtest/t-test.c
@@ -1156,7 +1156,7 @@ T_run_by_name(const char *name)
static T_case_context default_case;
-void
+void *
T_case_begin(const char *name, const T_fixture *fixture)
{
T_case_context *tc;
@@ -1165,6 +1165,7 @@ T_case_begin(const char *name, const T_fixture *fixture)
tc->name = name;
tc->fixture = fixture;
T_do_case_begin(&T_instance, tc);
+ return T_instance.case_fixture.context;
}
void
diff --git a/cpukit/mghttpd/mongoose.c b/cpukit/mghttpd/mongoose.c
index 0736c836ec..623d6a501f 100644
--- a/cpukit/mghttpd/mongoose.c
+++ b/cpukit/mghttpd/mongoose.c
@@ -81,6 +81,12 @@
#include <stddef.h>
#include <stdio.h>
+#if __rtems__
+#include <time.h>
+#include <sys/param.h>
+#include <rtems/libio_.h>
+#endif
+
#if defined(_WIN32) && !defined(__SYMBIAN32__) // Windows specific
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0400 // To make it link in VS2005
@@ -1516,13 +1522,32 @@ static int set_non_blocking_mode(SOCKET sock) {
#ifndef HAVE_POLL
static int poll(struct pollfd *pfd, int n, int milliseconds) {
struct timeval tv;
+#if __rtems__
+ #define set (*set_prealloc)
+ static fd_set *set_prealloc;
+ static size_t set_size;
+#else
fd_set set;
+#endif
int i, result;
SOCKET maxfd = 0;
tv.tv_sec = milliseconds / 1000;
tv.tv_usec = (milliseconds % 1000) * 1000;
+#if __rtems__
+ if (set_prealloc == NULL) {
+ set_size =
+ sizeof(fd_set) * (howmany(rtems_libio_number_iops, sizeof(fd_set) * 8));
+ set_prealloc = malloc(set_size);
+ if (set_prealloc == NULL) {
+ errno = ENOMEM;
+ return -1;
+ }
+ }
+ memset(set_prealloc, 0, set_size);
+#else
FD_ZERO(&set);
+#endif
for (i = 0; i < n; i++) {
FD_SET((SOCKET) pfd[i].fd, &set);
@@ -5368,6 +5393,12 @@ static void *master_thread(void *thread_func_param) {
}
}
}
+#if __rtems__
+ else {
+ struct timespec t = { .tv_sec = 0, .tv_nsec = 500000000L };
+ nanosleep(&t, &t);
+ }
+#endif /* __rtems__ */
}
free(pfd);
DEBUG_TRACE(("stopping workers"));
diff --git a/cpukit/posix/src/adjtime.c b/cpukit/posix/src/adjtime.c
index ab61693f19..ec8cb19a2e 100644
--- a/cpukit/posix/src/adjtime.c
+++ b/cpukit/posix/src/adjtime.c
@@ -44,6 +44,7 @@ int adjtime(
)
{
struct timespec delta_as_timespec;
+ Status_Control status;
/*
* Simple validations
@@ -83,7 +84,10 @@ int adjtime(
/*
* Now apply the adjustment
*/
- _TOD_Adjust( &delta_as_timespec );
+ status = _TOD_Adjust( &delta_as_timespec );
+ if ( status != STATUS_SUCCESSFUL ) {
+ rtems_set_errno_and_return_minus_one( STATUS_GET_POSIX( status ) );
+ }
return 0;
}
diff --git a/cpukit/posix/src/clocksettime.c b/cpukit/posix/src/clocksettime.c
index 53e728762e..23bb14a86d 100644
--- a/cpukit/posix/src/clocksettime.c
+++ b/cpukit/posix/src/clocksettime.c
@@ -41,6 +41,11 @@ int clock_settime(
if ( clock_id == CLOCK_REALTIME ) {
ISR_lock_Context lock_context;
+ status = _TOD_Is_valid_new_time_of_day( tp );
+ if ( status != STATUS_SUCCESSFUL ) {
+ rtems_set_errno_and_return_minus_one( STATUS_GET_POSIX( status ) );
+ }
+
_TOD_Lock();
_TOD_Acquire( &lock_context );
status = _TOD_Set( tp, &lock_context );
diff --git a/cpukit/posix/src/condsignalsupp.c b/cpukit/posix/src/condsignalsupp.c
index dd3886ae69..188e61ec75 100644
--- a/cpukit/posix/src/condsignalsupp.c
+++ b/cpukit/posix/src/condsignalsupp.c
@@ -35,36 +35,33 @@ int _POSIX_Condition_variables_Signal_support(
{
POSIX_Condition_variables_Control *the_cond;
unsigned long flags;
- const Thread_queue_Operations *operations;
- Thread_queue_Heads *heads;
+ Thread_queue_Context queue_context;
the_cond = _POSIX_Condition_variables_Get( cond );
POSIX_CONDITION_VARIABLES_VALIDATE_OBJECT( the_cond, flags );
- operations = POSIX_CONDITION_VARIABLES_TQ_OPERATIONS;
+ _Thread_queue_Context_initialize( &queue_context );
do {
- Thread_queue_Context queue_context;
+ Thread_queue_Heads *heads;
- _Thread_queue_Context_initialize( &queue_context );
_POSIX_Condition_variables_Acquire( the_cond, &queue_context );
heads = the_cond->Queue.Queue.heads;
- if ( heads != NULL ) {
- Thread_Control *the_thread;
-
- the_thread = ( *operations->first )( heads );
- _Thread_queue_Extract_critical(
- &the_cond->Queue.Queue,
- operations,
- the_thread,
- &queue_context
- );
- } else {
+ if ( heads == NULL ) {
the_cond->mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_POSIX_Condition_variables_Release( the_cond, &queue_context );
+
+ return 0;
}
- } while ( is_broadcast && heads != NULL );
+
+ _Thread_queue_Surrender_no_priority(
+ &the_cond->Queue.Queue,
+ heads,
+ &queue_context,
+ POSIX_CONDITION_VARIABLES_TQ_OPERATIONS
+ );
+ } while ( is_broadcast );
return 0;
}
diff --git a/cpukit/posix/src/confstr.c b/cpukit/posix/src/confstr.c
new file mode 100644
index 0000000000..bf27ca3c38
--- /dev/null
+++ b/cpukit/posix/src/confstr.c
@@ -0,0 +1,127 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ * @brief Implementation for confstr method
+ */
+
+/*
+ * Copyright (C) 2020 Eshan Dhawan
+ *
+ * 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 <sys/cdefs.h>
+#include <sys/param.h>
+#include <errno.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+
+/* Many programming environment flags have same values
+* this block is added to raise error if the flags value change
+*/
+
+#if (_CS_POSIX_V6_ILP32_OFF32_CFLAGS != _CS_POSIX_V7_ILP32_OFF32_CFLAGS)
+#error "_CS_POSIX_V6_ILP32_OFF32_CFLAGS and _CS_POSIX_V7_ILP32_OFF32_CFLAGS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V6_ILP32_OFF32_LDFLAGS != _CS_POSIX_V7_ILP32_OFF32_LDFLAGS)
+#error "_CS_POSIX_V6_ILP32_OFF32_LDFLAGS and _CS_POSIX_V7_ILP32_OFF32_LDFLAGS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V6_ILP32_OFF32_LIBS!= _CS_POSIX_V7_ILP32_OFF32_LIBS)
+#error "_CS_POSIX_V6_ILP32_OFF32_LIBS and _CS_POSIX_V7_ILP32_OFF32_LIBS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS != _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS)
+#error "_CS_POSIX_V6_LPBIG_OFFBIG_CFLAG and _CS_POSIX_V7_LPBIG_OFFBIG_CFLAG flag values not equal"
+#endif
+
+#if (_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS != _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS)
+#error "_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS and _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V7_LPBIG_OFFBIG_LIBS != _CS_POSIX_V7_LPBIG_OFFBIG_LIBS)
+#error "_CS_POSIX_V6_LPBIG_OFFBIG_LIBS and _CS_POSIX_V7_LPBIG_OFFBIG_LIBS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS != _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS)
+#error "_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS and _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS != _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS)
+#error "_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS and _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V7_ILP32_OFFBIG_LIBS != _CS_POSIX_V7_ILP32_OFFBIG_LIBS)
+#error "_CS_POSIX_V6_ILP32_OFFBIG_LIBS and _CS_POSIX_V7_ILP32_OFFBIG_LIBS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V6_LP64_OFF64_CFLAGS != _CS_POSIX_V7_LP64_OFF64_CFLAGS)
+#error "_CS_POSIX_V6_LP64_OFF64_CFLAGS and _CS_POSIX_V7_LP64_OFF64_CFLAGS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V6_LP64_OFF64_LDFLAGS != _CS_POSIX_V7_LP64_OFF64_LDFLAGS)
+#error "_CS_POSIX_V6_LP64_OFF64_LDFLAGS and _CS_POSIX_V7_LP64_OFF64_LDFLAGS flag values not equal"
+#endif
+
+#if (_CS_POSIX_V7_LP64_OFF64_LIBS != _CS_POSIX_V7_LP64_OFF64_LIBS)
+#error "_CS_POSIX_V6_LP64_OFF64_LIBS and _CS_POSIX_V7_LP64_OFF64_LIBS flag values not equal"
+#endif
+
+#if (_CS_V6_ENV != _CS_V7_ENV)
+#error "_CS_V6_ENV and _CS_V7_ENV flag values not equal"
+#endif
+
+size_t confstr(int name, char *buf, size_t len){
+ const char *p;
+ const char UPE[] = "unsupported programming environment";
+
+ switch (name) {
+ case _CS_PATH:
+ errno = EINVAL;
+ return (0);
+ case _CS_POSIX_V7_ILP32_OFF32_CFLAGS:
+ case _CS_POSIX_V7_ILP32_OFF32_LDFLAGS:
+ case _CS_POSIX_V7_ILP32_OFF32_LIBS:
+ case _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS:
+ case _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS:
+ case _CS_POSIX_V7_LPBIG_OFFBIG_LIBS:
+ case _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS:
+ case _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS:
+ case _CS_POSIX_V7_ILP32_OFFBIG_LIBS:
+ case _CS_POSIX_V7_LP64_OFF64_CFLAGS:
+ case _CS_POSIX_V7_LP64_OFF64_LDFLAGS:
+ case _CS_POSIX_V7_LP64_OFF64_LIBS:
+ case _CS_V7_ENV:
+ p = UPE;
+ if (len != 0 && buf != NULL){
+ strlcpy(buf, p, len);
+ }
+ return (strlen(p) + 1);
+ default:
+ errno = EINVAL;
+ return (0);
+ }
+}
diff --git a/cpukit/posix/src/psxtimercreate.c b/cpukit/posix/src/psxtimercreate.c
index a63cf1d100..2b5a10140f 100644
--- a/cpukit/posix/src/psxtimercreate.c
+++ b/cpukit/posix/src/psxtimercreate.c
@@ -40,7 +40,7 @@ int timer_create(
{
POSIX_Timer_Control *ptimer;
- if ( clock_id != CLOCK_REALTIME )
+ if ( clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !timerid )
@@ -91,6 +91,7 @@ int timer_create(
ptimer->timer_data.it_value.tv_nsec = 0;
ptimer->timer_data.it_interval.tv_sec = 0;
ptimer->timer_data.it_interval.tv_nsec = 0;
+ ptimer->clock_type = clock_id;
_Watchdog_Preinitialize( &ptimer->Timer, _Per_CPU_Get_snapshot() );
_Watchdog_Initialize( &ptimer->Timer, _POSIX_Timer_TSR );
diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c
index e9be24b417..1c207e7887 100644
--- a/cpukit/posix/src/pthreadsetschedparam.c
+++ b/cpukit/posix/src/pthreadsetschedparam.c
@@ -96,7 +96,7 @@ static int _POSIX_Set_sched_param(
_Thread_Priority_changed(
the_thread,
&the_thread->Real_priority,
- false,
+ PRIORITY_GROUP_LAST,
queue_context
);
#if defined(RTEMS_POSIX_API)
diff --git a/cpukit/posix/src/pthreadsetschedprio.c b/cpukit/posix/src/pthreadsetschedprio.c
index 72c7dab273..ae2add6232 100644
--- a/cpukit/posix/src/pthreadsetschedprio.c
+++ b/cpukit/posix/src/pthreadsetschedprio.c
@@ -49,7 +49,7 @@ int pthread_setschedprio( pthread_t thread, int prio )
the_thread,
&the_thread->Real_priority,
new_priority,
- true,
+ PRIORITY_GROUP_FIRST,
&queue_context
);
diff --git a/cpukit/posix/src/sempost.c b/cpukit/posix/src/sempost.c
index f1fb7fa693..49142b25a2 100644
--- a/cpukit/posix/src/sempost.c
+++ b/cpukit/posix/src/sempost.c
@@ -47,18 +47,12 @@ int sem_post( sem_t *_sem )
}
if ( RTEMS_PREDICT_TRUE( heads != NULL ) ) {
- const Thread_queue_Operations *operations;
- Thread_Control *first;
-
_Thread_queue_Context_set_ISR_level( &queue_context, level );
- operations = SEMAPHORE_TQ_OPERATIONS;
- first = ( *operations->first )( heads );
-
- _Thread_queue_Extract_critical(
+ _Thread_queue_Surrender_no_priority(
&sem->Queue.Queue,
- operations,
- first,
- &queue_context
+ heads,
+ &queue_context,
+ SEMAPHORE_TQ_OPERATIONS
);
return 0;
}
diff --git a/cpukit/posix/src/timergettime.c b/cpukit/posix/src/timergettime.c
index ee2a566f0e..f4b259678c 100644
--- a/cpukit/posix/src/timergettime.c
+++ b/cpukit/posix/src/timergettime.c
@@ -28,6 +28,7 @@
#include <rtems/score/todimpl.h>
#include <rtems/score/watchdogimpl.h>
#include <rtems/seterr.h>
+#include <rtems/timespec.h>
/*
* - When a timer is initialized, the value of the time in
@@ -42,32 +43,43 @@ int timer_gettime(
)
{
POSIX_Timer_Control *ptimer;
- ISR_lock_Context lock_context;
- uint64_t now;
- uint32_t remaining;
+ ISR_lock_Context lock_context;
+ Per_CPU_Control *cpu;
+ struct timespec now;
+ struct timespec expire;
+ struct timespec result;
if ( !value )
rtems_set_errno_and_return_minus_one( EINVAL );
ptimer = _POSIX_Timer_Get( timerid, &lock_context );
- if ( ptimer != NULL ) {
- Per_CPU_Control *cpu;
+ if ( ptimer == NULL ) {
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ }
- cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context );
- now = cpu->Watchdog.ticks;
+ cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context );
+ rtems_timespec_from_ticks( ptimer->Timer.expire, &expire );
- if ( now < ptimer->Timer.expire ) {
- remaining = (uint32_t) ( ptimer->Timer.expire - now );
- } else {
- remaining = 0;
- }
+ if ( ptimer->clock_type == CLOCK_MONOTONIC ) {
+ _Timecounter_Nanouptime(&now);
+ } else if (ptimer->clock_type == CLOCK_REALTIME) {
+ _TOD_Get(&now);
+ } else {
+ _POSIX_Timer_Release( cpu, &lock_context );
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ }
- _Timespec_From_ticks( remaining, &value->it_value );
- value->it_interval = ptimer->timer_data.it_interval;
- _POSIX_Timer_Release( cpu, &lock_context );
- return 0;
+ if ( rtems_timespec_less_than( &now, &expire ) ) {
+ rtems_timespec_subtract( &now, &expire, &result );
+ } else {
+ result.tv_nsec = 0;
+ result.tv_sec = 0;
}
- rtems_set_errno_and_return_minus_one( EINVAL );
-}
+ value->it_value = result;
+ value->it_interval = ptimer->timer_data.it_interval;
+
+ _POSIX_Timer_Release( cpu, &lock_context );
+ return 0;
+} \ No newline at end of file
diff --git a/cpukit/rtems/src/clockgettod.c b/cpukit/rtems/src/clockgettod.c
index dea136d477..fed9057f24 100644
--- a/cpukit/rtems/src/clockgettod.c
+++ b/cpukit/rtems/src/clockgettod.c
@@ -32,8 +32,6 @@
#define RTEMS_DAYS_PER_YEAR (365UL)
#define RTEMS_YEAR_BASE (1970UL)
-extern const uint16_t _TOD_Days_to_date[2][13];
-
static bool _Leap_year(
uint32_t year
)
@@ -64,9 +62,9 @@ static uint32_t _Year_day_as_month(
uint32_t month = 0;
if ( _Leap_year( year ) )
- days_to_date = _TOD_Days_to_date[1];
- else
days_to_date = _TOD_Days_to_date[0];
+ else
+ days_to_date = _TOD_Days_to_date[1];
days_to_date += 2;
@@ -83,7 +81,7 @@ static uint32_t _Year_day_as_month(
}
rtems_status_code rtems_clock_get_tod(
- rtems_time_of_day *time_buffer
+ rtems_time_of_day *time_of_day
)
{
struct timeval now;
@@ -93,7 +91,7 @@ rtems_status_code rtems_clock_get_tod(
uint32_t year_days;
uint32_t leap_years;
- if ( !time_buffer )
+ if ( !time_of_day )
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Is_set() )
@@ -102,9 +100,14 @@ rtems_status_code rtems_clock_get_tod(
/* Obtain the current time */
_TOD_Get_timeval( &now );
- /* How many days and how many seconds in the day ? */
- days = now.tv_sec / RTEMS_SECS_PER_DAY;
- day_secs = now.tv_sec % RTEMS_SECS_PER_DAY;
+ /*
+ * How many days and how many seconds in the day?
+ *
+ * A 32-bit integer can represent enough days for several 1000 years. When
+ * the current time is valid, the integer conversions below are well defined.
+ */
+ days = (uint32_t) ( now.tv_sec / RTEMS_SECS_PER_DAY );
+ day_secs = (uint32_t) ( now.tv_sec % RTEMS_SECS_PER_DAY );
/* How many non-leap year years ? */
year = ( days / RTEMS_DAYS_PER_YEAR ) + RTEMS_YEAR_BASE;
@@ -123,14 +126,14 @@ rtems_status_code rtems_clock_get_tod(
}
}
- time_buffer->year = year;
- time_buffer->month = _Year_day_as_month( year, &year_days ) + 1;
- time_buffer->day = year_days + 1;
- time_buffer->hour = day_secs / RTEMS_SECS_PER_HOUR;
- time_buffer->minute = day_secs % RTEMS_SECS_PER_HOUR;
- time_buffer->second = time_buffer->minute % RTEMS_SECS_PER_MINUTE;
- time_buffer->minute = time_buffer->minute / RTEMS_SECS_PER_MINUTE;
- time_buffer->ticks = now.tv_usec /
+ time_of_day->year = year;
+ time_of_day->month = _Year_day_as_month( year, &year_days ) + 1;
+ time_of_day->day = year_days + 1;
+ time_of_day->hour = day_secs / RTEMS_SECS_PER_HOUR;
+ time_of_day->minute = day_secs % RTEMS_SECS_PER_HOUR;
+ time_of_day->second = time_of_day->minute % RTEMS_SECS_PER_MINUTE;
+ time_of_day->minute = time_of_day->minute / RTEMS_SECS_PER_MINUTE;
+ time_of_day->ticks = now.tv_usec /
rtems_configuration_get_microseconds_per_tick( );
return RTEMS_SUCCESSFUL;
diff --git a/cpukit/rtems/src/clockgettodtimeval.c b/cpukit/rtems/src/clockgettodtimeval.c
index bf3847afec..a8d89c60a6 100644
--- a/cpukit/rtems/src/clockgettodtimeval.c
+++ b/cpukit/rtems/src/clockgettodtimeval.c
@@ -24,16 +24,16 @@
#include <rtems/score/todimpl.h>
rtems_status_code rtems_clock_get_tod_timeval(
- struct timeval *time
+ struct timeval *time_of_day
)
{
- if ( !time )
+ if ( !time_of_day )
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Is_set() )
return RTEMS_NOT_DEFINED;
- _TOD_Get_timeval( time );
+ _TOD_Get_timeval( time_of_day );
return RTEMS_SUCCESSFUL;
}
diff --git a/cpukit/rtems/src/clocktodtoseconds.c b/cpukit/rtems/src/clocktodtoseconds.c
index 86e89f86eb..43bf6c59c5 100644
--- a/cpukit/rtems/src/clocktodtoseconds.c
+++ b/cpukit/rtems/src/clocktodtoseconds.c
@@ -23,16 +23,9 @@
#include <rtems/rtems/clockimpl.h>
#include <rtems/score/todimpl.h>
-#define TOD_SECONDS_AT_2100_03_01_00_00 4107542400UL
-
-/*
- * The following array contains the number of days in all months
- * up to the month indicated by the index of the second dimension.
- * The first dimension should be 1 for leap years, and 0 otherwise.
- */
-const uint16_t _TOD_Days_to_date[2][13] = {
- { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
- { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
+const uint16_t _TOD_Days_to_date[ 2 ][ 13 ] = {
+ { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 },
+ { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }
};
/*
@@ -48,21 +41,18 @@ Watchdog_Interval _TOD_To_seconds(
const rtems_time_of_day *the_tod
)
{
- uint32_t time;
- uint32_t year_mod_4;
+ uint32_t time;
+ size_t leap_year_index;
time = the_tod->day - 1;
- year_mod_4 = the_tod->year & 3;
- if ( year_mod_4 == 0 )
- time += _TOD_Days_to_date[ 1 ][ the_tod->month ];
- else
- time += _TOD_Days_to_date[ 0 ][ the_tod->month ];
+ leap_year_index = _TOD_Get_leap_year_index( the_tod->year );
+ time += _TOD_Days_to_date[ leap_year_index ][ the_tod->month ];
time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) *
( (TOD_DAYS_PER_YEAR * 4) + 1);
- time += _TOD_Days_since_last_leap_year[ year_mod_4 ];
+ time += _TOD_Days_since_last_leap_year[ the_tod->year % 4 ];
time *= TOD_SECONDS_PER_DAY;
@@ -70,13 +60,6 @@ Watchdog_Interval _TOD_To_seconds(
* TOD_SECONDS_PER_MINUTE;
time += the_tod->second;
-
- /* The year 2100 is not a leap year */
- if ( time
- >= (TOD_SECONDS_AT_2100_03_01_00_00 - TOD_SECONDS_1970_THROUGH_1988)) {
- time -= TOD_SECONDS_PER_DAY;
- }
-
time += TOD_SECONDS_1970_THROUGH_1988;
return( time );
diff --git a/cpukit/rtems/src/clocktodvalidate.c b/cpukit/rtems/src/clocktodvalidate.c
index 14b3f79d8e..4433374e65 100644
--- a/cpukit/rtems/src/clocktodvalidate.c
+++ b/cpukit/rtems/src/clocktodvalidate.c
@@ -26,13 +26,13 @@
/*
* The following array contains the number of days in all months.
- * The first dimension should be 1 for leap years, and 0 otherwise.
+ * The first dimension should be 0 for leap years, and 1 otherwise.
* The second dimension should range from 1 to 12 for January to
- * February, respectively.
+ * December, respectively.
*/
-const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = {
- { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
- { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+static const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = {
+ { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
+ { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
};
rtems_status_code _TOD_Validate(
@@ -40,6 +40,7 @@ rtems_status_code _TOD_Validate(
TOD_Ticks_validation ticks_validation
)
{
+ size_t leap_year_index;
uint32_t days_in_month;
uint32_t ticks_per_second;
uint32_t ticks_mask;
@@ -51,23 +52,36 @@ rtems_status_code _TOD_Validate(
ticks_per_second = rtems_clock_get_ticks_per_second();
ticks_mask = (uint32_t) ticks_validation;
- if ( ( ( the_tod->ticks & ticks_mask ) >= ticks_per_second ) ||
- (the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
- (the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
- (the_tod->hour >= TOD_HOURS_PER_DAY) ||
- (the_tod->month == 0) ||
- (the_tod->month > TOD_MONTHS_PER_YEAR) ||
- (the_tod->year < TOD_BASE_YEAR) ||
- (the_tod->year > TOD_LATEST_YEAR) ||
- (the_tod->day == 0) ) {
+ if ( ( the_tod->ticks & ticks_mask ) >= ticks_per_second ) {
return RTEMS_INVALID_CLOCK;
}
- if (((the_tod->year % 4) == 0 && (the_tod->year % 100 != 0)) ||
- (the_tod->year % 400 == 0))
- days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
- else
- days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
+ if ( the_tod->second >= TOD_SECONDS_PER_MINUTE ) {
+ return RTEMS_INVALID_CLOCK;
+ }
+
+ if ( the_tod->minute >= TOD_MINUTES_PER_HOUR ) {
+ return RTEMS_INVALID_CLOCK;
+ }
+
+ if ( the_tod->hour >= TOD_HOURS_PER_DAY ) {
+ return RTEMS_INVALID_CLOCK;
+ }
+
+ if ( the_tod->month == 0 || the_tod->month > TOD_MONTHS_PER_YEAR ) {
+ return RTEMS_INVALID_CLOCK;
+ }
+
+ if ( the_tod->year < TOD_BASE_YEAR || the_tod->year > TOD_LATEST_YEAR ) {
+ return RTEMS_INVALID_CLOCK;
+ }
+
+ if ( the_tod->day == 0 ) {
+ return RTEMS_INVALID_CLOCK;
+ }
+
+ leap_year_index = _TOD_Get_leap_year_index( the_tod->year );
+ days_in_month = _TOD_Days_per_month[ leap_year_index ][ the_tod->month ];
if ( the_tod->day > days_in_month ) {
return RTEMS_INVALID_CLOCK;
diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c
index 012a416a1a..002bc0ceb9 100644
--- a/cpukit/rtems/src/partcreate.c
+++ b/cpukit/rtems/src/partcreate.c
@@ -23,6 +23,7 @@
#include <rtems/rtems/partimpl.h>
#include <rtems/rtems/attrimpl.h>
#include <rtems/rtems/support.h>
+#include <rtems/score/address.h>
#include <rtems/score/chainimpl.h>
#include <rtems/score/sysstate.h>
#include <rtems/sysinit.h>
@@ -40,8 +41,11 @@ static void _Partition_Initialize(
rtems_attribute attribute_set
)
{
- the_partition->starting_address = starting_address;
- the_partition->length = length;
+ const void *limit_address;
+
+ limit_address = _Addresses_Add_offset( starting_address, length - 1 );
+ the_partition->base_address = starting_address;
+ the_partition->limit_address = limit_address;
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
@@ -124,7 +128,7 @@ rtems_status_code rtems_partition_create(
if ( _Attributes_Is_global( attribute_set ) &&
!( _Objects_MP_Allocate_and_open( &_Partition_Information, name,
the_partition->Object.id, false ) ) ) {
- _Partition_Free( the_partition );
+ _Objects_Free( &_Partition_Information, &the_partition->Object );
_Objects_Allocator_unlock();
return RTEMS_TOO_MANY;
}
diff --git a/cpukit/rtems/src/partreturnbuffer.c b/cpukit/rtems/src/partreturnbuffer.c
index f5ab7d85f9..68302f1163 100644
--- a/cpukit/rtems/src/partreturnbuffer.c
+++ b/cpukit/rtems/src/partreturnbuffer.c
@@ -33,7 +33,7 @@ static bool _Partition_Is_address_on_buffer_boundary(
offset = _Addresses_Subtract(
the_buffer,
- the_partition->starting_address
+ the_partition->base_address
);
return ( offset % the_partition->buffer_size ) == 0;
@@ -44,14 +44,17 @@ static bool _Partition_Is_address_a_buffer_begin(
const void *the_buffer
)
{
- void *starting;
- void *ending;
+ const void *base;
+ const void *limit;
- starting = the_partition->starting_address;
- ending = _Addresses_Add_offset( starting, the_partition->length );
+ base = the_partition->base_address;
+ limit = the_partition->limit_address;
- return _Addresses_Is_in_range( the_buffer, starting, ending )
- && _Partition_Is_address_on_buffer_boundary( the_partition, the_buffer );
+ if ( !_Addresses_Is_in_range( the_buffer, base, limit ) ) {
+ return false;
+ }
+
+ return _Partition_Is_address_on_buffer_boundary( the_partition, the_buffer );
}
static void _Partition_Free_buffer(
diff --git a/cpukit/rtems/src/ratemoncancel.c b/cpukit/rtems/src/ratemoncancel.c
index 3d95c06fd7..ccc03942c6 100644
--- a/cpukit/rtems/src/ratemoncancel.c
+++ b/cpukit/rtems/src/ratemoncancel.c
@@ -35,6 +35,7 @@ void _Rate_monotonic_Cancel(
_Rate_monotonic_Acquire_critical( the_period, lock_context );
_Watchdog_Per_CPU_remove_ticks( &the_period->Timer );
+ the_period->postponed_jobs = 0;
the_period->state = RATE_MONOTONIC_INACTIVE;
_Scheduler_Cancel_job(
the_period->owner,
diff --git a/cpukit/rtems/src/ratemoncreate.c b/cpukit/rtems/src/ratemoncreate.c
index cd56a13df6..1376e51608 100644
--- a/cpukit/rtems/src/ratemoncreate.c
+++ b/cpukit/rtems/src/ratemoncreate.c
@@ -54,6 +54,7 @@ rtems_status_code rtems_rate_monotonic_create(
the_period->owner = _Thread_Get_executing();
the_period->state = RATE_MONOTONIC_INACTIVE;
+ the_period->postponed_jobs = 0;
_Watchdog_Preinitialize( &the_period->Timer, _Per_CPU_Get_by_index( 0 ) );
_Watchdog_Initialize( &the_period->Timer, _Rate_monotonic_Timeout );
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 2c55eb089d..7f0d302583 100644
--- a/cpukit/rtems/src/ratemonperiod.c
+++ b/cpukit/rtems/src/ratemonperiod.c
@@ -217,7 +217,7 @@ static rtems_status_code _Rate_monotonic_Activate(
ISR_lock_Context *lock_context
)
{
- the_period->postponed_jobs = 0;
+ _Assert( the_period->postponed_jobs == 0 );
the_period->state = RATE_MONOTONIC_ACTIVE;
the_period->next_length = length;
_Rate_monotonic_Restart( the_period, executing, lock_context );
diff --git a/cpukit/rtems/src/tasksetpriority.c b/cpukit/rtems/src/tasksetpriority.c
index 50d1bc156c..532848ea52 100644
--- a/cpukit/rtems/src/tasksetpriority.c
+++ b/cpukit/rtems/src/tasksetpriority.c
@@ -50,7 +50,7 @@ static rtems_status_code _RTEMS_tasks_Set_priority(
the_thread,
&the_thread->Real_priority,
core_new_priority,
- false,
+ PRIORITY_GROUP_LAST,
queue_context
);
cpu_self = _Thread_queue_Dispatch_disable( queue_context );
diff --git a/cpukit/score/cpu/aarch64/aarch64-context-validate.S b/cpukit/score/cpu/aarch64/aarch64-context-validate.S
index 1e71bc5b3a..1daa0d6bf2 100644
--- a/cpukit/score/cpu/aarch64/aarch64-context-validate.S
+++ b/cpukit/score/cpu/aarch64/aarch64-context-validate.S
@@ -44,35 +44,47 @@
#include <rtems/score/cpu.h>
#include <rtems/score/basedefs.h>
-/* These must be 8 byte aligned to avoid misaligned accesses */
-#define FRAME_OFFSET_X4 0x00
-#define FRAME_OFFSET_X5 0x08
-#define FRAME_OFFSET_X6 0x10
-#define FRAME_OFFSET_X7 0x18
-#define FRAME_OFFSET_X8 0x20
-#define FRAME_OFFSET_X9 0x28
-#define FRAME_OFFSET_X10 0x30
-#define FRAME_OFFSET_X11 0x38
-#define FRAME_OFFSET_LR 0x40
+/*
+ * This register size applies to X (integer) registers as well as the D (lower
+ * half floating point) registers. It does not apply to V (full size floating
+ * point) registers or W (lower half integer) registers.
+ */
+#define AARCH64_REGISTER_SIZE 8
+
+/* According to the AAPCS64, X19-X28 are callee-saved registers */
+#define FRAME_OFFSET_X19 0x00
+#define FRAME_OFFSET_X20 0x08
+#define FRAME_OFFSET_X21 0x10
+#define FRAME_OFFSET_X22 0x18
+#define FRAME_OFFSET_X23 0x20
+#define FRAME_OFFSET_X24 0x28
+#define FRAME_OFFSET_X25 0x30
+#define FRAME_OFFSET_X26 0x38
+#define FRAME_OFFSET_X27 0x40
+#define FRAME_OFFSET_X28 0x48
+#define FRAME_OFFSET_LR 0x50
#ifdef AARCH64_MULTILIB_VFP
- /* These must be 16 byte aligned to avoid misaligned accesses */
- #define FRAME_OFFSET_V8 0x50
- #define FRAME_OFFSET_V9 0x60
- #define FRAME_OFFSET_V10 0x70
- #define FRAME_OFFSET_V11 0x80
- #define FRAME_OFFSET_V12 0x90
- #define FRAME_OFFSET_V13 0xA0
- #define FRAME_OFFSET_V14 0xB0
- #define FRAME_OFFSET_V15 0xC0
+ /*
+ * According to the AAPCS64, V8-V15 are callee-saved registers, but only the
+ * bottom 8 bytes are required to be saved which correspond to D8-D15.
+ */
+ #define FRAME_OFFSET_D8 0x58
+ #define FRAME_OFFSET_D9 0x60
+ #define FRAME_OFFSET_D10 0x68
+ #define FRAME_OFFSET_D11 0x70
+ #define FRAME_OFFSET_D12 0x78
+ #define FRAME_OFFSET_D13 0x80
+ #define FRAME_OFFSET_D14 0x88
+ #define FRAME_OFFSET_D15 0x90
/*
* Force 16 byte alignment of the frame size to avoid stack pointer alignment
* exceptions.
*/
- #define FRAME_SIZE RTEMS_ALIGN_UP( FRAME_OFFSET_V15, 16 )
+ #define FRAME_SIZE RTEMS_ALIGN_UP( FRAME_OFFSET_D15 + AARCH64_REGISTER_SIZE, 16 )
#else
- #define FRAME_SIZE RTEMS_ALIGN_UP( FRAME_OFFSET_LR, 16 )
+ #define FRAME_SIZE RTEMS_ALIGN_UP( FRAME_OFFSET_LR + AARCH64_REGISTER_SIZE, 16 )
#endif
.section .text
@@ -83,25 +95,27 @@ FUNCTION_ENTRY(_CPU_Context_validate)
sub sp, sp, #FRAME_SIZE
- str x4, [sp, #FRAME_OFFSET_X4]
- str x5, [sp, #FRAME_OFFSET_X5]
- str x6, [sp, #FRAME_OFFSET_X6]
- str x7, [sp, #FRAME_OFFSET_X7]
- str x8, [sp, #FRAME_OFFSET_X8]
- str x9, [sp, #FRAME_OFFSET_X9]
- str x10, [sp, #FRAME_OFFSET_X10]
- str x11, [sp, #FRAME_OFFSET_X11]
+ str x19, [sp, #FRAME_OFFSET_X19]
+ str x20, [sp, #FRAME_OFFSET_X20]
+ str x21, [sp, #FRAME_OFFSET_X21]
+ str x22, [sp, #FRAME_OFFSET_X22]
+ str x23, [sp, #FRAME_OFFSET_X23]
+ str x24, [sp, #FRAME_OFFSET_X24]
+ str x25, [sp, #FRAME_OFFSET_X25]
+ str x26, [sp, #FRAME_OFFSET_X26]
+ str x27, [sp, #FRAME_OFFSET_X27]
+ str x28, [sp, #FRAME_OFFSET_X28]
str lr, [sp, #FRAME_OFFSET_LR]
#ifdef AARCH64_MULTILIB_VFP
- str d8, [sp, #FRAME_OFFSET_V8]
- str d9, [sp, #FRAME_OFFSET_V9]
- str d10, [sp, #FRAME_OFFSET_V10]
- str d11, [sp, #FRAME_OFFSET_V11]
- str d12, [sp, #FRAME_OFFSET_V12]
- str d13, [sp, #FRAME_OFFSET_V13]
- str d14, [sp, #FRAME_OFFSET_V14]
- str d15, [sp, #FRAME_OFFSET_V15]
+ str d8, [sp, #FRAME_OFFSET_D8]
+ str d9, [sp, #FRAME_OFFSET_D9]
+ str d10, [sp, #FRAME_OFFSET_D10]
+ str d11, [sp, #FRAME_OFFSET_D11]
+ str d12, [sp, #FRAME_OFFSET_D12]
+ str d13, [sp, #FRAME_OFFSET_D13]
+ str d14, [sp, #FRAME_OFFSET_D14]
+ str d15, [sp, #FRAME_OFFSET_D15]
#endif
/* Fill */
@@ -119,7 +133,7 @@ FUNCTION_ENTRY(_CPU_Context_validate)
#ifdef AARCH64_MULTILIB_VFP
- /* X3 contains the FPSCR */
+ /* X3 contains the FPSR */
mrs x3, FPSR
ldr x4, =0xf000001f
bic x3, x3, x4
@@ -139,6 +153,23 @@ FUNCTION_ENTRY(_CPU_Context_validate)
fill_register x10
fill_register x11
fill_register x12
+ fill_register x13
+ fill_register x14
+ fill_register x15
+ fill_register x16
+ fill_register x17
+ fill_register x18
+ fill_register x19
+ fill_register x20
+ fill_register x21
+ fill_register x22
+ fill_register x23
+ fill_register x24
+ fill_register x25
+ fill_register x26
+ fill_register x27
+ fill_register x28
+ fill_register x29
fill_register lr
#ifdef AARCH64_MULTILIB_VFP
@@ -191,7 +222,6 @@ check:
bne restore
.endm
- /* A compare involving the stack pointer is deprecated */
mov x1, sp
cmp x2, x1
bne restore
@@ -211,6 +241,23 @@ check:
check_register x10
check_register x11
check_register x12
+ check_register x13
+ check_register x14
+ check_register x15
+ check_register x16
+ check_register x17
+ check_register x18
+ check_register x19
+ check_register x20
+ check_register x21
+ check_register x22
+ check_register x23
+ check_register x24
+ check_register x25
+ check_register x26
+ check_register x27
+ check_register x28
+ check_register x29
check_register lr
#ifdef AARCH64_MULTILIB_VFP
@@ -222,25 +269,27 @@ check:
/* Restore */
restore:
- ldr x4, [sp, #FRAME_OFFSET_X4]
- ldr x5, [sp, #FRAME_OFFSET_X5]
- ldr x6, [sp, #FRAME_OFFSET_X6]
- ldr x7, [sp, #FRAME_OFFSET_X7]
- ldr x8, [sp, #FRAME_OFFSET_X8]
- ldr x9, [sp, #FRAME_OFFSET_X9]
- ldr x10, [sp, #FRAME_OFFSET_X10]
- ldr x11, [sp, #FRAME_OFFSET_X11]
+ ldr x19, [sp, #FRAME_OFFSET_X19]
+ ldr x20, [sp, #FRAME_OFFSET_X20]
+ ldr x21, [sp, #FRAME_OFFSET_X21]
+ ldr x22, [sp, #FRAME_OFFSET_X22]
+ ldr x23, [sp, #FRAME_OFFSET_X23]
+ ldr x24, [sp, #FRAME_OFFSET_X24]
+ ldr x25, [sp, #FRAME_OFFSET_X25]
+ ldr x26, [sp, #FRAME_OFFSET_X26]
+ ldr x27, [sp, #FRAME_OFFSET_X27]
+ ldr x28, [sp, #FRAME_OFFSET_X28]
ldr lr, [sp, #FRAME_OFFSET_LR]
#ifdef AARCH64_MULTILIB_VFP
- ldr d8, [sp, #FRAME_OFFSET_V8]
- ldr d9, [sp, #FRAME_OFFSET_V9]
- ldr d10, [sp, #FRAME_OFFSET_V10]
- ldr d11, [sp, #FRAME_OFFSET_V11]
- ldr d12, [sp, #FRAME_OFFSET_V12]
- ldr d13, [sp, #FRAME_OFFSET_V13]
- ldr d14, [sp, #FRAME_OFFSET_V14]
- ldr d15, [sp, #FRAME_OFFSET_V15]
+ ldr d8, [sp, #FRAME_OFFSET_D8]
+ ldr d9, [sp, #FRAME_OFFSET_D9]
+ ldr d10, [sp, #FRAME_OFFSET_D10]
+ ldr d11, [sp, #FRAME_OFFSET_D11]
+ ldr d12, [sp, #FRAME_OFFSET_D12]
+ ldr d13, [sp, #FRAME_OFFSET_D13]
+ ldr d14, [sp, #FRAME_OFFSET_D14]
+ ldr d15, [sp, #FRAME_OFFSET_D15]
#endif
add sp, sp, #FRAME_SIZE
diff --git a/cpukit/score/cpu/aarch64/aarch64-context-volatile-clobber.S b/cpukit/score/cpu/aarch64/aarch64-context-volatile-clobber.S
index 2be5ce69ff..73472b81ac 100644
--- a/cpukit/score/cpu/aarch64/aarch64-context-volatile-clobber.S
+++ b/cpukit/score/cpu/aarch64/aarch64-context-volatile-clobber.S
@@ -90,10 +90,29 @@ FUNCTION_ENTRY(_CPU_Context_volatile_clobber)
clobber_vfp_register d31
#endif /* AARCH64_MULTILIB_VFP */
+/*
+ * According to the AAPCS64, X0-X18 and X29 are caller-saved registers. X0 is
+ * already being clobbered.
+ */
clobber_register x1
clobber_register x2
clobber_register x3
+ clobber_register x4
+ clobber_register x5
+ clobber_register x6
+ clobber_register x7
+ clobber_register x8
+ clobber_register x9
+ clobber_register x10
+ clobber_register x11
clobber_register x12
+ clobber_register x13
+ clobber_register x14
+ clobber_register x15
+ clobber_register x16
+ clobber_register x17
+ clobber_register x18
+ clobber_register x29
ret
diff --git a/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S b/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S
index cb0954a29b..b206f5764b 100644
--- a/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S
+++ b/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S
@@ -47,7 +47,11 @@
.globl _AArch64_Exception_interrupt_nest
#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
- #define SELF_CPU_CONTROL_GET_REG w19
+ #ifdef RTEMS_SMP
+ #define SELF_CPU_CONTROL_GET_REG x19
+ #else
+ #define SELF_CPU_CONTROL_GET_REG w19
+ #endif
#else
#define SELF_CPU_CONTROL_GET_REG x19
#endif
diff --git a/cpukit/score/cpu/aarch64/cpu.c b/cpukit/score/cpu/aarch64/cpu.c
index d09403a349..b36f55ae17 100644
--- a/cpukit/score/cpu/aarch64/cpu.c
+++ b/cpukit/score/cpu/aarch64/cpu.c
@@ -146,7 +146,7 @@ void _CPU_Context_Initialize(
}
}
-void _CPU_ISR_Set_level( uint64_t level )
+void _CPU_ISR_Set_level( uint32_t level )
{
/* Set the mask bit if interrupts are disabled */
level = level ? AARCH64_PSTATE_I : 0;
@@ -156,7 +156,7 @@ void _CPU_ISR_Set_level( uint64_t level )
);
}
-uint64_t _CPU_ISR_Get_level( void )
+uint32_t _CPU_ISR_Get_level( void )
{
uint64_t level;
diff --git a/cpukit/score/cpu/aarch64/cpu_asm.S b/cpukit/score/cpu/aarch64/cpu_asm.S
index 9e609e06bd..2379698336 100644
--- a/cpukit/score/cpu/aarch64/cpu_asm.S
+++ b/cpukit/score/cpu/aarch64/cpu_asm.S
@@ -55,13 +55,22 @@
*
*/
+DEFINE_FUNCTION_AARCH64(_CPU_Context_switch)
+ .globl _CPU_Context_switch_no_return
+ .set _CPU_Context_switch_no_return, _CPU_Context_switch
#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
-#define reg_2 w2
+/* Sanitize inputs for ILP32 ABI */
+ mov w0, w0
+ mov w1, w1
+ #ifdef RTEMS_SMP
+ #define reg_2 x2
+ #else
+ #define reg_2 w2
+ #endif
#else
#define reg_2 x2
#endif
-DEFINE_FUNCTION_AARCH64(_CPU_Context_switch)
/* Start saving context */
GET_SELF_CPU_CONTROL reg_2
ldr w3, [x2, #PER_CPU_ISR_DISPATCH_DISABLE]
@@ -86,7 +95,30 @@ DEFINE_FUNCTION_AARCH64(_CPU_Context_switch)
str x3, [x0, #AARCH64_CONTEXT_CONTROL_ISR_DISPATCH_DISABLE]
#ifdef RTEMS_SMP
-#error SMP not yet supported
+ /*
+ * The executing thread no longer executes on this processor. Switch
+ * the stack to the temporary interrupt stack of this processor. Mark
+ * the context of the executing thread as not executing.
+ */
+ dmb SY
+ add sp, x2, #(PER_CPU_INTERRUPT_FRAME_AREA + CPU_INTERRUPT_FRAME_SIZE)
+ mov x3, #0
+ strb w3, [x0, #AARCH64_CONTEXT_CONTROL_IS_EXECUTING_OFFSET]
+
+.L_check_is_executing:
+
+ /* Check the is executing indicator of the heir context */
+ add x3, x1, #AARCH64_CONTEXT_CONTROL_IS_EXECUTING_OFFSET
+ ldaxrb w4, [x3]
+ cmp x4, #0
+ bne .L_get_potential_new_heir
+
+ /* Try to update the is executing indicator of the heir context */
+ mov x4, #1
+ stlxrb w5, w4, [x3]
+ cmp x5, #0
+ bne .L_get_potential_new_heir
+ dmb SY
#endif
/* Start restoring context */
@@ -129,6 +161,46 @@ DEFINE_FUNCTION_AARCH64(_CPU_Context_switch)
*
*/
DEFINE_FUNCTION_AARCH64(_CPU_Context_restore)
+#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
+/* Sanitize input for ILP32 ABI */
+ mov w0, w0
+#endif
+
mov x1, x0
GET_SELF_CPU_CONTROL reg_2
b .L_restore
+
+#ifdef RTEMS_SMP
+.L_get_potential_new_heir:
+
+ /* We may have a new heir */
+
+ /* Read the executing and heir */
+#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
+ ldr w4, [x2, #PER_CPU_OFFSET_EXECUTING]
+ ldr w5, [x2, #PER_CPU_OFFSET_HEIR]
+#else
+ ldr x4, [x2, #PER_CPU_OFFSET_EXECUTING]
+ ldr x5, [x2, #PER_CPU_OFFSET_HEIR]
+#endif
+
+ /*
+ * Update the executing only if necessary to avoid cache line
+ * monopolization.
+ */
+ cmp x4, x5
+ beq .L_check_is_executing
+
+ /* Calculate the heir context pointer */
+ sub x4, x1, x4
+ add x1, x5, x4
+
+ /* Update the executing */
+#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
+ str w5, [x2, #PER_CPU_OFFSET_EXECUTING]
+#else
+ str x5, [x2, #PER_CPU_OFFSET_EXECUTING]
+#endif
+
+ b .L_check_is_executing
+#endif
diff --git a/cpukit/score/cpu/aarch64/include/rtems/asm.h b/cpukit/score/cpu/aarch64/include/rtems/asm.h
index 35bf533c8a..fa53e08291 100644
--- a/cpukit/score/cpu/aarch64/include/rtems/asm.h
+++ b/cpukit/score/cpu/aarch64/include/rtems/asm.h
@@ -81,7 +81,12 @@
.align 8 ; .globl name ; name: ; .globl name ## _aarch64 ; name ## _aarch64:
.macro GET_SELF_CPU_CONTROL REG
+#ifdef RTEMS_SMP
+ /* Use Thread ID Register (TPIDR_EL1) */
+ mrs \REG, TPIDR_EL1
+#else
ldr \REG, =_Per_CPU_Information
+#endif
.endm
/** @} */
diff --git a/cpukit/score/cpu/aarch64/include/rtems/score/aarch64-system-registers.h b/cpukit/score/cpu/aarch64/include/rtems/score/aarch64-system-registers.h
index dc2afdeca8..dc2afdeca8 100755..100644
--- a/cpukit/score/cpu/aarch64/include/rtems/score/aarch64-system-registers.h
+++ b/cpukit/score/cpu/aarch64/include/rtems/score/aarch64-system-registers.h
diff --git a/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h b/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
index dacc18638e..ae7e2bdcba 100644
--- a/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
@@ -134,9 +134,9 @@
#ifdef RTEMS_SMP
#if defined(AARCH64_MULTILIB_VFP)
- #define AARCH64_CONTEXT_CONTROL_IS_EXECUTING_OFFSET 0x70
+ #define AARCH64_CONTEXT_CONTROL_IS_EXECUTING_OFFSET 0xb8
#else
- #define AARCH64_CONTEXT_CONTROL_IS_EXECUTING_OFFSET 0x30
+ #define AARCH64_CONTEXT_CONTROL_IS_EXECUTING_OFFSET 0x78
#endif
#endif
@@ -191,12 +191,12 @@ typedef struct {
static inline void _AARCH64_Data_memory_barrier( void )
{
- __asm__ volatile ( "dmb LD" : : : "memory" );
+ __asm__ volatile ( "dmb SY" : : : "memory" );
}
static inline void _AARCH64_Data_synchronization_barrier( void )
{
- __asm__ volatile ( "dsb LD" : : : "memory" );
+ __asm__ volatile ( "dsb SY" : : : "memory" );
}
static inline void _AARCH64_Instruction_synchronization_barrier( void )
@@ -204,9 +204,9 @@ static inline void _AARCH64_Instruction_synchronization_barrier( void )
__asm__ volatile ( "isb" : : : "memory" );
}
-void _CPU_ISR_Set_level( uint64_t level );
+void _CPU_ISR_Set_level( uint32_t level );
-uint64_t _CPU_ISR_Get_level( void );
+uint32_t _CPU_ISR_Get_level( void );
#if defined(AARCH64_DISABLE_INLINE_ISR_DISABLE_ENABLE)
uint64_t AArch64_interrupt_disable( void );
@@ -313,6 +313,11 @@ void _CPU_ISR_install_vector(
*/
void _CPU_Context_switch( Context_Control *run, Context_Control *heir );
+RTEMS_NO_RETURN void _CPU_Context_switch_no_return(
+ Context_Control *executing,
+ Context_Control *heir
+);
+
RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
#ifdef RTEMS_SMP
diff --git a/cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h b/cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h
index 0536ecd860..90fd48ad4e 100644
--- a/cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h
+++ b/cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h
@@ -50,7 +50,7 @@
*/
#define CPU_PER_CPU_CONTROL_SIZE 0
-#define CPU_INTERRUPT_FRAME_SIZE 240
+#define CPU_INTERRUPT_FRAME_SIZE 0x2E0
#ifndef ASM
@@ -60,6 +60,71 @@ extern "C" {
RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+typedef struct {
+ uint64_t x0;
+ uint64_t register_lr_original;
+ uint64_t register_lr;
+ uint64_t x1;
+ uint64_t x2;
+ uint64_t x3;
+ uint64_t x4;
+ uint64_t x5;
+ uint64_t x6;
+ uint64_t x7;
+ uint64_t x8;
+ uint64_t x9;
+ uint64_t x10;
+ uint64_t x11;
+ uint64_t x12;
+ uint64_t x13;
+ uint64_t x14;
+ uint64_t x15;
+ uint64_t x16;
+ uint64_t x17;
+ uint64_t x18;
+ uint64_t x19;
+ uint64_t x20;
+ uint64_t x21;
+#ifdef AARCH64_MULTILIB_VFP
+ uint128_t q0;
+ uint128_t q1;
+ uint128_t q2;
+ uint128_t q3;
+ uint128_t q4;
+ uint128_t q5;
+ uint128_t q6;
+ uint128_t q7;
+ uint128_t q8;
+ uint128_t q9;
+ uint128_t q10;
+ uint128_t q11;
+ uint128_t q12;
+ uint128_t q13;
+ uint128_t q14;
+ uint128_t q15;
+ uint128_t q16;
+ uint128_t q17;
+ uint128_t q18;
+ uint128_t q19;
+ uint128_t q20;
+ uint128_t q21;
+ uint128_t q22;
+ uint128_t q23;
+ uint128_t q24;
+ uint128_t q25;
+ uint128_t q26;
+ uint128_t q27;
+ uint128_t q28;
+ uint128_t q29;
+ uint128_t q30;
+ uint128_t q31;
+#endif /* AARCH64_MULTILIB_VFP */
+ uint64_t register_elr;
+ uint64_t register_spsr;
+ uint64_t register_fpsr;
+ uint64_t register_fpcr;
+} CPU_Interrupt_frame;
+
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
diff --git a/cpukit/score/cpu/arm/headers.am b/cpukit/score/cpu/arm/headers.am
deleted file mode 100644
index cb8976fdbc..0000000000
--- a/cpukit/score/cpu/arm/headers.am
+++ /dev/null
@@ -1,14 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_libcpu_HEADERS += score/cpu/arm/include/libcpu/arm-cp15.h
-include_machine_HEADERS += score/cpu/arm/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/arm/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/aarch32-pmsa.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/aarch32-system-registers.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/arm.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/armv4.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/armv7m.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/cpu_asm.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/arm/include/rtems/score/paravirt.h
diff --git a/cpukit/score/cpu/bfin/headers.am b/cpukit/score/cpu/bfin/headers.am
deleted file mode 100644
index e0f6cfca74..0000000000
--- a/cpukit/score/cpu/bfin/headers.am
+++ /dev/null
@@ -1,11 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/bfin/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/bfin/include/rtems/asm.h
-include_rtems_bfin_HEADERS += score/cpu/bfin/include/rtems/bfin/bf52x.h
-include_rtems_bfin_HEADERS += score/cpu/bfin/include/rtems/bfin/bf533.h
-include_rtems_bfin_HEADERS += score/cpu/bfin/include/rtems/bfin/bfin.h
-include_rtems_score_HEADERS += score/cpu/bfin/include/rtems/score/bfin.h
-include_rtems_score_HEADERS += score/cpu/bfin/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/bfin/include/rtems/score/cpu_asm.h
-include_rtems_score_HEADERS += score/cpu/bfin/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/bfin/include/rtems/score/cpuimpl.h
diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
index 77b7a7161c..f4e3e4d754 100644
--- a/cpukit/score/cpu/i386/cpu.c
+++ b/cpukit/score/cpu/i386/cpu.c
@@ -215,16 +215,16 @@ void _CPU_Exception_frame_print (const CPU_Exception_frame *ctx)
{
unsigned int faultAddr = 0;
printk("----------------------------------------------------------\n");
- printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %" PRId32 "\n",
+ printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %" PRIx32 "\n",
ctx->idtIndex,
ctx->eip,
_Thread_Executing->Object.id);
printk("----------------------------------------------------------\n");
printk("Processor execution context at time of the fault was :\n");
printk("----------------------------------------------------------\n");
- printk(" EAX = %" PRIx32 " EBX = %" PRIx32 " ECX = %" PRIx32 " EDX = %" PRIx32 "\n",
+ printk(" EAX = 0x%08" PRIx32 " EBX = 0x%08" PRIx32 " ECX = 0x%08" PRIx32 " EDX = 0x%08" PRIx32 "\n",
ctx->eax, ctx->ebx, ctx->ecx, ctx->edx);
- printk(" ESI = %" PRIx32 " EDI = %" PRIx32 " EBP = %" PRIx32 " ESP = %" PRIx32 "\n",
+ printk(" ESI = 0x%08" PRIx32 " EDI = 0x%08" PRIx32 " EBP = 0x%08" PRIx32 " ESP = 0x%08" PRIx32 "\n",
ctx->esi, ctx->edi, ctx->ebp, ctx->esp0);
printk("----------------------------------------------------------\n");
printk("Error code pushed by processor itself (if not 0) = %" PRIx32 "\n",
@@ -250,7 +250,7 @@ void _CPU_Exception_frame_print (const CPU_Exception_frame *ctx)
printk("Call Stack Trace of EIP:\n");
if ( fp ) {
for ( i=1; fp->up; fp=fp->up, i++ ) {
- printk("0x%08" PRIx32 " ",fp->pc);
+ printk("0x%08" PRIxPTR " ",fp->pc);
if ( ! (i&3) )
printk("\n");
}
diff --git a/cpukit/score/cpu/i386/headers.am b/cpukit/score/cpu/i386/headers.am
deleted file mode 100644
index e984232d9b..0000000000
--- a/cpukit/score/cpu/i386/headers.am
+++ /dev/null
@@ -1,11 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/i386/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/i386/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/i386/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/i386/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/i386/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/i386/include/rtems/score/i386.h
-include_rtems_score_HEADERS += score/cpu/i386/include/rtems/score/idtr.h
-include_rtems_score_HEADERS += score/cpu/i386/include/rtems/score/interrupts.h
-include_rtems_score_HEADERS += score/cpu/i386/include/rtems/score/paravirt.h
-include_rtems_score_HEADERS += score/cpu/i386/include/rtems/score/registers.h
diff --git a/cpukit/score/cpu/lm32/headers.am b/cpukit/score/cpu/lm32/headers.am
deleted file mode 100644
index b77dfb5ab3..0000000000
--- a/cpukit/score/cpu/lm32/headers.am
+++ /dev/null
@@ -1,8 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/lm32/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/lm32/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/lm32/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/lm32/include/rtems/score/cpu_asm.h
-include_rtems_score_HEADERS += score/cpu/lm32/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/lm32/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/lm32/include/rtems/score/lm32.h
diff --git a/cpukit/score/cpu/m68k/headers.am b/cpukit/score/cpu/m68k/headers.am
deleted file mode 100644
index 3fdc6fe2bd..0000000000
--- a/cpukit/score/cpu/m68k/headers.am
+++ /dev/null
@@ -1,11 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/m68k/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/m68k/include/rtems/asm.h
-include_rtems_m68k_HEADERS += score/cpu/m68k/include/rtems/m68k/m68302.h
-include_rtems_m68k_HEADERS += score/cpu/m68k/include/rtems/m68k/m68360.h
-include_rtems_m68k_HEADERS += score/cpu/m68k/include/rtems/m68k/qsm.h
-include_rtems_m68k_HEADERS += score/cpu/m68k/include/rtems/m68k/sim.h
-include_rtems_score_HEADERS += score/cpu/m68k/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/m68k/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/m68k/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/m68k/include/rtems/score/m68k.h
diff --git a/cpukit/score/cpu/microblaze/__tls_get_addr.c b/cpukit/score/cpu/microblaze/__tls_get_addr.c
new file mode 100644
index 0000000000..e779a63488
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/__tls_get_addr.c
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreCPUMicroBlaze
+ *
+ * @brief MicroBlaze thread-local storage implementation
+ */
+
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/threadimpl.h>
+#include <rtems/score/tls.h>
+
+#include <assert.h>
+
+void *__tls_get_addr( const TLS_Index *ti );
+
+void *__tls_get_addr( const TLS_Index *ti )
+{
+ const Thread_Control *executing = _Thread_Get_executing();
+ void *tls_block = (char *) executing->Start.tls_area
+ + _TLS_Get_thread_control_block_area_size( (uintptr_t) _TLS_Alignment );
+
+ return (char *) tls_block + ti->offset;
+}
diff --git a/cpukit/score/cpu/microblaze/cpu.c b/cpukit/score/cpu/microblaze/cpu.c
new file mode 100644
index 0000000000..de8fbfbba1
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/cpu.c
@@ -0,0 +1,121 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreCPUMicroBlaze
+ *
+ * @brief MicroBlaze architecture support implementation
+ */
+
+/*
+ * Copyright (c) 2015, Hesham Almatary
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/isr.h>
+#include <rtems/score/tls.h>
+#include <rtems/score/wkspace.h>
+
+void _CPU_Initialize( void )
+{
+}
+
+void _CPU_Context_Initialize(
+ Context_Control *context,
+ void *stack_area_begin,
+ size_t stack_area_size,
+ uint32_t new_level,
+ void (*entry_point)( void ),
+ bool is_fp,
+ void *tls_area
+)
+{
+ uint32_t stack = (uint32_t) stack_area_begin;
+ uint32_t stack_high = stack + stack_area_size;
+
+ memset( context, 0, sizeof(*context) ) ;
+
+ context->r1 = stack_high - 64;
+ context->r15 = (uint32_t) entry_point;
+
+ uint32_t msr;
+ _CPU_MSR_GET( msr );
+ context->rmsr = msr;
+
+ if ( tls_area != NULL ) {
+ _TLS_TCB_at_area_begin_initialize( tls_area );
+ }
+}
+
+void _CPU_Exception_frame_print( const CPU_Exception_frame *ctx )
+{
+}
+
+void _CPU_ISR_Set_level( uint32_t level )
+{
+ uint32_t microblaze_switch_reg;
+
+ _CPU_MSR_GET( microblaze_switch_reg );
+
+ if ( level == 0 ) {
+ microblaze_switch_reg |= (MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE);
+ } else {
+ microblaze_switch_reg &= ~(MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE);
+ }
+
+ _CPU_MSR_SET( microblaze_switch_reg );
+}
+
+uint32_t _CPU_ISR_Get_level( void )
+{
+ uint32_t level;
+
+ _CPU_MSR_GET( level );
+
+ /* This is unique. The MSR register contains an interrupt enable flag where
+ * most other architectures have an interrupt disable flag. */
+ return ( level & (MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE) ) == 0;
+}
+
+void _CPU_ISR_install_vector(
+ uint32_t vector,
+ CPU_ISR_handler new_handler,
+ CPU_ISR_handler *old_handler
+)
+{
+ *old_handler = _ISR_Vector_table[ vector ];
+ _ISR_Vector_table[ vector ] = new_handler;
+}
+
+void *_CPU_Thread_Idle_body( uintptr_t ignored )
+{
+ while ( true ) {
+ __asm__ volatile ( "sleep" );
+ }
+}
diff --git a/cpukit/score/cpu/microblaze/cpu_asm.S b/cpukit/score/cpu/microblaze/cpu_asm.S
new file mode 100644
index 0000000000..d095e62f69
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/cpu_asm.S
@@ -0,0 +1,194 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreCPUMicroBlaze
+ *
+ * @brief MicroBlaze interrupt handler implementation
+ */
+
+/*
+ * Copyright (C) 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
+ * 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 <rtems/asm.h>
+#include <rtems/score/percpu.h>
+
+ .text
+ .globl _ISR_Handler
+ .align 2
+
+_ISR_Handler:
+ /* Save stack frame */
+ swi r3, r1, MICROBLAZE_INTERRUPT_FRAME_R3
+ swi r4, r1, MICROBLAZE_INTERRUPT_FRAME_R4
+ swi r6, r1, MICROBLAZE_INTERRUPT_FRAME_R6
+ swi r7, r1, MICROBLAZE_INTERRUPT_FRAME_R7
+ swi r8, r1, MICROBLAZE_INTERRUPT_FRAME_R8
+ swi r9, r1, MICROBLAZE_INTERRUPT_FRAME_R9
+ swi r10, r1, MICROBLAZE_INTERRUPT_FRAME_R10
+ swi r11, r1, MICROBLAZE_INTERRUPT_FRAME_R11
+ swi r12, r1, MICROBLAZE_INTERRUPT_FRAME_R12
+ swi r15, r1, MICROBLAZE_INTERRUPT_FRAME_R15
+ swi r18, r1, MICROBLAZE_INTERRUPT_FRAME_R18
+
+ xori r3, r5, 0xFFFF
+ beqi r3, do_exception
+
+ /* Disable dispatching */
+ lwi r3, r0, _Per_CPU_Information + 16
+ addik r3, r3, 1
+ swi r3, r0, _Per_CPU_Information + 16
+
+ swi r14, r1, MICROBLAZE_INTERRUPT_FRAME_R14
+
+ /* Is SP < INTERRUPT_STACK_LOW? */
+ lwi r4, r0, _Per_CPU_Information
+ rsubk r3, r4, r1
+ blei r3, switch_to_interrupt_stack
+
+ /* Is SP > INTERRUPT_STACK_HIGH? */
+ lwi r4, r0, _Per_CPU_Information + 4
+ rsubk r3, r4, r1
+ bgei r3, switch_to_interrupt_stack
+
+ bri on_interrupt_stack
+
+switch_to_interrupt_stack:
+ add r4, r0, r1
+ lwi r1, r0, _Per_CPU_Information + 4
+ addik r1, r1, -52
+ swi r4, r1, 0
+
+on_interrupt_stack:
+ /* Add 1 to ISR_NEST_LEVEL */
+ lwi r3, r0, _Per_CPU_Information + 8
+ addik r3, r3, 1
+ swi r3, r0, _Per_CPU_Information + 8
+
+ bralid r15, bsp_interrupt_dispatch
+ nop
+
+ /* Subtract 1 from ISR_NEST_LEVEL */
+ lwi r3, r0, _Per_CPU_Information + 8
+ addik r3, r3, -1
+ swi r3, r0, _Per_CPU_Information + 8
+
+ /* Is ISR_NEST_LEVEL > 0? */
+ bgti r3, after_stack_switch
+
+ /* Switch back to interrupted thread stack */
+ lwi r1, r1, 0
+
+after_stack_switch:
+ /* Subtract 1 from THREAD_DISPATCH_DISABLE_LEVEL */
+ lwi r3, r0, _Per_CPU_Information + 16
+ addik r3, r3, -1
+ swi r3, r0, _Per_CPU_Information + 16
+
+ /* Is THREAD_DISPATCH_DISABLE_LEVEL != 0? */
+ bnei r3, quick_exit
+
+ /* Is DISPATCH_NEEDED == 0? */
+ lwi r3, r0, _Per_CPU_Information + 20
+ beqi r3, quick_exit
+
+ /* Return to interrupted thread and make it do a dispatch */
+ addik r14, r0, thread_dispatch
+ rtid r14, 0
+ nop
+
+quick_exit:
+ /* Simple return from nested interrupt */
+ /* Restore registers */
+ lwi r3, r1, MICROBLAZE_INTERRUPT_FRAME_R3
+ lwi r4, r1, MICROBLAZE_INTERRUPT_FRAME_R4
+ lwi r5, r1, MICROBLAZE_INTERRUPT_FRAME_R5
+ lwi r6, r1, MICROBLAZE_INTERRUPT_FRAME_R6
+ lwi r7, r1, MICROBLAZE_INTERRUPT_FRAME_R7
+ lwi r8, r1, MICROBLAZE_INTERRUPT_FRAME_R8
+ lwi r9, r1, MICROBLAZE_INTERRUPT_FRAME_R9
+ lwi r10, r1, MICROBLAZE_INTERRUPT_FRAME_R10
+ lwi r11, r1, MICROBLAZE_INTERRUPT_FRAME_R11
+ lwi r12, r1, MICROBLAZE_INTERRUPT_FRAME_R12
+ lwi r14, r1, MICROBLAZE_INTERRUPT_FRAME_R14
+ lwi r15, r1, MICROBLAZE_INTERRUPT_FRAME_R15
+ lwi r18, r1, MICROBLAZE_INTERRUPT_FRAME_R18
+
+ /* Remove stack frame */
+ addik r1, r1, 52
+
+ rtid r14, 0
+ nop
+
+thread_dispatch:
+ /* Reserve stack */
+ addik r1, r1, -52
+ /* Save scratch registers */
+ swi r3, r1, MICROBLAZE_INTERRUPT_FRAME_R3
+ swi r4, r1, MICROBLAZE_INTERRUPT_FRAME_R4
+ swi r5, r1, MICROBLAZE_INTERRUPT_FRAME_R5
+ swi r6, r1, MICROBLAZE_INTERRUPT_FRAME_R6
+ swi r7, r1, MICROBLAZE_INTERRUPT_FRAME_R7
+ swi r8, r1, MICROBLAZE_INTERRUPT_FRAME_R8
+ swi r9, r1, MICROBLAZE_INTERRUPT_FRAME_R9
+ swi r10, r1, MICROBLAZE_INTERRUPT_FRAME_R10
+ swi r11, r1, MICROBLAZE_INTERRUPT_FRAME_R11
+ swi r12, r1, MICROBLAZE_INTERRUPT_FRAME_R12
+ swi r14, r1, MICROBLAZE_INTERRUPT_FRAME_R14
+ swi r15, r1, MICROBLAZE_INTERRUPT_FRAME_R15
+ swi r18, r1, MICROBLAZE_INTERRUPT_FRAME_R18
+
+ bralid r15, _Thread_Dispatch
+ nop
+
+ /* Restore scratch registers */
+ lwi r3, r1, MICROBLAZE_INTERRUPT_FRAME_R3
+ lwi r4, r1, MICROBLAZE_INTERRUPT_FRAME_R4
+ lwi r5, r1, MICROBLAZE_INTERRUPT_FRAME_R5
+ lwi r6, r1, MICROBLAZE_INTERRUPT_FRAME_R6
+ lwi r7, r1, MICROBLAZE_INTERRUPT_FRAME_R7
+ lwi r8, r1, MICROBLAZE_INTERRUPT_FRAME_R8
+ lwi r9, r1, MICROBLAZE_INTERRUPT_FRAME_R9
+ lwi r10, r1, MICROBLAZE_INTERRUPT_FRAME_R10
+ lwi r11, r1, MICROBLAZE_INTERRUPT_FRAME_R11
+ lwi r12, r1, MICROBLAZE_INTERRUPT_FRAME_R12
+ lwi r14, r1, MICROBLAZE_INTERRUPT_FRAME_R14
+ lwi r15, r1, MICROBLAZE_INTERRUPT_FRAME_R15
+ lwi r18, r1, MICROBLAZE_INTERRUPT_FRAME_R18
+ /* Free stack space */
+ addik r1, r1, 52
+
+ bri quick_exit
+
+do_exception:
+ /* exception no longer in progress */
+ mfs r3, rmsr
+ andni r3, r3, 0x200
+ mts rmsr, r3
+ addi r5, r0, 9
+ add r6, r0, r1
+
+ brai _Terminate
diff --git a/cpukit/score/cpu/microblaze/include/rtems/asm.h b/cpukit/score/cpu/microblaze/include/rtems/asm.h
new file mode 100644
index 0000000000..2e35a66294
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/include/rtems/asm.h
@@ -0,0 +1,138 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @brief MicroBlaze assembler support
+ *
+ * This include file attempts to address the problems
+ * caused by incompatible flavors of assemblers and
+ * toolsets. It primarily addresses variations in the
+ * use of leading underscores on symbols and the requirement
+ * that register names be preceded by a %.
+ */
+
+/*
+ * Copyright (c) 2015, Hesham Almatary
+ * Copyright (C) 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
+ * 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_ASM_H
+#define _RTEMS_ASM_H
+
+/*
+ * Indicate we are in an assembly file and get the basic CPU definitions.
+ */
+
+#ifndef ASM
+#define ASM
+#endif
+
+#include <rtems/score/cpuopts.h>
+
+#ifndef __USER_LABEL_PREFIX__
+/**
+ * Recent versions of GNU cpp define variables which indicate the
+ * need for underscores and percents. If not using GNU cpp or
+ * the version does not support this, then you will obviously
+ * have to define these as appropriate.
+ *
+ * This symbol is prefixed to all C program symbols.
+ */
+#define __USER_LABEL_PREFIX__ _
+#endif
+
+#ifndef __REGISTER_PREFIX__
+/**
+ * Recent versions of GNU cpp define variables which indicate the
+ * need for underscores and percents. If not using GNU cpp or
+ * the version does not support this, then you will obviously
+ * have to define these as appropriate.
+ *
+ * This symbol is prefixed to all register names.
+ */
+#define __REGISTER_PREFIX__
+#endif
+
+#include <rtems/concat.h>
+
+/** Use the right prefix for global labels. */
+#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
+
+/** Use the right prefix for registers. */
+#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
+
+/*
+ * define macros for all of the registers on this CPU
+ *
+ * EXAMPLE: #define d0 REG (d0)
+ */
+
+/*
+ * Define macros to handle section beginning and ends.
+ */
+
+
+/** This macro is used to denote the beginning of a code declaration. */
+#define BEGIN_CODE_DCL .text
+/** This macro is used to denote the end of a code declaration. */
+#define END_CODE_DCL
+/** This macro is used to denote the beginning of a data declaration section. */
+#define BEGIN_DATA_DCL .data
+/** This macro is used to denote the end of a data declaration section. */
+#define END_DATA_DCL
+/** This macro is used to denote the beginning of a code section. */
+#define BEGIN_CODE .text
+/** This macro is used to denote the end of a code section. */
+#define END_CODE
+/** This macro is used to denote the beginning of a data section. */
+#define BEGIN_DATA
+/** This macro is used to denote the end of a data section. */
+#define END_DATA
+/** This macro is used to denote the beginning of the
+ * unitialized data section.
+ */
+#define BEGIN_BSS
+/** This macro is used to denote the end of the unitialized data section. */
+#define END_BSS
+/** This macro is used to denote the end of the assembly file. */
+#define END
+
+/**
+ * This macro is used to declare a public global symbol.
+ *
+ * @note This must be tailored for a particular flavor of the C compiler.
+ * They may need to put underscores in front of the symbols.
+ */
+#define PUBLIC(sym) .globl SYM (sym)
+
+/**
+ * This macro is used to prototype a public global symbol.
+ *
+ * @note This must be tailored for a particular flavor of the C compiler.
+ * They may need to put underscores in front of the symbols.
+ */
+#define EXTERN(sym) .globl SYM (sym)
+
+#endif
diff --git a/cpukit/score/cpu/microblaze/include/rtems/score/cpu.h b/cpukit/score/cpu/microblaze/include/rtems/score/cpu.h
new file mode 100644
index 0000000000..4b11625463
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/include/rtems/score/cpu.h
@@ -0,0 +1,305 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreCPU
+ *
+ * @brief MicroBlaze architecture support
+ */
+
+/*
+ * Copyright (c) 2015, Hesham Almatary
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_SCORE_CPU_H
+#define _RTEMS_SCORE_CPU_H
+
+#include <rtems/score/basedefs.h>
+#include <rtems/score/microblaze.h>
+
+#define CPU_SIMPLE_VECTORED_INTERRUPTS TRUE
+
+#define CPU_ISR_PASSES_FRAME_POINTER FALSE
+
+#define CPU_HARDWARE_FP FALSE
+
+#define CPU_SOFTWARE_FP FALSE
+
+#define CPU_ALL_TASKS_ARE_FP FALSE
+
+#define CPU_IDLE_TASK_IS_FP FALSE
+
+#define CPU_USE_DEFERRED_FP_SWITCH FALSE
+
+#define CPU_STACK_GROWS_UP FALSE
+
+/**
+ * The maximum cache-line size is 16 words.
+ */
+#define CPU_CACHE_LINE_BYTES 64
+
+#define CPU_STRUCTURE_ALIGNMENT
+
+#define CPU_MODES_INTERRUPT_MASK 0x00000001
+
+#ifndef ASM
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @ingroup CPUContext Management
+ * This defines the minimal set of integer and processor state registers
+ * that must be saved during a voluntary context switch from one thread
+ * to another.
+ */
+typedef struct {
+ uint32_t r1;
+ uint32_t r13;
+ uint32_t r14;
+ uint32_t r15;
+ uint32_t r16;
+ uint32_t r17;
+ uint32_t r18;
+ uint32_t r19;
+ uint32_t r20;
+ uint32_t r21;
+ uint32_t r22;
+ uint32_t r23;
+ uint32_t r24;
+ uint32_t r25;
+ uint32_t r26;
+ uint32_t r27;
+ uint32_t r28;
+ uint32_t r29;
+ uint32_t r30;
+ uint32_t r31;
+ uint32_t rmsr;
+} Context_Control;
+
+/**
+ * @ingroup CPUContext Management
+ *
+ * This macro returns the stack pointer associated with @a _context.
+ *
+ * @param[in] _context is the thread context area to access
+ *
+ * @return This method returns the stack pointer.
+ */
+#define _CPU_Context_Get_SP( _context ) \
+ (_context)->r1
+
+#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
+
+#define CPU_INTERRUPT_NUMBER_OF_VECTORS 32
+
+#define CPU_USE_LIBC_INIT_FINI_ARRAY TRUE
+
+#define CPU_MAXIMUM_PROCESSORS 32
+
+/**
+ * @ingroup CPUInterrupt
+ * This defines the highest interrupt vector number for this port.
+ */
+#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
+
+#define CPU_PROVIDES_ISR_IS_IN_PROGRESS FALSE
+
+#define CPU_STACK_MINIMUM_SIZE (1024*4)
+
+#define CPU_ALIGNMENT 4
+
+#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
+
+#define CPU_STACK_ALIGNMENT CPU_ALIGNMENT
+
+#define CPU_INTERRUPT_STACK_ALIGNMENT CPU_CACHE_LINE_BYTES
+
+#define MICROBLAZE_MSR_IE (1 << 1)
+#define MICROBLAZE_MSR_EE (1 << 8)
+
+#define _CPU_MSR_GET( _msr_value ) \
+ do { \
+ (_msr_value) = 0; \
+ __asm__ volatile ("mfs %0, rmsr" : "=&r" ((_msr_value)) : "0" ((_msr_value))); \
+ } while (0)
+
+#define _CPU_MSR_SET( _msr_value ) \
+{ __asm__ volatile ("mts rmsr, %0" : "=&r" ((_msr_value)) : "0" ((_msr_value))); }
+
+#define _CPU_ISR_Disable( _isr_cookie ) \
+ { \
+ unsigned int _new_msr; \
+ _CPU_MSR_GET(_isr_cookie); \
+ _new_msr = (_isr_cookie) & ~(MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE); \
+ _CPU_MSR_SET(_new_msr); \
+ }
+
+#define _CPU_ISR_Enable( _isr_cookie ) \
+ { \
+ uint32_t _microblaze_interrupt_enable; \
+ uint32_t _microblaze_switch_reg; \
+ \
+ _microblaze_interrupt_enable = (_isr_cookie) & (MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE); \
+ _CPU_MSR_GET(_microblaze_switch_reg); \
+ _microblaze_switch_reg &= ~(MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE); \
+ _microblaze_switch_reg |= _microblaze_interrupt_enable; \
+ _CPU_MSR_SET(_microblaze_switch_reg); \
+ }
+
+#define _CPU_ISR_Flash( _isr_cookie ) \
+ { \
+ unsigned int _new_msr; \
+ _CPU_MSR_SET(_isr_cookie); \
+ _new_msr = (_isr_cookie) & ~(MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE); \
+ _CPU_MSR_SET(_new_msr); \
+ }
+
+void _CPU_ISR_Set_level( uint32_t level );
+
+uint32_t _CPU_ISR_Get_level( void );
+
+RTEMS_INLINE_ROUTINE bool _CPU_ISR_Is_enabled( uint32_t level )
+{
+ return ( level & (MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE) ) != 0;
+}
+
+void _CPU_Context_Initialize(
+ Context_Control *context,
+ void *stack_area_begin,
+ size_t stack_area_size,
+ uint32_t new_level,
+ void (*entry_point)( void ),
+ bool is_fp,
+ void *tls_area
+);
+
+#define _CPU_Context_Restart_self( _the_context ) \
+ _CPU_Context_restore( (_the_context) );
+
+#define _CPU_Context_Initialize_fp( _destination ) \
+ { \
+ *(*(_destination)) = _CPU_Null_fp_context; \
+ }
+
+/* end of Context handler macros */
+
+/* Fatal Error manager macros */
+
+/* TODO */
+#define _CPU_Fatal_halt(_source, _error ) \
+ do { \
+ __asm__ volatile ( "sleep" ); \
+ for(;;) {} \
+ } while (0)
+
+/* end of Fatal Error manager macros */
+
+/* Bitfield handler macros */
+
+#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
+
+#define CPU_SIZEOF_POINTER 4
+
+#define CPU_PER_CPU_CONTROL_SIZE 0
+
+typedef struct {
+ /* TODO: enumerate registers */
+ uint32_t r[32];
+} CPU_Exception_frame;
+
+/* end of Priority handler macros */
+
+/* functions */
+
+void _CPU_Initialize( void );
+
+typedef void ( *CPU_ISR_handler )( uint32_t );
+
+void _CPU_ISR_install_vector(
+ uint32_t vector,
+ CPU_ISR_handler new_handler,
+ CPU_ISR_handler *old_handler
+);
+
+void _CPU_Context_switch(
+ Context_Control *run,
+ Context_Control *heir
+);
+
+RTEMS_NO_RETURN void _CPU_Context_restore(
+ Context_Control *new_context
+);
+
+static inline uint32_t CPU_swap_u32(
+ uint32_t value
+)
+{
+ uint32_t byte1, byte2, byte3, byte4, swapped;
+
+ byte4 = (value >> 24) & 0xff;
+ byte3 = (value >> 16) & 0xff;
+ byte2 = (value >> 8) & 0xff;
+ byte1 = value & 0xff;
+
+ swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
+ return swapped;
+}
+
+#define CPU_swap_u16( value ) \
+ (((value&0xff) << 8) | ((value >> 8)&0xff))
+
+void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
+
+typedef uint32_t CPU_Counter_ticks;
+
+uint32_t _CPU_Counter_frequency( void );
+
+CPU_Counter_ticks _CPU_Counter_read( void );
+
+static inline CPU_Counter_ticks _CPU_Counter_difference(
+ CPU_Counter_ticks second,
+ CPU_Counter_ticks first
+)
+{
+ return second - first;
+}
+
+void *_CPU_Thread_Idle_body( uintptr_t ignored );
+
+void bsp_interrupt_dispatch( uint32_t source );
+
+/** Type that can store a 32-bit integer or a pointer. */
+typedef uintptr_t CPU_Uint32ptr;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ASM */
+
+#endif /* _RTEMS_SCORE_CPU_H */
diff --git a/cpukit/score/cpu/microblaze/include/rtems/score/cpuatomic.h b/cpukit/score/cpu/microblaze/include/rtems/score/cpuatomic.h
new file mode 100644
index 0000000000..6dc769b95a
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/include/rtems/score/cpuatomic.h
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreCPU
+ *
+ * @brief MicroBlaze atomic support
+ */
+
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_SCORE_ATOMIC_CPU_H
+#define _RTEMS_SCORE_ATOMIC_CPU_H
+
+#include <rtems/score/cpustdatomic.h>
+
+#endif /* _RTEMS_SCORE_ATOMIC_CPU_H */
diff --git a/cpukit/score/cpu/microblaze/include/rtems/score/cpuimpl.h b/cpukit/score/cpu/microblaze/include/rtems/score/cpuimpl.h
new file mode 100644
index 0000000000..3d0167dd40
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/include/rtems/score/cpuimpl.h
@@ -0,0 +1,96 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreCPU
+ *
+ * @brief CPU Port Implementation API
+ */
+
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_SCORE_CPUIMPL_H
+#define _RTEMS_SCORE_CPUIMPL_H
+
+#include <rtems/score/cpu.h>
+
+/**
+ * @defgroup RTEMSScoreCPUMicroBlaze MicroBlaze
+ *
+ * @ingroup RTEMSScoreCPU
+ *
+ * @brief MicroBlaze Architecture Support
+ *
+ * @{
+ */
+
+#define CPU_PER_CPU_CONTROL_SIZE 0
+#define CPU_INTERRUPT_FRAME_SIZE 52
+
+#define MICROBLAZE_INTERRUPT_FRAME_R3 0
+#define MICROBLAZE_INTERRUPT_FRAME_R4 4
+#define MICROBLAZE_INTERRUPT_FRAME_R5 8
+#define MICROBLAZE_INTERRUPT_FRAME_R6 12
+#define MICROBLAZE_INTERRUPT_FRAME_R7 16
+#define MICROBLAZE_INTERRUPT_FRAME_R8 20
+#define MICROBLAZE_INTERRUPT_FRAME_R9 24
+#define MICROBLAZE_INTERRUPT_FRAME_R10 28
+#define MICROBLAZE_INTERRUPT_FRAME_R11 32
+#define MICROBLAZE_INTERRUPT_FRAME_R12 36
+#define MICROBLAZE_INTERRUPT_FRAME_R14 40
+#define MICROBLAZE_INTERRUPT_FRAME_R15 44
+#define MICROBLAZE_INTERRUPT_FRAME_R18 48
+
+#ifndef ASM
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _CPU_Context_volatile_clobber( uintptr_t pattern );
+
+void _CPU_Context_validate( uintptr_t pattern );
+
+RTEMS_INLINE_ROUTINE void _CPU_Instruction_illegal( void )
+{
+ __asm__ volatile ( ".word 0x0" );
+}
+
+RTEMS_INLINE_ROUTINE void _CPU_Instruction_no_operation( void )
+{
+ __asm__ volatile ( "nop" );
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ASM */
+
+/** @} */
+
+#endif /* _RTEMS_SCORE_CPUIMPL_H */
diff --git a/cpukit/score/cpu/microblaze/include/rtems/score/microblaze.h b/cpukit/score/cpu/microblaze/include/rtems/score/microblaze.h
new file mode 100644
index 0000000000..6310b4b17d
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/include/rtems/score/microblaze.h
@@ -0,0 +1,57 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreCPU
+ *
+ * @brief MicroBlaze architecture support
+ */
+
+/*
+ * Copyright (c) 2015, Hesham Almatary
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_SCORE_MICROBLAZE_H
+#define _RTEMS_SCORE_MICROBLAZE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define CPU_MODEL_NAME "MicroBlaze"
+#define NOCPU_HAS_FPU 1
+
+/*
+ * Define the name of the CPU family.
+ */
+
+#define CPU_NAME "MicroBlaze CPU"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_SCORE_MICROBLAZE_H */
diff --git a/cpukit/score/cpu/microblaze/microblaze-context-switch.S b/cpukit/score/cpu/microblaze/microblaze-context-switch.S
new file mode 100644
index 0000000000..523e836398
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/microblaze-context-switch.S
@@ -0,0 +1,107 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreCPUMicroBlaze
+ *
+ * @brief MicroBlaze context switch implementation
+ */
+
+/*
+ * Copyright (c) 2015, Hesham Almatary
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include <rtems/asm.h>
+
+.text
+.align 4
+
+PUBLIC(_CPU_Context_switch)
+PUBLIC(_CPU_Context_restore)
+PUBLIC(_CPU_Context_restore_fp)
+PUBLIC(_CPU_Context_save_fp)
+
+SYM(_CPU_Context_switch):
+ swi r1, r5, 0
+ swi r13, r5, 4
+ swi r14, r5, 8
+ swi r15, r5, 12
+ swi r16, r5, 16
+ swi r17, r5, 20
+ swi r18, r5, 24
+ swi r19, r5, 28
+ swi r20, r5, 32
+ swi r21, r5, 36
+ swi r22, r5, 40
+ swi r23, r5, 44
+ swi r24, r5, 48
+ swi r25, r5, 52
+ swi r26, r5, 56
+ swi r27, r5, 60
+ swi r28, r5, 64
+ swi r29, r5, 68
+ swi r30, r5, 72
+ swi r31, r5, 76
+
+ mfs r21, rmsr
+ swi r21, r5, 80
+
+
+SYM(restore):
+ lwi r1, r6, 0
+ lwi r13, r6, 4
+ lwi r14, r6, 8
+ lwi r15, r6, 12
+ lwi r16, r6, 16
+ lwi r17, r6, 20
+ lwi r18, r6, 24
+ lwi r19, r6, 28
+ lwi r20, r6, 32
+ lwi r21, r6, 36
+ lwi r22, r6, 40
+ lwi r23, r6, 44
+ lwi r24, r6, 48
+ lwi r25, r6, 52
+ lwi r26, r6, 56
+ lwi r27, r6, 60
+ lwi r28, r6, 64
+ lwi r29, r6, 68
+ lwi r30, r6, 72
+
+ lwi r31, r6, 80
+ mts rmsr, r31
+
+ lwi r31, r6, 76
+
+ rtsd r15, 8
+
+SYM(_CPU_Context_restore):
+ add r6, r5, r0
+ brai restore
diff --git a/cpukit/score/cpu/microblaze/microblaze-context-validate.S b/cpukit/score/cpu/microblaze/microblaze-context-validate.S
new file mode 100644
index 0000000000..b12d5930f6
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/microblaze-context-validate.S
@@ -0,0 +1,117 @@
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include <rtems/asm.h>
+
+#define FRAME_OFFSET_R19 0
+#define FRAME_OFFSET_R20 4
+#define FRAME_OFFSET_R21 8
+#define FRAME_OFFSET_R22 12
+#define FRAME_OFFSET_R23 16
+#define FRAME_OFFSET_R24 20
+#define FRAME_OFFSET_R25 24
+#define FRAME_OFFSET_R26 28
+#define FRAME_OFFSET_R27 32
+#define FRAME_OFFSET_R28 36
+#define FRAME_OFFSET_R29 40
+#define FRAME_OFFSET_R30 44
+#define FRAME_OFFSET_R31 48
+
+#define FRAME_SIZE (FRAME_OFFSET_R31 + 4)
+
+.text
+.align 4
+
+PUBLIC(_CPU_Context_validate)
+
+SYM(_CPU_Context_validate):
+
+ /* Save */
+ addik r1, r1, -FRAME_SIZE
+ swi r19, r1, FRAME_OFFSET_R19
+ swi r20, r1, FRAME_OFFSET_R20
+ swi r21, r1, FRAME_OFFSET_R21
+ swi r22, r1, FRAME_OFFSET_R22
+ swi r23, r1, FRAME_OFFSET_R23
+ swi r24, r1, FRAME_OFFSET_R24
+ swi r25, r1, FRAME_OFFSET_R25
+ swi r26, r1, FRAME_OFFSET_R26
+ swi r27, r1, FRAME_OFFSET_R27
+ swi r28, r1, FRAME_OFFSET_R28
+ swi r29, r1, FRAME_OFFSET_R29
+ swi r30, r1, FRAME_OFFSET_R30
+ swi r31, r1, FRAME_OFFSET_R31
+
+ /* Fill */
+
+ add r4, r0, r3
+
+ /* r7 contains the stack pointer */
+ add r7, r0, r1
+
+.macro fill_register reg
+ addi r4, r4, 1
+ add \reg, r0, r4
+.endm
+
+ fill_register r21
+ fill_register r22
+ fill_register r23
+ fill_register r24
+ fill_register r25
+ fill_register r26
+ fill_register r27
+ fill_register r28
+ fill_register r29
+ fill_register r30
+ fill_register r31
+
+ /* Check */
+check:
+
+.macro check_register reg
+ addi r4, r4, 1
+ cmp r6, \reg, r4
+ bnei r6, restore
+.endm
+
+ cmp r6, r7, r1
+ bnei r6, restore
+
+ add r4, r0, r3
+
+ check_register r21
+ check_register r22
+ check_register r23
+ check_register r24
+ check_register r25
+ check_register r26
+ check_register r27
+ check_register r28
+ check_register r29
+ check_register r30
+ check_register r31
+
+ brai check
+
+ /* Restore */
+restore:
+
+ lwi r19, r1, FRAME_OFFSET_R19
+ lwi r20, r1, FRAME_OFFSET_R20
+ lwi r21, r1, FRAME_OFFSET_R21
+ lwi r22, r1, FRAME_OFFSET_R22
+ lwi r23, r1, FRAME_OFFSET_R23
+ lwi r24, r1, FRAME_OFFSET_R24
+ lwi r25, r1, FRAME_OFFSET_R25
+ lwi r26, r1, FRAME_OFFSET_R26
+ lwi r27, r1, FRAME_OFFSET_R27
+ lwi r28, r1, FRAME_OFFSET_R28
+ lwi r29, r1, FRAME_OFFSET_R29
+ lwi r30, r1, FRAME_OFFSET_R30
+ lwi r31, r1, FRAME_OFFSET_R31
+
+ addik r1, r1, FRAME_SIZE
+
+ bra r15
diff --git a/cpukit/score/cpu/microblaze/microblaze-context-volatile-clobber.S b/cpukit/score/cpu/microblaze/microblaze-context-volatile-clobber.S
new file mode 100644
index 0000000000..fb49dc5e40
--- /dev/null
+++ b/cpukit/score/cpu/microblaze/microblaze-context-volatile-clobber.S
@@ -0,0 +1,28 @@
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include <rtems/asm.h>
+
+.text
+.align 4
+
+PUBLIC(_CPU_Context_volatile_clobber)
+
+SYM(_CPU_Context_volatile_clobber):
+
+.macro clobber_register reg
+ addi r5, r5, -1
+ add \reg, r0, r5
+.endm
+
+ clobber_register r3
+ clobber_register r4
+ clobber_register r6
+ clobber_register r7
+ clobber_register r8
+ clobber_register r9
+ clobber_register r10
+
+ rtsd r15, 8
+ nop
diff --git a/cpukit/score/cpu/mips/headers.am b/cpukit/score/cpu/mips/headers.am
deleted file mode 100644
index 3084000f09..0000000000
--- a/cpukit/score/cpu/mips/headers.am
+++ /dev/null
@@ -1,9 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/mips/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/mips/include/rtems/asm.h
-include_rtems_mips_HEADERS += score/cpu/mips/include/rtems/mips/idtcpu.h
-include_rtems_mips_HEADERS += score/cpu/mips/include/rtems/mips/iregdef.h
-include_rtems_score_HEADERS += score/cpu/mips/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/mips/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/mips/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/mips/include/rtems/score/mips.h
diff --git a/cpukit/score/cpu/moxie/headers.am b/cpukit/score/cpu/moxie/headers.am
deleted file mode 100644
index 6324166c86..0000000000
--- a/cpukit/score/cpu/moxie/headers.am
+++ /dev/null
@@ -1,7 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/moxie/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/moxie/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/moxie/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/moxie/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/moxie/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/moxie/include/rtems/score/moxie.h
diff --git a/cpukit/score/cpu/nios2/headers.am b/cpukit/score/cpu/nios2/headers.am
deleted file mode 100644
index 253f64d03a..0000000000
--- a/cpukit/score/cpu/nios2/headers.am
+++ /dev/null
@@ -1,10 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/nios2/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/nios2/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/nios2/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/nios2/include/rtems/score/cpu_asm.h
-include_rtems_score_HEADERS += score/cpu/nios2/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/nios2/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/nios2/include/rtems/score/nios2-count-zeros.h
-include_rtems_score_HEADERS += score/cpu/nios2/include/rtems/score/nios2-utility.h
-include_rtems_score_HEADERS += score/cpu/nios2/include/rtems/score/nios2.h
diff --git a/cpukit/score/cpu/no_cpu/headers.am b/cpukit/score/cpu/no_cpu/headers.am
deleted file mode 100644
index 6a8c54df42..0000000000
--- a/cpukit/score/cpu/no_cpu/headers.am
+++ /dev/null
@@ -1,6 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_rtems_HEADERS += score/cpu/no_cpu/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/no_cpu/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/no_cpu/include/rtems/score/cpu_asm.h
-include_rtems_score_HEADERS += score/cpu/no_cpu/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/no_cpu/include/rtems/score/no_cpu.h
diff --git a/cpukit/score/cpu/or1k/headers.am b/cpukit/score/cpu/or1k/headers.am
deleted file mode 100644
index e65d66464d..0000000000
--- a/cpukit/score/cpu/or1k/headers.am
+++ /dev/null
@@ -1,8 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_rtems_HEADERS += score/cpu/or1k/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/or1k/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/or1k/include/rtems/score/cpu_asm.h
-include_rtems_score_HEADERS += score/cpu/or1k/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/or1k/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/or1k/include/rtems/score/or1k-utility.h
-include_rtems_score_HEADERS += score/cpu/or1k/include/rtems/score/or1k.h
diff --git a/cpukit/score/cpu/powerpc/headers.am b/cpukit/score/cpu/powerpc/headers.am
deleted file mode 100644
index 5f016a21d1..0000000000
--- a/cpukit/score/cpu/powerpc/headers.am
+++ /dev/null
@@ -1,9 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/powerpc/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/powerpc/include/rtems/asm.h
-include_rtems_powerpc_HEADERS += score/cpu/powerpc/include/rtems/powerpc/registers.h
-include_rtems_score_HEADERS += score/cpu/powerpc/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/powerpc/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/powerpc/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/powerpc/include/rtems/score/paravirt.h
-include_rtems_score_HEADERS += score/cpu/powerpc/include/rtems/score/powerpc.h
diff --git a/cpukit/score/cpu/riscv/headers.am b/cpukit/score/cpu/riscv/headers.am
deleted file mode 100644
index eb863cb28c..0000000000
--- a/cpukit/score/cpu/riscv/headers.am
+++ /dev/null
@@ -1,11 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_libcpu_HEADERS += score/cpu/riscv/include/libcpu/access.h
-include_libcpu_HEADERS += score/cpu/riscv/include/libcpu/byteorder.h
-include_machine_HEADERS += score/cpu/riscv/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/riscv/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/riscv/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/riscv/include/rtems/score/cpu_asm.h
-include_rtems_score_HEADERS += score/cpu/riscv/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/riscv/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/riscv/include/rtems/score/riscv-utility.h
-include_rtems_score_HEADERS += score/cpu/riscv/include/rtems/score/riscv.h
diff --git a/cpukit/score/cpu/sh/headers.am b/cpukit/score/cpu/sh/headers.am
deleted file mode 100644
index ccb3b94eb5..0000000000
--- a/cpukit/score/cpu/sh/headers.am
+++ /dev/null
@@ -1,7 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_rtems_HEADERS += score/cpu/sh/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/sh/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/sh/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/sh/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/sh/include/rtems/score/sh.h
-include_rtems_score_HEADERS += score/cpu/sh/include/rtems/score/sh_io.h
diff --git a/cpukit/score/cpu/sparc/headers.am b/cpukit/score/cpu/sparc/headers.am
deleted file mode 100644
index 25eaeaa74a..0000000000
--- a/cpukit/score/cpu/sparc/headers.am
+++ /dev/null
@@ -1,11 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_libcpu_HEADERS += score/cpu/sparc/include/libcpu/access.h
-include_libcpu_HEADERS += score/cpu/sparc/include/libcpu/byteorder.h
-include_libcpu_HEADERS += score/cpu/sparc/include/libcpu/grlib-tn-0018.h
-include_machine_HEADERS += score/cpu/sparc/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/sparc/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/sparc/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/sparc/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/sparc/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/sparc/include/rtems/score/sparc.h
-include_rtems_score_HEADERS += score/cpu/sparc/include/rtems/score/sparcimpl.h
diff --git a/cpukit/score/cpu/sparc64/headers.am b/cpukit/score/cpu/sparc64/headers.am
deleted file mode 100644
index a2a1c1fb2c..0000000000
--- a/cpukit/score/cpu/sparc64/headers.am
+++ /dev/null
@@ -1,6 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_rtems_HEADERS += score/cpu/sparc64/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/sparc64/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/sparc64/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/sparc64/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/sparc64/include/rtems/score/sparc64.h
diff --git a/cpukit/score/cpu/v850/headers.am b/cpukit/score/cpu/v850/headers.am
deleted file mode 100644
index 547f128401..0000000000
--- a/cpukit/score/cpu/v850/headers.am
+++ /dev/null
@@ -1,8 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/v850/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/v850/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/v850/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/v850/include/rtems/score/cpu_asm.h
-include_rtems_score_HEADERS += score/cpu/v850/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/v850/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/v850/include/rtems/score/v850.h
diff --git a/cpukit/score/cpu/x86_64/headers.am b/cpukit/score/cpu/x86_64/headers.am
deleted file mode 100644
index 3ce32c3317..0000000000
--- a/cpukit/score/cpu/x86_64/headers.am
+++ /dev/null
@@ -1,9 +0,0 @@
-## This file was generated by "./boostrap -H".
-include_machine_HEADERS += score/cpu/x86_64/include/machine/elf_machdep.h
-include_rtems_HEADERS += score/cpu/x86_64/include/rtems/asm.h
-include_rtems_score_HEADERS += score/cpu/x86_64/include/rtems/score/cpu.h
-include_rtems_score_HEADERS += score/cpu/x86_64/include/rtems/score/cpu_asm.h
-include_rtems_score_HEADERS += score/cpu/x86_64/include/rtems/score/cpuatomic.h
-include_rtems_score_HEADERS += score/cpu/x86_64/include/rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += score/cpu/x86_64/include/rtems/score/idt.h
-include_rtems_score_HEADERS += score/cpu/x86_64/include/rtems/score/x86_64.h
diff --git a/cpukit/score/src/coremsgseize.c b/cpukit/score/src/coremsgseize.c
index e44538ee17..148e9dbb3c 100644
--- a/cpukit/score/src/coremsgseize.c
+++ b/cpukit/score/src/coremsgseize.c
@@ -56,7 +56,8 @@ Status_Control _CORE_message_queue_Seize(
return STATUS_SUCCESSFUL;
#else
{
- Thread_Control *the_thread;
+ Thread_queue_Heads *heads;
+ Thread_Control *the_thread;
/*
* There could be a thread waiting to send a message. If there
@@ -65,11 +66,8 @@ Status_Control _CORE_message_queue_Seize(
* NOTE: If we note that the queue was not full before this receive,
* then we can avoid this dequeue.
*/
- the_thread = _Thread_queue_First_locked(
- &the_message_queue->Wait_queue,
- the_message_queue->operations
- );
- if ( the_thread == NULL ) {
+ heads = the_message_queue->Wait_queue.Queue.heads;
+ if ( heads == NULL ) {
_CORE_message_queue_Free_message_buffer(
the_message_queue,
the_message
@@ -78,6 +76,13 @@ Status_Control _CORE_message_queue_Seize(
return STATUS_SUCCESSFUL;
}
+ the_thread = ( *the_message_queue->operations->surrender )(
+ &the_message_queue->Wait_queue.Queue,
+ heads,
+ NULL,
+ queue_context
+ );
+
/*
* There was a thread waiting to send a message. This code
* puts the messages in the message queue on behalf of the
@@ -90,9 +95,8 @@ Status_Control _CORE_message_queue_Seize(
(size_t) the_thread->Wait.option,
(CORE_message_queue_Submit_types) the_thread->Wait.count
);
- _Thread_queue_Extract_critical(
+ _Thread_queue_Resume(
&the_message_queue->Wait_queue.Queue,
- the_message_queue->operations,
the_thread,
queue_context
);
diff --git a/cpukit/score/src/coretodadjust.c b/cpukit/score/src/coretodadjust.c
index a746b0e004..b048aeee71 100644
--- a/cpukit/score/src/coretodadjust.c
+++ b/cpukit/score/src/coretodadjust.c
@@ -22,12 +22,13 @@
#include <rtems/score/todimpl.h>
-void _TOD_Adjust(
+Status_Control _TOD_Adjust(
const struct timespec *delta
)
{
ISR_lock_Context lock_context;
struct timespec tod;
+ Status_Control status;
/*
* Currently, RTEMS does the adjustment in one movement.
@@ -41,6 +42,13 @@ void _TOD_Adjust(
_TOD_Acquire( &lock_context );
_TOD_Get( &tod );
_Timespec_Add_to( &tod, delta );
- _TOD_Set( &tod, &lock_context );
+ status = _TOD_Is_valid_new_time_of_day( &tod );
+
+ if ( status == STATUS_SUCCESSFUL ) {
+ status = _TOD_Set( &tod, &lock_context );
+ }
+
_TOD_Unlock();
+
+ return status;
}
diff --git a/cpukit/score/src/coretodcheck.c b/cpukit/score/src/coretodcheck.c
new file mode 100644
index 0000000000..8c012c5070
--- /dev/null
+++ b/cpukit/score/src/coretodcheck.c
@@ -0,0 +1,59 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreTOD
+ *
+ * @brief This source file contains the implementation of
+ * _TOD_Is_valid_new_time_of_day().
+ */
+
+/*
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/todimpl.h>
+#include <rtems/score/watchdogimpl.h>
+
+Status_Control _TOD_Is_valid_new_time_of_day( const struct timespec *tod )
+{
+ if ( !_Watchdog_Is_valid_timespec( tod ) ) {
+ return STATUS_INVALID_NUMBER;
+ }
+
+ if ( tod->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) {
+ return STATUS_INVALID_NUMBER;
+ }
+
+ if ( tod->tv_sec > TOD_SECONDS_1970_THROUGH_2400 ) {
+ return STATUS_INVALID_NUMBER;
+ }
+
+ return STATUS_SUCCESSFUL;
+}
diff --git a/cpukit/score/src/coretodset.c b/cpukit/score/src/coretodset.c
index 5fc01215e0..b04242a0da 100644
--- a/cpukit/score/src/coretodset.c
+++ b/cpukit/score/src/coretodset.c
@@ -23,25 +23,6 @@
#include <rtems/score/assert.h>
#include <rtems/score/watchdogimpl.h>
-static Status_Control _TOD_Check_time_of_day_and_run_hooks(
- const struct timespec *tod
-)
-{
- if ( !_Watchdog_Is_valid_timespec( tod ) ) {
- return STATUS_INVALID_NUMBER;
- }
-
- if ( tod->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) {
- return STATUS_INVALID_NUMBER;
- }
-
- if ( _Watchdog_Is_far_future_timespec( tod ) ) {
- return STATUS_INVALID_NUMBER;
- }
-
- return _TOD_Hook_Run( TOD_ACTION_SET_CLOCK, tod );
-}
-
Status_Control _TOD_Set(
const struct timespec *tod,
ISR_lock_Context *lock_context
@@ -54,8 +35,9 @@ Status_Control _TOD_Set(
Status_Control status;
_Assert( _TOD_Is_owner() );
+ _Assert( _TOD_Is_valid_new_time_of_day( tod ) == STATUS_SUCCESSFUL );
- status = _TOD_Check_time_of_day_and_run_hooks( tod );
+ status = _TOD_Hook_Run( TOD_ACTION_SET_CLOCK, tod );
if ( status != STATUS_SUCCESSFUL ) {
_TOD_Release( lock_context );
return status;
diff --git a/cpukit/score/src/coretodtickspersec.c b/cpukit/score/src/coretodtickspersec.c
deleted file mode 100644
index f4860975bc..0000000000
--- a/cpukit/score/src/coretodtickspersec.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSScoreTOD
- *
- * @brief This source file contains the implementation of
- * TOD_TICKS_PER_SECOND_method().
- */
-
-/* COPYRIGHT (c) 1989-2014.
- * On-Line Applications Research Corporation (OAR).
- *
- * 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.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/score/todimpl.h>
-#include <rtems/config.h>
-
-uint32_t TOD_TICKS_PER_SECOND_method(void)
-{
- return (TOD_MICROSECONDS_PER_SECOND /
- rtems_configuration_get_microseconds_per_tick());
-}
diff --git a/cpukit/score/src/futex.c b/cpukit/score/src/futex.c
index b65a843704..9bf4d8b37e 100644
--- a/cpukit/score/src/futex.c
+++ b/cpukit/score/src/futex.c
@@ -1,11 +1,12 @@
/**
* @file
*
- * @ingroup RTEMSScore
+ * @ingroup RTEMSScoreFutex
*
* @brief This source file contains the implementation of
* _Futex_Wait() and _Futex_Wake().
*/
+
/*
* Copyright (c) 2015, 2016 embedded brains GmbH. All rights reserved.
*
@@ -20,6 +21,18 @@
* http://www.rtems.org/license/LICENSE.
*/
+/**
+ * @defgroup RTEMSScoreFutex Futex Handler
+ *
+ * @ingroup RTEMSScore
+ *
+ * @brief This group contains the Futex Handler implementation.
+ *
+ * The behaviour of the futex operations is defined by Linux, see also:
+ *
+ * https://man7.org/linux/man-pages/man2/futex.2.html
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -84,6 +97,22 @@ static void _Futex_Queue_release(
_ISR_Local_enable( level );
}
+/**
+ * @brief Performs the ``FUTEX_WAIT`` operation.
+ *
+ * @param[in, out] _futex is the futex object.
+ *
+ * @param[in] uaddr is the address to the futex state.
+ *
+ * @param val is the expected futex state value.
+ *
+ * @retval 0 Returns zero if the futex state is equal to the expected value.
+ * In this case the calling thread is enqueued on the thread queue of the
+ * futex object.
+ *
+ * @retval EAGAIN Returns EAGAIN if the futex state is not equal to the
+ * expected value.
+ */
int _Futex_Wait( struct _Futex_Control *_futex, int *uaddr, int val )
{
Futex_Control *futex;
@@ -113,7 +142,7 @@ int _Futex_Wait( struct _Futex_Control *_futex, int *uaddr, int val )
eno = 0;
} else {
_Futex_Queue_release( futex, level, &queue_context );
- eno = EWOULDBLOCK;
+ eno = EAGAIN;
}
return eno;
@@ -143,6 +172,15 @@ static Thread_Control *_Futex_Flush_filter(
return the_thread;
}
+/**
+ * @brief Performs the ``FUTEX_WAKE`` operation.
+ *
+ * @param[in, out] _futex is the futex object.
+ *
+ * @param count is the maximum count of threads to wake up.
+ *
+ * @return Returns the count of woken up threads.
+ */
int _Futex_Wake( struct _Futex_Control *_futex, int count )
{
Futex_Control *futex;
diff --git a/cpukit/score/src/mutex.c b/cpukit/score/src/mutex.c
index f7e35093b2..92bd614967 100644
--- a/cpukit/score/src/mutex.c
+++ b/cpukit/score/src/mutex.c
@@ -1,7 +1,7 @@
/**
* @file
*
- * @ingroup RTEMSScore
+ * @ingroup RTEMSScoreSysLockMutex
*
* @brief This source file contains the implementation of
* _Mutex_Acquire(), _Mutex_Acquire_timed(), _Mutex_Acquire_timed_ticks(),
@@ -36,6 +36,20 @@
#include <rtems/score/threadimpl.h>
#include <rtems/score/todimpl.h>
+/**
+ * @defgroup RTEMSScoreSysLockMutex System Lock Mutex Handler
+ *
+ * @ingroup RTEMSScore
+ *
+ * @brief This group contains the System Lock Mutex Handler implementation.
+ *
+ * The interfaces are defined by Newlib in <sys/lock.h>. The system lock
+ * mutexes are used for Newlib internal locking, the C++ standard library
+ * provided by GCC, the OpenMP support provided by GCC, the self-contained
+ * objects API provided by RTEMS, and the SuperCore internal mutexes such as
+ * the objects allocator lock (see ::API_Mutex_Control).
+ */
+
#define MUTEX_TQ_OPERATIONS &_Thread_queue_Operations_priority_inherit
RTEMS_STATIC_ASSERT(
diff --git a/cpukit/score/src/percpujobs.c b/cpukit/score/src/percpujobs.c
index f273f7d17d..3de3e4a7bd 100644
--- a/cpukit/score/src/percpujobs.c
+++ b/cpukit/score/src/percpujobs.c
@@ -127,7 +127,6 @@ void _Per_CPU_Wait_for_job(
break;
default:
_SMP_Fatal( SMP_FATAL_WRONG_CPU_STATE_TO_PERFORM_JOBS );
- break;
}
}
}
diff --git a/cpukit/score/src/rbtreemax.c b/cpukit/score/src/rbtreemax.c
new file mode 100644
index 0000000000..1b0e463aa2
--- /dev/null
+++ b/cpukit/score/src/rbtreemax.c
@@ -0,0 +1,55 @@
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreRBTree
+ *
+ * @brief This source file contains the implementation of
+ * _RBTree_Maximum().
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/rbtreeimpl.h>
+
+RBTree_Node *_RBTree_Maximum( const RBTree_Control *tree )
+{
+ RBTree_Node *parent;
+ RBTree_Node *node;
+
+ parent = NULL;
+ node = _RBTree_Root( tree );
+
+ while ( node != NULL ) {
+ parent = node;
+ node = _RBTree_Right( node );
+ }
+
+ return parent;
+}
diff --git a/cpukit/score/src/rbtreemin.c b/cpukit/score/src/rbtreemin.c
new file mode 100644
index 0000000000..b3cd4331c1
--- /dev/null
+++ b/cpukit/score/src/rbtreemin.c
@@ -0,0 +1,55 @@
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreRBTree
+ *
+ * @brief This source file contains the implementation of
+ * _RBTree_Minimum().
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/rbtreeimpl.h>
+
+RBTree_Node *_RBTree_Minimum( const RBTree_Control *tree )
+{
+ RBTree_Node *parent;
+ RBTree_Node *node;
+
+ parent = NULL;
+ node = _RBTree_Root( tree );
+
+ while ( node != NULL ) {
+ parent = node;
+ node = _RBTree_Left( node );
+ }
+
+ return parent;
+}
diff --git a/cpukit/score/src/rbtreenext.c b/cpukit/score/src/rbtreenext.c
index 32087955fe..5d43af0068 100644
--- a/cpukit/score/src/rbtreenext.c
+++ b/cpukit/score/src/rbtreenext.c
@@ -9,17 +9,28 @@
*/
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2012 embedded brains GmbH (http://www.embedded-brains.de)
*
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * 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.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
@@ -29,28 +40,9 @@
#include <rtems/score/rbtreeimpl.h>
#include <rtems/score/basedefs.h>
-RB_GENERATE_MINMAX( RBTree_Control, RBTree_Node, Node, static )
-
RB_GENERATE_NEXT( RBTree_Control, RBTree_Node, Node, static )
-RB_GENERATE_PREV( RBTree_Control, RBTree_Node, Node, static )
-
-RBTree_Node *_RBTree_Minimum( const RBTree_Control *tree )
-{
- return RB_MIN( RBTree_Control, RTEMS_DECONST( RBTree_Control *, tree ) );
-}
-
-RBTree_Node *_RBTree_Maximum( const RBTree_Control *tree )
-{
- return RB_MAX( RBTree_Control, RTEMS_DECONST( RBTree_Control *, tree ) );
-}
-
RBTree_Node *_RBTree_Successor( const RBTree_Node *node )
{
return RB_NEXT( RBTree_Control, NULL, RTEMS_DECONST( RBTree_Node *, node ) );
}
-
-RBTree_Node *_RBTree_Predecessor( const RBTree_Node *node )
-{
- return RB_PREV( RBTree_Control, NULL, RTEMS_DECONST( RBTree_Node *, node ) );
-}
diff --git a/cpukit/score/src/rbtreeprev.c b/cpukit/score/src/rbtreeprev.c
new file mode 100644
index 0000000000..9869cade99
--- /dev/null
+++ b/cpukit/score/src/rbtreeprev.c
@@ -0,0 +1,47 @@
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreRBTree
+ *
+ * @brief This source file contains the implementation of
+ * _RBTree_Predecessor().
+ */
+
+/*
+ * Copyright (C) 2012 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/rbtreeimpl.h>
+#include <rtems/score/basedefs.h>
+
+RB_GENERATE_PREV( RBTree_Control, RBTree_Node, Node, static inline )
+
+RBTree_Node *_RBTree_Predecessor( const RBTree_Node *node )
+{
+ return RB_PREV( RBTree_Control, NULL, RTEMS_DECONST( RBTree_Node *, node ) );
+}
diff --git a/cpukit/score/src/schedulerdefaultaskforhelp.c b/cpukit/score/src/schedulerdefaultaskforhelp.c
deleted file mode 100644
index 17c222eafb..0000000000
--- a/cpukit/score/src/schedulerdefaultaskforhelp.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSScoreScheduler
- *
- * @brief This source file contains the implementation of
- * _Scheduler_default_Ask_for_help(),
- * _Scheduler_default_Reconsider_help_request(), and
- * _Scheduler_default_Withdraw_node().
- */
-
-/*
- * Copyright (c) 2014, 2016 embedded brains GmbH
- *
- * 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/score/scheduler.h>
-
-bool _Scheduler_default_Ask_for_help(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- Scheduler_Node *node
-)
-{
- (void) scheduler;
- (void) the_thread;
- (void) node;
-
- return false;
-}
-
-void _Scheduler_default_Reconsider_help_request(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- Scheduler_Node *node
-)
-{
- (void) scheduler;
- (void) the_thread;
- (void) node;
-}
-
-void _Scheduler_default_Withdraw_node(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- Scheduler_Node *node,
- Thread_Scheduler_state next_state
-)
-{
- (void) scheduler;
- (void) the_thread;
- (void) node;
- (void) next_state;
-}
diff --git a/cpukit/score/src/schedulerdefaultnodedestroy.c b/cpukit/score/src/schedulerdefaultnodedestroy.c
index 796896d854..33cdfd4c69 100644
--- a/cpukit/score/src/schedulerdefaultnodedestroy.c
+++ b/cpukit/score/src/schedulerdefaultnodedestroy.c
@@ -21,12 +21,12 @@
#endif
#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulernodeimpl.h>
void _Scheduler_default_Node_destroy(
const Scheduler_Control *scheduler,
Scheduler_Node *node
)
{
- (void) scheduler;
- (void) node;
+ _Scheduler_Node_do_destroy( scheduler, node );
}
diff --git a/cpukit/score/src/schedulerdefaultpinunpin.c b/cpukit/score/src/schedulerdefaultpinunpin.c
index 4aa2169c8e..df41a29dcb 100644
--- a/cpukit/score/src/schedulerdefaultpinunpin.c
+++ b/cpukit/score/src/schedulerdefaultpinunpin.c
@@ -1,18 +1,37 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
* @ingroup RTEMSScoreScheduler
*
* @brief This source file contains the implementation of
- * _Scheduler_default_Pin_or_unpin().
+ * _Scheduler_default_Pin_or_unpin_not_supported().
*/
/*
- * Copyright (c) 2018 embedded brains GmbH
+ * Copyright (C) 2018 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * 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.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
@@ -23,7 +42,7 @@
#include <rtems/score/interr.h>
#include <rtems/score/smpimpl.h>
-void _Scheduler_default_Pin_or_unpin(
+void _Scheduler_default_Pin_or_unpin_not_supported(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node,
diff --git a/cpukit/score/src/schedulerdefaultpinunpindonothing.c b/cpukit/score/src/schedulerdefaultpinunpindonothing.c
new file mode 100644
index 0000000000..f3ecb0b718
--- /dev/null
+++ b/cpukit/score/src/schedulerdefaultpinunpindonothing.c
@@ -0,0 +1,73 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreScheduler
+ *
+ * @brief This source file contains the implementation of
+ * _Scheduler_default_Pin_or_unpin_do_nothing().
+ */
+
+/*
+ * Copyright (C) 2018 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/scheduler.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/smpimpl.h>
+#include <rtems/sysinit.h>
+
+void _Scheduler_default_Pin_or_unpin_do_nothing(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node,
+ struct Per_CPU_Control *cpu
+)
+{
+ (void) scheduler;
+ (void) the_thread;
+ (void) node;
+ (void) cpu;
+}
+
+static void _Scheduler_Ensure_exactly_one_processor( void )
+{
+ if ( _SMP_Get_processor_maximum() != 1 ) {
+ _Terminate(
+ RTEMS_FATAL_SOURCE_SMP,
+ SMP_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR
+ );
+ }
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Scheduler_Ensure_exactly_one_processor,
+ RTEMS_SYSINIT_SCHEDULER,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/score/src/scheduleredfreleasejob.c b/cpukit/score/src/scheduleredfreleasejob.c
index 443fdaeed5..4cccffc952 100644
--- a/cpukit/score/src/scheduleredfreleasejob.c
+++ b/cpukit/score/src/scheduleredfreleasejob.c
@@ -66,7 +66,7 @@ void _Scheduler_EDF_Release_job(
_Thread_Priority_changed(
the_thread,
priority_node,
- false,
+ PRIORITY_GROUP_LAST,
queue_context
);
} else {
diff --git a/cpukit/score/src/semaphore.c b/cpukit/score/src/semaphore.c
index db3c3a91eb..7743939973 100644
--- a/cpukit/score/src/semaphore.c
+++ b/cpukit/score/src/semaphore.c
@@ -159,18 +159,12 @@ void _Semaphore_Post( struct _Semaphore_Control *_sem )
++sem->count;
_Sem_Queue_release( sem, level, &queue_context );
} else {
- const Thread_queue_Operations *operations;
- Thread_Control *first;
-
_Thread_queue_Context_set_ISR_level( &queue_context, level );
- operations = SEMAPHORE_TQ_OPERATIONS;
- first = ( *operations->first )( heads );
-
- _Thread_queue_Extract_critical(
+ _Thread_queue_Surrender_no_priority(
&sem->Queue.Queue,
- operations,
- first,
- &queue_context
+ heads,
+ &queue_context,
+ SEMAPHORE_TQ_OPERATIONS
);
}
}
@@ -192,18 +186,12 @@ void _Semaphore_Post_binary( struct _Semaphore_Control *_sem )
sem->count = 1;
_Sem_Queue_release( sem, level, &queue_context );
} else {
- const Thread_queue_Operations *operations;
- Thread_Control *first;
-
_Thread_queue_Context_set_ISR_level( &queue_context, level );
- operations = SEMAPHORE_TQ_OPERATIONS;
- first = ( *operations->first )( heads );
-
- _Thread_queue_Extract_critical(
+ _Thread_queue_Surrender_no_priority(
&sem->Queue.Queue,
- operations,
- first,
- &queue_context
+ heads,
+ &queue_context,
+ SEMAPHORE_TQ_OPERATIONS
);
}
}
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index e98249be51..26e6b79058 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -287,6 +287,11 @@ long unsigned _SMP_Process_message(
)
{
if ( ( message & SMP_MESSAGE_SHUTDOWN ) != 0 ) {
+ ISR_Level level;
+
+ _CPU_ISR_Disable( level );
+ (void) level;
+
/* Check the state to prevent recursive shutdowns */
if ( _Per_CPU_Get_state( cpu_self ) != PER_CPU_STATE_SHUTDOWN ) {
_Per_CPU_Set_state( cpu_self, PER_CPU_STATE_SHUTDOWN );
diff --git a/cpukit/score/src/stackallocatorforidle.c b/cpukit/score/src/stackallocatorforidle.c
new file mode 100644
index 0000000000..7c4fd10c7d
--- /dev/null
+++ b/cpukit/score/src/stackallocatorforidle.c
@@ -0,0 +1,59 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2021 OAR Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/stack.h>
+#include <rtems/score/thread.h>
+
+/**
+ * @brief Default stack allocator allocate for idle handler.
+ *
+ * The allocate for idle handler is optional even when the user thread stack
+ * allocator and deallocator are configured.
+ *
+ * The default allocator for IDLE thread stacks gets the memory from a
+ * statically allocated area provided via confdefs.h.
+ *
+ * @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.
+ *
+ * @retval NULL Not enough memory (never returned).
+ * @retval other Pointer to begin of stack area.
+ */
+static void *_Stack_Allocator_allocate_for_idle_default(
+ uint32_t cpu,
+ size_t stack_size
+)
+{
+ return &_Thread_Idle_stacks[ cpu * stack_size ];
+}
+
+const Stack_Allocator_allocate_for_idle _Stack_Allocator_allocate_for_idle =
+ _Stack_Allocator_allocate_for_idle_default;
diff --git a/cpukit/score/src/threadchangepriority.c b/cpukit/score/src/threadchangepriority.c
index 13e9147916..bd4fef279b 100644
--- a/cpukit/score/src/threadchangepriority.c
+++ b/cpukit/score/src/threadchangepriority.c
@@ -31,13 +31,13 @@
static void _Thread_Set_scheduler_node_priority(
Priority_Aggregation *priority_aggregation,
- bool prepend_it
+ Priority_Group_order priority_group_order
)
{
_Scheduler_Node_set_priority(
SCHEDULER_NODE_OF_WAIT_PRIORITY_NODE( priority_aggregation ),
_Priority_Get_priority( priority_aggregation ),
- prepend_it
+ priority_group_order
);
}
@@ -55,7 +55,10 @@ static void _Thread_Priority_action_add(
the_thread = arg;
_Thread_Scheduler_add_wait_node( the_thread, scheduler_node );
- _Thread_Set_scheduler_node_priority( priority_aggregation, false );
+ _Thread_Set_scheduler_node_priority(
+ priority_aggregation,
+ PRIORITY_GROUP_LAST
+ );
_Priority_Set_action_type( priority_aggregation, PRIORITY_ACTION_ADD );
_Priority_Actions_add( priority_actions, priority_aggregation );
}
@@ -73,7 +76,10 @@ static void _Thread_Priority_action_remove(
the_thread = arg;
_Thread_Scheduler_remove_wait_node( the_thread, scheduler_node );
- _Thread_Set_scheduler_node_priority( priority_aggregation, true );
+ _Thread_Set_scheduler_node_priority(
+ priority_aggregation,
+ PRIORITY_GROUP_FIRST
+ );
_Priority_Set_action_type( priority_aggregation, PRIORITY_ACTION_REMOVE );
_Priority_Actions_add( priority_actions, priority_aggregation );
}
@@ -81,12 +87,15 @@ static void _Thread_Priority_action_remove(
static void _Thread_Priority_action_change(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
{
- _Thread_Set_scheduler_node_priority( priority_aggregation, prepend_it );
+ _Thread_Set_scheduler_node_priority(
+ priority_aggregation,
+ priority_group_order
+ );
#if defined(RTEMS_SMP) || defined(RTEMS_DEBUG)
_Priority_Set_action_type( priority_aggregation, PRIORITY_ACTION_CHANGE );
#endif
@@ -97,7 +106,7 @@ static void _Thread_Priority_do_perform_actions(
Thread_Control *the_thread,
Thread_queue_Queue *queue,
const Thread_queue_Operations *operations,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Thread_queue_Context *queue_context
)
{
@@ -162,7 +171,7 @@ static void _Thread_Priority_do_perform_actions(
_Priority_Changed(
priority_aggregation,
priority_action_node,
- prepend_it,
+ priority_group_order,
&queue_context->Priority.Actions,
_Thread_Priority_action_change,
NULL
@@ -203,7 +212,7 @@ void _Thread_Priority_perform_actions(
*/
the_thread = start_of_path;
- update_count = _Thread_queue_Context_save_priority_updates( queue_context );
+ update_count = _Thread_queue_Context_get_priority_updates( queue_context );
while ( true ) {
Thread_queue_Queue *queue;
@@ -214,7 +223,7 @@ void _Thread_Priority_perform_actions(
the_thread,
queue,
the_thread->Wait.operations,
- false,
+ PRIORITY_GROUP_LAST,
queue_context
);
@@ -244,7 +253,7 @@ static void _Thread_Priority_apply(
Thread_Control *the_thread,
Priority_Node *priority_action_node,
Thread_queue_Context *queue_context,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Action_type priority_action_type
)
{
@@ -263,17 +272,17 @@ static void _Thread_Priority_apply(
the_thread,
queue,
the_thread->Wait.operations,
- prepend_it,
+ priority_group_order,
queue_context
);
if ( !_Priority_Actions_is_empty( &queue_context->Priority.Actions ) ) {
#if defined(RTEMS_SMP)
- _Thread_queue_Path_acquire_critical( queue, the_thread, queue_context );
+ (void) _Thread_queue_Path_acquire( queue, the_thread, queue_context );
#endif
_Thread_Priority_perform_actions( queue->owner, queue_context );
#if defined(RTEMS_SMP)
- _Thread_queue_Path_release_critical( queue_context );
+ _Thread_queue_Path_release( queue_context );
#endif
}
}
@@ -288,7 +297,7 @@ void _Thread_Priority_add(
the_thread,
priority_node,
queue_context,
- false,
+ PRIORITY_GROUP_LAST,
PRIORITY_ACTION_ADD
);
}
@@ -303,7 +312,7 @@ void _Thread_Priority_remove(
the_thread,
priority_node,
queue_context,
- true,
+ PRIORITY_GROUP_FIRST,
PRIORITY_ACTION_REMOVE
);
}
@@ -311,7 +320,7 @@ void _Thread_Priority_remove(
void _Thread_Priority_changed(
Thread_Control *the_thread,
Priority_Node *priority_node,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Thread_queue_Context *queue_context
)
{
@@ -319,7 +328,7 @@ void _Thread_Priority_changed(
the_thread,
priority_node,
queue_context,
- prepend_it,
+ priority_group_order,
PRIORITY_ACTION_CHANGE
);
}
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c
index 395dcc9c12..86e117e70f 100644
--- a/cpukit/score/src/threadcreateidle.c
+++ b/cpukit/score/src/threadcreateidle.c
@@ -38,13 +38,7 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu )
memset( &config, 0, sizeof( config ) );
config.scheduler = _Scheduler_Get_by_CPU( cpu );
-
-#if defined(RTEMS_SMP)
- if ( config.scheduler == NULL ) {
- return;
- }
-#endif
-
+ _Assert( config.scheduler != NULL );
config.priority = _Scheduler_Map_priority(
config.scheduler,
config.scheduler->maximum_priority
@@ -55,9 +49,15 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu )
config.is_preemptible = true;
config.stack_size = _Thread_Idle_stack_size
+ CPU_IDLE_TASK_IS_FP * CONTEXT_FP_SIZE;
- config.stack_area = &_Thread_Idle_stacks[
- _Per_CPU_Get_index( cpu ) * config.stack_size
- ];
+
+ /*
+ * The IDLE thread stacks may be statically allocated or there may be a
+ * custom allocator provided just as with user threads.
+ */
+ config.stack_area = (*_Stack_Allocator_allocate_for_idle)(
+ _Per_CPU_Get_index( cpu ),
+ config.stack_size
+ );
/*
* The entire workspace is zeroed during its initialization. Thus, all
diff --git a/cpukit/score/src/threaddispatch.c b/cpukit/score/src/threaddispatch.c
index fd3f4eda4d..1d317ad2b1 100644
--- a/cpukit/score/src/threaddispatch.c
+++ b/cpukit/score/src/threaddispatch.c
@@ -5,7 +5,7 @@
*
* @brief This source file contains the definition of ::_Thread_Allocated_fp
* and ::_User_extensions_Switches_list and the implementation of
- * _Thread_Dispatch(), _Thread_Dispatch_direct(), _Thread_Dispatch_enable(),
+ * _Thread_Dispatch_direct(), _Thread_Dispatch_enable(),
* and _Thread_Do_dispatch().
*/
@@ -327,25 +327,6 @@ post_switch:
_Thread_Run_post_switch_actions( executing );
}
-void _Thread_Dispatch( void )
-{
- ISR_Level level;
- Per_CPU_Control *cpu_self;
-
- _ISR_Local_disable( level );
-
- cpu_self = _Per_CPU_Get();
-
- if ( cpu_self->dispatch_necessary ) {
- _Profiling_Thread_dispatch_disable( cpu_self, 0 );
- _Assert( cpu_self->thread_dispatch_disable_level == 0 );
- cpu_self->thread_dispatch_disable_level = 1;
- _Thread_Do_dispatch( cpu_self, level );
- } else {
- _ISR_Local_enable( level );
- }
-}
-
void _Thread_Dispatch_direct( Per_CPU_Control *cpu_self )
{
ISR_Level level;
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index 9c1b809c3a..81199a7044 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -96,6 +96,113 @@ void _Thread_Free(
_Objects_Free( &information->Objects, &the_thread->Object );
}
+static void _Thread_Initialize_scheduler_and_wait_nodes(
+ Thread_Control *the_thread,
+ const Thread_Configuration *config
+)
+{
+ Scheduler_Node *home_scheduler_node;
+#if defined(RTEMS_SMP)
+ Scheduler_Node *scheduler_node;
+ const Scheduler_Control *scheduler;
+ size_t scheduler_index;
+#endif
+
+#if defined(RTEMS_SMP)
+ home_scheduler_node = NULL;
+ scheduler_node = the_thread->Scheduler.nodes;
+ scheduler = &_Scheduler_Table[ 0 ];
+ scheduler_index = 0;
+
+ /*
+ * In SMP configurations, the thread has exactly one scheduler node for each
+ * configured scheduler. Initialize the scheduler nodes of each scheduler.
+ * The application configuration ensures that we have at least one scheduler
+ * configured.
+ */
+ while ( scheduler_index < _Scheduler_Count ) {
+ Priority_Control priority;
+
+ if ( scheduler == config->scheduler ) {
+ priority = config->priority;
+ home_scheduler_node = scheduler_node;
+ } else {
+ /*
+ * Use the idle thread priority for the non-home scheduler instances by
+ * default.
+ */
+ priority = _Scheduler_Map_priority(
+ scheduler,
+ scheduler->maximum_priority
+ );
+ }
+
+ _Scheduler_Node_initialize(
+ scheduler,
+ scheduler_node,
+ the_thread,
+ priority
+ );
+
+ /*
+ * Since the size of a scheduler node depends on the application
+ * configuration, the _Scheduler_Node_size constant is used to get the next
+ * scheduler node. Using sizeof( Scheduler_Node ) would be wrong.
+ */
+ scheduler_node = (Scheduler_Node *)
+ ( (uintptr_t) scheduler_node + _Scheduler_Node_size );
+ ++scheduler;
+ ++scheduler_index;
+ }
+
+ /*
+ * The thread is initialized to use exactly one scheduler node which is
+ * provided by its home scheduler.
+ */
+ _Assert( home_scheduler_node != NULL );
+ _Chain_Initialize_one(
+ &the_thread->Scheduler.Wait_nodes,
+ &home_scheduler_node->Thread.Wait_node
+ );
+ _Chain_Initialize_one(
+ &the_thread->Scheduler.Scheduler_nodes,
+ &home_scheduler_node->Thread.Scheduler_node.Chain
+ );
+#else
+ /*
+ * In uniprocessor configurations, the thread has exactly one scheduler node.
+ */
+ home_scheduler_node = _Thread_Scheduler_get_home_node( the_thread );
+ _Scheduler_Node_initialize(
+ config->scheduler,
+ home_scheduler_node,
+ the_thread,
+ config->priority
+ );
+#endif
+
+ /*
+ * The current priority of the thread is initialized to exactly the real
+ * priority of the thread. During the lifetime of the thread, it may gain
+ * more priority nodes, for example through locking protocols such as
+ * priority inheritance or priority ceiling.
+ */
+ _Priority_Node_initialize( &the_thread->Real_priority, config->priority );
+ _Priority_Initialize_one(
+ &home_scheduler_node->Wait.Priority,
+ &the_thread->Real_priority
+ );
+
+#if defined(RTEMS_SMP)
+ RTEMS_STATIC_ASSERT( THREAD_SCHEDULER_BLOCKED == 0, Scheduler_state );
+ the_thread->Scheduler.home_scheduler = config->scheduler;
+ _ISR_lock_Initialize( &the_thread->Scheduler.Lock, "Thread Scheduler" );
+ _ISR_lock_Initialize( &the_thread->Wait.Lock.Default, "Thread Wait Default" );
+ _Thread_queue_Gate_open( &the_thread->Wait.Lock.Tranquilizer );
+ _RBTree_Initialize_node( &the_thread->Wait.Link.Registry_node );
+#endif
+}
+
static bool _Thread_Try_initialize(
Thread_Information *information,
Thread_Control *the_thread,
@@ -107,12 +214,6 @@ static bool _Thread_Try_initialize(
char *stack_begin;
char *stack_end;
uintptr_t stack_align;
- Scheduler_Node *scheduler_node;
-#if defined(RTEMS_SMP)
- Scheduler_Node *scheduler_node_for_index;
- const Scheduler_Control *scheduler_for_index;
- size_t scheduler_index;
-#endif
Per_CPU_Control *cpu = _Per_CPU_Get_by_index( 0 );
memset(
@@ -182,78 +283,13 @@ static bool _Thread_Try_initialize(
the_thread->Start.stack_free = config->stack_free;
_Thread_Timer_initialize( &the_thread->Timer, cpu );
+ _Thread_Initialize_scheduler_and_wait_nodes( the_thread, config );
#if defined(RTEMS_SMP)
- scheduler_node = NULL;
- scheduler_node_for_index = the_thread->Scheduler.nodes;
- scheduler_for_index = &_Scheduler_Table[ 0 ];
- scheduler_index = 0;
-
- while ( scheduler_index < _Scheduler_Count ) {
- Priority_Control priority_for_index;
-
- if ( scheduler_for_index == config->scheduler ) {
- priority_for_index = config->priority;
- scheduler_node = scheduler_node_for_index;
- } else {
- /*
- * Use the idle thread priority for the non-home scheduler instances by
- * default.
- */
- priority_for_index = _Scheduler_Map_priority(
- scheduler_for_index,
- scheduler_for_index->maximum_priority
- );
- }
-
- _Scheduler_Node_initialize(
- scheduler_for_index,
- scheduler_node_for_index,
- the_thread,
- priority_for_index
- );
- scheduler_node_for_index = (Scheduler_Node *)
- ( (uintptr_t) scheduler_node_for_index + _Scheduler_Node_size );
- ++scheduler_for_index;
- ++scheduler_index;
- }
-
- _Assert( scheduler_node != NULL );
- _Chain_Initialize_one(
- &the_thread->Scheduler.Wait_nodes,
- &scheduler_node->Thread.Wait_node
- );
- _Chain_Initialize_one(
- &the_thread->Scheduler.Scheduler_nodes,
- &scheduler_node->Thread.Scheduler_node.Chain
- );
-#else
- scheduler_node = _Thread_Scheduler_get_home_node( the_thread );
- _Scheduler_Node_initialize(
- config->scheduler,
- scheduler_node,
- the_thread,
- config->priority
- );
-#endif
-
- _Priority_Node_initialize( &the_thread->Real_priority, config->priority );
- _Priority_Initialize_one(
- &scheduler_node->Wait.Priority,
- &the_thread->Real_priority
- );
-
-#if defined(RTEMS_SMP)
- RTEMS_STATIC_ASSERT( THREAD_SCHEDULER_BLOCKED == 0, Scheduler_state );
- the_thread->Scheduler.home_scheduler = config->scheduler;
- _ISR_lock_Initialize( &the_thread->Scheduler.Lock, "Thread Scheduler" );
_Processor_mask_Assign(
&the_thread->Scheduler.Affinity,
_SMP_Get_online_processors()
);
- _ISR_lock_Initialize( &the_thread->Wait.Lock.Default, "Thread Wait Default" );
- _Thread_queue_Gate_open( &the_thread->Wait.Lock.Tranquilizer );
- _RBTree_Initialize_node( &the_thread->Wait.Link.Registry_node );
_SMP_lock_Stats_initialize( &the_thread->Potpourri_stats, "Thread Potpourri" );
_SMP_lock_Stats_initialize( &the_thread->Join_queue.Lock_stats, "Thread State" );
#endif
diff --git a/cpukit/score/src/threadplaindispatch.c b/cpukit/score/src/threadplaindispatch.c
new file mode 100644
index 0000000000..eeb52ec42d
--- /dev/null
+++ b/cpukit/score/src/threadplaindispatch.c
@@ -0,0 +1,60 @@
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreThread
+ *
+ * @brief This source file contains the implementation of _Thread_Dispatch().
+ */
+
+/*
+ * Copyright (C) 2015, 2017 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/threaddispatch.h>
+#include <rtems/score/assert.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/threadimpl.h>
+
+void _Thread_Dispatch( void )
+{
+ ISR_Level level;
+ Per_CPU_Control *cpu_self;
+
+ _ISR_Local_disable( level );
+
+ cpu_self = _Per_CPU_Get();
+
+ if ( cpu_self->dispatch_necessary ) {
+ _Profiling_Thread_dispatch_disable( cpu_self, 0 );
+ _Assert( cpu_self->thread_dispatch_disable_level == 0 );
+ cpu_self->thread_dispatch_disable_level = 1;
+ _Thread_Do_dispatch( cpu_self, level );
+ } else {
+ _ISR_Local_enable( level );
+ }
+}
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index d187e32fbc..5fc357ec82 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -7,10 +7,10 @@
* _Thread_queue_Deadlock_fatal(), _Thread_queue_Deadlock_status(),
* _Thread_queue_Do_dequeue(), _Thread_queue_Enqueue(),
* _Thread_queue_Enqueue_do_nothing_extra(), _Thread_queue_Enqueue_sticky(),
- * _Thread_queue_Extract(), _Thread_queue_Extract_critical(),
- * _Thread_queue_Extract_locked(), _Thread_queue_Path_acquire_critical(),
- * _Thread_queue_Path_release_critical(), _Thread_queue_Surrender(),
- * _Thread_queue_Surrender_sticky(), and _Thread_queue_Unblock_critical().
+ * _Thread_queue_Extract(), _Thread_queue_Extract_locked(),
+ * _Thread_queue_Path_acquire(), _Thread_queue_Path_release(),
+ * _Thread_queue_Resume(),_Thread_queue_Surrender(),
+ * _Thread_queue_Surrender_no_priority(), _Thread_queue_Surrender_sticky().
*/
/*
@@ -112,7 +112,7 @@ static Thread_queue_Link *_Thread_queue_Link_find(
);
}
-static bool _Thread_queue_Link_add(
+static Thread_queue_Deadlock_status _Thread_queue_Link_add(
Thread_queue_Link *link,
Thread_queue_Queue *source,
Thread_queue_Queue *target
@@ -143,7 +143,7 @@ static bool _Thread_queue_Link_add(
if ( recursive_target == source ) {
_ISR_lock_Release( &links->Lock, &lock_context );
- return false;
+ return THREAD_QUEUE_DEADLOCK_DETECTED;
}
}
@@ -155,7 +155,7 @@ static bool _Thread_queue_Link_add(
);
_ISR_lock_Release( &links->Lock, &lock_context );
- return true;
+ return THREAD_QUEUE_NO_DEADLOCK;
}
static void _Thread_queue_Link_remove( Thread_queue_Link *link )
@@ -174,9 +174,7 @@ static void _Thread_queue_Link_remove( Thread_queue_Link *link )
#if !defined(RTEMS_SMP)
static
#endif
-void _Thread_queue_Path_release_critical(
- Thread_queue_Context *queue_context
-)
+void _Thread_queue_Path_release( Thread_queue_Context *queue_context )
{
#if defined(RTEMS_SMP)
Chain_Node *head;
@@ -259,7 +257,7 @@ static void _Thread_queue_Path_append_deadlock_thread(
#if !defined(RTEMS_SMP)
static
#endif
-bool _Thread_queue_Path_acquire_critical(
+Thread_queue_Deadlock_status _Thread_queue_Path_acquire(
Thread_queue_Queue *queue,
Thread_Control *the_thread,
Thread_queue_Context *queue_context
@@ -271,11 +269,12 @@ bool _Thread_queue_Path_acquire_critical(
Thread_queue_Queue *target;
/*
- * For an overview please look at the non-SMP part below. We basically do
- * the same on SMP configurations. The fact that we may have more than one
- * executing thread and each thread queue has its own SMP lock makes the task
- * a bit more difficult. We have to avoid deadlocks at SMP lock level, since
- * this would result in an unrecoverable deadlock of the overall system.
+ * For an overview please look at the non-SMP part below. In SMP
+ * configurations, we basically do the same. The fact that we may have more
+ * than one executing thread and each thread queue has its own SMP lock makes
+ * the procedure a bit more difficult. We have to avoid deadlocks at SMP
+ * lock level, since this would result in an unrecoverable deadlock of the
+ * overall system.
*/
_Chain_Initialize_empty( &queue_context->Path.Links );
@@ -283,11 +282,11 @@ bool _Thread_queue_Path_acquire_critical(
owner = queue->owner;
if ( owner == NULL ) {
- return true;
+ return THREAD_QUEUE_NO_DEADLOCK;
}
if ( owner == the_thread ) {
- return false;
+ return THREAD_QUEUE_DEADLOCK_DETECTED;
}
_Chain_Initialize_node(
@@ -310,7 +309,11 @@ bool _Thread_queue_Path_acquire_critical(
link->Lock_context.Wait.queue = target;
if ( target != NULL ) {
- if ( _Thread_queue_Link_add( link, queue, target ) ) {
+ Thread_queue_Deadlock_status deadlock_status;
+
+ deadlock_status = _Thread_queue_Link_add( link, queue, target );
+
+ if ( deadlock_status == THREAD_QUEUE_NO_DEADLOCK ) {
_Thread_queue_Gate_add(
&owner->Wait.Lock.Pending_requests,
&link->Lock_context.Wait.Gate
@@ -330,15 +333,15 @@ bool _Thread_queue_Path_acquire_critical(
);
_Thread_Wait_remove_request_locked( owner, &link->Lock_context );
_Assert( owner->Wait.queue == NULL );
- return true;
+ return THREAD_QUEUE_NO_DEADLOCK;
}
} else {
link->Lock_context.Wait.queue = NULL;
_Thread_queue_Path_append_deadlock_thread( owner, queue_context );
- return false;
+ return THREAD_QUEUE_DEADLOCK_DETECTED;
}
} else {
- return true;
+ return THREAD_QUEUE_NO_DEADLOCK;
}
link = &owner->Wait.Link;
@@ -350,18 +353,18 @@ bool _Thread_queue_Path_acquire_critical(
owner = queue->owner;
if ( owner == NULL ) {
- return true;
+ return THREAD_QUEUE_NO_DEADLOCK;
}
if ( owner == the_thread ) {
- return false;
+ return THREAD_QUEUE_DEADLOCK_DETECTED;
}
queue = owner->Wait.queue;
} while ( queue != NULL );
#endif
- return true;
+ return THREAD_QUEUE_NO_DEADLOCK;
}
void _Thread_queue_Enqueue_do_nothing_extra(
@@ -391,8 +394,9 @@ void _Thread_queue_Enqueue(
Thread_queue_Context *queue_context
)
{
- Per_CPU_Control *cpu_self;
- bool success;
+ Thread_queue_Deadlock_status deadlock_status;
+ Per_CPU_Control *cpu_self;
+ bool success;
_Assert( queue_context->enqueue_callout != NULL );
@@ -404,8 +408,11 @@ void _Thread_queue_Enqueue(
_Thread_Wait_claim( the_thread, queue );
- if ( !_Thread_queue_Path_acquire_critical( queue, the_thread, queue_context ) ) {
- _Thread_queue_Path_release_critical( queue_context );
+ deadlock_status =
+ _Thread_queue_Path_acquire( queue, the_thread, queue_context );
+
+ if ( deadlock_status == THREAD_QUEUE_DEADLOCK_DETECTED ) {
+ _Thread_queue_Path_release( queue_context );
_Thread_Wait_restore_default( the_thread );
_Thread_queue_Queue_release( queue, &queue_context->Lock_context.Lock_context );
_Thread_Wait_tranquilize( the_thread );
@@ -418,7 +425,7 @@ void _Thread_queue_Enqueue(
_Thread_Wait_claim_finalize( the_thread, operations );
( *operations->enqueue )( queue, the_thread, queue_context );
- _Thread_queue_Path_release_critical( queue_context );
+ _Thread_queue_Path_release( queue_context );
the_thread->Wait.return_code = STATUS_SUCCESSFUL;
_Thread_Wait_flags_set( the_thread, THREAD_QUEUE_INTEND_TO_BLOCK );
@@ -467,14 +474,18 @@ Status_Control _Thread_queue_Enqueue_sticky(
Thread_queue_Context *queue_context
)
{
- Per_CPU_Control *cpu_self;
+ Thread_queue_Deadlock_status deadlock_status;
+ Per_CPU_Control *cpu_self;
_Assert( queue_context->enqueue_callout != NULL );
_Thread_Wait_claim( the_thread, queue );
- if ( !_Thread_queue_Path_acquire_critical( queue, the_thread, queue_context ) ) {
- _Thread_queue_Path_release_critical( queue_context );
+ deadlock_status =
+ _Thread_queue_Path_acquire( queue, the_thread, queue_context );
+
+ if ( deadlock_status == THREAD_QUEUE_DEADLOCK_DETECTED ) {
+ _Thread_queue_Path_release( queue_context );
_Thread_Wait_restore_default( the_thread );
_Thread_queue_Queue_release( queue, &queue_context->Lock_context.Lock_context );
_Thread_Wait_tranquilize( the_thread );
@@ -486,7 +497,7 @@ Status_Control _Thread_queue_Enqueue_sticky(
_Thread_Wait_claim_finalize( the_thread, operations );
( *operations->enqueue )( queue, the_thread, queue_context );
- _Thread_queue_Path_release_critical( queue_context );
+ _Thread_queue_Path_release( queue_context );
the_thread->Wait.return_code = STATUS_SUCCESSFUL;
_Thread_Wait_flags_set( the_thread, THREAD_QUEUE_INTEND_TO_BLOCK );
@@ -543,6 +554,16 @@ static bool _Thread_queue_MP_set_callout(
}
#endif
+static void _Thread_queue_Force_ready_again( Thread_Control *the_thread )
+{
+ /*
+ * We must set the wait flags under protection of the current thread lock,
+ * otherwise a _Thread_Timeout() running on another processor may interfere.
+ */
+ _Thread_Wait_flags_set( the_thread, THREAD_QUEUE_READY_AGAIN );
+ _Thread_Wait_restore_default( the_thread );
+}
+
static bool _Thread_queue_Make_ready_again( Thread_Control *the_thread )
{
bool success;
@@ -569,6 +590,45 @@ static bool _Thread_queue_Make_ready_again( Thread_Control *the_thread )
return unblock;
}
+/*
+ * This function is used instead of _Thread_queue_Make_ready_again() in
+ * _Thread_queue_Surrender() and _Thread_queue_Surrender_priority_ceiling()
+ * since only the previous owner thread is allowed to surrender the thread
+ * queue.
+ *
+ * In uniprocessor configurations, there is only one executing thread (in this
+ * case the previous owner), so the new owner thread must be fully blocked.
+ *
+ * In SMP configurations, the new owner may execute on another processor in
+ * parallel, so we have to use _Thread_queue_Make_ready_again().
+ */
+static bool _Thread_queue_Make_new_owner_ready_again( Thread_Control *new_owner )
+{
+#if defined(RTEMS_SMP)
+ return _Thread_queue_Make_ready_again( new_owner );
+#else
+ _Assert( _Thread_Wait_flags_get( new_owner ) == THREAD_QUEUE_BLOCKED );
+ _Thread_queue_Force_ready_again( new_owner );
+ return false;
+#endif
+}
+
+static void _Thread_queue_Unblock_new_owner_and_remove_timer(
+ Thread_queue_Queue *queue,
+ Thread_Control *new_owner,
+ bool unblock
+)
+{
+#if defined(RTEMS_SMP)
+ if ( unblock ) {
+ _Thread_Remove_timer_and_unblock( new_owner, queue );
+ }
+#else
+ (void) unblock;
+ _Thread_Remove_timer_and_unblock( new_owner, queue );
+#endif
+}
+
bool _Thread_queue_Extract_locked(
Thread_queue_Queue *queue,
const Thread_queue_Operations *operations,
@@ -583,51 +643,34 @@ bool _Thread_queue_Extract_locked(
return _Thread_queue_Make_ready_again( the_thread );
}
-void _Thread_queue_Unblock_critical(
- bool unblock,
- Thread_queue_Queue *queue,
- Thread_Control *the_thread,
- ISR_lock_Context *lock_context
+void _Thread_queue_Resume(
+ Thread_queue_Queue *queue,
+ Thread_Control *the_thread,
+ Thread_queue_Context *queue_context
)
{
+ bool unblock;
+
+ unblock = _Thread_queue_Make_ready_again( the_thread );
+
if ( unblock ) {
Per_CPU_Control *cpu_self;
- cpu_self = _Thread_Dispatch_disable_critical( lock_context );
- _Thread_queue_Queue_release( queue, lock_context );
+ cpu_self = _Thread_queue_Dispatch_disable( queue_context );
+ _Thread_queue_Queue_release(
+ queue, &queue_context->Lock_context.Lock_context
+ );
_Thread_Remove_timer_and_unblock( the_thread, queue );
_Thread_Dispatch_enable( cpu_self );
} else {
- _Thread_queue_Queue_release( queue, lock_context );
+ _Thread_queue_Queue_release(
+ queue, &queue_context->Lock_context.Lock_context
+ );
}
}
-void _Thread_queue_Extract_critical(
- Thread_queue_Queue *queue,
- const Thread_queue_Operations *operations,
- Thread_Control *the_thread,
- Thread_queue_Context *queue_context
-)
-{
- bool unblock;
-
- unblock = _Thread_queue_Extract_locked(
- queue,
- operations,
- the_thread,
- queue_context
- );
-
- _Thread_queue_Unblock_critical(
- unblock,
- queue,
- the_thread,
- &queue_context->Lock_context.Lock_context
- );
-}
-
void _Thread_queue_Extract( Thread_Control *the_thread )
{
Thread_queue_Context queue_context;
@@ -640,25 +683,20 @@ void _Thread_queue_Extract( Thread_Control *the_thread )
queue = the_thread->Wait.queue;
if ( queue != NULL ) {
- bool unblock;
-
_Thread_Wait_remove_request( the_thread, &queue_context.Lock_context );
_Thread_queue_Context_set_MP_callout(
&queue_context,
_Thread_queue_MP_callout_do_nothing
);
- unblock = _Thread_queue_Extract_locked(
+#if defined(RTEMS_MULTIPROCESSING)
+ _Thread_queue_MP_set_callout( the_thread, &queue_context );
+#endif
+ ( *the_thread->Wait.operations->extract )(
queue,
- the_thread->Wait.operations,
the_thread,
&queue_context
);
- _Thread_queue_Unblock_critical(
- unblock,
- queue,
- the_thread,
- &queue_context.Lock_context.Lock_context
- );
+ _Thread_queue_Resume( queue, the_thread, &queue_context );
} else {
_Thread_Wait_release( the_thread, &queue_context );
}
@@ -694,7 +732,7 @@ void _Thread_queue_Surrender(
_Thread_Resource_count_increment( new_owner );
}
- unblock = _Thread_queue_Make_ready_again( new_owner );
+ unblock = _Thread_queue_Make_new_owner_ready_again( new_owner );
cpu_self = _Thread_queue_Dispatch_disable( queue_context );
_Thread_queue_Queue_release(
@@ -703,12 +741,123 @@ void _Thread_queue_Surrender(
);
_Thread_Priority_update( queue_context );
+ _Thread_queue_Unblock_new_owner_and_remove_timer(
+ queue,
+ new_owner,
+ unblock
+ );
+
+ _Thread_Dispatch_enable( cpu_self );
+}
+
+void _Thread_queue_Surrender_no_priority(
+ Thread_queue_Queue *queue,
+ Thread_queue_Heads *heads,
+ Thread_queue_Context *queue_context,
+ const Thread_queue_Operations *operations
+)
+{
+ Thread_Control *the_thread;
+ bool unblock;
+ Per_CPU_Control *cpu_self;
+
+ _Assert( heads != NULL );
+ _Assert( queue->owner == NULL );
+
+ the_thread = ( *operations->surrender )( queue, heads, NULL, queue_context );
+
+#if defined(RTEMS_MULTIPROCESSING)
+ _Thread_queue_MP_set_callout( the_thread, queue_context );
+#endif
+
+ unblock = _Thread_queue_Make_ready_again( the_thread );
+
+ cpu_self = _Thread_queue_Dispatch_disable( queue_context );
+ _Thread_queue_Queue_release(
+ queue,
+ &queue_context->Lock_context.Lock_context
+ );
if ( unblock ) {
- _Thread_Remove_timer_and_unblock( new_owner, queue );
+ _Thread_Remove_timer_and_unblock( the_thread, queue );
+ }
+
+ _Thread_Dispatch_enable( cpu_self );
+}
+
+Status_Control _Thread_queue_Surrender_priority_ceiling(
+ Thread_queue_Queue *queue,
+ Thread_Control *executing,
+ Priority_Node *priority_ceiling,
+ Thread_queue_Context *queue_context,
+ const Thread_queue_Operations *operations
+)
+{
+ ISR_lock_Context lock_context;
+ Thread_queue_Heads *heads;
+ Thread_Control *new_owner;
+ bool unblock;
+ Per_CPU_Control *cpu_self;
+
+ _Thread_Resource_count_decrement( executing );
+
+ _Thread_queue_Context_clear_priority_updates( queue_context );
+ _Thread_Wait_acquire_default_critical( executing, &lock_context );
+ _Thread_Priority_remove( executing, priority_ceiling, queue_context );
+ _Thread_Wait_release_default_critical( executing, &lock_context );
+
+ heads = queue->heads;
+ queue->owner = NULL;
+
+ if ( heads == NULL ) {
+ cpu_self = _Thread_Dispatch_disable_critical(
+ &queue_context->Lock_context.Lock_context
+ );
+ _Thread_queue_Queue_release(
+ queue,
+ &queue_context->Lock_context.Lock_context
+ );
+ _Thread_Priority_update( queue_context );
+ _Thread_Dispatch_enable( cpu_self );
+ return STATUS_SUCCESSFUL;
}
+ new_owner = ( *operations->surrender )(
+ queue,
+ heads,
+ NULL,
+ queue_context
+ );
+
+ queue->owner = new_owner;
+
+ unblock = _Thread_queue_Make_new_owner_ready_again( new_owner );
+
+#if defined(RTEMS_MULTIPROCESSING)
+ if ( _Objects_Is_local_id( new_owner->Object.id ) )
+#endif
+ {
+ _Thread_Resource_count_increment( new_owner );
+ _Thread_Wait_acquire_default_critical( new_owner, &lock_context );
+ _Thread_Priority_add( new_owner, priority_ceiling, queue_context );
+ _Thread_Wait_release_default_critical( new_owner, &lock_context );
+ }
+
+ cpu_self = _Thread_queue_Dispatch_disable( queue_context );
+ _Thread_queue_Queue_release(
+ queue,
+ &queue_context->Lock_context.Lock_context
+ );
+
+ _Thread_Priority_update( queue_context );
+ _Thread_queue_Unblock_new_owner_and_remove_timer(
+ queue,
+ new_owner,
+ unblock
+ );
+
_Thread_Dispatch_enable( cpu_self );
+ return STATUS_SUCCESSFUL;
}
#if defined(RTEMS_SMP)
@@ -735,11 +884,15 @@ void _Thread_queue_Surrender_sticky(
queue->owner = new_owner;
/*
- * There is no need to check the unblock status, since in the corresponding
+ * There is no need to unblock the thread, since in the corresponding
* _Thread_queue_Enqueue_sticky() the thread is not blocked by the scheduler.
* Instead, the thread busy waits for a change of its thread wait flags.
+ * Timeouts cannot interfere since we hold the thread queue lock.
*/
- (void) _Thread_queue_Make_ready_again( new_owner );
+ _Assert(
+ _Thread_Wait_flags_get( new_owner ) == THREAD_QUEUE_INTEND_TO_BLOCK
+ );
+ _Thread_queue_Force_ready_again( new_owner );
cpu_self = _Thread_queue_Dispatch_disable( queue_context );
_Thread_queue_Queue_release(
diff --git a/cpukit/score/src/threadqfirst.c b/cpukit/score/src/threadqfirst.c
index 9908523298..8edbc1645f 100644
--- a/cpukit/score/src/threadqfirst.c
+++ b/cpukit/score/src/threadqfirst.c
@@ -27,11 +27,19 @@ Thread_Control *_Thread_queue_First(
const Thread_queue_Operations *operations
)
{
+ Thread_queue_Heads *heads;
Thread_Control *the_thread;
Thread_queue_Context queue_context;
_Thread_queue_Acquire( the_thread_queue, &queue_context );
- the_thread = _Thread_queue_First_locked( the_thread_queue, operations );
+ heads = the_thread_queue->Queue.heads;
+
+ if ( heads != NULL ) {
+ the_thread = ( *operations->first )( heads );
+ } else {
+ the_thread = NULL;
+ }
+
_Thread_queue_Release( the_thread_queue, &queue_context );
return the_thread;
diff --git a/cpukit/score/src/threadqflush.c b/cpukit/score/src/threadqflush.c
index 357e3d696e..42b35a499b 100644
--- a/cpukit/score/src/threadqflush.c
+++ b/cpukit/score/src/threadqflush.c
@@ -71,15 +71,15 @@ size_t _Thread_queue_Flush_critical(
Thread_queue_Context *queue_context
)
{
- size_t flushed;
- Chain_Control unblock;
- Thread_Control *owner;
- Chain_Node *node;
- Chain_Node *tail;
+ size_t flushed;
+ size_t priority_updates;
+ Chain_Control unblock;
+ Chain_Node *node;
+ Chain_Node *tail;
flushed = 0;
+ priority_updates = 0;
_Chain_Initialize_empty( &unblock );
- owner = queue->owner;
while ( true ) {
Thread_queue_Heads *heads;
@@ -99,8 +99,7 @@ size_t _Thread_queue_Flush_critical(
/*
* We do not have enough space in the queue context to collect all priority
- * updates, so clear it each time. We unconditionally do the priority
- * update for the owner later if it exists.
+ * updates, so clear it each time and accumulate the priority updates.
*/
_Thread_queue_Context_clear_priority_updates( queue_context );
@@ -120,6 +119,8 @@ size_t _Thread_queue_Flush_critical(
);
}
+ priority_updates +=
+ _Thread_queue_Context_get_priority_updates( queue_context );
++flushed;
}
@@ -145,9 +146,12 @@ size_t _Thread_queue_Flush_critical(
node = next;
} while ( node != tail );
- if ( owner != NULL ) {
+ if ( priority_updates != 0 ) {
+ Thread_Control *owner;
ISR_lock_Context lock_context;
+ owner = queue->owner;
+ _Assert( owner != NULL );
_Thread_State_acquire( owner, &lock_context );
_Scheduler_Update_priority( owner );
_Thread_State_release( owner, &lock_context );
diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c
index d6ba9dad57..ce3a8f6a73 100644
--- a/cpukit/score/src/threadqops.c
+++ b/cpukit/score/src/threadqops.c
@@ -59,17 +59,6 @@ void _Thread_queue_Do_nothing_priority_actions(
_Priority_Actions_initialize_empty( priority_actions );
}
-static void _Thread_queue_Do_nothing_extract(
- Thread_queue_Queue *queue,
- Thread_Control *the_thread,
- Thread_queue_Context *queue_context
-)
-{
- (void) queue;
- (void) the_thread;
- (void) queue_context;
-}
-
static void _Thread_queue_Queue_enqueue(
Thread_queue_Queue *queue,
Thread_Control *the_thread,
@@ -700,7 +689,7 @@ static void _Thread_queue_Priority_inherit_do_priority_actions_remove(
static void _Thread_queue_Priority_inherit_do_priority_actions_change(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -787,7 +776,7 @@ static void _Thread_queue_Priority_inherit_priority_actions(
_Priority_Changed(
&priority_queue->Queue,
&scheduler_node->Wait.Priority.Node,
- false,
+ PRIORITY_GROUP_LAST,
priority_actions,
_Thread_queue_Priority_inherit_do_priority_actions_change,
scheduler_node_of_owner
@@ -884,7 +873,7 @@ static void _Thread_queue_Priority_inherit_do_initialize(
static void _Thread_queue_Priority_inherit_do_enqueue_change(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -1079,7 +1068,7 @@ static void _Thread_queue_Priority_inherit_do_extract_remove(
static void _Thread_queue_Priority_inherit_do_extract_change(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -1197,7 +1186,7 @@ static void _Thread_queue_Priority_inherit_extract(
* resolves the deadlock. Thread T1 and T2 can the complete their
* operations.
*/
- _Thread_queue_Path_acquire_critical( queue, the_thread, queue_context );
+ (void) _Thread_queue_Path_acquire( queue, the_thread, queue_context );
#endif
_Thread_queue_Queue_extract(
@@ -1210,7 +1199,7 @@ static void _Thread_queue_Priority_inherit_extract(
);
#if defined(RTEMS_SMP)
- _Thread_queue_Path_release_critical( queue_context );
+ _Thread_queue_Path_release( queue_context );
#endif
}
@@ -1231,7 +1220,7 @@ static void _Thread_queue_Priority_inherit_do_surrender_add(
_Scheduler_Node_set_priority(
scheduler_node,
_Priority_Get_priority( priority_aggregation ),
- false
+ PRIORITY_GROUP_LAST
);
}
@@ -1254,7 +1243,7 @@ static void _Thread_queue_Priority_inherit_do_surrender_remove(
static void _Thread_queue_Priority_inherit_do_surrender_change(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -1270,14 +1259,14 @@ static void _Thread_queue_Priority_inherit_do_surrender_change(
_Scheduler_Node_set_priority(
SCHEDULER_NODE_OF_WAIT_PRIORITY( priority_aggregation ),
_Priority_Get_priority( priority_aggregation ),
- prepend_it
+ priority_group_order
);
}
#if defined(RTEMS_SMP)
static void _Thread_queue_Priority_inherit_do_surrender_change_2(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -1285,7 +1274,7 @@ static void _Thread_queue_Priority_inherit_do_surrender_change_2(
_Scheduler_Node_set_priority(
SCHEDULER_NODE_OF_WAIT_PRIORITY( priority_aggregation ),
_Priority_Get_priority( priority_aggregation ),
- prepend_it
+ priority_group_order
);
}
#endif
@@ -1461,12 +1450,11 @@ static Thread_Control *_Thread_queue_Priority_inherit_surrender(
}
const Thread_queue_Operations _Thread_queue_Operations_default = {
- .priority_actions = _Thread_queue_Do_nothing_priority_actions,
- .extract = _Thread_queue_Do_nothing_extract
+ .priority_actions = _Thread_queue_Do_nothing_priority_actions
/*
- * The default operations are only used in _Thread_Change_priority() and
- * _Thread_Timeout() and don't have a thread queue associated with them, so
- * the enqueue and first operations are superfluous.
+ * The default operations are only used in _Thread_Priority_apply() and
+ * _Thread_Continue() and do not have a thread queue associated with them, so
+ * the enqueue, extract, surrender, and first operations are superfluous.
*/
};
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index 79a154e3d3..2240d8f713 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -44,14 +44,11 @@ static void _Thread_Life_action_handler(
ISR_lock_Context *lock_context
);
-typedef struct {
- Chain_Control Chain;
- ISR_lock_Control Lock;
-} Thread_Zombie_control;
-
-static Thread_Zombie_control _Thread_Zombies = {
- .Chain = CHAIN_INITIALIZER_EMPTY( _Thread_Zombies.Chain ),
- .Lock = ISR_LOCK_INITIALIZER( "thread zombies" )
+Thread_Zombie_registry _Thread_Zombies = {
+#if defined(RTEMS_SMP)
+ .Lock = ISR_LOCK_INITIALIZER( "Thread Zombies" ),
+#endif
+ .Chain = CHAIN_INITIALIZER_EMPTY( _Thread_Zombies.Chain )
};
static void _Thread_Raise_real_priority(
@@ -70,7 +67,7 @@ static void _Thread_Raise_real_priority(
the_thread,
&the_thread->Real_priority,
priority,
- false,
+ PRIORITY_GROUP_LAST,
&queue_context
);
}
@@ -115,10 +112,10 @@ static void _Thread_Wake_up_joining_threads( Thread_Control *the_thread )
);
}
-static void _Thread_Add_to_zombie_chain( Thread_Control *the_thread )
+static void _Thread_Add_to_zombie_registry( Thread_Control *the_thread )
{
- ISR_lock_Context lock_context;
- Thread_Zombie_control *zombies;
+ ISR_lock_Context lock_context;
+ Thread_Zombie_registry *zombies;
zombies = &_Thread_Zombies;
_ISR_lock_ISR_disable_and_acquire( &zombies->Lock, &lock_context );
@@ -148,12 +145,12 @@ static void _Thread_Make_zombie( Thread_Control *the_thread )
* threads, so that they are able to clean up the thread immediately. This
* matters for SMP configurations.
*/
- _Thread_Add_to_zombie_chain( the_thread );
+ _Thread_Add_to_zombie_registry( the_thread );
_Thread_Wake_up_joining_threads( the_thread );
}
-static void _Thread_Wait_for_execution_stop( Thread_Control *the_thread )
+static void _Thread_Wait_for_execution_stop( const Thread_Control *the_thread )
{
#if defined(RTEMS_SMP)
/*
@@ -169,16 +166,21 @@ static void _Thread_Wait_for_execution_stop( Thread_Control *the_thread )
#endif
}
+static Thread_Control *_Thread_Get_zombie( Thread_Zombie_registry *zombies )
+{
+ return (Thread_Control *) _Chain_Get_unprotected( &zombies->Chain );
+}
+
void _Thread_Kill_zombies( void )
{
- ISR_lock_Context lock_context;
- Thread_Zombie_control *zombies = &_Thread_Zombies;
- Thread_Control *the_thread;
+ ISR_lock_Context lock_context;
+ Thread_Zombie_registry *zombies;
+ Thread_Control *the_thread;
+ zombies = &_Thread_Zombies;
_ISR_lock_ISR_disable_and_acquire( &zombies->Lock, &lock_context );
- the_thread = (Thread_Control *) _Chain_Get_unprotected( &zombies->Chain );
- while ( the_thread != NULL ) {
+ while ( ( the_thread = _Thread_Get_zombie( zombies ) ) != NULL ) {
Thread_Information *information;
_ISR_lock_Release_and_ISR_enable( &zombies->Lock, &lock_context );
@@ -188,8 +190,6 @@ void _Thread_Kill_zombies( void )
_Thread_Free( information, the_thread );
_ISR_lock_ISR_disable_and_acquire( &zombies->Lock, &lock_context );
-
- the_thread = (Thread_Control *) _Chain_Get_unprotected( &zombies->Chain );
}
_ISR_lock_Release_and_ISR_enable( &zombies->Lock, &lock_context );
@@ -576,7 +576,7 @@ Status_Control _Thread_Restart(
the_thread,
&the_thread->Real_priority,
the_thread->Start.initial_priority,
- false,
+ PRIORITY_GROUP_LAST,
&queue_context
);
_Thread_Wait_release( the_thread, &queue_context );
diff --git a/cpukit/version-vc-key.h.in b/cpukit/version-vc-key.h.in
deleted file mode 100644
index 738e24d19d..0000000000
--- a/cpukit/version-vc-key.h.in
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Automatically generated. Do not edit.
- */
-#if !defined(_RTEMS_VERSION_VC_KEY_H_)
-#define _RTEMS_VERSION_VC_KEY_H_
-@VERSION_VC_KEY@
-#endif