summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/Makefile.am1834
-rw-r--r--cpukit/aclocal/canonical-target-name.m425
-rw-r--r--cpukit/aclocal/canonicalize-tools.m413
-rw-r--r--cpukit/aclocal/check-func.m421
-rw-r--r--cpukit/aclocal/check-multiprocessing.m45
-rw-r--r--cpukit/aclocal/check-networking.m425
-rw-r--r--cpukit/aclocal/check-newlib.m428
-rw-r--r--cpukit/aclocal/check-posix.m419
-rw-r--r--cpukit/aclocal/check-rtems-debug.m45
-rw-r--r--cpukit/aclocal/check-smp.m418
-rw-r--r--cpukit/aclocal/check-tool.m49
-rw-r--r--cpukit/aclocal/enable-drvmgr.m412
-rw-r--r--cpukit/aclocal/enable-multiprocessing.m413
-rw-r--r--cpukit/aclocal/enable-networking.m412
-rw-r--r--cpukit/aclocal/enable-paravirt.m413
-rw-r--r--cpukit/aclocal/enable-posix.m421
-rw-r--r--cpukit/aclocal/enable-profiling.m49
-rw-r--r--cpukit/aclocal/enable-rtems-debug.m410
-rw-r--r--cpukit/aclocal/enable-smp.m417
-rw-r--r--cpukit/aclocal/env-rtemscpu.m46
-rw-r--r--cpukit/aclocal/gcc-pipe.m418
-rw-r--r--cpukit/aclocal/gcc-sanity.m4114
-rw-r--r--cpukit/aclocal/gcc-weak.m419
-rw-r--r--cpukit/aclocal/multi.m450
-rw-r--r--cpukit/aclocal/multilib.m414
-rw-r--r--cpukit/aclocal/prog-cc.m438
-rw-r--r--cpukit/aclocal/prog-ccas.m46
-rw-r--r--cpukit/aclocal/rtems-bsp-includes.m413
-rw-r--r--cpukit/aclocal/rtems-build-top.m412
-rw-r--r--cpukit/aclocal/rtems-includes.m423
-rw-r--r--cpukit/aclocal/rtems-source-top.m48
-rw-r--r--cpukit/aclocal/rtems-top.m470
-rw-r--r--cpukit/aclocal/version.m44
-rw-r--r--cpukit/automake/compile.am5
-rw-r--r--cpukit/automake/multilib.am34
-rw-r--r--cpukit/configure.ac387
-rw-r--r--cpukit/doxygen/appl-config.h51
-rw-r--r--cpukit/header-dirs.am82
-rw-r--r--cpukit/headers.am452
-rw-r--r--cpukit/include/rtems/confdefs/bsp.h15
-rw-r--r--cpukit/include/rtems/confdefs/extensions.h10
-rw-r--r--cpukit/include/rtems/confdefs/iodrivers.h62
-rw-r--r--cpukit/include/rtems/confdefs/malloc.h10
-rw-r--r--cpukit/include/rtems/confdefs/percpu.h27
-rw-r--r--cpukit/include/rtems/confdefs/wkspace.h16
-rw-r--r--cpukit/include/rtems/config.h18
-rw-r--r--cpukit/include/rtems/counter.h5
-rw-r--r--cpukit/include/rtems/cpuuse.h219
-rw-r--r--cpukit/include/rtems/malloc.h6
-rw-r--r--cpukit/include/rtems/mallocinitmulti.h100
-rw-r--r--cpukit/include/rtems/mallocinitone.h90
-rw-r--r--cpukit/include/rtems/posix/posixapi.h7
-rw-r--r--cpukit/include/rtems/posix/pthreadimpl.h15
-rw-r--r--cpukit/include/rtems/rtems/asr.h2
-rw-r--r--cpukit/include/rtems/rtems/asrdata.h4
-rw-r--r--cpukit/include/rtems/rtems/clock.h592
-rw-r--r--cpukit/include/rtems/rtems/message.h4
-rw-r--r--cpukit/include/rtems/rtems/modesimpl.h8
-rw-r--r--cpukit/include/rtems/rtems/ratemon.h7
-rw-r--r--cpukit/include/rtems/rtems/ratemonimpl.h10
-rw-r--r--cpukit/include/rtems/rtems/signal.h2
-rw-r--r--cpukit/include/rtems/rtems/tasks.h12
-rw-r--r--cpukit/include/rtems/score/basedefs.h2
-rw-r--r--cpukit/include/rtems/score/chainimpl.h11
-rw-r--r--cpukit/include/rtems/score/coremuteximpl.h34
-rw-r--r--cpukit/include/rtems/score/exception.h71
-rw-r--r--cpukit/include/rtems/score/hash.h2
-rw-r--r--cpukit/include/rtems/score/mrspimpl.h19
-rw-r--r--cpukit/include/rtems/score/objectdata.h2
-rw-r--r--cpukit/include/rtems/score/percpu.h31
-rw-r--r--cpukit/include/rtems/score/rbtreeimpl.h26
-rw-r--r--cpukit/include/rtems/score/scheduler.h165
-rw-r--r--cpukit/include/rtems/score/schedulercbs.h15
-rw-r--r--cpukit/include/rtems/score/scheduleredf.h5
-rw-r--r--cpukit/include/rtems/score/scheduleredfsmp.h48
-rw-r--r--cpukit/include/rtems/score/schedulerimpl.h483
-rw-r--r--cpukit/include/rtems/score/schedulernodeimpl.h21
-rw-r--r--cpukit/include/rtems/score/schedulerpriority.h5
-rw-r--r--cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h37
-rw-r--r--cpukit/include/rtems/score/schedulerprioritysmp.h40
-rw-r--r--cpukit/include/rtems/score/schedulerprioritysmpimpl.h35
-rw-r--r--cpukit/include/rtems/score/schedulersimple.h5
-rw-r--r--cpukit/include/rtems/score/schedulersimpleimpl.h13
-rw-r--r--cpukit/include/rtems/score/schedulersimplesmp.h39
-rw-r--r--cpukit/include/rtems/score/schedulersmp.h9
-rw-r--r--cpukit/include/rtems/score/schedulersmpimpl.h1032
-rw-r--r--cpukit/include/rtems/score/schedulerstrongapa.h67
-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/status.h2
-rw-r--r--cpukit/include/rtems/score/thread.h129
-rw-r--r--cpukit/include/rtems/score/threadcpubudget.h102
-rw-r--r--cpukit/include/rtems/score/threadimpl.h165
-rw-r--r--cpukit/include/rtems/score/threadmp.h13
-rw-r--r--cpukit/include/rtems/score/threadqimpl.h75
-rw-r--r--cpukit/include/rtems/score/timecounter.h24
-rw-r--r--cpukit/include/rtems/score/watchdogimpl.h55
-rw-r--r--cpukit/include/rtems/score/wkspace.h22
-rw-r--r--cpukit/include/rtems/score/wkspacedata.h10
-rw-r--r--cpukit/include/rtems/score/wkspaceinitmulti.h129
-rw-r--r--cpukit/include/rtems/score/wkspaceinitone.h113
-rw-r--r--cpukit/include/rtems/seterr.h10
-rw-r--r--cpukit/include/rtems/sysinit.h1
-rw-r--r--cpukit/libcsupport/src/__times.c3
-rw-r--r--cpukit/libcsupport/src/malloc_initialize.c81
-rw-r--r--cpukit/libcsupport/src/mallocheap.c2
-rw-r--r--cpukit/libcsupport/src/posix_devctl.c80
-rw-r--r--cpukit/libdebugger/rtems-debugger-aarch64.c1884
-rw-r--r--cpukit/libdebugger/rtems-debugger-i386.c12
-rw-r--r--cpukit/libdebugger/rtems-debugger-server.c32
-rw-r--r--cpukit/libdebugger/rtems-debugger-target.c4
-rw-r--r--cpukit/libdebugger/rtems-debugger-target.h12
-rw-r--r--cpukit/libdebugger/rtems-debugger-threads.c6
-rw-r--r--cpukit/libdebugger/rtems-debugger-threads.h10
-rw-r--r--cpukit/libdl/rtl-mdreloc-h8300.c212
-rw-r--r--cpukit/libmisc/cpuuse/cpuusagereport.c2
-rw-r--r--cpukit/libmisc/cpuuse/cpuusagereset.c3
-rw-r--r--cpukit/libmisc/cpuuse/cpuusagetop.c2
-rw-r--r--cpukit/libtest/t-test-interrupt.c9
-rw-r--r--cpukit/libtest/t-test-time.c45
-rw-r--r--cpukit/libtest/testbusy.c4
-rw-r--r--cpukit/posix/src/psignalunblockthread.c7
-rw-r--r--cpukit/posix/src/psxtransschedparam.c44
-rw-r--r--cpukit/posix/src/pthreadcreate.c36
-rw-r--r--cpukit/posix/src/pthreadgetattrnp.c16
-rw-r--r--cpukit/posix/src/pthreadgetschedparam.c14
-rw-r--r--cpukit/posix/src/pthreadsetschedparam.c24
-rw-r--r--cpukit/rtems/src/clockgettod.c31
-rw-r--r--cpukit/rtems/src/clockgettodtimeval.c6
-rw-r--r--cpukit/rtems/src/eventsurrender.c12
-rw-r--r--cpukit/rtems/src/ratemoncancel.c1
-rw-r--r--cpukit/rtems/src/ratemongetstatus.c28
-rw-r--r--cpukit/rtems/src/ratemonperiod.c25
-rw-r--r--cpukit/rtems/src/ratemontimeout.c4
-rw-r--r--cpukit/rtems/src/schedulergetprocessor.c54
-rw-r--r--cpukit/rtems/src/schedulergetprocessormax.c54
-rw-r--r--cpukit/rtems/src/schedulerremoveprocessor.c50
-rw-r--r--cpukit/rtems/src/semsetpriority.c50
-rw-r--r--cpukit/rtems/src/signalsend.c25
-rw-r--r--cpukit/rtems/src/taskconstruct.c9
-rw-r--r--cpukit/rtems/src/taskident.c3
-rw-r--r--cpukit/rtems/src/taskmode.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-default.S131
-rw-r--r--cpukit/score/cpu/aarch64/aarch64-exception-default.c59
-rw-r--r--cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S171
-rw-r--r--cpukit/score/cpu/aarch64/cpu.c20
-rw-r--r--cpukit/score/cpu/aarch64/cpu_asm.S78
-rw-r--r--cpukit/score/cpu/aarch64/include/libcpu/mmu-vmsav8-64.h97
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/asm.h5
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/score/aarch64-system-registers.h1112
-rw-r--r--cpukit/score/cpu/aarch64/include/rtems/score/cpu.h38
-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/arm/include/rtems/score/aarch32-pmsa.h38
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/cpu.h2
-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/no_cpu/include/rtems/score/cpu.h63
-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/cpu_asm.S12
-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/coremsginsert.c6
-rw-r--r--cpukit/score/src/coretodset.c8
-rw-r--r--cpukit/score/src/exceptionmapping.c104
-rw-r--r--cpukit/score/src/kern_tc.c733
-rw-r--r--cpukit/score/src/mpci.c1
-rw-r--r--cpukit/score/src/mutex.c16
-rw-r--r--cpukit/score/src/rbtreeappend.c58
-rw-r--r--cpukit/score/src/rbtreeprepend.c58
-rw-r--r--cpukit/score/src/schedulercbs.c41
-rw-r--r--cpukit/score/src/schedulercbsattachthread.c5
-rw-r--r--cpukit/score/src/schedulercbsdetachthread.c20
-rw-r--r--cpukit/score/src/schedulercbsgetexecutiontime.c2
-rw-r--r--cpukit/score/src/schedulercbsgetremainingbudget.c2
-rw-r--r--cpukit/score/src/schedulercbsreleasejob.c2
-rw-r--r--cpukit/score/src/schedulercbsunblock.c2
-rw-r--r--cpukit/score/src/schedulerdefaultaskforhelp.c61
-rw-r--r--cpukit/score/src/schedulerdefaultmakecleansticky.c52
-rw-r--r--cpukit/score/src/schedulerdefaultpinunpin.c31
-rw-r--r--cpukit/score/src/schedulerdefaultpinunpindonothing.c73
-rw-r--r--cpukit/score/src/schedulerdefaulttick.c81
-rw-r--r--cpukit/score/src/scheduleredfsmp.c349
-rw-r--r--cpukit/score/src/schedulerpriorityaffinitysmp.c89
-rw-r--r--cpukit/score/src/schedulerprioritysmp.c73
-rw-r--r--cpukit/score/src/schedulersimplesmp.c96
-rw-r--r--cpukit/score/src/schedulersmp.c29
-rw-r--r--cpukit/score/src/schedulerstrongapa.c162
-rw-r--r--cpukit/score/src/stackallocatorforidle.c65
-rw-r--r--cpukit/score/src/threadchangepriority.c136
-rw-r--r--cpukit/score/src/threadcreateidle.c13
-rw-r--r--cpukit/score/src/threaddispatch.c13
-rw-r--r--cpukit/score/src/threadexhausttimeslice.c53
-rw-r--r--cpukit/score/src/threadgetcputimeused.c32
-rw-r--r--cpukit/score/src/threadgetcputimeusedafterreset.c71
-rw-r--r--cpukit/score/src/threadinitialize.c194
-rw-r--r--cpukit/score/src/threadloadenv.c11
-rw-r--r--cpukit/score/src/threadqenqueue.c223
-rw-r--r--cpukit/score/src/threadqextract.c57
-rw-r--r--cpukit/score/src/threadqextractwithproxy.c46
-rw-r--r--cpukit/score/src/threadqops.c20
-rw-r--r--cpukit/score/src/threadresettimeslice.c91
-rw-r--r--cpukit/score/src/threadrestart.c12
-rw-r--r--cpukit/score/src/threadscheduler.c58
-rw-r--r--cpukit/score/src/threadtimeout.c8
-rw-r--r--cpukit/score/src/userextremoveset.c2
-rw-r--r--cpukit/score/src/watchdogtick.c25
-rw-r--r--cpukit/score/src/wkspace.c125
-rw-r--r--cpukit/score/src/wkspaceallocate.c47
-rw-r--r--cpukit/score/src/wkspacefree.c51
-rw-r--r--cpukit/version-vc-key.h.in7
236 files changed, 11189 insertions, 6566 deletions
diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
deleted file mode 100644
index e8579f6338..0000000000
--- a/cpukit/Makefile.am
+++ /dev/null
@@ -1,1834 +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/confstr.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/rbtreemax.c
-librtemscpu_a_SOURCES += score/src/rbtreemin.c
-librtemscpu_a_SOURCES += score/src/rbtreenext.c
-librtemscpu_a_SOURCES += score/src/rbtreepostorder.c
-librtemscpu_a_SOURCES += score/src/rbtreeprev.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/threadplaindispatch.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/coretodadjust.c
-librtemscpu_a_SOURCES += score/src/coretodcheck.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/aclocal/canonical-target-name.m4 b/cpukit/aclocal/canonical-target-name.m4
deleted file mode 100644
index d3c2531cda..0000000000
--- a/cpukit/aclocal/canonical-target-name.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl canonicalize target cpu
-dnl NOTE: Most rtems targets do not fullfil autoconf's
-dnl target naming conventions "processor-vendor-os"
-dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
-dnl and we have to fix it for rtems ourselves
-
-AC_DEFUN([RTEMS_CANONICAL_TARGET_CPU],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_MSG_CHECKING(rtems target cpu)
-case "${host}" in
-riscv*-*-rtems*)
- RTEMS_CPU=riscv;;
-*-*-rtems*)
- RTEMS_CPU="$host_cpu";;
-*)
- ;;
-esac
-AS_IF([test -n "$RTEMS_CPU"],
-[dnl
-AC_MSG_RESULT($RTEMS_CPU)],
-[dnl
-AC_MSG_RESULT([<none>])
-AC_MSG_ERROR([unsupported host $host])])
-AC_SUBST(RTEMS_CPU)
-])
diff --git a/cpukit/aclocal/canonicalize-tools.m4 b/cpukit/aclocal/canonicalize-tools.m4
deleted file mode 100644
index 5795c1ecae..0000000000
--- a/cpukit/aclocal/canonicalize-tools.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-dnl
-dnl Set target tools
-dnl
-
-AC_DEFUN([RTEMS_CANONICALIZE_TOOLS],
-[AC_REQUIRE([RTEMS_PROG_CC])dnl
-
-dnl FIXME: What shall be done if these tools are not available?
- RTEMS_CHECK_TOOL(AR,ar,no)
-
-dnl special treatment of ranlib
- RTEMS_CHECK_TOOL(RANLIB,ranlib,:)
-])
diff --git a/cpukit/aclocal/check-func.m4 b/cpukit/aclocal/check-func.m4
deleted file mode 100644
index 36d700bcdd..0000000000
--- a/cpukit/aclocal/check-func.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-# Check whether FUNCTION is declared in INCLUDES
-# and whether rtems_stub_FUNCTION or FUNCTION is supplied.
-
-# RTEMS_CHECK_FUNC(FUNCTION[,INCLUDES])
-AC_DEFUN([RTEMS_CHECK_FUNC],
-[AC_REQUIRE([RTEMS_CHECK_NEWLIB])
-AC_CHECK_DECLS([$1],,,[$2])
-
-AC_CACHE_CHECK([for $1],[ac_cv_$1],[
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[$2]],[[rtems_stub_$1()]])],
- [ac_cv_$1="stub"],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[$2]],[[$1()]])],
- [ac_cv_$1="yes"],
- [ac_cv_$1="no"])
- ])
- ])
-AS_IF([test "$ac_cv_$1" = yes],
- [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]$1),[1],[Define to 1 if you have the `$1' function.])])
-])
diff --git a/cpukit/aclocal/check-multiprocessing.m4 b/cpukit/aclocal/check-multiprocessing.m4
deleted file mode 100644
index 1698d3d51f..0000000000
--- a/cpukit/aclocal/check-multiprocessing.m4
+++ /dev/null
@@ -1,5 +0,0 @@
-AC_DEFUN([RTEMS_CHECK_MULTIPROCESSING],
-[dnl
-AC_REQUIRE([RTEMS_ENV_RTEMSCPU])dnl
-AC_REQUIRE([RTEMS_ENABLE_MULTIPROCESSING])dnl
-])
diff --git a/cpukit/aclocal/check-networking.m4 b/cpukit/aclocal/check-networking.m4
deleted file mode 100644
index 7f38875dc6..0000000000
--- a/cpukit/aclocal/check-networking.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl
-AC_DEFUN([RTEMS_CHECK_NETWORKING],
-[dnl
-AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl
-AC_REQUIRE([RTEMS_ENABLE_NETWORKING])dnl
-AC_REQUIRE([RTEMS_INCLUDES])dnl
-
-AC_CACHE_CHECK([whether CPU supports networking],
- rtems_cv_HAS_NETWORKING,
- [dnl
- case "$host" in
- # Newer architecture ports that should only use new TCP/IP stack
- x86_64*)
- rtems_cv_HAS_NETWORKING="no"
- ;;
- *)
- AS_IF([test "${RTEMS_HAS_NETWORKING}" = "yes"],
- [rtems_cv_HAS_NETWORKING="yes"
- RTEMS_CPPFLAGS="${RTEMS_CPPFLAGS} -I${RTEMS_SOURCE_ROOT}/cpukit/libnetworking"],
- [rtems_cv_HAS_NETWORKING="no"])
- ;;
- esac
- ])
- ])
-])
diff --git a/cpukit/aclocal/check-newlib.m4 b/cpukit/aclocal/check-newlib.m4
deleted file mode 100644
index f23a90c7c7..0000000000
--- a/cpukit/aclocal/check-newlib.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-AC_DEFUN([RTEMS_CHECK_NEWLIB],
-[dnl
-AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnl
-AC_REQUIRE([RTEMS_CANONICALIZE_TOOLS])dnl
-AC_CACHE_CHECK([for RTEMS newlib],
- rtems_cv_use_newlib,
- [
-dnl some versions of newlib provide not_required_by_rtems
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[extern void not_required_by_rtems() ;]],
- [[not_required_by_rtems()]])],
- [rtems_cv_use_newlib="yes"],[])
-
-dnl some versions of newlib provide rtems_provides_crt0()
- AS_IF([test -z "$rtems_cv_use_newlib"],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[extern void rtems_provides_crt0() ;]],
- [[rtems_provides_crt0()]])],
- [rtems_cv_use_newlib="yes"],[rtems_cv_use_newlib="no"])
- ])
- ])
- RTEMS_USE_NEWLIB="$rtems_cv_use_newlib"
- AC_SUBST(RTEMS_USE_NEWLIB)
-
- AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],
- [ AC_DEFINE_UNQUOTED(RTEMS_NEWLIB,1,[if using newlib])]
- )
-])
diff --git a/cpukit/aclocal/check-posix.m4 b/cpukit/aclocal/check-posix.m4
deleted file mode 100644
index ad1d1c87da..0000000000
--- a/cpukit/aclocal/check-posix.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl
-AC_DEFUN([RTEMS_CHECK_POSIX_API],
-[dnl
-AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl
-AC_REQUIRE([RTEMS_ENABLE_POSIX])dnl
-
-AC_CACHE_CHECK([whether CPU supports libposix],
- rtems_cv_HAS_POSIX_API,
- [dnl
- case "$host" in
- *-*-rtems*)
- if test "${RTEMS_HAS_POSIX_API}" = "yes"; then
- rtems_cv_HAS_POSIX_API="yes";
- else
- rtems_cv_HAS_POSIX_API="disabled";
- fi
- ;;
- esac])
-])
diff --git a/cpukit/aclocal/check-rtems-debug.m4 b/cpukit/aclocal/check-rtems-debug.m4
deleted file mode 100644
index 280edccd65..0000000000
--- a/cpukit/aclocal/check-rtems-debug.m4
+++ /dev/null
@@ -1,5 +0,0 @@
-AC_DEFUN([RTEMS_CHECK_RTEMS_DEBUG],
-[AC_REQUIRE([RTEMS_ENABLE_RTEMS_DEBUG])
-AS_IF([test x"${enable_rtems_debug}" = x"yes"],
- [AC_DEFINE_UNQUOTED(RTEMS_DEBUG,1,[if RTEMS_DEBUG is enabled])])
-])
diff --git a/cpukit/aclocal/check-smp.m4 b/cpukit/aclocal/check-smp.m4
deleted file mode 100644
index a0c8b819fb..0000000000
--- a/cpukit/aclocal/check-smp.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-dnl
-AC_DEFUN([RTEMS_CHECK_SMP],
-[dnl
-AC_REQUIRE([RTEMS_ENABLE_SMP])dnl
-
-AC_CACHE_CHECK([whether CPU supports SMP],
- rtems_cv_HAS_SMP,
- [dnl
- case "$RTEMS_CPU" in
- *)
- if test "${RTEMS_HAS_SMP}" = "yes"; then
- rtems_cv_HAS_SMP="yes";
- else
- rtems_cv_HAS_SMP="disabled";
- fi
- ;;
- esac])
-])
diff --git a/cpukit/aclocal/check-tool.m4 b/cpukit/aclocal/check-tool.m4
deleted file mode 100644
index 2bc137cd96..0000000000
--- a/cpukit/aclocal/check-tool.m4
+++ /dev/null
@@ -1,9 +0,0 @@
-## Check for a cross tool, similar to AC_CHECK_TOOL, but do not fall back to
-## the un-prefixed version of PROG-TO-CHECK-FOR.
-dnl RTEMS_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN([RTEMS_CHECK_TOOL],
-[
- AS_IF([test "x$build_alias" != "x$host_alias"],
- [rtems_tool_prefix=${ac_tool_prefix}])
- AC_CHECK_PROG($1, ${rtems_tool_prefix}$2, ${rtems_tool_prefix}$2, $3, $4)
-])
diff --git a/cpukit/aclocal/enable-drvmgr.m4 b/cpukit/aclocal/enable-drvmgr.m4
deleted file mode 100644
index a9da288b11..0000000000
--- a/cpukit/aclocal/enable-drvmgr.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-dnl $Id: enable-drvmgr.m4,v 1.0
-
-AC_DEFUN([RTEMS_ENABLE_DRVMGR],
-[
-AC_ARG_ENABLE(drvmgr,
-AS_HELP_STRING(--enable-drvmgr,enable drvmgr at startup),
-[case "${enableval}" in
- yes) RTEMS_DRVMGR_STARTUP=yes ;;
- no) RTEMS_DRVMGR_STARTUP=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-drvmgr option) ;;
-esac],[RTEMS_DRVMGR_STARTUP=yes])
-])
diff --git a/cpukit/aclocal/enable-multiprocessing.m4 b/cpukit/aclocal/enable-multiprocessing.m4
deleted file mode 100644
index 53fa8ffe81..0000000000
--- a/cpukit/aclocal/enable-multiprocessing.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-AC_DEFUN([RTEMS_ENABLE_MULTIPROCESSING],
-[
-AC_ARG_ENABLE(multiprocessing,
-[AS_HELP_STRING([--enable-multiprocessing],
-[enable multiprocessing interface; the multiprocessing interface is a
-communication interface between different RTEMS instances and allows
-synchronization of objects via message passing])],
-[case "${enable_multiprocessing}" in
- yes) ;;
- no) ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;
-esac],[enable_multiprocessing=no])
-])
diff --git a/cpukit/aclocal/enable-networking.m4 b/cpukit/aclocal/enable-networking.m4
deleted file mode 100644
index d9b50ef208..0000000000
--- a/cpukit/aclocal/enable-networking.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-AC_DEFUN([RTEMS_ENABLE_NETWORKING],
-[
-## AC_BEFORE([$0], [RTEMS_CHECK_NETWORKING])dnl
-
-AC_ARG_ENABLE(networking,
-AS_HELP_STRING(--enable-networking,enable TCP/IP stack),
-[case "${enableval}" in
- yes) RTEMS_HAS_NETWORKING=yes ;;
- no) RTEMS_HAS_NETWORKING=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;;
-esac],[RTEMS_HAS_NETWORKING=yes])
-])
diff --git a/cpukit/aclocal/enable-paravirt.m4 b/cpukit/aclocal/enable-paravirt.m4
deleted file mode 100644
index b3ef97edad..0000000000
--- a/cpukit/aclocal/enable-paravirt.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-AC_DEFUN([RTEMS_ENABLE_PARAVIRT],
-[
-
-AC_ARG_ENABLE(paravirt,
-[AS_HELP_STRING([--enable-paravirt],[enable support for paravirtualization
-(default=no)])],
-
-[case "${enableval}" in
- yes) RTEMS_HAS_PARAVIRT=yes ;;
- no) RTEMS_HAS_PARAVIRT=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-paravirt option) ;;
-esac],[RTEMS_HAS_PARAVIRT=no])
-])
diff --git a/cpukit/aclocal/enable-posix.m4 b/cpukit/aclocal/enable-posix.m4
deleted file mode 100644
index c1833950e3..0000000000
--- a/cpukit/aclocal/enable-posix.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-AC_DEFUN([RTEMS_ENABLE_POSIX],
-[
-## AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl
-
-AC_ARG_ENABLE(posix,
-AS_HELP_STRING(--enable-posix,enable posix interface),
-[case "${enableval}" in
- yes) RTEMS_HAS_POSIX_API=yes ;;
- no) RTEMS_HAS_POSIX_API=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
-esac],[RTEMS_HAS_POSIX_API=yes])
-
-case "${host}" in
- no_cpu-*rtems*)
- RTEMS_HAS_POSIX_API=no
- ;;
- *)
- ;;
-esac
-AC_SUBST(RTEMS_HAS_POSIX_API)
-])
diff --git a/cpukit/aclocal/enable-profiling.m4 b/cpukit/aclocal/enable-profiling.m4
deleted file mode 100644
index b363ae28c6..0000000000
--- a/cpukit/aclocal/enable-profiling.m4
+++ /dev/null
@@ -1,9 +0,0 @@
-AC_DEFUN([RTEMS_ENABLE_PROFILING],
- [AC_ARG_ENABLE(profiling,
- [AS_HELP_STRING([--enable-profiling],[enable support for profiling (default=no)])],
- [case "${enableval}" in
- yes) RTEMS_HAS_PROFILING=yes ;;
- no) RTEMS_HAS_PROFILING=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable profiling option) ;;
- esac],
- [RTEMS_HAS_PROFILING=no])])
diff --git a/cpukit/aclocal/enable-rtems-debug.m4 b/cpukit/aclocal/enable-rtems-debug.m4
deleted file mode 100644
index ba4a4f2111..0000000000
--- a/cpukit/aclocal/enable-rtems-debug.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-AC_DEFUN([RTEMS_ENABLE_RTEMS_DEBUG],
-[
-AC_ARG_ENABLE(rtems-debug,
-AS_HELP_STRING(--enable-rtems-debug,enable RTEMS_DEBUG),
-[case "${enable_rtems_debug}" in
- yes) enable_rtems_debug=yes ;;
- no) enable_rtems_debug=no ;;
- *) AC_MSG_ERROR([bad value ${enable_rtems_debug} for RTEMS_DEBUG]) ;;
-esac],[enable_rtems_debug=no])
-])
diff --git a/cpukit/aclocal/enable-smp.m4 b/cpukit/aclocal/enable-smp.m4
deleted file mode 100644
index 1448a2e5eb..0000000000
--- a/cpukit/aclocal/enable-smp.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-AC_DEFUN([RTEMS_ENABLE_SMP],
-[
-## AC_BEFORE([$0], [RTEMS_CHECK_SMP])dnl
-
-AC_ARG_ENABLE(smp,
-[AS_HELP_STRING([--enable-smp],[enable support for symmetric multiprocessing
-(SMP)])],
-[case "${enableval}" in
- yes) case "${RTEMS_CPU}" in
- arm|powerpc|riscv*|sparc|i386) RTEMS_HAS_SMP=yes ;;
- *) RTEMS_HAS_SMP=no ;;
- esac
- ;;
- no) RTEMS_HAS_SMP=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-smp option) ;;
-esac],[RTEMS_HAS_SMP=no])
-])
diff --git a/cpukit/aclocal/env-rtemscpu.m4 b/cpukit/aclocal/env-rtemscpu.m4
deleted file mode 100644
index 7c18e3f521..0000000000
--- a/cpukit/aclocal/env-rtemscpu.m4
+++ /dev/null
@@ -1,6 +0,0 @@
-AC_DEFUN([RTEMS_ENV_RTEMSCPU],
-[
- AC_REQUIRE([RTEMS_ENABLE_MULTILIB])
-
- AM_CONDITIONAL([MULTILIB],[test x"$multilib" = x"yes"])
-])
diff --git a/cpukit/aclocal/gcc-pipe.m4 b/cpukit/aclocal/gcc-pipe.m4
deleted file mode 100644
index fbc78b9ca7..0000000000
--- a/cpukit/aclocal/gcc-pipe.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-dnl Check whether the target compiler accepts -pipe
-dnl
-
-AC_DEFUN([RTEMS_GCC_PIPE],
-[AC_REQUIRE([RTEMS_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_CACHE_CHECK(whether $CC accepts --pipe,rtems_cv_gcc_pipe,
-[
-rtems_cv_gcc_pipe=no
-if test x"$GCC" = x"yes"; then
- echo 'void f(){}' >conftest.c
- if test -z "`${CC} --pipe -c conftest.c 2>&1`";then
- rtems_cv_gcc_pipe=yes
- fi
- rm -f conftest*
-fi
-])
-])
diff --git a/cpukit/aclocal/gcc-sanity.m4 b/cpukit/aclocal/gcc-sanity.m4
deleted file mode 100644
index 0177009e28..0000000000
--- a/cpukit/aclocal/gcc-sanity.m4
+++ /dev/null
@@ -1,114 +0,0 @@
-# Some GCC sanity checks to check for known bugs in the rtems gcc toolchains
-
-# Internal macro
-# _RTEMS_GCC_WARNING(msg,cache-variable,include,main)
-AC_DEFUN([_RTEMS_GCC_WARNING],[
- AC_CACHE_CHECK([$1],
- [$2],[
- AS_IF([test x"$GCC" = xyes],[
- save_CFLAGS=$CFLAGS
- CFLAGS="-Wall -Werror"])
-
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([$3],[$4])],
- [$2=yes],
- [$2=no])
-
- AS_IF([test x"$GCC" = xyes],[
- CFLAGS=$save_CFLAGS])
- ])
-])
-
-AC_DEFUN([RTEMS_CHECK_GCC_PRIxPTR],[
- _RTEMS_GCC_WARNING(
- [if printf("%" PRIxPTR, uintptr_t) works],
- [rtems_cv_PRIxPTR],[
- #include <inttypes.h>
- #include <stdio.h>
- ],[
- uintptr_t ptr = 42;
- printf("%" PRIxPTR "\n", ptr);
- ])
-])
-
-AC_DEFUN([RTEMS_CHECK_GCC_PRIuPTR],[
- _RTEMS_GCC_WARNING(
- [if printf("%" PRIuPTR, uintptr_t) works],
- [rtems_cv_PRIuPTR],[
- #include <inttypes.h>
- #include <stdio.h>
- ],[
- uintptr_t ptr = 42;
- printf("%" PRIuPTR "\n", ptr);
- ])
-])
-
-AC_DEFUN([RTEMS_CHECK_GCC_PRIdPTR],[
- _RTEMS_GCC_WARNING(
- [if printf("%" PRIdPTR, intptr_t) works],
- [rtems_cv_PRIdPTR],[
- #include <inttypes.h>
- #include <stdio.h>
- ],[
- intptr_t ptr = -1;
- printf("%" PRIdPTR "\n", ptr);
- ])
-])
-
-AC_DEFUN([RTEMS_CHECK_GCC_PRINTF_ZU_SIZE_T],[
- _RTEMS_GCC_WARNING(
- [if printf("%zu", size_t) works],
- [rtems_cv_PRINTF_ZU_SIZE_T],[
- #include <sys/types.h>
- #include <stdio.h>
- ],[
- size_t sz = 1;
- printf("%zu\n", sz);
- ])
-])
-
-AC_DEFUN([RTEMS_CHECK_GCC_PRINTF_ZD_SSIZE_T],[
- _RTEMS_GCC_WARNING(
- [if printf("%zd", ssize_t) works],
- [rtems_cv_PRINTF_ZD_SSIZE_T],[
- #include <sys/types.h>
- #include <stdio.h>
- ],[
- ssize_t sz = 1;
- printf("%zd\n", sz);
- ])
-])
-
-AC_DEFUN([RTEMS_CHECK_GCC_PRINTF_LD_OFF_T],[
- _RTEMS_GCC_WARNING(
- [if printf("%ld", off_t) works],
- [rtems_cv_PRINTF_LD_OFF_T],[
- #include <sys/types.h>
- #include <stdio.h>
- ],[
- off_t off = 1;
- printf("%ld\n", off);
- ])
-])
-
-AC_DEFUN([RTEMS_CHECK_GCC_PRINTF_LLD_OFF_T],[
- _RTEMS_GCC_WARNING(
- [if printf("%lld", off_t) works],
- [rtems_cv_PRINTF_LLD_OFF_T],[
- #include <sys/types.h>
- #include <stdio.h>
- ],[
- off_t off = 1;
- printf("%lld\n", off);
- ])
-])
-
-AC_DEFUN([RTEMS_CHECK_GCC_SANITY],[
-RTEMS_CHECK_GCC_PRIxPTR
-RTEMS_CHECK_GCC_PRIuPTR
-RTEMS_CHECK_GCC_PRIdPTR
-RTEMS_CHECK_GCC_PRINTF_ZU_SIZE_T
-RTEMS_CHECK_GCC_PRINTF_ZD_SSIZE_T
-RTEMS_CHECK_GCC_PRINTF_LD_OFF_T
-RTEMS_CHECK_GCC_PRINTF_LLD_OFF_T
-])
diff --git a/cpukit/aclocal/gcc-weak.m4 b/cpukit/aclocal/gcc-weak.m4
deleted file mode 100644
index 73cfb28e7e..0000000000
--- a/cpukit/aclocal/gcc-weak.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-AC_DEFUN([RTEMS_CHECK_GCC_WEAK],[
-AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))],
-[rtems_cv_cc_attribute_weak],[
- AS_IF([test x"$GCC" = xyes],[
- save_CFLAGS=$CFLAGS
- CFLAGS=-Werror])
-
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(
- [void myfunc(char c) __attribute__ ((weak));
- void myfunc(char c) {}],
- [])],
- [rtems_cv_cc_attribute_weak=yes],
- [rtems_cv_cc_attribute_weak=no])
-
- AS_IF([test x"$GCC" = xyes],[
- CFLAGS=$save_CFLAGS])
-])
-])
diff --git a/cpukit/aclocal/multi.m4 b/cpukit/aclocal/multi.m4
deleted file mode 100644
index 7cdc3cb023..0000000000
--- a/cpukit/aclocal/multi.m4
+++ /dev/null
@@ -1,50 +0,0 @@
-#serial 99
-
-AC_DEFUN([AC_ENABLE_MULTILIB],
-[
-AC_ARG_ENABLE(multilib,
-AS_HELP_STRING(--enable-multilib,build many library versions (default=no)),
-[case "${enableval}" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
- esac], [multilib=no])dnl
-
-AM_CONDITIONAL(MULTILIB,test x"${multilib}" = x"yes")
-
-dnl We may get other options which we don't document:
-dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
-
-if test "[$]{srcdir}" = "."; then
- if test "[$]{with_target_subdir}" != "."; then
- multilib_basedir="[$]{srcdir}/[$]{with_multisrctop}../ifelse([$2],,,[$2])"
- else
- multilib_basedir="[$]{srcdir}/[$]{with_multisrctop}ifelse([$2],,,[$2])"
- fi
-else
- multilib_basedir="[$]{srcdir}/ifelse([$2],,,[$2])"
-fi
-AC_SUBST(multilib_basedir)
-
-if test "${multilib}" = "yes"; then
- multilib_arg="--enable-multilib"
-else
- multilib_arg=
-fi
-
-AC_CONFIG_COMMANDS([default-1],[case " $CONFIG_FILES " in
- *" ]m4_if([$1],,Makefile,[$1])[ "*)
- ac_file=]m4_if([$1],,Makefile,[$1])[ . ${multilib_basedir}/config-ml.in
-esac],[
- srcdir=${srcdir}
- host=${host}
- target=${target}
- with_multisrctop="${with_multisrctop}"
- with_target_subdir="${with_target_subdir}"
- with_multisubdir="${with_multisubdir}"
- ac_configure_args="${multilib_arg} ${ac_configure_args}"
- CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- multilib_basedir=${multilib_basedir}
- CC="${CC}"
-])
-])
diff --git a/cpukit/aclocal/multilib.m4 b/cpukit/aclocal/multilib.m4
deleted file mode 100644
index 90e6217780..0000000000
--- a/cpukit/aclocal/multilib.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl This provides configure definitions used for multilib support
-
-AC_DEFUN([RTEMS_ENABLE_MULTILIB],
-[
-AC_ARG_ENABLE(multilib,
-AS_HELP_STRING(--enable-multilib,build many library versions (default=no)),
-[case "${enableval}" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
- esac], [multilib=no])dnl
-
-AM_CONDITIONAL([MULTILIB],[test x"${multilib}" = x"yes"])
-])
diff --git a/cpukit/aclocal/prog-cc.m4 b/cpukit/aclocal/prog-cc.m4
deleted file mode 100644
index 9006e0e53a..0000000000
--- a/cpukit/aclocal/prog-cc.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl
-dnl Check for target gcc
-dnl
-
-AC_DEFUN([RTEMS_PROG_CC],
-[
-AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_BEFORE([$0], [AC_PROG_CC])dnl
-AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
-
-RTEMS_CHECK_TOOL(CC,gcc)
-test -z "$CC" && \
- AC_MSG_ERROR([no acceptable cc found in \$PATH])
-AC_PROG_CC
-AC_PROG_CPP
-])
-
-AC_DEFUN([RTEMS_PROG_CC_FOR_TARGET],
-[
-# Was CFLAGS set?
-rtems_cv_CFLAGS_set="${CFLAGS+set}"
-dnl check target cc
-RTEMS_PROG_CC
-dnl check if the target compiler may use --pipe
-RTEMS_GCC_PIPE
-test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe"
-
-# Append warning flags if CFLAGS wasn't set.
-AS_IF([test "$GCC" = yes && test "$rtems_cv_CFLAGS_set" != set],
-[CFLAGS="$CFLAGS -Wall -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs"])
-
-AS_IF([test "$GCC" = yes],[
- RTEMS_RELLDFLAGS="-qnolinkcmds -nostdlib -r"
-])
-AC_SUBST(RTEMS_RELLDFLAGS)
-
-RTEMS_INCLUDES
-])
diff --git a/cpukit/aclocal/prog-ccas.m4 b/cpukit/aclocal/prog-ccas.m4
deleted file mode 100644
index c30b884e19..0000000000
--- a/cpukit/aclocal/prog-ccas.m4
+++ /dev/null
@@ -1,6 +0,0 @@
-AC_DEFUN([RTEMS_PROG_CCAS],
-[
-AC_REQUIRE([RTEMS_PROG_CC])
-AM_PROG_AS
-AC_SUBST(RTEMS_CCASFLAGS,["-DASM \$(CFLAGS)"])
-])
diff --git a/cpukit/aclocal/rtems-bsp-includes.m4 b/cpukit/aclocal/rtems-bsp-includes.m4
deleted file mode 100644
index 2248211192..0000000000
--- a/cpukit/aclocal/rtems-bsp-includes.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-dnl
-dnl RTEMS Include paths.
-dnl
-AC_DEFUN([RTEMS_BSP_INCLUDES],
-[
-AC_REQUIRE([RTEMS_SOURCE_TOP])
-AC_REQUIRE([RTEMS_BUILD_TOP])
-RTEMS_BSP_CPPFLAGS="-I${RTEMS_BUILD_ROOT}/lib/libbsp/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/include \
--I${RTEMS_SOURCE_ROOT}/bsps/include \
--I${RTEMS_SOURCE_ROOT}/bsps/\$(RTEMS_CPU)/include \
--I${RTEMS_SOURCE_ROOT}/bsps/\$(RTEMS_CPU)/\$(RTEMS_BSP_FAMILY)/include"
-AC_SUBST([RTEMS_BSP_CPPFLAGS])
-])
diff --git a/cpukit/aclocal/rtems-build-top.m4 b/cpukit/aclocal/rtems-build-top.m4
deleted file mode 100644
index 5708119c14..0000000000
--- a/cpukit/aclocal/rtems-build-top.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-dnl
-dnl RTEMS_BUILD_TOP($1)
-dnl
-AC_DEFUN([RTEMS_BUILD_TOP],
-[dnl
-#
-# This is a copy of the horrible hack in rtems-top.m4 and it is simpler to
-# copy it that attempt to clean this crap up.
-#
-RTEMS_BUILD_ROOT="${with_rtems_build_top}"
-AC_SUBST([RTEMS_BUILD_ROOT])
-])dnl
diff --git a/cpukit/aclocal/rtems-includes.m4 b/cpukit/aclocal/rtems-includes.m4
deleted file mode 100644
index ca4ebed581..0000000000
--- a/cpukit/aclocal/rtems-includes.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-dnl
-dnl RTEMS Include paths.
-dnl
-AC_DEFUN([RTEMS_INCLUDES],
-[
-AC_REQUIRE([RTEMS_SOURCE_TOP])
-AC_REQUIRE([RTEMS_BUILD_TOP])
-
-# Was CFLAGS set?
-rtems_cv_CFLAGS_set="${CFLAGS+set}"
-
-RTEMS_INCLUDE_CPUKIT="-I${RTEMS_SOURCE_ROOT}/cpukit/include"
-RTEMS_INCLUDE_CPUKIT_ARCH="-I${RTEMS_SOURCE_ROOT}/cpukit/score/cpu/\$(RTEMS_CPU)/include"
-
-RTEMS_CPUKIT_INCLUDE="${RTEMS_INCLUDE_CPUKIT} ${RTEMS_INCLUDE_CPUKIT_ARCH}"
-RTEMS_BUILD_INCLUDE="-I\$(top_builddir) -I${RTEMS_BUILD_ROOT}/include"
-
-RTEMS_INCLUDE="${RTEMS_BUILD_INCLUDE} ${RTEMS_CPUKIT_INCLUDE}"
-
-RTEMS_CPPFLAGS="${RTEMS_INCLUDE}"
-
-AC_SUBST([RTEMS_CPPFLAGS])
-])
diff --git a/cpukit/aclocal/rtems-source-top.m4 b/cpukit/aclocal/rtems-source-top.m4
deleted file mode 100644
index d1460ae82d..0000000000
--- a/cpukit/aclocal/rtems-source-top.m4
+++ /dev/null
@@ -1,8 +0,0 @@
-dnl
-dnl RTEMS_SOURCE_TOP
-dnl
-AC_DEFUN([RTEMS_SOURCE_TOP],
-[dnl
-RTEMS_SOURCE_ROOT="${with_rtems_source_top}"
-AC_SUBST([RTEMS_SOURCE_ROOT])
-])dnl
diff --git a/cpukit/aclocal/rtems-top.m4 b/cpukit/aclocal/rtems-top.m4
deleted file mode 100644
index b0cdaaa4d7..0000000000
--- a/cpukit/aclocal/rtems-top.m4
+++ /dev/null
@@ -1,70 +0,0 @@
-# AC_DISABLE_OPTION_CHECKING is not available before 2.62
-AC_PREREQ(2.62)
-
-dnl
-dnl RTEMS_TOP($1)
-dnl
-dnl $1 .. relative path from this configure.ac to the toplevel configure.ac
-dnl
-AC_DEFUN([RTEMS_TOP],
-[dnl
-AC_REQUIRE([RTEMS_VERSIONING])
-AC_REQUIRE([AM_SET_LEADING_DOT])
-AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])
-AC_CONFIG_AUX_DIR([$1])
-AC_CHECK_PROGS(MAKE, gmake make)
-AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
-
-AC_PREFIX_DEFAULT([/opt/rtems-][_RTEMS_API])
-
-AC_SUBST([RTEMS_TOPdir],["$1"])
-
-# HACK: The sed pattern below strips of "../", corresponding to "cpukit/"
-rtems_updir=m4_if([$2],[],[`echo "$1/" | sed 's,^\.\.\/,,'`],[$2/])
-
-AS_IF([test -n "$with_multisubdir"],
- [MULTIBUILDTOP=`echo "/$with_multisubdir" | sed 's,/[[^\\/]]*,../,g'`])
-AC_SUBST(MULTIBUILDTOP)
-
-AS_IF([test -n "$with_multisubdir"],
- [MULTISUBDIR="/$with_multisubdir"])
-AC_SUBST(MULTISUBDIR)
-
-AC_ARG_WITH([project-root],[
-AS_HELP_STRING(--with-project-root,directory to pre-install files into)],[
-## Make sure to have a terminating '/'
-case "${with_project_root}" in
-*/) ;;
-*) with_project_root="${with_project_root}/" ;;
-esac
-
-case "${with_project_root}" in
- [[\\/$]]* | ?:[[\\/]]* ) # absolute directory
- PROJECT_ROOT=${with_project_root}
- ;;
- *) # relative directory
- sav0dir=`pwd` && cd ./${rtems_updir}
- sav1dir=`pwd` && cd ../${MULTIBUILDTOP}
- sav2dir=`pwd` && cd "$sav0dir"
- mydir=`echo "$sav1dir" | sed "s,^$sav2dir${MULTISUBDIR}/,,"`
- PROJECT_ROOT='$(top_builddir)'/${rtems_updir}'../$(MULTIBUILDTOP)'${mydir}/${with_project_root}
- ;;
-esac],[
-## Defaults: Note: Two different defaults!
-## ../ for multilib
-## '.' for non-multilib
-AS_IF([test "$enable_multilib" = "yes"],[
- PROJECT_ROOT='$(top_builddir)'/${rtems_updir}'../$(MULTIBUILDTOP)'],[
- PROJECT_ROOT='$(top_builddir)'/${rtems_updir}])
-])
-
-AC_SUBST([PROJECT_INCLUDE],["${PROJECT_ROOT}lib/include"])
-AC_SUBST([PROJECT_LIB],["${PROJECT_ROOT}lib\$(MULTISUBDIR)"])
-
-libdir="${libdir}\$(MULTISUBDIR)"
-
-AC_SUBST([project_libdir],["\$(libdir)"])
-AC_SUBST([project_includedir],["\$(includedir)"])
-
-AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
-])dnl
diff --git a/cpukit/aclocal/version.m4 b/cpukit/aclocal/version.m4
deleted file mode 100644
index 69e3eea10a..0000000000
--- a/cpukit/aclocal/version.m4
+++ /dev/null
@@ -1,4 +0,0 @@
-AC_DEFUN([RTEMS_VERSIONING],
-m4_define([_RTEMS_VERSION],[6.0.0]))
-
-m4_define([_RTEMS_API],[6])
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/doxygen/appl-config.h b/cpukit/doxygen/appl-config.h
index bbeb438bec..4735af8766 100644
--- a/cpukit/doxygen/appl-config.h
+++ b/cpukit/doxygen/appl-config.h
@@ -3,7 +3,7 @@
/*
* Copyright (C) 2019, 2021 embedded brains GmbH (http://www.embedded-brains.de)
* Copyright (C) 2010 Gedare Bloom
- * Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
+ * Copyright (C) 1988, 2021 On-Line Applications Research Corporation (OAR)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1773,6 +1773,29 @@
*/
#define CONFIGURE_ATA_DRIVER_TASK_PRIORITY
+/* Generated from spec:/acfg/if/exception-to-signal-mapping */
+
+/**
+ * @brief This configuration option is a boolean feature define.
+ *
+ * In case this configuration option is defined, then the machine exception to
+ * POSIX signal mapping is configured during system initialization.
+ *
+ * @par Default Configuration
+ * If this configuration option is undefined, then the described feature is not
+ * enabled.
+ *
+ * @par Notes
+ * @parblock
+ * This device driver is responsible for setting up a mapping from machine
+ * exceptions to POSIX signals so that applications may consume them and alter
+ * task execution as necessary.
+ *
+ * This is especially useful for applications written in Ada or C++.
+ * @endparblock
+ */
+#define CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING
+
/* Generated from spec:/acfg/if/max-drivers */
/**
@@ -4671,6 +4694,32 @@
*/
#define CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
+/* Generated from spec:/acfg/if/task-stack-allocator-for-idle */
+
+/**
+ * @brief This configuration option is an initializer define.
+ *
+ * The value of this configuration option is the address for the stack
+ * allocator allocate handler used to allocate the task stack of each IDLE
+ * task.
+ *
+ * @par Default Value
+ * The default value is ``_Stack_Allocator_allocate_for_idle_default``, which
+ * indicates that IDLE task stacks will be allocated from an area statically
+ * allocated by ``<rtems/confdefs.h>``.
+ *
+ * @par Value Constraints
+ * The value of this configuration option shall be defined to a valid function
+ * pointer of the type ``void *( *allocate )( uint32_t, size_t )``.
+ *
+ * @par Notes
+ * This configuration option is independent of the other thread stack allocator
+ * configuration options. It is assumed that any memory allocated for the
+ * stack of an IDLE task will not be from the RTEMS Workspace or the memory
+ * statically allocated by default.
+ */
+#define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
+
/* Generated from spec:/acfg/if/task-stack-allocator-init */
/**
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/confdefs/bsp.h b/cpukit/include/rtems/confdefs/bsp.h
index 03ad9bf55f..bc96713765 100644
--- a/cpukit/include/rtems/confdefs/bsp.h
+++ b/cpukit/include/rtems/confdefs/bsp.h
@@ -41,19 +41,8 @@
#error "Do not include this file directly, use <rtems/confdefs.h> instead"
#endif
-#ifdef CONFIGURE_INIT
-
-#ifdef CONFIGURE_DISABLE_BSP_SETTINGS
- #undef BSP_IDLE_TASK_BODY
- #undef BSP_IDLE_TASK_STACK_SIZE
- #undef BSP_INITIAL_EXTENSION
- #undef BSP_INTERRUPT_STACK_SIZE
- #undef CONFIGURE_BSP_PREREQUISITE_DRIVERS
- #undef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
-#else
- #include <bsp.h>
+#if defined(CONFIGURE_INIT) && !defined(CONFIGURE_DISABLE_BSP_SETTINGS)
+#include <bsp.h>
#endif
-#endif /* CONFIGURE_INIT */
-
#endif /* _RTEMS_CONFDEFS_BSP_H */
diff --git a/cpukit/include/rtems/confdefs/extensions.h b/cpukit/include/rtems/confdefs/extensions.h
index 83d690d50a..118ad29484 100644
--- a/cpukit/include/rtems/confdefs/extensions.h
+++ b/cpukit/include/rtems/confdefs/extensions.h
@@ -93,6 +93,10 @@
#include <rtems/stackchk.h>
#endif
+#ifdef CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING
+ #include <rtems/score/exception.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -103,6 +107,9 @@ extern "C" {
|| defined(CONFIGURE_INITIAL_EXTENSIONS) \
|| defined(BSP_INITIAL_EXTENSION)
const User_extensions_Table _User_extensions_Initial_extensions[] = {
+ #ifdef CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING
+ { .fatal = _Exception_Raise_signal },
+ #endif
#ifdef _CONFIGURE_RECORD_NEED_EXTENSION
{
#ifdef CONFIGURE_RECORD_EXTENSIONS_ENABLED
@@ -139,7 +146,8 @@ extern "C" {
#ifdef CONFIGURE_INITIAL_EXTENSIONS
CONFIGURE_INITIAL_EXTENSIONS,
#endif
- #ifdef BSP_INITIAL_EXTENSION
+ #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+ defined(BSP_INITIAL_EXTENSION)
BSP_INITIAL_EXTENSION
#endif
};
diff --git a/cpukit/include/rtems/confdefs/iodrivers.h b/cpukit/include/rtems/confdefs/iodrivers.h
index a7de77a8c3..1f77948676 100644
--- a/cpukit/include/rtems/confdefs/iodrivers.h
+++ b/cpukit/include/rtems/confdefs/iodrivers.h
@@ -43,16 +43,30 @@
#ifdef CONFIGURE_INIT
-#if defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) \
- || defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) \
- || defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) \
- || defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) \
- || defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) \
- || defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) \
- || defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) \
- || defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) \
- || defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) \
- || CONFIGURE_MAXIMUM_DRIVERS > 0
+#include <rtems/confdefs/bsp.h>
+
+#if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+ defined(CONFIGURE_BSP_PREREQUISITE_DRIVERS)
+#define _CONFIGURE_BSP_PREREQUISITE_DRIVERS CONFIGURE_BSP_PREREQUISITE_DRIVERS
+#endif
+
+#if defined(_CONFIGURE_BSP_PREREQUISITE_DRIVERS) || \
+ defined(CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS) || \
+ defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) || \
+ defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) || \
+ defined(CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER) || \
+ defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) || \
+ defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) || \
+ defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) || \
+ defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) || \
+ defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) || \
+ defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS)
+#define _CONFIGURE_HAS_IO_DRIVERS
+#endif
+
+#if defined(_CONFIGURE_HAS_IO_DRIVERS) || \
+ defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) || \
+ CONFIGURE_MAXIMUM_DRIVERS > 0
#include <rtems/ioimpl.h>
#include <rtems/sysinit.h>
@@ -110,8 +124,8 @@ extern "C" {
rtems_driver_address_table
_IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = {
- #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS
- CONFIGURE_BSP_PREREQUISITE_DRIVERS,
+ #ifdef _CONFIGURE_BSP_PREREQUISITE_DRIVERS
+ _CONFIGURE_BSP_PREREQUISITE_DRIVERS,
#endif
#ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS
CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS,
@@ -143,15 +157,8 @@ _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = {
#ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS
CONFIGURE_APPLICATION_EXTRA_DRIVERS,
#endif
- #if defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) \
- || ( !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) \
- && !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) \
- && !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) \
- && !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) \
- && !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) \
- && !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) \
- && !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) \
- && !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) )
+ #if defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) || \
+ !defined(_CONFIGURE_HAS_IO_DRIVERS)
NULL_DRIVER_TABLE_ENTRY
#endif
};
@@ -178,16 +185,9 @@ RTEMS_SYSINIT_ITEM(
}
#endif
-#endif /* CONFIGURE_APPLICATION_EXTRA_DRIVERS
- || CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
- || CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
- || CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
- || CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
- || CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
- || CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
- || CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
- || CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
- || CONFIGURE_MAXIMUM_DRIVERS */
+#endif /* _CONFIGURE_HAS_IO_DRIVERS) ||
+ CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER ||
+ CONFIGURE_MAXIMUM_DRIVERS */
/*
diff --git a/cpukit/include/rtems/confdefs/malloc.h b/cpukit/include/rtems/confdefs/malloc.h
index d864a98270..a8dae6e739 100644
--- a/cpukit/include/rtems/confdefs/malloc.h
+++ b/cpukit/include/rtems/confdefs/malloc.h
@@ -45,8 +45,12 @@
#include <rtems/confdefs/bsp.h>
-#if defined(CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK) \
- || defined(CONFIGURE_MALLOC_DIRTY)
+#if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+ defined(CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK)
+#define _CONFIGURE_HEAP_EXTEND_VIA_SBRK
+#endif
+
+#if defined(_CONFIGURE_HEAP_EXTEND_VIA_SBRK) || defined(CONFIGURE_MALLOC_DIRTY)
#include <rtems/malloc.h>
#endif
@@ -54,7 +58,7 @@
extern "C" {
#endif
-#ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
+#ifdef _CONFIGURE_HEAP_EXTEND_VIA_SBRK
const rtems_heap_extend_handler rtems_malloc_extend_handler =
rtems_heap_extend_via_sbrk;
#endif
diff --git a/cpukit/include/rtems/confdefs/percpu.h b/cpukit/include/rtems/confdefs/percpu.h
index badb616988..b91590bfd9 100644
--- a/cpukit/include/rtems/confdefs/percpu.h
+++ b/cpukit/include/rtems/confdefs/percpu.h
@@ -78,7 +78,8 @@ extern "C" {
/* Interrupt stack configuration */
#ifndef CONFIGURE_INTERRUPT_STACK_SIZE
- #ifdef BSP_INTERRUPT_STACK_SIZE
+ #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+ defined(BSP_INTERRUPT_STACK_SIZE)
#define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE
#else
#define CONFIGURE_INTERRUPT_STACK_SIZE CPU_STACK_MINIMUM_SIZE
@@ -121,7 +122,8 @@ RTEMS_DEFINE_GLOBAL_SYMBOL(
/* Idle thread configuration */
#ifndef CONFIGURE_IDLE_TASK_STACK_SIZE
- #ifdef BSP_IDLE_TASK_STACK_SIZE
+ #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+ defined(BSP_IDLE_TASK_STACK_SIZE)
#define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE
#else
#define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
@@ -134,18 +136,27 @@ 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)
#error "If you define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION, then you must define CONFIGURE_IDLE_TASK_BODY as well"
#endif
-#if !defined(CONFIGURE_IDLE_TASK_BODY) && defined(BSP_IDLE_TASK_BODY)
+#if !defined(CONFIGURE_IDLE_TASK_BODY) && \
+ !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && defined(BSP_IDLE_TASK_BODY)
#define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY
#endif
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..32dd662b3e 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -10,6 +10,7 @@
*/
/*
+ * Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
* Copyright (C) 2009, 2021 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
@@ -302,6 +303,23 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
#define rtems_configuration_get_number_of_initial_extensions() \
((uint32_t) _User_extensions_Initial_count)
+/* Generated from spec:/rtems/config/if/get-stack-allocate-for-idle-hook */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief Gets the thread stack allocator allocate hook used to allocate the
+ * stack of each IDLE task configured for this application.
+ *
+ * @return Returns the thread stack allocator allocate hook used to allocate
+ * the stack of each IDLE task configured for this application.
+ *
+ * @par Notes
+ * See #CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE.
+ */
+#define rtems_configuration_get_stack_allocate_for_idle_hook() \
+ _Stack_Allocator_allocate_for_idle
+
/* Generated from spec:/rtems/config/if/get-stack-allocate-hook */
/**
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/malloc.h b/cpukit/include/rtems/malloc.h
index eba538e223..c0d15fbf72 100644
--- a/cpukit/include/rtems/malloc.h
+++ b/cpukit/include/rtems/malloc.h
@@ -19,7 +19,6 @@
#include <rtems.h>
#include <rtems/bspIo.h>
#include <rtems/libcsupport.h> /* for malloc_walk() */
-#include <rtems/score/memory.h>
#include <stdint.h>
@@ -43,10 +42,7 @@ extern "C" {
*/
extern Heap_Control *RTEMS_Malloc_Heap;
-Heap_Control *RTEMS_Malloc_Initialize(
- const Memory_Information *mem,
- Heap_Initialization_or_extend_handler extend
-);
+void _Malloc_Initialize( void );
void rtems_heap_set_sbrk_amount( ptrdiff_t sbrk_amount );
diff --git a/cpukit/include/rtems/mallocinitmulti.h b/cpukit/include/rtems/mallocinitmulti.h
new file mode 100644
index 0000000000..a64c6e4802
--- /dev/null
+++ b/cpukit/include/rtems/mallocinitmulti.h
@@ -0,0 +1,100 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup MallocSupport
+ *
+ * @brief This header file provides the implementation of
+ * _Malloc_Initialize_for_multiple_areas().
+ */
+
+/*
+ * Copyright (C) 2012, 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.
+ */
+
+#ifndef _RTEMS_MALLOCINITMULTI_H
+#define _RTEMS_MALLOCINITMULTI_H
+
+#include <rtems/malloc.h>
+#include <rtems/score/heapimpl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @ingroup MallocSupport
+ *
+ * @brief Initializes the separate C Program Heap with support for more than
+ * one memory area.
+ *
+ * This implementation should be used by BSPs which provide more than one
+ * memory area via _Memory_Get() to implement
+ * _Workspace_Malloc_initialize_separate().
+ */
+RTEMS_INLINE_ROUTINE Heap_Control *_Malloc_Initialize_for_multiple_areas(
+ Heap_Control *heap
+)
+{
+ const Memory_Information *mem;
+ Heap_Initialization_or_extend_handler init_or_extend;
+ uintptr_t page_size;
+ size_t i;
+
+ mem = _Memory_Get();
+ RTEMS_Malloc_Heap = heap;
+ init_or_extend = _Heap_Initialize;
+ page_size = CPU_HEAP_ALIGNMENT;
+
+ for (i = 0; i < _Memory_Get_count( mem ); ++i) {
+ Memory_Area *area;
+ uintptr_t space_available;
+
+ area = _Memory_Get_area( mem, i );
+ space_available = ( *init_or_extend )(
+ heap,
+ _Memory_Get_free_begin( area ),
+ _Memory_Get_free_size( area ),
+ page_size
+ );
+
+ if ( space_available > 0 ) {
+ _Memory_Consume( area, _Memory_Get_free_size( area ) );
+ init_or_extend = _Heap_Extend;
+ }
+ }
+
+ if ( init_or_extend == _Heap_Initialize ) {
+ _Internal_error( INTERNAL_ERROR_NO_MEMORY_FOR_HEAP );
+ }
+
+ return heap;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_MALLOCINITMULTI_H */
diff --git a/cpukit/include/rtems/mallocinitone.h b/cpukit/include/rtems/mallocinitone.h
new file mode 100644
index 0000000000..eaa0d8eb3e
--- /dev/null
+++ b/cpukit/include/rtems/mallocinitone.h
@@ -0,0 +1,90 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup MallocSupport
+ *
+ * @brief This header file provides the implementation of
+ * _Malloc_Initialize_for_one_area().
+ */
+
+/*
+ * Copyright (C) 2012, 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.
+ */
+
+#ifndef _RTEMS_MALLOCINITONE_H
+#define _RTEMS_MALLOCINITONE_H
+
+#include <rtems/malloc.h>
+#include <rtems/score/assert.h>
+#include <rtems/score/heapimpl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @ingroup MallocSupport
+ *
+ * @brief Initializes the separate C Program Heap with support for exactly one
+ * memory area.
+ *
+ * This implementation should be used by BSPs which provide exactly one memory
+ * area via _Memory_Get() to implement _Workspace_Malloc_initialize_separate().
+ */
+RTEMS_INLINE_ROUTINE Heap_Control *_Malloc_Initialize_for_one_area(
+ Heap_Control *heap
+)
+{
+ const Memory_Information *mem;
+ Memory_Area *area;
+ uintptr_t space_available;
+
+ mem = _Memory_Get();
+ _Assert( _Memory_Get_count( mem ) == 1 );
+
+ RTEMS_Malloc_Heap = heap;
+ area = _Memory_Get_area( mem, 0 );
+ space_available = _Heap_Initialize(
+ heap,
+ _Memory_Get_free_begin( area ),
+ _Memory_Get_free_size( area ),
+ CPU_HEAP_ALIGNMENT
+ );
+
+ if ( space_available > 0 ) {
+ _Memory_Consume( area, _Memory_Get_free_size( area ) );
+ } else {
+ _Internal_error( INTERNAL_ERROR_NO_MEMORY_FOR_HEAP );
+ }
+
+ return heap;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_MALLOCINITONE_H */
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/pthreadimpl.h b/cpukit/include/rtems/posix/pthreadimpl.h
index 723b20e8d2..0dc7d9dac5 100644
--- a/cpukit/include/rtems/posix/pthreadimpl.h
+++ b/cpukit/include/rtems/posix/pthreadimpl.h
@@ -47,7 +47,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Sporadic_timer_insert(
POSIX_API_Control *api
)
{
- the_thread->cpu_time_budget =
+ the_thread->CPU_budget.available =
_Timespec_To_ticks( &api->Sporadic.sched_ss_init_budget );
_Watchdog_Per_CPU_insert_ticks(
@@ -61,19 +61,12 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Sporadic_timer_insert(
void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog );
/**
- * @brief POSIX threads sporadic budget callout.
- *
- * This routine handles the sporadic scheduling algorithm.
- *
- * @param[in] the_thread is a pointer to the thread whose budget
- * has been exceeded.
+ * @brief The POSIX threads sporadic budget operations.
*/
-void _POSIX_Threads_Sporadic_budget_callout(
- Thread_Control *the_thread
-);
+extern const Thread_CPU_budget_operations _POSIX_Threads_Sporadic_budget;
int _POSIX_Thread_Translate_to_sched_policy(
- Thread_CPU_budget_algorithms budget_algorithm
+ const Thread_CPU_budget_operations *operations
);
/**
diff --git a/cpukit/include/rtems/rtems/asr.h b/cpukit/include/rtems/rtems/asr.h
index f58d60790d..1b0af08a0e 100644
--- a/cpukit/include/rtems/rtems/asr.h
+++ b/cpukit/include/rtems/rtems/asr.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicSignal
+ *
* @brief This header file defines the parts of the Signal Manager API.
*/
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/clock.h b/cpukit/include/rtems/rtems/clock.h
index e158b18947..6cdc8d68e3 100644
--- a/cpukit/include/rtems/rtems/clock.h
+++ b/cpukit/include/rtems/rtems/clock.h
@@ -81,6 +81,11 @@ extern "C" {
* related capabilities.
*/
+/* Generated from spec:/rtems/clock/if/bintime */
+
+/* Forward declaration */
+struct bintime;
+
/* Generated from spec:/rtems/clock/if/set */
/**
@@ -213,6 +218,593 @@ rtems_status_code rtems_clock_get_tod( rtems_time_of_day *time_of_day );
*/
rtems_status_code rtems_clock_get_tod_timeval( struct timeval *time_of_day );
+/* Generated from spec:/rtems/clock/if/get-realtime */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since the Unix epoch measured using
+ * CLOCK_REALTIME in seconds and nanoseconds format.
+ *
+ * @param[out] time_snapshot is the pointer to a struct timespec object. The
+ * time elapsed since the Unix epoch measured using the CLOCK_REALTIME at
+ * some time point during the directive call will be stored in this object.
+ * Calling the directive with a pointer equal to NULL is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive accesses a device provided by the Clock Driver to get the time
+ * in the highest resolution available to the system. Alternatively, the
+ * rtems_clock_get_realtime_coarse() directive may be used to get the time in a
+ * lower resolution and with less runtime overhead.
+ *
+ * See rtems_clock_get_realtime_bintime() and
+ * rtems_clock_get_realtime_timeval() to get the time in alternative formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_realtime( struct timespec *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-realtime-bintime */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since the Unix epoch measured using
+ * CLOCK_REALTIME in binary time format.
+ *
+ * @param[out] time_snapshot is the pointer to a bintime object. The time
+ * elapsed since the Unix epoch measured using the CLOCK_REALTIME at some
+ * time point during the directive call will be stored in this object.
+ * Calling the directive with a pointer equal to NULL is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive accesses a device provided by the Clock Driver to get the time
+ * in the highest resolution available to the system. Alternatively, the
+ * rtems_clock_get_realtime_coarse_bintime() directive may be used to get the
+ * time in a lower resolution and with less runtime overhead.
+ *
+ * See rtems_clock_get_realtime() and rtems_clock_get_realtime_timeval() to get
+ * the time in alternative formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_realtime_bintime( struct bintime *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-realtime-timeval */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since the Unix epoch measured using
+ * CLOCK_REALTIME in seconds and microseconds format.
+ *
+ * @param[out] time_snapshot is the pointer to a struct timeval object. The
+ * time elapsed since the Unix epoch measured using the CLOCK_REALTIME at
+ * some time point during the directive call will be stored in this object.
+ * Calling the directive with a pointer equal to NULL is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive accesses a device provided by the Clock Driver to get the time
+ * in the highest resolution available to the system. Alternatively, the
+ * rtems_clock_get_realtime_coarse_timeval() directive may be used to get the
+ * time in a lower resolution and with less runtime overhead.
+ *
+ * See rtems_clock_get_realtime() and rtems_clock_get_realtime_bintime() to get
+ * the time in alternative formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_realtime_timeval( struct timeval *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-realtime-coarse */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since the Unix epoch measured using
+ * CLOCK_REALTIME in coarse resolution in seconds and nanoseconds format.
+ *
+ * @param[out] time_snapshot is the pointer to a struct timespec object. The
+ * time elapsed since the Unix epoch measured using the CLOCK_REALTIME at
+ * some time point close to the directive call will be stored in this object.
+ * Calling the directive with a pointer equal to NULL is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive does not access a device to get the time. It uses a recent
+ * snapshot provided by the Clock Driver. Alternatively, the
+ * rtems_clock_get_realtime() directive may be used to get the time in a higher
+ * resolution and with a higher runtime overhead.
+ *
+ * See rtems_clock_get_realtime_coarse_bintime() and
+ * rtems_clock_get_realtime_coarse_timeval() to get the time in alternative
+ * formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_realtime_coarse( struct timespec *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-realtime-coarse-bintime */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since the Unix epoch measured using
+ * CLOCK_REALTIME in coarse resolution in binary time format.
+ *
+ * @param[out] time_snapshot is the pointer to a bintime object. The time
+ * elapsed since the Unix epoch measured using the CLOCK_REALTIME at some
+ * time point close to the directive call will be stored in this object.
+ * Calling the directive with a pointer equal to NULL is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive does not access a device to get the time. It uses a recent
+ * snapshot provided by the Clock Driver. Alternatively, the
+ * rtems_clock_get_realtime_bintime() directive may be used to get the time in
+ * a higher resolution and with a higher runtime overhead.
+ *
+ * See rtems_clock_get_realtime_coarse() and
+ * rtems_clock_get_realtime_coarse_timeval() to get the time in alternative
+ * formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_realtime_coarse_bintime( struct bintime *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-realtime-coarse-timeval */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since the Unix epoch measured using
+ * CLOCK_REALTIME in coarse resolution in seconds and microseconds format.
+ *
+ * @param[out] time_snapshot is the pointer to a struct timeval object. The
+ * time elapsed since the Unix epoch measured using the CLOCK_REALTIME at
+ * some time point close to the directive call will be stored in this object.
+ * Calling the directive with a pointer equal to NULL is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive does not access a device to get the time. It uses a recent
+ * snapshot provided by the Clock Driver. Alternatively, the
+ * rtems_clock_get_realtime_timeval() directive may be used to get the time in
+ * a higher resolution and with a higher runtime overhead.
+ *
+ * See rtems_clock_get_realtime_coarse() and
+ * rtems_clock_get_realtime_coarse_timeval() to get the time in alternative
+ * formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_realtime_coarse_timeval( struct timeval *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-monotonic */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since some fixed time point in the past
+ * measured using the CLOCK_MONOTONIC in seconds and nanoseconds format.
+ *
+ * @param[out] time_snapshot is the pointer to a bintime object. The time
+ * elapsed since some fixed time point in the past measured using the
+ * CLOCK_MONOTONIC at some time point during the directive call will be
+ * stored in this object. Calling the directive with a pointer equal to NULL
+ * is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive accesses a device provided by the Clock Driver to get the time
+ * in the highest resolution available to the system. Alternatively, the
+ * rtems_clock_get_monotonic_coarse() directive may be used to get the time
+ * with in a lower resolution and with less runtime overhead.
+ *
+ * See rtems_clock_get_monotonic_bintime(),
+ * rtems_clock_get_monotonic_sbintime(), and
+ * rtems_clock_get_monotonic_timeval() to get the time in alternative formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_monotonic( struct timespec *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-monotonic-bintime */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since some fixed time point in the past
+ * measured using the CLOCK_MONOTONIC in binary time format.
+ *
+ * @param[out] time_snapshot is the pointer to a bintime object. The time
+ * elapsed since some fixed time point in the past measured using the
+ * CLOCK_MONOTONIC at some time point during the directive call will be
+ * stored in this object. Calling the directive with a pointer equal to NULL
+ * is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive accesses a device provided by the Clock Driver to get the time
+ * in the highest resolution available to the system. Alternatively, the
+ * rtems_clock_get_monotonic_coarse_bintime() directive may be used to get the
+ * time in a lower resolution and with less runtime overhead.
+ *
+ * See rtems_clock_get_monotonic(), rtems_clock_get_monotonic_sbintime(), and
+ * rtems_clock_get_monotonic_timeval() to get the time in alternative formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_monotonic_bintime( struct bintime *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-monotonic-sbintime */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since some fixed time point in the past
+ * measured using the CLOCK_MONOTONIC in signed binary time format.
+ *
+ * @return Returns the time elapsed since some fixed time point in the past
+ * measured using the CLOCK_MONOTONIC at some time point during the directive
+ * call.
+ *
+ * @par Notes
+ * @parblock
+ * The directive accesses a device provided by the Clock Driver to get the time
+ * in the highest resolution available to the system.
+ *
+ * See rtems_clock_get_monotonic(), rtems_clock_get_monotonic_bintime(), and
+ * rtems_clock_get_monotonic_timeval() to get the time in alternative formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+int64_t rtems_clock_get_monotonic_sbintime( void );
+
+/* Generated from spec:/rtems/clock/if/get-monotonic-timeval */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since some fixed time point in the past
+ * measured using the CLOCK_MONOTONIC in seconds and microseconds format.
+ *
+ * @param[out] time_snapshot is the pointer to a bintime object. The time
+ * elapsed since some fixed time point in the past measured using the
+ * CLOCK_MONOTONIC at some time point during the directive call will be
+ * stored in this object. Calling the directive with a pointer equal to NULL
+ * is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive accesses a device provided by the Clock Driver to get the time
+ * in the highest resolution available to the system. Alternatively, the
+ * rtems_clock_get_monotonic_coarse_timeval() directive may be used to get the
+ * time in a lower resolution and with less runtime overhead.
+ *
+ * See rtems_clock_get_monotonic(), rtems_clock_get_monotonic_bintime(), and
+ * rtems_clock_get_monotonic_sbintime() to get the time in alternative formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_monotonic_timeval( struct timeval *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-monotonic-coarse */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since some fixed time point in the past
+ * measured using the CLOCK_MONOTONIC in coarse resolution in seconds and
+ * nanoseconds format.
+ *
+ * @param[out] time_snapshot is the pointer to a bintime object. The time
+ * elapsed since some fixed time point in the past measured using the
+ * CLOCK_MONOTONIC at some time point close to the directive call will be
+ * stored in this object. Calling the directive with a pointer equal to NULL
+ * is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive does not access a device to get the time. It uses a recent
+ * snapshot provided by the Clock Driver. Alternatively, the
+ * rtems_clock_get_monotonic() directive may be used to get the time in a
+ * higher resolution and with a higher runtime overhead.
+ *
+ * See rtems_clock_get_monotonic_coarse_bintime() and
+ * rtems_clock_get_monotonic_coarse_timeval() to get the time in alternative
+ * formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_monotonic_coarse( struct timespec *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-monotonic-coarse-bintime */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since some fixed time point in the past
+ * measured using the CLOCK_MONOTONIC in coarse resolution in binary time
+ * format.
+ *
+ * @param[out] time_snapshot is the pointer to a bintime object. The time
+ * elapsed since some fixed time point in the past measured using the
+ * CLOCK_MONOTONIC at some time point close to the directive call will be
+ * stored in this object. Calling the directive with a pointer equal to NULL
+ * is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive does not access a device to get the time. It uses a recent
+ * snapshot provided by the Clock Driver. Alternatively, the
+ * rtems_clock_get_monotonic_bintime() directive may be used to get the time in
+ * a higher resolution and with a higher runtime overhead.
+ *
+ * See rtems_clock_get_monotonic_coarse() and
+ * rtems_clock_get_monotonic_coarse_timeval() to get the time in alternative
+ * formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_monotonic_coarse_bintime( struct bintime *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-monotonic-coarse-timeval */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since some fixed time point in the past
+ * measured using the CLOCK_MONOTONIC in coarse resolution in seconds and
+ * microseconds format.
+ *
+ * @param[out] time_snapshot is the pointer to a bintime object. The time
+ * elapsed since some fixed time point in the past measured using the
+ * CLOCK_MONOTONIC at some time point close to the directive call will be
+ * stored in this object. Calling the directive with a pointer equal to NULL
+ * is undefined behaviour.
+ *
+ * @par Notes
+ * @parblock
+ * The directive does not access a device to get the time. It uses a recent
+ * snapshot provided by the Clock Driver. Alternatively, the
+ * rtems_clock_get_monotonic_timeval() directive may be used to get the time in
+ * a higher resolution and with a higher runtime overhead.
+ *
+ * See rtems_clock_get_monotonic_coarse() and
+ * rtems_clock_get_monotonic_coarse_bintime() to get the time in alternative
+ * formats.
+ * @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.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_monotonic_coarse_timeval( struct timeval *time_snapshot );
+
+/* Generated from spec:/rtems/clock/if/get-boot-time */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since the Unix epoch at some time point during
+ * system initialization in seconds and nanoseconds format.
+ *
+ * @param[out] boot_time is the pointer to a struct timespec object. The time
+ * elapsed since the Unix epoch at some time point during system
+ * initialization call will be stored in this object. Calling the directive
+ * with a pointer equal to NULL is undefined behaviour.
+ *
+ * @par Notes
+ * See rtems_clock_get_boot_time_bintime() and
+ * rtems_clock_get_boot_time_timeval() to get the boot time in alternative
+ * formats. Setting the CLOCK_REALTIME will also set the boot time.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_boot_time( struct timespec *boot_time );
+
+/* Generated from spec:/rtems/clock/if/get-boot-time-bintime */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since the Unix epoch at some time point during
+ * system initialization in binary time format.
+ *
+ * @param[out] boot_time is the pointer to a bintime object. The time elapsed
+ * since the Unix epoch at some time point during system initialization call
+ * will be stored in this object. Calling the directive with a pointer equal
+ * to NULL is undefined behaviour.
+ *
+ * @par Notes
+ * See rtems_clock_get_boot_time() and rtems_clock_get_boot_time_timeval() to
+ * get the boot time in alternative formats. Setting the CLOCK_REALTIME will
+ * also set the boot time.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_boot_time_bintime( struct bintime *boot_time );
+
+/* Generated from spec:/rtems/clock/if/get-boot-time-timeval */
+
+/**
+ * @ingroup RTEMSAPIClassicClock
+ *
+ * @brief Gets the time elapsed since the Unix epoch at some time point during
+ * system initialization in seconds and microseconds format.
+ *
+ * @param[out] boot_time is the pointer to a struct timeval object. The time
+ * elapsed since the Unix epoch at some time point during system
+ * initialization call will be stored in this object. Calling the directive
+ * with a pointer equal to NULL is undefined behaviour.
+ *
+ * @par Notes
+ * See rtems_clock_get_boot_time() and rtems_clock_get_boot_time_bintime() to
+ * get the boot time in alternative formats. Setting the CLOCK_REALTIME will
+ * also set the boot time.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ *
+ * * The directive requires a Clock Driver.
+ * @endparblock
+ */
+void rtems_clock_get_boot_time_timeval( struct timeval *boot_time );
+
/* Generated from spec:/rtems/clock/if/get-seconds-since-epoch */
/**
diff --git a/cpukit/include/rtems/rtems/message.h b/cpukit/include/rtems/rtems/message.h
index 4b556c1091..0a76b1f9b8 100644
--- a/cpukit/include/rtems/rtems/message.h
+++ b/cpukit/include/rtems/rtems/message.h
@@ -861,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
diff --git a/cpukit/include/rtems/rtems/modesimpl.h b/cpukit/include/rtems/rtems/modesimpl.h
index 924e12fbee..8fdab263f1 100644
--- a/cpukit/include/rtems/rtems/modesimpl.h
+++ b/cpukit/include/rtems/rtems/modesimpl.h
@@ -22,6 +22,7 @@
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/smpimpl.h>
#include <rtems/score/threadimpl.h>
+#include <rtems/score/threadcpubudget.h>
#include <rtems/config.h>
#ifdef __cplusplus
@@ -148,10 +149,11 @@ RTEMS_INLINE_ROUTINE void _Modes_Apply_timeslice_to_thread(
)
{
if ( _Modes_Is_timeslice( mode_set ) ) {
- the_thread->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
- the_thread->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice();
+ the_thread->CPU_budget.operations = &_Thread_CPU_budget_reset_timeslice;
+ the_thread->CPU_budget.available =
+ rtems_configuration_get_ticks_per_timeslice();
} else {
- the_thread->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
+ the_thread->CPU_budget.operations = NULL;
}
}
diff --git a/cpukit/include/rtems/rtems/ratemon.h b/cpukit/include/rtems/rtems/ratemon.h
index 8823d72c55..7c789a204b 100644
--- a/cpukit/include/rtems/rtems/ratemon.h
+++ b/cpukit/include/rtems/rtems/ratemon.h
@@ -445,6 +445,10 @@ rtems_status_code rtems_rate_monotonic_delete( rtems_id id );
*
* @retval ::RTEMS_TIMEOUT The rate monotonic period has expired.
*
+ * @par Notes
+ * Resetting the processor usage time of tasks has no impact on the period
+ * status and statistics.
+ *
* @par Constraints
* @parblock
* The following constraints apply to this directive:
@@ -502,9 +506,6 @@ rtems_status_code rtems_rate_monotonic_period(
*
* @retval ::RTEMS_INVALID_ADDRESS The ``status`` parameter was NULL.
*
- * @retval ::RTEMS_NOT_DEFINED There was no status available due to a reset of
- * the processor time usage of the owner task of the period.
- *
* @par Constraints
* @parblock
* The following constraints apply to this directive:
diff --git a/cpukit/include/rtems/rtems/ratemonimpl.h b/cpukit/include/rtems/rtems/ratemonimpl.h
index 7e42a0437c..d17c7fe4de 100644
--- a/cpukit/include/rtems/rtems/ratemonimpl.h
+++ b/cpukit/include/rtems/rtems/ratemonimpl.h
@@ -48,9 +48,6 @@ extern "C" {
#define RATE_MONOTONIC_BLOCKED \
( THREAD_WAIT_CLASS_PERIOD | THREAD_WAIT_STATE_BLOCKED )
-#define RATE_MONOTONIC_READY_AGAIN \
- ( THREAD_WAIT_CLASS_PERIOD | THREAD_WAIT_STATE_READY_AGAIN )
-
/**
* @brief Allocates a period control block from
* the inactive chain of free period control blocks.
@@ -92,7 +89,7 @@ RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get(
void _Rate_monotonic_Timeout( Watchdog_Control *watchdog );
/**
- * @brief _Rate_monotonic_Get_status(
+ * @brief Gets the rate monotonic CPU usage status.
*
* This routine is invoked to compute the elapsed wall time and cpu
* time for a period.
@@ -102,11 +99,8 @@ void _Rate_monotonic_Timeout( Watchdog_Control *watchdog );
* since the period was initiated.
* @param[out] cpu_since_last_period is set to the cpu time used by the
* owning thread since the period was initiated.
- *
- * @retval This routine returns true if the status can be determined
- * and false otherwise.
*/
-bool _Rate_monotonic_Get_status(
+void _Rate_monotonic_Get_status(
const Rate_monotonic_Control *the_period,
Timestamp_Control *wall_since_last_period,
Timestamp_Control *cpu_since_last_period
diff --git a/cpukit/include/rtems/rtems/signal.h b/cpukit/include/rtems/rtems/signal.h
index c9fbd79b5d..9272f807bc 100644
--- a/cpukit/include/rtems/rtems/signal.h
+++ b/cpukit/include/rtems/rtems/signal.h
@@ -3,6 +3,8 @@
/**
* @file
*
+ * @ingroup RTEMSImplClassicSignal
+ *
* @brief This header file defines the parts of the Signal Manager API.
*/
diff --git a/cpukit/include/rtems/rtems/tasks.h b/cpukit/include/rtems/rtems/tasks.h
index 8c6e8a3bca..8e87bfd14a 100644
--- a/cpukit/include/rtems/rtems/tasks.h
+++ b/cpukit/include/rtems/rtems/tasks.h
@@ -867,9 +867,12 @@ rtems_status_code rtems_scheduler_add_processor(
*
* @retval ::RTEMS_INVALID_NUMBER The processor was not owned by the scheduler.
*
- * @retval ::RTEMS_RESOURCE_IN_USE The set of processors owned by the scheduler
- * would have been empty after the processor removal and there was at least
- * one non-idle task that used this scheduler as its home scheduler.
+ * @retval ::RTEMS_RESOURCE_IN_USE The processor was required by at least one
+ * non-idle task that used the scheduler as its home scheduler.
+ *
+ * @retval ::RTEMS_RESOURCE_IN_USE The processor was the last processor owned
+ * by the scheduler and there was at least one task that used the scheduler
+ * as a helping scheduler.
*
* @par Notes
* Removing a processor from a scheduler is a complex operation that involves
@@ -1267,7 +1270,8 @@ rtems_status_code rtems_task_construct(
* This directive obtains a task identifier associated with the task name
* specified in ``name``.
*
- * A task may obtain its own identifier by specifying #RTEMS_SELF for the name.
+ * A task may obtain its own identifier by specifying #RTEMS_WHO_AM_I for the
+ * name.
*
* The node to search is specified in ``node``. It shall be
*
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/chainimpl.h b/cpukit/include/rtems/score/chainimpl.h
index 234dd1d74e..6aaa89237d 100644
--- a/cpukit/include/rtems/score/chainimpl.h
+++ b/cpukit/include/rtems/score/chainimpl.h
@@ -826,7 +826,8 @@ RTEMS_INLINE_ROUTINE bool _Chain_Get_with_empty_check_unprotected(
* @retval false Otherwise.
*/
typedef bool ( *Chain_Node_order )(
- const void *left,
+ const void *key,
+ const Chain_Node *left,
const Chain_Node *right
);
@@ -848,18 +849,20 @@ typedef bool ( *Chain_Node_order )(
RTEMS_INLINE_ROUTINE void _Chain_Insert_ordered_unprotected(
Chain_Control *the_chain,
Chain_Node *to_insert,
- const void *left,
+ const void *key,
Chain_Node_order order
)
{
const Chain_Node *tail = _Chain_Immutable_tail( the_chain );
+ Chain_Node *previous = _Chain_Head( the_chain );
Chain_Node *next = _Chain_First( the_chain );
- while ( next != tail && !( *order )( left, next ) ) {
+ while ( next != tail && !( *order )( key, to_insert, next ) ) {
+ previous = next;
next = _Chain_Next( next );
}
- _Chain_Insert_unprotected( _Chain_Previous( next ), to_insert );
+ _Chain_Insert_unprotected( previous, to_insert );
}
/**
diff --git a/cpukit/include/rtems/score/coremuteximpl.h b/cpukit/include/rtems/score/coremuteximpl.h
index 757efbde9b..5114f33e0d 100644
--- a/cpukit/include/rtems/score/coremuteximpl.h
+++ b/cpukit/include/rtems/score/coremuteximpl.h
@@ -357,12 +357,10 @@ _CORE_ceiling_mutex_Get_scheduler(
*
* @param[out] the_mutex The ceiling mutex to set the priority of.
* @param priority_ceiling The new priority ceiling of the mutex.
- * @param queue_context The thread queue context.
*/
RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Set_priority(
CORE_ceiling_mutex_Control *the_mutex,
- Priority_Control priority_ceiling,
- Thread_queue_Context *queue_context
+ Priority_Control priority_ceiling
)
{
Thread_Control *owner;
@@ -370,15 +368,19 @@ RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Set_priority(
owner = _CORE_mutex_Get_owner( &the_mutex->Recursive.Mutex );
if ( owner != NULL ) {
- _Thread_Wait_acquire( owner, queue_context );
+ Thread_queue_Context queue_context;
+
+ _Thread_queue_Context_initialize( &queue_context );
+ _Thread_queue_Context_clear_priority_updates( &queue_context );
+ _Thread_Wait_acquire_critical( owner, &queue_context );
_Thread_Priority_change(
owner,
&the_mutex->Priority_ceiling,
priority_ceiling,
PRIORITY_GROUP_LAST,
- queue_context
+ &queue_context
);
- _Thread_Wait_release( owner, queue_context );
+ _Thread_Wait_release_critical( owner, &queue_context );
} else {
the_mutex->Priority_ceiling.priority = priority_ceiling;
}
@@ -475,19 +477,19 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Seize(
_CORE_mutex_Acquire_critical( &the_mutex->Recursive.Mutex, queue_context );
- owner = _CORE_mutex_Get_owner( &the_mutex->Recursive.Mutex );
-
- if ( owner == NULL ) {
#if defined(RTEMS_SMP)
- if (
- _Thread_Scheduler_get_home( executing )
- != _CORE_ceiling_mutex_Get_scheduler( the_mutex )
- ) {
- _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );
- return STATUS_NOT_DEFINED;
- }
+ if (
+ _Thread_Scheduler_get_home( executing )
+ != _CORE_ceiling_mutex_Get_scheduler( the_mutex )
+ ) {
+ _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );
+ return STATUS_NOT_DEFINED;
+ }
#endif
+ owner = _CORE_mutex_Get_owner( &the_mutex->Recursive.Mutex );
+
+ if ( owner == NULL ) {
_Thread_queue_Context_clear_priority_updates( queue_context );
return _CORE_ceiling_mutex_Set_owner(
the_mutex,
diff --git a/cpukit/include/rtems/score/exception.h b/cpukit/include/rtems/score/exception.h
new file mode 100644
index 0000000000..979a5aae7e
--- /dev/null
+++ b/cpukit/include/rtems/score/exception.h
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreException
+ *
+ * @brief This header file provides the interfaces for mapping
+ * exceptions to signsls.
+ */
+
+/*
+ * 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_EXCEPTION_H
+#define _RTEMS_EXCEPTION_H
+
+#include <rtems/fatal.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup RTEMSScoreException Exception Mapping Interfaces
+ *
+ * @ingroup RTEMSScore
+ *
+ * @brief This group contains the interfaces for mapping machine exceptions to
+ * signals using the fatal error handler.
+ */
+
+/**
+ * @brief Handle an exception frame for the purpose of mapping signals
+ *
+ * See CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING documentation in the
+ * "RTEMS Classic API Guide".
+ */
+void _Exception_Raise_signal(
+ Internal_errors_Source source,
+ bool always_set_to_false,
+ Internal_errors_t code
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_EXCEPTION_H */
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/mrspimpl.h b/cpukit/include/rtems/score/mrspimpl.h
index 3e64ad94e6..daa309e7cb 100644
--- a/cpukit/include/rtems/score/mrspimpl.h
+++ b/cpukit/include/rtems/score/mrspimpl.h
@@ -268,7 +268,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Claim_ownership(
_MRSP_Set_owner( mrsp, executing );
cpu_self = _Thread_queue_Dispatch_disable( queue_context );
_MRSP_Release( mrsp, queue_context );
- _Thread_Priority_and_sticky_update( executing, 1 );
+ _Thread_Priority_update_and_make_sticky( executing );
_Thread_Dispatch_enable( cpu_self );
return STATUS_SUCCESSFUL;
}
@@ -384,13 +384,6 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Wait_for_ownership(
_MRSP_Replace_priority( mrsp, executing, &ceiling_priority );
} else {
Per_CPU_Control *cpu_self;
- int sticky_level_change;
-
- if ( status != STATUS_DEADLOCK ) {
- sticky_level_change = -1;
- } else {
- sticky_level_change = 0;
- }
_ISR_lock_ISR_disable( &queue_context->Lock_context.Lock_context );
_MRSP_Remove_priority( executing, &ceiling_priority, queue_context );
@@ -398,7 +391,13 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Wait_for_ownership(
&queue_context->Lock_context.Lock_context
);
_ISR_lock_ISR_enable( &queue_context->Lock_context.Lock_context );
- _Thread_Priority_and_sticky_update( executing, sticky_level_change );
+
+ if ( status != STATUS_DEADLOCK ) {
+ _Thread_Priority_update_and_clean_sticky( executing );
+ } else {
+ _Thread_Priority_update_ignore_sticky( executing );
+ }
+
_Thread_Dispatch_enable( cpu_self );
}
@@ -493,7 +492,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Surrender(
&queue_context->Lock_context.Lock_context
);
_MRSP_Release( mrsp, queue_context );
- _Thread_Priority_and_sticky_update( executing, -1 );
+ _Thread_Priority_update_and_clean_sticky( executing );
_Thread_Dispatch_enable( cpu_self );
return STATUS_SUCCESSFUL;
}
diff --git a/cpukit/include/rtems/score/objectdata.h b/cpukit/include/rtems/score/objectdata.h
index 149498df9c..c7fb33ca5b 100644
--- a/cpukit/include/rtems/score/objectdata.h
+++ b/cpukit/include/rtems/score/objectdata.h
@@ -286,7 +286,7 @@ struct Objects_Information {
#if defined(RTEMS_MULTIPROCESSING)
/**
- * @brief This method is used by _Thread_queue_Extract_with_proxy().
+ * @brief This method is used by _Thread_MP_Extract_proxy().
*
* This member is statically initialized and read-only.
*/
diff --git a/cpukit/include/rtems/score/percpu.h b/cpukit/include/rtems/score/percpu.h
index 6081653a86..0794f15f69 100644
--- a/cpukit/include/rtems/score/percpu.h
+++ b/cpukit/include/rtems/score/percpu.h
@@ -38,18 +38,31 @@
extern "C" {
#endif
-#if defined(RTEMS_SMP)
- #if defined(RTEMS_PROFILING)
- #define PER_CPU_CONTROL_SIZE_APPROX \
- ( 512 + CPU_PER_CPU_CONTROL_SIZE + CPU_INTERRUPT_FRAME_SIZE )
- #elif defined(RTEMS_DEBUG) || CPU_SIZEOF_POINTER > 4
- #define PER_CPU_CONTROL_SIZE_APPROX \
- ( 256 + CPU_PER_CPU_CONTROL_SIZE + CPU_INTERRUPT_FRAME_SIZE )
+#if defined( RTEMS_SMP )
+ #if defined( RTEMS_PROFILING )
+ #define PER_CPU_CONTROL_SIZE_PROFILING 332
+ #else
+ #define PER_CPU_CONTROL_SIZE_PROFILING 0
+ #endif
+
+ #if defined( RTEMS_DEBUG )
+ #define PER_CPU_CONTROL_SIZE_DEBUG 76
#else
- #define PER_CPU_CONTROL_SIZE_APPROX \
- ( 180 + CPU_PER_CPU_CONTROL_SIZE + CPU_INTERRUPT_FRAME_SIZE )
+ #define PER_CPU_CONTROL_SIZE_DEBUG 0
#endif
+ #if CPU_SIZEOF_POINTER > 4
+ #define PER_CPU_CONTROL_SIZE_BIG_POINTER 76
+ #else
+ #define PER_CPU_CONTROL_SIZE_BIG_POINTER 0
+ #endif
+
+ #define PER_CPU_CONTROL_SIZE_BASE 180
+ #define PER_CPU_CONTROL_SIZE_APPROX \
+ ( PER_CPU_CONTROL_SIZE_BASE + CPU_PER_CPU_CONTROL_SIZE + \
+ CPU_INTERRUPT_FRAME_SIZE + PER_CPU_CONTROL_SIZE_PROFILING + \
+ PER_CPU_CONTROL_SIZE_DEBUG + PER_CPU_CONTROL_SIZE_BIG_POINTER )
+
/*
* This ensures that on SMP configurations the individual per-CPU controls
* are on different cache lines to prevent false sharing. This define can be
diff --git a/cpukit/include/rtems/score/rbtreeimpl.h b/cpukit/include/rtems/score/rbtreeimpl.h
index 597c24d771..0867240d59 100644
--- a/cpukit/include/rtems/score/rbtreeimpl.h
+++ b/cpukit/include/rtems/score/rbtreeimpl.h
@@ -31,6 +31,32 @@ extern "C" {
*/
/**
+ * @brief Appends the node to the red-black tree.
+ *
+ * The appended node is the new maximum node of the tree. The caller shall
+ * ensure that the appended node is indeed the maximum node with respect to the
+ * tree order.
+ *
+ * @param[in, out] the_rbtree is the red-black tree control.
+ *
+ * @param the_node[out] is the node to append.
+ */
+void _RBTree_Append( RBTree_Control *the_rbtree, RBTree_Node *the_node );
+
+/**
+ * @brief Prepends the node to the red-black tree.
+ *
+ * The prepended node is the new minimum node of the tree. The caller shall
+ * ensure that the prepended node is indeed the minimum node with respect to the
+ * tree order.
+ *
+ * @param[in, out] the_rbtree is the red-black tree control.
+ *
+ * @param the_node[out] is the node to prepend.
+ */
+void _RBTree_Prepend( RBTree_Control *the_rbtree, RBTree_Node *the_node );
+
+/**
* @brief Red-black tree visitor.
*
* @param[in] node The node.
diff --git a/cpukit/include/rtems/score/scheduler.h b/cpukit/include/rtems/score/scheduler.h
index da1e030ab8..95b4414bea 100644
--- a/cpukit/include/rtems/score/scheduler.h
+++ b/cpukit/include/rtems/score/scheduler.h
@@ -135,6 +135,61 @@ typedef struct {
);
/**
+ * @brief Makes the node sticky.
+ *
+ * This operation is used by _Thread_Priority_update_and_make_sticky(). It
+ * is only called for the scheduler node of the home scheduler.
+ *
+ * Uniprocessor schedulers schould provide
+ * _Scheduler_default_Sticky_do_nothing() for this operation.
+ *
+ * SMP schedulers should provide this operation using
+ * _Scheduler_SMP_Make_sticky().
+ *
+ * The make and clean sticky operations are an optimization to simplify the
+ * control flow in the update priority operation. The update priority
+ * operation is used for all scheduler nodes and not just the scheduler node
+ * of home schedulers. The update priority operation is a commonly used
+ * operations together with block and unblock. The make and clean sticky
+ * operations are used only in specific scenarios.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to make sticky.
+ */
+ void ( *make_sticky )(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+ );
+
+ /**
+ * @brief Cleans the sticky property from the node.
+ *
+ * This operation is used by _Thread_Priority_update_and_clean_sticky(). It
+ * is only called for the scheduler node of the home scheduler.
+ *
+ * Uniprocessor schedulers schould provide
+ * _Scheduler_default_Sticky_do_nothing() for this operation.
+ *
+ * SMP schedulers should provide this operation using
+ * _Scheduler_SMP_Clean_sticky().
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to clean the sticky property.
+ */
+ void ( *clean_sticky )(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+ );
+
+ /**
* @brief Pin thread operation.
*
* @param[in] scheduler The scheduler instance of the specified processor.
@@ -217,9 +272,6 @@ typedef struct {
Thread_queue_Context *
);
- /** @see _Scheduler_Tick() */
- void ( *tick )( const Scheduler_Control *, Thread_Control * );
-
/** @see _Scheduler_Start_idle() */
void ( *start_idle )(
const Scheduler_Control *,
@@ -403,26 +455,16 @@ 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.
+ * This default implementation for the make and clean sticky operations
+ * should be used by uniprocessor schedulers if SMP support is enabled.
*
- * @return Always returns false.
- */
- bool _Scheduler_default_Ask_for_help(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- Scheduler_Node *node
- );
-
- /**
- * @brief Does nothing.
+ * @param scheduler is an unused parameter.
*
- * @param scheduler This parameter is unused.
- * @param the_thread This parameter is unused.
- * @param node This parameter is unused.
+ * @param the_thread is an unused parameter.
+ *
+ * @param node is an unused parameter.
*/
- void _Scheduler_default_Reconsider_help_request(
+ void _Scheduler_default_Sticky_do_nothing(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
Scheduler_Node *node
@@ -431,44 +473,73 @@ Priority_Control _Scheduler_default_Unmap_priority(
/**
* @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 the_thread This parameter is unused.
* @param node This parameter is unused.
- * @param next_state This parameter is unused.
+ * @param cpu 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_Sticky_do_nothing, \
+ _Scheduler_default_Sticky_do_nothing, \
+ _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
/**
@@ -545,20 +616,6 @@ void _Scheduler_default_Cancel_job(
);
/**
- * @brief Performs tick operations depending on the CPU budget algorithm for
- * each executing thread.
- *
- * This routine is invoked as part of processing each clock tick.
- *
- * @param scheduler The scheduler.
- * @param[in, out] executing An executing thread.
- */
-void _Scheduler_default_Tick(
- const Scheduler_Control *scheduler,
- Thread_Control *executing
-);
-
-/**
* @brief Starts an idle thread.
*
* @param scheduler This parameter is unused.
@@ -594,11 +651,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..8a9a49ccd9 100644
--- a/cpukit/include/rtems/score/schedulercbs.h
+++ b/cpukit/include/rtems/score/schedulercbs.h
@@ -62,14 +62,13 @@ 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. */
@@ -394,15 +393,9 @@ int _Scheduler_CBS_Set_parameters (
);
/**
- * @brief Invoked when a limited time quantum is exceeded.
- *
- * This routine is invoked when a limited time quantum is exceeded.
- *
- * @param the_thread The thread that exceeded a limited time quantum.
+ * @brief These are the CBS CPU budget operations.
*/
-void _Scheduler_CBS_Budget_callout(
- Thread_Control *the_thread
-);
+extern const Thread_CPU_budget_operations _Scheduler_CBS_Budget;
/**
* @brief Initializes a CBS specific scheduler node of @a the_thread.
diff --git a/cpukit/include/rtems/score/scheduleredf.h b/cpukit/include/rtems/score/scheduleredf.h
index 065b511a14..258563217f 100644
--- a/cpukit/include/rtems/score/scheduleredf.h
+++ b/cpukit/include/rtems/score/scheduleredf.h
@@ -61,14 +61,13 @@ 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..75865e5a6e 100644
--- a/cpukit/include/rtems/score/scheduleredfsmp.h
+++ b/cpukit/include/rtems/score/scheduleredfsmp.h
@@ -79,9 +79,18 @@ typedef struct {
RBTree_Control Queue;
/**
- * @brief The scheduled thread of the corresponding processor.
+ * @brief If this member is not NULL, then it references the scheduled thread
+ * affine only to the corresponding processor, otherwise the processor is
+ * allocated to a thread which may execute on any of the processors owned
+ * by the scheduler.
*/
- Scheduler_EDF_SMP_Node *scheduled;
+ Scheduler_EDF_SMP_Node *affine_scheduled;
+
+ /**
+ * @brief This member references the thread allocated to the corresponding
+ * processor.
+ */
+ Scheduler_EDF_SMP_Node *allocated;
} Scheduler_EDF_SMP_Ready_queue;
typedef struct {
@@ -110,7 +119,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, \
@@ -120,6 +129,8 @@ typedef struct {
_Scheduler_EDF_SMP_Ask_for_help, \
_Scheduler_EDF_SMP_Reconsider_help_request, \
_Scheduler_EDF_SMP_Withdraw_node, \
+ _Scheduler_EDF_SMP_Make_sticky, \
+ _Scheduler_EDF_SMP_Clean_sticky, \
_Scheduler_EDF_SMP_Pin, \
_Scheduler_EDF_SMP_Unpin, \
_Scheduler_EDF_SMP_Add_processor, \
@@ -128,7 +139,6 @@ typedef struct {
_Scheduler_default_Node_destroy, \
_Scheduler_EDF_Release_job, \
_Scheduler_EDF_Cancel_job, \
- _Scheduler_default_Tick, \
_Scheduler_EDF_SMP_Start_idle, \
_Scheduler_EDF_SMP_Set_affinity \
}
@@ -241,6 +251,36 @@ void _Scheduler_EDF_SMP_Withdraw_node(
);
/**
+ * @brief Makes the node sticky.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to make sticky.
+ */
+void _Scheduler_EDF_SMP_Make_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
+ * @brief Cleans the sticky property from the node.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to clean the sticky property.
+ */
+void _Scheduler_EDF_SMP_Clean_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
* @brief Pin thread operation.
*
* @param scheduler The scheduler instance of the specified processor.
diff --git a/cpukit/include/rtems/score/schedulerimpl.h b/cpukit/include/rtems/score/schedulerimpl.h
index 98f8e337fd..dda1b4ee6e 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -174,30 +174,6 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Is_non_preempt_mode_supported(
}
#endif
-#if defined(RTEMS_SMP)
-void _Scheduler_Request_ask_for_help( Thread_Control *the_thread );
-
-/**
- * @brief Registers an ask for help request if necessary.
- *
- * The actual ask for help operation is carried out during
- * _Thread_Do_dispatch() on a processor related to the thread. This yields a
- * better separation of scheduler instances. A thread of one scheduler
- * instance should not be forced to carry out too much work for threads on
- * other scheduler instances.
- *
- * @param the_thread The thread in need for help.
- */
-RTEMS_INLINE_ROUTINE void _Scheduler_Ask_for_help( Thread_Control *the_thread )
-{
- _Assert( _Thread_State_is_owner( the_thread ) );
-
- if ( the_thread->Scheduler.helping_nodes > 0 ) {
- _Scheduler_Request_ask_for_help( the_thread );
- }
-}
-#endif
-
/**
* The preferred method to add a new scheduler is to define the jump table
* entries and add a case to the _Scheduler_Initialize routine.
@@ -405,65 +381,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update_priority( Thread_Control *the_thread
#endif
}
-#if defined(RTEMS_SMP)
-/**
- * @brief Changes the sticky level of the home scheduler node and propagates a
- * priority change of a thread to the scheduler.
- *
- * @param the_thread The thread changing its priority or sticky level.
- *
- * @see _Scheduler_Update_priority().
- */
-RTEMS_INLINE_ROUTINE void _Scheduler_Priority_and_sticky_update(
- Thread_Control *the_thread,
- int sticky_level_change
-)
-{
- Chain_Node *node;
- const Chain_Node *tail;
- Scheduler_Node *scheduler_node;
- const Scheduler_Control *scheduler;
- ISR_lock_Context lock_context;
-
- _Thread_Scheduler_process_requests( the_thread );
-
- node = _Chain_First( &the_thread->Scheduler.Scheduler_nodes );
- scheduler_node = SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( node );
- scheduler = _Scheduler_Node_get_scheduler( scheduler_node );
-
- _Scheduler_Acquire_critical( scheduler, &lock_context );
-
- scheduler_node->sticky_level += sticky_level_change;
- _Assert( scheduler_node->sticky_level >= 0 );
-
- ( *scheduler->Operations.update_priority )(
- scheduler,
- the_thread,
- scheduler_node
- );
-
- _Scheduler_Release_critical( scheduler, &lock_context );
-
- tail = _Chain_Immutable_tail( &the_thread->Scheduler.Scheduler_nodes );
- node = _Chain_Next( node );
-
- while ( node != tail ) {
- scheduler_node = SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( node );
- scheduler = _Scheduler_Node_get_scheduler( scheduler_node );
-
- _Scheduler_Acquire_critical( scheduler, &lock_context );
- ( *scheduler->Operations.update_priority )(
- scheduler,
- the_thread,
- scheduler_node
- );
- _Scheduler_Release_critical( scheduler, &lock_context );
-
- node = _Chain_Next( node );
- }
-}
-#endif
-
/**
* @brief Maps a thread priority from the user domain to the scheduler domain.
*
@@ -600,44 +517,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Cancel_job(
}
/**
- * @brief Scheduler method invoked at each clock tick.
- *
- * This method is invoked at each clock tick to allow the scheduler
- * implementation to perform any activities required. For the
- * scheduler which support standard RTEMS features, this includes
- * time-slicing management.
- *
- * @param cpu The cpu control for the operation.
- */
-RTEMS_INLINE_ROUTINE void _Scheduler_Tick( const Per_CPU_Control *cpu )
-{
- const Scheduler_Control *scheduler;
- Thread_Control *executing;
-
- scheduler = _Scheduler_Get_by_CPU( cpu );
-
-#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 );
-}
-
-/**
* @brief Starts the idle thread for a particular processor.
*
* @param scheduler The scheduler instance.
@@ -799,7 +678,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Generic_block(
/* TODO: flash critical section? */
- if ( _Thread_Is_executing( the_thread ) || _Thread_Is_heir( the_thread ) ) {
+ if ( _Thread_Is_heir( the_thread ) ) {
( *schedule )( scheduler, the_thread, true );
}
}
@@ -895,26 +774,26 @@ RTEMS_INLINE_ROUTINE uint32_t _Scheduler_Get_index(
#if defined(RTEMS_SMP)
/**
- * @brief Gets an idle thread from the scheduler instance.
+ * @brief Gets a scheduler node which is owned by an unused idle thread.
*
- * @param context The scheduler instance context.
+ * @param arg is the handler argument.
*
- * @return idle An idle thread for use. This function must always return an
- * idle thread. If none is available, then this is a fatal error.
+ * @return Returns a scheduler node owned by an idle thread for use. This
+ * handler must always return a node. If none is available, then this is a
+ * fatal error.
*/
-typedef Thread_Control *( *Scheduler_Get_idle_thread )(
- Scheduler_Context *context
-);
+typedef Scheduler_Node *( *Scheduler_Get_idle_node )( void *arg );
/**
- * @brief Releases an idle thread to the scheduler instance for reuse.
+ * @brief Releases the scheduler node which is owned by an idle thread.
+ *
+ * @param node is the node to release.
*
- * @param context The scheduler instance context.
- * @param idle The idle thread to release.
+ * @param arg is the handler argument.
*/
-typedef void ( *Scheduler_Release_idle_thread )(
- Scheduler_Context *context,
- Thread_Control *idle
+typedef void ( *Scheduler_Release_idle_node )(
+ Scheduler_Node *node,
+ void *arg
);
/**
@@ -938,319 +817,119 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Thread_change_state(
}
/**
- * @brief Sets the scheduler node's idle thread.
+ * @brief Uses an idle thread for the scheduler node.
*
- * @param[in, out] node The node to receive an idle thread.
- * @param idle The idle thread control for the operation.
- */
-RTEMS_INLINE_ROUTINE void _Scheduler_Set_idle_thread(
- Scheduler_Node *node,
- Thread_Control *idle
-)
-{
- _Assert( _Scheduler_Node_get_idle( node ) == NULL );
- _Assert(
- _Scheduler_Node_get_owner( node ) == _Scheduler_Node_get_user( node )
- );
-
- _Scheduler_Node_set_user( node, idle );
- node->idle = idle;
-}
-
-/**
- * @brief Uses an idle thread for this scheduler node.
+ * @param[in, out] node is the node which wants to use an idle thread.
*
- * A thread whose home scheduler node has a sticky level greater than zero may
- * use an idle thread in the home scheduler instance in the case it executes
- * currently in another scheduler instance or in the case it is in a blocking
- * state.
+ * @param get_idle_node is the get idle node handler.
*
- * @param context The scheduler instance context.
- * @param[in, out] node The node which wants to use the idle thread.
- * @param cpu The processor for the idle thread.
- * @param get_idle_thread Function to get an idle thread.
+ * @param arg is the handler argument.
*/
RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Use_idle_thread(
- Scheduler_Context *context,
- Scheduler_Node *node,
- Per_CPU_Control *cpu,
- Scheduler_Get_idle_thread get_idle_thread
+ Scheduler_Node *node,
+ Scheduler_Get_idle_node get_idle_node,
+ void *arg
)
{
- Thread_Control *idle = ( *get_idle_thread )( context );
+ Scheduler_Node *idle_node;
+ Thread_Control *idle;
+
+ idle_node = ( *get_idle_node )( arg );
+ idle = _Scheduler_Node_get_owner( idle_node );
+ _Assert( idle->is_idle );
+ _Scheduler_Node_set_idle_user( node, idle );
- _Scheduler_Set_idle_thread( node, idle );
- _Thread_Set_CPU( idle, cpu );
return idle;
}
/**
- * @brief This enumeration defines what a scheduler should do with a node which
- * could be scheduled.
- */
-typedef enum {
- SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE,
- SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE,
- SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK
-} Scheduler_Try_to_schedule_action;
-
-/**
- * @brief Tries to schedule the scheduler node.
- *
- * When a scheduler needs to schedule a node, it shall use this function to
- * determine what it shall do with the node. The node replaces a victim node if
- * it can be scheduled.
- *
- * This function uses the state of the node and the scheduler state of the owner
- * thread to determine what shall be done. Each scheduler maintains its nodes
- * independent of other schedulers. This function ensures that a thread is
- * scheduled by at most one scheduler. If a node requires an executing thread
- * due to some locking protocol and the owner thread is already scheduled by
- * another scheduler, then an idle thread shall be attached to the node.
- *
- * @param[in, out] context is the scheduler context.
- * @param[in, out] node is the node which could be scheduled.
- * @param idle is an idle thread used by the victim node or NULL.
- * @param get_idle_thread points to a function to get an idle thread.
- *
- * @retval SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE The node shall be scheduled.
- *
- * @retval SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE The node shall be
- * scheduled and the provided idle thread shall be attached to the node. This
- * action is returned, if the node cannot use the owner thread and shall use
- * an idle thread instead. In this case, the idle thread is provided by the
- * victim node.
- *
- * @retval SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK The node shall be blocked. This
- * action is returned, if the owner thread is already scheduled by another
- * scheduler.
+ * @brief Releases the idle thread used by the scheduler node.
+ *
+ * @param[in, out] node is the node which wants to release the idle thread.
+ *
+ * @param idle is the idle thread to release.
+ *
+ * @param release_idle_node is the release idle node handler.
+ *
+ * @param arg is the handler argument.
*/
-RTEMS_INLINE_ROUTINE Scheduler_Try_to_schedule_action
-_Scheduler_Try_to_schedule_node(
- Scheduler_Context *context,
- Scheduler_Node *node,
- const Thread_Control *idle,
- Scheduler_Get_idle_thread get_idle_thread
+RTEMS_INLINE_ROUTINE void _Scheduler_Release_idle_thread(
+ Scheduler_Node *node,
+ const Thread_Control *idle,
+ Scheduler_Release_idle_node release_idle_node,
+ void *arg
)
{
- ISR_lock_Context lock_context;
- Scheduler_Try_to_schedule_action action;
- Thread_Control *owner;
+ Thread_Control *owner;
+ Scheduler_Node *idle_node;
- action = SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE;
owner = _Scheduler_Node_get_owner( node );
- _Assert( _Scheduler_Node_get_user( node ) == owner );
- _Assert( _Scheduler_Node_get_idle( node ) == NULL );
-
- _Thread_Scheduler_acquire_critical( owner, &lock_context );
-
- if ( owner->Scheduler.state == THREAD_SCHEDULER_READY ) {
- _Thread_Scheduler_cancel_need_for_help( owner, _Thread_Get_CPU( owner ) );
- _Scheduler_Thread_change_state( owner, THREAD_SCHEDULER_SCHEDULED );
- } else if (
- owner->Scheduler.state == THREAD_SCHEDULER_SCHEDULED
- && node->sticky_level <= 1
- ) {
- action = SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK;
- } else if ( node->sticky_level == 0 ) {
- action = SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK;
- } else if ( idle != NULL ) {
- action = SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE;
- } else {
- _Scheduler_Use_idle_thread(
- context,
- node,
- _Thread_Get_CPU( owner ),
- get_idle_thread
- );
- }
-
- _Thread_Scheduler_release_critical( owner, &lock_context );
- return action;
+ _Assert( _Scheduler_Node_get_user( node ) == idle );
+ _Scheduler_Node_set_user( node, owner );
+ node->idle = NULL;
+ idle_node = _Thread_Scheduler_get_home_node( idle );
+ ( *release_idle_node )( idle_node, arg );
}
/**
- * @brief Releases an idle thread using this scheduler node.
+ * @brief Releases the idle thread used by the scheduler node if the node uses
+ * an idle thread.
+ *
+ * @param[in, out] node is the node which wants to release the idle thread.
+ *
+ * @param release_idle_node is the release idle node handler.
+ *
+ * @param arg is the handler argument.
*
- * @param context The scheduler instance context.
- * @param[in, out] node The node which may have an idle thread as user.
- * @param release_idle_thread Function to release an idle thread.
+ * @retval NULL The scheduler node did not use an idle thread.
*
- * @retval idle The idle thread which used this node.
- * @retval NULL This node had no idle thread as an user.
+ * @return Returns the idle thread used by the scheduler node.
*/
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Release_idle_thread(
- Scheduler_Context *context,
- Scheduler_Node *node,
- Scheduler_Release_idle_thread release_idle_thread
+RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Release_idle_thread_if_necessary(
+ Scheduler_Node *node,
+ Scheduler_Release_idle_node release_idle_node,
+ void *arg
)
{
- Thread_Control *idle = _Scheduler_Node_get_idle( node );
+ Thread_Control *idle;
- if ( idle != NULL ) {
- Thread_Control *owner = _Scheduler_Node_get_owner( node );
+ idle = _Scheduler_Node_get_idle( node );
- node->idle = NULL;
- _Scheduler_Node_set_user( node, owner );
- ( *release_idle_thread )( context, idle );
+ if ( idle != NULL ) {
+ _Scheduler_Release_idle_thread( node, idle, release_idle_node, arg );
}
return idle;
}
/**
- * @brief Exchanges an idle thread from the scheduler node that uses it
- * right now to another scheduler node.
+ * @brief Discards the idle thread used by the scheduler node.
*
- * @param needs_idle The scheduler node that needs an idle thread.
- * @param uses_idle The scheduler node that used the idle thread.
- * @param idle The idle thread that is exchanged.
- */
-RTEMS_INLINE_ROUTINE void _Scheduler_Exchange_idle_thread(
- Scheduler_Node *needs_idle,
- Scheduler_Node *uses_idle,
- Thread_Control *idle
-)
-{
- uses_idle->idle = NULL;
- _Scheduler_Node_set_user(
- uses_idle,
- _Scheduler_Node_get_owner( uses_idle )
- );
- _Scheduler_Set_idle_thread( needs_idle, idle );
-}
-
-/**
- * @brief Blocks this scheduler node.
- *
- * @param context The scheduler instance context.
- * @param[in, out] thread The thread which wants to get blocked referencing this
- * node. This is not necessarily the user of this node in case the node
- * participates in the scheduler helping protocol.
- * @param[in, out] node The node which wants to get blocked.
- * @param is_scheduled This node is scheduled.
- * @param get_idle_thread Function to get an idle thread.
- *
- * @retval thread_cpu The processor of the thread. Indicates to continue with
- * the blocking operation.
- * @retval NULL Otherwise.
- */
-RTEMS_INLINE_ROUTINE Per_CPU_Control *_Scheduler_Block_node(
- Scheduler_Context *context,
- Thread_Control *thread,
- Scheduler_Node *node,
- bool is_scheduled,
- Scheduler_Get_idle_thread get_idle_thread
-)
-{
- int sticky_level;
- ISR_lock_Context lock_context;
- Per_CPU_Control *thread_cpu;
-
- sticky_level = node->sticky_level;
- --sticky_level;
- node->sticky_level = sticky_level;
- _Assert( sticky_level >= 0 );
-
- _Thread_Scheduler_acquire_critical( thread, &lock_context );
- thread_cpu = _Thread_Get_CPU( thread );
- _Thread_Scheduler_cancel_need_for_help( thread, thread_cpu );
- _Scheduler_Thread_change_state( thread, THREAD_SCHEDULER_BLOCKED );
- _Thread_Scheduler_release_critical( thread, &lock_context );
-
- if ( sticky_level > 0 ) {
- if ( is_scheduled && _Scheduler_Node_get_idle( node ) == NULL ) {
- Thread_Control *idle;
-
- idle = _Scheduler_Use_idle_thread(
- context,
- node,
- thread_cpu,
- get_idle_thread
- );
- _Thread_Dispatch_update_heir( _Per_CPU_Get(), thread_cpu, idle );
- }
-
- return NULL;
- }
-
- _Assert( thread == _Scheduler_Node_get_user( node ) );
- return thread_cpu;
-}
-
-/**
- * @brief Discard the idle thread from the scheduler node.
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the node which wants to release the idle thread.
+ *
+ * @param release_idle_node is the release idle node handler.
*
- * @param context The scheduler context.
- * @param[in, out] the_thread The thread for the operation.
- * @param[in, out] node The scheduler node to discard the idle thread from.
- * @param release_idle_thread Method to release the idle thread from the context.
+ * @param arg is the handler argument.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Discard_idle_thread(
- Scheduler_Context *context,
- Thread_Control *the_thread,
- Scheduler_Node *node,
- Scheduler_Release_idle_thread release_idle_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node,
+ Scheduler_Release_idle_node release_idle_node,
+ void *arg
)
{
Thread_Control *idle;
- Thread_Control *owner;
Per_CPU_Control *cpu;
idle = _Scheduler_Node_get_idle( node );
- owner = _Scheduler_Node_get_owner( node );
-
- node->idle = NULL;
- _Assert( _Scheduler_Node_get_user( node ) == idle );
- _Scheduler_Node_set_user( node, owner );
- ( *release_idle_thread )( context, idle );
+ _Scheduler_Release_idle_thread( node, idle, release_idle_node, arg );
cpu = _Thread_Get_CPU( idle );
_Thread_Set_CPU( the_thread, cpu );
_Thread_Dispatch_update_heir( _Per_CPU_Get(), cpu, the_thread );
}
-
-/**
- * @brief Unblocks this scheduler node.
- *
- * @param context The scheduler instance context.
- * @param[in, out] the_thread The thread which wants to get unblocked.
- * @param[in, out] node The node which wants to get unblocked.
- * @param is_scheduled This node is scheduled.
- * @param release_idle_thread Function to release an idle thread.
- *
- * @retval true Continue with the unblocking operation.
- * @retval false Do not continue with the unblocking operation.
- */
-RTEMS_INLINE_ROUTINE bool _Scheduler_Unblock_node(
- Scheduler_Context *context,
- Thread_Control *the_thread,
- Scheduler_Node *node,
- bool is_scheduled,
- Scheduler_Release_idle_thread release_idle_thread
-)
-{
- bool unblock;
-
- ++node->sticky_level;
- _Assert( node->sticky_level > 0 );
-
- if ( is_scheduled ) {
- _Scheduler_Discard_idle_thread(
- context,
- the_thread,
- node,
- release_idle_thread
- );
- _Scheduler_Thread_change_state( the_thread, THREAD_SCHEDULER_SCHEDULED );
- unblock = false;
- } else {
- _Scheduler_Thread_change_state( the_thread, THREAD_SCHEDULER_READY );
- unblock = true;
- }
-
- return unblock;
-}
#endif
/**
@@ -1270,8 +949,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
if ( heir != new_heir && ( heir->is_preemptible || force_dispatch ) ) {
#if defined(RTEMS_SMP)
/*
- * We need this state only for _Thread_Get_CPU_time_used(). Cannot use
- * _Scheduler_Thread_change_state() since THREAD_SCHEDULER_BLOCKED to
+ * We need this state only for _Thread_Get_CPU_time_used_locked(). Cannot
+ * use _Scheduler_Thread_change_state() since THREAD_SCHEDULER_BLOCKED to
* THREAD_SCHEDULER_BLOCKED state changes are illegal for the real SMP
* schedulers.
*/
diff --git a/cpukit/include/rtems/score/schedulernodeimpl.h b/cpukit/include/rtems/score/schedulernodeimpl.h
index e222de953b..ecdc3c6d62 100644
--- a/cpukit/include/rtems/score/schedulernodeimpl.h
+++ b/cpukit/include/rtems/score/schedulernodeimpl.h
@@ -264,6 +264,27 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_idle(
{
return node->idle;
}
+
+/**
+ * @brief Sets the scheduler node's user to the idle thread.
+ *
+ * @param[in, out] node is the node to receive an idle thread.
+ *
+ * @param idle is the idle thread to use.
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_idle_user(
+ Scheduler_Node *node,
+ Thread_Control *idle
+)
+{
+ _Assert( _Scheduler_Node_get_idle( node ) == NULL );
+ _Assert(
+ _Scheduler_Node_get_owner( node ) == _Scheduler_Node_get_user( node )
+ );
+
+ _Scheduler_Node_set_user( node, idle );
+ node->idle = idle;
+}
#endif
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/score/schedulerpriority.h b/cpukit/include/rtems/score/schedulerpriority.h
index 66b976ef8f..1ddbb4a8cc 100644
--- a/cpukit/include/rtems/score/schedulerpriority.h
+++ b/cpukit/include/rtems/score/schedulerpriority.h
@@ -52,14 +52,13 @@ 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..d77629b39d 100644
--- a/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -65,15 +65,16 @@ 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_priority_affinity_SMP_Make_sticky, \
+ _Scheduler_priority_affinity_SMP_Clean_sticky, \
+ _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, \
_Scheduler_default_Node_destroy, \
_Scheduler_default_Release_job, \
_Scheduler_default_Cancel_job, \
- _Scheduler_default_Tick, \
_Scheduler_SMP_Start_idle, \
_Scheduler_priority_affinity_SMP_Set_affinity \
}
@@ -182,6 +183,36 @@ void _Scheduler_priority_affinity_SMP_Withdraw_node(
);
/**
+ * @brief Makes the node sticky.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to make sticky.
+ */
+void _Scheduler_priority_affinity_SMP_Make_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
+ * @brief Cleans the sticky property from the node.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to clean the sticky property.
+ */
+void _Scheduler_priority_affinity_SMP_Clean_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
* @brief Adds @a idle to @a scheduler.
*
* @param[in, out] scheduler The scheduler instance to add the processor to.
diff --git a/cpukit/include/rtems/score/schedulerprioritysmp.h b/cpukit/include/rtems/score/schedulerprioritysmp.h
index d6ab6f6fdd..21916647bc 100644
--- a/cpukit/include/rtems/score/schedulerprioritysmp.h
+++ b/cpukit/include/rtems/score/schedulerprioritysmp.h
@@ -57,6 +57,7 @@ extern "C" {
*/
typedef struct {
Scheduler_SMP_Context Base;
+ Chain_Control *idle_ready_queue;
Priority_bit_map_Control Bit_map;
Chain_Control Ready[ RTEMS_ZERO_LENGTH_ARRAY ];
} Scheduler_priority_SMP_Context;
@@ -93,17 +94,18 @@ 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_priority_SMP_Make_sticky, \
+ _Scheduler_priority_SMP_Clean_sticky, \
+ _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, \
_Scheduler_default_Node_destroy, \
_Scheduler_default_Release_job, \
_Scheduler_default_Cancel_job, \
- _Scheduler_default_Tick, \
_Scheduler_SMP_Start_idle \
- SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+ SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
}
/**
@@ -216,6 +218,36 @@ void _Scheduler_priority_SMP_Withdraw_node(
);
/**
+ * @brief Makes the node sticky.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to make sticky.
+ */
+void _Scheduler_priority_SMP_Make_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
+ * @brief Cleans the sticky property from the node.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to clean the sticky property.
+ */
+void _Scheduler_priority_SMP_Clean_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
* @brief Adds @a idle to @a scheduler.
*
* @param[in, out] scheduler The scheduler instance to add the processor to.
diff --git a/cpukit/include/rtems/score/schedulerprioritysmpimpl.h b/cpukit/include/rtems/score/schedulerprioritysmpimpl.h
index 6e14200840..8ffd8d01c1 100644
--- a/cpukit/include/rtems/score/schedulerprioritysmpimpl.h
+++ b/cpukit/include/rtems/score/schedulerprioritysmpimpl.h
@@ -156,6 +156,41 @@ static inline void _Scheduler_priority_SMP_Extract_from_ready(
);
}
+static inline Scheduler_Node *_Scheduler_priority_SMP_Get_idle( void *arg )
+{
+ Scheduler_priority_SMP_Context *self;
+ Scheduler_priority_SMP_Node *lowest_ready;
+
+ self = _Scheduler_priority_SMP_Get_self( arg );
+ lowest_ready = (Scheduler_priority_SMP_Node *)
+ _Chain_Last( self->idle_ready_queue );
+ _Scheduler_priority_Ready_queue_extract(
+ &lowest_ready->Base.Base.Node.Chain,
+ &lowest_ready->Ready_queue,
+ &self->Bit_map
+ );
+
+ return &lowest_ready->Base.Base;
+}
+
+static inline void _Scheduler_priority_SMP_Release_idle(
+ Scheduler_Node *node_base,
+ void *arg
+)
+{
+ Scheduler_priority_SMP_Context *self;
+ Scheduler_priority_SMP_Node *node;
+
+ self = _Scheduler_priority_SMP_Get_self( arg );
+ node = _Scheduler_priority_SMP_Node_downcast( node_base );
+
+ _Scheduler_priority_Ready_queue_enqueue(
+ &node->Base.Base.Node.Chain,
+ &node->Ready_queue,
+ &self->Bit_map
+ );
+}
+
static inline void _Scheduler_priority_SMP_Do_update(
Scheduler_Context *context,
Scheduler_Node *node_to_update,
diff --git a/cpukit/include/rtems/score/schedulersimple.h b/cpukit/include/rtems/score/schedulersimple.h
index e201890f21..15471a6498 100644
--- a/cpukit/include/rtems/score/schedulersimple.h
+++ b/cpukit/include/rtems/score/schedulersimple.h
@@ -51,14 +51,13 @@ 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/schedulersimpleimpl.h b/cpukit/include/rtems/score/schedulersimpleimpl.h
index 08ad7b8c66..9d762e058a 100644
--- a/cpukit/include/rtems/score/schedulersimpleimpl.h
+++ b/cpukit/include/rtems/score/schedulersimpleimpl.h
@@ -48,21 +48,26 @@ RTEMS_INLINE_ROUTINE Scheduler_simple_Context *
/**
* @brief Checks if the priority is less or equal than the priority of the node.
*
- * @param to_insert The priority to check whether it is less or equal than @a next.
- * @param next The Chain node to compare the priority of.
+ * @param key is the priority to compare.
+ *
+ * @param to_insert is the chain node to insert.
+ *
+ * @param next is the chain node to compare the priority of.
*
* @retval true @a to_insert is smaller or equal than the priority of @a next.
* @retval false @a to_insert is greater than the priority of @a next.
*/
RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Priority_less_equal(
- const void *to_insert,
+ const void *key,
+ const Chain_Node *to_insert,
const Chain_Node *next
)
{
const unsigned int *priority_to_insert;
const Thread_Control *thread_next;
- priority_to_insert = (const unsigned int *) to_insert;
+ (void) to_insert;
+ priority_to_insert = (const unsigned int *) key;
thread_next = (const Thread_Control *) next;
return *priority_to_insert <= _Thread_Get_priority( thread_next );
diff --git a/cpukit/include/rtems/score/schedulersimplesmp.h b/cpukit/include/rtems/score/schedulersimplesmp.h
index 6b7e111208..3b6f43869e 100644
--- a/cpukit/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/include/rtems/score/schedulersimplesmp.h
@@ -75,17 +75,18 @@ 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_simple_SMP_Make_sticky, \
+ _Scheduler_simple_SMP_Clean_sticky, \
+ _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, \
_Scheduler_default_Node_destroy, \
_Scheduler_default_Release_job, \
_Scheduler_default_Cancel_job, \
- _Scheduler_default_Tick, \
_Scheduler_SMP_Start_idle \
- SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+ SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
}
/**
@@ -196,6 +197,36 @@ void _Scheduler_simple_SMP_Withdraw_node(
);
/**
+ * @brief Makes the node sticky.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to make sticky.
+ */
+void _Scheduler_simple_SMP_Make_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
+ * @brief Cleans the sticky property from the node.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to clean the sticky property.
+ */
+void _Scheduler_simple_SMP_Clean_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
* @brief Adds @a idle to @a scheduler.
*
* @param[in, out] scheduler The scheduler instance to add the processor to.
diff --git a/cpukit/include/rtems/score/schedulersmp.h b/cpukit/include/rtems/score/schedulersmp.h
index 1d5294b4f0..fb4d6c46d2 100644
--- a/cpukit/include/rtems/score/schedulersmp.h
+++ b/cpukit/include/rtems/score/schedulersmp.h
@@ -55,15 +55,6 @@ typedef struct {
* @brief The chain of scheduled nodes.
*/
Chain_Control Scheduled;
-
- /**
- * @brief Chain of the available idle threads.
- *
- * Idle threads are used for the scheduler helping protocol. It is crucial
- * that the idle threads preserve their relative order. This is the case for
- * this priority based scheduler.
- */
- Chain_Control Idle_threads;
} Scheduler_SMP_Context;
/**
diff --git a/cpukit/include/rtems/score/schedulersmpimpl.h b/cpukit/include/rtems/score/schedulersmpimpl.h
index dbfc241b18..c37f53c8c0 100644
--- a/cpukit/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/include/rtems/score/schedulersmpimpl.h
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (c) 2013, 2017 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2013, 2021 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -282,7 +282,11 @@ typedef bool ( *Scheduler_SMP_Has_ready )(
typedef Scheduler_Node *( *Scheduler_SMP_Get_highest_ready )(
Scheduler_Context *context,
- Scheduler_Node *node
+ Scheduler_Node *filter
+);
+
+typedef Scheduler_Node *( *Scheduler_SMP_Get_lowest_ready )(
+ Scheduler_Context *context
);
typedef Scheduler_Node *( *Scheduler_SMP_Get_lowest_scheduled )(
@@ -330,11 +334,16 @@ typedef bool ( *Scheduler_SMP_Enqueue )(
Priority_Control priority
);
+typedef void ( *Scheduler_SMP_Enqueue_scheduled )(
+ Scheduler_Context *context,
+ Scheduler_Node *node_to_enqueue,
+ Priority_Control priority
+);
+
typedef void ( *Scheduler_SMP_Allocate_processor )(
Scheduler_Context *context,
Scheduler_Node *scheduled,
- Scheduler_Node *victim,
- Per_CPU_Control *victim_cpu
+ Per_CPU_Control *cpu
);
typedef void ( *Scheduler_SMP_Register_idle )(
@@ -364,21 +373,26 @@ static inline void _Scheduler_SMP_Do_nothing_register_idle(
/**
* @brief Checks if @a to_insert is less or equal than the priority of the chain node.
*
- * @param to_insert The priority to compare.
- * @param next The chain node to compare the priority of.
+ * @param key is the priority to compare.
+ *
+ * @param to_insert is the chain node to insert.
+ *
+ * @param next is the chain node to compare the priority of.
*
* @retval true @a to_insert is less or equal than the priority of @a next.
* @retval false @a to_insert is greater than the priority of @a next.
*/
static inline bool _Scheduler_SMP_Priority_less_equal(
- const void *to_insert,
+ const void *key,
+ const Chain_Node *to_insert,
const Chain_Node *next
)
{
const Priority_Control *priority_to_insert;
const Scheduler_SMP_Node *node_next;
- priority_to_insert = (const Priority_Control *) to_insert;
+ (void) to_insert;
+ priority_to_insert = (const Priority_Control *) key;
node_next = (const Scheduler_SMP_Node *) next;
return *priority_to_insert <= node_next->priority;
@@ -408,7 +422,6 @@ static inline void _Scheduler_SMP_Initialize(
)
{
_Chain_Initialize_empty( &self->Scheduled );
- _Chain_Initialize_empty( &self->Idle_threads );
}
/**
@@ -550,205 +563,300 @@ static inline bool _Scheduler_SMP_Is_processor_owned_by_us(
}
/**
- * @brief Gets The first idle thread of the given context.
+ * @brief Removes the thread's ask for help request from the processor.
+ *
+ * The caller must be the owner of the thread's scheduler lock.
*
- * @param context The scheduler context to get the first idle thread from.
+ * @param[in, out] thread is the thread of the ask for help request.
*
- * @return The first idle thread of @a context.
+ * @param[in, out] cpu is the processor from which the ask for help request
+ * should be removed.
*/
-static inline Thread_Control *_Scheduler_SMP_Get_idle_thread(
- Scheduler_Context *context
-)
+void _Scheduler_SMP_Remove_ask_for_help_from_processor(
+ Thread_Control *thread,
+ Per_CPU_Control *cpu
+);
+
+/**
+ * @brief Cancels the thread's ask for help request.
+ *
+ * The caller must be the owner of the thread's scheduler lock.
+ *
+ * @param[in, out] thread is the thread of the ask help request.
+ */
+static inline void _Scheduler_SMP_Cancel_ask_for_help( Thread_Control *thread )
{
- Scheduler_SMP_Context *self = _Scheduler_SMP_Get_self( context );
- Thread_Control *idle = (Thread_Control *)
- _Chain_Get_first_unprotected( &self->Idle_threads );
+ Per_CPU_Control *cpu;
- _Assert( &idle->Object.Node != _Chain_Tail( &self->Idle_threads ) );
+ _Assert( _ISR_lock_Is_owner( &thread->Scheduler.Lock ) );
+ cpu = thread->Scheduler.ask_for_help_cpu;
- return idle;
+ if ( RTEMS_PREDICT_FALSE( cpu != NULL ) ) {
+ _Scheduler_SMP_Remove_ask_for_help_from_processor( thread, cpu );
+ }
}
/**
- * @brief Releases the thread and adds it to the idle threads.
+ * @brief Requests to ask for help for the thread.
*
- * @param[in, out] context The scheduler context instance.
- * @param idle The thread to add to the idle threads.
+ * The actual ask for help operations are carried out during
+ * _Thread_Do_dispatch() on the current processor.
+ *
+ * An alternative approach would be to carry out the requests on a processor
+ * related to the thread. This could reduce the overhead for the preempting
+ * thread a bit, however, there are at least two problems with this approach.
+ * Firstly, we have to figure out what is a processor related to the thread.
+ * Secondly, we may need an inter-processor interrupt.
+ *
+ * @param[in, out] thread is the thread in need for help.
*/
-static inline void _Scheduler_SMP_Release_idle_thread(
- Scheduler_Context *context,
- Thread_Control *idle
-)
+static inline void _Scheduler_SMP_Request_ask_for_help( Thread_Control *thread )
{
- Scheduler_SMP_Context *self = _Scheduler_SMP_Get_self( context );
+ ISR_lock_Context lock_context;
+ Per_CPU_Control *cpu_self;
+
+ cpu_self = _Per_CPU_Get();
- _Chain_Prepend_unprotected( &self->Idle_threads, &idle->Object.Node );
+ _Assert( thread->Scheduler.ask_for_help_cpu == NULL );
+ thread->Scheduler.ask_for_help_cpu = cpu_self;
+ cpu_self->dispatch_necessary = true;
+
+ _Per_CPU_Acquire( cpu_self, &lock_context );
+ _Chain_Append_unprotected(
+ &cpu_self->Threads_in_need_for_help,
+ &thread->Scheduler.Help_node
+ );
+ _Per_CPU_Release( cpu_self, &lock_context );
}
/**
- * @brief Extracts the node of the idle thread.
+ * @brief This enumeration defines what a scheduler should do with a node which
+ * could be scheduled.
+ */
+typedef enum {
+ SCHEDULER_SMP_DO_SCHEDULE,
+ SCHEDULER_SMP_DO_NOT_SCHEDULE
+} Scheduler_SMP_Action;
+
+/**
+ * @brief Tries to schedule the scheduler node.
+ *
+ * When an SMP scheduler needs to schedule a node, it shall use this function
+ * to determine what it shall do with the node.
*
- * @param[in, out] idle The thread to extract the node of.
+ * This function uses the state of the node and the scheduler state of the
+ * owner thread to determine what shall be done. Each scheduler maintains its
+ * nodes independent of other schedulers. This function ensures that a thread
+ * is scheduled by at most one scheduler. If a node requires an executing
+ * thread due to some locking protocol and the owner thread is already
+ * scheduled by another scheduler, then an idle thread will be attached to the
+ * node.
+ *
+ * @param[in, out] node is the node which should be scheduled.
+ *
+ * @param get_idle_node is the get idle node handler.
+ *
+ * @param arg is the get idle node handler argument.
+ *
+ * @retval SCHEDULER_SMP_DO_SCHEDULE The node shall be scheduled.
+ *
+ * @retval SCHEDULER_SMP_DO_NOT_SCHEDULE The node shall be blocked. This
+ * action is returned, if the owner thread is already scheduled by another
+ * scheduler.
*/
-static inline void _Scheduler_SMP_Exctract_idle_thread(
- Thread_Control *idle
+static inline Scheduler_SMP_Action _Scheduler_SMP_Try_to_schedule(
+ Scheduler_Node *node,
+ Scheduler_Get_idle_node get_idle_node,
+ void *arg
)
{
- _Chain_Extract_unprotected( &idle->Object.Node );
+ ISR_lock_Context lock_context;
+ Thread_Control *owner;
+ Thread_Scheduler_state owner_state;
+ int owner_sticky_level;
+
+ owner = _Scheduler_Node_get_owner( node );
+ _Assert( _Scheduler_Node_get_idle( node ) == NULL );
+
+ _Thread_Scheduler_acquire_critical( owner, &lock_context );
+ owner_state = owner->Scheduler.state;
+ owner_sticky_level = node->sticky_level;
+
+ if ( RTEMS_PREDICT_TRUE( owner_state == THREAD_SCHEDULER_READY ) ) {
+ _Scheduler_SMP_Cancel_ask_for_help( owner );
+ _Scheduler_Thread_change_state( owner, THREAD_SCHEDULER_SCHEDULED );
+ _Thread_Scheduler_release_critical( owner, &lock_context );
+ return SCHEDULER_SMP_DO_SCHEDULE;
+ }
+
+ _Thread_Scheduler_release_critical( owner, &lock_context );
+
+ if (
+ ( owner_state == THREAD_SCHEDULER_SCHEDULED && owner_sticky_level <= 1 ) ||
+ owner_sticky_level == 0
+ ) {
+ _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED );
+
+ return SCHEDULER_SMP_DO_NOT_SCHEDULE;
+ }
+
+ (void) _Scheduler_Use_idle_thread( node, get_idle_node, arg );
+
+ return SCHEDULER_SMP_DO_SCHEDULE;
}
/**
- * @brief Allocates the cpu for the scheduled thread.
+ * @brief Allocates a processor to the user of the scheduled node.
*
* Attempts to prevent migrations but does not take into account affinity.
*
- * @param context The scheduler context instance.
- * @param scheduled The scheduled node that should be executed next.
- * @param victim If the heir is this node's thread, no processor is allocated.
- * @param[in, out] victim_cpu The cpu to allocate.
+ * @param[in, out] context is the scheduler context.
+ *
+ * @param[in, out] scheduled is the scheduled node that gets the processor allocated.
+ *
+ * @param[in, out] cpu is the processor to allocate.
*/
static inline void _Scheduler_SMP_Allocate_processor_lazy(
Scheduler_Context *context,
Scheduler_Node *scheduled,
- Scheduler_Node *victim,
- Per_CPU_Control *victim_cpu
+ Per_CPU_Control *cpu
)
{
Thread_Control *scheduled_thread = _Scheduler_Node_get_user( scheduled );
- Thread_Control *victim_thread = _Scheduler_Node_get_user( victim );
Per_CPU_Control *scheduled_cpu = _Thread_Get_CPU( scheduled_thread );
Per_CPU_Control *cpu_self = _Per_CPU_Get();
- Thread_Control *heir;
_Assert( _ISR_Get_level() != 0 );
- if ( _Thread_Is_executing_on_a_processor( scheduled_thread ) ) {
- if ( _Scheduler_SMP_Is_processor_owned_by_us( context, scheduled_cpu ) ) {
- heir = scheduled_cpu->heir;
- _Thread_Dispatch_update_heir(
- cpu_self,
- scheduled_cpu,
- scheduled_thread
- );
- } else {
- /* We have to force a migration to our processor set */
- heir = scheduled_thread;
- }
- } else {
- heir = scheduled_thread;
+ if ( cpu == scheduled_cpu ) {
+ _Thread_Set_CPU( scheduled_thread, cpu );
+ _Thread_Dispatch_update_heir( cpu_self, cpu, scheduled_thread );
+
+ return;
}
- if ( heir != victim_thread ) {
- _Thread_Set_CPU( heir, victim_cpu );
- _Thread_Dispatch_update_heir( cpu_self, victim_cpu, heir );
+ if (
+ _Thread_Is_executing_on_a_processor( scheduled_thread ) &&
+ _Scheduler_SMP_Is_processor_owned_by_us( context, scheduled_cpu )
+ ) {
+ Thread_Control *heir = scheduled_cpu->heir;
+ _Thread_Dispatch_update_heir( cpu_self, scheduled_cpu, scheduled_thread );
+ _Thread_Set_CPU( heir, cpu );
+ _Thread_Dispatch_update_heir( cpu_self, cpu, heir );
+
+ return;
}
+
+ _Thread_Set_CPU( scheduled_thread, cpu );
+ _Thread_Dispatch_update_heir( cpu_self, cpu, scheduled_thread );
}
/**
- * @brief Allocates the cpu for the scheduled thread.
+ * @brief Allocates exactly the processor to the user of the scheduled node.
*
* This method is slightly different from
* _Scheduler_SMP_Allocate_processor_lazy() in that it does what it is asked to
* do. _Scheduler_SMP_Allocate_processor_lazy() attempts to prevent migrations
* but does not take into account affinity.
*
- * @param context This parameter is unused.
- * @param scheduled The scheduled node whose thread should be executed next.
- * @param victim This parameter is unused.
- * @param[in, out] victim_cpu The cpu to allocate.
+ * @param[in, out] context is the scheduler context.
+ *
+ * @param[in, out] scheduled is the scheduled node that gets the processor allocated.
+ *
+ * @param[in, out] cpu is the processor to allocate.
*/
static inline void _Scheduler_SMP_Allocate_processor_exact(
Scheduler_Context *context,
Scheduler_Node *scheduled,
- Scheduler_Node *victim,
- Per_CPU_Control *victim_cpu
+ Per_CPU_Control *cpu
)
{
Thread_Control *scheduled_thread = _Scheduler_Node_get_user( scheduled );
Per_CPU_Control *cpu_self = _Per_CPU_Get();
(void) context;
- (void) victim;
- _Thread_Set_CPU( scheduled_thread, victim_cpu );
- _Thread_Dispatch_update_heir( cpu_self, victim_cpu, scheduled_thread );
+ _Thread_Set_CPU( scheduled_thread, cpu );
+ _Thread_Dispatch_update_heir( cpu_self, cpu, scheduled_thread );
}
/**
- * @brief Allocates the cpu for the scheduled thread using the given allocation function.
+ * @brief Allocates the processor to the user of the scheduled node using the
+ * given allocation handler.
*
- * @param context The scheduler context instance.
- * @param scheduled The scheduled node that should be executed next.
- * @param victim If the heir is this node's thread, no processor is allocated.
- * @param[in, out] victim_cpu The cpu to allocate.
- * @param allocate_processor The function to use for the allocation of @a victim_cpu.
+ * @param[in, out] context is the scheduler context.
+ *
+ * @param[in, out] scheduled is the scheduled node that gets the processor allocated.
+ *
+ * @param[in, out] cpu is the processor to allocate.
+ *
+ * @param allocate_processor is the handler which should allocate the processor.
*/
static inline void _Scheduler_SMP_Allocate_processor(
Scheduler_Context *context,
Scheduler_Node *scheduled,
- Scheduler_Node *victim,
- Per_CPU_Control *victim_cpu,
+ Per_CPU_Control *cpu,
Scheduler_SMP_Allocate_processor allocate_processor
)
{
_Scheduler_SMP_Node_change_state( scheduled, SCHEDULER_SMP_NODE_SCHEDULED );
- ( *allocate_processor )( context, scheduled, victim, victim_cpu );
+ ( *allocate_processor )( context, scheduled, cpu );
}
/**
- * @brief Preempts the victim's thread and allocates a cpu for the scheduled thread.
+ * @brief Preempts the victim's thread and allocates a processor for the user
+ * of the scheduled node.
*
- * @param context The scheduler context instance.
- * @param scheduled Node of the scheduled thread that is about to be executed.
- * @param[in, out] victim Node of the thread to preempt.
- * @param allocate_processor The function for allocation of a processor for the new thread.
+ * @param[in, out] context is the scheduler context.
+ *
+ * @param scheduled[in, out] is the node of the user thread that is about to
+ * get a processor allocated.
+ *
+ * @param[in, out] victim is the victim node of the thread to preempt.
*
- * @return The preempted thread.
+ * @param[in, out] victim_idle is the idle thread used by the victim node or NULL.
+ *
+ * @param allocate_processor The function for allocation of a processor for the new thread.
*/
-static inline Thread_Control *_Scheduler_SMP_Preempt(
+static inline void _Scheduler_SMP_Preempt(
Scheduler_Context *context,
Scheduler_Node *scheduled,
Scheduler_Node *victim,
+ Thread_Control *victim_idle,
Scheduler_SMP_Allocate_processor allocate_processor
)
{
- Thread_Control *victim_thread;
- ISR_lock_Context scheduler_lock_context;
- Per_CPU_Control *victim_cpu;
+ Thread_Control *victim_owner;
+ ISR_lock_Context lock_context;
+ Per_CPU_Control *cpu;
- victim_thread = _Scheduler_Node_get_user( victim );
_Scheduler_SMP_Node_change_state( victim, SCHEDULER_SMP_NODE_READY );
- _Thread_Scheduler_acquire_critical( victim_thread, &scheduler_lock_context );
+ victim_owner = _Scheduler_Node_get_owner( victim );
+ _Thread_Scheduler_acquire_critical( victim_owner, &lock_context );
- victim_cpu = _Thread_Get_CPU( victim_thread );
+ if ( RTEMS_PREDICT_TRUE( victim_idle == NULL ) ) {
+ if ( victim_owner->Scheduler.state == THREAD_SCHEDULER_SCHEDULED ) {
+ _Scheduler_Thread_change_state( victim_owner, THREAD_SCHEDULER_READY );
- if ( victim_thread->Scheduler.state == THREAD_SCHEDULER_SCHEDULED ) {
- _Scheduler_Thread_change_state( victim_thread, THREAD_SCHEDULER_READY );
-
- if ( victim_thread->Scheduler.helping_nodes > 0 ) {
- ISR_lock_Context per_cpu_lock_context;
-
- _Per_CPU_Acquire( victim_cpu, &per_cpu_lock_context );
- _Chain_Append_unprotected(
- &victim_cpu->Threads_in_need_for_help,
- &victim_thread->Scheduler.Help_node
- );
- _Per_CPU_Release( victim_cpu, &per_cpu_lock_context );
+ if ( victim_owner->Scheduler.helping_nodes > 0 ) {
+ _Scheduler_SMP_Request_ask_for_help( victim_owner );
+ }
}
+
+ cpu = _Thread_Get_CPU( victim_owner );
+ } else {
+ cpu = _Thread_Get_CPU( victim_idle );
}
- _Thread_Scheduler_release_critical( victim_thread, &scheduler_lock_context );
+ _Thread_Scheduler_release_critical( victim_owner, &lock_context );
_Scheduler_SMP_Allocate_processor(
context,
scheduled,
- victim,
- victim_cpu,
+ cpu,
allocate_processor
);
-
- return victim_thread;
}
/**
@@ -764,16 +872,19 @@ static inline Scheduler_Node *_Scheduler_SMP_Get_lowest_scheduled(
Scheduler_Node *filter
)
{
- Scheduler_SMP_Context *self = _Scheduler_SMP_Get_self( context );
- Chain_Control *scheduled = &self->Scheduled;
- Scheduler_Node *lowest_scheduled =
- (Scheduler_Node *) _Chain_Last( scheduled );
+ Scheduler_SMP_Context *self;
+ Scheduler_Node *lowest_scheduled;
(void) filter;
- _Assert( &lowest_scheduled->Node.Chain != _Chain_Tail( scheduled ) );
+ self = _Scheduler_SMP_Get_self( context );
+
+ _Assert( !_Chain_Is_empty( &self->Scheduled ) );
+ lowest_scheduled = (Scheduler_Node *) _Chain_Last( &self->Scheduled );
+
_Assert(
- _Chain_Next( &lowest_scheduled->Node.Chain ) == _Chain_Tail( scheduled )
+ _Chain_Next( &lowest_scheduled->Node.Chain ) ==
+ _Chain_Tail( &self->Scheduled )
);
return lowest_scheduled;
@@ -802,52 +913,43 @@ static inline void _Scheduler_SMP_Enqueue_to_scheduled(
Scheduler_Node *lowest_scheduled,
Scheduler_SMP_Insert insert_scheduled,
Scheduler_SMP_Move move_from_scheduled_to_ready,
- Scheduler_SMP_Allocate_processor allocate_processor
+ Scheduler_SMP_Move move_from_ready_to_scheduled,
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Get_idle_node get_idle_node,
+ Scheduler_Release_idle_node release_idle_node
)
{
- Scheduler_Try_to_schedule_action action;
+ Thread_Control *lowest_scheduled_idle;
+ Scheduler_SMP_Action action;
- action = _Scheduler_Try_to_schedule_node(
- context,
- node,
- _Scheduler_Node_get_idle( lowest_scheduled ),
- _Scheduler_SMP_Get_idle_thread
+ lowest_scheduled_idle = _Scheduler_Release_idle_thread_if_necessary(
+ lowest_scheduled,
+ release_idle_node,
+ context
);
- if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
+ ( *move_from_scheduled_to_ready )( context, lowest_scheduled );
+
+ action = _Scheduler_SMP_Try_to_schedule( node, get_idle_node, context );
+
+ if ( RTEMS_PREDICT_TRUE( action == SCHEDULER_SMP_DO_SCHEDULE ) ) {
_Scheduler_SMP_Preempt(
context,
node,
lowest_scheduled,
+ lowest_scheduled_idle,
allocate_processor
);
( *insert_scheduled )( context, node, priority );
- ( *move_from_scheduled_to_ready )( context, lowest_scheduled );
-
- _Scheduler_Release_idle_thread(
- context,
- lowest_scheduled,
- _Scheduler_SMP_Release_idle_thread
- );
- } else if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE ) {
- _Scheduler_SMP_Node_change_state(
- lowest_scheduled,
- SCHEDULER_SMP_NODE_READY
- );
- _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_SCHEDULED );
+ } else {
+ _Assert( action == SCHEDULER_SMP_DO_NOT_SCHEDULE );
- ( *insert_scheduled )( context, node, priority );
- ( *move_from_scheduled_to_ready )( context, lowest_scheduled );
+ if ( lowest_scheduled_idle != NULL ) {
+ (void) _Scheduler_Use_idle_thread( lowest_scheduled, get_idle_node, context );
+ }
- _Scheduler_Exchange_idle_thread(
- node,
- lowest_scheduled,
- _Scheduler_Node_get_idle( lowest_scheduled )
- );
- } else {
- _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
- _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED );
+ ( *move_from_ready_to_scheduled )( context, lowest_scheduled );
}
}
@@ -881,8 +983,11 @@ static inline bool _Scheduler_SMP_Enqueue(
Scheduler_SMP_Insert insert_ready,
Scheduler_SMP_Insert insert_scheduled,
Scheduler_SMP_Move move_from_scheduled_to_ready,
+ Scheduler_SMP_Move move_from_ready_to_scheduled,
Scheduler_SMP_Get_lowest_scheduled get_lowest_scheduled,
- Scheduler_SMP_Allocate_processor allocate_processor
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Get_idle_node get_idle_node,
+ Scheduler_Release_idle_node release_idle_node
)
{
bool needs_help;
@@ -890,7 +995,13 @@ static inline bool _Scheduler_SMP_Enqueue(
lowest_scheduled = ( *get_lowest_scheduled )( context, node );
- if ( ( *order )( &insert_priority, &lowest_scheduled->Node.Chain ) ) {
+ if (
+ ( *order )(
+ &insert_priority,
+ &node->Node.Chain,
+ &lowest_scheduled->Node.Chain
+ )
+ ) {
_Scheduler_SMP_Enqueue_to_scheduled(
context,
node,
@@ -898,10 +1009,14 @@ static inline bool _Scheduler_SMP_Enqueue(
lowest_scheduled,
insert_scheduled,
move_from_scheduled_to_ready,
- allocate_processor
+ move_from_ready_to_scheduled,
+ allocate_processor,
+ get_idle_node,
+ release_idle_node
);
needs_help = false;
} else {
+ _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
( *insert_ready )( context, node, insert_priority );
needs_help = true;
}
@@ -928,7 +1043,7 @@ static inline bool _Scheduler_SMP_Enqueue(
* @param allocate_processor Function to allocate a processor to a node
* based on the rules of the scheduler.
*/
-static inline bool _Scheduler_SMP_Enqueue_scheduled(
+static inline void _Scheduler_SMP_Enqueue_scheduled(
Scheduler_Context *context,
Scheduler_Node *const node,
Priority_Control insert_priority,
@@ -938,12 +1053,22 @@ static inline bool _Scheduler_SMP_Enqueue_scheduled(
Scheduler_SMP_Insert insert_ready,
Scheduler_SMP_Insert insert_scheduled,
Scheduler_SMP_Move move_from_ready_to_scheduled,
- Scheduler_SMP_Allocate_processor allocate_processor
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Get_idle_node get_idle_node,
+ Scheduler_Release_idle_node release_idle_node
)
{
+ Thread_Control *node_idle;
+
+ node_idle = _Scheduler_Release_idle_thread_if_necessary(
+ node,
+ release_idle_node,
+ context
+ );
+
while ( true ) {
- Scheduler_Node *highest_ready;
- Scheduler_Try_to_schedule_action action;
+ Scheduler_Node *highest_ready;
+ Scheduler_SMP_Action action;
highest_ready = ( *get_highest_ready )( context, node );
@@ -952,12 +1077,13 @@ static inline bool _Scheduler_SMP_Enqueue_scheduled(
* it now on the scheduled or ready set.
*/
if (
- node->sticky_level > 0
- && ( *order )( &insert_priority, &highest_ready->Node.Chain )
+ node->sticky_level > 0 && ( *order )(
+ &insert_priority,
+ &node->Node.Chain,
+ &highest_ready->Node.Chain
+ )
) {
- ( *insert_scheduled )( context, node, insert_priority );
-
- if ( _Scheduler_Node_get_idle( node ) != NULL ) {
+ if ( node_idle != NULL ) {
Thread_Control *owner;
ISR_lock_Context lock_context;
@@ -965,77 +1091,50 @@ static inline bool _Scheduler_SMP_Enqueue_scheduled(
_Thread_Scheduler_acquire_critical( owner, &lock_context );
if ( owner->Scheduler.state == THREAD_SCHEDULER_READY ) {
- _Thread_Scheduler_cancel_need_for_help(
- owner,
- _Thread_Get_CPU( owner )
- );
- _Scheduler_Discard_idle_thread(
- context,
- owner,
- node,
- _Scheduler_SMP_Release_idle_thread
- );
+ Per_CPU_Control *cpu;
+
+ _Scheduler_SMP_Cancel_ask_for_help( owner );
_Scheduler_Thread_change_state( owner, THREAD_SCHEDULER_SCHEDULED );
+ cpu = _Thread_Get_CPU( node_idle );
+ _Thread_Set_CPU( owner, cpu );
+ _Thread_Scheduler_release_critical( owner, &lock_context );
+ _Thread_Dispatch_update_heir( _Per_CPU_Get(), cpu, owner );
+ } else {
+ Thread_Control *new_idle;
+
+ _Thread_Scheduler_release_critical( owner, &lock_context );
+ new_idle = _Scheduler_Use_idle_thread( node, get_idle_node, context );
+ _Assert_Unused_variable_equals( new_idle, node_idle );
}
-
- _Thread_Scheduler_release_critical( owner, &lock_context );
}
- return false;
+ ( *insert_scheduled )( context, node, insert_priority );
+
+ return;
}
- action = _Scheduler_Try_to_schedule_node(
- context,
+ action = _Scheduler_SMP_Try_to_schedule(
highest_ready,
- _Scheduler_Node_get_idle( node ),
- _Scheduler_SMP_Get_idle_thread
+ get_idle_node,
+ context
);
- if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
- Thread_Control *idle;
-
+ if ( RTEMS_PREDICT_TRUE( action == SCHEDULER_SMP_DO_SCHEDULE ) ) {
_Scheduler_SMP_Preempt(
context,
highest_ready,
node,
+ node_idle,
allocate_processor
);
- ( *insert_ready )( context, node, insert_priority );
( *move_from_ready_to_scheduled )( context, highest_ready );
-
- idle = _Scheduler_Release_idle_thread(
- context,
- node,
- _Scheduler_SMP_Release_idle_thread
- );
- return ( idle == NULL );
- } else if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE ) {
- _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
- _Scheduler_SMP_Node_change_state(
- highest_ready,
- SCHEDULER_SMP_NODE_SCHEDULED
- );
-
( *insert_ready )( context, node, insert_priority );
- ( *move_from_ready_to_scheduled )( context, highest_ready );
-
- _Scheduler_Exchange_idle_thread(
- highest_ready,
- node,
- _Scheduler_Node_get_idle( node )
- );
- return false;
- } else {
- _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
-
- _Scheduler_SMP_Node_change_state(
- highest_ready,
- SCHEDULER_SMP_NODE_BLOCKED
- );
-
- ( *extract_from_ready )( context, highest_ready );
+ return;
}
+
+ _Assert( action == SCHEDULER_SMP_DO_NOT_SCHEDULE );
+ ( *extract_from_ready )( context, highest_ready );
}
}
@@ -1059,7 +1158,9 @@ static inline void _Scheduler_SMP_Extract_from_scheduled(
*
* @param context The scheduler context instance.
* @param victim The node of the thread that is repressed by the newly scheduled thread.
- * @param victim_cpu The cpu to allocate.
+ * @param cpu is the processor to allocate.
+ * @param extract_from_scheduled Function to extract a node from the set of
+ * scheduled nodes.
* @param extract_from_ready Function to extract a node from the set of
* ready nodes.
* @param get_highest_ready Function to get the highest ready node.
@@ -1071,46 +1172,44 @@ static inline void _Scheduler_SMP_Extract_from_scheduled(
static inline void _Scheduler_SMP_Schedule_highest_ready(
Scheduler_Context *context,
Scheduler_Node *victim,
- Per_CPU_Control *victim_cpu,
+ Per_CPU_Control *cpu,
+ Scheduler_SMP_Extract extract_from_scheduled,
Scheduler_SMP_Extract extract_from_ready,
Scheduler_SMP_Get_highest_ready get_highest_ready,
Scheduler_SMP_Move move_from_ready_to_scheduled,
- Scheduler_SMP_Allocate_processor allocate_processor
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Get_idle_node get_idle_node
)
{
- Scheduler_Try_to_schedule_action action;
+ Scheduler_SMP_Action action;
- do {
+ _Scheduler_SMP_Node_change_state( victim, SCHEDULER_SMP_NODE_BLOCKED );
+ ( *extract_from_scheduled )( context, victim );
+
+ while ( true ) {
Scheduler_Node *highest_ready = ( *get_highest_ready )( context, victim );
- action = _Scheduler_Try_to_schedule_node(
- context,
+ action = _Scheduler_SMP_Try_to_schedule(
highest_ready,
- NULL,
- _Scheduler_SMP_Get_idle_thread
+ get_idle_node,
+ context
);
- if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
+ if ( RTEMS_PREDICT_TRUE( action == SCHEDULER_SMP_DO_SCHEDULE ) ) {
_Scheduler_SMP_Allocate_processor(
context,
highest_ready,
- victim,
- victim_cpu,
+ cpu,
allocate_processor
);
( *move_from_ready_to_scheduled )( context, highest_ready );
- } else {
- _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
-
- _Scheduler_SMP_Node_change_state(
- highest_ready,
- SCHEDULER_SMP_NODE_BLOCKED
- );
-
- ( *extract_from_ready )( context, highest_ready );
+ return;
}
- } while ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
+
+ _Assert( action == SCHEDULER_SMP_DO_NOT_SCHEDULE );
+ ( *extract_from_ready )( context, highest_ready );
+ }
}
/**
@@ -1118,7 +1217,6 @@ static inline void _Scheduler_SMP_Schedule_highest_ready(
*
* @param context The scheduler context instance.
* @param victim The node of the thread that is repressed by the newly scheduled thread.
- * @param victim_cpu The cpu to allocate.
* @param extract_from_ready Function to extract a node from the set of
* ready nodes.
* @param get_highest_ready Function to get the highest ready node.
@@ -1130,45 +1228,49 @@ static inline void _Scheduler_SMP_Schedule_highest_ready(
static inline void _Scheduler_SMP_Preempt_and_schedule_highest_ready(
Scheduler_Context *context,
Scheduler_Node *victim,
- Per_CPU_Control *victim_cpu,
Scheduler_SMP_Extract extract_from_ready,
Scheduler_SMP_Get_highest_ready get_highest_ready,
Scheduler_SMP_Move move_from_ready_to_scheduled,
- Scheduler_SMP_Allocate_processor allocate_processor
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Get_idle_node get_idle_node,
+ Scheduler_Release_idle_node release_idle_node
)
{
- Scheduler_Try_to_schedule_action action;
+ Thread_Control *victim_idle;
+ Scheduler_SMP_Action action;
- do {
+ _Scheduler_SMP_Node_change_state( victim, SCHEDULER_SMP_NODE_READY );
+ victim_idle = _Scheduler_Release_idle_thread_if_necessary(
+ victim,
+ release_idle_node,
+ context
+ );
+
+ while ( true ) {
Scheduler_Node *highest_ready = ( *get_highest_ready )( context, victim );
- action = _Scheduler_Try_to_schedule_node(
- context,
+ action = _Scheduler_SMP_Try_to_schedule(
highest_ready,
- NULL,
- _Scheduler_SMP_Get_idle_thread
+ get_idle_node,
+ context
);
- if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
+ if ( RTEMS_PREDICT_TRUE( action == SCHEDULER_SMP_DO_SCHEDULE ) ) {
_Scheduler_SMP_Preempt(
context,
highest_ready,
victim,
+ victim_idle,
allocate_processor
);
( *move_from_ready_to_scheduled )( context, highest_ready );
- } else {
- _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
-
- _Scheduler_SMP_Node_change_state(
- highest_ready,
- SCHEDULER_SMP_NODE_BLOCKED
- );
-
- ( *extract_from_ready )( context, highest_ready );
+ return;
}
- } while ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
+
+ _Assert( action == SCHEDULER_SMP_DO_NOT_SCHEDULE );
+ ( *extract_from_ready )( context, highest_ready );
+ }
}
/**
@@ -1195,39 +1297,61 @@ static inline void _Scheduler_SMP_Block(
Scheduler_SMP_Extract extract_from_ready,
Scheduler_SMP_Get_highest_ready get_highest_ready,
Scheduler_SMP_Move move_from_ready_to_scheduled,
- Scheduler_SMP_Allocate_processor allocate_processor
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Get_idle_node get_idle_node
)
{
+ int sticky_level;
+ ISR_lock_Context lock_context;
Scheduler_SMP_Node_state node_state;
- Per_CPU_Control *thread_cpu;
+ Per_CPU_Control *cpu;
- node_state = _Scheduler_SMP_Node_state( node );
+ sticky_level = node->sticky_level;
+ --sticky_level;
+ node->sticky_level = sticky_level;
+ _Assert( sticky_level >= 0 );
- thread_cpu = _Scheduler_Block_node(
- context,
- thread,
- node,
- node_state == SCHEDULER_SMP_NODE_SCHEDULED,
- _Scheduler_SMP_Get_idle_thread
- );
+ _Thread_Scheduler_acquire_critical( thread, &lock_context );
+ _Scheduler_SMP_Cancel_ask_for_help( thread );
+ cpu = _Thread_Get_CPU( thread );
+ _Scheduler_Thread_change_state( thread, THREAD_SCHEDULER_BLOCKED );
+ _Thread_Scheduler_release_critical( thread, &lock_context );
- if ( thread_cpu != NULL ) {
- _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED );
+ node_state = _Scheduler_SMP_Node_state( node );
- if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {
- ( *extract_from_scheduled )( context, node );
- _Scheduler_SMP_Schedule_highest_ready(
- context,
- node,
- thread_cpu,
- extract_from_ready,
- get_highest_ready,
- move_from_ready_to_scheduled,
- allocate_processor
- );
- } else if ( node_state == SCHEDULER_SMP_NODE_READY ) {
- ( *extract_from_ready )( context, node );
+ if ( RTEMS_PREDICT_FALSE( sticky_level > 0 ) ) {
+ if (
+ node_state == SCHEDULER_SMP_NODE_SCHEDULED &&
+ _Scheduler_Node_get_idle( node ) == NULL
+ ) {
+ Thread_Control *idle;
+
+ idle = _Scheduler_Use_idle_thread( node, get_idle_node, context );
+ _Thread_Set_CPU( idle, cpu );
+ _Thread_Dispatch_update_heir( _Per_CPU_Get(), cpu, idle );
}
+
+ return;
+ }
+
+ _Assert( _Scheduler_Node_get_user( node ) == thread );
+ _Assert( _Scheduler_Node_get_idle( node ) == NULL );
+
+ if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {
+ _Scheduler_SMP_Schedule_highest_ready(
+ context,
+ node,
+ cpu,
+ extract_from_scheduled,
+ extract_from_ready,
+ get_highest_ready,
+ move_from_ready_to_scheduled,
+ allocate_processor,
+ get_idle_node
+ );
+ } else if ( node_state == SCHEDULER_SMP_NODE_READY ) {
+ _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED );
+ ( *extract_from_ready )( context, node );
}
}
@@ -1242,52 +1366,60 @@ static inline void _Scheduler_SMP_Block(
* of a context.
*/
static inline void _Scheduler_SMP_Unblock(
- Scheduler_Context *context,
- Thread_Control *thread,
- Scheduler_Node *node,
- Scheduler_SMP_Update update,
- Scheduler_SMP_Enqueue enqueue
+ Scheduler_Context *context,
+ Thread_Control *thread,
+ Scheduler_Node *node,
+ Scheduler_SMP_Update update,
+ Scheduler_SMP_Enqueue enqueue,
+ Scheduler_Release_idle_node release_idle_node
)
{
Scheduler_SMP_Node_state node_state;
- bool unblock;
+ Priority_Control priority;
+
+ _Assert( _Chain_Is_node_off_chain( &thread->Scheduler.Help_node ) );
+
+ ++node->sticky_level;
+ _Assert( node->sticky_level > 0 );
node_state = _Scheduler_SMP_Node_state( node );
- unblock = _Scheduler_Unblock_node(
- context,
- thread,
- node,
- node_state == SCHEDULER_SMP_NODE_SCHEDULED,
- _Scheduler_SMP_Release_idle_thread
- );
- if ( unblock ) {
- Priority_Control priority;
- bool needs_help;
+ if ( RTEMS_PREDICT_FALSE( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) ) {
+ _Scheduler_Thread_change_state( thread, THREAD_SCHEDULER_SCHEDULED );
+ _Scheduler_Discard_idle_thread(
+ thread,
+ node,
+ release_idle_node,
+ context
+ );
- priority = _Scheduler_Node_get_priority( node );
- priority = SCHEDULER_PRIORITY_PURIFY( priority );
+ return;
+ }
- if ( priority != _Scheduler_SMP_Node_priority( node ) ) {
- ( *update )( context, node, priority );
- }
+ _Scheduler_Thread_change_state( thread, THREAD_SCHEDULER_READY );
- if ( node_state == SCHEDULER_SMP_NODE_BLOCKED ) {
- Priority_Control insert_priority;
+ priority = _Scheduler_Node_get_priority( node );
+ priority = SCHEDULER_PRIORITY_PURIFY( priority );
- _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
- insert_priority = SCHEDULER_PRIORITY_APPEND( priority );
- needs_help = ( *enqueue )( context, node, insert_priority );
- } else {
- _Assert( node_state == SCHEDULER_SMP_NODE_READY );
- _Assert( node->sticky_level > 0 );
- _Assert( node->idle == NULL );
- needs_help = true;
- }
+ if ( priority != _Scheduler_SMP_Node_priority( node ) ) {
+ ( *update )( context, node, priority );
+ }
+
+ if ( node_state == SCHEDULER_SMP_NODE_BLOCKED ) {
+ Priority_Control insert_priority;
+ bool needs_help;
- if ( needs_help ) {
- _Scheduler_Ask_for_help( thread );
+ insert_priority = SCHEDULER_PRIORITY_APPEND( priority );
+ needs_help = ( *enqueue )( context, node, insert_priority );
+
+ if ( needs_help && thread->Scheduler.helping_nodes > 0 ) {
+ _Scheduler_SMP_Request_ask_for_help( thread );
}
+ } else {
+ _Assert( node_state == SCHEDULER_SMP_NODE_READY );
+ _Assert( node->sticky_level > 0 );
+ _Assert( node->idle == NULL );
+ _Scheduler_SMP_Request_ask_for_help( thread );
}
}
@@ -1302,6 +1434,8 @@ static inline void _Scheduler_SMP_Unblock(
* @param context The scheduler instance context.
* @param thread The thread for the operation.
* @param[in, out] node The node to update the priority of.
+ * @param extract_from_scheduled Function to extract a node from the set of
+ * scheduled nodes.
* @param extract_from_ready Function to extract a node from the ready
* queue of the scheduler context.
* @param update Function to update the priority of a node in the scheduler
@@ -1311,14 +1445,15 @@ static inline void _Scheduler_SMP_Unblock(
* @param ask_for_help Function to perform a help request.
*/
static inline void _Scheduler_SMP_Update_priority(
- Scheduler_Context *context,
- Thread_Control *thread,
- Scheduler_Node *node,
- Scheduler_SMP_Extract extract_from_ready,
- Scheduler_SMP_Update update,
- Scheduler_SMP_Enqueue enqueue,
- Scheduler_SMP_Enqueue enqueue_scheduled,
- Scheduler_SMP_Ask_for_help ask_for_help
+ Scheduler_Context *context,
+ Thread_Control *thread,
+ Scheduler_Node *node,
+ Scheduler_SMP_Extract extract_from_scheduled,
+ Scheduler_SMP_Extract extract_from_ready,
+ Scheduler_SMP_Update update,
+ Scheduler_SMP_Enqueue enqueue,
+ Scheduler_SMP_Enqueue_scheduled enqueue_scheduled,
+ Scheduler_SMP_Ask_for_help ask_for_help
)
{
Priority_Control priority;
@@ -1339,7 +1474,7 @@ static inline void _Scheduler_SMP_Update_priority(
node_state = _Scheduler_SMP_Node_state( node );
if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {
- _Scheduler_SMP_Extract_from_scheduled( context, node );
+ ( *extract_from_scheduled )( context, node );
( *update )( context, node, priority );
( *enqueue_scheduled )( context, node, insert_priority );
} else if ( node_state == SCHEDULER_SMP_NODE_READY ) {
@@ -1361,21 +1496,23 @@ static inline void _Scheduler_SMP_Update_priority(
* @param context The scheduler instance context.
* @param thread The thread for the operation.
* @param node The node of the thread that yields.
+ * @param extract_from_scheduled Function to extract a node from the set of
+ * scheduled nodes.
* @param extract_from_ready Function to extract a node from the ready
* queue of the scheduler context.
* @param enqueue Function to enqueue a node with a given priority.
* @param enqueue_scheduled Function to enqueue a scheduled node.
*/
static inline void _Scheduler_SMP_Yield(
- Scheduler_Context *context,
- Thread_Control *thread,
- Scheduler_Node *node,
- Scheduler_SMP_Extract extract_from_ready,
- Scheduler_SMP_Enqueue enqueue,
- Scheduler_SMP_Enqueue enqueue_scheduled
+ Scheduler_Context *context,
+ Thread_Control *thread,
+ Scheduler_Node *node,
+ Scheduler_SMP_Extract extract_from_scheduled,
+ Scheduler_SMP_Extract extract_from_ready,
+ Scheduler_SMP_Enqueue enqueue,
+ Scheduler_SMP_Enqueue_scheduled enqueue_scheduled
)
{
- bool needs_help;
Scheduler_SMP_Node_state node_state;
Priority_Control insert_priority;
@@ -1384,19 +1521,11 @@ static inline void _Scheduler_SMP_Yield(
insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );
if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {
- _Scheduler_SMP_Extract_from_scheduled( context, node );
+ ( *extract_from_scheduled )( context, node );
( *enqueue_scheduled )( context, node, insert_priority );
- needs_help = false;
} else if ( node_state == SCHEDULER_SMP_NODE_READY ) {
( *extract_from_ready )( context, node );
-
- needs_help = ( *enqueue )( context, node, insert_priority );
- } else {
- needs_help = true;
- }
-
- if ( needs_help ) {
- _Scheduler_Ask_for_help( thread );
+ (void) ( *enqueue )( context, node, insert_priority );
}
}
@@ -1456,7 +1585,8 @@ static inline bool _Scheduler_SMP_Ask_for_help(
Scheduler_SMP_Insert insert_scheduled,
Scheduler_SMP_Move move_from_scheduled_to_ready,
Scheduler_SMP_Get_lowest_scheduled get_lowest_scheduled,
- Scheduler_SMP_Allocate_processor allocate_processor
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Release_idle_node release_idle_node
)
{
Scheduler_Node *lowest_scheduled;
@@ -1485,49 +1615,54 @@ static inline bool _Scheduler_SMP_Ask_for_help(
insert_priority = _Scheduler_SMP_Node_priority( node );
- if ( ( *order )( &insert_priority, &lowest_scheduled->Node.Chain ) ) {
- _Thread_Scheduler_cancel_need_for_help(
- thread,
- _Thread_Get_CPU( thread )
- );
+ if (
+ ( *order )(
+ &insert_priority,
+ &node->Node.Chain,
+ &lowest_scheduled->Node.Chain
+ )
+ ) {
+ Thread_Control *lowest_scheduled_idle;
+
+ _Scheduler_SMP_Cancel_ask_for_help( thread );
_Scheduler_Thread_change_state( thread, THREAD_SCHEDULER_SCHEDULED );
_Thread_Scheduler_release_critical( thread, &lock_context );
+ lowest_scheduled_idle = _Scheduler_Release_idle_thread_if_necessary(
+ lowest_scheduled,
+ release_idle_node,
+ context
+ );
+
_Scheduler_SMP_Preempt(
context,
node,
lowest_scheduled,
+ lowest_scheduled_idle,
allocate_processor
);
- ( *insert_scheduled )( context, node, insert_priority );
( *move_from_scheduled_to_ready )( context, lowest_scheduled );
+ ( *insert_scheduled )( context, node, insert_priority );
- _Scheduler_Release_idle_thread(
- context,
- lowest_scheduled,
- _Scheduler_SMP_Release_idle_thread
- );
success = true;
} else {
_Thread_Scheduler_release_critical( thread, &lock_context );
+
_Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
( *insert_ready )( context, node, insert_priority );
success = false;
}
} else if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {
- _Thread_Scheduler_cancel_need_for_help(
- thread,
- _Thread_Get_CPU( thread )
- );
+ _Scheduler_SMP_Cancel_ask_for_help( thread );
+ _Scheduler_Thread_change_state( thread, THREAD_SCHEDULER_SCHEDULED );
+ _Thread_Scheduler_release_critical( thread, &lock_context );
_Scheduler_Discard_idle_thread(
- context,
thread,
node,
- _Scheduler_SMP_Release_idle_thread
+ release_idle_node,
+ context
);
- _Scheduler_Thread_change_state( thread, THREAD_SCHEDULER_SCHEDULED );
- _Thread_Scheduler_release_critical( thread, &lock_context );
success = true;
} else {
_Thread_Scheduler_release_critical( thread, &lock_context );
@@ -1580,6 +1715,8 @@ static inline void _Scheduler_SMP_Reconsider_help_request(
* @param[in, out] thread The thread to change to @a next_state.
* @param[in, out] node The node to withdraw.
* @param next_state The new state for @a thread.
+ * @param extract_from_scheduled Function to extract a node from the set of
+ * scheduled nodes.
* @param extract_from_ready Function to extract a node from the ready queue
* of the scheduler context.
* @param get_highest_ready Function to get the highest ready node.
@@ -1593,10 +1730,12 @@ static inline void _Scheduler_SMP_Withdraw_node(
Thread_Control *thread,
Scheduler_Node *node,
Thread_Scheduler_state next_state,
+ Scheduler_SMP_Extract extract_from_scheduled,
Scheduler_SMP_Extract extract_from_ready,
Scheduler_SMP_Get_highest_ready get_highest_ready,
Scheduler_SMP_Move move_from_ready_to_scheduled,
- Scheduler_SMP_Allocate_processor allocate_processor
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Get_idle_node get_idle_node
)
{
ISR_lock_Context lock_context;
@@ -1605,27 +1744,32 @@ static inline void _Scheduler_SMP_Withdraw_node(
_Thread_Scheduler_acquire_critical( thread, &lock_context );
node_state = _Scheduler_SMP_Node_state( node );
- _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED );
if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {
- Per_CPU_Control *thread_cpu;
+ Per_CPU_Control *cpu;
- thread_cpu = _Thread_Get_CPU( thread );
+ _Assert( thread == _Scheduler_Node_get_user( node ) );
+ cpu = _Thread_Get_CPU( thread );
_Scheduler_Thread_change_state( thread, next_state );
_Thread_Scheduler_release_critical( thread, &lock_context );
- _Scheduler_SMP_Extract_from_scheduled( context, node );
+ _Assert( _Scheduler_Node_get_user( node ) == thread );
+ _Assert( _Scheduler_Node_get_idle( node ) == NULL );
+
_Scheduler_SMP_Schedule_highest_ready(
context,
node,
- thread_cpu,
+ cpu,
+ extract_from_scheduled,
extract_from_ready,
get_highest_ready,
move_from_ready_to_scheduled,
- allocate_processor
+ allocate_processor,
+ get_idle_node
);
} else if ( node_state == SCHEDULER_SMP_NODE_READY ) {
_Thread_Scheduler_release_critical( thread, &lock_context );
+ _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED );
( *extract_from_ready )( context, node );
} else {
_Assert( node_state == SCHEDULER_SMP_NODE_BLOCKED );
@@ -1634,6 +1778,97 @@ static inline void _Scheduler_SMP_Withdraw_node(
}
/**
+ * @brief Makes the node sticky.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to make sticky.
+ */
+static inline void _Scheduler_SMP_Make_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node,
+ Scheduler_SMP_Update update,
+ Scheduler_SMP_Enqueue enqueue
+)
+{
+ Scheduler_SMP_Node_state node_state;
+
+ node_state = _Scheduler_SMP_Node_state( node );
+
+ if ( node_state == SCHEDULER_SMP_NODE_BLOCKED ) {
+ Scheduler_Context *context;
+ Priority_Control insert_priority;
+ Priority_Control priority;
+
+ context = _Scheduler_Get_context( scheduler );
+ priority = _Scheduler_Node_get_priority( node );
+ priority = SCHEDULER_PRIORITY_PURIFY( priority );
+
+ if ( priority != _Scheduler_SMP_Node_priority( node ) ) {
+ ( *update )( context, node, priority );
+ }
+
+ insert_priority = SCHEDULER_PRIORITY_APPEND( priority );
+ (void) ( *enqueue )( context, node, insert_priority );
+ }
+}
+
+/**
+ * @brief Cleans the sticky property from the node.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to clean the sticky property.
+ */
+static inline void _Scheduler_SMP_Clean_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node,
+ Scheduler_SMP_Extract extract_from_scheduled,
+ Scheduler_SMP_Extract extract_from_ready,
+ Scheduler_SMP_Get_highest_ready get_highest_ready,
+ Scheduler_SMP_Move move_from_ready_to_scheduled,
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Get_idle_node get_idle_node,
+ Scheduler_Release_idle_node release_idle_node
+)
+{
+ Scheduler_SMP_Node_state node_state;
+
+ node_state = _Scheduler_SMP_Node_state( node );
+
+ if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {
+ Thread_Control *idle;
+
+ idle = _Scheduler_Node_get_idle( node );
+
+ if ( idle != NULL ) {
+ Scheduler_Context *context;
+
+ context = _Scheduler_Get_context( scheduler );
+
+ _Scheduler_Release_idle_thread( node, idle, release_idle_node, context );
+ _Scheduler_SMP_Schedule_highest_ready(
+ context,
+ node,
+ _Thread_Get_CPU( idle ),
+ extract_from_scheduled,
+ extract_from_ready,
+ get_highest_ready,
+ move_from_ready_to_scheduled,
+ allocate_processor,
+ get_idle_node
+ );
+ }
+ }
+}
+
+/**
* @brief Starts the idle thread on the given processor.
*
* @param context The scheduler context instance.
@@ -1660,7 +1895,6 @@ static inline void _Scheduler_SMP_Do_start_idle(
_Thread_Set_CPU( idle, cpu );
( *register_idle )( context, &node->Base, cpu );
_Chain_Append_unprotected( &self->Scheduled, &node->Base.Node.Chain );
- _Scheduler_SMP_Release_idle_thread( &self->Base, idle );
}
/**
@@ -1673,11 +1907,11 @@ static inline void _Scheduler_SMP_Do_start_idle(
* @param register_idle Function to register the idle thread for a cpu.
*/
static inline void _Scheduler_SMP_Add_processor(
- Scheduler_Context *context,
- Thread_Control *idle,
- Scheduler_SMP_Has_ready has_ready,
- Scheduler_SMP_Enqueue enqueue_scheduled,
- Scheduler_SMP_Register_idle register_idle
+ Scheduler_Context *context,
+ Thread_Control *idle,
+ Scheduler_SMP_Has_ready has_ready,
+ Scheduler_SMP_Enqueue_scheduled enqueue_scheduled,
+ Scheduler_SMP_Register_idle register_idle
)
{
Scheduler_SMP_Context *self;
@@ -1685,7 +1919,6 @@ static inline void _Scheduler_SMP_Add_processor(
self = _Scheduler_SMP_Get_self( context );
idle->Scheduler.state = THREAD_SCHEDULER_SCHEDULED;
- _Scheduler_SMP_Release_idle_thread( &self->Base, idle );
node = _Thread_Scheduler_get_home_node( idle );
_Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_SCHEDULED );
( *register_idle )( context, node, _Thread_Get_CPU( idle ) );
@@ -1706,6 +1939,8 @@ static inline void _Scheduler_SMP_Add_processor(
*
* @param context The scheduler context instance.
* @param cpu The processor to remove from.
+ * @param extract_from_scheduled Function to extract a node from the set of
+ * scheduled nodes.
* @param extract_from_ready Function to extract a node from the ready queue
* of the scheduler context.
* @param enqueue Function to enqueue a node with a given priority.
@@ -1713,10 +1948,13 @@ static inline void _Scheduler_SMP_Add_processor(
* @return The idle thread of @a cpu.
*/
static inline Thread_Control *_Scheduler_SMP_Remove_processor(
- Scheduler_Context *context,
- Per_CPU_Control *cpu,
- Scheduler_SMP_Extract extract_from_ready,
- Scheduler_SMP_Enqueue enqueue
+ Scheduler_Context *context,
+ Per_CPU_Control *cpu,
+ Scheduler_SMP_Extract extract_from_scheduled,
+ Scheduler_SMP_Extract extract_from_ready,
+ Scheduler_SMP_Enqueue enqueue,
+ Scheduler_Get_idle_node get_idle_node,
+ Scheduler_Release_idle_node release_idle_node
)
{
Scheduler_SMP_Context *self;
@@ -1736,39 +1974,37 @@ static inline Thread_Control *_Scheduler_SMP_Remove_processor(
chain_node = _Chain_Next( chain_node );
} while ( _Thread_Get_CPU( victim_user ) != cpu );
- _Scheduler_SMP_Extract_from_scheduled( context, victim_node );
+ ( *extract_from_scheduled )( &self->Base, victim_node );
victim_owner = _Scheduler_Node_get_owner( victim_node );
if ( !victim_owner->is_idle ) {
- Scheduler_Node *idle_node;
+ Thread_Control *victim_idle;
+ Scheduler_Node *idle_node;
+ Priority_Control insert_priority;
- _Scheduler_Release_idle_thread(
- &self->Base,
+ victim_idle = _Scheduler_Release_idle_thread_if_necessary(
victim_node,
- _Scheduler_SMP_Release_idle_thread
+ release_idle_node,
+ &self->Base
);
- idle = _Scheduler_SMP_Get_idle_thread( &self->Base );
- idle_node = _Thread_Scheduler_get_home_node( idle );
- ( *extract_from_ready )( &self->Base, idle_node );
+ idle_node = ( *get_idle_node )( &self->Base );
+ idle = _Scheduler_Node_get_owner( idle_node );
_Scheduler_SMP_Preempt(
&self->Base,
idle_node,
victim_node,
+ victim_idle,
_Scheduler_SMP_Allocate_processor_exact
);
- if ( !_Chain_Is_empty( &self->Scheduled ) ) {
- Priority_Control insert_priority;
-
- insert_priority = _Scheduler_SMP_Node_priority( victim_node );
- insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );
- ( *enqueue )( context, victim_node, insert_priority );
- }
+ _Assert( !_Chain_Is_empty( &self->Scheduled ) );
+ insert_priority = _Scheduler_SMP_Node_priority( victim_node );
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );
+ ( *enqueue )( &self->Base, victim_node, insert_priority );
} else {
_Assert( victim_owner == victim_user );
_Assert( _Scheduler_Node_get_idle( victim_node ) == NULL );
idle = victim_owner;
- _Scheduler_SMP_Exctract_idle_thread( idle );
}
return idle;
@@ -1784,6 +2020,8 @@ static inline Thread_Control *_Scheduler_SMP_Remove_processor(
* @param[in, out] node The node to set the affinity of.
* @param arg The affinity for @a node.
* @param set_affinity Function to set the affinity of a node.
+ * @param extract_from_scheduled Function to extract a node from the set of
+ * scheduled nodes.
* @param extract_from_ready Function to extract a node from the ready queue
* of the scheduler context.
* @param get_highest_ready Function to get the highest ready node.
@@ -1799,11 +2037,14 @@ static inline void _Scheduler_SMP_Set_affinity(
Scheduler_Node *node,
void *arg,
Scheduler_SMP_Set_affinity set_affinity,
+ Scheduler_SMP_Extract extract_from_scheduled,
Scheduler_SMP_Extract extract_from_ready,
Scheduler_SMP_Get_highest_ready get_highest_ready,
Scheduler_SMP_Move move_from_ready_to_scheduled,
Scheduler_SMP_Enqueue enqueue,
- Scheduler_SMP_Allocate_processor allocate_processor
+ Scheduler_SMP_Allocate_processor allocate_processor,
+ Scheduler_Get_idle_node get_idle_node,
+ Scheduler_Release_idle_node release_idle_node
)
{
Scheduler_SMP_Node_state node_state;
@@ -1814,15 +2055,16 @@ static inline void _Scheduler_SMP_Set_affinity(
insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );
if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {
- _Scheduler_SMP_Extract_from_scheduled( context, node );
+ ( *extract_from_scheduled )( context, node );
_Scheduler_SMP_Preempt_and_schedule_highest_ready(
context,
node,
- _Thread_Get_CPU( thread ),
extract_from_ready,
get_highest_ready,
move_from_ready_to_scheduled,
- allocate_processor
+ allocate_processor,
+ get_idle_node,
+ release_idle_node
);
( *set_affinity )( context, node, arg );
( *enqueue )( context, node, insert_priority );
diff --git a/cpukit/include/rtems/score/schedulerstrongapa.h b/cpukit/include/rtems/score/schedulerstrongapa.h
index 9ee922d46d..8db3ae8634 100644
--- a/cpukit/include/rtems/score/schedulerstrongapa.h
+++ b/cpukit/include/rtems/score/schedulerstrongapa.h
@@ -161,15 +161,16 @@ 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_strong_APA_Make_sticky, \
+ _Scheduler_strong_APA_Clean_sticky, \
+ _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, \
_Scheduler_default_Node_destroy, \
_Scheduler_default_Release_job, \
_Scheduler_default_Cancel_job, \
- _Scheduler_default_Tick, \
_Scheduler_strong_APA_Start_idle, \
_Scheduler_strong_APA_Set_affinity \
}
@@ -280,6 +281,66 @@ void _Scheduler_strong_APA_Withdraw_node(
);
/**
+ * @brief Makes the node sticky.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to make sticky.
+ */
+void _Scheduler_strong_APA_Make_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
+ * @brief Cleans the sticky property from the node.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to clean the sticky property.
+ */
+void _Scheduler_strong_APA_Clean_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
+ * @brief Makes the node sticky.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to make sticky.
+ */
+void _Scheduler_strong_APA_Make_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
+ * @brief Cleans the sticky property from the node.
+ *
+ * @param scheduler is the scheduler of the node.
+ *
+ * @param[in, out] the_thread is the thread owning the node.
+ *
+ * @param[in, out] node is the scheduler node to clean the sticky property.
+ */
+void _Scheduler_strong_APA_sticky(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+);
+
+/**
* @brief Adds the idle thread to a processor.
*
* @param scheduler The scheduler control instance.
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/status.h b/cpukit/include/rtems/score/status.h
index 236ae52d7b..96c0f1f9af 100644
--- a/cpukit/include/rtems/score/status.h
+++ b/cpukit/include/rtems/score/status.h
@@ -106,6 +106,8 @@ typedef enum {
STATUS_BUILD( STATUS_CLASSIC_INCORRECT_STATE, EINVAL ),
STATUS_INTERRUPTED =
STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, EINTR ),
+ STATUS_INTERNAL_ERROR =
+ STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, ENOTSUP ),
STATUS_INVALID_ADDRESS =
STATUS_BUILD( STATUS_CLASSIC_INVALID_ADDRESS, EFAULT ),
STATUS_INVALID_ID =
diff --git a/cpukit/include/rtems/score/thread.h b/cpukit/include/rtems/score/thread.h
index e23261701a..c3c37eb160 100644
--- a/cpukit/include/rtems/score/thread.h
+++ b/cpukit/include/rtems/score/thread.h
@@ -76,14 +76,6 @@ extern "C" {
*@{
*/
-#define RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE
-
-/*
- * With the addition of the Constant Block Scheduler (CBS),
- * this feature is needed even when POSIX is disabled.
- */
-#define RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT
-
#if defined(RTEMS_DEBUG)
#define RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT
#endif
@@ -148,27 +140,47 @@ typedef struct {
} Thread_Entry_information;
/**
- * The following lists the algorithms used to manage the thread cpu budget.
- *
- * Reset Timeslice: At each context switch, reset the time quantum.
- * Exhaust Timeslice: Only reset the quantum once it is consumed.
- * Callout: Execute routine when budget is consumed.
+ * @brief This structure contains operations which manage the CPU budget of a
+ * thread.
*/
-typedef enum {
- THREAD_CPU_BUDGET_ALGORITHM_NONE,
- THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE,
- #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
- THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE,
- #endif
- #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
- THREAD_CPU_BUDGET_ALGORITHM_CALLOUT
- #endif
-} Thread_CPU_budget_algorithms;
+typedef struct {
+ /**
+ * @brief This operation is called at each clock tick for the executing
+ * thread.
+ */
+ void ( *at_tick )( Thread_Control * );
+
+ /**
+ * @brief This operation is called right before a context switch to the
+ * thread is performed.
+ */
+ void ( *at_context_switch )( Thread_Control * );
-/** This defines thes the entry point for the thread specific timeslice
- * budget management algorithm.
+ /**
+ * @brief This operation is called to initialize the CPU budget of the
+ * thread.
+ */
+ void ( *initialize )( Thread_Control * );
+} Thread_CPU_budget_operations;
+
+/**
+ * @brief This structure is used to control the CPU budget of a thread.
*/
-typedef void (*Thread_CPU_budget_algorithm_callout )( Thread_Control * );
+typedef struct {
+ /**
+ * @brief If this member is not NULL, then it references the CPU budget
+ * operations used to manage the CPU budget of the thread, otherwise it is
+ * NULL.
+ */
+ const Thread_CPU_budget_operations *operations;
+
+ /**
+ * @brief This member contains the count of the time quantum that this thread
+ * is allowed to consume until an action takes place defined by the CPU
+ * budget operations.
+ */
+ uint32_t available;
+} Thread_CPU_budget_control;
/**
* The following structure contains the information which defines
@@ -182,12 +194,13 @@ typedef struct {
* it started.
*/
bool is_preemptible;
- /** This field indicates the CPU budget algorith. */
- Thread_CPU_budget_algorithms budget_algorithm;
- /** This field is the routine to invoke when the CPU allotment is
- * consumed.
+
+ /**
+ * @brief This member may provide the CPU budget operations activated when a
+ * thread is initialized before it is started or restarted.
*/
- Thread_CPU_budget_algorithm_callout budget_callout;
+ const Thread_CPU_budget_operations *cpu_budget_operations;
+
/** This field is the initial ISR disable level of this thread. */
uint32_t isr_level;
/** This field is the initial priority. */
@@ -293,10 +306,24 @@ typedef struct {
Chain_Control Scheduler_nodes;
/**
- * @brief Node for the Per_CPU_Control::Threads_in_need_for_help chain.
+ * @brief If an ask for help request for the thread is pending, then this
+ * member references the processor on which the ask for help request is
+ * registered, otherwise it is NULL.
*
- * This chain is protected by the Per_CPU_Control::Lock lock of the assigned
- * processor.
+ * Depending on the state of the thread and usage context, this member is
+ * protected by the Per_CPU_Control::Lock lock of the referenced processor,
+ * the scheduler lock of the thread (Thread_Scheduler_control::Lock), or the
+ * thread state lock.
+ */
+ struct Per_CPU_Control *ask_for_help_cpu;
+
+ /**
+ * @brief This member is the node for the
+ * Per_CPU_Control::Threads_in_need_for_help chain.
+ *
+ * This chain is protected by the Per_CPU_Control::Lock lock of the processor
+ * on which the ask for help request is registered
+ * (Thread_Scheduler_control::ask_for_help_cpu).
*/
Chain_Node Help_node;
@@ -377,7 +404,7 @@ typedef union {
* The mutually exclusive wait state flags are
* - @ref THREAD_WAIT_STATE_INTEND_TO_BLOCK,
* - @ref THREAD_WAIT_STATE_BLOCKED, and
- * - @ref THREAD_WAIT_STATE_READY_AGAIN.
+ * - @ref THREAD_WAIT_STATE_READY.
*/
typedef unsigned int Thread_Wait_flags;
@@ -772,9 +799,7 @@ struct _Thread_Control {
* the following fields
*
* - RTEMS_API_Control::Signal,
- * - Thread_Control::budget_algorithm,
- * - Thread_Control::budget_callout,
- * - Thread_Control::cpu_time_budget,
+ * - Thread_Control::CPU_budget,
* - Thread_Control::current_state,
* - Thread_Control::Post_switch_actions,
* - Thread_Control::Scheduler::control, and
@@ -841,22 +866,24 @@ struct _Thread_Control {
*/
bool was_created_with_inherited_scheduler;
- /** This field is the length of the time quantum that this thread is
- * allowed to consume. The algorithm used to manage limits on CPU usage
- * is specified by budget_algorithm.
+ /**
+ * @brief This member contains the CPU budget control used to manage the CPU
+ * budget of the thread.
*/
- uint32_t cpu_time_budget;
- /** This field is the algorithm used to manage this thread's time
- * quantum. The algorithm may be specified as none which case,
- * no limit is in place.
+ Thread_CPU_budget_control CPU_budget;
+
+ /**
+ * @brief This member contains the amount of CPU time consumed by this thread
+ * since it was created.
*/
- Thread_CPU_budget_algorithms budget_algorithm;
- /** This field is the method invoked with the budgeted time is consumed. */
- Thread_CPU_budget_algorithm_callout budget_callout;
- /** This field is the amount of CPU time consumed by this thread
- * since it was created.
+ Timestamp_Control cpu_time_used;
+
+ /**
+ * @brief This member contains the amount of CPU time consumed by this thread
+ * at the time of the last reset of the CPU usage by
+ * rtems_cpu_usage_reset().
*/
- Timestamp_Control cpu_time_used;
+ Timestamp_Control cpu_time_used_at_last_reset;
/** This field contains information about the starting state of
* this thread.
diff --git a/cpukit/include/rtems/score/threadcpubudget.h b/cpukit/include/rtems/score/threadcpubudget.h
new file mode 100644
index 0000000000..bcbaa11bdb
--- /dev/null
+++ b/cpukit/include/rtems/score/threadcpubudget.h
@@ -0,0 +1,102 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreThread
+ *
+ * @brief This header file provides interfaces used to implement the CPU budget
+ * management of threads.
+ */
+
+/*
+ * 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.
+ */
+
+#ifndef _RTEMS_SCORE_THREADCPUBUDGET_H
+#define _RTEMS_SCORE_THREADCPUBUDGET_H
+
+#include <rtems/score/thread.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSScoreThread
+ *
+ * @{
+ */
+
+/**
+ * @brief Does nothing.
+ *
+ * @param the_thread is an unused parameter.
+ */
+void _Thread_CPU_budget_do_nothing( Thread_Control *the_thread );
+
+/**
+ * @brief Sets the available CPU budget of the thread to the configured clock
+ * ticks per timeslice.
+ *
+ * @param the_thread is the thread to set the available CPU budget.
+ */
+void _Thread_CPU_budget_set_to_ticks_per_timeslice(
+ Thread_Control *the_thread
+);
+
+/**
+ * @brief Consumes one time quantum of the available CPU budget of the thread
+ * and yields the thread if the available CPU budget is fully consumed.
+ *
+ * While the thread enabled the non-preemptive mode or is not ready, no time
+ * quantum is consumed.
+ *
+ * @param the_thread is the thread to operate on.
+ */
+void _Thread_CPU_budget_consume_and_yield( Thread_Control *the_thread );
+
+/**
+ * @brief These CPU budget operations allocate timeslices to the thread.
+ *
+ * The timeslice is not reset at a context switch to the thread. Once a
+ * timeslice is consumed, the thread yields.
+ */
+extern const Thread_CPU_budget_operations _Thread_CPU_budget_exhaust_timeslice;
+
+/**
+ * @brief These CPU budget operations allocate timeslices to the thread.
+ *
+ * The timeslice is reset at a context switch to the thread. Once a timeslice
+ * is consumed, the thread yields.
+ */
+extern const Thread_CPU_budget_operations _Thread_CPU_budget_reset_timeslice;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_SCORE_THREADCPUBUDGET_H */
diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h
index f25e347e33..0a672aa837 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -176,19 +176,9 @@ typedef struct {
Priority_Control priority;
/**
- * @brief The thread's budget algorithm.
+ * @brief The thread's initial CPU budget operations.
*/
- Thread_CPU_budget_algorithms budget_algorithm;
-
- /**
- * @brief The thread's initial budget callout.
- */
- Thread_CPU_budget_algorithm_callout budget_callout;
-
- /**
- * @brief The thread's initial CPU time budget.
- */
- uint32_t cpu_time_budget;
+ const Thread_CPU_budget_operations *cpu_budget_operations;
/**
* @brief 32-bit unsigned integer name of the object for the thread.
@@ -800,17 +790,29 @@ void _Thread_Priority_replace(
*/
void _Thread_Priority_update( Thread_queue_Context *queue_context );
+#if defined(RTEMS_SMP)
/**
- * @brief Updates the priority of the thread and changes it sticky level.
+ * @brief Updates the priority of the thread and makes its home scheduler node
+ * sticky.
*
- * @param the_thread The thread.
- * @param sticky_level_change The new value for the sticky level.
+ * @param the_thread is the thread to work on.
*/
-#if defined(RTEMS_SMP)
-void _Thread_Priority_and_sticky_update(
- Thread_Control *the_thread,
- int sticky_level_change
-);
+void _Thread_Priority_update_and_make_sticky( Thread_Control *the_thread );
+
+/**
+ * @brief Updates the priority of the thread and cleans the sticky property of
+ * its home scheduler node.
+ *
+ * @param the_thread is the thread to work on.
+ */
+void _Thread_Priority_update_and_clean_sticky( Thread_Control *the_thread );
+
+/**
+ * @brief Updates the priority of the thread.
+ *
+ * @param the_thread is the thread to update the priority.
+ */
+void _Thread_Priority_update_ignore_sticky( Thread_Control *the_thread );
#endif
/**
@@ -1242,15 +1244,41 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_update_heir(
#endif
/**
- * @brief Gets the used cpu time of the thread and stores it in the given
- * Timestamp_Control.
+ * @brief Gets the used processor time of the thread throughout its entire
+ * lifetime.
+ *
+ * @param[in, out] the_thread is the thread.
*
- * @param the_thread The thread to get the used cpu time of.
- * @param[out] cpu_time_used Stores the used cpu time of @a the_thread.
+ * @return Returns the used processor time of the thread throughout its entire
+ * lifetime.
*/
-void _Thread_Get_CPU_time_used(
- Thread_Control *the_thread,
- Timestamp_Control *cpu_time_used
+Timestamp_Control _Thread_Get_CPU_time_used( Thread_Control *the_thread );
+
+/**
+ * @brief Gets the used processor time of the thread throughout its entire
+ * lifetime if the caller already acquired the thread state and home
+ * scheduler locks.
+ *
+ * @param[in, out] the_thread is the thread.
+ *
+ * @return Returns the used processor time of the thread throughout its entire
+ * lifetime.
+ */
+Timestamp_Control _Thread_Get_CPU_time_used_locked(
+ Thread_Control *the_thread
+);
+
+/**
+ * @brief Gets the used processor time of the thread after the last CPU usage
+ * reset.
+ *
+ * @param[in, out] the_thread is the thread.
+ *
+ * @return Returns the used processor time of the thread after the last CPU usage
+ * reset.
+ */
+Timestamp_Control _Thread_Get_CPU_time_used_after_last_reset(
+ Thread_Control *the_thread
);
/**
@@ -1466,32 +1494,6 @@ RTEMS_INLINE_ROUTINE bool _Thread_Owns_resources(
}
#endif
-#if defined(RTEMS_SMP)
-/**
- * @brief Cancels the thread's need for help.
- *
- * @param the_thread The thread to cancel the help request of.
- * @param cpu The cpu to get the lock context of in order to
- * cancel the help request.
- */
-RTEMS_INLINE_ROUTINE void _Thread_Scheduler_cancel_need_for_help(
- Thread_Control *the_thread,
- Per_CPU_Control *cpu
-)
-{
- ISR_lock_Context lock_context;
-
- _Per_CPU_Acquire( cpu, &lock_context );
-
- if ( !_Chain_Is_node_off_chain( &the_thread->Scheduler.Help_node ) ) {
- _Chain_Extract_unprotected( &the_thread->Scheduler.Help_node );
- _Chain_Set_off_chain( &the_thread->Scheduler.Help_node );
- }
-
- _Per_CPU_Release( cpu, &lock_context );
-}
-#endif
-
/**
* @brief Gets the home scheduler of the thread.
*
@@ -2195,8 +2197,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
@@ -2210,19 +2212,23 @@ 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
+ }
}
/**
- * @brief The initial thread wait flags value set by _Thread_Initialize().
+ * @brief Mask to get the thread wait state flags.
*/
-#define THREAD_WAIT_FLAGS_INITIAL 0x0U
+#define THREAD_WAIT_STATE_MASK 0xffU
/**
- * @brief Mask to get the thread wait state flags.
+ * @brief Indicates that the thread does not wait on something.
+ *
+ * In this wait state, the wait class is zero. This wait state is set
+ * initially by _Thread_Initialize() and after each wait operation once the
+ * thread is ready again.
*/
-#define THREAD_WAIT_STATE_MASK 0xffU
+#define THREAD_WAIT_STATE_READY 0x0U
/**
* @brief Indicates that the thread begins with the blocking operation.
@@ -2239,13 +2245,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Wait_cancel(
#define THREAD_WAIT_STATE_BLOCKED 0x2U
/**
- * @brief Indicates that a condition to end the thread wait occurred.
- *
- * This could be a timeout, a signal, an event or a resource availability.
- */
-#define THREAD_WAIT_STATE_READY_AGAIN 0x4U
-
-/**
* @brief Mask to get the thread wait class flags.
*/
#define THREAD_WAIT_CLASS_MASK 0xff00U
@@ -2636,7 +2635,7 @@ void _Thread_Do_unpin(
RTEMS_INLINE_ROUTINE void _Thread_Pin( Thread_Control *executing )
{
#if defined(RTEMS_SMP)
- _Assert( executing == _Thread_Executing );
+ _Assert( executing == _Thread_Get_executing() );
executing->Scheduler.pin_level += THREAD_PIN_STEP;
#else
@@ -2658,7 +2657,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Unpin(
#if defined(RTEMS_SMP)
unsigned int pin_level;
- _Assert( executing == _Thread_Executing );
+ _Assert( executing == _Per_CPU_Get_executing( cpu_self ) );
pin_level = executing->Scheduler.pin_level;
_Assert( pin_level > 0 );
@@ -2688,5 +2687,35 @@ RTEMS_INLINE_ROUTINE void _Thread_Unpin(
#include <rtems/score/threadmp.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @ingroup RTEMSScoreThread
+ *
+ * @brief Removes the watchdog timer from the thread and lets the thread
+ * continue its execution.
+ *
+ * @param[in, out] the_thread is the thread.
+ *
+ * @param status is the thread wait status.
+ */
+RTEMS_INLINE_ROUTINE void _Thread_Timer_remove_and_continue(
+ Thread_Control *the_thread,
+ Status_Control status
+)
+{
+ _Thread_Timer_remove( the_thread );
+#if defined(RTEMS_MULTIPROCESSING)
+ _Thread_MP_Extract_proxy( the_thread );
+#endif
+ _Thread_Continue( the_thread, status );
+}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* end of include file */
diff --git a/cpukit/include/rtems/score/threadmp.h b/cpukit/include/rtems/score/threadmp.h
index 6cc68e6320..e10661a573 100644
--- a/cpukit/include/rtems/score/threadmp.h
+++ b/cpukit/include/rtems/score/threadmp.h
@@ -98,6 +98,19 @@ Thread_Control *_Thread_MP_Find_proxy (
((_the_thread) == _MPCI_Receive_server_tcb)
/**
+ * @brief Extracts the proxy of the thread if necessary.
+ *
+ * This routine ensures that if there is a proxy for this thread on another
+ * node, it is also dealt with. A proxy is a data that is on the thread queue
+ * on the remote node and acts as a proxy for the local thread. If the local
+ * thread was waiting on a remote operation, then the remote side of the
+ * operation must be cleaned up.
+ *
+ * @param[in, out] the_thread is the thread to determine the proxy.
+ */
+void _Thread_MP_Extract_proxy( Thread_Control *the_thread );
+
+/**
* @brief Trees a proxy control block to the inactive chain of free proxy
* control blocks.
*/
diff --git a/cpukit/include/rtems/score/threadqimpl.h b/cpukit/include/rtems/score/threadqimpl.h
index 22e0c7f069..7dd7250acf 100644
--- a/cpukit/include/rtems/score/threadqimpl.h
+++ b/cpukit/include/rtems/score/threadqimpl.h
@@ -984,24 +984,6 @@ void _Thread_queue_Resume(
void _Thread_queue_Extract( Thread_Control *the_thread );
/**
- * @brief Extracts the_thread from the_thread_queue.
- *
- * This routine extracts the_thread from the_thread_queue
- * and ensures that if there is a proxy for this task on
- * another node, it is also dealt with. A proxy is a data
- * data that is on the thread queue on the remote node and
- * acts as a proxy for the local thread. If the local thread
- * was waiting on a remote operation, then the remote side
- * of the operation must be cleaned up.
- *
- * @param[in, out] the_thread The pointer to a thread control block that
- * is to be removed
- */
-void _Thread_queue_Extract_with_proxy(
- Thread_Control *the_thread
-);
-
-/**
* @brief Surrenders the thread queue previously owned by the thread to the
* first enqueued thread.
*
@@ -1314,18 +1296,23 @@ RTEMS_INLINE_ROUTINE void _Thread_queue_Destroy(
#endif
}
+#if defined(RTEMS_MULTIPROCESSING)
/**
* @brief Does nothing.
*
* @param the_proxy This parameter is unused.
* @param mp_id This parameter is unused.
*/
-#if defined(RTEMS_MULTIPROCESSING)
void _Thread_queue_MP_callout_do_nothing(
Thread_Control *the_proxy,
Objects_Id mp_id
);
+bool _Thread_queue_MP_set_callout(
+ Thread_Control *the_thread,
+ const Thread_queue_Context *queue_context
+);
+
/**
* @brief Unblocks the proxy of the thread.
*
@@ -1339,28 +1326,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.
*
- * @retval true The operation was successful.
- * @retval false The operation failed.
+ * 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.
+ *
+ * @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
diff --git a/cpukit/include/rtems/score/timecounter.h b/cpukit/include/rtems/score/timecounter.h
index 8185140f9b..39f0dc353e 100644
--- a/cpukit/include/rtems/score/timecounter.h
+++ b/cpukit/include/rtems/score/timecounter.h
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (c) 2015 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2015, 2021 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -248,6 +248,28 @@ extern volatile int32_t _Timecounter_Time_uptime;
*/
extern struct timecounter *_Timecounter;
+/**
+ * @brief Handler doing the NTP update second processing shall have this type.
+ *
+ * @param[in, out] adjustment is the NTP time adjustment.
+ *
+ * @param[in, out] newsec is the number of seconds since Unix epoch.
+ */
+typedef void ( *Timecounter_NTP_update_second )(
+ int64_t *adjustment,
+ time_t *newsec
+);
+
+/**
+ * @brief Sets the NTP update second handler.
+ *
+ * @param handler is the new NTP update second handler used to carry out the
+ * NTP update second processing.
+ */
+void _Timecounter_Set_NTP_update_second(
+ Timecounter_NTP_update_second handler
+);
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/score/watchdogimpl.h b/cpukit/include/rtems/score/watchdogimpl.h
index 7b364b8828..ba1a884a3d 100644
--- a/cpukit/include/rtems/score/watchdogimpl.h
+++ b/cpukit/include/rtems/score/watchdogimpl.h
@@ -351,33 +351,50 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_scheduled(
}
/**
- * @brief Sets the first node of the header.
+ * @brief Sets the first watchdog of the watchdog collection to the next
+ * watchdog of the current first watchdog.
*
- * Sets the first node of the header to either the leftmost child node of the
- * watchdog control node, or if not present sets it to the right child node of
- * the watchdog control node. if both are not present, the new first node is
- * the parent node of the current first node.
+ * This function may be used during watchdog removals, see _Watchdog_Remove()
+ * and _Watchdog_Tickle().
*
- * @param[in, out] header The watchdog header.
- * @param the_watchdog The watchdog control node for the operation.
+ * @param[in, out] header is the watchdog collection header.
+ *
+ * @param first is the current first watchdog which should be removed
+ * afterwards.
*/
RTEMS_INLINE_ROUTINE void _Watchdog_Next_first(
- Watchdog_Header *header,
- Watchdog_Control *the_watchdog
+ Watchdog_Header *header,
+ const Watchdog_Control *first
)
{
- RBTree_Node *node = _RBTree_Right( &the_watchdog->Node.RBTree );
-
- if ( node != NULL ) {
- RBTree_Node *left;
-
- while ( ( left = _RBTree_Left( node ) ) != NULL ) {
- node = left;
- }
+ RBTree_Node *right;
- header->first = node;
+ /*
+ * This function uses the following properties of red-black trees:
+ *
+ * 1. Every leaf (NULL) is black.
+ *
+ * 2. If a node is red, then both its children are black.
+ *
+ * 3. Every simple path from a node to a descendant leaf contains the same
+ * number of black nodes.
+ *
+ * The first node has no left child. So every path from the first node has
+ * exactly one black node (including leafs). The first node cannot have a
+ * non-leaf black right child. It may have a red right child. In this case
+ * both children must be leafs.
+ */
+ _Assert( header->first == &first->Node.RBTree );
+ _Assert( _RBTree_Left( &first->Node.RBTree ) == NULL );
+ right = _RBTree_Right( &first->Node.RBTree );
+
+ if ( right != NULL ) {
+ _Assert( RB_COLOR( right, Node ) == RB_RED );
+ _Assert( _RBTree_Left( right ) == NULL );
+ _Assert( _RBTree_Right( right ) == NULL );
+ header->first = right;
} else {
- header->first = _RBTree_Parent( &the_watchdog->Node.RBTree );
+ header->first = _RBTree_Parent( &first->Node.RBTree );
}
}
diff --git a/cpukit/include/rtems/score/wkspace.h b/cpukit/include/rtems/score/wkspace.h
index b37f257ed6..75660980a1 100644
--- a/cpukit/include/rtems/score/wkspace.h
+++ b/cpukit/include/rtems/score/wkspace.h
@@ -20,23 +20,13 @@
#define _RTEMS_SCORE_WKSPACE_H
#include <rtems/score/heap.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/memory.h>
#ifdef __cplusplus
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
*
* @{
*/
@@ -50,17 +40,11 @@ extern "C" {
extern Heap_Control _Workspace_Area;
/**
- * @brief Initilizes the workspace handler.
+ * @brief Initializes the workspace handler.
*
* This routine performs the initialization necessary for this handler.
- *
- * @param mem The memory information
- * @param extend The extension handler for the new workspace.
*/
-void _Workspace_Handler_initialization(
- const Memory_Information *mem,
- Heap_Initialization_or_extend_handler extend
-);
+void _Workspace_Handler_initialization( void );
/**
* @brief Allocates a memory block of the specified size from the workspace.
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/score/wkspaceinitmulti.h b/cpukit/include/rtems/score/wkspaceinitmulti.h
new file mode 100644
index 0000000000..18520199ce
--- /dev/null
+++ b/cpukit/include/rtems/score/wkspaceinitmulti.h
@@ -0,0 +1,129 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreWorkspace
+ *
+ * @brief This header file provides the implementation of
+ * _Workspace_Initialize_for_multiple_areas().
+ */
+
+/*
+ * Copyright (C) 2012, 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.
+ */
+
+#ifndef _RTEMS_SCORE_WKSPACEINITMULTI_H
+#define _RTEMS_SCORE_WKSPACEINITMULTI_H
+
+#include <rtems/score/wkspace.h>
+#include <rtems/score/heapimpl.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/memory.h>
+#include <rtems/config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @ingroup RTEMSScoreWorkspace
+ *
+ * @brief Initializes the RTEMS Workspace with support for more than one memory
+ * area.
+ *
+ * This implementation should be used by BSPs which provide more than one
+ * memory area via _Memory_Get() to implement
+ * _Workspace_Handler_initialization().
+ */
+RTEMS_INLINE_ROUTINE void _Workspace_Initialize_for_multiple_areas( void )
+{
+ const Memory_Information *mem;
+ Heap_Initialization_or_extend_handler init_or_extend;
+ uintptr_t remaining;
+ bool unified;
+ uintptr_t page_size;
+ uintptr_t overhead;
+ size_t i;
+
+ mem = _Memory_Get();
+ page_size = CPU_HEAP_ALIGNMENT;
+ remaining = rtems_configuration_get_work_space_size();
+ init_or_extend = _Heap_Initialize;
+ unified = rtems_configuration_get_unified_work_area();
+ overhead = _Heap_Area_overhead( page_size );
+
+ for ( i = 0; i < _Memory_Get_count( mem ); ++i ) {
+ Memory_Area *area;
+ uintptr_t free_size;
+
+ area = _Memory_Get_area( mem, i );
+ free_size = _Memory_Get_free_size( area );
+
+ if ( free_size > overhead ) {
+ uintptr_t space_available;
+ uintptr_t size;
+
+ if ( unified ) {
+ size = free_size;
+ } else {
+ if ( remaining > 0 ) {
+ size = remaining < free_size - overhead ?
+ remaining + overhead : free_size;
+ } else {
+ size = 0;
+ }
+ }
+
+ space_available = ( *init_or_extend )(
+ &_Workspace_Area,
+ _Memory_Get_free_begin( area ),
+ size,
+ page_size
+ );
+
+ _Memory_Consume( area, size );
+
+ if ( space_available < remaining ) {
+ remaining -= space_available;
+ } else {
+ remaining = 0;
+ }
+
+ init_or_extend = _Heap_Extend;
+ }
+ }
+
+ if ( remaining > 0 ) {
+ _Internal_error( INTERNAL_ERROR_TOO_LITTLE_WORKSPACE );
+ }
+
+ _Heap_Protection_set_delayed_free_fraction( &_Workspace_Area, 1 );
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_SCORE_WKSPACEINITMULTI_H */
diff --git a/cpukit/include/rtems/score/wkspaceinitone.h b/cpukit/include/rtems/score/wkspaceinitone.h
new file mode 100644
index 0000000000..c68e1b5db1
--- /dev/null
+++ b/cpukit/include/rtems/score/wkspaceinitone.h
@@ -0,0 +1,113 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreWorkspace
+ *
+ * @brief This header file provides the implementation of
+ * _Workspace_Initialize_for_one_area().
+ */
+
+/*
+ * Copyright (C) 2012, 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.
+ */
+
+#ifndef _RTEMS_SCORE_WKSPACEINITONE_H
+#define _RTEMS_SCORE_WKSPACEINITONE_H
+
+#include <rtems/score/wkspace.h>
+#include <rtems/score/assert.h>
+#include <rtems/score/heapimpl.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/memory.h>
+#include <rtems/config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @ingroup RTEMSScoreWorkspace
+ *
+ * @brief Initializes the RTEMS Workspace with support for exactly one memory
+ * area.
+ *
+ * This implementation should be used by BSPs which provide exactly one memory
+ * area via _Memory_Get() to implement _Workspace_Handler_initialization().
+ */
+RTEMS_INLINE_ROUTINE void _Workspace_Initialize_for_one_area( void )
+{
+ uintptr_t page_size;
+ uintptr_t wkspace_size;
+ uintptr_t wkspace_size_with_overhead;
+ uintptr_t available_size;
+
+ page_size = CPU_HEAP_ALIGNMENT;
+ wkspace_size = rtems_configuration_get_work_space_size();
+ wkspace_size_with_overhead = wkspace_size + _Heap_Area_overhead( page_size );
+
+ if ( wkspace_size < wkspace_size_with_overhead ) {
+ const Memory_Information *mem;
+ Memory_Area *area;
+ uintptr_t free_size;
+ uintptr_t size;
+
+ mem = _Memory_Get();
+ _Assert( _Memory_Get_count( mem ) == 1 );
+
+ area = _Memory_Get_area( mem, 0 );
+ free_size = _Memory_Get_free_size( area );
+
+ if ( rtems_configuration_get_unified_work_area() ) {
+ size = free_size;
+ } else {
+ size = wkspace_size_with_overhead;
+ }
+
+ available_size = _Heap_Initialize(
+ &_Workspace_Area,
+ _Memory_Get_free_begin( area ),
+ size,
+ page_size
+ );
+
+ _Memory_Consume( area, size );
+ } else {
+ /* An unsigned integer overflow happened */
+ available_size = 0;
+ }
+
+ if ( wkspace_size > available_size ) {
+ _Internal_error( INTERNAL_ERROR_TOO_LITTLE_WORKSPACE );
+ }
+
+ _Heap_Protection_set_delayed_free_fraction( &_Workspace_Area, 1 );
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_SCORE_WKSPACEINITONE_H */
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/libcsupport/src/__times.c b/cpukit/libcsupport/src/__times.c
index 7bb7e0e9ca..a37c662654 100644
--- a/cpukit/libcsupport/src/__times.c
+++ b/cpukit/libcsupport/src/__times.c
@@ -65,7 +65,8 @@ clock_t _times(
* of ticks since boot and the number of ticks executed by this
* this thread.
*/
- _Thread_Get_CPU_time_used( _Thread_Get_executing(), &cpu_time_used );
+ cpu_time_used =
+ _Thread_Get_CPU_time_used_after_last_reset( _Thread_Get_executing() );
ptms->tms_utime = ((clock_t) cpu_time_used) / tick_interval;
return ptms->tms_stime;
diff --git a/cpukit/libcsupport/src/malloc_initialize.c b/cpukit/libcsupport/src/malloc_initialize.c
deleted file mode 100644
index fb0999df01..0000000000
--- a/cpukit/libcsupport/src/malloc_initialize.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * @file
- *
- * @brief RTEMS_Malloc_Initialize() implementation.
- */
-
-/*
- * COPYRIGHT (c) 1989-2012.
- * 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/malloc.h>
-#include <rtems/score/wkspace.h>
-
-#include "malloc_p.h"
-
-#ifdef RTEMS_NEWLIB
-static Heap_Control _Malloc_Heap;
-
-Heap_Control *RTEMS_Malloc_Initialize(
- const Memory_Information *mem,
- Heap_Initialization_or_extend_handler extend
-)
-{
- Heap_Control *heap;
- Heap_Initialization_or_extend_handler init_or_extend;
- uintptr_t page_size;
- size_t i;
-
- heap = &_Malloc_Heap;
- RTEMS_Malloc_Heap = heap;
- init_or_extend = _Heap_Initialize;
- page_size = CPU_HEAP_ALIGNMENT;
-
- for (i = 0; i < _Memory_Get_count( mem ); ++i) {
- Memory_Area *area;
- uintptr_t space_available;
-
- area = _Memory_Get_area( mem, i );
- space_available = ( *init_or_extend )(
- heap,
- _Memory_Get_free_begin( area ),
- _Memory_Get_free_size( area ),
- page_size
- );
-
- if ( space_available > 0 ) {
- _Memory_Consume( area, _Memory_Get_free_size( area ) );
- init_or_extend = extend;
- }
- }
-
- if ( init_or_extend == _Heap_Initialize ) {
- _Internal_error( INTERNAL_ERROR_NO_MEMORY_FOR_HEAP );
- }
-
- return heap;
-}
-#else
-Heap_Control *RTEMS_Malloc_Initialize(
- const Memory_Information *mem,
- Heap_Initialization_or_extend_handler extend
-)
-{
- /* FIXME: Dummy function */
- return NULL;
-}
-#endif
-
-Heap_Control *_Workspace_Malloc_initialize_separate( void )
-{
- return RTEMS_Malloc_Initialize( _Memory_Get(), _Heap_Extend );
-}
diff --git a/cpukit/libcsupport/src/mallocheap.c b/cpukit/libcsupport/src/mallocheap.c
index 006362f209..ec14e73763 100644
--- a/cpukit/libcsupport/src/mallocheap.c
+++ b/cpukit/libcsupport/src/mallocheap.c
@@ -44,7 +44,7 @@
Heap_Control *RTEMS_Malloc_Heap;
-static void _Malloc_Initialize( void )
+void _Malloc_Initialize( void )
{
RTEMS_Malloc_Heap = ( *_Workspace_Malloc_initializer )();
}
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/libdebugger/rtems-debugger-aarch64.c b/cpukit/libdebugger/rtems-debugger-aarch64.c
new file mode 100644
index 0000000000..279c2d61ef
--- /dev/null
+++ b/cpukit/libdebugger/rtems-debugger-aarch64.c
@@ -0,0 +1,1884 @@
+/*
+ * Copyright (c) 2016-2019 Chris Johns <chrisj@rtems.org>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#define TARGET_DEBUG 0
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <errno.h>
+#include <inttypes.h>
+#include <stdlib.h>
+
+/* Defined by linkcmds.base */
+extern char bsp_section_text_begin[];
+extern char bsp_section_text_end[];
+extern char bsp_section_fast_text_begin[];
+extern char bsp_section_fast_text_end[];
+
+#include <libcpu/mmu-vmsav8-64.h>
+
+#include <rtems.h>
+#include <rtems/score/aarch64-system-registers.h>
+#include <rtems/score/cpu.h>
+#include <rtems/score/threadimpl.h>
+
+#include <rtems/debugger/rtems-debugger-bsp.h>
+
+#include "rtems-debugger-target.h"
+#include "rtems-debugger-threads.h"
+
+#if TARGET_DEBUG
+#include <rtems/bspIo.h>
+#endif
+
+/*
+ * Structure used to manage a task executing a function on available cores on
+ * a scheduler.
+ */
+typedef struct {
+ rtems_id allCPUsBarrier;
+ rtems_task_entry work_function;
+ rtems_task_argument arg;
+ rtems_status_code sc;
+} run_across_cpus_context;
+
+/*
+ * The function that runs as the body of the task which moves itself among the
+ * various cores registered to a scheduler.
+ */
+static rtems_task run_across_cpus_task( rtems_task_argument arg )
+{
+ uint32_t released = 0;
+ rtems_status_code sc;
+ run_across_cpus_context *ctx = (run_across_cpus_context *) arg;
+ cpu_set_t set;
+ cpu_set_t scheduler_set;
+ rtems_id scheduler_id;
+
+ sc = rtems_task_get_scheduler( RTEMS_SELF, &scheduler_id );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ ctx->sc = sc;
+ rtems_task_exit();
+ }
+
+ CPU_ZERO( &scheduler_set );
+ sc = rtems_scheduler_get_processor_set(
+ scheduler_id,
+ sizeof( scheduler_set ),
+ &scheduler_set
+ );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ ctx->sc = sc;
+ rtems_task_exit();
+ }
+
+ for (
+ int cpu_index = 0;
+ cpu_index < rtems_scheduler_get_processor_maximum();
+ cpu_index++
+ ) {
+ if ( !CPU_ISSET( cpu_index, &scheduler_set ) ) {
+ continue;
+ }
+
+ CPU_ZERO( &set );
+ CPU_SET( cpu_index, &set );
+ sc = rtems_task_set_affinity( RTEMS_SELF, sizeof( set ), &set );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ ctx->sc = sc;
+ rtems_task_exit();
+ }
+
+ /* execute task on selected CPU */
+ ctx->work_function( ctx->arg );
+ }
+
+ sc = rtems_barrier_release( ctx->allCPUsBarrier, &released );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ ctx->sc = sc;
+ }
+
+ rtems_task_exit();
+}
+
+/*
+ * The function used to run a provided function with arbitrary argument across
+ * all cores registered to the current scheduler. This is similar to the Linux
+ * kernel's on_each_cpu() call and always waits for the task to complete before
+ * returning.
+ */
+static rtems_status_code run_across_cpus(
+ rtems_task_entry task_entry,
+ rtems_task_argument arg
+)
+{
+ rtems_status_code sc;
+ rtems_id Task_id;
+ run_across_cpus_context ctx;
+
+ ctx.work_function = task_entry;
+ ctx.arg = arg;
+ ctx.sc = RTEMS_SUCCESSFUL;
+
+ memset( &ctx.allCPUsBarrier, 0, sizeof( ctx.allCPUsBarrier ) );
+ sc = rtems_barrier_create(
+ rtems_build_name( 'B', 'c', 'p', 'u' ),
+ RTEMS_BARRIER_MANUAL_RELEASE,
+ 2,
+ &ctx.allCPUsBarrier
+ );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ return sc;
+ }
+
+ sc = rtems_task_create(
+ rtems_build_name( 'T', 'c', 'p', 'u' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE * 2,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id
+ );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ rtems_barrier_delete( ctx.allCPUsBarrier );
+ return sc;
+ }
+
+ sc = rtems_task_start(
+ Task_id,
+ run_across_cpus_task,
+ ( rtems_task_argument ) & ctx
+ );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ rtems_task_delete( Task_id );
+ rtems_barrier_delete( ctx.allCPUsBarrier );
+ return sc;
+ }
+
+ /* wait on task */
+ sc = rtems_barrier_wait( ctx.allCPUsBarrier, RTEMS_NO_TIMEOUT );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ rtems_task_delete( Task_id );
+ rtems_barrier_delete( ctx.allCPUsBarrier );
+ return sc;
+ }
+
+ rtems_barrier_delete( ctx.allCPUsBarrier );
+
+ if ( ctx.sc != RTEMS_SUCCESSFUL ) {
+ return ctx.sc;
+ }
+
+ return sc;
+}
+
+/*
+ * Number of registers.
+ */
+#define RTEMS_DEBUGGER_NUMREGS 68
+
+/*
+ * Number of bytes per type of register.
+ */
+#define RTEMS_DEBUGGER_REG_BYTES 8
+
+/* Debugger registers layout. See aarch64-core.xml in GDB source. */
+#define REG_X0 0
+#define REG_X1 1
+#define REG_X2 2
+#define REG_X3 3
+#define REG_X4 4
+#define REG_X5 5
+#define REG_X6 6
+#define REG_X7 7
+#define REG_X8 8
+#define REG_X9 9
+#define REG_X10 10
+#define REG_X11 11
+#define REG_X12 12
+#define REG_X13 13
+#define REG_X14 14
+#define REG_X15 15
+#define REG_X16 16
+#define REG_X17 17
+#define REG_X18 18
+#define REG_X19 19
+#define REG_X20 20
+#define REG_X21 21
+#define REG_X22 22
+#define REG_X23 23
+#define REG_X24 24
+#define REG_X25 25
+#define REG_X26 26
+#define REG_X27 27
+#define REG_X28 28
+#define REG_FP 29
+#define REG_LR 30
+#define REG_SP 31
+/*
+ * PC isn't a real directly accessible register on AArch64, but is exposed via
+ * ELR_EL1 in exception context.
+ */
+#define REG_PC 32
+/* CPSR is defined as 32-bit by GDB */
+#define REG_CPS 33
+/* Debugger registers layout. See aarch64-fpu.xml in GDB source. */
+#define REG_V0 34
+#define REG_V1 35
+#define REG_V2 36
+#define REG_V3 37
+#define REG_V4 38
+#define REG_V5 39
+#define REG_V6 40
+#define REG_V7 41
+#define REG_V8 42
+#define REG_V9 43
+#define REG_V10 44
+#define REG_V11 45
+#define REG_V12 46
+#define REG_V13 47
+#define REG_V14 48
+#define REG_V15 49
+#define REG_V16 50
+#define REG_V17 51
+#define REG_V18 52
+#define REG_V19 53
+#define REG_V20 54
+#define REG_V21 55
+#define REG_V22 56
+#define REG_V23 57
+#define REG_V24 58
+#define REG_V25 59
+#define REG_V26 60
+#define REG_V27 61
+#define REG_V28 62
+#define REG_V29 63
+#define REG_V30 64
+#define REG_V31 65
+/* FPSR and FPCR are defined as 32-bit by GDB */
+#define REG_FPS 66
+#define REG_FPC 67
+
+/**
+ * Register offset table with the total as the last entry.
+ *
+ * Check this table in gdb with the command:
+ *
+ * maint print registers
+ */
+static const size_t aarch64_reg_offsets[ RTEMS_DEBUGGER_NUMREGS + 1 ] = {
+ REG_X0 * 8,
+ REG_X1 * 8,
+ REG_X2 * 8,
+ REG_X3 * 8,
+ REG_X4 * 8,
+ REG_X5 * 8,
+ REG_X6 * 8,
+ REG_X7 * 8,
+ REG_X8 * 8,
+ REG_X9 * 8,
+ REG_X10 * 8,
+ REG_X11 * 8,
+ REG_X12 * 8,
+ REG_X13 * 8,
+ REG_X14 * 8,
+ REG_X15 * 8,
+ REG_X16 * 8,
+ REG_X17 * 8,
+ REG_X18 * 8,
+ REG_X19 * 8,
+ REG_X20 * 8,
+ REG_X21 * 8,
+ REG_X22 * 8,
+ REG_X23 * 8,
+ REG_X24 * 8,
+ REG_X25 * 8,
+ REG_X26 * 8,
+ REG_X27 * 8,
+ REG_X28 * 8,
+ REG_FP * 8,
+ REG_LR * 8,
+ REG_SP * 8,
+ REG_PC * 8,
+ REG_CPS * 8,
+/* Floating point registers, CPS is 32-bit */
+#define V0_OFFSET ( REG_CPS * 8 + 4 )
+ V0_OFFSET,
+ V0_OFFSET + 16 * ( REG_V1 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V2 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V3 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V4 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V5 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V6 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V7 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V8 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V9 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V10 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V11 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V12 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V13 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V14 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V15 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V16 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V17 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V18 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V19 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V20 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V21 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V22 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V23 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V24 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V25 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V26 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V27 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V28 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V29 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V30 - REG_V0 ),
+ V0_OFFSET + 16 * ( REG_V31 - REG_V0 ),
+/* FPSR and FPCR are defined as 32-bit by GDB */
+#define FPS_OFFSET ( V0_OFFSET + 16 * ( REG_V31 - REG_V0 ) + 16 )
+ FPS_OFFSET,
+/* FPC follows FPS */
+ FPS_OFFSET + 4,
+/* Total size */
+ FPS_OFFSET + 8,
+};
+
+/*
+ * Number of bytes of registers.
+ */
+#define RTEMS_DEBUGGER_NUMREGBYTES \
+ aarch64_reg_offsets[ RTEMS_DEBUGGER_NUMREGS ]
+
+/**
+ * Print the exception frame.
+ */
+#define EXC_FRAME_PRINT( _out, _prefix, _frame ) \
+ do { \
+ _out( \
+ _prefix " X0 = %016" PRIx64 " X1 = %016" PRIx64 \
+ " X2 = %016" PRIx64 " X3 = %016" PRIx64 "\n", \
+ _frame->register_x0, \
+ _frame->register_x1, \
+ _frame->register_x2, \
+ _frame->register_x3 \
+ ); \
+ _out( \
+ _prefix " X4 = %016" PRIx64 " X5 = %016" PRIx64 \
+ " X6 = %016" PRIx64 " X7 = %016" PRIx64 "\n", \
+ _frame->register_x4, \
+ _frame->register_x5, \
+ _frame->register_x6, \
+ _frame->register_x7 \
+ ); \
+ _out( \
+ _prefix " X8 = %016" PRIx64 " X9 = %016" PRIx64 \
+ " X10 = %016" PRIx64 " X11 = %016" PRIx64 "\n", \
+ _frame->register_x8, \
+ _frame->register_x9, \
+ _frame->register_x10, \
+ _frame->register_x11 \
+ ); \
+ _out( \
+ _prefix " X12 = %016" PRIx64 " X13 = %016" PRIx64 \
+ " X14 = %016" PRIx64 " X15 = %016" PRIx64 "\n", \
+ _frame->register_x12, \
+ _frame->register_x13, \
+ _frame->register_x14, \
+ _frame->register_x15 \
+ ); \
+ _out( \
+ _prefix " X16 = %016" PRIx64 " X17 = %016" PRIx64 \
+ " X18 = %016" PRIx64 " X19 = %016" PRIx64 "\n", \
+ _frame->register_x16, \
+ _frame->register_x17, \
+ _frame->register_x18, \
+ _frame->register_x19 \
+ ); \
+ _out( \
+ _prefix " X20 = %016" PRIx64 " X21 = %016" PRIx64 \
+ " X22 = %016" PRIx64 " X23 = %016" PRIx64 "\n", \
+ _frame->register_x20, \
+ _frame->register_x21, \
+ _frame->register_x22, \
+ _frame->register_x23 \
+ ); \
+ _out( \
+ _prefix " X24 = %016" PRIx64 " X25 = %016" PRIx64 \
+ " X26 = %016" PRIx64 " X27 = %016" PRIx64 "\n", \
+ _frame->register_x24, \
+ _frame->register_x25, \
+ _frame->register_x26, \
+ _frame->register_x27 \
+ ); \
+ _out( \
+ _prefix " X28 = %016" PRIx64 " FP = %016" PRIx64 \
+ " LR = %016" PRIxPTR " SP = %016" PRIxPTR "\n", \
+ _frame->register_x28, \
+ _frame->register_fp, \
+ (intptr_t) _frame->register_lr, \
+ (intptr_t) _frame->register_sp \
+ ); \
+ _out( \
+ _prefix " PC = %016" PRIxPTR "\n", \
+ (intptr_t) _frame->register_pc \
+ ); \
+ _out( \
+ _prefix " CPSR = %08" PRIx64 " %c%c%c%c%c%c%c%c%c" \
+ " M:%" PRIx64 " %s\n", \
+ _frame->register_cpsr, \
+ ( _frame->register_cpsr & ( 1 << 31 ) ) != 0 ? 'N' : '-', \
+ ( _frame->register_cpsr & ( 1 << 30 ) ) != 0 ? 'Z' : '-', \
+ ( _frame->register_cpsr & ( 1 << 29 ) ) != 0 ? 'C' : '-', \
+ ( _frame->register_cpsr & ( 1 << 28 ) ) != 0 ? 'V' : '-', \
+ ( _frame->register_cpsr & ( 1 << 21 ) ) != 0 ? 'S' : '-', \
+ ( _frame->register_cpsr & ( 1 << 9 ) ) != 0 ? 'D' : '-', \
+ ( _frame->register_cpsr & ( 1 << 8 ) ) != 0 ? 'A' : '-', \
+ ( _frame->register_cpsr & ( 1 << 7 ) ) != 0 ? 'I' : '-', \
+ ( _frame->register_cpsr & ( 1 << 6 ) ) != 0 ? 'F' : '-', \
+ _frame->register_cpsr & 0x1f, \
+ aarch64_mode_label( _frame->register_cpsr & 0x1f ) \
+ ); \
+ } while ( 0 )
+
+/**
+ * The breakpoint instruction.
+ */
+static const uint8_t breakpoint[ 4 ] = { 0x00, 0x00, 0x20, 0xd4 };
+
+/**
+ * Target lock.
+ */
+RTEMS_INTERRUPT_LOCK_DEFINE( static, target_lock, "target_lock" )
+
+/**
+ * Is a session active?
+ */
+static bool debug_session_active;
+
+/*
+ * AArch64 debug hardware.
+ */
+static uint64_t hw_breakpoints;
+static uint64_t hw_watchpoints;
+
+#ifdef HARDWARE_BREAKPOINTS_NOT_USED
+/**
+ * Hardware break and watch points.
+ */
+typedef struct {
+ bool enabled;
+ bool loaded;
+ void *address;
+ size_t length;
+ CPU_Exception_frame *frame;
+ uint64_t control;
+ uint64_t value;
+} aarch64_debug_hwbreak;
+
+/*
+ * AArch64 guarantees that 2-16 breakpoints will be available in:
+ * DBGBCR<0-15>_EL1 (control)
+ * BT: BSP_FLD64(val, 20, 23) (breakpoint type, always 0x0 or 0x4, address match or mismatch)
+ * LBN: BSP_FLD64(val, 16, 19) (linked breakpoint number, always 0x0, not relevant given above)
+ * SSC: BSP_FLD64(val, 14, 15) (security state control, only 0x0 relevant)
+ * HMC: BSP_BIT64(13) (higher mode control, only 0x0 relevant)
+ * BAS: BSP_FLD64(val, 5, 8) (byte address select, always 0xF, other values denote debugging of AArch32 code)
+ * PMC: BSP_FLD64(val, 1, 2) (privelege mode control, only 0x1 relevant)
+ * E: BSP_BIT64(0) (enable, 0x1 when in use, 0x0 when disabled)
+ * DBGBVR<0-15>_EL1 (value, address)
+ * ID_AA64DFR0_EL1
+ * WRPs: BSP_FLD64(val, 20, 23) (watchpoints implemented - 1, 0x0 reserved so minimum 2)
+ * BRPs: BSP_FLD64(val, 12, 15) (breakpoints implemented - 1, 0x0 reserved so minimum 2)
+ * DebugVer: BSP_FLD64(val, 0, 3) (0x6 - 8, 0x7 - 8 w/ VHE, 0x8 - 8.2, 0x9 - 8.4)
+ */
+#define AARCH64_HW_BREAKPOINT_MAX ( 16 )
+
+/*
+ * Types of break points.
+ */
+#define AARCH64_HW_BP_TYPE_UNLINKED_INSTR_MATCH ( 0x0 << 20 )
+#define AARCH64_HW_BP_TYPE_UNLINKED_INSTR_MISMATCH ( 0x4 << 20 )
+
+/*
+ * Byte Address Select
+ */
+#define AARCH64_HW_BP_BAS_A64 ( 0xF << 5 )
+
+/*
+ * Privilege level, corresponds to PMC at 2:1
+ */
+#define AARCH64_HW_BP_PRIV_EL1 ( 0x1 << 1 )
+
+/*
+ * Breakpoint enable.
+ */
+#define AARCH64_HW_BP_ENABLE ( 0x1 )
+
+static aarch64_debug_hwbreak hw_breaks[ AARCH64_HW_BREAKPOINT_MAX ];
+#endif
+
+/*
+ * Target debugging support. Use this to debug the backend.
+ */
+#if TARGET_DEBUG
+
+void rtems_debugger_printk_lock( rtems_interrupt_lock_context *lock_context );
+
+void rtems_debugger_printk_unlock(
+ rtems_interrupt_lock_context *lock_context
+);
+
+static void target_printk( const char *format, ... ) RTEMS_PRINTFLIKE( 1, 2 );
+
+static void target_printk( const char *format, ... )
+{
+ rtems_interrupt_lock_context lock_context;
+ va_list ap;
+
+ va_start( ap, format );
+ rtems_debugger_printk_lock( &lock_context );
+ vprintk( format, ap );
+ rtems_debugger_printk_unlock( &lock_context );
+ va_end( ap );
+}
+
+#else
+#define target_printk( _fmt, ... )
+#endif
+
+static const char *aarch64_mode_label( int mode )
+{
+ switch ( mode ) {
+ case 0x0:
+ return "EL0t";
+ case 0x4:
+ return "EL1t";
+ case 0x5:
+ return "EL1h";
+ }
+
+ return "---";
+}
+
+static int aarch64_debug_probe( rtems_debugger_target *target )
+{
+ int debug_version;
+ uint64_t val;
+ const char *vl = "[Invalid version]";
+ const char * const labels[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "ARMv8.0",
+ "ARMv8.0+VHE",
+ "ARMv8.2",
+ "ARMv8.4"
+ };
+
+ val = _AArch64_Read_midr_el1();
+ rtems_debugger_printf(
+ "rtems-db: aarch64 core: Architecture: %" PRIu64 " Variant: %" PRIu64 " " \
+ "Implementor: %" PRIu64 " Part Number: %" PRIu64 " Revision: %" PRIu64 "\n",
+ AARCH64_MIDR_EL1_ARCHITECTURE_GET( val ),
+ AARCH64_MIDR_EL1_VARIANT_GET( val ),
+ AARCH64_MIDR_EL1_IMPLEMENTER_GET( val ),
+ AARCH64_MIDR_EL1_PARTNUM_GET( val ),
+ AARCH64_MIDR_EL1_REVISION_GET( val )
+ );
+
+ val = _AArch64_Read_id_aa64dfr0_el1();
+
+ debug_version = AARCH64_ID_AA64DFR0_EL1_DEBUGVER_GET( val );
+
+ if ( debug_version < 6 || debug_version > 9 ) {
+ rtems_debugger_printf(
+ "rtems-db: aarch64 debug: %d not supported\n",
+ debug_version
+ );
+ errno = EIO;
+ return -1;
+ }
+
+ vl = labels[ debug_version ];
+ hw_breakpoints = AARCH64_ID_AA64DFR0_EL1_BRPS_GET( val );
+ hw_watchpoints = AARCH64_ID_AA64DFR0_EL1_WRPS_GET( val );
+
+ rtems_debugger_printf(
+ "rtems-db: aarch64 debug: %s (%d) " \
+ "breakpoints:%" PRIu64 " watchpoints:%" PRIu64 "\n",
+ vl,
+ debug_version,
+ hw_breakpoints,
+ hw_watchpoints
+ );
+
+ return 0;
+}
+
+#ifdef HARDWARE_BREAKPOINTS_NOT_USED
+static void aarch64_debug_break_write_control( int bp, uint64_t control )
+{
+ if ( bp < 15 ) {
+ switch ( bp ) {
+ case 0:
+ _AArch64_Write_dbgbcr0_el1( control );
+ break;
+ case 1:
+ _AArch64_Write_dbgbcr1_el1( control );
+ break;
+ case 2:
+ _AArch64_Write_dbgbcr2_el1( control );
+ break;
+ case 3:
+ _AArch64_Write_dbgbcr3_el1( control );
+ break;
+ case 4:
+ _AArch64_Write_dbgbcr4_el1( control );
+ break;
+ case 5:
+ _AArch64_Write_dbgbcr5_el1( control );
+ break;
+ case 6:
+ _AArch64_Write_dbgbcr6_el1( control );
+ break;
+ case 7:
+ _AArch64_Write_dbgbcr7_el1( control );
+ break;
+ case 8:
+ _AArch64_Write_dbgbcr8_el1( control );
+ break;
+ case 9:
+ _AArch64_Write_dbgbcr9_el1( control );
+ break;
+ case 10:
+ _AArch64_Write_dbgbcr10_el1( control );
+ break;
+ case 11:
+ _AArch64_Write_dbgbcr11_el1( control );
+ break;
+ case 12:
+ _AArch64_Write_dbgbcr12_el1( control );
+ break;
+ case 13:
+ _AArch64_Write_dbgbcr13_el1( control );
+ break;
+ case 14:
+ _AArch64_Write_dbgbcr14_el1( control );
+ break;
+ case 15:
+ _AArch64_Write_dbgbcr15_el1( control );
+ break;
+ }
+ }
+}
+
+static void aarch64_debug_break_write_value( int bp, uint64_t value )
+{
+ if ( bp < 15 ) {
+ switch ( bp ) {
+ case 0:
+ _AArch64_Write_dbgbvr0_el1( value );
+ break;
+ case 1:
+ _AArch64_Write_dbgbvr1_el1( value );
+ break;
+ case 2:
+ _AArch64_Write_dbgbvr2_el1( value );
+ break;
+ case 3:
+ _AArch64_Write_dbgbvr3_el1( value );
+ break;
+ case 4:
+ _AArch64_Write_dbgbvr4_el1( value );
+ break;
+ case 5:
+ _AArch64_Write_dbgbvr5_el1( value );
+ break;
+ case 6:
+ _AArch64_Write_dbgbvr6_el1( value );
+ break;
+ case 7:
+ _AArch64_Write_dbgbvr7_el1( value );
+ break;
+ case 8:
+ _AArch64_Write_dbgbvr8_el1( value );
+ break;
+ case 9:
+ _AArch64_Write_dbgbvr9_el1( value );
+ break;
+ case 10:
+ _AArch64_Write_dbgbvr10_el1( value );
+ break;
+ case 11:
+ _AArch64_Write_dbgbvr11_el1( value );
+ break;
+ case 12:
+ _AArch64_Write_dbgbvr12_el1( value );
+ break;
+ case 13:
+ _AArch64_Write_dbgbvr13_el1( value );
+ break;
+ case 14:
+ _AArch64_Write_dbgbvr14_el1( value );
+ break;
+ case 15:
+ _AArch64_Write_dbgbvr15_el1( value );
+ break;
+ }
+ }
+}
+
+static inline void aarch64_debug_break_setup(
+ uint8_t index,
+ uint64_t address
+)
+{
+ aarch64_debug_hwbreak *bp = &hw_breaks[ index ];
+
+ bp->control = AARCH64_HW_BP_TYPE_UNLINKED_INSTR_MISMATCH |
+ AARCH64_HW_BP_BAS_A64 |
+ AARCH64_HW_BP_PRIV_EL1 |
+ AARCH64_HW_BP_ENABLE;
+ uint64_t address_mask = 0x3;
+
+ bp->value = (intptr_t) ( address & ~address_mask );
+ aarch64_debug_break_write_value( index, bp->value );
+ aarch64_debug_break_write_control( index, bp->control );
+}
+
+static void aarch64_debug_break_clear( void )
+{
+ rtems_interrupt_lock_context lock_context;
+ aarch64_debug_hwbreak *bp = &hw_breaks[ 0 ];
+ int i;
+
+ rtems_interrupt_lock_acquire( &target_lock, &lock_context );
+
+ for ( i = 0; i < hw_breakpoints; ++i, ++bp ) {
+ bp->enabled = false;
+ bp->loaded = false;
+ }
+
+ rtems_interrupt_lock_release( &target_lock, &lock_context );
+}
+
+static void aarch64_debug_break_load( void )
+{
+ rtems_interrupt_lock_context lock_context;
+ aarch64_debug_hwbreak *bp = &hw_breaks[ 0 ];
+ int i;
+
+ rtems_interrupt_lock_acquire( &target_lock, &lock_context );
+
+ if ( bp->enabled && !bp->loaded ) {
+ aarch64_debug_set_context_id( 0xdead1111 );
+ aarch64_debug_break_write_value( 0, bp->value );
+ aarch64_debug_break_write_control( 0, bp->control );
+ }
+
+ ++bp;
+
+ for ( i = 1; i < hw_breakpoints; ++i, ++bp ) {
+ if ( bp->enabled && !bp->loaded ) {
+ bp->loaded = true;
+ aarch64_debug_break_write_value( i, bp->value );
+ aarch64_debug_break_write_control( i, bp->control );
+ }
+ }
+
+ rtems_interrupt_lock_release( &target_lock, &lock_context );
+}
+
+static void aarch64_debug_break_unload( void )
+{
+ rtems_interrupt_lock_context lock_context;
+ aarch64_debug_hwbreak *bp = &hw_breaks[ 0 ];
+ int i;
+
+ rtems_interrupt_lock_acquire( &target_lock, &lock_context );
+ aarch64_debug_set_context_id( 0 );
+
+ for ( i = 0; i < hw_breakpoints; ++i, ++bp ) {
+ bp->loaded = false;
+ aarch64_debug_break_write_control( i, 0 );
+ }
+
+ rtems_interrupt_lock_release( &target_lock, &lock_context );
+}
+
+static void aarch64_debug_break_dump( void )
+{
+#if TARGET_DEBUG
+ aarch64_debug_hwbreak *bp = &hw_breaks[ 0 ];
+ int i;
+
+ for ( i = 0; i < hw_breakpoints; ++i, ++bp ) {
+ if ( bp->enabled ) {
+ target_printk(
+ "[} bp: %d: control: %016" PRIx64 " addr: %016" PRIxPTR "\n",
+ i,
+ bp->control,
+ (uintptr_t) bp->value
+ );
+ }
+ }
+
+#endif
+}
+#endif
+
+static void aarch64_debug_disable_interrupts( void )
+{
+ __asm__ volatile ( "msr DAIFSet, #0x2" );
+}
+
+static void aarch64_debug_enable_interrupts( void )
+{
+ __asm__ volatile ( "msr DAIFClr, #2\n" );
+}
+
+static void aarch64_debug_disable_debug_exceptions( void )
+{
+ __asm__ volatile ( "msr DAIFSet, #0x8" );
+}
+
+static inline void aarch64_debug_set_context_id( const uint32_t id )
+{
+ _AArch64_Write_contextidr_el1( id );
+}
+
+int rtems_debugger_target_configure( rtems_debugger_target *target )
+{
+ target->capabilities = ( RTEMS_DEBUGGER_TARGET_CAP_SWBREAK );
+ target->reg_num = RTEMS_DEBUGGER_NUMREGS;
+ target->reg_offset = aarch64_reg_offsets;
+ target->breakpoint = &breakpoint[ 0 ];
+ target->breakpoint_size = sizeof( breakpoint );
+ return aarch64_debug_probe( target );
+}
+
+static void target_print_frame( CPU_Exception_frame *frame )
+{
+ EXC_FRAME_PRINT( target_printk, "[} ", frame );
+}
+
+/* returns true if cascade is required */
+static bool target_exception( CPU_Exception_frame *frame )
+{
+ target_printk(
+ "[} > frame = %016" PRIxPTR \
+ " sig=%d" \
+ " pra=%016" PRIxPTR "\n" \
+ "[} > esr=%016" PRIx64 \
+ " far=%016" PRIxPTR "\n",
+ (uintptr_t) frame,
+ rtems_debugger_target_exception_to_signal( frame ),
+ (uintptr_t) frame->register_pc,
+ (uint64_t) frame->register_syndrome,
+ (uintptr_t) frame->register_fault_address
+ );
+
+ target_print_frame( frame );
+
+ switch ( rtems_debugger_target_exception( frame ) ) {
+ case rtems_debugger_target_exc_consumed:
+ default:
+ break;
+ case rtems_debugger_target_exc_step:
+ break;
+ case rtems_debugger_target_exc_cascade:
+ target_printk( "rtems-db: unhandled exception: cascading\n" );
+ /* Continue in fatal error handler chain */
+ return true;
+ break;
+ }
+
+ target_printk(
+ "[} < resuming frame = %016" PRIxPTR "\n",
+ (uintptr_t) frame
+ );
+ target_print_frame( frame );
+
+#if TARGET_DEBUG
+ uint64_t mdscr = _AArch64_Read_mdscr_el1();
+#endif
+ target_printk(
+ "[} global stepping: %s\n",
+ mdscr & AARCH64_MDSCR_EL1_SS ? "yes" : "no"
+ );
+ target_printk(
+ "[} kernel self-debug: %s\n",
+ mdscr & AARCH64_MDSCR_EL1_KDE ? "yes" : "no"
+ );
+ target_printk(
+ "[} non-step/non-BRK debug events: %s\n",
+ mdscr & AARCH64_MDSCR_EL1_MDE ? "yes" : "no"
+ );
+ target_printk(
+ "[} OSLSR(should be 0x8): 0x%016" PRIx64 "\n",
+ _AArch64_Read_oslsr_el1()
+ );
+#ifdef HARDWARE_BREAKPOINTS_NOT_USED
+ aarch64_debug_break_dump();
+#endif
+ return false;
+}
+
+#define xstr( a ) str( a )
+#define str( a ) #a
+#define FRAME_SIZE_STR xstr( AARCH64_EXCEPTION_FRAME_SIZE )
+
+/*
+ * This block of assembly must have a target branch function because GCC
+ * requires that SP not accumulate changes across an ASM block. Instead of
+ * changing the SP, we branch to a new function and never return since it was
+ * never going to return anyway.
+ */
+#define SWITCH_STACKS_AND_ALLOC( new_mode, old_frame, jump_target ) \
+ __asm__ volatile ( \
+ "msr spsel, #" new_mode "\n" /* switch to thread stack */ \
+ "sub sp, sp, #" FRAME_SIZE_STR "\n" /* reserve space for CEF */ \
+ "mov x0, sp\n" /* Set x0 to the new exception frame */ \
+ "mov x1, %[old_frame]\n" /* Set x1 to the old exception frame */ \
+ "b " #jump_target "\n" /* Jump to the specified function */ \
+ : \
+ : [ old_frame ] "r" ( old_frame ) \
+ : "x0", "x1" )
+
+#define SWITCH_STACKS_AND_ALLOC_WITH_CASCADE( new_mode, app_frame, \
+ jump_target ) \
+ __asm__ volatile ( \
+ "msr spsel, #" new_mode "\n" /* switch to thread stack */ \
+ "sub sp, sp, #" FRAME_SIZE_STR "\n" /* reserve space for CEF */ \
+ "mov x0, sp\n" /* Set x0 to the new exception frame */ \
+ "mov x1, %[app_frame]\n" /* Set x1 to the old exception frame */ \
+ "mov x2, %[needs_cascade]\n" /* pass on whether cascade is needed */ \
+ "b " #jump_target "\n" /* Jump to the specified function */ \
+ : \
+ : [ app_frame ] "r" ( app_frame ), \
+ [ needs_cascade ] "r" ( needs_cascade ) \
+ : "x0", "x1" )
+
+/*
+ * This block does not have an overall effect on SP since the spsel mode change
+ * preserves the original SP
+ */
+#define DROP_OLD_FRAME( old_frame, old_mode, new_mode ) \
+ __asm__ volatile ( \
+ "msr spsel, #" old_mode "\n" /* switch to exception stack */ \
+ "mov sp, %0\n" /* Reset SP to the beginning of the CEF */ \
+ "add sp, sp, #" FRAME_SIZE_STR "\n" /* release space for CEF on exception stack */ \
+ "msr spsel, #" new_mode "\n" /* switch to thread stack */ \
+ : \
+ : "r" ( old_frame ) ) \
+
+#define THREAD_MODE "1"
+#define EXCEPTION_MODE "0"
+
+void target_exception_stack_stage_3(
+ CPU_Exception_frame *exc_frame,
+ CPU_Exception_frame *app_frame,
+ bool needs_cascade
+);
+
+void target_exception_stack_stage_3(
+ CPU_Exception_frame *exc_frame,
+ CPU_Exception_frame *app_frame,
+ bool needs_cascade
+)
+{
+ _AArch64_Exception_frame_copy( exc_frame, app_frame );
+ DROP_OLD_FRAME( app_frame, THREAD_MODE, EXCEPTION_MODE );
+
+ if ( needs_cascade ) {
+ /* does not return */
+ _AArch64_Exception_default( exc_frame );
+ }
+
+ /* does not return */
+ _CPU_Exception_resume( exc_frame );
+}
+
+void target_exception_stack_stage_2(
+ CPU_Exception_frame *app_frame,
+ CPU_Exception_frame *exc_frame
+);
+
+void target_exception_stack_stage_2(
+ CPU_Exception_frame *app_frame,
+ CPU_Exception_frame *exc_frame
+)
+{
+ _AArch64_Exception_frame_copy( app_frame, exc_frame );
+ DROP_OLD_FRAME( exc_frame, EXCEPTION_MODE, THREAD_MODE );
+ /* breakpoints must be disabled here since other tasks could run that don't have debug masked */
+#ifdef HARDWARE_BREAKPOINTS_NOT_USED
+ aarch64_debug_break_unload();
+#endif
+ /* enable interrupts here to allow this thread to be suspended as necessary */
+ aarch64_debug_enable_interrupts();
+ bool needs_cascade = target_exception( app_frame );
+
+ /* disable interrupts to return to normal operation */
+ aarch64_debug_disable_interrupts();
+ /* re-enable breakpoints disabled above */
+#ifdef HARDWARE_BREAKPOINTS_NOT_USED
+ aarch64_debug_break_load();
+#endif
+ SWITCH_STACKS_AND_ALLOC_WITH_CASCADE(
+ EXCEPTION_MODE,
+ app_frame,
+ target_exception_stack_stage_3
+ );
+}
+
+/* not allowed to return since it unwinds the stack */
+static void target_exception_thread_stack( CPU_Exception_frame *old_frame )
+{
+ SWITCH_STACKS_AND_ALLOC(
+ THREAD_MODE,
+ old_frame,
+ target_exception_stack_stage_2
+ );
+}
+
+static void target_exception_application( CPU_Exception_frame *ef )
+{
+ /* Continue in fatal error handler chain */
+ if ( !debug_session_active ) {
+ /* does not return */
+ _AArch64_Exception_default( ef );
+ }
+
+ /*
+ * Set CPSR.D to disable single-step operation, this will be cleared before
+ * the thread is resumed if necessary.
+ */
+ ef->register_cpsr |= AARCH64_DSPSR_EL0_D;
+
+ /*
+ * Switching to the user stack is not possible if the stack pointer is bad.
+ * This should be a relatively rare occurrance and signals a severe problem
+ * with the application code or system.
+ */
+ if ( AARCH64_ESR_EL1_EC_GET( ef->register_syndrome ) == 0x26 ) {
+ if ( target_exception( ef ) ) {
+ /* does not return */
+ _AArch64_Exception_default( ef );
+ }
+
+ /* does not return */
+ _CPU_Exception_resume( ef );
+ }
+
+ target_exception_thread_stack( ef );
+}
+
+static void target_exception_kernel( CPU_Exception_frame *ef )
+{
+ /*
+ * If there is a stack alignment problem in exception mode, it really
+ * shouldn't happen and execution won't even make it this far.
+ */
+ if ( !debug_session_active ) {
+ /* does not return */
+ _AArch64_Exception_default( ef );
+ }
+
+ /*
+ * Set CPSR.D to disable single-step operation, this will be cleared before
+ * the thread is resumed if necessary.
+ */
+ ef->register_cpsr |= AARCH64_DSPSR_EL0_D;
+
+ if ( target_exception( ef ) ) {
+ /* does not return */
+ _AArch64_Exception_default( ef );
+ }
+
+ /* does not return */
+ _CPU_Exception_resume( ef );
+}
+
+static void rtems_debugger_target_set_vectors( void )
+{
+ /* Set vectors for both application and kernel modes */
+ AArch64_set_exception_handler(
+ AARCH64_EXCEPTION_SPx_SYNCHRONOUS,
+ (void *) target_exception_application
+ );
+ AArch64_set_exception_handler(
+ AARCH64_EXCEPTION_SP0_SYNCHRONOUS,
+ (void *) target_exception_kernel
+ );
+}
+
+static bool rtems_debugger_is_int_reg( size_t reg )
+{
+ const size_t size = aarch64_reg_offsets[ reg + 1 ] -
+ aarch64_reg_offsets[ reg ];
+
+ return size == RTEMS_DEBUGGER_REG_BYTES;
+}
+
+static void rtems_debugger_set_int_reg(
+ rtems_debugger_thread *thread,
+ size_t reg,
+ const uint64_t value
+)
+{
+ const size_t offset = aarch64_reg_offsets[ reg ];
+
+ memcpy( &thread->registers[ offset ], &value, sizeof( uint64_t ) );
+}
+
+static const uint64_t rtems_debugger_get_int_reg(
+ rtems_debugger_thread *thread,
+ size_t reg
+)
+{
+ const size_t offset = aarch64_reg_offsets[ reg ];
+ uint64_t value;
+
+ memcpy( &value, &thread->registers[ offset ], sizeof( uint64_t ) );
+ return value;
+}
+
+static void rtems_debugger_set_halfint_reg(
+ rtems_debugger_thread *thread,
+ size_t reg,
+ const uint32_t value
+)
+{
+ const size_t offset = aarch64_reg_offsets[ reg ];
+
+ memcpy( &thread->registers[ offset ], &value, sizeof( uint32_t ) );
+}
+
+static const uint32_t rtems_debugger_get_halfint_reg(
+ rtems_debugger_thread *thread,
+ size_t reg
+)
+{
+ const size_t offset = aarch64_reg_offsets[ reg ];
+ uint32_t value;
+
+ memcpy( &value, &thread->registers[ offset ], sizeof( uint32_t ) );
+ return value;
+}
+
+static void rtems_debugger_set_fp_reg(
+ rtems_debugger_thread *thread,
+ size_t reg,
+ const uint128_t value
+)
+{
+ const size_t offset = aarch64_reg_offsets[ reg ];
+
+ memcpy( &thread->registers[ offset ], &value, sizeof( uint128_t ) );
+}
+
+static const uint128_t rtems_debugger_get_fp_reg(
+ rtems_debugger_thread *thread,
+ size_t reg
+)
+{
+ const size_t offset = aarch64_reg_offsets[ reg ];
+ uint128_t value;
+
+ memcpy( &value, &thread->registers[ offset ], sizeof( uint128_t ) );
+ return value;
+}
+
+static rtems_status_code rtems_debugger_target_set_text_writable(
+ bool writable
+)
+{
+ uintptr_t text_begin = (uintptr_t) bsp_section_text_begin;
+ uintptr_t text_end = (uintptr_t) bsp_section_text_end;
+ uintptr_t fast_text_begin = (uintptr_t) bsp_section_fast_text_begin;
+ uintptr_t fast_text_end = (uintptr_t) bsp_section_fast_text_end;
+ uint64_t mmu_flags = AARCH64_MMU_CODE_RW_CACHED;
+ rtems_status_code sc;
+
+ if ( !writable ) {
+ mmu_flags = AARCH64_MMU_CODE_CACHED;
+ }
+
+ target_printk(
+ "[} MMU edit: text_begin: 0x%016" PRIxPTR
+ " text_end: 0x%016" PRIxPTR "\n",
+ text_begin,
+ text_end
+ );
+ sc = aarch64_mmu_map(
+ text_begin,
+ text_end - text_begin,
+ mmu_flags
+ );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ target_printk( "[} MMU edit failed\n" );
+ return sc;
+ }
+
+ target_printk(
+ "[} MMU edit: fast_text_begin: 0x%016" PRIxPTR
+ " fast_text_end: 0x%016" PRIxPTR "\n",
+ fast_text_begin,
+ fast_text_end
+ );
+ sc = aarch64_mmu_map(
+ fast_text_begin,
+ fast_text_end - fast_text_begin,
+ mmu_flags
+ );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ target_printk( "[} MMU edit failed\n" );
+ }
+
+ return sc;
+}
+
+static rtems_task setup_debugger_on_cpu( rtems_task_argument arg )
+{
+ rtems_status_code sc;
+ rtems_status_code *init_error = (rtems_status_code *) arg;
+ rtems_interrupt_lock_context lock_context;
+
+ rtems_interrupt_lock_acquire( &target_lock, &lock_context );
+ sc = rtems_debugger_target_set_text_writable( true );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ *init_error = sc;
+ }
+
+ rtems_debugger_target_set_vectors();
+
+ /* enable single-step debugging */
+ uint64_t mdscr = _AArch64_Read_mdscr_el1();
+
+ mdscr |= AARCH64_MDSCR_EL1_SS;
+ mdscr |= AARCH64_MDSCR_EL1_KDE;
+ mdscr |= AARCH64_MDSCR_EL1_MDE;
+ _AArch64_Write_mdscr_el1( mdscr );
+
+ /* clear the OS lock */
+ _AArch64_Write_oslar_el1( 0 );
+ rtems_interrupt_lock_release( &target_lock, &lock_context );
+}
+
+int rtems_debugger_target_enable( void )
+{
+ rtems_status_code sc;
+ rtems_status_code init_error = RTEMS_SUCCESSFUL;
+
+ debug_session_active = true;
+#ifdef HARDWARE_BREAKPOINTS_NOT_USED
+ aarch64_debug_break_unload();
+ aarch64_debug_break_clear();
+#endif
+ aarch64_debug_disable_debug_exceptions();
+ sc = run_across_cpus(
+ setup_debugger_on_cpu,
+ ( rtems_task_argument ) & init_error
+ );
+
+ if ( init_error != RTEMS_SUCCESSFUL ) {
+ return init_error;
+ }
+
+ return sc;
+}
+
+static rtems_task teardown_debugger_on_cpu( rtems_task_argument arg )
+{
+ rtems_status_code sc;
+ rtems_status_code *deinit_error = (rtems_status_code *) arg;
+ rtems_interrupt_lock_context lock_context;
+
+ rtems_interrupt_lock_acquire( &target_lock, &lock_context );
+ sc = rtems_debugger_target_set_text_writable( false );
+
+ if ( sc != RTEMS_SUCCESSFUL ) {
+ *deinit_error = sc;
+ }
+
+ /* disable single-step debugging */
+ uint64_t mdscr = _AArch64_Read_mdscr_el1();
+
+ mdscr &= ~AARCH64_MDSCR_EL1_SS;
+ mdscr &= ~AARCH64_MDSCR_EL1_KDE;
+ mdscr &= ~AARCH64_MDSCR_EL1_MDE;
+ _AArch64_Write_mdscr_el1( mdscr );
+
+ rtems_interrupt_lock_release( &target_lock, &lock_context );
+}
+
+int rtems_debugger_target_disable( void )
+{
+ rtems_status_code sc;
+ rtems_status_code deinit_error = RTEMS_SUCCESSFUL;
+
+ debug_session_active = false;
+#ifdef HARDWARE_BREAKPOINTS_NOT_USED
+ aarch64_debug_break_unload();
+ aarch64_debug_break_clear();
+#endif
+ sc = run_across_cpus(
+ teardown_debugger_on_cpu,
+ ( rtems_task_argument ) & deinit_error
+ );
+
+ if ( deinit_error != RTEMS_SUCCESSFUL ) {
+ return deinit_error;
+ }
+
+ return sc;
+}
+
+int rtems_debugger_target_read_regs( rtems_debugger_thread *thread )
+{
+ if (
+ !rtems_debugger_thread_flag(
+ thread,
+ RTEMS_DEBUGGER_THREAD_FLAG_REG_VALID
+ )
+ ) {
+ static const uintptr_t good_address = (uintptr_t) &good_address;
+ int i;
+
+ memset( &thread->registers[ 0 ], 0, RTEMS_DEBUGGER_NUMREGBYTES );
+
+ /* set all integer register to a known valid address */
+ for ( i = 0; i < RTEMS_DEBUGGER_NUMREGS; ++i ) {
+ if ( rtems_debugger_is_int_reg( i ) ) {
+ rtems_debugger_set_int_reg( thread, i, (uintptr_t) &good_address );
+ }
+ }
+
+ if ( thread->frame ) {
+ CPU_Exception_frame *frame = thread->frame;
+
+ *( (CPU_Exception_frame *) thread->registers ) = *frame;
+ rtems_debugger_set_int_reg( thread, REG_X0, frame->register_x0 );
+ rtems_debugger_set_int_reg( thread, REG_X1, frame->register_x1 );
+ rtems_debugger_set_int_reg( thread, REG_X2, frame->register_x2 );
+ rtems_debugger_set_int_reg( thread, REG_X3, frame->register_x3 );
+ rtems_debugger_set_int_reg( thread, REG_X4, frame->register_x4 );
+ rtems_debugger_set_int_reg( thread, REG_X5, frame->register_x5 );
+ rtems_debugger_set_int_reg( thread, REG_X6, frame->register_x6 );
+ rtems_debugger_set_int_reg( thread, REG_X7, frame->register_x7 );
+ rtems_debugger_set_int_reg( thread, REG_X8, frame->register_x8 );
+ rtems_debugger_set_int_reg( thread, REG_X9, frame->register_x9 );
+ rtems_debugger_set_int_reg( thread, REG_X10, frame->register_x10 );
+ rtems_debugger_set_int_reg( thread, REG_X11, frame->register_x11 );
+ rtems_debugger_set_int_reg( thread, REG_X12, frame->register_x12 );
+ rtems_debugger_set_int_reg( thread, REG_X13, frame->register_x13 );
+ rtems_debugger_set_int_reg( thread, REG_X14, frame->register_x14 );
+ rtems_debugger_set_int_reg( thread, REG_X15, frame->register_x15 );
+ rtems_debugger_set_int_reg( thread, REG_X16, frame->register_x16 );
+ rtems_debugger_set_int_reg( thread, REG_X17, frame->register_x17 );
+ rtems_debugger_set_int_reg( thread, REG_X18, frame->register_x18 );
+ rtems_debugger_set_int_reg( thread, REG_X19, frame->register_x19 );
+ rtems_debugger_set_int_reg( thread, REG_X20, frame->register_x20 );
+ rtems_debugger_set_int_reg( thread, REG_X21, frame->register_x21 );
+ rtems_debugger_set_int_reg( thread, REG_X22, frame->register_x22 );
+ rtems_debugger_set_int_reg( thread, REG_X23, frame->register_x23 );
+ rtems_debugger_set_int_reg( thread, REG_X24, frame->register_x24 );
+ rtems_debugger_set_int_reg( thread, REG_X25, frame->register_x25 );
+ rtems_debugger_set_int_reg( thread, REG_X26, frame->register_x26 );
+ rtems_debugger_set_int_reg( thread, REG_X27, frame->register_x27 );
+ rtems_debugger_set_int_reg( thread, REG_X28, frame->register_x28 );
+ rtems_debugger_set_int_reg( thread, REG_FP, frame->register_fp );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_LR,
+ (intptr_t) frame->register_lr
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_SP,
+ (intptr_t) frame->register_sp
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_PC,
+ (intptr_t) frame->register_pc
+ );
+ /* GDB considers CPSR to be 32-bit because bits 63:32 are RES0 */
+ rtems_debugger_set_halfint_reg(
+ thread,
+ REG_CPS,
+ (uint32_t) frame->register_cpsr
+ );
+ rtems_debugger_set_fp_reg( thread, REG_V0, frame->register_q0 );
+ rtems_debugger_set_fp_reg( thread, REG_V1, frame->register_q1 );
+ rtems_debugger_set_fp_reg( thread, REG_V2, frame->register_q2 );
+ rtems_debugger_set_fp_reg( thread, REG_V3, frame->register_q3 );
+ rtems_debugger_set_fp_reg( thread, REG_V4, frame->register_q4 );
+ rtems_debugger_set_fp_reg( thread, REG_V5, frame->register_q5 );
+ rtems_debugger_set_fp_reg( thread, REG_V6, frame->register_q6 );
+ rtems_debugger_set_fp_reg( thread, REG_V7, frame->register_q7 );
+ rtems_debugger_set_fp_reg( thread, REG_V8, frame->register_q8 );
+ rtems_debugger_set_fp_reg( thread, REG_V9, frame->register_q9 );
+ rtems_debugger_set_fp_reg( thread, REG_V10, frame->register_q10 );
+ rtems_debugger_set_fp_reg( thread, REG_V11, frame->register_q11 );
+ rtems_debugger_set_fp_reg( thread, REG_V12, frame->register_q12 );
+ rtems_debugger_set_fp_reg( thread, REG_V13, frame->register_q13 );
+ rtems_debugger_set_fp_reg( thread, REG_V14, frame->register_q14 );
+ rtems_debugger_set_fp_reg( thread, REG_V15, frame->register_q15 );
+ rtems_debugger_set_fp_reg( thread, REG_V16, frame->register_q16 );
+ rtems_debugger_set_fp_reg( thread, REG_V17, frame->register_q17 );
+ rtems_debugger_set_fp_reg( thread, REG_V18, frame->register_q18 );
+ rtems_debugger_set_fp_reg( thread, REG_V19, frame->register_q19 );
+ rtems_debugger_set_fp_reg( thread, REG_V20, frame->register_q20 );
+ rtems_debugger_set_fp_reg( thread, REG_V21, frame->register_q21 );
+ rtems_debugger_set_fp_reg( thread, REG_V22, frame->register_q22 );
+ rtems_debugger_set_fp_reg( thread, REG_V23, frame->register_q23 );
+ rtems_debugger_set_fp_reg( thread, REG_V24, frame->register_q24 );
+ rtems_debugger_set_fp_reg( thread, REG_V25, frame->register_q25 );
+ rtems_debugger_set_fp_reg( thread, REG_V26, frame->register_q26 );
+ rtems_debugger_set_fp_reg( thread, REG_V27, frame->register_q27 );
+ rtems_debugger_set_fp_reg( thread, REG_V28, frame->register_q28 );
+ rtems_debugger_set_fp_reg( thread, REG_V29, frame->register_q29 );
+ rtems_debugger_set_fp_reg( thread, REG_V30, frame->register_q30 );
+ rtems_debugger_set_fp_reg( thread, REG_V31, frame->register_q31 );
+ /* GDB considers FPSR and FPCR to be 32-bit because bits 63:32 are RES0 */
+ rtems_debugger_set_halfint_reg( thread, REG_FPS, frame->register_fpsr );
+ rtems_debugger_set_halfint_reg( thread, REG_FPC, frame->register_fpcr );
+ /*
+ * Get the signal from the frame.
+ */
+ thread->signal = rtems_debugger_target_exception_to_signal( frame );
+ } else {
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X19,
+ thread->tcb->Registers.register_x19
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X20,
+ thread->tcb->Registers.register_x20
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X21,
+ thread->tcb->Registers.register_x21
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X22,
+ thread->tcb->Registers.register_x22
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X23,
+ thread->tcb->Registers.register_x23
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X24,
+ thread->tcb->Registers.register_x24
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X25,
+ thread->tcb->Registers.register_x25
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X26,
+ thread->tcb->Registers.register_x26
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X27,
+ thread->tcb->Registers.register_x27
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_X28,
+ thread->tcb->Registers.register_x28
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_FP,
+ thread->tcb->Registers.register_fp
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_LR,
+ (intptr_t) thread->tcb->Registers.register_lr
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_SP,
+ (intptr_t) thread->tcb->Registers.register_sp
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_PC,
+ (intptr_t) thread->tcb->Registers.register_lr
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_V8,
+ thread->tcb->Registers.register_d8
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_V9,
+ thread->tcb->Registers.register_d9
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_V10,
+ thread->tcb->Registers.register_d10
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_V11,
+ thread->tcb->Registers.register_d11
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_V12,
+ thread->tcb->Registers.register_d12
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_V13,
+ thread->tcb->Registers.register_d13
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_V14,
+ thread->tcb->Registers.register_d14
+ );
+ rtems_debugger_set_int_reg(
+ thread,
+ REG_V15,
+ thread->tcb->Registers.register_d15
+ );
+ /*
+ * Blocked threads have no signal.
+ */
+ thread->signal = 0;
+ }
+
+ thread->flags |= RTEMS_DEBUGGER_THREAD_FLAG_REG_VALID;
+ thread->flags &= ~RTEMS_DEBUGGER_THREAD_FLAG_REG_DIRTY;
+ }
+
+ return 0;
+}
+
+int rtems_debugger_target_write_regs( rtems_debugger_thread *thread )
+{
+ if (
+ rtems_debugger_thread_flag(
+ thread,
+ RTEMS_DEBUGGER_THREAD_FLAG_REG_DIRTY
+ )
+ ) {
+ /*
+ * Only write to debugger controlled exception threads. Do not touch the
+ * registers for threads blocked in the context switcher.
+ */
+ if (
+ rtems_debugger_thread_flag(
+ thread,
+ RTEMS_DEBUGGER_THREAD_FLAG_EXCEPTION
+ )
+ ) {
+ CPU_Exception_frame *frame = thread->frame;
+ frame->register_x0 = rtems_debugger_get_int_reg( thread, REG_X0 );
+ frame->register_x1 = rtems_debugger_get_int_reg( thread, REG_X1 );
+ frame->register_x2 = rtems_debugger_get_int_reg( thread, REG_X2 );
+ frame->register_x3 = rtems_debugger_get_int_reg( thread, REG_X3 );
+ frame->register_x4 = rtems_debugger_get_int_reg( thread, REG_X4 );
+ frame->register_x5 = rtems_debugger_get_int_reg( thread, REG_X5 );
+ frame->register_x6 = rtems_debugger_get_int_reg( thread, REG_X6 );
+ frame->register_x7 = rtems_debugger_get_int_reg( thread, REG_X7 );
+ frame->register_x8 = rtems_debugger_get_int_reg( thread, REG_X8 );
+ frame->register_x9 = rtems_debugger_get_int_reg( thread, REG_X9 );
+ frame->register_x10 = rtems_debugger_get_int_reg( thread, REG_X10 );
+ frame->register_x11 = rtems_debugger_get_int_reg( thread, REG_X11 );
+ frame->register_x12 = rtems_debugger_get_int_reg( thread, REG_X12 );
+ frame->register_x13 = rtems_debugger_get_int_reg( thread, REG_X13 );
+ frame->register_x14 = rtems_debugger_get_int_reg( thread, REG_X14 );
+ frame->register_x15 = rtems_debugger_get_int_reg( thread, REG_X15 );
+ frame->register_x16 = rtems_debugger_get_int_reg( thread, REG_X16 );
+ frame->register_x17 = rtems_debugger_get_int_reg( thread, REG_X17 );
+ frame->register_x18 = rtems_debugger_get_int_reg( thread, REG_X18 );
+ frame->register_x19 = rtems_debugger_get_int_reg( thread, REG_X19 );
+ frame->register_x20 = rtems_debugger_get_int_reg( thread, REG_X20 );
+ frame->register_x21 = rtems_debugger_get_int_reg( thread, REG_X21 );
+ frame->register_x22 = rtems_debugger_get_int_reg( thread, REG_X22 );
+ frame->register_x23 = rtems_debugger_get_int_reg( thread, REG_X23 );
+ frame->register_x24 = rtems_debugger_get_int_reg( thread, REG_X24 );
+ frame->register_x25 = rtems_debugger_get_int_reg( thread, REG_X25 );
+ frame->register_x26 = rtems_debugger_get_int_reg( thread, REG_X26 );
+ frame->register_x27 = rtems_debugger_get_int_reg( thread, REG_X27 );
+ frame->register_x28 = rtems_debugger_get_int_reg( thread, REG_X28 );
+ frame->register_fp = (uintptr_t) rtems_debugger_get_int_reg(
+ thread,
+ REG_FP
+ );
+ frame->register_lr = (void *) (uintptr_t) rtems_debugger_get_int_reg(
+ thread,
+ REG_LR
+ );
+ frame->register_sp = (uintptr_t) rtems_debugger_get_int_reg(
+ thread,
+ REG_SP
+ );
+ frame->register_pc = (void *) (uintptr_t) rtems_debugger_get_int_reg(
+ thread,
+ REG_PC
+ );
+ frame->register_cpsr = rtems_debugger_get_halfint_reg( thread, REG_CPS );
+ frame->register_q0 = rtems_debugger_get_fp_reg( thread, REG_V0 );
+ frame->register_q1 = rtems_debugger_get_fp_reg( thread, REG_V1 );
+ frame->register_q2 = rtems_debugger_get_fp_reg( thread, REG_V2 );
+ frame->register_q3 = rtems_debugger_get_fp_reg( thread, REG_V3 );
+ frame->register_q4 = rtems_debugger_get_fp_reg( thread, REG_V4 );
+ frame->register_q5 = rtems_debugger_get_fp_reg( thread, REG_V5 );
+ frame->register_q6 = rtems_debugger_get_fp_reg( thread, REG_V6 );
+ frame->register_q7 = rtems_debugger_get_fp_reg( thread, REG_V7 );
+ frame->register_q8 = rtems_debugger_get_fp_reg( thread, REG_V8 );
+ frame->register_q9 = rtems_debugger_get_fp_reg( thread, REG_V9 );
+ frame->register_q10 = rtems_debugger_get_fp_reg( thread, REG_V10 );
+ frame->register_q11 = rtems_debugger_get_fp_reg( thread, REG_V11 );
+ frame->register_q12 = rtems_debugger_get_fp_reg( thread, REG_V12 );
+ frame->register_q13 = rtems_debugger_get_fp_reg( thread, REG_V13 );
+ frame->register_q14 = rtems_debugger_get_fp_reg( thread, REG_V14 );
+ frame->register_q15 = rtems_debugger_get_fp_reg( thread, REG_V15 );
+ frame->register_q16 = rtems_debugger_get_fp_reg( thread, REG_V16 );
+ frame->register_q17 = rtems_debugger_get_fp_reg( thread, REG_V17 );
+ frame->register_q18 = rtems_debugger_get_fp_reg( thread, REG_V18 );
+ frame->register_q19 = rtems_debugger_get_fp_reg( thread, REG_V19 );
+ frame->register_q20 = rtems_debugger_get_fp_reg( thread, REG_V20 );
+ frame->register_q21 = rtems_debugger_get_fp_reg( thread, REG_V21 );
+ frame->register_q22 = rtems_debugger_get_fp_reg( thread, REG_V22 );
+ frame->register_q23 = rtems_debugger_get_fp_reg( thread, REG_V23 );
+ frame->register_q24 = rtems_debugger_get_fp_reg( thread, REG_V24 );
+ frame->register_q25 = rtems_debugger_get_fp_reg( thread, REG_V25 );
+ frame->register_q26 = rtems_debugger_get_fp_reg( thread, REG_V26 );
+ frame->register_q27 = rtems_debugger_get_fp_reg( thread, REG_V27 );
+ frame->register_q28 = rtems_debugger_get_fp_reg( thread, REG_V28 );
+ frame->register_q29 = rtems_debugger_get_fp_reg( thread, REG_V29 );
+ frame->register_q30 = rtems_debugger_get_fp_reg( thread, REG_V30 );
+ frame->register_q31 = rtems_debugger_get_fp_reg( thread, REG_V31 );
+ frame->register_fpsr = rtems_debugger_get_halfint_reg( thread, REG_FPS );
+ frame->register_fpcr = rtems_debugger_get_halfint_reg( thread, REG_FPC );
+ }
+
+ thread->flags &= ~RTEMS_DEBUGGER_THREAD_FLAG_REG_DIRTY;
+ }
+
+ return 0;
+}
+
+uintptr_t rtems_debugger_target_reg_pc( rtems_debugger_thread *thread )
+{
+ int r;
+
+ r = rtems_debugger_target_read_regs( thread );
+
+ if ( r >= 0 ) {
+ return rtems_debugger_get_int_reg( thread, REG_PC );
+ }
+
+ return 0;
+}
+
+uintptr_t rtems_debugger_target_frame_pc( CPU_Exception_frame *frame )
+{
+ return (uintptr_t) frame->register_pc;
+}
+
+uintptr_t rtems_debugger_target_reg_sp( rtems_debugger_thread *thread )
+{
+ int r;
+
+ r = rtems_debugger_target_read_regs( thread );
+
+ if ( r >= 0 ) {
+ return rtems_debugger_get_int_reg( thread, REG_SP );
+ }
+
+ return 0;
+}
+
+uintptr_t rtems_debugger_target_tcb_sp( rtems_debugger_thread *thread )
+{
+ return (uintptr_t) thread->tcb->Registers.register_sp;
+}
+
+int rtems_debugger_target_thread_stepping( rtems_debugger_thread *thread )
+{
+ CPU_Exception_frame *frame = thread->frame;
+
+ if ( rtems_debugger_thread_flag(
+ thread,
+ RTEMS_DEBUGGER_THREAD_FLAG_STEP_INSTR
+ ) ) {
+ /* Especially on first startup, frame isn't guaranteed to be non-NULL */
+ if ( frame == NULL ) {
+ return -1;
+ }
+
+ /*
+ * Single stepping uses AArch64-specific single-step mode and does not
+ * involve hardware breakpoints.
+ */
+
+ /* Breakpoint instruction exceptions occur even when D is not set. */
+ uint64_t stepping_enabled =
+ !( frame->register_cpsr & AARCH64_DSPSR_EL0_D );
+
+ target_printk( "[} stepping: %s\n", stepping_enabled ? "yes" : "no" );
+
+ /*
+ * This field is unset by the CPU during the software step process and must
+ * be set again each time the debugger needs to advance one instruction. If
+ * this is not set each time, the software step exception will trigger
+ * before executing an instruction.
+ */
+ frame->register_cpsr |= AARCH64_DSPSR_EL0_SS;
+
+ if ( !stepping_enabled ) {
+ /*
+ * Clear CPSR.D to enable single-step operation. The debug mask flag is
+ * set on taking an exception to prevent unwanted stepping. The way
+ * single-stepping works will need to change if hardware breakpoints and
+ * watchpoints are ever used.
+ */
+ frame->register_cpsr &= ~AARCH64_DSPSR_EL0_D;
+ }
+ }
+
+ return 0;
+}
+
+int rtems_debugger_target_exception_to_signal( CPU_Exception_frame *frame )
+{
+ uint64_t EC = AARCH64_ESR_EL1_EC_GET( frame->register_syndrome );
+
+ switch ( EC ) {
+ case 0x1: /* WFI */
+ case 0x7: /* SVE/SIMD/FP */
+ case 0xa: /* LD64B/ST64B* */
+ case 0x15:
+ case 0x18: /* MSR/MRS/system instruction */
+ case 0x19: /* SVE */
+ case 0x31:
+ case 0x33:
+ case 0x35:
+ case 0x3c:
+ return RTEMS_DEBUGGER_SIGNAL_TRAP;
+
+ case 0x2c:
+ return RTEMS_DEBUGGER_SIGNAL_FPE;
+
+ case 0x21:
+ case 0x25:
+ return RTEMS_DEBUGGER_SIGNAL_SEGV;
+
+ default:
+ /*
+ * Covers unknown, SP/PC alignment, illegal execution state, and any new
+ * exception classes that get added.
+ */
+ return RTEMS_DEBUGGER_SIGNAL_ILL;
+ }
+}
+
+void rtems_debugger_target_exception_print( CPU_Exception_frame *frame )
+{
+ EXC_FRAME_PRINT( rtems_debugger_printf, "", frame );
+}
+
+int rtems_debugger_target_hwbreak_insert( void )
+{
+ /*
+ * Do nothing, these are loaded elsewhere if needed.
+ */
+ return 0;
+}
+
+int rtems_debugger_target_hwbreak_remove( void )
+{
+#ifdef HARDWARE_BREAKPOINTS_NOT_USED
+ aarch64_debug_break_unload();
+#endif
+ return 0;
+}
+
+int rtems_debugger_target_hwbreak_control(
+ rtems_debugger_target_watchpoint wp,
+ bool insert,
+ uintptr_t addr,
+ DB_UINT kind
+)
+{
+ /* To do. */
+ return 0;
+}
+
+int rtems_debugger_target_cache_sync( rtems_debugger_target_swbreak *swbreak )
+{
+ /*
+ * Flush the data cache and invalidate the instruction cache.
+ */
+ rtems_cache_flush_multiple_data_lines(
+ swbreak->address,
+ sizeof( breakpoint )
+ );
+ rtems_cache_instruction_sync_after_code_change(
+ swbreak->address,
+ sizeof( breakpoint )
+ );
+ return 0;
+}
diff --git a/cpukit/libdebugger/rtems-debugger-i386.c b/cpukit/libdebugger/rtems-debugger-i386.c
index a2396e5f30..02e29c25a1 100644
--- a/cpukit/libdebugger/rtems-debugger-i386.c
+++ b/cpukit/libdebugger/rtems-debugger-i386.c
@@ -376,7 +376,7 @@ rtems_debugger_target_write_regs(rtems_debugger_thread* thread)
return 0;
}
-DB_UINT
+uintptr_t
rtems_debugger_target_reg_pc(rtems_debugger_thread* thread)
{
int r;
@@ -387,13 +387,13 @@ rtems_debugger_target_reg_pc(rtems_debugger_thread* thread)
return 0;
}
-DB_UINT
+uintptr_t
rtems_debugger_target_frame_pc(CPU_Exception_frame* frame)
{
- return (DB_UINT) frame->eip;
+ return (uintptr_t) frame->eip;
}
-DB_UINT
+uintptr_t
rtems_debugger_target_reg_sp(rtems_debugger_thread* thread)
{
int r;
@@ -404,7 +404,7 @@ rtems_debugger_target_reg_sp(rtems_debugger_thread* thread)
return 0;
}
-DB_UINT
+uintptr_t
rtems_debugger_target_tcb_sp(rtems_debugger_thread* thread)
{
return (DB_UINT) thread->tcb->Registers.esp;
@@ -503,7 +503,7 @@ rtems_debugger_target_hwbreak_remove(void)
int
rtems_debugger_target_hwbreak_control(rtems_debugger_target_watchpoint wp,
bool insert,
- DB_UINT addr,
+ uintptr_t addr,
DB_UINT kind)
{
/*
diff --git a/cpukit/libdebugger/rtems-debugger-server.c b/cpukit/libdebugger/rtems-debugger-server.c
index 975ec23a30..9de9421b6b 100644
--- a/cpukit/libdebugger/rtems-debugger-server.c
+++ b/cpukit/libdebugger/rtems-debugger-server.c
@@ -154,6 +154,26 @@ hex_encode(int val)
return "0123456789abcdef"[val & 0xf];
}
+static inline uintptr_t
+hex_decode_addr(const uint8_t* data)
+{
+ uintptr_t ui = 0;
+ size_t i;
+ if (data[0] == '-') {
+ if (data[1] == '1')
+ ui = (uintptr_t) -1;
+ }
+ else {
+ for (i = 0; i < (sizeof(ui) * 2); ++i) {
+ int v = hex_decode(data[i]);
+ if (v < 0)
+ break;
+ ui = (ui << 4) | v;
+ }
+ }
+ return ui;
+}
+
static inline DB_UINT
hex_decode_uint(const uint8_t* data)
{
@@ -1438,10 +1458,10 @@ remote_read_memory(uint8_t* buffer, int size)
if (comma == NULL)
remote_packet_out_str(r_E01);
else {
- DB_UINT addr;
+ uintptr_t addr;
DB_UINT length;
int r;
- addr = hex_decode_uint(&buffer[1]);
+ addr = hex_decode_addr(&buffer[1]);
length = hex_decode_uint((const uint8_t*) comma + 1);
remote_packet_out_reset();
r = rtems_debugger_target_start_memory_access();
@@ -1468,10 +1488,10 @@ remote_write_memory(uint8_t* buffer, int size)
comma = strchr((const char*) buffer, ',');
colon = strchr((const char*) buffer, ':');
if (comma != NULL && colon != NULL) {
- DB_UINT addr;
+ uintptr_t addr;
DB_UINT length;
int r;
- addr = hex_decode_uint(&buffer[1]);
+ addr = hex_decode_addr(&buffer[1]);
length = hex_decode_uint((const uint8_t*) comma + 1);
r = rtems_debugger_target_start_memory_access();
if (r == 0) {
@@ -1519,9 +1539,9 @@ remote_breakpoints(bool insert, uint8_t* buffer, int size)
comma2 = strchr(comma1 + 1, ',');
if (comma2 != NULL) {
uint32_t capabilities;
- DB_UINT addr;
+ uintptr_t addr;
DB_UINT kind;
- addr = hex_decode_uint((const uint8_t*) comma1 + 1);
+ addr = hex_decode_addr((const uint8_t*) comma1 + 1);
kind = hex_decode_uint((const uint8_t*)comma2 + 1);
capabilities = rtems_debugger_target_capabilities();
switch (buffer[1]) {
diff --git a/cpukit/libdebugger/rtems-debugger-target.c b/cpukit/libdebugger/rtems-debugger-target.c
index bf7579700d..04b274909b 100644
--- a/cpukit/libdebugger/rtems-debugger-target.c
+++ b/cpukit/libdebugger/rtems-debugger-target.c
@@ -168,7 +168,7 @@ rtems_debugger_target_reg_table_size(void)
}
int
-rtems_debugger_target_swbreak_control(bool insert, DB_UINT addr, DB_UINT kind)
+rtems_debugger_target_swbreak_control(bool insert, uintptr_t addr, DB_UINT kind)
{
rtems_debugger_target* target = rtems_debugger->target;
rtems_debugger_target_swbreak* swbreaks;
@@ -315,7 +315,7 @@ rtems_debugger_target_exception(CPU_Exception_frame* frame)
Thread_Control* thread = _Thread_Get_executing();
const rtems_id tid = thread->Object.id;
rtems_id* excludes;
- DB_UINT pc;
+ uintptr_t pc;
const rtems_debugger_thread_stepper* stepper;
rtems_debugger_exception target_exception;
size_t i;
diff --git a/cpukit/libdebugger/rtems-debugger-target.h b/cpukit/libdebugger/rtems-debugger-target.h
index f2abbe5fd3..1e132fb28c 100644
--- a/cpukit/libdebugger/rtems-debugger-target.h
+++ b/cpukit/libdebugger/rtems-debugger-target.h
@@ -164,22 +164,22 @@ extern int rtems_debugger_target_write_regs(rtems_debugger_thread* thread);
/**
* Return the thread's program counter (PC).
*/
-extern DB_UINT rtems_debugger_target_reg_pc(rtems_debugger_thread* thread);
+extern uintptr_t rtems_debugger_target_reg_pc(rtems_debugger_thread* thread);
/**
* Return the frame's program counter (PC).
*/
-extern DB_UINT rtems_debugger_target_frame_pc(CPU_Exception_frame* frame);
+extern uintptr_t rtems_debugger_target_frame_pc(CPU_Exception_frame* frame);
/**
* Return the thread's stack pointer (SP).
*/
-extern DB_UINT rtems_debugger_target_reg_sp(rtems_debugger_thread* thread);
+extern uintptr_t rtems_debugger_target_reg_sp(rtems_debugger_thread* thread);
/**
* Return the thread's TCB stack pointer (SP).
*/
-extern DB_UINT rtems_debugger_target_tcb_sp(rtems_debugger_thread* thread);
+extern uintptr_t rtems_debugger_target_tcb_sp(rtems_debugger_thread* thread);
/**
* The thread is stepping. Setup the thread to step an instruction.
@@ -200,7 +200,7 @@ extern void rtems_debugger_target_exception_print(CPU_Exception_frame* frame);
* Software breakpoints. These are also referred to as memory breakpoints.
*/
extern int rtems_debugger_target_swbreak_control(bool insert,
- DB_UINT addr,
+ uintptr_t addr,
DB_UINT kind);
/**
@@ -228,7 +228,7 @@ extern int rtems_debugger_target_hwbreak_remove(void);
*/
extern int rtems_debugger_target_hwbreak_control(rtems_debugger_target_watchpoint type,
bool insert,
- DB_UINT addr,
+ uintptr_t addr,
DB_UINT kind);
/**
diff --git a/cpukit/libdebugger/rtems-debugger-threads.c b/cpukit/libdebugger/rtems-debugger-threads.c
index e6ffe4a080..c628c0250e 100644
--- a/cpukit/libdebugger/rtems-debugger-threads.c
+++ b/cpukit/libdebugger/rtems-debugger-threads.c
@@ -469,8 +469,8 @@ rtems_debugger_thread_step(rtems_debugger_thread* thread)
int
rtems_debugger_thread_stepping(rtems_debugger_thread* thread,
- DB_UINT start,
- DB_UINT end)
+ uintptr_t start,
+ uintptr_t end)
{
/* add lock */
rtems_debugger_threads* threads = rtems_debugger->threads;
@@ -496,7 +496,7 @@ rtems_debugger_thread_stepping(rtems_debugger_thread* thread,
}
const rtems_debugger_thread_stepper*
-rtems_debugger_thread_is_stepping(rtems_id id, DB_UINT pc)
+rtems_debugger_thread_is_stepping(rtems_id id, uintptr_t pc)
{
/* add lock */
rtems_debugger_threads* threads = rtems_debugger->threads;
diff --git a/cpukit/libdebugger/rtems-debugger-threads.h b/cpukit/libdebugger/rtems-debugger-threads.h
index 200dbbe1c7..60bc87984e 100644
--- a/cpukit/libdebugger/rtems-debugger-threads.h
+++ b/cpukit/libdebugger/rtems-debugger-threads.h
@@ -102,8 +102,8 @@ typedef struct rtems_debugger_thread
typedef struct rtems_debugger_thread_stepper
{
rtems_debugger_thread* thread;
- DB_UINT start;
- DB_UINT end;
+ uintptr_t start;
+ uintptr_t end;
} rtems_debugger_thread_stepper;
/**
@@ -165,15 +165,15 @@ extern int rtems_debugger_thread_step(rtems_debugger_thread* thread);
* Thread is stepping so record the details.
*/
extern int rtems_debugger_thread_stepping(rtems_debugger_thread* thread,
- DB_UINT start,
- DB_UINT end);
+ uintptr_t start,
+ uintptr_t end);
/**
* Thread's PC in the stepping range? Returns the stepper is in range else
* NULL.
*/
extern const rtems_debugger_thread_stepper*
-rtems_debugger_thread_is_stepping(rtems_id id, DB_UINT pc);
+rtems_debugger_thread_is_stepping(rtems_id id, uintptr_t pc);
/**
* Return the thread's current priority/
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/cpuuse/cpuusagereport.c b/cpukit/libmisc/cpuuse/cpuusagereport.c
index 08bc5bb541..ea21e73dc1 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereport.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereport.c
@@ -52,7 +52,7 @@ static bool cpu_usage_visitor( Thread_Control *the_thread, void *arg )
ctx = arg;
_Thread_Get_name( the_thread, name, sizeof( name ) );
- _Thread_Get_CPU_time_used( the_thread, &used );
+ used = _Thread_Get_CPU_time_used_after_last_reset( the_thread );
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract( &ctx->uptime_at_last_reset, &uptime, &ctx->total );
_Timestamp_Divide( &used, &ctx->total, &ival, &fval );
diff --git a/cpukit/libmisc/cpuuse/cpuusagereset.c b/cpukit/libmisc/cpuuse/cpuusagereset.c
index 10d8ebec48..d1f0e65180 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereset.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereset.c
@@ -40,7 +40,8 @@ static bool CPU_usage_Per_thread_handler(
scheduler = _Thread_Scheduler_get_home( the_thread );
_Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
- _Timestamp_Set_to_zero( &the_thread->cpu_time_used );
+ the_thread->cpu_time_used_at_last_reset =
+ _Thread_Get_CPU_time_used_locked( the_thread );
_Scheduler_Release_critical( scheduler, &scheduler_lock_context );
_Thread_State_release( the_thread, &state_lock_context );
diff --git a/cpukit/libmisc/cpuuse/cpuusagetop.c b/cpukit/libmisc/cpuuse/cpuusagetop.c
index dad11ad748..51d049257a 100644
--- a/cpukit/libmisc/cpuuse/cpuusagetop.c
+++ b/cpukit/libmisc/cpuuse/cpuusagetop.c
@@ -178,7 +178,7 @@ task_usage(Thread_Control* thread, void* arg)
data->stack_size += thread->Start.Initial_stack.size;
- _Thread_Get_CPU_time_used(thread, &usage);
+ usage = _Thread_Get_CPU_time_used_after_last_reset(thread);
for (j = 0; j < data->last_task_count; j++)
{
diff --git a/cpukit/libtest/t-test-interrupt.c b/cpukit/libtest/t-test-interrupt.c
index 5d83b7876a..85b9b6ff69 100644
--- a/cpukit/libtest/t-test-interrupt.c
+++ b/cpukit/libtest/t-test-interrupt.c
@@ -456,9 +456,16 @@ T_interrupt_test(const T_interrupt_test_config *config, void *arg)
lower_bound[sample] = lower - delta;
sample = (sample + 1) % T_INTERRUPT_SAMPLE_COUNT;
- } else if (state == T_INTERRUPT_TEST_LATE) {
+ } else if (state == T_INTERRUPT_TEST_LATE ||
+ state == T_INTERRUPT_TEST_ACTION) {
uint_fast32_t upper;
+ /*
+ * If the state is T_INTERRUPT_TEST_ACTION, then there
+ * was probably no interrupt during the action, so the
+ * interrupt would be late.
+ */
+
lower_sum -= lower_bound[sample];
lower_sum += busy;
lower_bound[sample] = busy;
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/testbusy.c b/cpukit/libtest/testbusy.c
index c1d44278be..51c6a71810 100644
--- a/cpukit/libtest/testbusy.c
+++ b/cpukit/libtest/testbusy.c
@@ -28,10 +28,10 @@ void rtems_test_busy_cpu_usage( time_t seconds, long nanoseconds )
Timestamp_Control now;
executing = _Thread_Get_executing();
- _Thread_Get_CPU_time_used( executing, &start );
+ start = _Thread_Get_CPU_time_used( executing );
_Timestamp_Set( &busy, seconds, nanoseconds );
do {
- _Thread_Get_CPU_time_used( executing, &now );
+ now = _Thread_Get_CPU_time_used( executing );
} while ( now - start < busy );
}
diff --git a/cpukit/posix/src/psignalunblockthread.c b/cpukit/posix/src/psignalunblockthread.c
index de814c13cd..36680f99a2 100644
--- a/cpukit/posix/src/psignalunblockthread.c
+++ b/cpukit/posix/src/psignalunblockthread.c
@@ -196,8 +196,6 @@ bool _POSIX_signals_Unblock_thread(
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (api->signals_unblocked & mask) ) {
- the_thread->Wait.return_code = STATUS_INTERRUPTED;
-
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
@@ -208,7 +206,7 @@ bool _POSIX_signals_Unblock_thread(
*the_info = *info;
}
- _Thread_queue_Extract_with_proxy( the_thread );
+ _Thread_Timer_remove_and_continue( the_thread, STATUS_INTERRUPTED );
return _POSIX_signals_Unblock_thread_done( the_thread, api, true );
}
@@ -238,8 +236,7 @@ bool _POSIX_signals_Unblock_thread(
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
- the_thread->Wait.return_code = STATUS_INTERRUPTED;
- _Thread_queue_Extract_with_proxy( the_thread );
+ _Thread_Timer_remove_and_continue( the_thread, STATUS_INTERRUPTED );
}
}
return _POSIX_signals_Unblock_thread_done( the_thread, api, false );
diff --git a/cpukit/posix/src/psxtransschedparam.c b/cpukit/posix/src/psxtransschedparam.c
index eba26d4932..f97924e011 100644
--- a/cpukit/posix/src/psxtransschedparam.c
+++ b/cpukit/posix/src/psxtransschedparam.c
@@ -23,22 +23,27 @@
#include <errno.h>
#include <rtems/posix/pthreadimpl.h>
+#include <rtems/score/threadcpubudget.h>
int _POSIX_Thread_Translate_to_sched_policy(
- Thread_CPU_budget_algorithms budget_algorithm
+ const Thread_CPU_budget_operations *operations
)
{
- switch ( budget_algorithm ) {
- case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
- return SCHED_OTHER;
- case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
- return SCHED_RR;
- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
- return SCHED_SPORADIC;
- default:
- _Assert( budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE );
- return SCHED_FIFO;
+ if ( operations == NULL ) {
+ return SCHED_FIFO;
}
+
+ if ( operations == &_Thread_CPU_budget_exhaust_timeslice ) {
+ return SCHED_RR;
+ }
+
+#if defined(RTEMS_POSIX_API)
+ if ( operations == &_POSIX_Threads_Sporadic_budget ) {
+ return SCHED_SPORADIC;
+ }
+#endif
+
+ return SCHED_OTHER;
}
int _POSIX_Thread_Translate_sched_param(
@@ -47,23 +52,19 @@ int _POSIX_Thread_Translate_sched_param(
Thread_Configuration *config
)
{
- config->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
- config->budget_callout = NULL;
- config->cpu_time_budget = 0;
+ config->cpu_budget_operations = NULL;
- if ( policy == SCHED_OTHER ) {
- config->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
+ if ( policy == SCHED_FIFO ) {
return 0;
}
- if ( policy == SCHED_FIFO ) {
- config->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
+ if ( policy == SCHED_OTHER ) {
+ config->cpu_budget_operations = &_Thread_CPU_budget_reset_timeslice;
return 0;
}
if ( policy == SCHED_RR ) {
- config->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
- config->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice();
+ config->cpu_budget_operations = &_Thread_CPU_budget_exhaust_timeslice;
return 0;
}
@@ -81,8 +82,7 @@ int _POSIX_Thread_Translate_sched_param(
_Timespec_To_ticks( &param->sched_ss_init_budget ) )
return EINVAL;
- config->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
- config->budget_callout = _POSIX_Threads_Sporadic_budget_callout;
+ config->cpu_budget_operations = &_POSIX_Threads_Sporadic_budget;
return 0;
}
#endif
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index 9474d07032..093ad5cfe1 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -34,9 +34,11 @@
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/pthreadattrimpl.h>
#include <rtems/score/assert.h>
+#include <rtems/score/threadcpubudget.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/apimutex.h>
#include <rtems/score/stackimpl.h>
+#include <rtems/score/statesimpl.h>
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/userextimpl.h>
#include <rtems/sysinit.h>
@@ -348,7 +350,9 @@ void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
_Thread_Priority_update( &queue_context );
}
-void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread )
+static void _POSIX_Threads_Sporadic_budget_callout(
+ Thread_Control *the_thread
+)
{
POSIX_API_Control *api;
Thread_queue_Context queue_context;
@@ -363,7 +367,7 @@ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread )
* This will prevent the thread from consuming its entire "budget"
* while at low priority.
*/
- the_thread->cpu_time_budget = UINT32_MAX;
+ the_thread->CPU_budget.available = UINT32_MAX;
if ( !_Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
_Thread_Priority_add(
@@ -382,6 +386,34 @@ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread )
_Thread_Priority_update( &queue_context );
}
+static void _POSIX_Threads_Sporadic_budget_at_tick( Thread_Control *the_thread )
+{
+ uint32_t budget_available;
+
+ if ( !the_thread->is_preemptible ) {
+ return;
+ }
+
+ if ( !_States_Is_ready( the_thread->current_state ) ) {
+ return;
+ }
+
+ budget_available = the_thread->CPU_budget.available;
+
+ if ( budget_available == 1 ) {
+ the_thread->CPU_budget.available = 0;
+ _POSIX_Threads_Sporadic_budget_callout ( the_thread );
+ } else {
+ the_thread->CPU_budget.available = budget_available - 1;
+ }
+}
+
+const Thread_CPU_budget_operations _POSIX_Threads_Sporadic_budget = {
+ .at_tick = _POSIX_Threads_Sporadic_budget_at_tick,
+ .at_context_switch = _Thread_CPU_budget_do_nothing,
+ .initialize = _Thread_CPU_budget_do_nothing
+};
+
static bool _POSIX_Threads_Create_extension(
Thread_Control *executing,
Thread_Control *created
diff --git a/cpukit/posix/src/pthreadgetattrnp.c b/cpukit/posix/src/pthreadgetattrnp.c
index 5572fb98a5..aa34185264 100644
--- a/cpukit/posix/src/pthreadgetattrnp.c
+++ b/cpukit/posix/src/pthreadgetattrnp.c
@@ -37,12 +37,12 @@ int pthread_getattr_np(
pthread_attr_t *attr
)
{
- Thread_Control *the_thread;
- ISR_lock_Context lock_context;
- Thread_CPU_budget_algorithms budget_algorithm;
- const Scheduler_Control *scheduler;
- Priority_Control priority;
- Status_Control status;
+ Thread_Control *the_thread;
+ ISR_lock_Context lock_context;
+ const Thread_CPU_budget_operations *cpu_budget_operations;
+ const Scheduler_Control *scheduler;
+ Priority_Control priority;
+ Status_Control status;
if ( attr == NULL ) {
return EINVAL;
@@ -89,7 +89,7 @@ int pthread_getattr_np(
attr->affinityset
);
- budget_algorithm = the_thread->budget_algorithm;
+ cpu_budget_operations = the_thread->CPU_budget.operations;
_Thread_State_release( the_thread, &lock_context );
@@ -101,7 +101,7 @@ int pthread_getattr_np(
priority
);
attr->schedpolicy =
- _POSIX_Thread_Translate_to_sched_policy( budget_algorithm );
+ _POSIX_Thread_Translate_to_sched_policy( cpu_budget_operations );
return _POSIX_Get_error( status );
}
diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c
index a82d79c715..406ae8e7bb 100644
--- a/cpukit/posix/src/pthreadgetschedparam.c
+++ b/cpukit/posix/src/pthreadgetschedparam.c
@@ -37,11 +37,11 @@ int pthread_getschedparam(
struct sched_param *param
)
{
- Thread_Control *the_thread;
- Thread_queue_Context queue_context;
- Thread_CPU_budget_algorithms budget_algorithm;
- const Scheduler_Control *scheduler;
- Priority_Control priority;
+ Thread_Control *the_thread;
+ Thread_queue_Context queue_context;
+ const Thread_CPU_budget_operations *cpu_budget_operations;
+ const Scheduler_Control *scheduler;
+ Priority_Control priority;
if ( policy == NULL || param == NULL ) {
return EINVAL;
@@ -59,11 +59,11 @@ int pthread_getschedparam(
scheduler = _Thread_Scheduler_get_home( the_thread );
_POSIX_Threads_Get_sched_param_sporadic( the_thread, scheduler, param );
priority = the_thread->Real_priority.priority;
- budget_algorithm = the_thread->budget_algorithm;
+ cpu_budget_operations = the_thread->CPU_budget.operations;
_Thread_Wait_release( the_thread, &queue_context );
param->sched_priority = _POSIX_Priority_From_core( scheduler, priority );
- *policy = _POSIX_Thread_Translate_to_sched_policy( budget_algorithm );
+ *policy = _POSIX_Thread_Translate_to_sched_policy( cpu_budget_operations );
return 0;
}
diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c
index 1c207e7887..165e1d86a8 100644
--- a/cpukit/posix/src/pthreadsetschedparam.c
+++ b/cpukit/posix/src/pthreadsetschedparam.c
@@ -40,14 +40,15 @@ static int _POSIX_Set_sched_param(
Thread_queue_Context *queue_context
)
{
- const Scheduler_Control *scheduler;
- int normal_prio;
- bool valid;
- Priority_Control core_normal_prio;
+ const Scheduler_Control *scheduler;
+ int normal_prio;
+ bool valid;
+ Priority_Control core_normal_prio;
+ const Thread_CPU_budget_operations *cpu_budget_operations;
#if defined(RTEMS_POSIX_API)
- POSIX_API_Control *api;
- int low_prio;
- Priority_Control core_low_prio;
+ POSIX_API_Control *api;
+ int low_prio;
+ Priority_Control core_low_prio;
#endif
normal_prio = param->sched_priority;
@@ -103,9 +104,12 @@ static int _POSIX_Set_sched_param(
}
#endif
- the_thread->cpu_time_budget = config->cpu_time_budget;
- the_thread->budget_algorithm = config->budget_algorithm;
- the_thread->budget_callout = config->budget_callout;
+ cpu_budget_operations = config->cpu_budget_operations;
+ the_thread->CPU_budget.operations = cpu_budget_operations;
+
+ if ( cpu_budget_operations != NULL ) {
+ ( *cpu_budget_operations->initialize )( the_thread );
+ }
#if defined(RTEMS_POSIX_API)
_Priority_Node_set_priority( &api->Sporadic.Low_priority, core_low_prio );
diff --git a/cpukit/rtems/src/clockgettod.c b/cpukit/rtems/src/clockgettod.c
index 5058b42375..fed9057f24 100644
--- a/cpukit/rtems/src/clockgettod.c
+++ b/cpukit/rtems/src/clockgettod.c
@@ -81,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;
@@ -91,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() )
@@ -100,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;
@@ -121,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/eventsurrender.c b/cpukit/rtems/src/eventsurrender.c
index 48c08e486f..0623977c8b 100644
--- a/cpukit/rtems/src/eventsurrender.c
+++ b/cpukit/rtems/src/eventsurrender.c
@@ -42,12 +42,10 @@ static bool _Event_Is_blocking_on_event(
)
{
Thread_Wait_flags wait_flags;
- Thread_Wait_flags wait_mask;
wait_flags = _Thread_Wait_flags_get( the_thread );
- wait_mask = THREAD_WAIT_CLASS_MASK | THREAD_WAIT_STATE_READY_AGAIN;
- return ( wait_flags & wait_mask ) == wait_class;
+ return ( wait_flags & THREAD_WAIT_CLASS_MASK ) == wait_class;
}
static bool _Event_Is_satisfied(
@@ -88,16 +86,14 @@ rtems_status_code _Event_Surrender(
_Event_Is_blocking_on_event( the_thread, wait_class )
&& _Event_Is_satisfied( the_thread, pending_events, &seized_events )
) {
- Thread_Wait_flags ready_again;
- bool success;
+ bool success;
_Event_Satisfy( the_thread, event, pending_events, seized_events );
- ready_again = wait_class | THREAD_WAIT_STATE_READY_AGAIN;
success = _Thread_Wait_flags_try_change_release(
the_thread,
wait_class | THREAD_WAIT_STATE_INTEND_TO_BLOCK,
- ready_again
+ THREAD_WAIT_STATE_READY
);
if ( success ) {
@@ -107,7 +103,7 @@ rtems_status_code _Event_Surrender(
_Thread_Wait_flags_get( the_thread )
== ( wait_class | THREAD_WAIT_STATE_BLOCKED )
);
- _Thread_Wait_flags_set( the_thread, ready_again );
+ _Thread_Wait_flags_set( the_thread, THREAD_WAIT_STATE_READY );
unblock = true;
}
} else {
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/ratemongetstatus.c b/cpukit/rtems/src/ratemongetstatus.c
index 745b52f026..5b46a7a435 100644
--- a/cpukit/rtems/src/ratemongetstatus.c
+++ b/cpukit/rtems/src/ratemongetstatus.c
@@ -31,7 +31,6 @@ rtems_status_code rtems_rate_monotonic_get_status(
{
Rate_monotonic_Control *the_period;
ISR_lock_Context lock_context;
- rtems_status_code status;
if ( period_status == NULL ) {
return RTEMS_INVALID_ADDRESS;
@@ -54,35 +53,28 @@ rtems_status_code rtems_rate_monotonic_get_status(
*/
_Timespec_Set_to_zero( &period_status->since_last_period );
_Timespec_Set_to_zero( &period_status->executed_since_last_period );
- status = RTEMS_SUCCESSFUL;
} else {
Timestamp_Control wall_since_last_period;
Timestamp_Control cpu_since_last_period;
- bool valid_status;
/*
* Grab the current status.
*/
- valid_status = _Rate_monotonic_Get_status(
+ _Rate_monotonic_Get_status(
the_period,
&wall_since_last_period,
&cpu_since_last_period
);
- if ( valid_status ) {
- _Timestamp_To_timespec(
- &wall_since_last_period,
- &period_status->since_last_period
- );
- _Timestamp_To_timespec(
- &cpu_since_last_period,
- &period_status->executed_since_last_period
- );
- status = RTEMS_SUCCESSFUL;
- } else {
- status = RTEMS_NOT_DEFINED;
- }
+ _Timestamp_To_timespec(
+ &wall_since_last_period,
+ &period_status->since_last_period
+ );
+ _Timestamp_To_timespec(
+ &cpu_since_last_period,
+ &period_status->executed_since_last_period
+ );
}
_Rate_monotonic_Release( the_period, &lock_context );
- return status;
+ return RTEMS_SUCCESSFUL;
}
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 2c55eb089d..a8697abf3c 100644
--- a/cpukit/rtems/src/ratemonperiod.c
+++ b/cpukit/rtems/src/ratemonperiod.c
@@ -26,7 +26,7 @@
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/todimpl.h>
-bool _Rate_monotonic_Get_status(
+void _Rate_monotonic_Get_status(
const Rate_monotonic_Control *the_period,
Timestamp_Control *wall_since_last_period,
Timestamp_Control *cpu_since_last_period
@@ -47,14 +47,7 @@ bool _Rate_monotonic_Get_status(
/*
* Determine cpu usage since period initiated.
*/
- _Thread_Get_CPU_time_used( owning_thread, &used );
-
- /*
- * The cpu usage info was reset while executing. Can't
- * determine a status.
- */
- if ( _Timestamp_Less_than( &used, &the_period->cpu_usage_period_initiated ) )
- return false;
+ used = _Thread_Get_CPU_time_used( owning_thread );
/* used = current cpu usage - cpu usage at start of period */
_Timestamp_Subtract(
@@ -62,8 +55,6 @@ bool _Rate_monotonic_Get_status(
&used,
cpu_since_last_period
);
-
- return true;
}
static void _Rate_monotonic_Release_postponed_job(
@@ -130,7 +121,7 @@ void _Rate_monotonic_Restart(
* Set the starting point and the CPU time used for the statistics.
*/
_TOD_Get_uptime( &the_period->time_period_initiated );
- _Thread_Get_CPU_time_used( owner, &the_period->cpu_usage_period_initiated );
+ the_period->cpu_usage_period_initiated = _Thread_Get_CPU_time_used( owner );
_Rate_monotonic_Release_job(
the_period,
@@ -147,7 +138,6 @@ static void _Rate_monotonic_Update_statistics(
Timestamp_Control executed;
Timestamp_Control since_last_period;
Rate_monotonic_Statistics *stats;
- bool valid_status;
/*
* Assume we are only called in states where it is appropriate
@@ -167,10 +157,7 @@ static void _Rate_monotonic_Update_statistics(
/*
* Grab status for time statistics.
*/
- valid_status =
- _Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
- if (!valid_status)
- return;
+ _Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
/*
* Update CPU time
@@ -217,7 +204,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 );
@@ -260,7 +247,7 @@ static rtems_status_code _Rate_monotonic_Block_while_active(
);
if ( !success ) {
_Assert(
- _Thread_Wait_flags_get( executing ) == RATE_MONOTONIC_READY_AGAIN
+ _Thread_Wait_flags_get( executing ) == THREAD_WAIT_STATE_READY
);
_Thread_Unblock( executing );
}
diff --git a/cpukit/rtems/src/ratemontimeout.c b/cpukit/rtems/src/ratemontimeout.c
index b20e1e15db..375c5f081f 100644
--- a/cpukit/rtems/src/ratemontimeout.c
+++ b/cpukit/rtems/src/ratemontimeout.c
@@ -74,13 +74,13 @@ void _Rate_monotonic_Timeout( Watchdog_Control *the_watchdog )
success = _Thread_Wait_flags_try_change_release(
owner,
RATE_MONOTONIC_INTEND_TO_BLOCK,
- RATE_MONOTONIC_READY_AGAIN
+ THREAD_WAIT_STATE_READY
);
if ( success ) {
unblock = false;
} else {
_Assert( _Thread_Wait_flags_get( owner ) == RATE_MONOTONIC_BLOCKED );
- _Thread_Wait_flags_set( owner, RATE_MONOTONIC_READY_AGAIN );
+ _Thread_Wait_flags_set( owner, THREAD_WAIT_STATE_READY );
unblock = true;
}
diff --git a/cpukit/rtems/src/schedulergetprocessor.c b/cpukit/rtems/src/schedulergetprocessor.c
new file mode 100644
index 0000000000..5aafeae204
--- /dev/null
+++ b/cpukit/rtems/src/schedulergetprocessor.c
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSImplClassic
+ *
+ * @brief This source file contains the implementation of
+ * rtems_scheduler_get_processor() which may be used by binding for languages
+ * other than C/C++.
+ */
+
+/*
+ * 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/rtems/tasks.h>
+
+static uint32_t _RTEMS_Scheduler_get_processor( void )
+{
+ return rtems_scheduler_get_processor();
+}
+
+#undef rtems_scheduler_get_processor
+
+uint32_t rtems_scheduler_get_processor( void )
+{
+ return _RTEMS_Scheduler_get_processor();
+}
diff --git a/cpukit/rtems/src/schedulergetprocessormax.c b/cpukit/rtems/src/schedulergetprocessormax.c
new file mode 100644
index 0000000000..0091a6e544
--- /dev/null
+++ b/cpukit/rtems/src/schedulergetprocessormax.c
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSImplClassic
+ *
+ * @brief This source file contains the implementation of
+ * rtems_scheduler_get_processor_maximum() which may be used by binding for
+ * languages other than C/C++.
+ */
+
+/*
+ * 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/rtems/tasks.h>
+
+static uint32_t _RTEMS_Scheduler_get_processor_maximum( void )
+{
+ return rtems_scheduler_get_processor_maximum();
+}
+
+#undef rtems_scheduler_get_processor_maximum
+
+uint32_t rtems_scheduler_get_processor_maximum( void )
+{
+ return _RTEMS_Scheduler_get_processor_maximum();
+}
diff --git a/cpukit/rtems/src/schedulerremoveprocessor.c b/cpukit/rtems/src/schedulerremoveprocessor.c
index 79c17bda49..3136a8e0c0 100644
--- a/cpukit/rtems/src/schedulerremoveprocessor.c
+++ b/cpukit/rtems/src/schedulerremoveprocessor.c
@@ -35,7 +35,7 @@ typedef struct {
rtems_status_code status;
} Scheduler_Processor_removal_context;
-static bool _Scheduler_Check_processor_removal(
+static bool _Scheduler_Check_processor_not_required(
Thread_Control *the_thread,
void *arg
)
@@ -68,6 +68,45 @@ static bool _Scheduler_Check_processor_removal(
_Thread_Wait_release( the_thread, &queue_context );
return iter_context->status != RTEMS_SUCCESSFUL;
}
+
+static bool _Scheduler_Check_no_helping(
+ Thread_Control *the_thread,
+ void *arg
+)
+{
+ Scheduler_Processor_removal_context *iter_context;
+ ISR_lock_Context lock_context;
+ const Chain_Node *node;
+ const Chain_Node *tail;
+
+ if ( the_thread->is_idle ) {
+ return false;
+ }
+
+ iter_context = arg;
+
+ _Thread_State_acquire( the_thread, &lock_context );
+ node = _Chain_Immutable_first( &the_thread->Scheduler.Scheduler_nodes );
+ tail = _Chain_Immutable_tail( &the_thread->Scheduler.Scheduler_nodes );
+
+ do {
+ const Scheduler_Node *scheduler_node;
+ const Scheduler_Control *scheduler;
+
+ scheduler_node = SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( node );
+ scheduler = _Scheduler_Node_get_scheduler( scheduler_node );
+
+ if ( scheduler == iter_context->scheduler ) {
+ iter_context->status = RTEMS_RESOURCE_IN_USE;
+ break;
+ }
+
+ node = _Chain_Immutable_next( node );
+ } while ( node != tail );
+
+ _Thread_State_release( the_thread, &lock_context );
+ return iter_context->status != RTEMS_SUCCESSFUL;
+}
#endif
rtems_status_code rtems_scheduler_remove_processor(
@@ -116,7 +155,14 @@ rtems_status_code rtems_scheduler_remove_processor(
_Scheduler_Release_critical( scheduler, &lock_context );
_ISR_lock_ISR_enable( &lock_context );
- _Thread_Iterate( _Scheduler_Check_processor_removal, &iter_context );
+ _Thread_Iterate( _Scheduler_Check_processor_not_required, &iter_context );
+
+ if (
+ _Processor_mask_Is_zero( &scheduler_context->Processors ) &&
+ iter_context.status == RTEMS_SUCCESSFUL
+ ) {
+ _Thread_Iterate( _Scheduler_Check_no_helping, &iter_context );
+ }
_ISR_lock_ISR_disable( &lock_context );
_Scheduler_Acquire_critical( scheduler, &lock_context );
diff --git a/cpukit/rtems/src/semsetpriority.c b/cpukit/rtems/src/semsetpriority.c
index adb0320210..97e53c6584 100644
--- a/cpukit/rtems/src/semsetpriority.c
+++ b/cpukit/rtems/src/semsetpriority.c
@@ -29,20 +29,6 @@
#include <rtems/rtems/tasksimpl.h>
#include <rtems/score/schedulerimpl.h>
-static rtems_status_code _Semaphore_Is_scheduler_valid(
- const CORE_ceiling_mutex_Control *the_mutex,
- const Scheduler_Control *scheduler
-)
-{
-#if defined(RTEMS_SMP)
- if ( scheduler != _CORE_ceiling_mutex_Get_scheduler( the_mutex ) ) {
- return RTEMS_NOT_DEFINED;
- }
-#endif
-
- return RTEMS_SUCCESSFUL;
-}
-
static rtems_status_code _Semaphore_Set_priority(
Semaphore_Control *the_semaphore,
const Scheduler_Control *scheduler,
@@ -51,7 +37,6 @@ static rtems_status_code _Semaphore_Set_priority(
Thread_queue_Context *queue_context
)
{
- rtems_status_code sc;
bool valid;
Priority_Control core_priority;
Priority_Control old_priority;
@@ -73,20 +58,29 @@ static rtems_status_code _Semaphore_Set_priority(
switch ( variant ) {
case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
- sc = _Semaphore_Is_scheduler_valid(
- &the_semaphore->Core_control.Mutex,
- scheduler
- );
+#if defined(RTEMS_SMP)
+ if (
+ scheduler != _CORE_ceiling_mutex_Get_scheduler(
+ &the_semaphore->Core_control.Mutex
+ )
+ ) {
+ _Thread_queue_Release(
+ &the_semaphore->Core_control.Wait_queue,
+ queue_context
+ );
+
+ return RTEMS_NOT_DEFINED;
+ }
+#endif
old_priority = _CORE_ceiling_mutex_Get_priority(
&the_semaphore->Core_control.Mutex
);
- if ( sc == RTEMS_SUCCESSFUL && new_priority != RTEMS_CURRENT_PRIORITY ) {
+ if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
_CORE_ceiling_mutex_Set_priority(
&the_semaphore->Core_control.Mutex,
- core_priority,
- queue_context
+ core_priority
);
}
@@ -106,7 +100,6 @@ static rtems_status_code _Semaphore_Set_priority(
);
}
- sc = RTEMS_SUCCESSFUL;
break;
#endif
default:
@@ -116,9 +109,12 @@ static rtems_status_code _Semaphore_Set_priority(
|| variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
|| variant == SEMAPHORE_VARIANT_COUNTING
);
- old_priority = 0;
- sc = RTEMS_NOT_DEFINED;
- break;
+ _Thread_queue_Release(
+ &the_semaphore->Core_control.Wait_queue,
+ queue_context
+ );
+
+ return RTEMS_NOT_DEFINED;
}
cpu_self = _Thread_queue_Dispatch_disable( queue_context );
@@ -130,7 +126,7 @@ static rtems_status_code _Semaphore_Set_priority(
_Thread_Dispatch_enable( cpu_self );
*old_priority_p = _RTEMS_Priority_From_core( scheduler, old_priority );
- return sc;
+ return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_semaphore_set_priority(
diff --git a/cpukit/rtems/src/signalsend.c b/cpukit/rtems/src/signalsend.c
index 72407e2b01..6ce59f2e74 100644
--- a/cpukit/rtems/src/signalsend.c
+++ b/cpukit/rtems/src/signalsend.c
@@ -35,16 +35,15 @@ static void _Signal_Action_handler(
ISR_lock_Context *lock_context
)
{
- RTEMS_API_Control *api;
- ASR_Information *asr;
- rtems_signal_set signal_set;
- bool normal_is_preemptible;
- uint32_t normal_cpu_time_budget;
- Thread_CPU_budget_algorithms normal_budget_algorithm;
- uint32_t normal_isr_level;
- uint32_t before_call_isr_level;
- bool after_call_is_preemptible;
- bool after_call_asr_is_enabled;
+ RTEMS_API_Control *api;
+ ASR_Information *asr;
+ rtems_signal_set signal_set;
+ bool normal_is_preemptible;
+ Thread_CPU_budget_control normal_cpu_budget;
+ uint32_t normal_isr_level;
+ uint32_t before_call_isr_level;
+ bool after_call_is_preemptible;
+ bool after_call_asr_is_enabled;
(void) action;
@@ -69,8 +68,7 @@ static void _Signal_Action_handler(
_Assert( asr->is_enabled );
normal_is_preemptible = executing->is_preemptible;
- normal_cpu_time_budget = executing->cpu_time_budget;
- normal_budget_algorithm = executing->budget_algorithm;
+ normal_cpu_budget = executing->CPU_budget;
/* Set mode for ASR processing */
@@ -102,8 +100,7 @@ static void _Signal_Action_handler(
_Thread_State_acquire( executing, lock_context );
- executing->cpu_time_budget = normal_cpu_time_budget ;
- executing->budget_algorithm = normal_budget_algorithm ;
+ executing->CPU_budget = normal_cpu_budget;
after_call_is_preemptible = executing->is_preemptible;
executing->is_preemptible = normal_is_preemptible;
diff --git a/cpukit/rtems/src/taskconstruct.c b/cpukit/rtems/src/taskconstruct.c
index 6e03440aed..05fbf32ff5 100644
--- a/cpukit/rtems/src/taskconstruct.c
+++ b/cpukit/rtems/src/taskconstruct.c
@@ -154,14 +154,17 @@ rtems_status_code _RTEMS_tasks_Create(
attributes = _Attributes_Clear( attributes, ATTRIBUTES_NOT_SUPPORTED );
memset( &thread_config, 0, sizeof( thread_config ) );
- thread_config.budget_algorithm = _Modes_Is_timeslice( config->initial_modes ) ?
- THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE
- : THREAD_CPU_BUDGET_ALGORITHM_NONE,
thread_config.isr_level = _Modes_Get_interrupt_level( config->initial_modes );
thread_config.name = config->name;
thread_config.is_fp = _Attributes_Is_floating_point( attributes );
thread_config.is_preemptible = _Modes_Is_preempt( config->initial_modes );
+ if ( _Modes_Is_timeslice( config->initial_modes ) ) {
+ thread_config.cpu_budget_operations = &_Thread_CPU_budget_reset_timeslice;
+ } else {
+ thread_config.cpu_budget_operations = NULL;
+ }
+
/*
* Validate the RTEMS API priority and convert it to the core priority range.
*/
diff --git a/cpukit/rtems/src/taskident.c b/cpukit/rtems/src/taskident.c
index 74a0a53982..89c2c7ce7e 100644
--- a/cpukit/rtems/src/taskident.c
+++ b/cpukit/rtems/src/taskident.c
@@ -40,6 +40,7 @@
#endif
#include <rtems/rtems/tasksimpl.h>
+#include <rtems/rtems/object.h>
#include <rtems/rtems/objectimpl.h>
#include <rtems/score/percpu.h>
@@ -53,7 +54,7 @@ rtems_status_code rtems_task_ident(
return RTEMS_INVALID_ADDRESS;
}
- if ( name == OBJECTS_ID_OF_SELF ) {
+ if ( name == RTEMS_WHO_AM_I ) {
*id = _Thread_Get_executing()->Object.id;
return RTEMS_SUCCESSFUL;
}
diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c
index 96bed470f4..3300eafa28 100644
--- a/cpukit/rtems/src/taskmode.c
+++ b/cpukit/rtems/src/taskmode.c
@@ -73,7 +73,7 @@ rtems_status_code rtems_task_mode(
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
- if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
+ if ( executing->CPU_budget.operations == NULL )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
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-default.S b/cpukit/score/cpu/aarch64/aarch64-exception-default.S
index 2a4ddbcc61..c7c9d03465 100644
--- a/cpukit/score/cpu/aarch64/aarch64-exception-default.S
+++ b/cpukit/score/cpu/aarch64/aarch64-exception-default.S
@@ -72,7 +72,7 @@
* * The exception returns to the previous execution state
*/
- .macro JUMP_HANDLER_SHORT
+ .macro JUMP_HANDLER
/* Mask to use in BIC, lower 7 bits */
mov x0, #0x7f
/* LR contains PC, mask off to the base of the current vector */
@@ -109,10 +109,6 @@
nop
nop
nop
- .endm
-
- .macro JUMP_HANDLER
- JUMP_HANDLER_SHORT
nop
.endm
@@ -144,11 +140,48 @@ Vector_table_el3:
* using SP0.
*/
curr_el_sp0_sync:
- stp x0, lr, [sp, #-0x10]! /* Push x0,lr on to the stack */
- bl curr_el_sp0_sync_get_pc /* Get current execution address */
-curr_el_sp0_sync_get_pc: /* The current PC is now in LR */
- JUMP_HANDLER
- JUMP_TARGET_SP0
+ sub sp, sp, #AARCH64_EXCEPTION_FRAME_SIZE /* reserve space for CEF */
+ str lr, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_LR_OFFSET] /* shove lr into CEF */
+ bl .push_exception_context_start /* bl to CEF store routine */
+/* Save original sp in x0 for .push_exception_context_finish */
+ add x0, sp, #AARCH64_EXCEPTION_FRAME_SIZE /* save original sp */
+/* Push the remainder of the context */
+ bl .push_exception_context_finish
+/* get jump target and branch/link */
+ bl curr_el_sp0_sync_get_pc /* Get current execution address */
+curr_el_sp0_sync_get_pc: /* The current PC is now in LR */
+ mov x0, #0x7f /* Mask to use in BIC, lower 7 bits */
+ bic x0, lr, x0 /* Mask LR to base of current vector */
+ ldr x1, [x0, #0x78] /* Load target from last word in vector */
+ and lr, lr, #0x780 /* Mask off bits for vector number */
+ lsr lr, lr, #7 /* Shift the vector bits down */
+/* Store the vector */
+ str lr, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_VECTOR_OFFSET]
+ mov x0, sp
+ blr x1
+ b twiddle
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+/* Takes up the space of 2 instructions */
+#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
+ .word _AArch64_Exception_default
+ .word 0x0
+#else
+ .dword _AArch64_Exception_default
+#endif
.balign 0x80
/* The exception handler for IRQ exceptions from the current EL using SP0. */
curr_el_sp0_irq:
@@ -204,13 +237,11 @@ curr_el_spx_sync_get_pc: /* The current PC is now in LR */
str lr, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_VECTOR_OFFSET]
mov x0, sp
blr x1
-/* bl to CEF restore routine (doesn't restore lr) */
- bl .pop_exception_context
- ldr lr, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_LR_OFFSET] /* get lr from CEF */
-/* drop space reserved for CEF and clear exclusive */
- add sp, sp, #AARCH64_EXCEPTION_FRAME_SIZE
- msr spsel, #1 /* switch to thread stack */
- eret /* exception return */
+ b twiddle
+ nop
+ nop
+ nop
+ nop
nop
nop
nop
@@ -475,69 +506,3 @@ twiddle:
stp q30, q31, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x1e0)]
/* Done, return to exception handler */
ret
-
-/*
- * Apply the exception frame to the current register status, SP points to the EF
- */
-.pop_exception_context:
-/* Pop daif and spsr */
- ldp x2, x3, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_DAIF_OFFSET]
-/* Restore daif and spsr */
- msr DAIF, x2
- msr SPSR_EL1, x3
-/* Pop FAR and ESR */
- ldp x2, x3, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_SYNDROME_OFFSET]
-/* Restore ESR and FAR */
- msr ESR_EL1, x2
- msr FAR_EL1, x3
-/* Pop fpcr and fpsr */
- ldp x2, x3, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_FPSR_OFFSET]
-/* Restore fpcr and fpsr */
- msr FPSR, x2
- msr FPCR, x3
-/* Pop VFP registers */
- ldp q0, q1, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x000)]
- ldp q2, q3, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x020)]
- ldp q4, q5, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x040)]
- ldp q6, q7, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x060)]
- ldp q8, q9, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x080)]
- ldp q10, q11, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x0a0)]
- ldp q12, q13, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x0c0)]
- ldp q14, q15, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x0e0)]
- ldp q16, q17, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x100)]
- ldp q18, q19, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x120)]
- ldp q20, q21, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x140)]
- ldp q22, q23, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x160)]
- ldp q24, q25, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x180)]
- ldp q26, q27, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x1a0)]
- ldp q28, q29, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x1c0)]
- ldp q30, q31, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x1e0)]
-/* Pop x0-x29(fp) */
- ldp x2, x3, [sp, #0x10]
- ldp x4, x5, [sp, #0x20]
- ldp x6, x7, [sp, #0x30]
- ldp x8, x9, [sp, #0x40]
- ldp x10, x11, [sp, #0x50]
- ldp x12, x13, [sp, #0x60]
- ldp x14, x15, [sp, #0x70]
- ldp x16, x17, [sp, #0x80]
- ldp x18, x19, [sp, #0x90]
- ldp x20, x21, [sp, #0xa0]
- ldp x22, x23, [sp, #0xb0]
- ldp x24, x25, [sp, #0xc0]
- ldp x26, x27, [sp, #0xd0]
- ldp x28, x29, [sp, #0xe0]
-/* Pop sp and ELR */
- ldp x0, x1, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_SP_OFFSET]
-/* Restore thread SP */
- msr spsel, #1
- mov sp, x0
- msr spsel, #0
-/* Restore exception LR */
- msr ELR_EL1, x1
- ldp x0, x1, [sp, #0x00]
-
-/* We must clear reservations to ensure consistency with atomic operations */
- clrex
-
- ret
diff --git a/cpukit/score/cpu/aarch64/aarch64-exception-default.c b/cpukit/score/cpu/aarch64/aarch64-exception-default.c
index 2ebb3dee9f..3494c88ea6 100644
--- a/cpukit/score/cpu/aarch64/aarch64-exception-default.c
+++ b/cpukit/score/cpu/aarch64/aarch64-exception-default.c
@@ -41,10 +41,67 @@
#include "config.h"
#endif
-#include <rtems/score/cpu.h>
#include <rtems/fatal.h>
+#include <rtems/score/aarch64-system-registers.h>
+#include <rtems/score/cpu.h>
+#include <rtems/score/percpu.h>
void _AArch64_Exception_default( CPU_Exception_frame *frame )
{
rtems_fatal( RTEMS_FATAL_SOURCE_EXCEPTION, (rtems_fatal_code) frame );
}
+
+void _CPU_Exception_disable_thread_dispatch( void )
+{
+ Per_CPU_Control *cpu_self = _Per_CPU_Get();
+
+ /* Increment interrupt nest and thread dispatch disable level */
+ ++cpu_self->thread_dispatch_disable_level;
+ ++cpu_self->isr_nest_level;
+}
+
+void _AArch64_Exception_frame_copy(
+ CPU_Exception_frame *new_ef,
+ CPU_Exception_frame *old_ef
+)
+{
+ *new_ef = *old_ef;
+}
+
+int _CPU_Exception_frame_get_signal( CPU_Exception_frame *ef )
+{
+ uint64_t EC = AARCH64_ESR_EL1_EC_GET( ef->register_syndrome );
+
+ switch ( EC ) {
+ case 0x1: /* WFI */
+ case 0x7: /* SVE/SIMD/FP */
+ case 0xa: /* LD64B/ST64B* */
+ case 0x18: /* MSR/MRS/system instruction */
+ case 0x19: /* SVE */
+ case 0x15: /* Supervisor call */
+ case 0x26: /* SP Alignment */
+ case 0x31: /* Breakpoint */
+ case 0x33: /* Step */
+ case 0x35: /* Watchpoint */
+ case 0x3c: /* Break Instruction */
+ return -1;
+ case 0x2c: /* FPU */
+ return SIGFPE;
+ case 0x21: /* Instruction Abort */
+ case 0x25: /* Data Abort */
+ return SIGSEGV;
+ default:
+ return SIGILL;
+ }
+}
+
+void _CPU_Exception_frame_set_resume( CPU_Exception_frame *ef, void *address )
+{
+ ef->register_pc = address;
+}
+
+#define AARCH64_INSTRUCTION_SIZE 4
+void _CPU_Exception_frame_make_resume_next_instruction( CPU_Exception_frame *ef )
+{
+ ef->register_pc += AARCH64_INSTRUCTION_SIZE;
+}
diff --git a/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S b/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S
index cb0954a29b..6344dce63a 100644
--- a/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S
+++ b/cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S
@@ -45,9 +45,15 @@
.globl _AArch64_Exception_interrupt_no_nest
.globl _AArch64_Exception_interrupt_nest
+.globl _CPU_Exception_dispatch_and_resume
+.globl _CPU_Exception_resume
#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
@@ -320,3 +326,166 @@ Return to embedded exception vector code
pop_interrupt_context
/* Return to vector for final cleanup */
ret
+
+/*
+ * This function is expected to resume execution using the CPU_Exception_frame
+ * provided in x0. This function does not adhere to the AAPCS64 calling
+ * convention because all necessary state is contained within the exception
+ * frame.
+ */
+_CPU_Exception_resume:
+/* Reset stack pointer */
+ mov sp, x0
+
+/* call CEF restore routine (doesn't restore lr) */
+ bl .pop_exception_context
+
+/* get lr from CEF */
+ ldr lr, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_LR_OFFSET]
+
+/* drop space reserved for CEF */
+ add sp, sp, #AARCH64_EXCEPTION_FRAME_SIZE
+
+/* switch to thread stack */
+ msr spsel, #1
+ eret
+
+/*
+ * This function is expected to undo dispatch disabling, perform dispatch, and
+ * resume execution using the CPU_Exception_frame provided in x0. This function
+ * does not adhere to the AAPCS64 calling convention because all necessary
+ * state is contained within the exception frame.
+ */
+_CPU_Exception_dispatch_and_resume:
+/* Get per-CPU control of current processor */
+ GET_SELF_CPU_CONTROL SELF_CPU_CONTROL_GET_REG
+
+/* Reset stack pointer */
+ mov sp, x0
+
+/* Check dispatch disable and perform dispatch if necessary */
+/* Load some per-CPU variables */
+ ldr w0, [SELF_CPU_CONTROL, #PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL]
+ ldrb w1, [SELF_CPU_CONTROL, #PER_CPU_DISPATCH_NEEDED]
+ ldr w2, [SELF_CPU_CONTROL, #PER_CPU_ISR_DISPATCH_DISABLE]
+ ldr w3, [SELF_CPU_CONTROL, #PER_CPU_ISR_NEST_LEVEL]
+
+/* Decrement levels and determine thread dispatch state */
+ eor w1, w1, w0
+ sub w0, w0, #1
+ orr w1, w1, w0
+ orr w1, w1, w2
+ sub w3, w3, #1
+
+/* Store thread dispatch disable and ISR nest levels */
+ str w0, [SELF_CPU_CONTROL, #PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL]
+ str w3, [SELF_CPU_CONTROL, #PER_CPU_ISR_NEST_LEVEL]
+
+/* store should_skip_thread_dispatch in x22 */
+ mov x22, x1
+
+/*
+ * It is now safe to assume that the source of the exception has been resolved.
+ * Copy the exception frame to the thread stack to be compatible with thread
+ * dispatch. This may arbitrarily clobber corruptible registers since all
+ * important state is contained in the exception frame.
+ *
+ * No need to save current LR since this will never return to the caller.
+ */
+ bl .move_exception_frame_and_switch_to_thread_stack
+
+/*
+ * Check thread dispatch necessary, ISR dispatch disable and thread dispatch
+ * disable level.
+ */
+ cmp x22, #0
+ bne .Lno_need_thread_dispatch_resume
+ bl .AArch64_Perform_Thread_Dispatch
+.Lno_need_thread_dispatch_resume:
+/* call CEF restore routine (doesn't restore lr) */
+ bl .pop_exception_context
+
+/* get lr from CEF */
+ ldr lr, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_LR_OFFSET]
+
+/* drop space reserved for CEF */
+ add sp, sp, #AARCH64_EXCEPTION_FRAME_SIZE
+ eret
+
+/* Assumes sp currently points to the EF on the exception stack and SPSel is 0 */
+.move_exception_frame_and_switch_to_thread_stack:
+ mov x1, sp /* Set x1 to the current exception frame */
+ msr spsel, #1 /* switch to thread stack */
+ ldr x0, [x1, #AARCH64_EXCEPTION_FRAME_REGISTER_SP_OFFSET] /* Get thread SP from exception frame since it may have been updated */
+ mov sp, x0
+ sub sp, sp, #AARCH64_EXCEPTION_FRAME_SIZE /* reserve space for CEF */
+ mov x0, sp /* Set x0 to the new exception frame */
+ mov x20, lr /* Save LR */
+ bl _AArch64_Exception_frame_copy /* Copy exception frame to reserved thread stack space */
+ mov lr, x20 /* Restore LR */
+ msr spsel, #0 /* switch to exception stack */
+ add sp, sp, #AARCH64_EXCEPTION_FRAME_SIZE /* release space for CEF on exception stack */
+ msr spsel, #1 /* switch to thread stack */
+ ret
+
+/*
+ * Apply the exception frame to the current register status, SP points to the EF
+ */
+.pop_exception_context:
+/* Pop daif and spsr */
+ ldp x2, x3, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_DAIF_OFFSET]
+/* Restore daif and spsr */
+ msr DAIF, x2
+ msr SPSR_EL1, x3
+/* Pop FAR and ESR */
+ ldp x2, x3, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_SYNDROME_OFFSET]
+/* Restore ESR and FAR */
+ msr ESR_EL1, x2
+ msr FAR_EL1, x3
+/* Pop fpcr and fpsr */
+ ldp x2, x3, [sp, #AARCH64_EXCEPTION_FRAME_REGISTER_FPSR_OFFSET]
+/* Restore fpcr and fpsr */
+ msr FPSR, x2
+ msr FPCR, x3
+/* Pop VFP registers */
+ ldp q0, q1, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x000)]
+ ldp q2, q3, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x020)]
+ ldp q4, q5, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x040)]
+ ldp q6, q7, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x060)]
+ ldp q8, q9, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x080)]
+ ldp q10, q11, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x0a0)]
+ ldp q12, q13, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x0c0)]
+ ldp q14, q15, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x0e0)]
+ ldp q16, q17, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x100)]
+ ldp q18, q19, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x120)]
+ ldp q20, q21, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x140)]
+ ldp q22, q23, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x160)]
+ ldp q24, q25, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x180)]
+ ldp q26, q27, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x1a0)]
+ ldp q28, q29, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x1c0)]
+ ldp q30, q31, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_Q0_OFFSET + 0x1e0)]
+/* Pop x0-x29(fp) */
+ ldp x2, x3, [sp, #0x10]
+ ldp x4, x5, [sp, #0x20]
+ ldp x6, x7, [sp, #0x30]
+ ldp x8, x9, [sp, #0x40]
+ ldp x10, x11, [sp, #0x50]
+ ldp x12, x13, [sp, #0x60]
+ ldp x14, x15, [sp, #0x70]
+ ldp x16, x17, [sp, #0x80]
+ ldp x18, x19, [sp, #0x90]
+ ldp x20, x21, [sp, #0xa0]
+ ldp x22, x23, [sp, #0xb0]
+ ldp x24, x25, [sp, #0xc0]
+ ldp x26, x27, [sp, #0xd0]
+ ldp x28, x29, [sp, #0xe0]
+/* Pop ELR, SP already popped */
+ ldr x1, [sp, #(AARCH64_EXCEPTION_FRAME_REGISTER_SP_OFFSET + 0x8)]
+/* Restore exception LR */
+ msr ELR_EL1, x1
+ ldp x0, x1, [sp, #0x00]
+
+/* We must clear reservations to ensure consistency with atomic operations */
+ clrex
+
+ ret
diff --git a/cpukit/score/cpu/aarch64/cpu.c b/cpukit/score/cpu/aarch64/cpu.c
index d09403a349..88e7ad8a8c 100644
--- a/cpukit/score/cpu/aarch64/cpu.c
+++ b/cpukit/score/cpu/aarch64/cpu.c
@@ -146,17 +146,23 @@ 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;
- __asm__ volatile (
- "msr DAIF, %[level]\n"
- : : [level] "r" (level)
- );
+ if ( level ) {
+ __asm__ volatile (
+ "msr DAIFSet, #0x2\n"
+ : : [level] "r" (level)
+ );
+ } else {
+ __asm__ volatile (
+ "msr DAIFClr, #0x2\n"
+ : : [level] "r" (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/libcpu/mmu-vmsav8-64.h b/cpukit/score/cpu/aarch64/include/libcpu/mmu-vmsav8-64.h
new file mode 100644
index 0000000000..6b6296bb7a
--- /dev/null
+++ b/cpukit/score/cpu/aarch64/include/libcpu/mmu-vmsav8-64.h
@@ -0,0 +1,97 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreCPUAArch64
+ *
+ * @brief Definitions used in MMU setup.
+ */
+
+/*
+ * Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
+ * Written by Kinsey Moore <kinsey.moore@oarcorp.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LIBCPU_AARCH64_MMU_VMSAV8_64_H
+#define LIBCPU_AARCH64_MMU_VMSAV8_64_H
+
+#ifndef ASM
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <rtems.h>
+
+/* VMSAv8 Long-descriptor fields */
+#define MMU_DESC_AF ( 1 << 10 )
+#define MMU_DESC_SH_INNER ( ( 1 << 9 ) | ( 1 << 8 ) )
+#define MMU_DESC_WRITE_DISABLE ( 1 << 7 )
+/* PAGE and TABLE flags are the same bit, but only apply on certain levels */
+#define MMU_DESC_TYPE_TABLE ( 1 << 1 )
+#define MMU_DESC_TYPE_PAGE ( 1 << 1 )
+#define MMU_DESC_VALID ( 1 << 0 )
+#define MMU_DESC_MAIR_ATTR( val ) ( ( val & 0x3 ) << 2 )
+#define MMU_DESC_PAGE_TABLE_MASK 0xFFFFFFFFF000LL
+
+/* Page table configuration */
+#define MMU_PAGE_BITS 12
+#define MMU_PAGE_SIZE ( 1 << MMU_PAGE_BITS )
+#define MMU_BITS_PER_LEVEL 9
+#define MMU_TOP_LEVEL_PAGE_BITS ( 2 * MMU_BITS_PER_LEVEL + MMU_PAGE_BITS )
+
+#define AARCH64_MMU_FLAGS_BASE \
+ ( MMU_DESC_VALID | MMU_DESC_SH_INNER | MMU_DESC_AF )
+
+#define AARCH64_MMU_DATA_RO_CACHED \
+ ( AARCH64_MMU_FLAGS_BASE | MMU_DESC_MAIR_ATTR( 3 ) | MMU_DESC_WRITE_DISABLE )
+#define AARCH64_MMU_CODE_CACHED AARCH64_MMU_DATA_RO_CACHED
+#define AARCH64_MMU_CODE_RW_CACHED AARCH64_MMU_DATA_RW_CACHED
+
+#define AARCH64_MMU_DATA_RO \
+ ( AARCH64_MMU_FLAGS_BASE | MMU_DESC_MAIR_ATTR( 1 ) | MMU_DESC_WRITE_DISABLE )
+#define AARCH64_MMU_CODE AARCH64_MMU_DATA_RO
+#define AARCH64_MMU_CODE_RW AARCH64_MMU_DATA_RW
+
+/* RW implied by not ORing in RO */
+#define AARCH64_MMU_DATA_RW_CACHED \
+ ( AARCH64_MMU_FLAGS_BASE | MMU_DESC_MAIR_ATTR( 3 ) )
+#define AARCH64_MMU_DATA_RW \
+ ( AARCH64_MMU_FLAGS_BASE | MMU_DESC_MAIR_ATTR( 1 ) )
+#define AARCH64_MMU_DEVICE ( AARCH64_MMU_FLAGS_BASE | MMU_DESC_MAIR_ATTR( 0 ) )
+
+rtems_status_code aarch64_mmu_map(
+ uintptr_t addr,
+ uint64_t size,
+ uint64_t flags
+);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* ASM */
+
+#endif /* LIBCPU_AARCH64_MMU_VMSAV8_64_H */
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..5bfddb6dad 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
@@ -6719,21 +6719,291 @@ static inline uint64_t _AArch64_Read_dbgauthstatus_el1( void )
#define AARCH64_DBGBCR_N_EL1_BT_GET( _reg ) \
( ( ( _reg ) >> 20 ) & 0xfU )
-static inline uint64_t _AArch64_Read_dbgbcr_n_el1( void )
+static inline uint64_t _AArch64_Read_dbgbcr0_el1( void )
{
uint64_t value;
__asm__ volatile (
- "mrs %0, DBGBCR_N_EL1" : "=&r" ( value ) : : "memory"
+ "mrs %0, DBGBCR0_EL1" : "=&r" ( value ) : : "memory"
);
return value;
}
-static inline void _AArch64_Write_dbgbcr_n_el1( uint64_t value )
+static inline void _AArch64_Write_dbgbcr0_el1( uint64_t value )
{
__asm__ volatile (
- "msr DBGBCR_N_EL1, %0" : : "r" ( value ) : "memory"
+ "msr DBGBCR0_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr1_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR1_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr1_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR1_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr2_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR2_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr2_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR2_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr3_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR3_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr3_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR3_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr4_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR4_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr4_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR4_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr5_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR5_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr5_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR5_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr6_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR6_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr6_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR6_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr7_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR7_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr7_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR7_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr8_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR8_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr8_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR8_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr9_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR9_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr9_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR9_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr10_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR10_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr10_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR10_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr11_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR11_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr11_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR11_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr12_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR12_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr12_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR12_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr13_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR13_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr13_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR13_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr14_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR14_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr14_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR14_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbcr15_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBCR15_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbcr15_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBCR15_EL1, %0" : : "r" ( value ) : "memory"
);
}
@@ -6781,21 +7051,291 @@ static inline void _AArch64_Write_dbgbcr_n_el1( uint64_t value )
#define AARCH64_DBGBVR_N_EL1_RESS_14_4_GET( _reg ) \
( ( ( _reg ) >> 53 ) & 0x7ffULL )
-static inline uint64_t _AArch64_Read_dbgbvr_n_el1( void )
+static inline uint64_t _AArch64_Read_dbgbvr0_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR0_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr0_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR0_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr1_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR1_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr1_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR1_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr2_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR2_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr2_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR2_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr3_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR3_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr3_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR3_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr4_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR4_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr4_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR4_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr5_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR5_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr5_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR5_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr6_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR6_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr6_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR6_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr7_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR7_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr7_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR7_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr8_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR8_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr8_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR8_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr9_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR9_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr9_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR9_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr10_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR10_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr10_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR10_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr11_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR11_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr11_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR11_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr12_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR12_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr12_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR12_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr13_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR13_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr13_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR13_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr14_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGBVR14_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgbvr14_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGBVR14_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgbvr15_el1( void )
{
uint64_t value;
__asm__ volatile (
- "mrs %0, DBGBVR_N_EL1" : "=&r" ( value ) : : "memory"
+ "mrs %0, DBGBVR15_EL1" : "=&r" ( value ) : : "memory"
);
return value;
}
-static inline void _AArch64_Write_dbgbvr_n_el1( uint64_t value )
+static inline void _AArch64_Write_dbgbvr15_el1( uint64_t value )
{
__asm__ volatile (
- "msr DBGBVR_N_EL1, %0" : : "r" ( value ) : "memory"
+ "msr DBGBVR15_EL1, %0" : : "r" ( value ) : "memory"
);
}
@@ -7027,21 +7567,291 @@ static inline void _AArch64_Write_dbgvcr32_el2( uint64_t value )
#define AARCH64_DBGWCR_N_EL1_MASK_GET( _reg ) \
( ( ( _reg ) >> 24 ) & 0x1fU )
-static inline uint64_t _AArch64_Read_dbgwcr_n_el1( void )
+static inline uint64_t _AArch64_Read_dbgwcr0_el1( void )
{
uint64_t value;
__asm__ volatile (
- "mrs %0, DBGWCR_N_EL1" : "=&r" ( value ) : : "memory"
+ "mrs %0, DBGWCR0_EL1" : "=&r" ( value ) : : "memory"
);
return value;
}
-static inline void _AArch64_Write_dbgwcr_n_el1( uint64_t value )
+static inline void _AArch64_Write_dbgwcr0_el1( uint64_t value )
{
__asm__ volatile (
- "msr DBGWCR_N_EL1, %0" : : "r" ( value ) : "memory"
+ "msr DBGWCR0_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr1_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR1_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr1_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR1_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr2_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR2_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr2_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR2_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr3_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR3_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr3_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR3_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr4_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR4_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr4_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR4_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr5_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR5_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr5_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR5_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr6_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR6_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr6_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR6_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr7_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR7_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr7_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR7_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr8_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR8_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr8_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR8_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr9_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR9_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr9_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR9_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr10_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR10_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr10_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR10_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr11_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR11_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr11_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR11_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr12_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR12_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr12_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR12_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr13_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR13_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr13_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR13_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr14_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR14_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr14_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR14_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwcr15_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWCR15_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwcr15_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWCR15_EL1, %0" : : "r" ( value ) : "memory"
);
}
@@ -7065,21 +7875,291 @@ static inline void _AArch64_Write_dbgwcr_n_el1( uint64_t value )
#define AARCH64_DBGWVR_N_EL1_RESS_14_4_GET( _reg ) \
( ( ( _reg ) >> 53 ) & 0x7ffULL )
-static inline uint64_t _AArch64_Read_dbgwvr_n_el1( void )
+static inline uint64_t _AArch64_Read_dbgwvr0_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR0_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr0_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR0_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr1_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR1_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr1_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR1_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr2_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR2_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr2_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR2_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr3_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR3_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr3_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR3_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr4_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR4_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr4_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR4_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr5_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR5_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr5_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR5_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr6_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR6_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr6_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR6_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr7_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR7_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr7_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR7_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr8_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR8_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr8_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR8_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr9_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR9_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr9_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR9_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr10_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR10_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr10_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR10_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr11_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR11_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr11_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR11_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr12_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR12_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr12_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR12_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr13_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR13_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr13_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR13_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr14_el1( void )
+{
+ uint64_t value;
+
+ __asm__ volatile (
+ "mrs %0, DBGWVR14_EL1" : "=&r" ( value ) : : "memory"
+ );
+
+ return value;
+}
+
+static inline void _AArch64_Write_dbgwvr14_el1( uint64_t value )
+{
+ __asm__ volatile (
+ "msr DBGWVR14_EL1, %0" : : "r" ( value ) : "memory"
+ );
+}
+
+static inline uint64_t _AArch64_Read_dbgwvr15_el1( void )
{
uint64_t value;
__asm__ volatile (
- "mrs %0, DBGWVR_N_EL1" : "=&r" ( value ) : : "memory"
+ "mrs %0, DBGWVR15_EL1" : "=&r" ( value ) : : "memory"
);
return value;
}
-static inline void _AArch64_Write_dbgwvr_n_el1( uint64_t value )
+static inline void _AArch64_Write_dbgwvr15_el1( uint64_t value )
{
__asm__ volatile (
- "msr DBGWVR_N_EL1, %0" : : "r" ( value ) : "memory"
+ "msr DBGWVR15_EL1, %0" : : "r" ( value ) : "memory"
);
}
diff --git a/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h b/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
index dacc18638e..e1d9f0a5c2 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
@@ -519,6 +524,27 @@ typedef struct {
void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
+RTEMS_NO_RETURN void _CPU_Exception_resume( CPU_Exception_frame *frame );
+
+RTEMS_NO_RETURN void
+_CPU_Exception_dispatch_and_resume( CPU_Exception_frame *frame );
+
+void _CPU_Exception_disable_thread_dispatch( void );
+
+int _CPU_Exception_frame_get_signal( CPU_Exception_frame *frame );
+
+void _CPU_Exception_frame_set_resume( CPU_Exception_frame *frame,
+ void *address );
+
+void _CPU_Exception_frame_make_resume_next_instruction(
+ CPU_Exception_frame *frame
+);
+
+void _AArch64_Exception_frame_copy(
+ CPU_Exception_frame *new_ef,
+ CPU_Exception_frame *old_ef
+);
+
void _AArch64_Exception_default( CPU_Exception_frame *frame );
/** Type that can store a 32-bit integer or a pointer. */
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 );