summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bsps/aarch64/include/bsp/aarch64-mmu.h60
-rw-r--r--bsps/aarch64/include/dev/irq/arm-gic-arch.h4
-rw-r--r--bsps/aarch64/shared/cache/cache.c2
-rw-r--r--bsps/aarch64/shared/mmu/vmsav8-64-nommu.c49
-rw-r--r--bsps/aarch64/shared/mmu/vmsav8-64.c69
-rw-r--r--bsps/aarch64/shared/start/linkcmds.base7
-rw-r--r--bsps/aarch64/shared/start/start.S131
-rw-r--r--bsps/aarch64/xilinx-versal/start/bspstarthooks.c3
-rw-r--r--bsps/aarch64/xilinx-versal/start/bspstartmmu.c1
-rw-r--r--bsps/aarch64/xilinx-zynqmp/start/bspstarthooks.c12
-rw-r--r--bsps/aarch64/xilinx-zynqmp/start/bspstartmmu.c1
-rw-r--r--bsps/arm/altera-cyclone-v/start/bsp_specs0
-rw-r--r--bsps/arm/atsam/console/console.c467
-rw-r--r--bsps/arm/atsam/include/bsp.h13
-rw-r--r--bsps/arm/atsam/start/bsp_specs0
-rw-r--r--bsps/arm/beagle/start/bsp_specs0
-rw-r--r--bsps/arm/csb336/start/bsp_specs0
-rw-r--r--bsps/arm/csb337/start/bsp_specs0
-rw-r--r--bsps/arm/edb7312/start/bsp_specs0
-rw-r--r--bsps/arm/gumstix/start/bsp_specs0
-rw-r--r--bsps/arm/imx/start/bsp_specs0
-rw-r--r--bsps/arm/lm3s69xx/start/bsp_specs0
-rw-r--r--bsps/arm/lpc176x/start/bsp_specs0
-rw-r--r--bsps/arm/lpc24xx/start/bsp_specs0
-rw-r--r--bsps/arm/lpc32xx/start/bsp_specs0
-rw-r--r--bsps/arm/raspberrypi/start/bsp_specs0
-rw-r--r--bsps/arm/realview-pbx-a9/start/bsp_specs0
-rw-r--r--bsps/arm/rtl22xx/start/bsp_specs0
-rw-r--r--bsps/arm/smdk2410/start/bsp_specs0
-rw-r--r--bsps/arm/stm32f4/start/bsp_specs0
-rw-r--r--bsps/arm/stm32h7/start/bsp_specs0
-rw-r--r--bsps/arm/tms570/start/bsp_specs0
-rw-r--r--bsps/arm/xen/start/bsp_specs0
-rw-r--r--bsps/arm/xilinx-zynq/start/bsp_specs0
-rw-r--r--bsps/arm/xilinx-zynqmp/start/bsp_specs0
-rw-r--r--bsps/bfin/TLL6527M/start/bsp_specs0
-rw-r--r--bsps/bfin/bf537Stamp/start/bsp_specs0
-rw-r--r--bsps/bfin/eZKit533/start/bsp_specs0
-rw-r--r--bsps/i386/pc386/start/bsp_specs0
-rw-r--r--bsps/lm32/lm32_evr/start/bsp_specs0
-rw-r--r--bsps/lm32/milkymist/start/bsp_specs0
-rw-r--r--bsps/m68k/av5282/start/bsp_specs0
-rw-r--r--bsps/m68k/csb360/start/bsp_specs0
-rw-r--r--bsps/m68k/gen68340/start/bsp_specs0
-rw-r--r--bsps/m68k/gen68360/start/bsp_specs0
-rw-r--r--bsps/m68k/genmcf548x/start/bsp_specs0
-rw-r--r--bsps/m68k/mcf5206elite/start/bsp_specs0
-rw-r--r--bsps/m68k/mcf52235/start/bsp_specs0
-rw-r--r--bsps/m68k/mcf5225x/start/bsp_specs0
-rw-r--r--bsps/m68k/mcf5235/start/bsp_specs0
-rw-r--r--bsps/m68k/mcf5329/start/bsp_specs0
-rw-r--r--bsps/m68k/mrm332/start/bsp_specs0
-rw-r--r--bsps/m68k/mrm332/start/linkcmds16
-rw-r--r--bsps/m68k/mvme147/start/bsp_specs0
-rw-r--r--bsps/m68k/mvme147s/start/bsp_specs0
-rw-r--r--bsps/m68k/mvme162/start/bsp_specs0
-rw-r--r--bsps/m68k/mvme167/start/bsp_specs0
-rw-r--r--bsps/m68k/uC5282/start/bsp_specs0
-rw-r--r--bsps/mips/csb350/start/bsp_specs0
-rw-r--r--bsps/mips/hurricane/start/bsp_specs0
-rw-r--r--bsps/mips/jmr3904/start/bsp_specs0
-rw-r--r--bsps/mips/malta/start/bsp_specs0
-rw-r--r--bsps/mips/rbtx4925/start/bsp_specs0
-rw-r--r--bsps/mips/rbtx4938/start/bsp_specs0
-rw-r--r--bsps/moxie/moxiesim/start/bsp_specs0
-rw-r--r--bsps/nios2/nios2_iss/start/bsp_specs0
-rw-r--r--bsps/no_cpu/no_bsp/start/bsp_specs0
-rw-r--r--bsps/or1k/generic_or1k/start/bsp_specs0
-rw-r--r--bsps/powerpc/beatnik/start/bsp_specs0
-rw-r--r--bsps/powerpc/gen5200/start/bsp_specs0
-rw-r--r--bsps/powerpc/gen83xx/start/bsp_specs0
-rw-r--r--bsps/powerpc/haleakala/README51
-rw-r--r--bsps/powerpc/haleakala/config/haleakala.cfg27
-rw-r--r--bsps/powerpc/haleakala/include/bsp.h107
-rw-r--r--bsps/powerpc/haleakala/include/bsp/irq.h168
-rw-r--r--bsps/powerpc/haleakala/include/mmu_405.h77
-rw-r--r--bsps/powerpc/haleakala/include/tm27.h1
-rw-r--r--bsps/powerpc/haleakala/irq/irq.c237
-rw-r--r--bsps/powerpc/haleakala/irq/irq_init.c96
-rw-r--r--bsps/powerpc/haleakala/start/bsp_specs0
-rw-r--r--bsps/powerpc/haleakala/start/bspstart.c190
-rw-r--r--bsps/powerpc/haleakala/start/linkcmds274
-rw-r--r--bsps/powerpc/haleakala/start/mmu_405.c293
-rw-r--r--bsps/powerpc/haleakala/start/mmu_405asm.S83
-rw-r--r--bsps/powerpc/haleakala/start/start.S237
-rw-r--r--bsps/powerpc/motorola_powerpc/start/bsp_specs0
-rw-r--r--bsps/powerpc/mpc55xxevb/start/bsp_specs0
-rw-r--r--bsps/powerpc/mpc8260ads/start/bsp_specs0
-rw-r--r--bsps/powerpc/mvme3100/start/bsp_specs0
-rw-r--r--bsps/powerpc/mvme5500/start/bsp_specs0
-rw-r--r--bsps/powerpc/psim/start/bsp_specs0
-rw-r--r--bsps/powerpc/qemuppc/start/bsp_specs0
-rw-r--r--bsps/powerpc/qoriq/irq/irq.c101
-rw-r--r--bsps/powerpc/qoriq/start/bsp_specs0
-rw-r--r--bsps/powerpc/ss555/start/bsp_specs0
-rw-r--r--bsps/powerpc/t32mppc/start/bsp_specs0
-rw-r--r--bsps/powerpc/tqm8xx/start/bsp_specs0
-rw-r--r--bsps/powerpc/virtex/start/bsp_specs0
-rw-r--r--bsps/powerpc/virtex4/start/bsp_specs0
-rw-r--r--bsps/powerpc/virtex5/start/bsp_specs0
-rw-r--r--bsps/riscv/griscv/start/bsp_specs0
-rw-r--r--bsps/riscv/riscv/start/bsp_specs0
-rw-r--r--bsps/sh/gensh1/start/bsp_specs0
-rw-r--r--bsps/sh/gensh2/start/bsp_specs0
-rw-r--r--bsps/sh/gensh4/start/bsp_specs0
-rw-r--r--bsps/sh/shsim/start/bsp_specs0
-rw-r--r--bsps/shared/dev/btimer/btimer-stub.c30
-rw-r--r--bsps/shared/dev/irq/arm-gicv3.c75
-rw-r--r--bsps/shared/start/bsp-fdt.c10
-rw-r--r--bsps/shared/start/mallocinitmulti.c49
-rw-r--r--bsps/shared/start/mallocinitone.c49
-rw-r--r--bsps/shared/start/wkspaceinitmulti.c46
-rw-r--r--bsps/shared/start/wkspaceinitone.c46
-rw-r--r--bsps/sparc/erc32/start/bsp_specs0
-rw-r--r--bsps/sparc/leon2/start/bsp_specs0
-rw-r--r--bsps/sparc/leon3/clock/ckinit.c14
-rw-r--r--bsps/sparc/leon3/include/tm27.h77
-rw-r--r--bsps/sparc/leon3/start/bsp_specs0
-rw-r--r--bsps/sparc/leon3/start/bspsmp.c15
-rw-r--r--bsps/sparc64/niagara/start/bsp_specs0
-rw-r--r--bsps/sparc64/usiii/start/bsp_specs0
-rw-r--r--bsps/v850/gdbv850sim/start/bsp_specs0
-rw-r--r--bsps/x86_64/amd64/start/bsp_specs0
-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/doxygen/appl-config.h23
-rw-r--r--cpukit/dtc/VERSION6
-rw-r--r--cpukit/dtc/libfdt/fdt.c41
-rw-r--r--cpukit/dtc/libfdt/fdt_addresses.c2
-rw-r--r--cpukit/dtc/libfdt/fdt_ro.c44
-rw-r--r--cpukit/dtc/libfdt/fdt_rw.c37
-rw-r--r--cpukit/dtc/libfdt/fdt_strerror.c5
-rw-r--r--cpukit/dtc/libfdt/fdt_sw.c38
-rw-r--r--cpukit/dtc/libfdt/fdt_wip.c2
-rw-r--r--cpukit/dtc/libfdt/libfdt_internal.h49
-rw-r--r--cpukit/include/libfdt.h157
-rw-r--r--cpukit/include/rtems.h1
-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.h9
-rw-r--r--cpukit/include/rtems/irq-extension.h2257
-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/pthreadimpl.h15
-rw-r--r--cpukit/include/rtems/rtems/asr.h2
-rw-r--r--cpukit/include/rtems/rtems/clock.h592
-rw-r--r--cpukit/include/rtems/rtems/intr.h2323
-rw-r--r--cpukit/include/rtems/rtems/modesimpl.h8
-rw-r--r--cpukit/include/rtems/rtems/partdata.h4
-rw-r--r--cpukit/include/rtems/rtems/ratemondata.h4
-rw-r--r--cpukit/include/rtems/rtems/ratemonimpl.h3
-rw-r--r--cpukit/include/rtems/rtems/scheduler.h551
-rw-r--r--cpukit/include/rtems/rtems/signal.h2
-rw-r--r--cpukit/include/rtems/rtems/tasks.h480
-rw-r--r--cpukit/include/rtems/rtems/tasksimpl.h8
-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/cpustdatomic.h6
-rw-r--r--cpukit/include/rtems/score/exception.h71
-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.h35
-rw-r--r--cpukit/include/rtems/score/rbtreeimpl.h26
-rw-r--r--cpukit/include/rtems/score/scheduler.h96
-rw-r--r--cpukit/include/rtems/score/schedulercbs.h11
-rw-r--r--cpukit/include/rtems/score/scheduleredf.h1
-rw-r--r--cpukit/include/rtems/score/scheduleredfsmp.h46
-rw-r--r--cpukit/include/rtems/score/schedulerimpl.h479
-rw-r--r--cpukit/include/rtems/score/schedulernodeimpl.h21
-rw-r--r--cpukit/include/rtems/score/schedulerpriority.h1
-rw-r--r--cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h33
-rw-r--r--cpukit/include/rtems/score/schedulerprioritysmp.h34
-rw-r--r--cpukit/include/rtems/score/schedulerprioritysmpimpl.h35
-rw-r--r--cpukit/include/rtems/score/schedulersimple.h1
-rw-r--r--cpukit/include/rtems/score/schedulersimpleimpl.h13
-rw-r--r--cpukit/include/rtems/score/schedulersimplesmp.h33
-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.h63
-rw-r--r--cpukit/include/rtems/score/status.h2
-rw-r--r--cpukit/include/rtems/score/thread.h120
-rw-r--r--cpukit/include/rtems/score/threadcpubudget.h102
-rw-r--r--cpukit/include/rtems/score/threadimpl.h121
-rw-r--r--cpukit/include/rtems/score/threadmp.h13
-rw-r--r--cpukit/include/rtems/score/threadqimpl.h25
-rw-r--r--cpukit/include/rtems/score/timecounter.h24
-rw-r--r--cpukit/include/rtems/score/userextimpl.h4
-rw-r--r--cpukit/include/rtems/score/wkspace.h12
-rw-r--r--cpukit/include/rtems/score/wkspaceinitmulti.h129
-rw-r--r--cpukit/include/rtems/score/wkspaceinitone.h119
-rw-r--r--cpukit/libcsupport/src/malloc_initialize.c81
-rw-r--r--cpukit/libcsupport/src/mallocheap.c2
-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/libmisc/cpuuse/cpuusagereset.c1
-rw-r--r--cpukit/libmisc/rtems-fdt/rtems-fdt.c1
-rw-r--r--cpukit/libmisc/untar/untar.c57
-rw-r--r--cpukit/libtest/t-test-interrupt.c9
-rw-r--r--cpukit/libtest/t-test-rtems-context.c9
-rw-r--r--cpukit/libtest/t-test-rtems-measure.c29
-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/eventsurrender.c12
-rw-r--r--cpukit/rtems/src/ratemonperiod.c2
-rw-r--r--cpukit/rtems/src/ratemontimeout.c4
-rw-r--r--cpukit/rtems/src/scheduleraddprocessor.c4
-rw-r--r--cpukit/rtems/src/schedulergetmaxprio.c4
-rw-r--r--cpukit/rtems/src/schedulergetprocessor.c54
-rw-r--r--cpukit/rtems/src/schedulergetprocessormax.c54
-rw-r--r--cpukit/rtems/src/schedulergetprocessorset.c4
-rw-r--r--cpukit/rtems/src/schedulerident.c4
-rw-r--r--cpukit/rtems/src/scheduleridentbyprocessor.c4
-rw-r--r--cpukit/rtems/src/scheduleridentbyprocessorset.c4
-rw-r--r--cpukit/rtems/src/schedulermapfromposix.c4
-rw-r--r--cpukit/rtems/src/schedulermaptoposix.c4
-rw-r--r--cpukit/rtems/src/schedulerremoveprocessor.c54
-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-exception-default.S131
-rw-r--r--cpukit/score/cpu/aarch64/aarch64-exception-default.c59
-rw-r--r--cpukit/score/cpu/aarch64/aarch64-exception-interrupt.S165
-rw-r--r--cpukit/score/cpu/aarch64/cpu.c16
-rw-r--r--cpukit/score/cpu/aarch64/include/libcpu/mmu-vmsav8-64.h97
-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.h21
-rw-r--r--cpukit/score/cpu/arm/arm_exc_interrupt.S193
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h38
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/arm.h1
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/cpu.h2
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/cpuimpl.h13
-rw-r--r--cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h63
-rw-r--r--cpukit/score/cpu/sparc/cpu_asm.S12
-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/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/schedulerdefaultmakecleansticky.c52
-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.c2
-rw-r--r--cpukit/score/src/threadchangepriority.c132
-rw-r--r--cpukit/score/src/threadcreateidle.c1
-rw-r--r--cpukit/score/src/threaddispatch.c13
-rw-r--r--cpukit/score/src/threadexhausttimeslice.c53
-rw-r--r--cpukit/score/src/threadinitialize.c14
-rw-r--r--cpukit/score/src/threadloadenv.c11
-rw-r--r--cpukit/score/src/threadqenqueue.c68
-rw-r--r--cpukit/score/src/threadqextract.c57
-rw-r--r--cpukit/score/src/threadqextractwithproxy.c46
-rw-r--r--cpukit/score/src/threadresettimeslice.c91
-rw-r--r--cpukit/score/src/threadrestart.c12
-rw-r--r--cpukit/score/src/threadtimeout.c8
-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--spec/build/bsps/aarch64/a53/grp.yml4
-rw-r--r--spec/build/bsps/aarch64/a53/obj.yml2
-rw-r--r--spec/build/bsps/aarch64/a72/grp.yml4
-rw-r--r--spec/build/bsps/aarch64/a72/obj.yml2
-rw-r--r--spec/build/bsps/aarch64/optisns.yml20
-rw-r--r--spec/build/bsps/aarch64/xilinx-versal/grp.yml6
-rw-r--r--spec/build/bsps/aarch64/xilinx-versal/obj.yml4
-rw-r--r--spec/build/bsps/aarch64/xilinx-zynqmp/grp.yml4
-rw-r--r--spec/build/bsps/aarch64/xilinx-zynqmp/obj.yml2
-rw-r--r--spec/build/bsps/aarch64/xilinx-zynqmp/objcadencei2c.yml4
-rw-r--r--spec/build/bsps/aarch64/xilinx-zynqmp/optclki2c0.yml7
-rw-r--r--spec/build/bsps/aarch64/xilinx-zynqmp/optclki2c1.yml7
-rw-r--r--spec/build/bsps/arm/altera-cyclone-v/bspalteracyclonev.yml4
-rw-r--r--spec/build/bsps/arm/atsam/bspatsam.yml5
-rw-r--r--spec/build/bsps/arm/beagle/grp.yml2
-rw-r--r--spec/build/bsps/arm/beagle/obj.yml3
-rw-r--r--spec/build/bsps/arm/csb336/bspcsb336.yml3
-rw-r--r--spec/build/bsps/arm/csb337/grp.yml2
-rw-r--r--spec/build/bsps/arm/csb337/obj.yml1
-rw-r--r--spec/build/bsps/arm/edb7312/bspedb7312.yml3
-rw-r--r--spec/build/bsps/arm/fvp/grp.yml2
-rw-r--r--spec/build/bsps/arm/fvp/obj.yml1
-rw-r--r--spec/build/bsps/arm/gumstix/bspgumstix.yml3
-rw-r--r--spec/build/bsps/arm/imx/bspimx.yml6
-rw-r--r--spec/build/bsps/arm/imxrt/bspimxrt.yml5
-rw-r--r--spec/build/bsps/arm/lm3s69xx/grp.yml2
-rw-r--r--spec/build/bsps/arm/lm3s69xx/obj.yml3
-rw-r--r--spec/build/bsps/arm/lpc176x/grp.yml2
-rw-r--r--spec/build/bsps/arm/lpc176x/obj.yml1
-rw-r--r--spec/build/bsps/arm/lpc24xx/grp.yml2
-rw-r--r--spec/build/bsps/arm/lpc24xx/obj.yml1
-rw-r--r--spec/build/bsps/arm/lpc32xx/grp.yml2
-rw-r--r--spec/build/bsps/arm/lpc32xx/obj.yml1
-rw-r--r--spec/build/bsps/arm/raspberrypi/obj.yml2
-rw-r--r--spec/build/bsps/arm/realview-pbx-a9/bsprealviewpbxa9.yml5
-rw-r--r--spec/build/bsps/arm/rtl22xx/grp.yml2
-rw-r--r--spec/build/bsps/arm/rtl22xx/obj.yml1
-rw-r--r--spec/build/bsps/arm/smdk2410/bspsmdk2410.yml3
-rw-r--r--spec/build/bsps/arm/stm32f4/grp.yml2
-rw-r--r--spec/build/bsps/arm/stm32f4/obj.yml3
-rw-r--r--spec/build/bsps/arm/stm32h7/grp.yml2
-rw-r--r--spec/build/bsps/arm/stm32h7/obj.yml6
-rw-r--r--spec/build/bsps/arm/tms570/grp.yml2
-rw-r--r--spec/build/bsps/arm/tms570/obj.yml1
-rw-r--r--spec/build/bsps/arm/xen/bspxen.yml6
-rw-r--r--spec/build/bsps/arm/xilinx-zynq/grp.yml2
-rw-r--r--spec/build/bsps/arm/xilinx-zynq/obj.yml9
-rw-r--r--spec/build/bsps/arm/xilinx-zynqmp/bspxilinxzynqmp.yml6
-rw-r--r--spec/build/bsps/bfin/TLL6527M/bsptll6527m.yml3
-rw-r--r--spec/build/bsps/bfin/bf537Stamp/bspbf537stamp.yml3
-rw-r--r--spec/build/bsps/bfin/eZKit533/bspezkit533.yml3
-rw-r--r--spec/build/bsps/i386/pc386/obj.yml2
-rw-r--r--spec/build/bsps/lm32/lm32_evr/grp.yml2
-rw-r--r--spec/build/bsps/lm32/lm32_evr/obj.yml1
-rw-r--r--spec/build/bsps/lm32/milkymist/bspmilkymist.yml3
-rw-r--r--spec/build/bsps/m68k/av5282/bspav5282.yml3
-rw-r--r--spec/build/bsps/m68k/csb360/bspcsb360.yml3
-rw-r--r--spec/build/bsps/m68k/gen68340/bspgen68340.yml3
-rw-r--r--spec/build/bsps/m68k/gen68360/grp.yml2
-rw-r--r--spec/build/bsps/m68k/gen68360/obj.yml1
-rw-r--r--spec/build/bsps/m68k/genmcf548x/grp.yml2
-rw-r--r--spec/build/bsps/m68k/genmcf548x/obj.yml1
-rw-r--r--spec/build/bsps/m68k/mcf5206elite/bspmcf5206elite.yml3
-rw-r--r--spec/build/bsps/m68k/mcf52235/bspmcf52235.yml3
-rw-r--r--spec/build/bsps/m68k/mcf5225x/bspmcf5225x.yml3
-rw-r--r--spec/build/bsps/m68k/mcf5235/bspmcf5235.yml3
-rw-r--r--spec/build/bsps/m68k/mcf5329/bspmcf5329.yml3
-rw-r--r--spec/build/bsps/m68k/mrm332/bspmrm332.yml3
-rw-r--r--spec/build/bsps/m68k/mrm332/tstmrm332.yml2
-rw-r--r--spec/build/bsps/m68k/mvme147/bspmvme147.yml3
-rw-r--r--spec/build/bsps/m68k/mvme147s/bspmvme147s.yml3
-rw-r--r--spec/build/bsps/m68k/mvme162/grp.yml2
-rw-r--r--spec/build/bsps/m68k/mvme162/obj.yml1
-rw-r--r--spec/build/bsps/m68k/mvme167/bspmvme167.yml3
-rw-r--r--spec/build/bsps/m68k/uC5282/bspuc5282.yml3
-rw-r--r--spec/build/bsps/microblaze/microblaze_fpga/grp.yml2
-rw-r--r--spec/build/bsps/microblaze/microblaze_fpga/obj.yml1
-rw-r--r--spec/build/bsps/mips/csb350/bspcsb350.yml3
-rw-r--r--spec/build/bsps/mips/hurricane/bsphurricane.yml3
-rw-r--r--spec/build/bsps/mips/jmr3904/bspjmr3904.yml3
-rw-r--r--spec/build/bsps/mips/malta/bspmalta.yml5
-rw-r--r--spec/build/bsps/mips/rbtx4925/bsprbtx4925.yml3
-rw-r--r--spec/build/bsps/mips/rbtx4938/bsprbtx4938.yml3
-rw-r--r--spec/build/bsps/moxie/moxiesim/bspmoxiesim.yml5
-rw-r--r--spec/build/bsps/nios2/nios2_iss/bspnios2iss.yml3
-rw-r--r--spec/build/bsps/objmem.yml16
-rw-r--r--spec/build/bsps/optconsolebaud.yml1
-rw-r--r--spec/build/bsps/or1k/generic_or1k/bspgenericor1k.yml3
-rw-r--r--spec/build/bsps/powerpc/beatnik/bspbeatnik.yml3
-rw-r--r--spec/build/bsps/powerpc/gen5200/grp.yml2
-rw-r--r--spec/build/bsps/powerpc/gen5200/obj.yml1
-rw-r--r--spec/build/bsps/powerpc/gen83xx/grp.yml2
-rw-r--r--spec/build/bsps/powerpc/gen83xx/obj.yml1
-rw-r--r--spec/build/bsps/powerpc/haleakala/abi.yml18
-rw-r--r--spec/build/bsps/powerpc/haleakala/bsphaleakala.yml71
-rw-r--r--spec/build/bsps/powerpc/haleakala/optsprg.yml15
-rw-r--r--spec/build/bsps/powerpc/haleakala/optvecbase.yml16
-rw-r--r--spec/build/bsps/powerpc/haleakala/start.yml14
-rw-r--r--spec/build/bsps/powerpc/motorola_powerpc/grp.yml2
-rw-r--r--spec/build/bsps/powerpc/motorola_powerpc/obj.yml1
-rw-r--r--spec/build/bsps/powerpc/mpc55xxevb/obj.yml2
-rw-r--r--spec/build/bsps/powerpc/mpc8260ads/bspmpc8260ads.yml3
-rw-r--r--spec/build/bsps/powerpc/mvme3100/bspmvme3100.yml3
-rw-r--r--spec/build/bsps/powerpc/mvme5500/bspmvme5500.yml3
-rw-r--r--spec/build/bsps/powerpc/objmem.yml16
-rw-r--r--spec/build/bsps/powerpc/psim/bsppsim.yml3
-rw-r--r--spec/build/bsps/powerpc/qemuppc/bspqemuppc.yml3
-rw-r--r--spec/build/bsps/powerpc/qoriq/obj.yml2
-rw-r--r--spec/build/bsps/powerpc/ss555/bspss555.yml3
-rw-r--r--spec/build/bsps/powerpc/t32mppc/bspt32mppc.yml5
-rw-r--r--spec/build/bsps/powerpc/tqm8xx/obj.yml2
-rw-r--r--spec/build/bsps/powerpc/virtex/bspvirtex.yml3
-rw-r--r--spec/build/bsps/powerpc/virtex4/bspvirtex4.yml3
-rw-r--r--spec/build/bsps/powerpc/virtex5/bspvirtex5.yml3
-rw-r--r--spec/build/bsps/riscv/griscv/grp.yml2
-rw-r--r--spec/build/bsps/riscv/griscv/obj.yml3
-rw-r--r--spec/build/bsps/riscv/riscv/grp.yml2
-rw-r--r--spec/build/bsps/riscv/riscv/obj.yml1
-rw-r--r--spec/build/bsps/sh/gensh1/bspgensh1.yml3
-rw-r--r--spec/build/bsps/sh/gensh2/bspgensh2.yml3
-rw-r--r--spec/build/bsps/sh/gensh4/bspgensh4.yml3
-rw-r--r--spec/build/bsps/sh/shsim/grp.yml2
-rw-r--r--spec/build/bsps/sh/shsim/obj.yml3
-rw-r--r--spec/build/bsps/sparc/erc32/bsperc32.yml3
-rw-r--r--spec/build/bsps/sparc/leon2/grp.yml2
-rw-r--r--spec/build/bsps/sparc/leon2/obj.yml1
-rw-r--r--spec/build/bsps/sparc/leon3/grp.yml2
-rw-r--r--spec/build/bsps/sparc/leon3/obj.yml1
-rw-r--r--spec/build/bsps/sparc/objmem.yml16
-rw-r--r--spec/build/bsps/sparc64/niagara/bspniagara.yml5
-rw-r--r--spec/build/bsps/sparc64/usiii/bspusiii.yml5
-rw-r--r--spec/build/bsps/tst-xfail-dl06.yml13
-rw-r--r--spec/build/bsps/v850/gdbv850sim/grp.yml2
-rw-r--r--spec/build/bsps/v850/gdbv850sim/obj.yml3
-rw-r--r--spec/build/bsps/x86_64/amd64/bspamd64.yml5
-rw-r--r--spec/build/cpukit/cpuaarch64.yml1
-rw-r--r--spec/build/cpukit/cpuopts.yml2
-rw-r--r--spec/build/cpukit/libdebugger.yml2
-rw-r--r--spec/build/cpukit/librtemscpu.yml19
-rw-r--r--spec/build/cpukit/librtemstest.yml6
-rw-r--r--spec/build/cpukit/objdbgaarch64.yml15
-rw-r--r--spec/build/cpukit/objexceptionmapping.yml15
-rw-r--r--spec/build/cpukit/objmpci.yml1
-rw-r--r--spec/build/cpukit/objsmp.yml1
-rw-r--r--spec/build/cpukit/optexceptionextensions.yml18
-rw-r--r--spec/build/cpukit/optlibdebugger.yml1
-rw-r--r--spec/build/cpukit/optvermaj.yml2
-rw-r--r--spec/build/testsuites/psxtests/grp.yml2
-rw-r--r--spec/build/testsuites/psxtests/psxsignal09.yml22
-rw-r--r--spec/build/testsuites/sptests/grp.yml2
-rw-r--r--spec/build/testsuites/sptests/spfatal35.yml20
-rw-r--r--testsuites/aclocal/canonical-target-name.m425
-rw-r--r--testsuites/aclocal/canonicalize-tools.m420
-rw-r--r--testsuites/aclocal/check-cpuopts.m421
-rw-r--r--testsuites/aclocal/check-custom-bsp.m422
-rw-r--r--testsuites/aclocal/check-cxx.m420
-rw-r--r--testsuites/aclocal/check-tool.m49
-rw-r--r--testsuites/aclocal/enable-cxx.m411
-rw-r--r--testsuites/aclocal/enable-tests.m411
-rw-r--r--testsuites/aclocal/env-rtemsbsp.m427
-rw-r--r--testsuites/aclocal/gcc-specs.m416
-rw-r--r--testsuites/aclocal/prog-cc.m440
-rw-r--r--testsuites/aclocal/prog-cxx.m449
-rw-r--r--testsuites/aclocal/project-root.m47
-rw-r--r--testsuites/aclocal/rtems-bsp-includes.m413
-rw-r--r--testsuites/aclocal/rtems-bsp-linkcmds.m425
-rw-r--r--testsuites/aclocal/rtems-build-top.m412
-rw-r--r--testsuites/aclocal/rtems-includes.m423
-rw-r--r--testsuites/aclocal/rtems-source-top.m48
-rw-r--r--testsuites/aclocal/rtems-test-check.m431
-rw-r--r--testsuites/aclocal/rtems-top.m483
-rw-r--r--testsuites/aclocal/version.m44
-rw-r--r--testsuites/ada/aclocal/prog-gnat.m444
-rw-r--r--testsuites/libtests/POSIX/calloc.c4
-rw-r--r--testsuites/libtests/dl10/init.c33
-rw-r--r--testsuites/libtests/libfdt01/some.c4
-rw-r--r--testsuites/libtests/malloc04/init.c37
-rw-r--r--testsuites/libtests/malloctest/task1.c2
-rw-r--r--testsuites/libtests/ofw01/init.c16
-rw-r--r--testsuites/libtests/ofw01/some.c4
-rw-r--r--testsuites/libtests/stackchk/task1.c2
-rw-r--r--testsuites/libtests/tar01/init.c199
-rw-r--r--testsuites/libtests/tar01/tar01.doc1
-rw-r--r--testsuites/libtests/tar01/tar01.scn54
-rw-r--r--testsuites/libtests/tar01/tar01.tarbin10240 -> 10240 bytes
-rw-r--r--testsuites/mptests/mp01/task1.c2
-rw-r--r--testsuites/mptests/mp03/task1.c2
-rw-r--r--testsuites/mptests/mp04/task1.c2
-rw-r--r--testsuites/psxtests/psxsignal09/init.c73
-rw-r--r--testsuites/psxtests/psxsignal09/psxsignal09.doc7
-rw-r--r--testsuites/psxtests/psxsignal09/psxsignal09.scn3
-rw-r--r--testsuites/psxtests/psxsignal09/system.h55
-rw-r--r--testsuites/samples/base_mp/apptask.c2
-rw-r--r--testsuites/samples/base_sp/apptask.c2
-rw-r--r--testsuites/samples/ticker/tasks.c2
-rw-r--r--testsuites/smptests/smp08/tasks.c2
-rw-r--r--testsuites/smptests/smpaffinity01/init.c2
-rw-r--r--testsuites/smptests/smpscheduler02/init.c2
-rw-r--r--testsuites/sptests/sp19/first.c2
-rw-r--r--testsuites/sptests/sp19/fptask.c2
-rw-r--r--testsuites/sptests/sp19/task1.c2
-rw-r--r--testsuites/sptests/sp24/task1.c2
-rw-r--r--testsuites/sptests/sp30/task1.c2
-rw-r--r--testsuites/sptests/sp42/init.c2
-rw-r--r--testsuites/sptests/sp76/init.c2
-rw-r--r--testsuites/sptests/spcbssched01/task1.c2
-rw-r--r--testsuites/sptests/spchain/init.c8
-rw-r--r--testsuites/sptests/spedfsched01/task1.c2
-rw-r--r--testsuites/sptests/spfatal35/init.c89
-rw-r--r--testsuites/sptests/spfatal35/spfatal35.doc7
-rw-r--r--testsuites/sptests/spfatal35/spfatal35.scn2
-rw-r--r--testsuites/sptests/spintrcritical08/init.c13
-rw-r--r--testsuites/sptests/spintrcritical09/init.c2
-rw-r--r--testsuites/sptests/spintrcritical10/init.c9
-rw-r--r--testsuites/sptests/spintrcritical21/init.c16
-rw-r--r--testsuites/sptests/spintrcritical22/init.c2
-rw-r--r--testsuites/sptests/spsimplesched01/init.c2
-rw-r--r--testsuites/sptests/spsimplesched02/init.c2
-rw-r--r--testsuites/sptests/sptask_err04/task1.c4
-rw-r--r--testsuites/sptests/sptimecounter01/init.c12
-rwxr-xr-xwscript61
537 files changed, 13733 insertions, 9086 deletions
diff --git a/bsps/aarch64/include/bsp/aarch64-mmu.h b/bsps/aarch64/include/bsp/aarch64-mmu.h
index a5f6e846f3..b1a471d534 100644
--- a/bsps/aarch64/include/bsp/aarch64-mmu.h
+++ b/bsps/aarch64/include/bsp/aarch64-mmu.h
@@ -42,50 +42,12 @@
#include <rtems/score/aarch64-system-registers.h>
#include <bspopts.h>
#include <bsp/utility.h>
+#include <libcpu/mmu-vmsav8-64.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-/* VMSAv8 Long-descriptor fields */
-#define MMU_DESC_AF BSP_BIT64( 10 )
-#define MMU_DESC_SH_INNER ( BSP_BIT64( 9 ) | BSP_BIT64( 8 ) )
-#define MMU_DESC_WRITE_DISABLE BSP_BIT64( 7 )
-/* PAGE and TABLE flags are the same bit, but only apply on certain levels */
-#define MMU_DESC_TYPE_TABLE BSP_BIT64( 1 )
-#define MMU_DESC_TYPE_PAGE BSP_BIT64( 1 )
-#define MMU_DESC_VALID BSP_BIT64( 0 )
-#define MMU_DESC_MAIR_ATTR( val ) BSP_FLD64( val, 2, 3 )
-#define MMU_DESC_MAIR_ATTR_GET( reg ) BSP_FLD64GET( reg, 2, 3 )
-#define MMU_DESC_MAIR_ATTR_SET( reg, val ) BSP_FLD64SET( reg, val, 2, 3 )
-#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 ) )
-
typedef struct {
uintptr_t begin;
uintptr_t end;
@@ -284,6 +246,15 @@ BSP_START_TEXT_SECTION static inline rtems_status_code aarch64_mmu_map_block(
} else {
/* block starts on a boundary, but is short */
chunk_size = size;
+
+ /* it isn't possible to go beyond page table level 2 */
+ if ( page_flag ) {
+ /* no sub-table, apply block properties */
+ page_table[index] = addr | flags | page_flag;
+ size -= chunk_size;
+ addr += chunk_size;
+ continue;
+ }
}
} else {
uintptr_t block_top = RTEMS_ALIGN_UP( addr, granularity );
@@ -400,6 +371,17 @@ aarch64_mmu_enable( void )
_AArch64_Write_sctlr_el1( sctlr );
}
+BSP_START_TEXT_SECTION static inline void
+aarch64_mmu_disable( void )
+{
+ uint64_t sctlr;
+
+ /* Enable MMU and cache */
+ sctlr = _AArch64_Read_sctlr_el1();
+ sctlr &= ~(AARCH64_SCTLR_EL1_M);
+ _AArch64_Write_sctlr_el1( sctlr );
+}
+
BSP_START_TEXT_SECTION static inline void aarch64_mmu_setup( void )
{
/* Set TCR */
diff --git a/bsps/aarch64/include/dev/irq/arm-gic-arch.h b/bsps/aarch64/include/dev/irq/arm-gic-arch.h
index 0911320851..f1b6fdc03d 100644
--- a/bsps/aarch64/include/dev/irq/arm-gic-arch.h
+++ b/bsps/aarch64/include/dev/irq/arm-gic-arch.h
@@ -49,8 +49,10 @@ extern "C" {
static inline void arm_interrupt_handler_dispatch(rtems_vector_number vector)
{
uint32_t interrupt_level = _CPU_ISR_Get_level();
- AArch64_interrupt_enable(1);
+ /* Enable interrupts for nesting */
+ _CPU_ISR_Set_level(0);
bsp_interrupt_handler_dispatch(vector);
+ /* Restore interrupts to previous level */
_CPU_ISR_Set_level(interrupt_level);
}
diff --git a/bsps/aarch64/shared/cache/cache.c b/bsps/aarch64/shared/cache/cache.c
index 9e7446a077..fc1766c2b9 100644
--- a/bsps/aarch64/shared/cache/cache.c
+++ b/bsps/aarch64/shared/cache/cache.c
@@ -47,8 +47,6 @@
#define CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS
-#define CPU_CACHE_SUPPORT_PROVIDES_DISABLE_DATA
-
#define AARCH64_CACHE_L1_CPU_DATA_ALIGNMENT ( (size_t) 64 )
#define AARCH64_CACHE_PREPARE_MVA(mva) (const void *) \
RTEMS_ALIGN_DOWN ( (size_t) mva, AARCH64_CACHE_L1_CPU_DATA_ALIGNMENT )
diff --git a/bsps/aarch64/shared/mmu/vmsav8-64-nommu.c b/bsps/aarch64/shared/mmu/vmsav8-64-nommu.c
new file mode 100644
index 0000000000..2c793fa239
--- /dev/null
+++ b/bsps/aarch64/shared/mmu/vmsav8-64-nommu.c
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSBSPsAArch64Shared
+ *
+ * @brief AArch64 MMU dummy implementation.
+ */
+
+/*
+ * 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.
+ */
+
+#include <libcpu/mmu-vmsav8-64.h>
+
+/*
+ * This must have a non-header implementation because it is used by libdebugger.
+ */
+rtems_status_code aarch64_mmu_map(
+ uintptr_t addr,
+ uint64_t size,
+ uint64_t flags
+)
+{
+ return RTEMS_SUCCESSFUL;
+}
diff --git a/bsps/aarch64/shared/mmu/vmsav8-64.c b/bsps/aarch64/shared/mmu/vmsav8-64.c
new file mode 100644
index 0000000000..9caa91c414
--- /dev/null
+++ b/bsps/aarch64/shared/mmu/vmsav8-64.c
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSBSPsAArch64Shared
+ *
+ * @brief AArch64 MMU implementation.
+ */
+
+/*
+ * 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.
+ */
+
+#include <bsp/aarch64-mmu.h>
+#include <rtems/score/cpu.h>
+
+/*
+ * This must have a non-header implementation because it is used by libdebugger.
+ */
+rtems_status_code aarch64_mmu_map(
+ uintptr_t addr,
+ uint64_t size,
+ uint64_t flags
+)
+{
+ rtems_status_code sc;
+
+ aarch64_mmu_disable();
+ sc = aarch64_mmu_map_block(
+ (uint64_t *) bsp_translation_table_base,
+ 0x0,
+ addr,
+ size,
+ 0,
+ flags
+ );
+ _AARCH64_Data_synchronization_barrier();
+ __asm__ volatile(
+ "tlbi vmalle1\n"
+ );
+ _AARCH64_Data_synchronization_barrier();
+ _AARCH64_Instruction_synchronization_barrier();
+ aarch64_mmu_enable();
+
+ return sc;
+}
diff --git a/bsps/aarch64/shared/start/linkcmds.base b/bsps/aarch64/shared/start/linkcmds.base
index a560b1016e..d3b5485777 100644
--- a/bsps/aarch64/shared/start/linkcmds.base
+++ b/bsps/aarch64/shared/start/linkcmds.base
@@ -321,6 +321,13 @@ SECTIONS {
} > REGION_WORK AT > REGION_WORK
bsp_section_rtemsstack_size = bsp_section_rtemsstack_end - bsp_section_rtemsstack_begin;
+ .noinit (NOLOAD) : ALIGN_WITH_INPUT {
+ bsp_section_noinit_begin = .;
+ *(.noinit*)
+ bsp_section_noinit_end = .;
+ } > REGION_WORK AT > REGION_WORK
+ bsp_section_noinit_size = bsp_section_noinit_end - bsp_section_noinit_begin;
+
.work : ALIGN_WITH_INPUT {
/*
* The work section will occupy the remaining REGION_WORK region and
diff --git a/bsps/aarch64/shared/start/start.S b/bsps/aarch64/shared/start/start.S
index bc6a855217..8bd4f86f4e 100644
--- a/bsps/aarch64/shared/start/start.S
+++ b/bsps/aarch64/shared/start/start.S
@@ -55,6 +55,11 @@ _start:
mov x5, x1 /* machine type number or ~0 for DT boot */
mov x6, x2 /* physical address of ATAGs or DTB */
#else /* BSP_START_NEEDS_REGISTER_INITIALIZATION */
+ /*
+ * This block is dead code. No aarch64 targets require this. It might be
+ * needed for hardware simulations or in future processor variants with
+ * lock-step cores.
+ */
mov x0, XZR
mov x1, XZR
mov x2, XZR
@@ -87,8 +92,42 @@ _start:
mov x29, XZR
mov x30, XZR
#ifdef AARCH64_MULTILIB_VFP
-#endif
-#endif
+ mov CPTR_EL3, XZR
+ mov CPTR_EL2, XZR
+ mov d0, XZR
+ mov d1, XZR
+ mov d2, XZR
+ mov d3, XZR
+ mov d4, XZR
+ mov d5, XZR
+ mov d6, XZR
+ mov d7, XZR
+ mov d8, XZR
+ mov d9, XZR
+ mov d10, XZR
+ mov d11, XZR
+ mov d12, XZR
+ mov d13, XZR
+ mov d14, XZR
+ mov d15, XZR
+ mov d16, XZR
+ mov d17, XZR
+ mov d18, XZR
+ mov d19, XZR
+ mov d20, XZR
+ mov d21, XZR
+ mov d22, XZR
+ mov d23, XZR
+ mov d24, XZR
+ mov d25, XZR
+ mov d26, XZR
+ mov d27, XZR
+ mov d28, XZR
+ mov d29, XZR
+ mov d30, XZR
+ mov d31, XZR
+#endif /* AARCH64_MULTILIB_VFP */
+#endif /* BSP_START_NEEDS_REGISTER_INITIALIZATION */
/* Initialize SCTLR_EL1 */
mov x0, XZR
@@ -105,6 +144,33 @@ _start:
b.eq _el2_start
_el3_start:
+ /*
+ * Before leaving the Secure World, we need to initialize the GIC. We
+ * do that here in an early stack context in EL3. This will NOT work
+ * on secondary core boot! We assume only the primary boot core will
+ * start in EL3 if any. Usually on real hardware, we should be running
+ * on top of trusted firmware and will not boot in EL3. Qemu fakes it
+ * for us and will start the primary core in EL3 and secondary cores
+ * will be brought up in EL1NS as expected.
+ */
+ #ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
+ ldr w1, =_ISR_Stack_size
+ ldr w2, =_ISR_Stack_area_begin
+ #else
+ ldr x1, =_ISR_Stack_size
+ ldr x2, =_ISR_Stack_area_begin
+ #endif
+ add x3, x1, x2
+ /* using SP0 for the early init stack context at EL3 */
+ msr spsel, #0
+ mov sp, x3
+
+ /*
+ * Invoke the start hook 0.
+ * We don't set up exception handling, so this hook better behave.
+ */
+ bl bsp_start_hook_0
+
/* Drop from EL3 to EL2 */
/* Initialize HCR_EL2 and SCTLR_EL2 */
@@ -114,27 +180,16 @@ _el3_start:
mrs x0, SCR_EL3
/* Set EL2 to AArch64 */
orr x0, x0, #(1<<10)
-#ifdef AARCH64_IS_NONSECURE
/* Set EL1 to NS */
orr x0, x0, #1
-#endif
msr SCR_EL3, x0
/* set EL2h mode for eret */
-#ifdef AARCH64_IS_NONSECURE
mov x0, #0b01001
-#else
- mov x0, #0b00101
-#endif
-
msr SPSR_EL3, x0
/* Set EL2 entry point */
-#ifdef AARCH64_IS_NONSECURE
adr x0, _el2_start
-#else
- adr x0, _el1_start
-#endif
msr ELR_EL3, x0
eret
@@ -201,8 +256,8 @@ _el1_start:
#endif
add x3, x1, x2
- /* Disable interrupts */
- msr DAIFSet, #0x2
+ /* Disable interrupts and debug */
+ msr DAIFSet, #0xa
#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
mov x8, XZR
@@ -252,54 +307,8 @@ _el1_start:
/* FPU does not need to be enabled on AArch64 */
-#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
- mov x0, #0
- mov CPTR_EL3, XZR
- mov CPTR_EL2, XZR
- mov d0, XZR
- mov d1, XZR
- mov d2, XZR
- mov d3, XZR
- mov d4, XZR
- mov d5, XZR
- mov d6, XZR
- mov d7, XZR
- mov d8, XZR
- mov d9, XZR
- mov d10, XZR
- mov d11, XZR
- mov d12, XZR
- mov d13, XZR
- mov d14, XZR
- mov d15, XZR
- mov d16, XZR
- mov d17, XZR
- mov d18, XZR
- mov d19, XZR
- mov d20, XZR
- mov d21, XZR
- mov d22, XZR
- mov d23, XZR
- mov d24, XZR
- mov d25, XZR
- mov d26, XZR
- mov d27, XZR
- mov d28, XZR
- mov d29, XZR
- mov d30, XZR
- mov d31, XZR
-#endif /* BSP_START_NEEDS_REGISTER_INITIALIZATION */
-
#endif /* AARCH64_MULTILIB_VFP */
- /*
- * Invoke the start hook 0.
- *
- */
-
- mov x1, x5 /* machine type number or ~0 for DT boot */
- bl bsp_start_hook_0
-
/* Branch to start hook 1 */
bl bsp_start_hook_1
diff --git a/bsps/aarch64/xilinx-versal/start/bspstarthooks.c b/bsps/aarch64/xilinx-versal/start/bspstarthooks.c
index be98675a24..71d161125b 100644
--- a/bsps/aarch64/xilinx-versal/start/bspstarthooks.c
+++ b/bsps/aarch64/xilinx-versal/start/bspstarthooks.c
@@ -35,11 +35,12 @@
*/
#include <bsp.h>
+#include <bsp/irq-generic.h>
#include <bsp/start.h>
BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
{
- /* Do nothing */
+ bsp_interrupt_facility_initialize();
}
BSP_START_TEXT_SECTION void bsp_start_hook_1(void)
diff --git a/bsps/aarch64/xilinx-versal/start/bspstartmmu.c b/bsps/aarch64/xilinx-versal/start/bspstartmmu.c
index 8b622aec7d..5949111d0d 100644
--- a/bsps/aarch64/xilinx-versal/start/bspstartmmu.c
+++ b/bsps/aarch64/xilinx-versal/start/bspstartmmu.c
@@ -36,6 +36,7 @@
#include <bsp.h>
#include <bsp/start.h>
#include <bsp/aarch64-mmu.h>
+#include <libcpu/mmu-vmsav8-64.h>
BSP_START_DATA_SECTION static const aarch64_mmu_config_entry
versal_mmu_config_table[] = {
diff --git a/bsps/aarch64/xilinx-zynqmp/start/bspstarthooks.c b/bsps/aarch64/xilinx-zynqmp/start/bspstarthooks.c
index ad688088e5..14f2bcc280 100644
--- a/bsps/aarch64/xilinx-zynqmp/start/bspstarthooks.c
+++ b/bsps/aarch64/xilinx-zynqmp/start/bspstarthooks.c
@@ -47,6 +47,11 @@
BSP_START_TEXT_SECTION void bsp_start_hook_0( void )
{
+ /* do nothing */
+}
+
+BSP_START_TEXT_SECTION void bsp_start_hook_1( void )
+{
#ifdef RTEMS_SMP
uint32_t cpu_index_self;
@@ -72,13 +77,10 @@ BSP_START_TEXT_SECTION void bsp_start_hook_0( void )
_SMP_Start_multitasking_on_secondary_processor(
_Per_CPU_Get_by_index( cpu_index_self )
);
+ /* Unreached */
}
+#endif /* RTEMS_SMP */
-#endif
-}
-
-BSP_START_TEXT_SECTION void bsp_start_hook_1( void )
-{
AArch64_start_set_vector_base();
bsp_start_copy_sections();
zynqmp_setup_mmu_and_cache();
diff --git a/bsps/aarch64/xilinx-zynqmp/start/bspstartmmu.c b/bsps/aarch64/xilinx-zynqmp/start/bspstartmmu.c
index 09012c9db5..33ca1eafab 100644
--- a/bsps/aarch64/xilinx-zynqmp/start/bspstartmmu.c
+++ b/bsps/aarch64/xilinx-zynqmp/start/bspstartmmu.c
@@ -37,6 +37,7 @@
#include <bsp.h>
#include <bsp/start.h>
#include <bsp/aarch64-mmu.h>
+#include <libcpu/mmu-vmsav8-64.h>
BSP_START_DATA_SECTION static const aarch64_mmu_config_entry
zynqmp_mmu_config_table[] = {
diff --git a/bsps/arm/altera-cyclone-v/start/bsp_specs b/bsps/arm/altera-cyclone-v/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/altera-cyclone-v/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/atsam/console/console.c b/bsps/arm/atsam/console/console.c
index d51d2ace7d..5ef4327e11 100644
--- a/bsps/arm/atsam/console/console.c
+++ b/bsps/arm/atsam/console/console.c
@@ -16,6 +16,7 @@
#include <bsp/irq.h>
#include <bsp/fatal.h>
#include <rtems/console.h>
+#include <rtems/seterr.h>
#include <rtems/termiostypes.h>
@@ -23,274 +24,92 @@
#include <unistd.h>
+#define UART_RX_DMA_BUF_SIZE 32l
+
+typedef struct {
+ char buf[UART_RX_DMA_BUF_SIZE];
+ LinkedListDescriporView3 desc;
+} atsam_uart_rx_dma;
+
typedef struct {
rtems_termios_device_context base;
- Usart *regs;
+ Uart *regs;
rtems_vector_number irq;
uint32_t id;
bool console;
+ bool is_usart;
#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
bool transmitting;
+ bool rx_dma_enabled;
+ uint32_t rx_dma_channel;
+ atsam_uart_rx_dma *rx_dma;
+ char *volatile*rx_dma_da;
+ char *rx_next_read_pos;
#endif
-} atsam_usart_context;
+} atsam_uart_context;
-static atsam_usart_context atsam_usart_instances[] = {
+static atsam_uart_context atsam_usart_instances[] = {
{
- .regs = USART0,
+ .regs = (Uart *)USART0,
.irq = USART0_IRQn,
- .id = ID_USART0
+ .id = ID_USART0,
+ .is_usart = true,
}
#ifdef USART1
, {
- .regs = USART1,
+ .regs = (Uart *)USART1,
.irq = USART1_IRQn,
- .id = ID_USART1
+ .id = ID_USART1,
+ .is_usart = true,
}
#endif
#ifdef USART2
, {
- .regs = USART2,
+ .regs = (Uart *)USART2,
.irq = USART2_IRQn,
- .id = ID_USART2
- }
-#endif
-};
-
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
-static void atsam_usart_interrupt(void *arg)
-{
- rtems_termios_tty *tty = arg;
- atsam_usart_context *ctx = rtems_termios_get_device_context(tty);
- Usart *regs = ctx->regs;
- uint32_t csr = regs->US_CSR;
-
- while ((csr & US_CSR_RXRDY) != 0) {
- char c = (char) regs->US_RHR;
-
- rtems_termios_enqueue_raw_characters(tty, &c, 1);
-
- csr = regs->US_CSR;
- }
-
- if (ctx->transmitting && (csr & US_CSR_TXEMPTY) != 0) {
- rtems_termios_dequeue_characters(tty, 1);
- }
-}
-#endif
-
-static bool atsam_usart_set_attributes(
- rtems_termios_device_context *base,
- const struct termios *term
-)
-{
- atsam_usart_context *ctx = (atsam_usart_context *) base;
- Usart *regs = ctx->regs;
- rtems_termios_baud_t baud;
- uint32_t mr;
-
- baud = rtems_termios_baud_to_number(term->c_ospeed);
- regs->US_BRGR = (BOARD_MCK / baud) / 16;
-
- if ((term->c_cflag & CREAD) != 0) {
- regs->US_CR = US_CR_RXEN | US_CR_TXEN;
- } else {
- regs->US_CR = US_CR_TXEN;
- }
-
- mr = US_MR_USART_MODE_NORMAL | US_MR_USCLKS_MCK;
-
- switch (term->c_cflag & CSIZE) {
- case CS5:
- mr |= US_MR_CHRL_5_BIT;
- break;
- case CS6:
- mr |= US_MR_CHRL_6_BIT;
- break;
- case CS7:
- mr |= US_MR_CHRL_7_BIT;
- break;
- default:
- mr |= US_MR_CHRL_8_BIT;
- break;
- }
-
- if ((term->c_cflag & PARENB) != 0) {
- if ((term->c_cflag & PARODD) != 0) {
- mr |= US_MR_PAR_ODD;
- } else {
- mr |= US_MR_PAR_EVEN;
- }
- } else {
- mr |= US_MR_PAR_NO;
- }
-
- if ((term->c_cflag & CSTOPB) != 0) {
- mr |= US_MR_NBSTOP_2_BIT;
- } else {
- mr |= US_MR_NBSTOP_1_BIT;
- }
-
- regs->US_MR = mr;
-
- return true;
-}
-
-static bool atsam_usart_first_open(
- rtems_termios_tty *tty,
- rtems_termios_device_context *base,
- struct termios *term,
- rtems_libio_open_close_args_t *args
-)
-{
- atsam_usart_context *ctx = (atsam_usart_context *) base;
- Usart *regs = ctx->regs;
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
- rtems_status_code sc;
-#endif
-
- regs->US_CR = US_CR_RSTRX | US_CR_RSTTX | US_CR_RSTSTA;
- regs->US_IDR = 0xffffffff;
-
- PMC_EnablePeripheral(ctx->id);
-
- rtems_termios_set_initial_baud(tty, ATSAM_CONSOLE_BAUD);
- atsam_usart_set_attributes(base, term);
-
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
- regs->US_IER = US_IDR_RXRDY;
- sc = rtems_interrupt_handler_install(
- ctx->irq,
- "USART",
- RTEMS_INTERRUPT_SHARED,
- atsam_usart_interrupt,
- tty
- );
- if (sc != RTEMS_SUCCESSFUL) {
- return false;
- }
-#endif
-
- return true;
-}
-
-static void atsam_usart_last_close(
- rtems_termios_tty *tty,
- rtems_termios_device_context *base,
- rtems_libio_open_close_args_t *args
-)
-{
- atsam_usart_context *ctx = (atsam_usart_context *) base;
-
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
- rtems_interrupt_handler_remove(ctx->irq, atsam_usart_interrupt, tty);
-#endif
-
- if (!ctx->console) {
- PMC_DisablePeripheral(ctx->id);
- }
-}
-
-static void atsam_usart_write(
- rtems_termios_device_context *base,
- const char *buf,
- size_t len
-)
-{
- atsam_usart_context *ctx = (atsam_usart_context *) base;
- Usart *regs = ctx->regs;
-
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
- if (len > 0) {
- ctx->transmitting = true;
- regs->US_THR = buf[0];
- regs->US_IER = US_IDR_TXEMPTY;
- } else {
- ctx->transmitting = false;
- regs->US_IDR = US_IDR_TXEMPTY;
- }
-#else
- size_t i;
-
- for (i = 0; i < len; ++i) {
- while ((regs->US_CSR & US_CSR_TXEMPTY) == 0) {
- /* Wait */
- }
-
- regs->US_THR = buf[i];
- }
-#endif
-}
-
-#ifndef ATSAM_CONSOLE_USE_INTERRUPTS
-static int atsam_usart_read(rtems_termios_device_context *base)
-{
- atsam_usart_context *ctx = (atsam_usart_context *) base;
- Usart *regs = ctx->regs;
-
- if ((regs->US_CSR & US_CSR_RXRDY) != 0) {
- return (char) regs->US_RHR;
- } else {
- return -1;
+ .id = ID_USART2,
+ .is_usart = true,
}
-}
-#endif
-
-static const rtems_termios_device_handler atsam_usart_handler = {
- .first_open = atsam_usart_first_open,
- .last_close = atsam_usart_last_close,
- .write = atsam_usart_write,
- .set_attributes = atsam_usart_set_attributes,
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
- .mode = TERMIOS_IRQ_DRIVEN
-#else
- .poll_read = atsam_usart_read,
- .mode = TERMIOS_POLLED
#endif
};
-typedef struct {
- rtems_termios_device_context base;
- Uart *regs;
- rtems_vector_number irq;
- uint32_t id;
- bool console;
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
- bool transmitting;
-#endif
-} atsam_uart_context;
-
static atsam_uart_context atsam_uart_instances[] = {
{
.regs = UART0,
.irq = UART0_IRQn,
- .id = ID_UART0
+ .id = ID_UART0,
+ .is_usart = false,
}
#ifdef UART1
, {
.regs = UART1,
.irq = UART1_IRQn,
- .id = ID_UART1
+ .id = ID_UART1,
+ .is_usart = false,
}
#endif
#ifdef UART2
, {
.regs = UART2,
.irq = UART2_IRQn,
- .id = ID_UART2
+ .id = ID_UART2,
+ .is_usart = false,
}
#endif
#ifdef UART3
, {
.regs = UART3,
.irq = UART3_IRQn,
- .id = ID_UART3
+ .id = ID_UART3,
+ .is_usart = false,
}
#endif
#ifdef UART4
, {
.regs = UART4,
.irq = UART4_IRQn,
- .id = ID_UART4
+ .id = ID_UART4,
+ .is_usart = false,
}
#endif
};
@@ -303,12 +122,27 @@ static void atsam_uart_interrupt(void *arg)
Uart *regs = ctx->regs;
uint32_t sr = regs->UART_SR;
- while ((sr & UART_SR_RXRDY) != 0) {
- char c = (char) regs->UART_RHR;
+ if (!ctx->rx_dma_enabled) {
+ while ((sr & UART_SR_RXRDY) != 0) {
+ char c = (char) regs->UART_RHR;
+
+ rtems_termios_enqueue_raw_characters(tty, &c, 1);
+
+ sr = regs->UART_SR;
+ }
+ } else {
+ while (*ctx->rx_dma_da != ctx->rx_next_read_pos) {
+ char c;
+
+ c = *ctx->rx_next_read_pos;
- rtems_termios_enqueue_raw_characters(tty, &c, 1);
+ ++ctx->rx_next_read_pos;
+ if (ctx->rx_next_read_pos >= &ctx->rx_dma->buf[UART_RX_DMA_BUF_SIZE]) {
+ ctx->rx_next_read_pos = &ctx->rx_dma->buf[0];
+ }
- sr = regs->UART_SR;
+ rtems_termios_enqueue_raw_characters(tty, &c, 1);
+ }
}
if (ctx->transmitting && (sr & UART_SR_TXEMPTY) != 0) {
@@ -336,10 +170,31 @@ static bool atsam_uart_set_attributes(
regs->UART_CR = UART_CR_TXEN;
}
- mr = UART_MR_FILTER_DISABLED | UART_MR_BRSRCCK_PERIPH_CLK;
-
- if ((term->c_cflag & CSIZE) != CS8) {
- return false;
+ if (ctx->is_usart) {
+ mr = US_MR_USART_MODE_NORMAL | US_MR_USCLKS_MCK;
+ } else {
+ mr = UART_MR_FILTER_DISABLED | UART_MR_BRSRCCK_PERIPH_CLK;
+ }
+
+ if (ctx->is_usart) {
+ switch (term->c_cflag & CSIZE) {
+ case CS5:
+ mr |= US_MR_CHRL_5_BIT;
+ break;
+ case CS6:
+ mr |= US_MR_CHRL_6_BIT;
+ break;
+ case CS7:
+ mr |= US_MR_CHRL_7_BIT;
+ break;
+ default:
+ mr |= US_MR_CHRL_8_BIT;
+ break;
+ }
+ } else {
+ if ((term->c_cflag & CSIZE) != CS8) {
+ return false;
+ }
}
if ((term->c_cflag & PARENB) != 0) {
@@ -352,8 +207,16 @@ static bool atsam_uart_set_attributes(
mr |= UART_MR_PAR_NO;
}
- if ((term->c_cflag & CSTOPB) != 0) {
- return false;
+ if (ctx->is_usart) {
+ if ((term->c_cflag & CSTOPB) != 0) {
+ mr |= US_MR_NBSTOP_2_BIT;
+ } else {
+ mr |= US_MR_NBSTOP_1_BIT;
+ }
+ } else {
+ if ((term->c_cflag & CSTOPB) != 0) {
+ return false;
+ }
}
regs->UART_MR = mr;
@@ -361,6 +224,118 @@ static bool atsam_uart_set_attributes(
return true;
}
+static void atsam_uart_disable_rx_dma(atsam_uart_context *ctx)
+{
+ if (ctx->rx_dma) {
+ rtems_cache_coherent_free(ctx->rx_dma);
+ ctx->rx_dma = NULL;
+ }
+
+ if (ctx->rx_dma_channel != XDMAD_ALLOC_FAILED) {
+ XDMAD_FreeChannel(&XDMAD_Instance, ctx->rx_dma_channel);
+ }
+
+ ctx->rx_dma_enabled = false;
+}
+
+static rtems_status_code atsam_uart_enable_rx_dma(atsam_uart_context *ctx)
+{
+ eXdmadRC rc;
+ int channel_id;
+
+ if (ctx->rx_dma_enabled) {
+ return RTEMS_SUCCESSFUL;
+ }
+
+ /*
+ * Make sure everything is in a clean default state so that the cleanup works
+ * in an error case.
+ */
+ ctx->rx_dma = NULL;
+ ctx->rx_dma_channel = XDMAD_ALLOC_FAILED;
+
+ ctx->rx_dma = rtems_cache_coherent_allocate(sizeof(*ctx->rx_dma), 0, 0);
+ if (ctx->rx_dma == NULL) {
+ atsam_uart_disable_rx_dma(ctx);
+ return RTEMS_NO_MEMORY;
+ }
+
+ ctx->rx_next_read_pos = &ctx->rx_dma->buf[0];
+
+ ctx->rx_dma_channel = XDMAD_AllocateChannel(
+ &XDMAD_Instance,
+ XDMAD_TRANSFER_MEMORY,
+ ctx->id
+ );
+
+ if (ctx->rx_dma_channel == XDMAD_ALLOC_FAILED) {
+ atsam_uart_disable_rx_dma(ctx);
+ return RTEMS_IO_ERROR;
+ }
+
+ rc = XDMAD_PrepareChannel(&XDMAD_Instance, ctx->rx_dma_channel);
+ if (rc != XDMAD_OK) {
+ atsam_uart_disable_rx_dma(ctx);
+ return RTEMS_IO_ERROR;
+ }
+
+ channel_id = ctx->rx_dma_channel & 0xff;
+ ctx->rx_dma_da =
+ (char *volatile*) &XDMAD_Instance.pXdmacs->XDMAC_CHID[channel_id].XDMAC_CDA;
+
+ ctx->rx_dma->desc.mbr_nda = (uint32_t)&ctx->rx_dma->desc;
+ ctx->rx_dma->desc.mbr_ubc =
+ 1 |
+ XDMA_UBC_NVIEW_NDV3 |
+ XDMA_UBC_NDE_FETCH_EN |
+ XDMA_UBC_NDEN_UPDATED |
+ XDMA_UBC_NSEN_UPDATED;
+ ctx->rx_dma->desc.mbr_sa = (uint32_t) &ctx->regs->UART_RHR;
+ ctx->rx_dma->desc.mbr_da = (uint32_t) &ctx->rx_dma->buf[0];
+ ctx->rx_dma->desc.mbr_cfg =
+ XDMAC_CC_TYPE_PER_TRAN |
+ XDMAC_CC_MBSIZE_SINGLE |
+ XDMAC_CC_DSYNC_PER2MEM |
+ XDMAC_CC_SWREQ_HWR_CONNECTED |
+ XDMAC_CC_MEMSET_NORMAL_MODE |
+ XDMAC_CC_CSIZE_CHK_1 |
+ XDMAC_CC_DWIDTH_BYTE |
+ XDMAC_CC_SIF_AHB_IF1 |
+ XDMAC_CC_DIF_AHB_IF1 |
+ XDMAC_CC_SAM_FIXED_AM |
+ XDMAC_CC_DAM_UBS_AM |
+ XDMAC_CC_PERID(XDMAIF_Get_ChannelNumber(ctx->id, XDMAD_TRANSFER_RX));
+ ctx->rx_dma->desc.mbr_bc = UART_RX_DMA_BUF_SIZE - 1;
+ ctx->rx_dma->desc.mbr_ds = 0;
+ ctx->rx_dma->desc.mbr_sus = 0;
+ ctx->rx_dma->desc.mbr_dus = 0;
+
+ rc = XDMAD_ConfigureTransfer(
+ &XDMAD_Instance,
+ ctx->rx_dma_channel,
+ NULL,
+ XDMAC_CNDC_NDE_DSCR_FETCH_EN |
+ XDMAC_CNDC_NDVIEW_NDV3 |
+ XDMAC_CNDC_NDDUP_DST_PARAMS_UPDATED |
+ XDMAC_CNDC_NDSUP_SRC_PARAMS_UPDATED,
+ (uint32_t)&ctx->rx_dma->desc,
+ 0);
+ if (rc != XDMAD_OK) {
+ atsam_uart_disable_rx_dma(ctx);
+ return RTEMS_IO_ERROR;
+ }
+
+ rc = XDMAD_StartTransfer(&XDMAD_Instance, ctx->rx_dma_channel);
+ if (rc != XDMAD_OK) {
+ atsam_uart_disable_rx_dma(ctx);
+ return RTEMS_IO_ERROR;
+ }
+
+ ctx->rx_dma_enabled = true;
+
+ return RTEMS_SUCCESSFUL;
+}
+
static bool atsam_uart_first_open(
rtems_termios_tty *tty,
rtems_termios_device_context *base,
@@ -386,7 +361,7 @@ static bool atsam_uart_first_open(
regs->UART_IER = UART_IDR_RXRDY;
sc = rtems_interrupt_handler_install(
ctx->irq,
- "UART",
+ ctx->is_usart ? "USART" : "UART",
RTEMS_INTERRUPT_SHARED,
atsam_uart_interrupt,
tty
@@ -411,6 +386,10 @@ static void atsam_uart_last_close(
rtems_interrupt_handler_remove(ctx->irq, atsam_uart_interrupt, tty);
#endif
+ if (ctx->rx_dma_enabled) {
+ atsam_uart_disable_rx_dma(ctx);
+ }
+
if (!ctx->console) {
PMC_DisablePeripheral(ctx->id);
}
@@ -461,13 +440,41 @@ static int atsam_uart_read(rtems_termios_device_context *base)
}
#endif
+#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+static int atsam_uart_ioctl(
+ rtems_termios_device_context *base,
+ ioctl_command_t request,
+ void *buffer
+)
+{
+ atsam_uart_context *ctx = (atsam_uart_context *) base;
+ rtems_status_code sc;
+
+ switch (request) {
+ case ATSAM_UART_ENABLE_RX_DMA:
+ sc = atsam_uart_enable_rx_dma(ctx);
+ if (sc != RTEMS_SUCCESSFUL) {
+ rtems_set_errno_and_return_minus_one(EIO);
+ } else {
+ ctx->rx_dma_enabled = true;
+ }
+ break;
+ default:
+ rtems_set_errno_and_return_minus_one(EINVAL);
+ }
+
+ return 0;
+}
+#endif
+
static const rtems_termios_device_handler atsam_uart_handler = {
.first_open = atsam_uart_first_open,
.last_close = atsam_uart_last_close,
.write = atsam_uart_write,
.set_attributes = atsam_uart_set_attributes,
#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
- .mode = TERMIOS_IRQ_DRIVEN
+ .mode = TERMIOS_IRQ_DRIVEN,
+ .ioctl = atsam_uart_ioctl,
#else
.poll_read = atsam_uart_read,
.mode = TERMIOS_POLLED
@@ -490,7 +497,7 @@ rtems_status_code console_initialize(
usart[sizeof(usart) - 2] = (char) ('0' + i);
rtems_termios_device_install(
&usart[0],
- &atsam_usart_handler,
+ &atsam_uart_handler,
NULL,
&atsam_usart_instances[i].base
);
diff --git a/bsps/arm/atsam/include/bsp.h b/bsps/arm/atsam/include/bsp.h
index 2556f6046d..d1b021255c 100644
--- a/bsps/arm/atsam/include/bsp.h
+++ b/bsps/arm/atsam/include/bsp.h
@@ -33,6 +33,7 @@
#include <bspopts.h>
#include <bsp/default-initial-extension.h>
+#include <sys/ioccom.h>
#include <rtems.h>
@@ -109,6 +110,18 @@ void atsam_rtc_get_time(rtems_time_of_day *tod);
void bsp_restart( const void *const addr );
+/*
+ * This ioctl enables the receive DMA for an UART. The DMA can be usefull if you
+ * loose characters in high interrupt load situations.
+ *
+ * Disabling the DMA again is only possible by closing all file descriptors of
+ * that UART.
+ *
+ * Note that every UART needs one DMA channel and the system has only a limited
+ * amount of DMAs. So only use it if you need it.
+ */
+#define ATSAM_UART_ENABLE_RX_DMA _IO('d', 0)
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/bsps/arm/atsam/start/bsp_specs b/bsps/arm/atsam/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/atsam/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/beagle/start/bsp_specs b/bsps/arm/beagle/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/beagle/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/csb336/start/bsp_specs b/bsps/arm/csb336/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/csb336/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/csb337/start/bsp_specs b/bsps/arm/csb337/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/csb337/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/edb7312/start/bsp_specs b/bsps/arm/edb7312/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/edb7312/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/gumstix/start/bsp_specs b/bsps/arm/gumstix/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/gumstix/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/imx/start/bsp_specs b/bsps/arm/imx/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/imx/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/lm3s69xx/start/bsp_specs b/bsps/arm/lm3s69xx/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/lm3s69xx/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/lpc176x/start/bsp_specs b/bsps/arm/lpc176x/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/lpc176x/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/lpc24xx/start/bsp_specs b/bsps/arm/lpc24xx/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/lpc24xx/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/lpc32xx/start/bsp_specs b/bsps/arm/lpc32xx/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/lpc32xx/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/raspberrypi/start/bsp_specs b/bsps/arm/raspberrypi/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/raspberrypi/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/realview-pbx-a9/start/bsp_specs b/bsps/arm/realview-pbx-a9/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/realview-pbx-a9/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/rtl22xx/start/bsp_specs b/bsps/arm/rtl22xx/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/rtl22xx/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/smdk2410/start/bsp_specs b/bsps/arm/smdk2410/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/smdk2410/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/stm32f4/start/bsp_specs b/bsps/arm/stm32f4/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/stm32f4/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/stm32h7/start/bsp_specs b/bsps/arm/stm32h7/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/stm32h7/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/tms570/start/bsp_specs b/bsps/arm/tms570/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/tms570/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/xen/start/bsp_specs b/bsps/arm/xen/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/xen/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/xilinx-zynq/start/bsp_specs b/bsps/arm/xilinx-zynq/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/xilinx-zynq/start/bsp_specs
+++ /dev/null
diff --git a/bsps/arm/xilinx-zynqmp/start/bsp_specs b/bsps/arm/xilinx-zynqmp/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/arm/xilinx-zynqmp/start/bsp_specs
+++ /dev/null
diff --git a/bsps/bfin/TLL6527M/start/bsp_specs b/bsps/bfin/TLL6527M/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/bfin/TLL6527M/start/bsp_specs
+++ /dev/null
diff --git a/bsps/bfin/bf537Stamp/start/bsp_specs b/bsps/bfin/bf537Stamp/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/bfin/bf537Stamp/start/bsp_specs
+++ /dev/null
diff --git a/bsps/bfin/eZKit533/start/bsp_specs b/bsps/bfin/eZKit533/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/bfin/eZKit533/start/bsp_specs
+++ /dev/null
diff --git a/bsps/i386/pc386/start/bsp_specs b/bsps/i386/pc386/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/i386/pc386/start/bsp_specs
+++ /dev/null
diff --git a/bsps/lm32/lm32_evr/start/bsp_specs b/bsps/lm32/lm32_evr/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/lm32/lm32_evr/start/bsp_specs
+++ /dev/null
diff --git a/bsps/lm32/milkymist/start/bsp_specs b/bsps/lm32/milkymist/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/lm32/milkymist/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/av5282/start/bsp_specs b/bsps/m68k/av5282/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/av5282/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/csb360/start/bsp_specs b/bsps/m68k/csb360/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/csb360/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/gen68340/start/bsp_specs b/bsps/m68k/gen68340/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/gen68340/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/gen68360/start/bsp_specs b/bsps/m68k/gen68360/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/gen68360/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/genmcf548x/start/bsp_specs b/bsps/m68k/genmcf548x/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/genmcf548x/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mcf5206elite/start/bsp_specs b/bsps/m68k/mcf5206elite/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mcf5206elite/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mcf52235/start/bsp_specs b/bsps/m68k/mcf52235/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mcf52235/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mcf5225x/start/bsp_specs b/bsps/m68k/mcf5225x/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mcf5225x/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mcf5235/start/bsp_specs b/bsps/m68k/mcf5235/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mcf5235/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mcf5329/start/bsp_specs b/bsps/m68k/mcf5329/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mcf5329/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mrm332/start/bsp_specs b/bsps/m68k/mrm332/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mrm332/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mrm332/start/linkcmds b/bsps/m68k/mrm332/start/linkcmds
index 7c31b92dd1..3ae0d027bd 100644
--- a/bsps/m68k/mrm332/start/linkcmds
+++ b/bsps/m68k/mrm332/start/linkcmds
@@ -139,11 +139,6 @@ SECTIONS
*(.rodata*)
KEEP (*(SORT(.rtemsroset.*)))
*(.gnu.linkonce.r*)
-
- . = ALIGN (16);
- PROVIDE (_etext = .);
- _endtext = .;
- __data_start_rom = .;
} > rom
.tdata : {
_TLS_Data_begin = .;
@@ -154,6 +149,11 @@ SECTIONS
_TLS_BSS_begin = .;
*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
_TLS_BSS_end = .;
+
+ . = ALIGN (16);
+ PROVIDE (_etext = .);
+ _endtext = .;
+ __data_start_rom = .;
} > rom
_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
_TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
@@ -161,17 +161,13 @@ SECTIONS
_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
_TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
- .gcc_exc :
- AT ( ADDR(.tdata) + SIZEOF( .tdata ) )
- {
- *(.gcc_exc)
- } > ram
.data : AT(__data_start_rom)
{
PROVIDE (_copy_start = .);
*(.data*)
KEEP (*(SORT(.rtemsrwset.*)))
*(.gnu.linkonce.d*)
+ *(.gcc_exc)
*(.gcc_except_table*)
*(.jcr)
. = ALIGN (16);
diff --git a/bsps/m68k/mvme147/start/bsp_specs b/bsps/m68k/mvme147/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mvme147/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mvme147s/start/bsp_specs b/bsps/m68k/mvme147s/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mvme147s/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mvme162/start/bsp_specs b/bsps/m68k/mvme162/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mvme162/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/mvme167/start/bsp_specs b/bsps/m68k/mvme167/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/mvme167/start/bsp_specs
+++ /dev/null
diff --git a/bsps/m68k/uC5282/start/bsp_specs b/bsps/m68k/uC5282/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/m68k/uC5282/start/bsp_specs
+++ /dev/null
diff --git a/bsps/mips/csb350/start/bsp_specs b/bsps/mips/csb350/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/mips/csb350/start/bsp_specs
+++ /dev/null
diff --git a/bsps/mips/hurricane/start/bsp_specs b/bsps/mips/hurricane/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/mips/hurricane/start/bsp_specs
+++ /dev/null
diff --git a/bsps/mips/jmr3904/start/bsp_specs b/bsps/mips/jmr3904/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/mips/jmr3904/start/bsp_specs
+++ /dev/null
diff --git a/bsps/mips/malta/start/bsp_specs b/bsps/mips/malta/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/mips/malta/start/bsp_specs
+++ /dev/null
diff --git a/bsps/mips/rbtx4925/start/bsp_specs b/bsps/mips/rbtx4925/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/mips/rbtx4925/start/bsp_specs
+++ /dev/null
diff --git a/bsps/mips/rbtx4938/start/bsp_specs b/bsps/mips/rbtx4938/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/mips/rbtx4938/start/bsp_specs
+++ /dev/null
diff --git a/bsps/moxie/moxiesim/start/bsp_specs b/bsps/moxie/moxiesim/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/moxie/moxiesim/start/bsp_specs
+++ /dev/null
diff --git a/bsps/nios2/nios2_iss/start/bsp_specs b/bsps/nios2/nios2_iss/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/nios2/nios2_iss/start/bsp_specs
+++ /dev/null
diff --git a/bsps/no_cpu/no_bsp/start/bsp_specs b/bsps/no_cpu/no_bsp/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/no_cpu/no_bsp/start/bsp_specs
+++ /dev/null
diff --git a/bsps/or1k/generic_or1k/start/bsp_specs b/bsps/or1k/generic_or1k/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/or1k/generic_or1k/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/beatnik/start/bsp_specs b/bsps/powerpc/beatnik/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/beatnik/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/gen5200/start/bsp_specs b/bsps/powerpc/gen5200/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/gen5200/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/gen83xx/start/bsp_specs b/bsps/powerpc/gen83xx/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/gen83xx/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/haleakala/README b/bsps/powerpc/haleakala/README
deleted file mode 100644
index 115ae63fb1..0000000000
--- a/bsps/powerpc/haleakala/README
+++ /dev/null
@@ -1,51 +0,0 @@
-# Adapted from Virtex BSP
-
-BSP NAME: Haleakala
-BOARD: AMCC/UDTech Haleakala 405Exr eval board
-BUS: N/A
-CPU FAMILY: ppc
-CPU: PowerPC 405EXr
-COPROCESSORS: N/A
-MODE: 32 bit mode
-
-DEBUG MONITOR:
-
-PERIPHERALS
-===========
-TIMERS: 405EXr internal
-SERIAL PORTS: 405EXr internal
-REAL-TIME CLOCK: DS1338
-DMA: 405EXr internal
-VIDEO: none
-SCSI: none
-NETWORKING: 405EXr internal
-
-DRIVER INFORMATION
-==================
-CLOCK DRIVER: PPC Decrementer
-IOSUPP DRIVER: N/A
-SHMSUPP: N/A
-TIMER DRIVER: N/A
-TTY DRIVER: shared
-
-STDIO
-=====
-PORT: Console port 0
-ELECTRICAL: RS-232
-BAUD: 9600-115200
-BITS PER CHARACTER: 8
-PARITY: None
-STOP BITS: 1
-
-Notes
-=====
-
-Board description
------------------
-clock rate: 400 MHz
-ROM: 64MByte FLASH
-RAM: 256MByte DDR DRAM
-
-
-Porting
--------
diff --git a/bsps/powerpc/haleakala/config/haleakala.cfg b/bsps/powerpc/haleakala/config/haleakala.cfg
deleted file mode 100644
index 57feb35781..0000000000
--- a/bsps/powerpc/haleakala/config/haleakala.cfg
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Config file for a PowerPC 405 based card
-# mhamel
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=powerpc
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS = -mcpu=405
-
-# optimize flag: typically -0, could use -O4 or -fast
-# -O4 is ok for RTEMS
-# NOTE: some level of -O may be actually required by inline assembler
-CFLAGS_OPTIMIZE_V = -O1 -g
-
-# The following two lines enable compiling and linking on per element.
-CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
-LDFLAGS = -Wl,--gc-sections
-
-define bsp-post-link
- $(default-bsp-post-link)
- $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)
-endef
diff --git a/bsps/powerpc/haleakala/include/bsp.h b/bsps/powerpc/haleakala/include/bsp.h
deleted file mode 100644
index 71ea09b545..0000000000
--- a/bsps/powerpc/haleakala/include/bsp.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSBSPsPowerPCHaleakala
- *
- * @brief Global BSP definitions.
- */
-
-/* bsp.h
- *
- * Generic 405EX bsp.h
- * derived from virtex/include/bsp.h
- * by Michael Hamel ADInstruments Ltd 2008
- *
- * derived from helas403/include/bsp.h:
- * Id: bsp.h,v 1.4 2001/06/18 17:01:48 joel Exp
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- * IMD Ingenieurbuero fuer Microcomputertechnik
- *
- * COPYRIGHT (c) 1998 by IMD
- *
- * Changes from IMD are covered by the original distributions terms.
- * This file has been derived from the papyrus BSP.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * COPYRIGHT (c) 1995 by i-cubed ltd.
- *
- * To anyone who acknowledges that this file is provided "AS IS"
- * without any express or implied warranty:
- * permission to use, copy, modify, and distribute this file
- * for any purpose is hereby granted without fee, provided that
- * the above copyright notice and this notice appears in all
- * copies, and that the name of i-cubed limited not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * i-cubed limited makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h
- *
- * COPYRIGHT (c) 1989-1999.
- * 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.
- *
- *
- *
- */
-
-#ifndef LIBBSP_POWERPC_HALEAKALA_BSP_H
-#define LIBBSP_POWERPC_HALEAKALA_BSP_H
-
-/**
- * @defgroup RTEMSBSPsPowerPCHaleakala Haleakala
- *
- * @ingroup RTEMSBSPsPowerPC
- *
- * @brief Haleakala Board Support Package.
- *
- * @{
- */
-
-#include <bspopts.h>
-
-#ifdef ASM
-
-
- /* Definition of where to store registers in alignment handler */
- #define ALIGN_REGS 0x0140
-
-#else
-
- #include <rtems.h>
- #include <libcpu/io.h>
- #include <bsp/irq.h>
- #include <bsp/vectors.h>
- #include <bsp/default-initial-extension.h>
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /* Network Defines */
- #define RTEMS_BSP_NETWORK_DRIVER_NAME "eth0"
-
- struct rtems_bsdnet_ifconfig;
- int rtems_emac_driver_attach(struct rtems_bsdnet_ifconfig* config, int attaching);
- #define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_emac_driver_attach
-
- #define BSP_UART_IOBASE_COM1 0xEF600200 /* PPC405EX */
- #define BSP_UART_IOBASE_COM2 0xEF600300
-
- #define BSP_CONSOLE_PORT BSP_UART_COM1 /* console */
-
- #define BSP_UART_BAUD_BASE (11059200 / 16) /* Kilauea ext clock, max speed */
-
- #ifdef __cplusplus
- }
- #endif
-#endif /* ASM */
-
-/** @} */
-
-#endif /* BSP_H */
diff --git a/bsps/powerpc/haleakala/include/bsp/irq.h b/bsps/powerpc/haleakala/include/bsp/irq.h
deleted file mode 100644
index d4d1d818da..0000000000
--- a/bsps/powerpc/haleakala/include/bsp/irq.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*===============================================================*\
-| Project: RTEMS Haleakala BSP |
-| by Michael Hamel ADInstruments Ltd 2008 |
-+-----------------------------------------------------------------+
-| 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. |
-| |
-\*===============================================================*/
-
-
-#ifndef Haleakala_IRQ_IRQ_H
-#define Haleakala_IRQ_IRQ_H
-
-/* Implemented for us in bsp_irq_dispatch_list */
-#define BSP_SHARED_HANDLER_SUPPORT 1
-
-#include <rtems/irq.h>
-
-#ifndef ASM
-
-#include <bsp/irq-default.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /* Define UIC interrupt numbers; IRQs that cause an external interrupt that needs further decode.
- These are arbitrary but it makes things easier if they match the CPU interrupt numbers */
-
- /*
-
- #define BSP_UIC_UART0_GP (BSP_UIC_IRQ_LOWEST_OFFSET + 0)
- #define BSP_UIC_UART1 (BSP_UIC_IRQ_LOWEST_OFFSET + 1)
- #define BSP_UIC_IIC0 (BSP_UIC_IRQ_LOWEST_OFFSET + 2)
- #define BSP_UIC_ExtMaster (BSP_UIC_IRQ_LOWEST_OFFSET + 3)
- #define BSP_UIC_PCI (BSP_UIC_IRQ_LOWEST_OFFSET + 4)
- #define BSP_UIC_DMA0 (BSP_UIC_IRQ_LOWEST_OFFSET + 5)
- #define BSP_UIC_DMA1 (BSP_UIC_IRQ_LOWEST_OFFSET + 6)
- #define BSP_UIC_DMA2 (BSP_UIC_IRQ_LOWEST_OFFSET + 7)
- #define BSP_UIC_DMA3 (BSP_UIC_IRQ_LOWEST_OFFSET + 8)
- #define BSP_UIC_ENetWU (BSP_UIC_IRQ_LOWEST_OFFSET + 9)
- #define BSP_UIC_MALSERR (BSP_UIC_IRQ_LOWEST_OFFSET + 10)
- #define BSP_UIC_MALTXEOB (BSP_UIC_IRQ_LOWEST_OFFSET + 11)
- #define BSP_UIC_MALRXEOB (BSP_UIC_IRQ_LOWEST_OFFSET + 12)
- #define BSP_UIC_MALTXDE (BSP_UIC_IRQ_LOWEST_OFFSET + 13)
- #define BSP_UIC_MALRXDE (BSP_UIC_IRQ_LOWEST_OFFSET + 14)
- #define BSP_UIC_ENet (BSP_UIC_IRQ_LOWEST_OFFSET + 15)
- #define BSP_UIC_PCISERR (BSP_UIC_IRQ_LOWEST_OFFSET + 16)
- #define BSP_UIC_ECCERR (BSP_UIC_IRQ_LOWEST_OFFSET + 17)
- #define BSP_UIC_PCIPower (BSP_UIC_IRQ_LOWEST_OFFSET + 18)
- #define BSP_UIC_IRQ0 (BSP_UIC_IRQ_LOWEST_OFFSET + 25)
- #define BSP_UIC_IRQ1 (BSP_UIC_IRQ_LOWEST_OFFSET + 26)
- #define BSP_UIC_IRQ2 (BSP_UIC_IRQ_LOWEST_OFFSET + 27)
- #define BSP_UIC_IRQ3 (BSP_UIC_IRQ_LOWEST_OFFSET + 28)
- #define BSP_UIC_IRQ4 (BSP_UIC_IRQ_LOWEST_OFFSET + 29)
- #define BSP_UIC_IRQ5 (BSP_UIC_IRQ_LOWEST_OFFSET + 30)
- #define BSP_UIC_IRQ6 (BSP_UIC_IRQ_LOWEST_OFFSET + 31)
-
- #define BSP_UIC_IRQ_NUMBER (32)
-
- */
- /* PPC405EX interrupt vectors */
- #define BSP_UIC_UART1 (BSP_UIC_IRQ_LOWEST_OFFSET + 1)
- #define BSP_UIC_IIC0 (BSP_UIC_IRQ_LOWEST_OFFSET + 2)
- #define BSP_UIC_EIPPKP_READY (BSP_UIC_IRQ_LOWEST_OFFSET + 3)
- #define BSP_UIC_EIPPKP_TRNG (BSP_UIC_IRQ_LOWEST_OFFSET + 4)
- #define BSP_UIC_EBM (BSP_UIC_IRQ_LOWEST_OFFSET + 5)
- #define BSP_UIC_OPBtoPLB (BSP_UIC_IRQ_LOWEST_OFFSET + 6)
- #define BSP_UIC_IIC1 (BSP_UIC_IRQ_LOWEST_OFFSET + 7)
- #define BSP_UIC_SPI (BSP_UIC_IRQ_LOWEST_OFFSET + 8)
- #define BSP_UIC_IRQ0 (BSP_UIC_IRQ_LOWEST_OFFSET + 9)
- #define BSP_UIC_MALTXEOB (BSP_UIC_IRQ_LOWEST_OFFSET + 10)
- #define BSP_UIC_MALRXEOB (BSP_UIC_IRQ_LOWEST_OFFSET + 11)
- #define BSP_UIC_DMA0 (BSP_UIC_IRQ_LOWEST_OFFSET + 12)
- #define BSP_UIC_DMA1 (BSP_UIC_IRQ_LOWEST_OFFSET + 13)
- #define BSP_UIC_DMA2 (BSP_UIC_IRQ_LOWEST_OFFSET + 14)
- #define BSP_UIC_DMA3 (BSP_UIC_IRQ_LOWEST_OFFSET + 15)
- #define BSP_UIC_PCIe0AL (BSP_UIC_IRQ_LOWEST_OFFSET + 16)
- #define BSP_UIC_PCIe0VPD (BSP_UIC_IRQ_LOWEST_OFFSET + 17)
- #define BSP_UIC_PCIe0HRst (BSP_UIC_IRQ_LOWEST_OFFSET + 18)
- #define BSP_UIC_EIPPKP_PKA (BSP_UIC_IRQ_LOWEST_OFFSET + 19)
- #define BSP_UIC_PCIe0TCR (BSP_UIC_IRQ_LOWEST_OFFSET + 20)
- #define BSP_UIC_PCIe0VCO (BSP_UIC_IRQ_LOWEST_OFFSET + 21)
- #define BSP_UIC_EIPPKP_TRNG_AL (BSP_UIC_IRQ_LOWEST_OFFSET + 22)
- #define BSP_UIC_EIP94 (BSP_UIC_IRQ_LOWEST_OFFSET + 23)
- #define BSP_UIC_EMAC0 (BSP_UIC_IRQ_LOWEST_OFFSET + 24)
- #define BSP_UIC_EMAC1 (BSP_UIC_IRQ_LOWEST_OFFSET + 25)
- #define BSP_UIC_UART0 (BSP_UIC_IRQ_LOWEST_OFFSET + 26)
- #define BSP_UIC_IRQ4 (BSP_UIC_IRQ_LOWEST_OFFSET + 27)
- #define BSP_UIC_UIC2_STD (BSP_UIC_IRQ_LOWEST_OFFSET + 28)
- #define BSP_UIC_UIC2_CRIT (BSP_UIC_IRQ_LOWEST_OFFSET + 29)
- #define BSP_UIC_UIC1_STD (BSP_UIC_IRQ_LOWEST_OFFSET + 30)
- #define BSP_UIC_UIC1_CRIT (BSP_UIC_IRQ_LOWEST_OFFSET + 31)
-
- #define BSP_UIC1_IRQ_LOWEST_OFFSET (BSP_UIC_IRQ_LOWEST_OFFSET + 32)
- #define BSP_UIC_MALSERR (BSP_UIC1_IRQ_LOWEST_OFFSET + 0)
- #define BSP_UIC_MALTXDE (BSP_UIC1_IRQ_LOWEST_OFFSET + 1)
- #define BSP_UIC_MALRXDE (BSP_UIC1_IRQ_LOWEST_OFFSET + 2)
- #define BSP_UIC_PCIe0DCRErr (BSP_UIC1_IRQ_LOWEST_OFFSET + 3)
- #define BSP_UIC_PCIe1DCRErr (BSP_UIC1_IRQ_LOWEST_OFFSET + 4)
- #define BSP_UIC_ExtBus (BSP_UIC1_IRQ_LOWEST_OFFSET + 5)
- #define BSP_UIC_NDFC (BSP_UIC1_IRQ_LOWEST_OFFSET + 6)
- #define BSP_UIC_EIPKP_SLAVE (BSP_UIC1_IRQ_LOWEST_OFFSET + 7)
- #define BSP_UIC_GPT_TIMER5 (BSP_UIC1_IRQ_LOWEST_OFFSET + 8)
- #define BSP_UIC_GPT_TIMER6 (BSP_UIC1_IRQ_LOWEST_OFFSET + 9)
-
- #define BSP_UIC_GPT_TIMER0 (BSP_UIC1_IRQ_LOWEST_OFFSET + 16)
- #define BSP_UIC_GPT_TIMER1 (BSP_UIC1_IRQ_LOWEST_OFFSET + 17)
- #define BSP_UIC_IRQ7 (BSP_UIC1_IRQ_LOWEST_OFFSET + 18)
- #define BSP_UIC_IRQ8 (BSP_UIC1_IRQ_LOWEST_OFFSET + 19)
- #define BSP_UIC_IRQ9 (BSP_UIC1_IRQ_LOWEST_OFFSET + 20)
- #define BSP_UIC_GPT_TIMER2 (BSP_UIC1_IRQ_LOWEST_OFFSET + 21)
- #define BSP_UIC_GPT_TIMER3 (BSP_UIC1_IRQ_LOWEST_OFFSET + 22)
- #define BSP_UIC_GPT_TIMER4 (BSP_UIC1_IRQ_LOWEST_OFFSET + 23)
- #define BSP_UIC_SERIAL_ROM (BSP_UIC1_IRQ_LOWEST_OFFSET + 24)
- #define BSP_UIC_GPT_DEC (BSP_UIC1_IRQ_LOWEST_OFFSET + 25)
- #define BSP_UIC_IRQ2 (BSP_UIC1_IRQ_LOWEST_OFFSET + 26)
- #define BSP_UIC_IRQ5 (BSP_UIC1_IRQ_LOWEST_OFFSET + 27)
- #define BSP_UIC_IRQ6 (BSP_UIC1_IRQ_LOWEST_OFFSET + 28)
- #define BSP_UIC_EMAC0WU (BSP_UIC1_IRQ_LOWEST_OFFSET + 29)
- #define BSP_UIC_IRQ1 (BSP_UIC1_IRQ_LOWEST_OFFSET + 30)
- #define BSP_UIC_EMAC1WU (BSP_UIC1_IRQ_LOWEST_OFFSET + 31)
-
- #define BSP_UIC2_IRQ_LOWEST_OFFSET (BSP_UIC_IRQ_LOWEST_OFFSET + 64)
- #define BSP_UIC_PCIe0INTA (BSP_UIC2_IRQ_LOWEST_OFFSET + 0)
- #define BSP_UIC_PCIe0INTB (BSP_UIC2_IRQ_LOWEST_OFFSET + 1)
- #define BSP_UIC_PCIe0INTC (BSP_UIC2_IRQ_LOWEST_OFFSET + 2)
- #define BSP_UIC_PCIe0INTD (BSP_UIC2_IRQ_LOWEST_OFFSET + 3)
- #define BSP_UIC_IRQ3 (BSP_UIC2_IRQ_LOWEST_OFFSET + 4)
-
- #define BSP_UIC_USBOTG (BSP_UIC2_IRQ_LOWEST_OFFSET + 30)
-
- #define BSP_UIC_IRQ_NUMBER (95)
-
-
- #define BSP_UIC_IRQ_LOWEST_OFFSET 0
- #define BSP_UIC_IRQ_MAX_OFFSET (BSP_UIC_IRQ_LOWEST_OFFSET + BSP_UIC_IRQ_NUMBER - 1)
-
- #define BSP_UART_COM1_IRQ BSP_UIC_UART0 /* Required by shared/console/uart.c */
- #define BSP_UART_COM2_IRQ BSP_UIC_UART1
-
- /* Define processor IRQ numbers; IRQs that are handled by the exception vectors */
-
- #define BSP_PIT BSP_PROCESSOR_IRQ_LOWEST_OFFSET /* Required by ppc403/clock.c */
- #define BSP_FIT BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 1
- #define BSP_WDOG BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 2
-
- #define BSP_PROCESSOR_IRQ_NUMBER (3)
- #define BSP_PROCESSOR_IRQ_LOWEST_OFFSET (BSP_UIC_IRQ_MAX_OFFSET + 1)
- #define BSP_PROCESSOR_IRQ_MAX_OFFSET (BSP_PROCESSOR_IRQ_LOWEST_OFFSET + BSP_PROCESSOR_IRQ_NUMBER - 1)
-
- /* Summary and totals */
-
- #define BSP_IRQ_NUMBER (BSP_PROCESSOR_IRQ_MAX_OFFSET + 1)
- #define BSP_LOWEST_OFFSET (BSP_UIC_IRQ_LOWEST_OFFSET)
- #define BSP_MAX_OFFSET (BSP_IRQ_NUMBER - 1)
-
- extern void BSP_rtems_irq_mng_init(unsigned cpuId); // Implemented in irq_init.c
- #include <bsp/irq_supp.h>
-
- #ifdef __cplusplus
- }
- #endif
-#endif /* ASM */
-
-#endif /* Haleakala_IRQ_IRQ_H */
diff --git a/bsps/powerpc/haleakala/include/mmu_405.h b/bsps/powerpc/haleakala/include/mmu_405.h
deleted file mode 100644
index 344dfe4def..0000000000
--- a/bsps/powerpc/haleakala/include/mmu_405.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef _mmu_405_h
-#define _mmu_405_h
-
-/*
- Simple interface to the PowerPC 405 MMU
-
- The intention here is just to allow the MMU to be used to define cacheability and
- read/write/execute permissions in a simple enough way to fit entirely into the
- 64-entry TLB cache.
-
- This code does not do address relocation and does not generate any MMU-related interrupts.
-
- The process ID support is there for a possible future extension where RTEMS supports
- setting the process ID on task switches, which allows per-process stack protection
-
- This code will call fatal_error() if your add_space() calls overrun the 64 entries
-
- Michael Hamel ADInstruments 2008
-
-*/
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "stdint.h"
-
-enum {
- kAllProcessIDs = 0
-};
-
-typedef enum MMUAccessType {
- executable,
- readOnlyData,
- readOnlyNoCache,
- readWriteData,
- readWriteNoCache,
- readWriteExecutable
-} MMUAccessType;
-
-/* Initialise and clear the MMU */
-void mmu_initialise(void);
-
-/* Turn on/off data access translation */
-bool mmu_enable_data(bool enable);
-
-/* Turn on instruction translation */
-bool mmu_enable_code(bool enable);
-
-/* Define properties for an area of memory (must be 1K-aligned) */
-void mmu_add_space(uint32_t startAddr, uint32_t endAddr, MMUAccessType permissions, uint8_t processID);
-
-/* Delete a memory property definition */
-void mmu_remove_space(uint32_t startAddr, uint32_t endAddr);
-
-/* Return number of TLB entries out of total in use */
-int mmu_get_tlb_count(void);
-
-/* Allocate a new process ID and return it */
-uint8_t mmu_new_processID(void);
-
-/* Free a process ID that has been in use */
-void mmu_free_processID(uint8_t freeThis);
-
-/* Return the current process ID */
-uint8_t mmu_current_processID(void);
-
-/* Change the process ID to ID and return the old value */
-uint8_t mmu_set_processID(uint8_t toID);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //_mmu_405.h
diff --git a/bsps/powerpc/haleakala/include/tm27.h b/bsps/powerpc/haleakala/include/tm27.h
deleted file mode 100644
index 0dfa7bf628..0000000000
--- a/bsps/powerpc/haleakala/include/tm27.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <rtems/tm27-default.h>
diff --git a/bsps/powerpc/haleakala/irq/irq.c b/bsps/powerpc/haleakala/irq/irq.c
deleted file mode 100644
index c9607a032d..0000000000
--- a/bsps/powerpc/haleakala/irq/irq.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- *
- *
- * 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.
- *
- * Middleware support for PPC405 by M.Hamel ADInstruments Ltd 2008
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <bsp/irq.h>
-#include <bsp/irq_supp.h>
-#include <bsp/vectors.h>
-#include <libcpu/powerpc-utility.h>
-
-
-/* PPC405EX UIC numbers */
-#define UIC_DCR_BASE 0xc0
-#define UIC0_SR (UIC_DCR_BASE+0x0) /* UIC status */
-#define UIC0_SRS (UIC_DCR_BASE+0x1) /* UIC status set */
-#define UIC0_ER (UIC_DCR_BASE+0x2) /* UIC enable */
-#define UIC0_CR (UIC_DCR_BASE+0x3) /* UIC critical */
-#define UIC0_PR (UIC_DCR_BASE+0x4) /* UIC polarity */
-#define UIC0_TR (UIC_DCR_BASE+0x5) /* UIC triggering */
-#define UIC0_MSR (UIC_DCR_BASE+0x6) /* UIC masked status */
-#define UIC0_VR (UIC_DCR_BASE+0x7) /* UIC vector */
-#define UIC0_VCR (UIC_DCR_BASE+0x8) /* UIC vector configuration */
-
-#define UIC1_SR (UIC_DCR_BASE+0x10) /* UIC status */
-#define UIC1_SRS (UIC_DCR_BASE+0x11) /* UIC status set */
-#define UIC1_ER (UIC_DCR_BASE+0x12) /* UIC enable */
-#define UIC1_CR (UIC_DCR_BASE+0x13) /* UIC critical */
-#define UIC1_PR (UIC_DCR_BASE+0x14) /* UIC polarity */
-#define UIC1_TR (UIC_DCR_BASE+0x15) /* UIC triggering */
-#define UIC1_MSR (UIC_DCR_BASE+0x16) /* UIC masked status */
-#define UIC1_VR (UIC_DCR_BASE+0x17) /* UIC vector */
-#define UIC1_VCR (UIC_DCR_BASE+0x18) /* UIC vector configuration */
-
-#define UIC2_SR (UIC_DCR_BASE+0x20) /* UIC status */
-#define UIC2_SRS (UIC_DCR_BASE+0x21) /* UIC status set */
-#define UIC2_ER (UIC_DCR_BASE+0x22) /* UIC enable */
-#define UIC2_CR (UIC_DCR_BASE+0x23) /* UIC critical */
-#define UIC2_PR (UIC_DCR_BASE+0x24) /* UIC polarity */
-#define UIC2_TR (UIC_DCR_BASE+0x25) /* UIC triggering */
-#define UIC2_MSR (UIC_DCR_BASE+0x26) /* UIC masked status */
-#define UIC2_VR (UIC_DCR_BASE+0x27) /* UIC vector */
-#define UIC2_VCR (UIC_DCR_BASE+0x28) /* UIC vector configuration */
-
-enum { kUICWords = 3 };
-
-static rtems_irq_connect_data* rtems_hdl_tblP;
-static rtems_irq_connect_data dflt_entry;
-
-static uint32_t gEnabledInts[kUICWords]; /* 1-bits mean enabled */
-static uint32_t gIntInhibited[kUICWords]; /* 1-bits disable, overriding gEnabledInts because the interrupt
- is being processed in C_dispatch_irq_handler */
-
-static inline int IsUICIRQ(const rtems_irq_number irqLine)
-{
- return (((int) irqLine <= BSP_UIC_IRQ_MAX_OFFSET) &&
- ((int) irqLine >= BSP_UIC_IRQ_LOWEST_OFFSET)
- );
-}
-
-static void WriteIState(void)
-/* Write the gEnabledInts state masked by gIntInhibited to the hardware */
-{
- PPC_SET_DEVICE_CONTROL_REGISTER(UIC0_ER,
- gEnabledInts[0] & ~gIntInhibited[0]);
- PPC_SET_DEVICE_CONTROL_REGISTER(UIC1_ER,
- gEnabledInts[1] & ~gIntInhibited[1]);
- PPC_SET_DEVICE_CONTROL_REGISTER(UIC2_ER,
- gEnabledInts[2] & ~gIntInhibited[2]);
-}
-
-void
-BSP_enable_irq_at_pic(const rtems_irq_number irq)
-/* Enable an interrupt; this can be called from inside C_dispatch_irq_handler */
-{
- if (IsUICIRQ(irq)) {
- /* Set relevant bit in the state, write state to the UIC */
- gEnabledInts[irq>>5] |= (0x80000000 >> (irq & 0x1F));
- WriteIState();
- }
-}
-
-int
-BSP_disable_irq_at_pic(const rtems_irq_number irq)
-/* Enable an interrupt; this can be called from inside C_dispatch_irq_handler */
-{
- if (IsUICIRQ(irq)) {
- uint32_t oldState;
- int iword = irq>>5;
- uint32_t mask = (0x80000000 >> (irq & 0x1F));
-
- oldState = gEnabledInts[iword] & mask;
- gEnabledInts[iword] &= ~mask;
- WriteIState();
- return oldState ? 1 : 0;
- } else
- return -1;
-}
-
-int
-BSP_setup_the_pic(rtems_irq_global_settings* config)
-{
- int i;
-
- dflt_entry = config->defaultEntry;
- rtems_hdl_tblP = config->irqHdlTbl;
- for (i=0; i<kUICWords; i++)
- gIntInhibited[i] = 0;
-
- /* disable all interrupts */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC2_ER, 0x00000000);
- /* Set Critical / Non Critical interrupts */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC2_CR, 0x00000000);
- /* Set Interrupt Polarities */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC2_PR, 0xf7ffffff);
- /* Set Interrupt Trigger Levels */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC2_TR, 0x01e1fff8);
- /* Set Vect base=0,INT31 Highest priority */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC2_VR, 0x00000001);
- /* clear all interrupts */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC2_SR, 0xffffffff);
-
- /* disable all interrupts */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC1_ER, 0x00000000);
- /* Set Critical / Non Critical interrupts */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC1_CR, 0x00000000);
- /* Set Interrupt Polarities */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC1_PR, 0xfffac785);
- /* Set Interrupt Trigger Levels */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC1_TR, 0x001d0040);
- /* Set Vect base=0,INT31 Highest priority */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC1_VR, 0x00000001);
- /* clear all interrupts */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC1_SR, 0xffffffff);
-
- /* Disable all interrupts except cascade UIC0 and UIC1 */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC0_ER, 0x0000000a);
- /* Set Critical / Non Critical interrupts */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC0_CR, 0x00000000);
- /* Set Interrupt Polarities */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC0_PR, 0xffbfefef);
- /* Set Interrupt Trigger Levels */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC0_TR, 0x00007000);
- /* Set Vect base=0,INT31 Highest priority */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC0_VR, 0x00000001);
- /* clear all interrupts */
- PPC_SET_DEVICE_CONTROL_REGISTER (UIC0_SR, 0xffffffff);
-
- return 1;
-}
-
-
-/*
- * High level IRQ handler called from shared_raw_irq_code_entry; decode and
- * dispatch. Note that this routine needs to be re-entrant
- *
- * No support for critical interrupts here yet
- */
-
-int
-C_dispatch_irq_handler( BSP_Exception_frame* frame, unsigned int excNum )
-{
- if (excNum == ASM_EXT_VECTOR) {
- uint32_t active[kUICWords];
-
- /* Fetch the masked flags that tell us what external ints are active.
- Likely to be only one, but we need to handle more than one,
- OR the flags into gIntInhibited */
- active[0] = PPC_DEVICE_CONTROL_REGISTER(UIC0_MSR);
- active[1] = PPC_DEVICE_CONTROL_REGISTER(UIC1_MSR);
- active[2] = PPC_DEVICE_CONTROL_REGISTER(UIC2_MSR);
- gIntInhibited[0] |= active[0];
- gIntInhibited[1] |= active[1];
- gIntInhibited[2] |= active[2];
-
- /* ...and update the hardware so the active interrupts are disabled */
- WriteIState();
-
- /* Loop, calling bsp_irq_dispatch_list for each active interrupt */
- while ((active[0] | active[1] | active[2]) != 0) {
- uint32_t index = -1;
- uint32_t bit, bmask;
-
- /* Find an active interrupt, searching 0..2, bit 0..bit 31 (IBM order) */
- do {
- index++;
- asm volatile (" cntlzw %0, %1":"=r" (bit):"r" (active[index]));
- } while (bit==32);
-
- /* Call the matching handler */
- bsp_irq_dispatch_list(rtems_hdl_tblP, (index*32)+bit, dflt_entry.hdl);
-
- /* Write a 1-bit to the appropriate status register to clear it */
- bmask = 0x80000000 >> bit;
- switch (index) {
- case 0:
- PPC_SET_DEVICE_CONTROL_REGISTER(UIC0_SR, bmask);
- break;
- case 1:
- PPC_SET_DEVICE_CONTROL_REGISTER(UIC1_SR, bmask);
- break;
- case 2:
- PPC_SET_DEVICE_CONTROL_REGISTER(UIC2_SR, bmask);
- break;
- }
-
- /* Clear in the active record and gIntInhibited */
- active[index] &= ~bmask;
- gIntInhibited[index] &= ~bmask;
- };
-
- /* Update the hardware again so the interrupts we have handled are unmasked */
- WriteIState();
- return 0;
-
- } else if (excNum == ASM_DEC_VECTOR) { /* 0x1000 remapped by C_dispatch_dec_handler_bookE */
- bsp_irq_dispatch_list(rtems_hdl_tblP, BSP_PIT, dflt_entry.hdl);
- return 0;
-
- } else if (excNum == ASM_BOOKE_FIT_VECTOR) { /* 0x1010 mapped to 0x13 by ppc_get_vector_addr */
- bsp_irq_dispatch_list(rtems_hdl_tblP, BSP_FIT, dflt_entry.hdl);
- return 0;
-
- } else if (excNum == ASM_BOOKE_WDOG_VECTOR) { /* 0x1020 mapped to 0x14 by ppc_get_vector_addr */
- bsp_irq_dispatch_list(rtems_hdl_tblP, BSP_WDOG, dflt_entry.hdl);
- return 0;
-
- } else
- return -1; /* unhandled interrupt, panic time */
-}
-
diff --git a/bsps/powerpc/haleakala/irq/irq_init.c b/bsps/powerpc/haleakala/irq/irq_init.c
deleted file mode 100644
index d48855a979..0000000000
--- a/bsps/powerpc/haleakala/irq/irq_init.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*===============================================================*\
-| Project: RTEMS Haleakala BSP |
-| * by Michael Hamel ADInstruments Ltd 2008 |
-+-----------------------------------------------------------------+
-| The license and distribution terms for this file may be |
-| found in the file LICENSE in this distribution or at |
-| |
-| http://www.rtems.org/license/LICENSE. |
-| |
-+-----------------------------------------------------------------+
-| this file contains the irq controller handler |
-\*===============================================================*/
-#include <libcpu/spr.h>
-#include <bsp/irq.h>
-#include <bsp.h>
-#include <bsp/vectors.h>
-#include <rtems/bspIo.h>
-#include <rtems/powerpc/powerpc.h>
-
-
-/*
- * default on/off function
- */
-static void nop_func(void)
-{
-}
-
-/*
- * default isOn function
- */
-static int not_connected(void)
-{
- return 0;
-}
-
-static rtems_irq_connect_data rtemsIrq[BSP_IRQ_NUMBER];
-static rtems_irq_global_settings initial_config;
-static rtems_irq_connect_data defaultIrq = {
- .name = 0,
- .hdl = NULL,
- .handle = NULL,
- .on = (rtems_irq_enable) nop_func,
- .off = (rtems_irq_disable) nop_func,
- .isOn = (rtems_irq_is_enabled) not_connected,
-#ifdef BSP_SHARED_HANDLER_SUPPORT
- .next_handler = NULL
-#endif
-};
-
-static rtems_irq_prio irqPrioTable[BSP_IRQ_NUMBER]={
- /*
- * Processor exceptions handled as interrupts
- */
- 0
-};
-
- /*
- * This code assumes the exceptions management setup has already
- * been done. We just need to replace the exceptions that will
- * be handled like interrupt. On mcp750/mpc750 and many PPC processors
- * this means the decrementer exception and the external exception.
- */
-
-void BSP_rtems_irq_mng_init(unsigned cpuId)
-{
- int i;
-
- /*
- * re-init the rtemsIrq table
- */
- for (i = 0; i < BSP_IRQ_NUMBER; i++) {
- rtemsIrq[i] = defaultIrq;
- rtemsIrq[i].name = i;
- }
- /*
- * Init initial Interrupt management config
- */
- initial_config.irqNb = BSP_IRQ_NUMBER;
- initial_config.defaultEntry = defaultIrq;
- initial_config.irqHdlTbl = rtemsIrq;
- initial_config.irqBase = BSP_LOWEST_OFFSET;
- initial_config.irqPrioTbl = irqPrioTable;
-
- if (!BSP_rtems_irq_mngt_set(&initial_config)) {
- /*
- * put something here that will show the failure...
- */
- rtems_panic(
- "Unable to initialize RTEMS interrupt management!!! System locked\n"
- );
- }
-
- #ifdef TRACE_IRQ_INIT
- printk("RTEMS IRQ management is now operational\n");
- #endif
-}
diff --git a/bsps/powerpc/haleakala/start/bsp_specs b/bsps/powerpc/haleakala/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/haleakala/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/haleakala/start/bspstart.c b/bsps/powerpc/haleakala/start/bspstart.c
deleted file mode 100644
index 61fb376e28..0000000000
--- a/bsps/powerpc/haleakala/start/bspstart.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * This routine does the bulk of the system initialization.
- */
-
-/*
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- * IMD Ingenieurbuero fuer Microcomputertechnik
- *
- * COPYRIGHT (c) 1998 by IMD
- *
- * Changes from IMD are covered by the original distributions terms.
- * This file has been derived from the papyrus BSP:
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * COPYRIGHT (c) 1995 by i-cubed ltd.
- *
- * To anyone who acknowledges that this file is provided "AS IS"
- * without any express or implied warranty:
- * permission to use, copy, modify, and distribute this file
- * for any purpose is hereby granted without fee, provided that
- * the above copyright notice and this notice appears in all
- * copies, and that the name of i-cubed limited not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * i-cubed limited makes no representations about the suitability
- * of this software for any purpose.
- *
- * Modifications for spooling console driver and control of memory layout
- * with linker command file by
- * Thomas Doerfler <td@imd.m.isar.de>
- * for these modifications:
- * COPYRIGHT (c) 1997 by IMD, Puchheim, Germany.
- *
- * To anyone who acknowledges that this file is provided "AS IS"
- * without any express or implied warranty:
- * permission to use, copy, modify, and distribute this file
- * for any purpose is hereby granted without fee, provided that
- * the above copyright notice and this notice appears in all
- * copies. IMD makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c:
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
- * On-Line Applications Research Corporation (OAR).
- *
- * Modifications for PPC405GP by Dennis Ehlin
- *
- * Further modified for the PPC405EX Haleakala board by
- * Michael Hamel ADInstruments Ltd May 2008
- */
-#include <string.h>
-#include <fcntl.h>
-
-#include <rtems/bspIo.h>
-#include <rtems/counter.h>
-
-#include <bsp.h>
-#include <bsp/bootcard.h>
-#include <bsp/uart.h>
-#include <bsp/irq.h>
-#include <libcpu/powerpc-utility.h>
-#include <bsp/vectors.h>
-#include <ppc4xx/ppc405gp.h>
-#include <ppc4xx/ppc405ex.h>
-
-#include <stdio.h>
-/*
- * Driver configuration parameters
- */
-
-/* Expected by clock.c */
-uint32_t bsp_clicks_per_usec;
-
-/*-------------------- Haleakala-specific UART setup -------------------------*/
-
-static void
-EarlyUARTInit(int baudRate)
-{
- volatile uint8_t* up = (uint8_t*)(BSP_UART_IOBASE_COM1);
- int divider = BSP_UART_BAUD_BASE / baudRate;
- up[LCR] = DLAB; /* Access DLM/DLL */
- up[DLL] = divider & 0x0FF;
- up[DLM] = divider >> 8;
- up[LCR] = CHR_8_BITS;
- up[MCR] = DTR | RTS;
- up[FCR] = FIFO_EN | XMIT_RESET | RCV_RESET;
- up[THR] = '+';
-}
-
-
-static void
-InitUARTClock(void)
-{
- uint32_t reg;
- mfsdr(SDR0_UART0,reg);
- reg &= ~0x008000FF;
- reg |= 0x00800001; /* Ext clock, div 1 */
- mtsdr(SDR0_UART0,reg);
-}
-
-static void GPIO_AlternateSelect(int bitnum, int source)
-/* PPC405EX: select a GPIO function for the specified pin */
-{
- int shift;
- unsigned long value, mask;
- GPIORegisters* gpioPtr = (GPIORegisters*)(GPIOAddress);
-
- shift = (31 - bitnum) & 0xF;
- value = (source & 3) << (shift*2);
- mask = 3 << (shift*2);
- if (bitnum <= 15) {
- gpioPtr->OSRL = (gpioPtr->OSRL & ~mask) | value;
- gpioPtr->TSRL = (gpioPtr->TSRL & ~mask) | value;
- } else {
- gpioPtr->OSRH = (gpioPtr->OSRH & ~mask) | value;
- gpioPtr->TSRH = (gpioPtr->TSRH & ~mask) | value;
- }
-}
-
-static void Init_FPGA(void)
-{
- /* Have to write to the FPGA to enable the UART drivers */
- /* Have to enable CS2 as an output in GPIO to get the FPGA working */
- mtebc(EBC0_B2CR,0xF0018000); /* Set up CS2 at 0xF0000000 */
- mtebc(EBC0_B2AP,0x9400C800);
- GPIO_AlternateSelect(9,1); /* GPIO9 = PerCS2 */
- {
- unsigned long *fpgaPtr = (unsigned long*)(0xF0000000);
- unsigned long n;
- n = *(fpgaPtr);
- n &= ~0x00100; /* User LEDs on */
- n |= 0x30000; /* UART 0 and 1 transcievers on! */
- *fpgaPtr = n;
- }
-}
-
-/*===================================================================*/
-
-static void
-DirectUARTWrite(const char c)
-{
- volatile uint8_t* up = (uint8_t*)(BSP_UART_IOBASE_COM1);
- while ((up[LSR] & THRE) == 0) { ; }
- up[THR] = c;
-}
-
-/* We will provide our own printk output function as it may get used early */
-BSP_output_char_function_type BSP_output_char = DirectUARTWrite;
-BSP_polling_getchar_function_type BSP_poll_char = NULL;
-
-uint32_t _CPU_Counter_frequency(void)
-{
- return bsp_clicks_per_usec * 1000000;
-}
-
-/*===================================================================*/
-
-void bsp_start( void )
-{
- /* Get the UART clock initialized first in case we call printk */
-
- InitUARTClock();
- Init_FPGA();
- EarlyUARTInit(115200);
-
- /*
- * Get CPU identification dynamically. Note that the get_ppc_cpu_type()
- * function store the result in global variables
- * so that it can be used later...
- */
- get_ppc_cpu_type();
- get_ppc_cpu_revision();
-
- /*
- * initialize the device driver parameters
- */
-
- /* Set globals visible to clock.c */
- /* timebase register ticks/microsecond = CPU Clk in MHz */
- bsp_clicks_per_usec = 400;
-
- ppc_exc_initialize();
-
- /*
- * Install our own set of exception vectors
- */
- BSP_rtems_irq_mng_init(0);
-}
diff --git a/bsps/powerpc/haleakala/start/linkcmds b/bsps/powerpc/haleakala/start/linkcmds
deleted file mode 100644
index dc5a198b00..0000000000
--- a/bsps/powerpc/haleakala/start/linkcmds
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the 405GP/EX
- * This file is intended to be used together with dlentry.s
- * it will generate downloadable code
- *
- * Modifications for gen405 by Dennis Ehlin
- * Modifications for virtex by Keith, Greg, and Bob
- * Modifications for 405GP/EX by Michael Hamel
- */
-
-OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
-OUTPUT_ARCH(powerpc)
-STARTUP(start.o)
-ENTRY(download_entry)
-EXTERN(__vectors)
-
-RamBase = DEFINED(RamBase) ? RamBase : 0;
-RamSize = DEFINED(RamSize) ? RamSize : 256M;
-RamEnd = RamBase + RamSize;
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
-
-MEMORY {
- RAM : ORIGIN = 0, LENGTH = 256M
- /*FLASH : ORIGIN = 0xFFE00000, LENGTH = 16M*/
-}
-
-/*
- * Max sdata/bss.
- */
-bsp_section_small_data_area_size = 65536;
-
-SECTIONS
-{
- /* First 16K is occupied by exception vectors and anything else we want to put there */
- .text 0x4000:
- {
- text.start = . ;
- *(.entry)
- *(.entry2)
- *(.text*)
- *(.rodata*)
- *(.rodata1)
- KEEP (*(SORT(.rtemsroset.*)))
-
- /*
- * Special FreeBSD sysctl sections.
- */
- . = ALIGN (16);
- __start_set_sysctl_set = .;
- *(set_sysctl_*);
- __stop_set_sysctl_set = ABSOLUTE(.);
- *(set_domain_*);
- *(set_pseudo_*);
-
- /* C++ constructors/destructors */
- *(.gnu.linkonce.t*)
-
- /* Initialization and finalization code.
- *
- * Various files can provide initialization and finalization functions.
- * The bodies of these functions are in .init and .fini sections. We
- * accumulate the bodies here, and prepend function prologues from
- * ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
- * first; ecrtn.o must be linked last. Because these are wildcards, it
- * doesn't matter if the user does not actually link against ecrti.o and
- * ecrtn.o; the linker won't look for a file to match a wildcard. The
- * wildcard also means that it doesn't matter which directory ecrti.o
- * and ecrtn.o are in.
- */
- PROVIDE (_init = .);
- *ecrti.o(.init)
- *(.init)
- *ecrtn.o(.init)
-
- PROVIDE (_fini = .);
- *ecrti.o(.fini)
- *(.fini)
- *ecrtn.o(.init)
-
- KEEP (*ecrti.o(.ctors))
- KEEP (*crtbegin.o(.ctors))
- KEEP (*crtbegin?.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors))
- KEEP (*ecrti.o(.dtors))
- KEEP (*crtbegin.o(.dtors))
- KEEP (*crtbegin?.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors))
-
- /* Exception frame info */
- *(.eh_frame)
- /* Miscellaneous read-only data */
- _rodata_start = . ;
- *(.gnu.linkonce.r*)
- *(.lit)
- *(.shdata)
- *(.rodata)
- *(.rodata1)
- *(.descriptors)
- *(rom_ver)
- _erodata = .;
-
- PROVIDE (__EXCEPT_START__ = .);
- *(.gcc_except_table*)
- PROVIDE (__EXCEPT_END__ = .);
- __GOT_START__ = .;
- s.got = .;
- *(.got.plt)
- *(.got)
- *(.got1)
- PROVIDE (__GOT2_START__ = .);
- PROVIDE (_GOT2_START_ = .);
- *(.got2)
- PROVIDE (__GOT2_END__ = .);
- PROVIDE (_GOT2_END_ = .);
-
- PROVIDE (__FIXUP_START__ = .);
- PROVIDE (_FIXUP_START_ = .);
- *(.fixup)
- PROVIDE (_FIXUP_END_ = .);
- PROVIDE (__FIXUP_END__ = .);
-
-
- /* Various possible names for the end of the .text section */
- etext = ALIGN(0x10);
- _etext = .;
-
- *(.lit)
- *(.shdata)
- _endtext = ALIGN(0x10);
- text.end = .;
- text.size = text.end - text.start;
- } >RAM
-
- text.size = text.end - text.start;
-
- .tdata : {
- _TLS_Data_begin = .;
- *(.tdata .tdata.* .gnu.linkonce.td.*)
- _TLS_Data_end = .;
- } >RAM
-
- .tbss : {
- _TLS_BSS_begin = .;
- *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
- _TLS_BSS_end = .;
- } >RAM
-
- _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
- _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
- _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
- _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
- _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
- _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
-
- .jcr : { KEEP (*(.jcr)) } >RAM
-
- .rel.dyn : {
- *(.rel.init)
- *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
- *(.rel.fini)
- *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
- *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
- *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
- *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
- *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
- *(.rel.ctors)
- *(.rel.dtors)
- *(.rel.got)
- *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
- *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
- *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
- *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
- *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
- } >RAM
- .rela.dyn : {
- *(.rela.init)
- *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
- *(.rela.fini)
- *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
- *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
- *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
- *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
- *(.rela.ctors)
- *(.rela.dtors)
- *(.rela.got)
- *(.rela.got1)
- *(.rela.got2)
- *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
- *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
- *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
- *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
- *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
- } >RAM
-
-
- /* Initialised large data */
- .data ( . ) :
- {
- . = ALIGN (4);
- data.start = .;
- *(.data)
- *(.data1)
- KEEP (*(SORT(.rtemsrwset.*)))
- *(.data.* .gnu.linkonce.d.*)
- data.end = .;
- } > RAM
-
- /* Initialised small data addressed as offsets from r13 */
- .sdata : {
- . = ALIGN (4);
- PROVIDE (__SDATA_START__ = .);
- bsp_section_sdata_begin = .;
- sdata.start = .;
- *(.sdata*)
- *(.gnu.linkonce.s.*)
- sdata.end = .;
- bsp_section_sdata_end = .;
- } > RAM
-
- /* Zeroed small data addressed as offsets from r13 */
- .sbss : {
- . = ALIGN (4);
- PROVIDE(__SBSS_START__ = .);
- bsp_section_sbss_begin = .;
- sbss.start = .;
- *(.sbss .sbss.* *.gnu.linkonce.sb.*);
- sbss.end = .;
- bsp_section_sbss_end = .;
- bsp_section_sdata_libdl_begin = .;
- . = DEFINED(bsp_section_small_data_area_size) ?
- bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
- bsp_section_sdata_libdl_end = .;
- } > RAM
- PROVIDE(__SBSS_END__ = .);
-
- /* Zeroed large data */
- .bss : {
- . = ALIGN (4);
- bss.start = .;
- *(.bss .bss* .gnu.linkonce.b*)
- . = ALIGN(4);
- bss.end = .;
- } > RAM
-
- bss.size = bss.end - bss.start;
- sbss.size = sbss.end - sbss.start;
-
- .noinit (NOLOAD) : {
- *(.noinit*)
- } >RAM
-
- .rtemsstack (NOLOAD) : {
- *(SORT(.rtemsstack.*))
- } >RAM
-
- WorkAreaBase = .;
-
- /* Debugging information */
- .line 0 : { *(.line) }
- .debug 0 : { *(.debug) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_aregion 0 : { *(.debug_aregion) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
-}
diff --git a/bsps/powerpc/haleakala/start/mmu_405.c b/bsps/powerpc/haleakala/start/mmu_405.c
deleted file mode 100644
index ea45807b8f..0000000000
--- a/bsps/powerpc/haleakala/start/mmu_405.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Simple interface to the PowerPC 405 MMU
- *
- * Michael Hamel ADInstruments 2008
- *
- */
-
-
-#include <bsp.h>
-#include <libcpu/powerpc-utility.h>
-#include "mmu_405.h"
-#include <inttypes.h>
-
-/* #define qLogTLB */
-/* #define qLogTLBDetails */
-
-
-/*----------------------------- TLB handling -------------------------------- */
-/* The following are in assembler in mmu_405asm.S */
-extern void MMU_GetTLBEntry(uint8_t index, uint32_t* tagword, uint32_t* dataword, uint8_t* pid);
-extern void MMU_SetTLBEntry(uint8_t index, uint32_t hiword, uint32_t loword, uint8_t pid);
-extern void MMU_ClearTLBs(void);
-extern int16_t MMU_FindTLBEntry(uint32_t address);
-
-
-enum { kNTLBs = 64 }; /* for 403GCX and 405 */
-
-static bool sFreeTLBs[kNTLBs];
-static uint8_t sLastIndex = 0;
-static int sNInUse = 0;
-
-static void MMUFault(const char* what)
-/* Used for all setup faults; these can't really be ignored */
-{
- printk("\n>>>MMU fatal error %s\n",what);
- rtems_fatal_error_occurred(RTEMS_INTERNAL_ERROR);
-}
-
-static uint8_t AllocTLB(void)
-{
- uint8_t index;
-
- index = sLastIndex;
- do {
- index++;
- if (index == kNTLBs)
- index = 0;
- if (index == sLastIndex)
- MMUFault("TLB table full");
- } while (! sFreeTLBs[index]);
- sFreeTLBs[index] = false;
- sLastIndex = index;
- sNInUse++;
- return index;
-}
-
-static void FreeTLB(uint8_t index)
-{
- MMU_SetTLBEntry(index,0,0,0);
- sFreeTLBs[index] = true;
- sLastIndex = index-1;
- sNInUse--;
-}
-
-
-/*---------------------------- MMU operations ---------------------------------- */
-
-int DataMissException(BSP_Exception_frame *f, unsigned int vector);
-int InstructionMissException(BSP_Exception_frame *f, unsigned int vector);
-int InstructionFetchException(BSP_Exception_frame *f, unsigned int vector);
-void mmu_initialise(void);
-int mmu_get_tlb_count(void);
-uint8_t mmu_new_processID(void);
-uint8_t mmu_current_processID(void);
-
-void
-mmu_initialise(void)
-/* Clear the TLBs and set up exception handlers for the MMU miss handlers */
-{
- int i;
-
- MMU_ClearTLBs();
- for (i=0; i<kNTLBs; i++) {
- sFreeTLBs[i] = true;
- MMU_SetTLBEntry(i,0,0,0xFF);
- }
- ppc_exc_set_handler(ASM_ISI_VECTOR ,InstructionFetchException);
- ppc_exc_set_handler(ASM_BOOKE_ITLBMISS_VECTOR ,DataMissException);
- ppc_exc_set_handler(ASM_BOOKE_DTLBMISS_VECTOR ,InstructionMissException);
-}
-
-static void
-MakeTLBEntries(uint32_t startAt, uint32_t nBytes, bool EX, bool WR, bool I, uint8_t PID)
-{
- uint32_t mask, options, tagWord, dataWord;
- uint8_t index, sizeCode, pid;
-
- if ((startAt & 0x3FF) != 0)
- MMUFault("TLB entry not on 1K boundary");
- if ((nBytes & 0x3FF) != 0)
- MMUFault("TLB size not on 1K boundary");
-
- options = 0;
- if (EX) options += 0x200;
- if (WR) options += 0x100;
- if (I) options += 5;
-
- #ifdef qLogTLB
- printk("TLB: make entries for $%X bytes from $%X..$%X PID %d",nBytes, startAt, startAt+nBytes-1, PID);
- if (EX) printk(" EX");
- if (WR) printk(" WR");
- if (I) printk(" I");
- printk("\n");
- #endif
-
- while (nBytes > 0) {
- /* Find the largest block we can base on this address */
- mask = 0x3FF;
- sizeCode = 0;
- while (mask < nBytes && ((startAt & mask)==0) && sizeCode < 8) {
- mask = (mask<<2) + 3;
- sizeCode++;
- }
- mask >>= 2;
- sizeCode--;
-
- /* Make a TLB entry describing this, ZSEL=0 */
- tagWord = startAt | (sizeCode<<7) | 0x40;
- dataWord = startAt | options;
- index = AllocTLB();
- MMU_SetTLBEntry( index , tagWord, dataWord, PID);
-
- {
- /* Paranoia: check that we can read that back... */
- uint8_t tdex, oldpid;
-
- oldpid = mmu_current_processID();
- mmu_set_processID(PID);
- tdex = MMU_FindTLBEntry(startAt);
- mmu_set_processID(oldpid);
-
- if (tdex != index) {
- printk(" Add TLB %d: At %" PRIx32 " for $%" PRIx32
- " sizecode %d tagWord $%" PRIx32 " ",
- index, startAt, mask+1,sizeCode,tagWord);
- printk(" -- find failed, %d/%d!\n",tdex,index);
- MMU_GetTLBEntry(index, &tagWord, &dataWord, &pid);
- printk(" -- reads back $%" PRIx32 " : $%" PRIx32
- ", PID %d\n",tagWord,dataWord,pid);
- } else {
- #ifdef qLogTLBDetails
- printk(" Add TLB %d: At %X for $%X sizecode %d tagWord $%X\n",index, startAt, mask+1,sizeCode,tagWord);
- #endif
- }
- }
-
- /* Subtract block from startAddr and nBytes */
- mask++; /* Convert to a byte count */
- startAt += mask;
- nBytes -= mask;
- }
- #ifdef qLogTLB
- printk(" %d in use\n",sNInUse);
- #endif
-}
-
-void
-mmu_remove_space(uint32_t startAt, uint32_t endAt)
-{
- int16_t index;
- int32_t size;
- uint32_t tagword, dataword, nBytes;
- uint8_t pid, sCode;
-
- nBytes = endAt - startAt;
-
- #ifdef qLogTLB
- printk("TLB: delete entries for $%X bytes from $%X\n",nBytes,startAt);
- #endif
-
- while (nBytes > 0) {
- index = MMU_FindTLBEntry( (uint32_t)startAt );
- size = 1024;
- if (index >= 0) {
- MMU_GetTLBEntry(index, &tagword, &dataword, &pid);
- if ((tagword & 0x40) == 0)
- MMUFault("Undefine failed: redundant entries?");
- if ((tagword & 0xFFFFFC00) != (uint32_t)startAt)
- MMUFault("Undefine not on TLB boundary");
- FreeTLB(index);
- sCode = (tagword >> 7) & 7;
- while (sCode > 0) {
- size <<= 2;
- sCode--;
- }
- #ifdef qLogTLBDetails
- printk(" Free TLB %d: At %X for $%X\n",index, startAt, size);
- #endif
- }
- startAt += size;
- nBytes -= size;
- }
-}
-
-void
-mmu_add_space(uint32_t startAddr, uint32_t endAddr, MMUAccessType permissions, uint8_t processID)
-/* Convert accesstype to write-enable, executable, and cache-inhibit bits */
-{
- bool EX, WR, I;
-
- EX = false;
- WR = false;
- I = false;
- switch (permissions) {
- case executable : EX = true; break;
- case readOnlyData : break;
- case readOnlyNoCache : I = true; break;
- case readWriteData : WR = true; break;
- case readWriteNoCache : WR = true; I= true; break;
- case readWriteExecutable: WR = true; EX = true; break;
- }
- MakeTLBEntries( (uint32_t)startAddr, (uint32_t)(endAddr-startAddr+1), EX, WR, I, processID);
-}
-
-int
-mmu_get_tlb_count(void)
-{
- return sNInUse;
-}
-
-/*---------------------------- CPU process ID handling ----------------------------------
- * Really dumb system where we just hand out sequential numbers and eventually fail
- * As long as we only use 8-9 processes this isn't a problem */
-
-static uint8_t sNextPID = 1;
-
-#define SPR_PID 0x3B1
-
-uint8_t mmu_new_processID(void)
-{
- return sNextPID++;
-}
-
-void mmu_free_processID(uint8_t freeThis)
-{
-}
-
-uint8_t mmu_current_processID(void)
-{
- return PPC_SPECIAL_PURPOSE_REGISTER(SPR_PID);
-}
-
-uint8_t mmu_set_processID(uint8_t newID)
-{
- uint8_t prev = mmu_current_processID();
- PPC_SET_SPECIAL_PURPOSE_REGISTER(SPR_PID,newID);
- return prev;
-}
-
-
-/* ------------------ Fault handlers ------------------ */
-
-#define SPR_ESR 0x3D4
-#define SPR_DEAR 0x3D5
-
-enum { kESR_DST = 0x00800000 };
-
-int DataMissException(BSP_Exception_frame *f, unsigned int vector)
-{
- uint32_t addr, excSyn;
-
- addr = PPC_SPECIAL_PURPOSE_REGISTER(SPR_DEAR);
- excSyn = PPC_SPECIAL_PURPOSE_REGISTER(SPR_ESR);
- if (excSyn & kESR_DST) printk("\n---Data write to $%" PRIx32
- " attempted at $%" PRIxPTR "\n",addr,f->EXC_SRR0);
- else printk("\n---Data read from $%" PRIx32 " attempted at $%"
- PRIxPTR "\n",addr,f->EXC_SRR0);
- return -1;
-}
-
-int InstructionMissException(BSP_Exception_frame *f, unsigned int vector)
-{
- printk("\n---Instruction fetch attempted from $%" PRIxPTR ", no TLB exists\n",
- f->EXC_SRR0);
- return -1;
-}
-
-int InstructionFetchException(BSP_Exception_frame *f, unsigned int vector)
-{
- printk("\n---Instruction fetch attempted from $%" PRIxPTR
- ", TLB is no-execute\n",f->EXC_SRR0);
- return -1;
-}
diff --git a/bsps/powerpc/haleakala/start/mmu_405asm.S b/bsps/powerpc/haleakala/start/mmu_405asm.S
deleted file mode 100644
index 5fef5fb11f..0000000000
--- a/bsps/powerpc/haleakala/start/mmu_405asm.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-
-Low-level interface to the PPC405 MMU
-
-M.Hamel ADInstruments 2008
-
-*/
-
-#include <rtems/asm.h>
-
-/* Useful MMU SPR values */
-
-#define SPR_ZPR 0x3B0
-#define SPR_PID 0x3B1
-
- .text
-
-/* void MMU_ClearTLBs(); */
- PUBLIC_VAR(MMU_ClearTLBs)
-SYM (MMU_ClearTLBs):
- tlbia
- isync
- lis r3,0x5555 // *** Gratuitous fiddle of ZPR to 0101010101 to take it out of
- mtspr SPR_ZPR,r3 // the picture
- blr
-
-/* void MMU_SetTLBEntry(UInt8 index, UInt32 tagword, UInt32 dataword, UInt8 SPR_PID) */
- PUBLIC_VAR(MMU_SetTLBEntry)
-SYM (MMU_SetTLBEntry):
- mfspr r7,SPR_PID // Save the current SPR_PID
- mtspr SPR_PID,r6 // Write to SPR_PID
- tlbwehi r4,r3 // Write hiword
- mtspr SPR_PID,r7 // Restore the SPR_PID
- tlbwelo r5,r3 // Write loword
- isync
- blr
-
-/* void MMU_GetTLBEntry(UInt8 index, UInt32& tagword, UInt32& dataword, UInt8& SPR_PID) */
- PUBLIC_VAR(MMU_GetTLBEntry)
-SYM (MMU_GetTLBEntry):
- mfspr r7,SPR_PID // Save the current SPR_PID
- tlbrehi r8,r3 // Read hiword & SPR_PID
- mfspr r9,SPR_PID // Copy the SPR_PID
- mtspr SPR_PID,r7 // Restore original SPR_PID so we can proceed
- stw r8,0(r4) // Write to r4 pointer
- stb r9,0(r6) // Write to r6 pointer
- tlbrelo r8,r3 // Read loword
- stw r8,0(r5) // Write to r5 pointer
- blr
-
-/* SInt16 MMU_FindTLBEntry(UInt32 address) */
-/* Returns index of covering TLB entry (0..63), or -1 if there isn't one */
- PUBLIC_VAR(MMU_FindTLBEntry)
-SYM (MMU_FindTLBEntry):
- tlbsx. r3,0,r3
- beqlr
- li r3,0xFFFFFFFF
- blr
-
-/* bool mmu_enable_code(bool enable); */
- PUBLIC_VAR(mmu_enable_code)
-SYM (mmu_enable_code):
- li r5,0x20 // IR bit
- b msrbits
-
-/* bool mmu_enable_data(bool enable); */
- PUBLIC_VAR(mmu_enable_data)
-SYM (mmu_enable_data):
- li r5,0x10 // DR bit
-msrbits: cmpwi r3,0 // Common code: parameter 0?
- mfmsr r4 // r4 = MSR state
- beq clrBit
- or r6,r4,r5 // If 1, r6 = MSR with bit set
- b setmsr
-clrBit: andc r6,r4,r5 // If 0 r6 = MSR with bit clear
-setmsr: mtmsr r6 // Write new MSR
- and. r3,r4,r5 // Result = old MSR bit
- beqlr // If zero return zero
- li r3,0xFF // If nonzero return byte -1
- blr
-
-
-
diff --git a/bsps/powerpc/haleakala/start/start.S b/bsps/powerpc/haleakala/start/start.S
deleted file mode 100644
index 43dde91255..0000000000
--- a/bsps/powerpc/haleakala/start/start.S
+++ /dev/null
@@ -1,237 +0,0 @@
-/* dlentry.s
- *
- * This file contains the entry code for RTEMS programs starting
- * after download to RAM
- *
- * Author: Thomas Doerfler <td@imd.m.isar.de>
- * IMD Ingenieurbuero fuer Microcomputertechnik
- *
- * COPYRIGHT (c) 1998 by IMD
- *
- * Changes from IMD are covered by the original distributions terms.
- * This file has been derived from the papyrus BSP:
- *
- * This file contains the entry veneer for RTEMS programs
- * downloaded to Papyrus.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * COPYRIGHT (c) 1995 by i-cubed ltd.
- *
- * To anyone who acknowledges that this file is provided "AS IS"
- * without any express or implied warranty:
- * permission to use, copy, modify, and distribute this file
- * for any purpose is hereby granted without fee, provided that
- * the above copyright notice and this notice appears in all
- * copies, and that the name of i-cubed limited not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * i-cubed limited makes no representations about the suitability
- * of this software for any purpose.
- *
- * derived from "helas403/dlentry.S":
- *
- * Further changes to derive for the PPC405CR/GP/GPr/EX/EXr
- * by Michael Hamel ADInstruments Ltd 2008
- */
-
-#include <rtems/asm.h>
-
-/*
- * The virtex ELF link scripts support three special sections:
- * .entry The actual entry point
- * .vectors The section containing the interrupt entry veneers.
- */
-
-/*
- * Downloaded code loads the vectors separately to 0x00000100,
- * so .entry can be over 256 bytes.
- *
- * The other sections are linked in the following order:
- * .entry
- * .text
- * .data
- * .bss
- * see linker command file for section placement
- *
- * The initial stack is set to _ISR_Stack_area_end.
- *
- * All the entry veneer has to do is to clear the BSS.
- */
-
-/*
- * GDB likes to have debugging information for the entry veneer.
- * Here was some DWARF information. IMD removed it, because we
- * could not check, whether it was still correct. Sorry.
-
- */
-
-
- .section .entry
-
- PUBLIC_VAR (start)
- PUBLIC_VAR (download_entry)
- PUBLIC_VAR (__rtems_entry_point)
-
-SYM(start):
-SYM(download_entry):
-SYM(__rtems_entry_point):
-
- .extern SYM (boot_card)
-
- bl .startup /* First word is branch to reset_entry */
-
-
-/*---------------------------------------------------------------------------
- * Parameters from linker
- *--------------------------------------------------------------------------*/
-
-base_addr:
-toc_pointer:
- .long s.got
-bss_length:
- .long bss.size
-bss_addr:
- .long bss.start
-sbss_length:
- .long sbss.size
-sbss_addr:
- .long sbss.start
-stack_top:
- .long _ISR_Stack_area_end
-PUBLIC_VAR (text_addr)
-text_addr:
- .long text.start
-PUBLIC_VAR (text_length)
-text_length:
- .long text.size
-
-/*---------------------------------------------------------------------------
- * Reset_entry.
- *--------------------------------------------------------------------------*/
-.startup:
- /* Get entrypoint address in R1 so we can find linker variables */
- mflr r1
-
- /* Initialise procesor registers generally */
- bl init405
-
- /* Clear .bss and .sbss */
- bl bssclr
-
- /*-------------------------------------------------------------------
- * C_setup.
- *------------------------------------------------------------------*/
- lwz r1,stack_top - base_addr(r1) /* Now set R1 to stack_top */
- addi r1,r1,-56-4 /* start stack at text_addr - 56 */
- li r3,0
- stw r3, 0(r1) /* Clear stack chain */
- stw r3, 4(r1)
- stw r3, 8(r1)
- stw r3, 12(r1)
-
- bl __eabi /* Initialise EABI: sets up r2 & r13 */
-
- li r3, 0 /* command line */
-
- b SYM (boot_card) /* call the first C routine */
-
-/*---------------------------------------------------------------------------
- * bssclr.
- *--------------------------------------------------------------------------*/
-bssclr: lwz r2,bss_addr-base_addr(r1) /* start of bss set by loader */
- lwz r3,bss_length-base_addr(r1) /* bss length */
- srwi. r3,r3,2 /* div 4 to get # of words */
- li r0,0
- beq dosbss /* no bss */
- mtctr r3 /* set ctr reg */
- subi r2,r2,4
-clear_bss: stwu r0,4(r2)
- bdnz clear_bss /* decrement counter and loop */
-
-dosbss: lwz r2,sbss_addr-base_addr(r1) /* start of sbss set by loader */
- lwz r3,sbss_length-base_addr(r1) /* sbss length */
- slwi. r3,r3,2 /* div 4 to get # of words */
- subi r2,r2,4
- beqlr /* no sbss */
- mtctr r3 /* set ctr reg */
-clear_sbss: stwu r0,4(r2)
- bdnz clear_sbss /* decrement counter and loop */
-
- blr /* return */
-
-
-/*---------------------------------------------------------------------------
- * Generic 405 register setup
- *--------------------------------------------------------------------------*/
-init405:
- li r0, 0
- mtmsr r0
- mticcr r0
- mtdccr r0
-
- li r3,0x7FFC # 405EX-specific
- mtsgr r3 # Clear guarded mode on all storage except PCIe region
-
- mtsler r0 # Storage is all big-endian
- mtsu0r r0 # and uncompressed
-
- iccci r3,0 # Invalidate the instruction cache
- li r3,1 # Enable F800 0000 to FFFF FFFF
- oris r3,r3,0xC000 # Enable 0000 0000 to 0FFF FFFF
- mticcr r3
- isync
-
- li r3,0
- li r4,256 # 405 has 128 or 256 32-byte lines: do 256
- mtctr r4 # set loop ctr
-dcloop: dccci 0,r3 # invalidate line
- addi r3,r3,0x20 # bump to next line
- bdnz dcloop
- mtdcwr r0 # Select write-back caching
- lis r3,0xC000 # Enable 0000 0000 to 0FFF FFFF
- # mtdccr r3 # Enable data cache
-
- mtevpr r0
- mtesr r0
- mtxer r0
-
- lwarx r3,r0,r0 # get some data/set resv bit
- stwcx. r3,r0,r0 # store out and clear resv bit
-
- lis r3,0xDEAD
- ori r3,r3,0xBEEF # Make distintive uninitialised value
- mr r4, r3
- mr r5, r3
- mr r6, r3
- mr r7, r3
- mr r8, r3
- mr r9, r3
- mr r10, r3
- mr r11, r3
- mr r12, r3
- mr r13, r3
- mr r14, r3
- mr r15, r3
- mr r16, r3
- mr r17, r3
- mr r18, r3
- mr r19, r3
- mr r20, r3
- mr r21, r3
- mr r22, r3
- mr r23, r3
- mr r24, r3
- mr r25, r3
- mr r26, r3
- mr r27, r3
- mr r28, r3
- mr r29, r3
- mr r30, r3
- mr r31, r3
-
- blr
-
-.L_text_e:
-
- .comm environ,4,4
diff --git a/bsps/powerpc/motorola_powerpc/start/bsp_specs b/bsps/powerpc/motorola_powerpc/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/motorola_powerpc/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/mpc55xxevb/start/bsp_specs b/bsps/powerpc/mpc55xxevb/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/mpc55xxevb/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/mpc8260ads/start/bsp_specs b/bsps/powerpc/mpc8260ads/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/mpc8260ads/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/mvme3100/start/bsp_specs b/bsps/powerpc/mvme3100/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/mvme3100/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/mvme5500/start/bsp_specs b/bsps/powerpc/mvme5500/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/mvme5500/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/psim/start/bsp_specs b/bsps/powerpc/psim/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/psim/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/qemuppc/start/bsp_specs b/bsps/powerpc/qemuppc/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/qemuppc/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/qoriq/irq/irq.c b/bsps/powerpc/qoriq/irq/irq.c
index 01e24998ba..dbc6ef2a78 100644
--- a/bsps/powerpc/qoriq/irq/irq.c
+++ b/bsps/powerpc/qoriq/irq/irq.c
@@ -280,6 +280,11 @@ static volatile qoriq_pic_src_cfg *get_src_cfg(rtems_vector_number vector)
}
}
+static bool is_ipi(rtems_vector_number vector)
+{
+ return (vector - QORIQ_IRQ_IPI_BASE) < 4;
+}
+
rtems_status_code qoriq_pic_set_priority(
rtems_vector_number vector,
int new_priority,
@@ -320,8 +325,13 @@ rtems_status_code bsp_interrupt_set_affinity(
const Processor_mask *affinity
)
{
- volatile qoriq_pic_src_cfg *src_cfg = get_src_cfg(vector);
+ volatile qoriq_pic_src_cfg *src_cfg;
+ if (is_ipi(vector)) {
+ return RTEMS_UNSATISFIED;
+ }
+
+ src_cfg = get_src_cfg(vector);
src_cfg->dr = _Processor_mask_To_uint32_t(affinity, 0);
return RTEMS_SUCCESSFUL;
}
@@ -331,57 +341,96 @@ rtems_status_code bsp_interrupt_get_affinity(
Processor_mask *affinity
)
{
- volatile qoriq_pic_src_cfg *src_cfg = get_src_cfg(vector);
+ volatile qoriq_pic_src_cfg *src_cfg;
+
+ if (is_ipi(vector)) {
+ return RTEMS_UNSATISFIED;
+ }
+ src_cfg = get_src_cfg(vector);
_Processor_mask_From_uint32_t(affinity, src_cfg->dr, 0);
return RTEMS_SUCCESSFUL;
}
static void pic_vector_enable(rtems_vector_number vector, uint32_t msk)
{
- volatile qoriq_pic_src_cfg *src_cfg = get_src_cfg(vector);
+ volatile qoriq_pic_src_cfg *src_cfg;
rtems_interrupt_lock_context lock_context;
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
+ src_cfg = get_src_cfg(vector);
rtems_interrupt_lock_acquire(&lock, &lock_context);
src_cfg->vpr = (src_cfg->vpr & ~VPR_MSK) | msk;
rtems_interrupt_lock_release(&lock, &lock_context);
}
rtems_status_code bsp_interrupt_get_attributes(
- rtems_vector_number vector,
- rtems_interrupt_attributes *attributes
+ rtems_vector_number vector,
+ rtems_interrupt_attributes *attributes
)
{
- return RTEMS_SUCCESSFUL;
+ bool vector_is_ipi = is_ipi(vector);
+ attributes->is_maskable = true;
+ attributes->can_enable = true;
+ attributes->maybe_enable = true;
+ attributes->can_disable = true;
+ attributes->maybe_disable = true;
+ attributes->cleared_by_acknowledge = true;
+ attributes->can_get_affinity = !vector_is_ipi;
+ attributes->can_set_affinity = !vector_is_ipi;
+ attributes->can_raise = vector_is_ipi;
+ attributes->can_raise_on = vector_is_ipi;
+ return RTEMS_SUCCESSFUL;
}
rtems_status_code bsp_interrupt_is_pending(
- rtems_vector_number vector,
- bool *pending
+ rtems_vector_number vector,
+ bool *pending
)
{
- bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
- bsp_interrupt_assert(pending != NULL);
- *pending = false;
- return RTEMS_UNSATISFIED;
+ volatile qoriq_pic_src_cfg *src_cfg;
+
+ bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
+ bsp_interrupt_assert(pending != NULL);
+
+ src_cfg = get_src_cfg(vector);
+ *pending = (src_cfg->vpr & VPR_A) != 0;
+ return RTEMS_SUCCESSFUL;
+}
+
+static void raise_on(rtems_vector_number vector, uint32_t cpu_index)
+{
+ rtems_vector_number ipi_index = vector - QORIQ_IRQ_IPI_BASE;
+ qoriq.pic.ipidr[ipi_index].reg = 1U << cpu_index;
}
rtems_status_code bsp_interrupt_raise(rtems_vector_number vector)
{
- bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
- return RTEMS_UNSATISFIED;
+ bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
+
+ if (is_ipi(vector)) {
+ raise_on(vector, rtems_scheduler_get_processor());
+ return RTEMS_SUCCESSFUL;
+ }
+
+ return RTEMS_UNSATISFIED;
}
#if defined(RTEMS_SMP)
rtems_status_code bsp_interrupt_raise_on(
- rtems_vector_number vector,
- uint32_t cpu_index
+ rtems_vector_number vector,
+ uint32_t cpu_index
)
{
- bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
- return RTEMS_UNSATISFIED;
+ bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
+
+ if (is_ipi(vector)) {
+ raise_on(vector, cpu_index);
+ return RTEMS_SUCCESSFUL;
+ }
+
+ return RTEMS_UNSATISFIED;
}
#endif
@@ -392,14 +441,18 @@ rtems_status_code bsp_interrupt_clear(rtems_vector_number vector)
}
rtems_status_code bsp_interrupt_vector_is_enabled(
- rtems_vector_number vector,
- bool *enabled
+ rtems_vector_number vector,
+ bool *enabled
)
{
- bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
- bsp_interrupt_assert(enabled != NULL);
- *enabled = false;
- return RTEMS_UNSATISFIED;
+ volatile qoriq_pic_src_cfg *src_cfg;
+
+ bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
+ bsp_interrupt_assert(enabled != NULL);
+
+ src_cfg = get_src_cfg(vector);
+ *enabled = (src_cfg->vpr & VPR_MSK) == 0;
+ return RTEMS_SUCCESSFUL;
}
rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
diff --git a/bsps/powerpc/qoriq/start/bsp_specs b/bsps/powerpc/qoriq/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/qoriq/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/ss555/start/bsp_specs b/bsps/powerpc/ss555/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/ss555/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/t32mppc/start/bsp_specs b/bsps/powerpc/t32mppc/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/t32mppc/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/tqm8xx/start/bsp_specs b/bsps/powerpc/tqm8xx/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/tqm8xx/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/virtex/start/bsp_specs b/bsps/powerpc/virtex/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/virtex/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/virtex4/start/bsp_specs b/bsps/powerpc/virtex4/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/virtex4/start/bsp_specs
+++ /dev/null
diff --git a/bsps/powerpc/virtex5/start/bsp_specs b/bsps/powerpc/virtex5/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/powerpc/virtex5/start/bsp_specs
+++ /dev/null
diff --git a/bsps/riscv/griscv/start/bsp_specs b/bsps/riscv/griscv/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/riscv/griscv/start/bsp_specs
+++ /dev/null
diff --git a/bsps/riscv/riscv/start/bsp_specs b/bsps/riscv/riscv/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/riscv/riscv/start/bsp_specs
+++ /dev/null
diff --git a/bsps/sh/gensh1/start/bsp_specs b/bsps/sh/gensh1/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/sh/gensh1/start/bsp_specs
+++ /dev/null
diff --git a/bsps/sh/gensh2/start/bsp_specs b/bsps/sh/gensh2/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/sh/gensh2/start/bsp_specs
+++ /dev/null
diff --git a/bsps/sh/gensh4/start/bsp_specs b/bsps/sh/gensh4/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/sh/gensh4/start/bsp_specs
+++ /dev/null
diff --git a/bsps/sh/shsim/start/bsp_specs b/bsps/sh/shsim/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/sh/shsim/start/bsp_specs
+++ /dev/null
diff --git a/bsps/shared/dev/btimer/btimer-stub.c b/bsps/shared/dev/btimer/btimer-stub.c
deleted file mode 100644
index d1e3313115..0000000000
--- a/bsps/shared/dev/btimer/btimer-stub.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * This file implements a stub benchmark timer that is sufficient to
- * satisfy linking the RTEMS Benchmarks.
- *
- * COPYRIGHT (c) 1989-2001.
- * On-Line Applications Research Corporation (OAR).
- */
-
-#include <bsp.h>
-#include <rtems/btimer.h>
-
-bool benchmark_timer_find_average_overhead;
-
-void benchmark_timer_initialize(void)
-{
-}
-
-benchmark_timer_t benchmark_timer_read(void)
-{
- if (benchmark_timer_find_average_overhead)
- return 1;
- return 0;
-}
-
-void benchmark_timer_disable_subtracting_average_overhead(
- bool find_flag
-)
-{
- benchmark_timer_find_average_overhead = find_flag;
-}
diff --git a/bsps/shared/dev/irq/arm-gicv3.c b/bsps/shared/dev/irq/arm-gicv3.c
index ea123d325e..afe21a8e15 100644
--- a/bsps/shared/dev/irq/arm-gicv3.c
+++ b/bsps/shared/dev/irq/arm-gicv3.c
@@ -312,14 +312,10 @@ rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
volatile gic_sgi_ppi *sgi_ppi =
gicv3_get_sgi_ppi(_SMP_Get_current_processor());
- /* Set interrupt group to 1 in the current security mode */
-#if defined(ARM_MULTILIB_ARCH_V4) || defined(AARCH64_IS_NONSECURE)
+ /* Set G1NS */
sgi_ppi->icspigrpr[0] |= 1U << vector;
sgi_ppi->icspigrpmodr[0] &= ~(1U << vector);
-#else
- sgi_ppi->icspigrpr[0] &= ~(1U << vector);
- sgi_ppi->icspigrpmodr[0] |= 1U << vector;
-#endif
+
/* Set enable */
sgi_ppi->icspiser[0] = 1U << vector;
}
@@ -355,6 +351,34 @@ static inline uint32_t get_id_count(volatile gic_dist *dist)
return id_count;
}
+static void gicv3_init_dist(void)
+{
+ volatile gic_dist *dist = ARM_GIC_DIST;
+ uint32_t id_count = get_id_count(dist);
+ uint32_t id;
+
+ dist->icddcr = GIC_DIST_ICDDCR_ARE_NS | GIC_DIST_ICDDCR_ARE_S
+ | GIC_DIST_ICDDCR_ENABLE_GRP1S | GIC_DIST_ICDDCR_ENABLE_GRP1NS
+ | GIC_DIST_ICDDCR_ENABLE_GRP0;
+
+ for (id = 0; id < id_count; id += 32) {
+ /* Disable all interrupts */
+ dist->icdicer[id / 32] = 0xffffffff;
+
+ /* Set G1NS */
+ dist->icdigr[id / 32] = 0xffffffff;
+ dist->icdigmr[id / 32] = 0;
+ }
+
+ for (id = 0; id < id_count; ++id) {
+ gic_id_set_priority(dist, id, PRIORITY_DEFAULT);
+ }
+
+ for (id = 32; id < id_count; ++id) {
+ gic_id_set_targets(dist, id, 0x01);
+ }
+}
+
static void gicv3_init_cpu_interface(void)
{
uint32_t cpu_index = _SMP_Get_current_processor();
@@ -370,14 +394,9 @@ static void gicv3_init_cpu_interface(void)
redist->icrwaker = waker;
volatile gic_sgi_ppi *sgi_ppi = gicv3_get_sgi_ppi(cpu_index);
- /* Set interrupt group to 1 in the current security mode */
-#if defined(ARM_MULTILIB_ARCH_V4) || defined(AARCH64_IS_NONSECURE)
+ /* Set G1NS */
sgi_ppi->icspigrpr[0] = 0xffffffff;
sgi_ppi->icspigrpmodr[0] = 0;
-#else
- sgi_ppi->icspigrpr[0] = 0x0;
- sgi_ppi->icspigrpmodr[0] = 0xffffffff;
-#endif
for (int id = 0; id < 32; id++) {
sgi_ppi->icspiprior[id] = PRIORITY_DEFAULT;
}
@@ -390,38 +409,8 @@ static void gicv3_init_cpu_interface(void)
void bsp_interrupt_facility_initialize(void)
{
- volatile gic_dist *dist = ARM_GIC_DIST;
- uint32_t id_count = get_id_count(dist);
- uint32_t id;
-
arm_interrupt_facility_set_exception_handler();
-
- dist->icddcr = GIC_DIST_ICDDCR_ARE_NS | GIC_DIST_ICDDCR_ARE_S
- | GIC_DIST_ICDDCR_ENABLE_GRP1S | GIC_DIST_ICDDCR_ENABLE_GRP1NS
- | GIC_DIST_ICDDCR_ENABLE_GRP0;
-
- for (id = 0; id < id_count; id += 32) {
- /* Disable all interrupts */
- dist->icdicer[id / 32] = 0xffffffff;
-
- /* Set interrupt group to 1 in the current security mode */
-#if defined(ARM_MULTILIB_ARCH_V4) || defined(AARCH64_IS_NONSECURE)
- dist->icdigr[id / 32] = 0xffffffff;
- dist->icdigmr[id / 32] = 0;
-#else
- dist->icdigr[id / 32] = 0;
- dist->icdigmr[id / 32] = 0xffffffff;
-#endif
- }
-
- for (id = 0; id < id_count; ++id) {
- gic_id_set_priority(dist, id, PRIORITY_DEFAULT);
- }
-
- for (id = 32; id < id_count; ++id) {
- gic_id_set_targets(dist, id, 0x01);
- }
-
+ gicv3_init_dist();
gicv3_init_cpu_interface();
}
diff --git a/bsps/shared/start/bsp-fdt.c b/bsps/shared/start/bsp-fdt.c
index 50a485eb16..bdb33be2e8 100644
--- a/bsps/shared/start/bsp-fdt.c
+++ b/bsps/shared/start/bsp-fdt.c
@@ -28,17 +28,17 @@
#endif
#ifdef BSP_FDT_BLOB_READ_ONLY
-static const uint32_t
-bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] CPU_STRUCTURE_ALIGNMENT =
+static RTEMS_ALIGNED(8) const uint32_t
+bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] =
{ 0xdeadbeef };
#else
-static uint32_t
-bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] CPU_STRUCTURE_ALIGNMENT;
+static RTEMS_ALIGNED(8) uint32_t
+bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)];
#endif
void bsp_fdt_copy(const void *src)
{
- const uint32_t *s = (const uint32_t *) src;
+ const volatile uint32_t *s = (const uint32_t *) src;
#ifdef BSP_FDT_BLOB_COPY_TO_READ_ONLY_LOAD_AREA
uint32_t *d = (uint32_t *) ((uintptr_t) &bsp_fdt_blob[0]
- (uintptr_t) bsp_section_rodata_begin
diff --git a/bsps/shared/start/mallocinitmulti.c b/bsps/shared/start/mallocinitmulti.c
new file mode 100644
index 0000000000..ad04ea14ed
--- /dev/null
+++ b/bsps/shared/start/mallocinitmulti.c
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup MallocSupport
+ *
+ * @brief This source file contains the _Workspace_Malloc_initialize_separate()
+ * implementation which supports more than one memory area.
+ */
+
+/*
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/mallocinitmulti.h>
+#include <rtems/score/wkspacedata.h>
+
+static Heap_Control _Malloc_Heap;
+
+Heap_Control *_Workspace_Malloc_initialize_separate( void )
+{
+ return _Malloc_Initialize_for_multiple_areas( &_Malloc_Heap );
+}
diff --git a/bsps/shared/start/mallocinitone.c b/bsps/shared/start/mallocinitone.c
new file mode 100644
index 0000000000..249f0b8e02
--- /dev/null
+++ b/bsps/shared/start/mallocinitone.c
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup MallocSupport
+ *
+ * @brief This source file contains the _Workspace_Malloc_initialize_separate()
+ * implementation which supports exactly one memory area.
+ */
+
+/*
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/mallocinitone.h>
+#include <rtems/score/wkspacedata.h>
+
+static Heap_Control _Malloc_Heap;
+
+Heap_Control *_Workspace_Malloc_initialize_separate( void )
+{
+ return _Malloc_Initialize_for_one_area( &_Malloc_Heap );
+}
diff --git a/bsps/shared/start/wkspaceinitmulti.c b/bsps/shared/start/wkspaceinitmulti.c
new file mode 100644
index 0000000000..2a0d0b5806
--- /dev/null
+++ b/bsps/shared/start/wkspaceinitmulti.c
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreWorkspace
+ *
+ * @brief This source file contains the _Workspace_Handler_initialization()
+ * implementation which supports more than one memory area.
+ */
+
+/*
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/wkspaceinitmulti.h>
+
+void _Workspace_Handler_initialization( void )
+{
+ _Workspace_Initialize_for_multiple_areas();
+}
diff --git a/bsps/shared/start/wkspaceinitone.c b/bsps/shared/start/wkspaceinitone.c
new file mode 100644
index 0000000000..91d007d100
--- /dev/null
+++ b/bsps/shared/start/wkspaceinitone.c
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSScoreWorkspace
+ *
+ * @brief This source file contains the _Workspace_Handler_initialization()
+ * implementation which supports exactly one memory area.
+ */
+
+/*
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/wkspaceinitone.h>
+
+void _Workspace_Handler_initialization( void )
+{
+ _Workspace_Initialize_for_one_area();
+}
diff --git a/bsps/sparc/erc32/start/bsp_specs b/bsps/sparc/erc32/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/sparc/erc32/start/bsp_specs
+++ /dev/null
diff --git a/bsps/sparc/leon2/start/bsp_specs b/bsps/sparc/leon2/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/sparc/leon2/start/bsp_specs
+++ /dev/null
diff --git a/bsps/sparc/leon3/clock/ckinit.c b/bsps/sparc/leon3/clock/ckinit.c
index 4d30e0fd64..69afb25f3c 100644
--- a/bsps/sparc/leon3/clock/ckinit.c
+++ b/bsps/sparc/leon3/clock/ckinit.c
@@ -133,16 +133,22 @@ static void leon3_tc_do_tick(void)
#define Clock_driver_support_install_isr(isr) \
bsp_clock_handler_install(isr)
+static rtems_interrupt_entry leon3_clock_interrupt_entry;
+
static void bsp_clock_handler_install(rtems_interrupt_handler isr)
{
rtems_status_code sc;
- sc = rtems_interrupt_handler_install(
+ rtems_interrupt_entry_initialize(
+ &leon3_clock_interrupt_entry,
+ isr,
+ NULL,
+ "Clock"
+ );
+ sc = rtems_interrupt_entry_install(
clkirq,
- "Clock",
RTEMS_INTERRUPT_UNIQUE,
- isr,
- NULL
+ &leon3_clock_interrupt_entry
);
if (sc != RTEMS_SUCCESSFUL) {
rtems_fatal(RTEMS_FATAL_SOURCE_BSP, LEON3_FATAL_CLOCK_INITIALIZATION);
diff --git a/bsps/sparc/leon3/include/tm27.h b/bsps/sparc/leon3/include/tm27.h
index dda21f558f..99c79012bd 100644
--- a/bsps/sparc/leon3/include/tm27.h
+++ b/bsps/sparc/leon3/include/tm27.h
@@ -21,7 +21,11 @@
#define __tm27_h
#include <bsp.h>
-#include <leon.h>
+#include <bsp/irq.h>
+
+#if defined(RTEMS_SMP)
+#include <rtems/score/smpimpl.h>
+#endif
/*
* Define the interrupt mechanism for Time Test 27
@@ -59,40 +63,73 @@
#else /* use a regular asynchronous trap */
-#define TEST_INTERRUPT_SOURCE LEON_INTERRUPT_EXTERNAL_1
-#define TEST_INTERRUPT_SOURCE2 LEON_INTERRUPT_EXTERNAL_1+1
+extern uint32_t Interrupt_nest;
+
+#define TEST_INTERRUPT_SOURCE 5
+#define TEST_INTERRUPT_SOURCE2 6
#define MUST_WAIT_FOR_INTERRUPT 1
static inline void Install_tm27_vector(
void ( *handler )( rtems_vector_number )
)
{
- (void) rtems_interrupt_handler_install(
+ static rtems_interrupt_entry entry_low;
+ static rtems_interrupt_entry entry_high;
+
+#if defined(RTEMS_SMP)
+ bsp_interrupt_set_affinity(
+ TEST_INTERRUPT_SOURCE,
+ _SMP_Get_online_processors()
+ );
+ bsp_interrupt_set_affinity(
+ TEST_INTERRUPT_SOURCE2,
+ _SMP_Get_online_processors()
+ );
+#endif
+
+ rtems_interrupt_entry_initialize(
+ &entry_low,
+ (rtems_interrupt_handler) handler,
+ NULL,
+ "tm27 low"
+ );
+ (void) rtems_interrupt_entry_install(
TEST_INTERRUPT_SOURCE,
- "tm27 low",
RTEMS_INTERRUPT_SHARED,
+ &entry_low
+ );
+ rtems_interrupt_entry_initialize(
+ &entry_high,
(rtems_interrupt_handler) handler,
- NULL
+ NULL,
+ "tm27 high"
);
- (void) rtems_interrupt_handler_install(
+ (void) rtems_interrupt_entry_install(
TEST_INTERRUPT_SOURCE2,
- "tm27 high",
RTEMS_INTERRUPT_SHARED,
- (rtems_interrupt_handler) handler,
- NULL
+ &entry_high
);
}
-#define Cause_tm27_intr() \
- do { \
- LEON_Force_interrupt( TEST_INTERRUPT_SOURCE+(Interrupt_nest>>1)); \
- nop(); \
- nop(); \
- nop(); \
- } while (0)
-
-#define Clear_tm27_intr() \
- LEON_Clear_interrupt( TEST_INTERRUPT_SOURCE )
+static inline void Cause_tm27_intr( void )
+{
+ rtems_vector_number vector;
+
+ vector = TEST_INTERRUPT_SOURCE + ( Interrupt_nest >> 1 );
+#if defined(RTEMS_SMP)
+ (void) rtems_interrupt_raise_on( vector, rtems_scheduler_get_processor() );
+#else
+ (void) rtems_interrupt_raise( vector );
+#endif
+ nop();
+ nop();
+ nop();
+}
+
+static inline void Clear_tm27_intr( void )
+{
+ (void) rtems_interrupt_clear( TEST_INTERRUPT_SOURCE );
+}
#define Lower_tm27_intr() /* empty */
diff --git a/bsps/sparc/leon3/start/bsp_specs b/bsps/sparc/leon3/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/sparc/leon3/start/bsp_specs
+++ /dev/null
diff --git a/bsps/sparc/leon3/start/bspsmp.c b/bsps/sparc/leon3/start/bspsmp.c
index a556da1e09..acd932843a 100644
--- a/bsps/sparc/leon3/start/bspsmp.c
+++ b/bsps/sparc/leon3/start/bspsmp.c
@@ -51,6 +51,13 @@ void bsp_start_on_secondary_processor(Per_CPU_Control *cpu_self)
_SMP_Start_multitasking_on_secondary_processor(cpu_self);
}
+static rtems_interrupt_entry leon3_inter_processor_interrupt_entry =
+ RTEMS_INTERRUPT_ENTRY_INITIALIZER(
+ bsp_inter_processor_interrupt,
+ NULL,
+ "IPI"
+ );
+
static void leon3_install_inter_processor_interrupt( void )
{
rtems_status_code sc;
@@ -60,12 +67,10 @@ static void leon3_install_inter_processor_interrupt( void )
bsp_interrupt_set_affinity( irq, _SMP_Get_online_processors() );
- sc = rtems_interrupt_handler_install(
+ sc = rtems_interrupt_entry_install(
irq,
- "IPI",
RTEMS_INTERRUPT_SHARED,
- bsp_inter_processor_interrupt,
- NULL
+ &leon3_inter_processor_interrupt_entry
);
_Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL );
}
@@ -100,7 +105,7 @@ void _CPU_SMP_Finalize_initialization( uint32_t cpu_count )
void _CPU_SMP_Prepare_start_multitasking( void )
{
- rtems_cache_invalidate_entire_instruction();
+ /* Do nothing */
}
void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)
diff --git a/bsps/sparc64/niagara/start/bsp_specs b/bsps/sparc64/niagara/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/sparc64/niagara/start/bsp_specs
+++ /dev/null
diff --git a/bsps/sparc64/usiii/start/bsp_specs b/bsps/sparc64/usiii/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/sparc64/usiii/start/bsp_specs
+++ /dev/null
diff --git a/bsps/v850/gdbv850sim/start/bsp_specs b/bsps/v850/gdbv850sim/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/v850/gdbv850sim/start/bsp_specs
+++ /dev/null
diff --git a/bsps/x86_64/amd64/start/bsp_specs b/bsps/x86_64/amd64/start/bsp_specs
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bsps/x86_64/amd64/start/bsp_specs
+++ /dev/null
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/doxygen/appl-config.h b/cpukit/doxygen/appl-config.h
index c0e5b0b717..4735af8766 100644
--- a/cpukit/doxygen/appl-config.h
+++ b/cpukit/doxygen/appl-config.h
@@ -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 */
/**
diff --git a/cpukit/dtc/VERSION b/cpukit/dtc/VERSION
index a6f7720958..77198ab947 100644
--- a/cpukit/dtc/VERSION
+++ b/cpukit/dtc/VERSION
@@ -4,15 +4,15 @@ git://git.kernel.org/pub/scm/utils/dtc/dtc.git
Commit:
-0f61c72dedc4bf11cd19a78fc36a7bde99d653e0
+17739b7ef510917471409d71fb45d8eaf6a1e1fb
Date:
-Thu Feb 20 14:45:57 2020 -0700
+Thu Dec 9 07:14:20 2021 +0100
Commands to generate update patches:
-git format-patch 0f61c72dedc4bf11cd19a78fc36a7bde99d653e0 -- libfdt/fdt_addresses.c libfdt/fdt.c libfdt/fdt_empty_tree.c libfdt/fdt.h libfdt/fdt_ro.c libfdt/fdt_rw.c libfdt/fdt_strerror.c libfdt/fdt_sw.c libfdt/fdt_wip.c libfdt/libfdt_env.h libfdt/libfdt.h libfdt/libfdt_internal.h libfdt/TODO
+git format-patch 17739b7ef510917471409d71fb45d8eaf6a1e1fb -- libfdt/fdt_addresses.c libfdt/fdt.c libfdt/fdt_empty_tree.c libfdt/fdt.h libfdt/fdt_ro.c libfdt/fdt_rw.c libfdt/fdt_strerror.c libfdt/fdt_sw.c libfdt/fdt_wip.c libfdt/libfdt_env.h libfdt/libfdt.h libfdt/libfdt_internal.h libfdt/TODO
sed -i 's%/libfdt/fdt.h%/cpukit/include/fdt.h%g' 00*
sed -i 's%/libfdt/libfdt.h%/cpukit/include/libfdt.h%g' 00*
sed -i 's%/libfdt/libfdt_env.h%/cpukit/include/libfdt_env.h%g' 00*
diff --git a/cpukit/dtc/libfdt/fdt.c b/cpukit/dtc/libfdt/fdt.c
index 4419204a86..9fe7cf4b74 100644
--- a/cpukit/dtc/libfdt/fdt.c
+++ b/cpukit/dtc/libfdt/fdt.c
@@ -22,6 +22,10 @@ int32_t fdt_ro_probe_(const void *fdt)
if (can_assume(VALID_DTB))
return totalsize;
+ /* The device tree must be at an 8-byte aligned address */
+ if ((uintptr_t)fdt & 7)
+ return -FDT_ERR_ALIGNMENT;
+
if (fdt_magic(fdt) == FDT_MAGIC) {
/* Complete tree */
if (!can_assume(LATEST)) {
@@ -33,7 +37,7 @@ int32_t fdt_ro_probe_(const void *fdt)
}
} else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
/* Unfinished sequential-write blob */
- if (fdt_size_dt_struct(fdt) == 0)
+ if (!can_assume(VALID_INPUT) && fdt_size_dt_struct(fdt) == 0)
return -FDT_ERR_BADSTATE;
} else {
return -FDT_ERR_BADMAGIC;
@@ -86,6 +90,10 @@ int fdt_check_header(const void *fdt)
{
size_t hdrsize;
+ /* The device tree must be at an 8-byte aligned address */
+ if ((uintptr_t)fdt & 7)
+ return -FDT_ERR_ALIGNMENT;
+
if (fdt_magic(fdt) != FDT_MAGIC)
return -FDT_ERR_BADMAGIC;
if (!can_assume(LATEST)) {
@@ -134,16 +142,20 @@ int fdt_check_header(const void *fdt)
const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
{
- unsigned absoffset = offset + fdt_off_dt_struct(fdt);
+ unsigned int uoffset = offset;
+ unsigned int absoffset = offset + fdt_off_dt_struct(fdt);
+
+ if (offset < 0)
+ return NULL;
if (!can_assume(VALID_INPUT))
- if ((absoffset < offset)
+ if ((absoffset < uoffset)
|| ((absoffset + len) < absoffset)
|| (absoffset + len) > fdt_totalsize(fdt))
return NULL;
if (can_assume(LATEST) || fdt_version(fdt) >= 0x11)
- if (((offset + len) < offset)
+ if (((uoffset + len) < uoffset)
|| ((offset + len) > fdt_size_dt_struct(fdt)))
return NULL;
@@ -206,10 +218,11 @@ uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
int fdt_check_node_offset_(const void *fdt, int offset)
{
- if (can_assume(VALID_INPUT))
- return offset;
- if ((offset < 0) || (offset % FDT_TAGSIZE)
- || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE))
+ if (!can_assume(VALID_INPUT)
+ && ((offset < 0) || (offset % FDT_TAGSIZE)))
+ return -FDT_ERR_BADOFFSET;
+
+ if (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE)
return -FDT_ERR_BADOFFSET;
return offset;
@@ -217,8 +230,11 @@ int fdt_check_node_offset_(const void *fdt, int offset)
int fdt_check_prop_offset_(const void *fdt, int offset)
{
- if ((offset < 0) || (offset % FDT_TAGSIZE)
- || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP))
+ if (!can_assume(VALID_INPUT)
+ && ((offset < 0) || (offset % FDT_TAGSIZE)))
+ return -FDT_ERR_BADOFFSET;
+
+ if (fdt_next_tag(fdt, offset, &offset) != FDT_PROP)
return -FDT_ERR_BADOFFSET;
return offset;
@@ -306,9 +322,12 @@ const char *fdt_find_string_(const char *strtab, int tabsize, const char *s)
int fdt_move(const void *fdt, void *buf, int bufsize)
{
+ if (!can_assume(VALID_INPUT) && bufsize < 0)
+ return -FDT_ERR_NOSPACE;
+
FDT_RO_PROBE(fdt);
- if (fdt_totalsize(fdt) > bufsize)
+ if (fdt_totalsize(fdt) > (unsigned int)bufsize)
return -FDT_ERR_NOSPACE;
memmove(buf, fdt, fdt_totalsize(fdt));
diff --git a/cpukit/dtc/libfdt/fdt_addresses.c b/cpukit/dtc/libfdt/fdt_addresses.c
index 9a82cd0ba2..c40ba094f1 100644
--- a/cpukit/dtc/libfdt/fdt_addresses.c
+++ b/cpukit/dtc/libfdt/fdt_addresses.c
@@ -73,7 +73,7 @@ int fdt_appendprop_addrrange(void *fdt, int parent, int nodeoffset,
/* check validity of address */
prop = data;
if (addr_cells == 1) {
- if ((addr > UINT32_MAX) || ((UINT32_MAX + 1 - addr) < size))
+ if ((addr > UINT32_MAX) || (((uint64_t) UINT32_MAX + 1 - addr) < size))
return -FDT_ERR_BADVALUE;
fdt32_st(prop, (uint32_t)addr);
diff --git a/cpukit/dtc/libfdt/fdt_ro.c b/cpukit/dtc/libfdt/fdt_ro.c
index 194550344a..17584da257 100644
--- a/cpukit/dtc/libfdt/fdt_ro.c
+++ b/cpukit/dtc/libfdt/fdt_ro.c
@@ -53,7 +53,7 @@ const char *fdt_get_string(const void *fdt, int stroffset, int *lenp)
err = -FDT_ERR_BADOFFSET;
absoffset = stroffset + fdt_off_dt_strings(fdt);
- if (absoffset >= totalsize)
+ if (absoffset >= (unsigned)totalsize)
goto fail;
len = totalsize - absoffset;
@@ -61,17 +61,19 @@ const char *fdt_get_string(const void *fdt, int stroffset, int *lenp)
if (stroffset < 0)
goto fail;
if (can_assume(LATEST) || fdt_version(fdt) >= 17) {
- if (stroffset >= fdt_size_dt_strings(fdt))
+ if ((unsigned)stroffset >= fdt_size_dt_strings(fdt))
goto fail;
if ((fdt_size_dt_strings(fdt) - stroffset) < len)
len = fdt_size_dt_strings(fdt) - stroffset;
}
} else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
- if ((stroffset >= 0)
- || (stroffset < -fdt_size_dt_strings(fdt)))
+ unsigned int sw_stroffset = -stroffset;
+
+ if ((stroffset >= 0) ||
+ (sw_stroffset > fdt_size_dt_strings(fdt)))
goto fail;
- if ((-stroffset) < len)
- len = -stroffset;
+ if (sw_stroffset < len)
+ len = sw_stroffset;
} else {
err = -FDT_ERR_INTERNAL;
goto fail;
@@ -157,8 +159,8 @@ int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
static const struct fdt_reserve_entry *fdt_mem_rsv(const void *fdt, int n)
{
- int offset = n * sizeof(struct fdt_reserve_entry);
- int absoffset = fdt_off_mem_rsvmap(fdt) + offset;
+ unsigned int offset = n * sizeof(struct fdt_reserve_entry);
+ unsigned int absoffset = fdt_off_mem_rsvmap(fdt) + offset;
if (!can_assume(VALID_INPUT)) {
if (absoffset < fdt_off_mem_rsvmap(fdt))
@@ -179,8 +181,8 @@ int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
if (!can_assume(VALID_INPUT) && !re)
return -FDT_ERR_BADOFFSET;
- *address = fdt64_ld(&re->address);
- *size = fdt64_ld(&re->size);
+ *address = fdt64_ld_(&re->address);
+ *size = fdt64_ld_(&re->size);
return 0;
}
@@ -190,7 +192,7 @@ int fdt_num_mem_rsv(const void *fdt)
const struct fdt_reserve_entry *re;
for (i = 0; (re = fdt_mem_rsv(fdt, i)) != NULL; i++) {
- if (fdt64_ld(&re->size) == 0)
+ if (fdt64_ld_(&re->size) == 0)
return i;
}
return -FDT_ERR_TRUNCATED;
@@ -368,7 +370,7 @@ static const struct fdt_property *fdt_get_property_by_offset_(const void *fdt,
prop = fdt_offset_ptr_(fdt, offset);
if (lenp)
- *lenp = fdt32_ld(&prop->len);
+ *lenp = fdt32_ld_(&prop->len);
return prop;
}
@@ -402,11 +404,11 @@ static const struct fdt_property *fdt_get_property_namelen_(const void *fdt,
const struct fdt_property *prop;
prop = fdt_get_property_by_offset_(fdt, offset, lenp);
- if (!can_assume(VALID_DTB) && !prop) {
+ if (!can_assume(LIBFDT_FLAWLESS) && !prop) {
offset = -FDT_ERR_INTERNAL;
break;
}
- if (fdt_string_eq_(fdt, fdt32_ld(&prop->nameoff),
+ if (fdt_string_eq_(fdt, fdt32_ld_(&prop->nameoff),
name, namelen)) {
if (poffset)
*poffset = offset;
@@ -459,7 +461,7 @@ const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
/* Handle realignment */
if (!can_assume(LATEST) && fdt_version(fdt) < 0x10 &&
- (poffset + sizeof(*prop)) % 8 && fdt32_ld(&prop->len) >= 8)
+ (poffset + sizeof(*prop)) % 8 && fdt32_ld_(&prop->len) >= 8)
return prop->data + 4;
return prop->data;
}
@@ -477,7 +479,7 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset,
int namelen;
if (!can_assume(VALID_INPUT)) {
- name = fdt_get_string(fdt, fdt32_ld(&prop->nameoff),
+ name = fdt_get_string(fdt, fdt32_ld_(&prop->nameoff),
&namelen);
if (!name) {
if (lenp)
@@ -486,13 +488,13 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset,
}
*namep = name;
} else {
- *namep = fdt_string(fdt, fdt32_ld(&prop->nameoff));
+ *namep = fdt_string(fdt, fdt32_ld_(&prop->nameoff));
}
}
/* Handle realignment */
if (!can_assume(LATEST) && fdt_version(fdt) < 0x10 &&
- (offset + sizeof(*prop)) % 8 && fdt32_ld(&prop->len) >= 8)
+ (offset + sizeof(*prop)) % 8 && fdt32_ld_(&prop->len) >= 8)
return prop->data + 4;
return prop->data;
}
@@ -517,7 +519,7 @@ uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
return 0;
}
- return fdt32_ld(php);
+ return fdt32_ld_(php);
}
const char *fdt_get_alias_namelen(const void *fdt,
@@ -634,7 +636,7 @@ int fdt_node_depth(const void *fdt, int nodeoffset)
err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
if (err)
- return (can_assume(VALID_INPUT) || err < 0) ? err :
+ return (can_assume(LIBFDT_FLAWLESS) || err < 0) ? err :
-FDT_ERR_INTERNAL;
return nodedepth;
}
@@ -680,7 +682,7 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
{
int offset;
- if ((phandle == 0) || (phandle == -1))
+ if ((phandle == 0) || (phandle == ~0U))
return -FDT_ERR_BADPHANDLE;
FDT_RO_PROBE(fdt);
diff --git a/cpukit/dtc/libfdt/fdt_rw.c b/cpukit/dtc/libfdt/fdt_rw.c
index 13854253ff..3621d3651d 100644
--- a/cpukit/dtc/libfdt/fdt_rw.c
+++ b/cpukit/dtc/libfdt/fdt_rw.c
@@ -46,7 +46,7 @@ static int fdt_rw_probe_(void *fdt)
return err_; \
}
-static inline int fdt_data_size_(void *fdt)
+static inline unsigned int fdt_data_size_(void *fdt)
{
return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
}
@@ -54,15 +54,16 @@ static inline int fdt_data_size_(void *fdt)
static int fdt_splice_(void *fdt, void *splicepoint, int oldlen, int newlen)
{
char *p = splicepoint;
- char *end = (char *)fdt + fdt_data_size_(fdt);
+ unsigned int dsize = fdt_data_size_(fdt);
+ size_t soff = p - (char *)fdt;
- if (((p + oldlen) < p) || ((p + oldlen) > end))
+ if ((oldlen < 0) || (soff + oldlen < soff) || (soff + oldlen > dsize))
return -FDT_ERR_BADOFFSET;
- if ((p < (char *)fdt) || ((end - oldlen + newlen) < (char *)fdt))
+ if ((p < (char *)fdt) || (dsize + newlen < (unsigned)oldlen))
return -FDT_ERR_BADOFFSET;
- if ((end - oldlen + newlen) > ((char *)fdt + fdt_totalsize(fdt)))
+ if (dsize - oldlen + newlen > fdt_totalsize(fdt))
return -FDT_ERR_NOSPACE;
- memmove(p + newlen, p + oldlen, end - p - oldlen);
+ memmove(p + newlen, p + oldlen, ((char *)fdt + dsize) - (p + oldlen));
return 0;
}
@@ -348,7 +349,10 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
return offset;
/* Try to place the new node after the parent's properties */
- fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
+ tag = fdt_next_tag(fdt, parentoffset, &nextoffset);
+ /* the fdt_subnode_offset_namelen() should ensure this never hits */
+ if (!can_assume(LIBFDT_FLAWLESS) && (tag != FDT_BEGIN_NODE))
+ return -FDT_ERR_INTERNAL;
do {
offset = nextoffset;
tag = fdt_next_tag(fdt, offset, &nextoffset);
@@ -390,7 +394,9 @@ int fdt_del_node(void *fdt, int nodeoffset)
}
static void fdt_packblocks_(const char *old, char *new,
- int mem_rsv_size, int struct_size)
+ int mem_rsv_size,
+ int struct_size,
+ int strings_size)
{
int mem_rsv_off, struct_off, strings_off;
@@ -405,8 +411,7 @@ static void fdt_packblocks_(const char *old, char *new,
fdt_set_off_dt_struct(new, struct_off);
fdt_set_size_dt_struct(new, struct_size);
- memmove(new + strings_off, old + fdt_off_dt_strings(old),
- fdt_size_dt_strings(old));
+ memmove(new + strings_off, old + fdt_off_dt_strings(old), strings_size);
fdt_set_off_dt_strings(new, strings_off);
fdt_set_size_dt_strings(new, fdt_size_dt_strings(old));
}
@@ -427,15 +432,17 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
if (can_assume(LATEST) || fdt_version(fdt) >= 17) {
struct_size = fdt_size_dt_struct(fdt);
- } else {
+ } else if (fdt_version(fdt) == 16) {
struct_size = 0;
while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END)
;
if (struct_size < 0)
return struct_size;
+ } else {
+ return -FDT_ERR_BADVERSION;
}
- if (can_assume(LIBFDT_ORDER) |
+ if (can_assume(LIBFDT_ORDER) ||
!fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) {
/* no further work necessary */
err = fdt_move(fdt, buf, bufsize);
@@ -464,7 +471,8 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
return -FDT_ERR_NOSPACE;
}
- fdt_packblocks_(fdt, tmp, mem_rsv_size, struct_size);
+ fdt_packblocks_(fdt, tmp, mem_rsv_size, struct_size,
+ fdt_size_dt_strings(fdt));
memmove(buf, tmp, newsize);
fdt_set_magic(buf, FDT_MAGIC);
@@ -484,7 +492,8 @@ int fdt_pack(void *fdt)
mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
* sizeof(struct fdt_reserve_entry);
- fdt_packblocks_(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
+ fdt_packblocks_(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt),
+ fdt_size_dt_strings(fdt));
fdt_set_totalsize(fdt, fdt_data_size_(fdt));
return 0;
diff --git a/cpukit/dtc/libfdt/fdt_strerror.c b/cpukit/dtc/libfdt/fdt_strerror.c
index 768db66ead..d852b77e81 100644
--- a/cpukit/dtc/libfdt/fdt_strerror.c
+++ b/cpukit/dtc/libfdt/fdt_strerror.c
@@ -39,8 +39,9 @@ static struct fdt_errtabent fdt_errtable[] = {
FDT_ERRTABENT(FDT_ERR_BADOVERLAY),
FDT_ERRTABENT(FDT_ERR_NOPHANDLES),
FDT_ERRTABENT(FDT_ERR_BADFLAGS),
+ FDT_ERRTABENT(FDT_ERR_ALIGNMENT),
};
-#define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
+#define FDT_ERRTABSIZE ((int)(sizeof(fdt_errtable) / sizeof(fdt_errtable[0])))
const char *fdt_strerror(int errval)
{
@@ -48,7 +49,7 @@ const char *fdt_strerror(int errval)
return "<valid offset/length>";
else if (errval == 0)
return "<no error>";
- else if (errval > -FDT_ERRTABSIZE) {
+ else if (-errval < FDT_ERRTABSIZE) {
const char *s = fdt_errtable[-errval].str;
if (s)
diff --git a/cpukit/dtc/libfdt/fdt_sw.c b/cpukit/dtc/libfdt/fdt_sw.c
index 352193c0a7..4c569ee7eb 100644
--- a/cpukit/dtc/libfdt/fdt_sw.c
+++ b/cpukit/dtc/libfdt/fdt_sw.c
@@ -12,7 +12,7 @@
static int fdt_sw_probe_(void *fdt)
{
- if (!can_assume(VALID_DTB)) {
+ if (!can_assume(VALID_INPUT)) {
if (fdt_magic(fdt) == FDT_MAGIC)
return -FDT_ERR_BADSTATE;
else if (fdt_magic(fdt) != FDT_SW_MAGIC)
@@ -32,7 +32,7 @@ static int fdt_sw_probe_(void *fdt)
/* 'memrsv' state: Initial state after fdt_create()
*
* Allowed functions:
- * fdt_add_reservmap_entry()
+ * fdt_add_reservemap_entry()
* fdt_finish_reservemap() [moves to 'struct' state]
*/
static int fdt_sw_probe_memrsv_(void *fdt)
@@ -41,7 +41,7 @@ static int fdt_sw_probe_memrsv_(void *fdt)
if (err)
return err;
- if (!can_assume(VALID_DTB) && fdt_off_dt_strings(fdt) != 0)
+ if (!can_assume(VALID_INPUT) && fdt_off_dt_strings(fdt) != 0)
return -FDT_ERR_BADSTATE;
return 0;
}
@@ -67,7 +67,8 @@ static int fdt_sw_probe_struct_(void *fdt)
if (err)
return err;
- if (fdt_off_dt_strings(fdt) != fdt_totalsize(fdt))
+ if (!can_assume(VALID_INPUT) &&
+ fdt_off_dt_strings(fdt) != fdt_totalsize(fdt))
return -FDT_ERR_BADSTATE;
return 0;
}
@@ -92,8 +93,8 @@ static inline uint32_t sw_flags(void *fdt)
static void *fdt_grab_space_(void *fdt, size_t len)
{
- int offset = fdt_size_dt_struct(fdt);
- int spaceleft;
+ unsigned int offset = fdt_size_dt_struct(fdt);
+ unsigned int spaceleft;
spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt)
- fdt_size_dt_strings(fdt);
@@ -107,8 +108,8 @@ static void *fdt_grab_space_(void *fdt, size_t len)
int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags)
{
- const size_t hdrsize = FDT_ALIGN(sizeof(struct fdt_header),
- sizeof(struct fdt_reserve_entry));
+ const int hdrsize = FDT_ALIGN(sizeof(struct fdt_header),
+ sizeof(struct fdt_reserve_entry));
void *fdt = buf;
if (bufsize < hdrsize)
@@ -151,6 +152,9 @@ int fdt_resize(void *fdt, void *buf, int bufsize)
FDT_SW_PROBE(fdt);
+ if (bufsize < 0)
+ return -FDT_ERR_NOSPACE;
+
headsize = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
tailsize = fdt_size_dt_strings(fdt);
@@ -158,7 +162,7 @@ int fdt_resize(void *fdt, void *buf, int bufsize)
headsize + tailsize > fdt_totalsize(fdt))
return -FDT_ERR_INTERNAL;
- if ((headsize + tailsize) > bufsize)
+ if ((headsize + tailsize) > (unsigned)bufsize)
return -FDT_ERR_NOSPACE;
oldtail = (char *)fdt + fdt_totalsize(fdt) - tailsize;
@@ -246,18 +250,18 @@ int fdt_end_node(void *fdt)
static int fdt_add_string_(void *fdt, const char *s)
{
char *strtab = (char *)fdt + fdt_totalsize(fdt);
- int strtabsize = fdt_size_dt_strings(fdt);
- int len = strlen(s) + 1;
- int struct_top, offset;
+ unsigned int strtabsize = fdt_size_dt_strings(fdt);
+ unsigned int len = strlen(s) + 1;
+ unsigned int struct_top, offset;
- offset = -strtabsize - len;
+ offset = strtabsize + len;
struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
- if (fdt_totalsize(fdt) + offset < struct_top)
+ if (fdt_totalsize(fdt) - offset < struct_top)
return 0; /* no more room :( */
- memcpy(strtab + offset, s, len);
+ memcpy(strtab - offset, s, len);
fdt_set_size_dt_strings(fdt, strtabsize + len);
- return offset;
+ return -offset;
}
/* Must only be used to roll back in case of error */
@@ -373,7 +377,7 @@ int fdt_finish(void *fdt)
fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
/* And fix up fields that were keeping intermediate state. */
- fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
+ fdt_set_last_comp_version(fdt, FDT_LAST_COMPATIBLE_VERSION);
fdt_set_magic(fdt, FDT_MAGIC);
return 0;
diff --git a/cpukit/dtc/libfdt/fdt_wip.c b/cpukit/dtc/libfdt/fdt_wip.c
index f64139e0b3..c2d7566a67 100644
--- a/cpukit/dtc/libfdt/fdt_wip.c
+++ b/cpukit/dtc/libfdt/fdt_wip.c
@@ -23,7 +23,7 @@ int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
if (!propval)
return proplen;
- if (proplen < (len + idx))
+ if ((unsigned)proplen < (len + idx))
return -FDT_ERR_NOSPACE;
memcpy((char *)propval + idx, val, len);
diff --git a/cpukit/dtc/libfdt/libfdt_internal.h b/cpukit/dtc/libfdt/libfdt_internal.h
index e9913cdfa0..16bda1906a 100644
--- a/cpukit/dtc/libfdt/libfdt_internal.h
+++ b/cpukit/dtc/libfdt/libfdt_internal.h
@@ -46,6 +46,25 @@ static inline struct fdt_reserve_entry *fdt_mem_rsv_w_(void *fdt, int n)
return (void *)(uintptr_t)fdt_mem_rsv_(fdt, n);
}
+/*
+ * Internal helpers to access tructural elements of the device tree
+ * blob (rather than for exaple reading integers from within property
+ * values). We assume that we are either given a naturally aligned
+ * address for the platform or if we are not, we are on a platform
+ * where unaligned memory reads will be handled in a graceful manner.
+ * If not the external helpers fdtXX_ld() from libfdt.h can be used
+ * instead.
+ */
+static inline uint32_t fdt32_ld_(const fdt32_t *p)
+{
+ return fdt32_to_cpu(*p);
+}
+
+static inline uint64_t fdt64_ld_(const fdt64_t *p)
+{
+ return fdt64_to_cpu(*p);
+}
+
#define FDT_SW_MAGIC (~FDT_MAGIC)
/**********************************************************************/
@@ -58,7 +77,7 @@ static inline struct fdt_reserve_entry *fdt_mem_rsv_w_(void *fdt, int n)
/*
* Defines assumptions which can be enabled. Each of these can be enabled
- * individually. For maximum saftey, don't enable any assumptions!
+ * individually. For maximum safety, don't enable any assumptions!
*
* For minimal code size and no safety, use ASSUME_PERFECT at your own risk.
* You should have another method of validating the device tree, such as a
@@ -91,7 +110,9 @@ enum {
*
* With this assumption enabled, normal device trees produced by libfdt
* and the compiler should be handled safely. Malicious device trees and
- * complete garbage may cause libfdt to behave badly or crash.
+ * complete garbage may cause libfdt to behave badly or crash. Truncated
+ * device trees (e.g. those only partially loaded) can also cause
+ * problems.
*
* Note: Only checks that relate exclusively to the device tree itself
* (not the parameters passed to libfdt) are disabled by this
@@ -121,8 +142,8 @@ enum {
ASSUME_LATEST = 1 << 2,
/*
- * This assume that it is OK for a failed additional to the device tree
- * due to lack of space or some other problem can skip any rollback
+ * This assumes that it is OK for a failed addition to the device tree,
+ * due to lack of space or some other problem, to skip any rollback
* steps (such as dropping the property name from the string table).
* This is safe to enable in most circumstances, even though it may
* leave the tree in a sub-optimal state.
@@ -130,12 +151,28 @@ enum {
ASSUME_NO_ROLLBACK = 1 << 3,
/*
- * This assumes that the device tree components appear in the correct
- * order. As such it disables a check in fdt_open_into() and removes the
+ * This assumes that the device tree components appear in a 'convenient'
+ * order, i.e. the memory reservation block first, then the structure
+ * block and finally the string block.
+ *
+ * This order is not specified by the device-tree specification,
+ * but is expected by libfdt. The device-tree compiler always created
+ * device trees with this order.
+ *
+ * This assumption disables a check in fdt_open_into() and removes the
* ability to fix the problem there. This is safe if you know that the
* device tree is correctly ordered. See fdt_blocks_misordered_().
*/
ASSUME_LIBFDT_ORDER = 1 << 4,
+
+ /*
+ * This assumes that libfdt itself does not have any internal bugs. It
+ * drops certain checks that should never be needed unless libfdt has an
+ * undiscovered bug.
+ *
+ * This can generally be considered safe to enable.
+ */
+ ASSUME_LIBFDT_FLAWLESS = 1 << 5,
};
/**
diff --git a/cpukit/include/libfdt.h b/cpukit/include/libfdt.h
index 48f375c9c1..a7f432c80c 100644
--- a/cpukit/include/libfdt.h
+++ b/cpukit/include/libfdt.h
@@ -9,7 +9,12 @@
#include <libfdt_env.h>
#include <fdt.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define FDT_FIRST_SUPPORTED_VERSION 0x02
+#define FDT_LAST_COMPATIBLE_VERSION 0x10
#define FDT_LAST_SUPPORTED_VERSION 0x11
/* Error codes: informative error codes */
@@ -97,7 +102,11 @@
/* FDT_ERR_BADFLAGS: The function was passed a flags field that
* contains invalid flags or an invalid combination of flags. */
-#define FDT_ERR_MAX 18
+#define FDT_ERR_ALIGNMENT 19
+ /* FDT_ERR_ALIGNMENT: The device tree base address is not 8-byte
+ * aligned. */
+
+#define FDT_ERR_MAX 19
/* constants */
#define FDT_MAX_PHANDLE 0xfffffffe
@@ -118,11 +127,16 @@ static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
/*
- * Alignment helpers:
- * These helpers access words from a device tree blob. They're
- * built to work even with unaligned pointers on platforms (ike
- * ARM) that don't like unaligned loads and stores
+ * External helpers to access words from a device tree blob. They're built
+ * to work even with unaligned pointers on platforms (such as ARMv5) that don't
+ * like unaligned loads and stores.
*/
+static inline uint16_t fdt16_ld(const fdt16_t *p)
+{
+ const uint8_t *bp = (const uint8_t *)p;
+
+ return ((uint16_t)bp[0] << 8) | bp[1];
+}
static inline uint32_t fdt32_ld(const fdt32_t *p)
{
@@ -180,23 +194,23 @@ int fdt_next_node(const void *fdt, int offset, int *depth);
/**
* fdt_first_subnode() - get offset of first direct subnode
- *
* @fdt: FDT blob
* @offset: Offset of node to check
- * @return offset of first subnode, or -FDT_ERR_NOTFOUND if there is none
+ *
+ * Return: offset of first subnode, or -FDT_ERR_NOTFOUND if there is none
*/
int fdt_first_subnode(const void *fdt, int offset);
/**
* fdt_next_subnode() - get offset of next direct subnode
+ * @fdt: FDT blob
+ * @offset: Offset of previous subnode
*
* After first calling fdt_first_subnode(), call this function repeatedly to
* get direct subnodes of a parent node.
*
- * @fdt: FDT blob
- * @offset: Offset of previous subnode
- * @return offset of next subnode, or -FDT_ERR_NOTFOUND if there are no more
- * subnodes
+ * Return: offset of next subnode, or -FDT_ERR_NOTFOUND if there are no more
+ * subnodes
*/
int fdt_next_subnode(const void *fdt, int offset);
@@ -221,7 +235,6 @@ int fdt_next_subnode(const void *fdt, int offset);
* Note that this is implemented as a macro and @node is used as
* iterator in the loop. The parent variable be constant or even a
* literal.
- *
*/
#define fdt_for_each_subnode(node, fdt, parent) \
for (node = fdt_first_subnode(fdt, parent); \
@@ -265,17 +278,21 @@ fdt_set_hdr_(size_dt_struct);
/**
* fdt_header_size - return the size of the tree's header
* @fdt: pointer to a flattened device tree
+ *
+ * Return: size of DTB header in bytes
*/
size_t fdt_header_size(const void *fdt);
/**
- * fdt_header_size_ - internal function which takes a version number
+ * fdt_header_size_ - internal function to get header size from a version number
+ * @version: devicetree version number
+ *
+ * Return: size of DTB header in bytes
*/
size_t fdt_header_size_(uint32_t version);
/**
* fdt_check_header - sanity check a device tree header
-
* @fdt: pointer to data which might be a flattened device tree
*
* fdt_check_header() checks that the given buffer contains what
@@ -400,8 +417,7 @@ static inline uint32_t fdt_get_max_phandle(const void *fdt)
* highest phandle value in the device tree blob) will be returned in the
* @phandle parameter.
*
- * Returns:
- * 0 on success or a negative error-code on failure
+ * Return: 0 on success or a negative error-code on failure
*/
int fdt_generate_phandle(const void *fdt, uint32_t *phandle);
@@ -421,9 +437,11 @@ int fdt_num_mem_rsv(const void *fdt);
/**
* fdt_get_mem_rsv - retrieve one memory reserve map entry
* @fdt: pointer to the device tree blob
- * @address, @size: pointers to 64-bit variables
+ * @n: index of reserve map entry
+ * @address: pointer to 64-bit variable to hold the start address
+ * @size: pointer to 64-bit variable to hold the size of the entry
*
- * On success, *address and *size will contain the address and size of
+ * On success, @address and @size will contain the address and size of
* the n-th reserve map entry from the device tree blob, in
* native-endian format.
*
@@ -446,6 +464,8 @@ int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
* namelen characters of name for matching the subnode name. This is
* useful for finding subnodes based on a portion of a larger string,
* such as a full path.
+ *
+ * Return: offset of the subnode or -FDT_ERR_NOTFOUND if name not found.
*/
#ifndef SWIG /* Not available in Python */
int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
@@ -485,6 +505,8 @@ int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
*
* Identical to fdt_path_offset(), but only consider the first namelen
* characters of path as the path name.
+ *
+ * Return: offset of the node or negative libfdt error value otherwise
*/
#ifndef SWIG /* Not available in Python */
int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
@@ -584,9 +606,9 @@ int fdt_next_property_offset(const void *fdt, int offset);
/**
* fdt_for_each_property_offset - iterate over all properties of a node
*
- * @property_offset: property offset (int, lvalue)
- * @fdt: FDT blob (const void *)
- * @node: node offset (int)
+ * @property: property offset (int, lvalue)
+ * @fdt: FDT blob (const void *)
+ * @node: node offset (int)
*
* This is actually a wrapper around a for loop and would be used like so:
*
@@ -649,6 +671,9 @@ const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
*
* Identical to fdt_get_property(), but only examine the first namelen
* characters of name for matching the property name.
+ *
+ * Return: pointer to the structure representing the property, or NULL
+ * if not found
*/
#ifndef SWIG /* Not available in Python */
const struct fdt_property *fdt_get_property_namelen(const void *fdt,
@@ -741,6 +766,8 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset,
*
* Identical to fdt_getprop(), but only examine the first namelen
* characters of name for matching the property name.
+ *
+ * Return: pointer to the property's value or NULL on error
*/
#ifndef SWIG /* Not available in Python */
const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
@@ -762,10 +789,10 @@ static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset,
* @lenp: pointer to an integer variable (will be overwritten) or NULL
*
* fdt_getprop() retrieves a pointer to the value of the property
- * named 'name' of the node at offset nodeoffset (this will be a
+ * named @name of the node at offset @nodeoffset (this will be a
* pointer to within the device blob itself, not a copy of the value).
- * If lenp is non-NULL, the length of the property value is also
- * returned, in the integer pointed to by lenp.
+ * If @lenp is non-NULL, the length of the property value is also
+ * returned, in the integer pointed to by @lenp.
*
* returns:
* pointer to the property's value
@@ -810,8 +837,11 @@ uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
* @name: name of the alias th look up
* @namelen: number of characters of name to consider
*
- * Identical to fdt_get_alias(), but only examine the first namelen
- * characters of name for matching the alias name.
+ * Identical to fdt_get_alias(), but only examine the first @namelen
+ * characters of @name for matching the alias name.
+ *
+ * Return: a pointer to the expansion of the alias named @name, if it exists,
+ * NULL otherwise
*/
#ifndef SWIG /* Not available in Python */
const char *fdt_get_alias_namelen(const void *fdt,
@@ -824,7 +854,7 @@ const char *fdt_get_alias_namelen(const void *fdt,
* @name: name of the alias th look up
*
* fdt_get_alias() retrieves the value of a given alias. That is, the
- * value of the property named 'name' in the node /aliases.
+ * value of the property named @name in the node /aliases.
*
* returns:
* a pointer to the expansion of the alias named 'name', if it exists
@@ -1000,14 +1030,13 @@ int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
/**
- * fdt_node_check_compatible: check a node's compatible property
+ * fdt_node_check_compatible - check a node's compatible property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of a tree node
* @compatible: string to match against
*
- *
* fdt_node_check_compatible() returns 0 if the given node contains a
- * 'compatible' property with the given string as one of its elements,
+ * @compatible property with the given string as one of its elements,
* it returns non-zero otherwise, or on error.
*
* returns:
@@ -1071,7 +1100,7 @@ int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
* one or more strings, each terminated by \0, as is found in a device tree
* "compatible" property.
*
- * @return: 1 if the string is found in the list, 0 not found, or invalid list
+ * Return: 1 if the string is found in the list, 0 not found, or invalid list
*/
int fdt_stringlist_contains(const char *strlist, int listlen, const char *str);
@@ -1080,7 +1109,8 @@ int fdt_stringlist_contains(const char *strlist, int listlen, const char *str);
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of a tree node
* @property: name of the property containing the string list
- * @return:
+ *
+ * Return:
* the number of strings in the given property
* -FDT_ERR_BADVALUE if the property value is not NUL-terminated
* -FDT_ERR_NOTFOUND if the property does not exist
@@ -1100,7 +1130,7 @@ int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property);
* small-valued cell properties, such as #address-cells, when searching for
* the empty string.
*
- * @return:
+ * return:
* the index of the string in the list of strings
* -FDT_ERR_BADVALUE if the property value is not NUL-terminated
* -FDT_ERR_NOTFOUND if the property does not exist or does not contain
@@ -1124,7 +1154,7 @@ int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
* If non-NULL, the length of the string (on success) or a negative error-code
* (on failure) will be stored in the integer pointer to by lenp.
*
- * @return:
+ * Return:
* A pointer to the string at the given index in the string list or NULL on
* failure. On success the length of the string will be stored in the memory
* location pointed to by the lenp parameter, if non-NULL. On failure one of
@@ -1213,6 +1243,8 @@ int fdt_size_cells(const void *fdt, int nodeoffset);
* starting from the given index, and using only the first characters
* of the name. It is useful when you want to manipulate only one value of
* an array and you have a string that doesn't end with \0.
+ *
+ * Return: 0 on success, negative libfdt error value otherwise
*/
#ifndef SWIG /* Not available in Python */
int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
@@ -1326,8 +1358,13 @@ static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
/**
* fdt_setprop_inplace_cell - change the value of a single-cell property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node containing the property
+ * @name: name of the property to change the value of
+ * @val: new value of the 32-bit cell
*
* This is an alternative name for fdt_setprop_inplace_u32()
+ * Return: 0 on success, negative libfdt error number otherwise.
*/
static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
const char *name, uint32_t val)
@@ -1399,7 +1436,7 @@ int fdt_nop_node(void *fdt, int nodeoffset);
/**
* fdt_create_with_flags - begin creation of a new fdt
- * @fdt: pointer to memory allocated where fdt will be created
+ * @buf: pointer to memory allocated where fdt will be created
* @bufsize: size of the memory space at fdt
* @flags: a valid combination of FDT_CREATE_FLAG_ flags, or 0.
*
@@ -1417,7 +1454,7 @@ int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags);
/**
* fdt_create - begin creation of a new fdt
- * @fdt: pointer to memory allocated where fdt will be created
+ * @buf: pointer to memory allocated where fdt will be created
* @bufsize: size of the memory space at fdt
*
* fdt_create() is equivalent to fdt_create_with_flags() with flags=0.
@@ -1482,7 +1519,8 @@ int fdt_pack(void *fdt);
/**
* fdt_add_mem_rsv - add one memory reserve map entry
* @fdt: pointer to the device tree blob
- * @address, @size: 64-bit values (native endian)
+ * @address: 64-bit start address of the reserve map entry
+ * @size: 64-bit size of the reserved region
*
* Adds a reserve map entry to the given blob reserving a region at
* address address of length size.
@@ -1687,8 +1725,14 @@ static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
/**
* fdt_setprop_cell - set a property to a single cell value
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 32-bit integer value for the property (native endian)
*
* This is an alternative name for fdt_setprop_u32()
+ *
+ * Return: 0 on success, negative libfdt error value otherwise.
*/
static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
uint32_t val)
@@ -1859,8 +1903,14 @@ static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
/**
* fdt_appendprop_cell - append a single cell value to a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 32-bit integer value to append to the property (native endian)
*
* This is an alternative name for fdt_appendprop_u32()
+ *
+ * Return: 0 on success, negative libfdt error value otherwise.
*/
static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
const char *name, uint32_t val)
@@ -1963,13 +2013,16 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name);
* fdt_add_subnode_namelen - creates a new node based on substring
* @fdt: pointer to the device tree blob
* @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
+ * @name: name of the subnode to create
* @namelen: number of characters of name to consider
*
- * Identical to fdt_add_subnode(), but use only the first namelen
- * characters of name as the name of the new node. This is useful for
+ * Identical to fdt_add_subnode(), but use only the first @namelen
+ * characters of @name as the name of the new node. This is useful for
* creating subnodes based on a portion of a larger string, such as a
* full path.
+ *
+ * Return: structure block offset of the created subnode (>=0),
+ * negative libfdt error value otherwise
*/
#ifndef SWIG /* Not available in Python */
int fdt_add_subnode_namelen(void *fdt, int parentoffset,
@@ -1988,7 +2041,7 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
*
* This function will insert data into the blob, and will therefore
* change the offsets of some existing nodes.
-
+ *
* returns:
* structure block offset of the created nodeequested subnode (>=0), on
* success
@@ -2063,10 +2116,32 @@ int fdt_del_node(void *fdt, int nodeoffset);
*/
int fdt_overlay_apply(void *fdt, void *fdto);
+/**
+ * fdt_overlay_target_offset - retrieves the offset of a fragment's target
+ * @fdt: Base device tree blob
+ * @fdto: Device tree overlay blob
+ * @fragment_offset: node offset of the fragment in the overlay
+ * @pathp: pointer which receives the path of the target (or NULL)
+ *
+ * fdt_overlay_target_offset() retrieves the target offset in the base
+ * device tree of a fragment, no matter how the actual targeting is
+ * done (through a phandle or a path)
+ *
+ * returns:
+ * the targeted node offset in the base device tree
+ * Negative error code on error
+ */
+int fdt_overlay_target_offset(const void *fdt, const void *fdto,
+ int fragment_offset, char const **pathp);
+
/**********************************************************************/
/* Debugging / informational functions */
/**********************************************************************/
const char *fdt_strerror(int errval);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* LIBFDT_H */
diff --git a/cpukit/include/rtems.h b/cpukit/include/rtems.h
index 32d7769150..809b2b77f4 100644
--- a/cpukit/include/rtems.h
+++ b/cpukit/include/rtems.h
@@ -73,6 +73,7 @@
#include <rtems/rtems/part.h>
#include <rtems/rtems/ratemon.h>
#include <rtems/rtems/region.h>
+#include <rtems/rtems/scheduler.h>
#include <rtems/rtems/sem.h>
#include <rtems/rtems/signal.h>
#include <rtems/rtems/status.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 3bea8340cb..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
@@ -153,7 +155,8 @@ const size_t _Thread_Idle_stack_size = CONFIGURE_IDLE_TASK_STACK_SIZE;
#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/irq-extension.h b/cpukit/include/rtems/irq-extension.h
index e45ea43004..76b930dc69 100644
--- a/cpukit/include/rtems/irq-extension.h
+++ b/cpukit/include/rtems/irq-extension.h
@@ -5,11 +5,11 @@
*
* @ingroup RTEMSAPIClassicIntr
*
- * @brief This header file defines the Interrupt Manager Extension API.
+ * @brief This header file is provided for backward compatiblility.
*/
/*
- * Copyright (C) 2008, 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * 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
@@ -55,2265 +55,12 @@
#ifndef _RTEMS_IRQ_EXTENSION_H
#define _RTEMS_IRQ_EXTENSION_H
-#include <stddef.h>
-#include <stdint.h>
-#include <sys/cpuset.h>
-#include <rtems/rtems/attr.h>
#include <rtems/rtems/intr.h>
-#include <rtems/rtems/modes.h>
-#include <rtems/rtems/options.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/types.h>
-#include <rtems/score/chain.h>
#ifdef __cplusplus
extern "C" {
#endif
-/* Generated from spec:/rtems/intr/if/handler */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Interrupt handler routines shall have this type.
- */
-typedef void ( *rtems_interrupt_handler )( void * );
-
-/* Generated from spec:/rtems/intr/if/per-handler-routine */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Visitor routines invoked by rtems_interrupt_handler_iterate() shall
- * have this type.
- */
-typedef void ( *rtems_interrupt_per_handler_routine )(
- void *,
- const char *,
- rtems_option,
- rtems_interrupt_handler,
- void *
-);
-
-/* Generated from spec:/rtems/intr/if/shared */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This interrupt handler install option allows that the interrupt
- * handler may share the interrupt vector with other handler.
- */
-#define RTEMS_INTERRUPT_SHARED ( (rtems_option) 0x00000000 )
-
-/* Generated from spec:/rtems/intr/if/unique */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This interrupt handler install option ensures that the interrupt
- * handler is unique.
- *
- * This option prevents other handler from using the same interrupt vector.
- */
-#define RTEMS_INTERRUPT_UNIQUE ( (rtems_option) 0x00000001 )
-
-/* Generated from spec:/rtems/intr/if/replace */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This interrupt handler install option requests that the interrupt
- * handler replaces the first handler with the same argument.
- */
-#define RTEMS_INTERRUPT_REPLACE ( (rtems_option) 0x00000002 )
-
-/* Generated from spec:/rtems/intr/if/is-shared */
-
-/**
- * @brief Checks if the interrupt handler shared option is set.
- *
- * @param _options is the interrupt handler option set to check.
- *
- * @return Returns true, if the interrupt handler shared option
- * #RTEMS_INTERRUPT_SHARED is set, otherwise false.
- */
-#define RTEMS_INTERRUPT_IS_SHARED( _options ) \
- ( ( _options ) & RTEMS_INTERRUPT_SHARED )
-
-/* Generated from spec:/rtems/intr/if/is-unique */
-
-/**
- * @brief Checks if the interrupt handler unique option is set.
- *
- * @param _options is the interrupt handler option set to check.
- *
- * @return Returns true, if the interrupt handler unique option
- * #RTEMS_INTERRUPT_UNIQUE is set, otherwise false.
- */
-#define RTEMS_INTERRUPT_IS_UNIQUE( _options ) \
- ( ( _options ) & RTEMS_INTERRUPT_UNIQUE )
-
-/* Generated from spec:/rtems/intr/if/is-replace */
-
-/**
- * @brief Checks if the interrupt handler replace option is set.
- *
- * @param _options is the interrupt handler option set to check.
- *
- * @return Returns true, if the interrupt handler replace option
- * #RTEMS_INTERRUPT_REPLACE is set, otherwise false.
- */
-#define RTEMS_INTERRUPT_IS_REPLACE( _options ) \
- ( ( _options ) & RTEMS_INTERRUPT_REPLACE )
-
-/* Generated from spec:/rtems/intr/if/entry */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This structure represents an interrupt entry.
- *
- * @par Notes
- * This structure shall be treated as an opaque data type from the API point of
- * view. Members shall not be accessed directly. An entry may be initialized
- * by RTEMS_INTERRUPT_ENTRY_INITIALIZER() or
- * rtems_interrupt_entry_initialize(). It may be installed for an interrupt
- * vector with rtems_interrupt_entry_install() and removed from an interrupt
- * vector by rtems_interrupt_entry_remove().
- */
-typedef struct rtems_interrupt_entry {
- /**
- * @brief This member is the interrupt handler routine.
- */
- rtems_interrupt_handler handler;
-
- /**
- * @brief This member is the interrupt handler argument.
- */
- void *arg;
-
- /**
- * @brief This member is the reference to the next entry or NULL.
- */
- struct rtems_interrupt_entry *next;
-
- /**
- * @brief This member is the descriptive information of the entry.
- */
- const char *info;
-} rtems_interrupt_entry;
-
-/* Generated from spec:/rtems/intr/if/entry-initializer */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Statically initializes an interrupt entry object.
- *
- * @param _routine is the interrupt handler routine for the entry.
- *
- * @param _arg is the interrupt handler argument for the entry.
- *
- * @param _info is the descriptive information for the entry.
- *
- * @par Notes
- * Alternatively, rtems_interrupt_entry_initialize() may be used to dynamically
- * initialize an interrupt entry.
- */
-#define RTEMS_INTERRUPT_ENTRY_INITIALIZER( _routine, _arg, _info ) \
- { _routine, _arg, NULL, _info }
-
-/* Generated from spec:/rtems/intr/if/entry-initialize */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Initializes the interrupt entry.
- *
- * @param[out] entry is the interrupt entry to initialize.
- *
- * @param routine is the interrupt handler routine for the entry.
- *
- * @param arg is the interrupt handler argument for the entry.
- *
- * @param info is the descriptive information for the entry.
- *
- * @par Notes
- * Alternatively, RTEMS_INTERRUPT_ENTRY_INITIALIZER() may be used to statically
- * initialize an interrupt entry.
- *
- * @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
- */
-static inline void rtems_interrupt_entry_initialize(
- rtems_interrupt_entry *entry,
- rtems_interrupt_handler routine,
- void *arg,
- const char *info
-)
-{
- entry->handler = routine;
- entry->arg = arg;
- entry->next = NULL;
- entry->info = info;
-}
-
-/* Generated from spec:/rtems/intr/if/entry-install */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Installs the interrupt entry at the interrupt vector.
- *
- * @param vector is the interrupt vector number.
- *
- * @param options is the interrupt entry install option set.
- *
- * @param entry is the interrupt entry to install.
- *
- * One of the following mutually exclusive options
- *
- * * #RTEMS_INTERRUPT_UNIQUE, and
- *
- * * #RTEMS_INTERRUPT_SHARED
- *
- * shall be set in the ``options`` parameter.
- *
- * The handler routine of the entry specified by ``entry`` will be called with
- * the handler argument of the entry when dispatched. The order in which
- * shared interrupt handlers are dispatched for one vector is defined by the
- * installation order. The first installed handler is dispatched first.
- *
- * If the option #RTEMS_INTERRUPT_UNIQUE is set, then it will be ensured that
- * the handler will be the only one for the interrupt vector.
- *
- * If the option #RTEMS_INTERRUPT_SHARED is set, then multiple handlers may be
- * installed for the interrupt vector.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``entry`` parameter was NULL.
- *
- * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The handler routine of the entry was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
- * interrupt context.
- *
- * @retval ::RTEMS_INVALID_NUMBER An option specified by ``options`` was not
- * applicable.
- *
- * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_UNIQUE option was set
- * in ``entry`` and the interrupt vector was already occupied by a handler.
- *
- * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_SHARED option was set
- * in ``entry`` and the interrupt vector was already occupied by a unique
- * handler.
- *
- * @retval ::RTEMS_TOO_MANY The handler routine of the entry specified by
- * ``entry`` was already installed for the interrupt vector specified by
- * ``vector`` with an argument equal to the handler argument of the entry.
- *
- * @par Notes
- * When the directive call was successful, the ownership of the interrupt entry
- * has been transferred from the caller to the interrupt service. An installed
- * interrupt entry may be removed from the interrupt service by calling
- * rtems_interrupt_entry_remove().
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive may obtain and release the object allocator mutex. This may
- * cause the calling task to be preempted.
- *
- * * The interrupt entry shall have been initialized by
- * rtems_interrupt_entry_initialize() or RTEMS_INTERRUPT_ENTRY_INITIALIZER().
- * @endparblock
- */
-rtems_status_code rtems_interrupt_entry_install(
- rtems_vector_number vector,
- rtems_option options,
- rtems_interrupt_entry *entry
-);
-
-/* Generated from spec:/rtems/intr/if/entry-remove */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Removes the interrupt entry from the interrupt vector.
- *
- * @param vector is the interrupt vector number.
- *
- * @param entry is the interrupt entry to remove.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``entry`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
- * interrupt context.
- *
- * @retval ::RTEMS_UNSATISFIED The entry specified by ``entry`` was not
- * installed at the interrupt vector specified by ``vector``.
- *
- * @par Notes
- * When the directive call was successful, the ownership of the interrupt entry
- * has been transferred from the interrupt service to the caller.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive may obtain and release the object allocator mutex. This may
- * cause the calling task to be preempted.
- *
- * * The interrupt entry shall have been installed by
- * rtems_interrupt_entry_install().
- * @endparblock
- */
-rtems_status_code rtems_interrupt_entry_remove(
- rtems_vector_number vector,
- rtems_interrupt_entry *entry
-);
-
-/* Generated from spec:/rtems/intr/if/handler-install */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Installs the interrupt handler routine and argument at the interrupt
- * vector.
- *
- * @param vector is the interrupt vector number.
- *
- * @param info is the descriptive information of the interrupt handler to
- * install.
- *
- * @param options is the interrupt handler install option set.
- *
- * @param routine is the interrupt handler routine to install.
- *
- * @param arg is the interrupt handler argument to install.
- *
- * One of the following mutually exclusive options
- *
- * * #RTEMS_INTERRUPT_UNIQUE,
- *
- * * #RTEMS_INTERRUPT_SHARED, and
- *
- * * #RTEMS_INTERRUPT_REPLACE
- *
- * shall be set in the ``options`` parameter.
- *
- * The handler routine will be called with the argument specified by ``arg``
- * when dispatched. The order in which shared interrupt handlers are
- * dispatched for one vector is defined by the installation order. The first
- * installed handler is dispatched first.
- *
- * If the option #RTEMS_INTERRUPT_UNIQUE is set, then it will be ensured that
- * the handler will be the only one for the interrupt vector.
- *
- * If the option #RTEMS_INTERRUPT_SHARED is set, then multiple handler may be
- * installed for the interrupt vector.
- *
- * If the option #RTEMS_INTERRUPT_REPLACE is set, then the handler specified by
- * ``routine`` will replace the first handler with the same argument for the
- * interrupt vector if it exists, otherwise an error status will be returned.
- * A second handler with the same argument for the interrupt vector will remain
- * unchanged. The new handler will inherit the unique or shared options from
- * the replaced handler.
- *
- * An informative description may be provided in ``info``. It may be used for
- * system debugging and diagnostic tools. The referenced string has to be
- * persistent as long as the handler is installed.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``routine`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
- * interrupt context.
- *
- * @retval ::RTEMS_NO_MEMORY There was not enough memory available to allocate
- * data structures to install the handler.
- *
- * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_UNIQUE option was set
- * in ``options`` and the interrupt vector was already occupied by a handler.
- *
- * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_SHARED option was set
- * in ``options`` and the interrupt vector was already occupied by a unique
- * handler.
- *
- * @retval ::RTEMS_TOO_MANY The handler specified by ``routine`` was already
- * installed for the interrupt vector specified by ``vector`` with an
- * argument equal to the argument specified by ``arg``.
- *
- * @retval ::RTEMS_UNSATISFIED The #RTEMS_INTERRUPT_REPLACE option was set in
- * ``options`` and no handler to replace was installed.
- *
- * @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
- */
-rtems_status_code rtems_interrupt_handler_install(
- rtems_vector_number vector,
- const char *info,
- rtems_option options,
- rtems_interrupt_handler routine,
- void *arg
-);
-
-/* Generated from spec:/rtems/intr/if/handler-remove */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Removes the interrupt handler routine and argument from the interrupt
- * vector.
- *
- * @param vector is the interrupt vector number.
- *
- * @param routine is the interrupt handler routine to remove.
- *
- * @param arg is the interrupt handler argument to remove.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``routine`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
- * interrupt context.
- *
- * @retval ::RTEMS_UNSATISFIED There was no handler routine and argument pair
- * installed specified by ``routine`` and ``arg``.
- *
- * @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
- */
-rtems_status_code rtems_interrupt_handler_remove(
- rtems_vector_number vector,
- rtems_interrupt_handler routine,
- void *arg
-);
-
-/* Generated from spec:/rtems/intr/if/vector-is-enabled */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Checks if the interrupt vector is enabled.
- *
- * @param vector is the interrupt vector number.
- *
- * @param[out] enabled is the pointer to a ``bool`` object. When the directive
- * call is successful, the enabled status of the interrupt associated with
- * the interrupt vector specified by ``vector`` will be stored in this
- * object. When the interrupt was enabled for the processor executing the
- * directive call at some time point during the call, the object value will
- * be set to true, otherwise to false.
- *
- * The directive checks if the interrupt associated with the interrupt vector
- * specified by ``vector`` was enabled for the processor executing the
- * directive call at some time point during the call.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``enabled`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @par Notes
- * Interrupt vectors may be enabled by rtems_interrupt_vector_enable() and
- * disabled by rtems_interrupt_vector_disable().
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_vector_is_enabled(
- rtems_vector_number vector,
- bool *enabled
-);
-
-/* Generated from spec:/rtems/intr/if/vector-enable */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Enables the interrupt vector.
- *
- * @param vector is the number of the interrupt vector to enable.
- *
- * The directive enables the interrupt vector specified by ``vector``. This
- * allows that interrupt service requests are issued to the target processors
- * of the interrupt vector. Interrupt service requests for an interrupt vector
- * may be raised by rtems_interrupt_raise(), rtems_interrupt_raise_on(),
- * external signals, or messages.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_UNSATISFIED The request to enable the interrupt vector has
- * not been satisfied.
- *
- * @par Notes
- * The rtems_interrupt_get_attributes() directive may be used to check if an
- * interrupt vector can be enabled. Interrupt vectors may be disabled by
- * rtems_interrupt_vector_disable().
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_vector_enable( rtems_vector_number vector );
-
-/* Generated from spec:/rtems/intr/if/vector-disable */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Disables the interrupt vector.
- *
- * @param vector is the number of the interrupt vector to disable.
- *
- * The directive disables the interrupt vector specified by ``vector``. This
- * prevents that an interrupt service request is issued to the target
- * processors of the interrupt vector.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_UNSATISFIED The request to disable the interrupt vector has
- * not been satisfied.
- *
- * @par Notes
- * The rtems_interrupt_get_attributes() directive may be used to check if an
- * interrupt vector can be disabled. Interrupt vectors may be enabled by
- * rtems_interrupt_vector_enable(). There may be targets on which some
- * interrupt vectors cannot be disabled, for example a hardware watchdog
- * interrupt or software generated interrupts.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_vector_disable( rtems_vector_number vector );
-
-/* Generated from spec:/rtems/intr/if/is-pending */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Checks if the interrupt is pending.
- *
- * @param vector is the interrupt vector number.
- *
- * @param[out] pending is the pointer to a ``bool`` object. When the directive
- * call is successful, the pending status of the interrupt associated with
- * the interrupt vector specified by ``vector`` will be stored in this
- * object. When the interrupt was pending for the processor executing the
- * directive call at some time point during the call, the object value will
- * be set to true, otherwise to false.
- *
- * The directive checks if the interrupt associated with the interrupt vector
- * specified by ``vector`` was pending for the processor executing the
- * directive call at some time point during the call.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``pending`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_UNSATISFIED The request to get the pending status has not
- * been satisfied.
- *
- * @par Notes
- * Interrupts may be made pending by calling the rtems_interrupt_raise() or
- * rtems_interrupt_raise_on() directives or due to external signals or
- * messages. The pending state may be cleared by rtems_interrupt_clear().
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_is_pending(
- rtems_vector_number vector,
- bool *pending
-);
-
-/* Generated from spec:/rtems/intr/if/get-affinity */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Gets the processor affinity set of the interrupt vector.
- *
- * @param vector is the interrupt vector number.
- *
- * @param affinity_size is the size of the processor set referenced by
- * ``affinity`` in bytes.
- *
- * @param[out] affinity is the pointer to a cpu_set_t object. When the
- * directive call is successful, the processor affinity set of the interrupt
- * vector will be stored in this object. A set bit in the processor set
- * means that the corresponding processor is in the processor affinity set of
- * the interrupt vector, otherwise the bit is cleared.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``affinity`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_INVALID_SIZE The size specified by ``affinity_size`` of the
- * processor set was too small for the processor affinity set of the
- * interrupt vector.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_get_affinity(
- rtems_vector_number vector,
- size_t affinity_size,
- cpu_set_t *affinity
-);
-
-/* Generated from spec:/rtems/intr/if/set-affinity */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Sets the processor affinity set of the interrupt vector.
- *
- * @param vector is the interrupt vector number.
- *
- * @param affinity_size is the size of the processor set referenced by
- * ``affinity`` in bytes.
- *
- * @param affinity is the pointer to a cpu_set_t object. The processor set
- * defines the new processor affinity set of the interrupt vector. A set bit
- * in the processor set means that the corresponding processor shall be in
- * the processor affinity set of the interrupt vector, otherwise the bit
- * shall be cleared.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``affinity`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_INVALID_NUMBER The referenced processor set was not a valid
- * new processor affinity set for the interrupt vector.
- *
- * @retval ::RTEMS_UNSATISFIED The request to set the processor affinity of the
- * interrupt vector has not been satisfied.
- *
- * @par Notes
- * The rtems_interrupt_get_attributes() directive may be used to check if the
- * processor affinity of an interrupt vector can be set.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_set_affinity(
- rtems_vector_number vector,
- size_t affinity_size,
- const cpu_set_t *affinity
-);
-
-/* Generated from spec:/rtems/intr/if/signal-variant */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This enumeration provides interrupt trigger signal variants.
- */
-typedef enum {
- /**
- * @brief This interrupt signal variant indicates that the interrupt trigger
- * signal is unspecified.
- */
- RTEMS_INTERRUPT_UNSPECIFIED_SIGNAL,
-
- /**
- * @brief This interrupt signal variant indicates that the interrupt cannot be
- * triggered by a signal.
- */
- RTEMS_INTERRUPT_NO_SIGNAL,
-
- /**
- * @brief This interrupt signal variant indicates that the interrupt is
- * triggered by a low level signal.
- */
- RTEMS_INTERRUPT_SIGNAL_LEVEL_LOW,
-
- /**
- * @brief This interrupt signal variant indicates that the interrupt is
- * triggered by a high level signal.
- */
- RTEMS_INTERRUPT_SIGNAL_LEVEL_HIGH,
-
- /**
- * @brief This interrupt signal variant indicates that the interrupt is
- * triggered by a falling edge signal.
- */
- RTEMS_INTERRUPT_SIGNAL_EDGE_FALLING,
-
- /**
- * @brief This interrupt signal variant indicates that the interrupt is
- * triggered by a raising edge signal.
- */
- RTEMS_INTERRUPT_SIGNAL_EDGE_RAISING
-} rtems_interrupt_signal_variant;
-
-/* Generated from spec:/rtems/intr/if/attributes */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This structure provides the attributes of an interrupt vector.
- *
- * The rtems_interrupt_get_attributes() directive may be used to obtain the
- * attributes of an interrupt vector.
- */
-typedef struct {
- /**
- * @brief This member is true, if the interrupt vector is maskable by
- * rtems_interrupt_local_disable(), otherwise it is false.
- *
- * Interrupt vectors which are not maskable by rtems_interrupt_local_disable()
- * should be used with care since they cannot use most operating system
- * services.
- */
- bool is_maskable;
-
- /**
- * @brief This member is true, if the interrupt vector can be enabled by
- * rtems_interrupt_vector_enable(), otherwise it is false.
- *
- * When an interrupt vector can be enabled, this means that the enabled state
- * can always be changed from disabled to enabled. For an interrupt vector
- * which can be enabled it follows that it may be enabled.
- */
- bool can_enable;
-
- /**
- * @brief This member is true, if the interrupt vector may be enabled by
- * rtems_interrupt_vector_enable(), otherwise it is false.
- *
- * When an interrupt vector may be enabled, this means that the enabled state
- * may be changed from disabled to enabled. The requested enabled state change
- * should be checked by rtems_interrupt_vector_is_enabled(). Some interrupt
- * vectors may be optionally available and cannot be enabled on a particular
- * target.
- */
- bool maybe_enable;
-
- /**
- * @brief This member is true, if the interrupt vector can be disabled by
- * rtems_interrupt_vector_disable(), otherwise it is false.
- *
- * When an interrupt vector can be disabled, this means that the enabled state
- * can be changed from enabled to disabled. For an interrupt vector which can
- * be disabled it follows that it may be disabled.
- */
- bool can_disable;
-
- /**
- * @brief This member is true, if the interrupt vector may be disabled by
- * rtems_interrupt_vector_disable(), otherwise it is false.
- *
- * When an interrupt vector may be disabled, this means that the enabled state
- * may be changed from enabled to disabled. The requested enabled state change
- * should be checked by rtems_interrupt_vector_is_enabled(). Some interrupt
- * vectors may be always enabled and cannot be disabled on a particular target.
- */
- bool maybe_disable;
-
- /**
- * @brief This member is true, if the interrupt vector can be raised by
- * rtems_interrupt_raise(), otherwise it is false.
- */
- bool can_raise;
-
- /**
- * @brief This member is true, if the interrupt vector can be raised on a
- * processor by rtems_interrupt_raise_on(), otherwise it is false.
- */
- bool can_raise_on;
-
- /**
- * @brief This member is true, if the interrupt vector can be cleared by
- * rtems_interrupt_clear(), otherwise it is false.
- */
- bool can_clear;
-
- /**
- * @brief This member is true, if the pending status of the interrupt
- * associated with the interrupt vector is cleared by an interrupt
- * acknowledge from the processor, otherwise it is false.
- */
- bool cleared_by_acknowledge;
-
- /**
- * @brief This member is true, if the affinity set of the interrupt vector can
- * be obtained by rtems_interrupt_get_affinity(), otherwise it is false.
- */
- bool can_get_affinity;
-
- /**
- * @brief This member is true, if the affinity set of the interrupt vector can
- * be set by rtems_interrupt_set_affinity(), otherwise it is false.
- */
- bool can_set_affinity;
-
- /**
- * @brief This member is true, if the interrupt associated with the interrupt
- * vector can be triggered by a message.
- *
- * Interrupts may be also triggered by signals, rtems_interrupt_raise(), or
- * rtems_interrupt_raise_on(). Examples for message triggered interrupts are
- * the PCIe MSI/MSI-X and the ARM GICv3 Locality-specific Peripheral Interrupts
- * (LPI).
- */
- bool can_be_triggered_by_message;
-
- /**
- * @brief This member describes the trigger signal of the interrupt associated
- * with the interrupt vector.
- *
- * Interrupts are normally triggered by signals which indicate an interrupt
- * request from a peripheral. Interrupts may be also triggered by messages,
- * rtems_interrupt_raise(), or rtems_interrupt_raise_on().
- */
- rtems_interrupt_signal_variant trigger_signal;
-} rtems_interrupt_attributes;
-
-/* Generated from spec:/rtems/intr/if/get-attributes */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Gets the attributes of the interrupt vector.
- *
- * @param vector is the interrupt vector number.
- *
- * @param[out] attributes is the pointer to an rtems_interrupt_attributes
- * object. When the directive call is successful, the attributes of the
- * interrupt vector will be stored in this object.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``attributes`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_get_attributes(
- rtems_vector_number vector,
- rtems_interrupt_attributes *attributes
-);
-
-/* Generated from spec:/rtems/intr/if/handler-iterate */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Iterates over all interrupt handler installed at the interrupt
- * vector.
- *
- * @param vector is the interrupt vector number.
- *
- * @param routine is the visitor routine.
- *
- * @param arg is the visitor argument.
- *
- * For each installed handler at the interrupt vector the visitor function
- * specified by ``routine`` will be called with the argument specified by
- * ``arg`` and the handler information, options, routine and argument.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``routine`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
- * interrupt context.
- *
- * @par Notes
- * @parblock
- * The directive is intended for system information and diagnostics.
- *
- * Never install or remove an interrupt handler within the visitor function.
- * This may result in a deadlock.
- * @endparblock
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive may obtain and release the object allocator mutex. This may
- * cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_handler_iterate(
- rtems_vector_number vector,
- rtems_interrupt_per_handler_routine routine,
- void *arg
-);
-
-/* Generated from spec:/rtems/intr/if/server-default */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief The constant represents the index of the default interrupt server.
- */
-#define RTEMS_INTERRUPT_SERVER_DEFAULT 0
-
-/* Generated from spec:/rtems/intr/if/server-control */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This structure represents an interrupt server.
- *
- * @par Notes
- * This structure shall be treated as an opaque data type from the API point of
- * view. Members shall not be accessed directly. The structure is initialized
- * by rtems_interrupt_server_create() and maintained by the interrupt server
- * support.
- */
-typedef struct rtems_interrupt_server_control {
- #if defined(RTEMS_SMP)
- /**
- * @brief This member is the ISR lock protecting the server control state.
- */
- rtems_interrupt_lock lock;
- #endif
-
- /**
- * @brief This member is the chain of pending interrupt entries.
- */
- Chain_Control entries;
-
- /**
- * @brief This member is the identifier of the server task.
- */
- rtems_id server;
-
- /**
- * @brief This member is the error count.
- */
- unsigned long errors;
-
- /**
- * @brief This member is the server index.
- */
- uint32_t index;
-
- /**
- * @brief This member is the node for the interrupt server registry.
- */
- Chain_Node node;
-
- /**
- * @brief This member is the optional handler to destroy the interrupt server
- * control.
- */
- void ( *destroy )( struct rtems_interrupt_server_control * );
-} rtems_interrupt_server_control;
-
-/* Generated from spec:/rtems/intr/if/server-config */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This structure defines an interrupt server configuration.
- *
- * @par Notes
- * See also rtems_interrupt_server_create().
- */
-typedef struct {
- /**
- * @brief This member is the task name of the interrupt server.
- */
- rtems_name name;
-
- /**
- * @brief This member is the initial task priority of the interrupt server.
- */
- rtems_task_priority priority;
-
- /**
- * @brief This member is the task storage area of the interrupt server.
- *
- * It shall be NULL for interrupt servers created by
- * rtems_interrupt_server_create().
- */
- void *storage_area;
-
- /**
- * @brief This member is the task storage size of the interrupt server.
- *
- * For interrupt servers created by rtems_interrupt_server_create() this is the
- * task stack size.
- */
- size_t storage_size;
-
- /**
- * @brief This member is the initial mode set of the interrupt server.
- */
- rtems_mode modes;
-
- /**
- * @brief This member is the attribute set of the interrupt server.
- */
- rtems_attribute attributes;
-
- /**
- * @brief This member is an optional handler to destroy the interrupt server
- * control handed over to rtems_interrupt_server_create().
- *
- * The destroy handler is optional and may be NULL. If the destroy handler is
- * present, it is called from within the context of the interrupt server to be
- * deleted, see also rtems_interrupt_server_delete().
- */
- void ( *destroy )( rtems_interrupt_server_control * );
-} rtems_interrupt_server_config;
-
-/* Generated from spec:/rtems/intr/if/server-initialize */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Initializes the interrupt server tasks.
- *
- * @param priority is the initial task priority of the created interrupt
- * servers.
- *
- * @param stack_size is the task stack size of the created interrupt servers.
- *
- * @param modes is the initial mode set of the created interrupt servers.
- *
- * @param attributes is the attribute set of the created interrupt servers.
- *
- * @param[out] server_count is the pointer to an uint32_t object or NULL. When
- * the pointer is not equal to NULL, the count of successfully created
- * interrupt servers is stored in this object regardless of the return
- * status.
- *
- * The directive tries to create an interrupt server task for each online
- * processor in the system. The tasks will have the initial priority specified
- * by ``priority``, the stack size specified by ``stack_size``, the initial
- * mode set specified by ``modes``, and the attribute set specified by
- * ``attributes``. The count of successfully created server tasks will be
- * returned in ``server_count`` if the pointer is not equal to NULL.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INCORRECT_STATE The interrupt servers were already
- * initialized.
- *
- * @return The directive uses rtems_task_create(). If this directive fails,
- * then its error status will be returned.
- *
- * @par Notes
- * @parblock
- * Interrupt handlers may be installed on an interrupt server with
- * rtems_interrupt_server_handler_install() and removed with
- * rtems_interrupt_server_handler_remove() using a server index. In case of an
- * interrupt, the request will be forwarded to the interrupt server. The
- * handlers are executed within the interrupt server context. If one handler
- * blocks on something this may delay the processing of other handlers.
- *
- * Interrupt servers may be deleted by rtems_interrupt_server_delete().
- * @endparblock
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive may obtain and release the object allocator mutex. This may
- * cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_server_initialize(
- rtems_task_priority priority,
- size_t stack_size,
- rtems_mode modes,
- rtems_attribute attributes,
- uint32_t *server_count
-);
-
-/* Generated from spec:/rtems/intr/if/server-create */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Creates an interrupt server.
- *
- * @param[out] control is the pointer to an rtems_interrupt_server_control
- * object. When the directive call was successful, the ownership of the
- * object was transferred from the caller of the directive to the interrupt
- * server management.
- *
- * @param config is the interrupt server configuration.
- *
- * @param[out] server_index is the pointer to an uint32_t object. When the
- * directive call was successful, the index of the created interrupt server
- * will be stored in this object.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @return The directive uses rtems_task_create(). If this directive fails,
- * then its error status will be returned.
- *
- * @par Notes
- * See also rtems_interrupt_server_initialize() and
- * rtems_interrupt_server_delete().
- *
- * @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
- */
-rtems_status_code rtems_interrupt_server_create(
- rtems_interrupt_server_control *control,
- const rtems_interrupt_server_config *config,
- uint32_t *server_index
-);
-
-/* Generated from spec:/rtems/intr/if/server-handler-install */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Installs the interrupt handler routine and argument at the interrupt
- * vector on the interrupt server.
- *
- * @param server_index is the interrupt server index. The constant
- * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
- * interrupt server.
- *
- * @param vector is the interrupt vector number.
- *
- * @param info is the descriptive information of the interrupt handler to
- * install.
- *
- * @param options is the interrupt handler install option set.
- *
- * @param routine is the interrupt handler routine to install.
- *
- * @param arg is the interrupt handler argument to install.
- *
- * The handler routine specified by ``routine`` will be executed within the
- * context of the interrupt server task specified by ``server_index``.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``server_index``.
- *
- * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
- * interrupt context.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``routine`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_INVALID_NUMBER An option specified by ``info`` was not
- * applicable.
- *
- * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_UNIQUE option was set
- * in ``info`` and the interrupt vector was already occupied by a handler.
- *
- * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_SHARED option was set
- * in ``info`` and the interrupt vector was already occupied by a unique
- * handler.
- *
- * @retval ::RTEMS_TOO_MANY The handler specified by ``routine`` was already
- * installed for the interrupt vector specified by ``vector`` with an
- * argument equal to the argument specified by ``arg``.
- *
- * @retval ::RTEMS_UNSATISFIED The #RTEMS_INTERRUPT_REPLACE option was set in
- * ``info`` and no handler to replace was installed.
- *
- * @par Notes
- * See also rtems_interrupt_handler_install().
- *
- * @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
- */
-rtems_status_code rtems_interrupt_server_handler_install(
- uint32_t server_index,
- rtems_vector_number vector,
- const char *info,
- rtems_option options,
- rtems_interrupt_handler routine,
- void *arg
-);
-
-/* Generated from spec:/rtems/intr/if/server-handler-remove */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Removes the interrupt handler routine and argument from the interrupt
- * vector and the interrupt server.
- *
- * @param server_index is the interrupt server index. The constant
- * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
- * interrupt server.
- *
- * @param vector is the interrupt vector number.
- *
- * @param routine is the interrupt handler routine to remove.
- *
- * @param arg is the interrupt handler argument to remove.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``server_index``.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @retval ::RTEMS_UNSATISFIED There was no handler routine and argument pair
- * installed specified by ``routine`` and ``arg``.
- *
- * @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.
- *
- * * The directive shall not be called from within the context of an interrupt
- * server. Calling the directive from within the context of an interrupt
- * server is undefined behaviour.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_server_handler_remove(
- uint32_t server_index,
- rtems_vector_number vector,
- rtems_interrupt_handler routine,
- void *arg
-);
-
-/* Generated from spec:/rtems/intr/if/server-set-affinity */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Sets the processor affinity of the interrupt server.
- *
- * @param server_index is the interrupt server index. The constant
- * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
- * interrupt server.
- *
- * @param affinity_size is the size of the processor set referenced by
- * ``affinity`` in bytes.
- *
- * @param affinity is the pointer to a cpu_set_t object. The processor set
- * defines the new processor affinity set of the interrupt server. A set bit
- * in the processor set means that the corresponding processor shall be in
- * the processor affinity set of the task, otherwise the bit shall be
- * cleared.
- *
- * @param priority is the new real priority for the interrupt server.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``server_index``.
- *
- * @return The directive uses rtems_scheduler_ident_by_processor_set(),
- * rtems_task_set_scheduler(), and rtems_task_set_affinity(). If one of
- * these directive fails, then its error status will be returned.
- *
- * @par Notes
- * @parblock
- * The scheduler is set determined by the highest numbered processor in the
- * affinity set specified by ``affinity``.
- *
- * This operation is only reliable in case the interrupt server was suspended
- * via rtems_interrupt_server_suspend().
- * @endparblock
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive may change the processor affinity of a task. This may cause
- * the calling task to be preempted.
- *
- * * The directive may change the priority of a task. This may cause the
- * calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_server_set_affinity(
- uint32_t server_index,
- size_t affinity_size,
- const cpu_set_t *affinity,
- rtems_task_priority priority
-);
-
-/* Generated from spec:/rtems/intr/if/server-delete */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Deletes the interrupt server.
- *
- * @param server_index is the index of the interrupt server to delete.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * server index specified by ``server_index``.
- *
- * @par Notes
- * @parblock
- * The interrupt server deletes itself, so after the return of the directive
- * the interrupt server may be still in the termination process depending on
- * the task priorities of the system.
- *
- * See also rtems_interrupt_server_create().
- * @endparblock
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within task context.
- *
- * * The directive shall not be called from within the context of an interrupt
- * server. Calling the directive from within the context of an interrupt
- * server is undefined behaviour.
- *
- * * 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
- */
-rtems_status_code rtems_interrupt_server_delete( uint32_t server_index );
-
-/* Generated from spec:/rtems/intr/if/server-suspend */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Suspends the interrupt server.
- *
- * @param server_index is the index of the interrupt server to suspend. The
- * constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the
- * default interrupt server.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``server_index``.
- *
- * @par Notes
- * Interrupt server may be resumed by rtems_interrupt_server_resume().
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within task context.
- *
- * * The directive shall not be called from within the context of an interrupt
- * server. Calling the directive from within the context of an interrupt
- * server is undefined behaviour.
- *
- * * 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
- */
-rtems_status_code rtems_interrupt_server_suspend( uint32_t server_index );
-
-/* Generated from spec:/rtems/intr/if/server-resume */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Resumes the interrupt server.
- *
- * @param server_index is the index of the interrupt server to resume. The
- * constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the
- * default interrupt server.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``server_index``.
- *
- * @par Notes
- * Interrupt server may be suspended by rtems_interrupt_server_suspend().
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within task context.
- *
- * * The directive shall not be called from within the context of an interrupt
- * server. Calling the directive from within the context of an interrupt
- * server is undefined behaviour.
- *
- * * 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
- */
-rtems_status_code rtems_interrupt_server_resume( uint32_t server_index );
-
-/* Generated from spec:/rtems/intr/if/server-move */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Moves the interrupt handlers installed at the interrupt vector and
- * the source interrupt server to the destination interrupt server.
- *
- * @param source_server_index is the index of the source interrupt server. The
- * constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the
- * default interrupt server.
- *
- * @param vector is the interrupt vector number.
- *
- * @param destination_server_index is the index of the destination interrupt
- * server. The constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to
- * specify the default interrupt server.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``source_server_index``.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``destination_server_index``.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within task context.
- *
- * * The directive shall not be called from within the context of an interrupt
- * server. Calling the directive from within the context of an interrupt
- * server is undefined behaviour.
- *
- * * 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
- */
-rtems_status_code rtems_interrupt_server_move(
- uint32_t source_server_index,
- rtems_vector_number vector,
- uint32_t destination_server_index
-);
-
-/* Generated from spec:/rtems/intr/if/server-handler-iterate */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Iterates over all interrupt handler installed at the interrupt vector
- * and interrupt server.
- *
- * @param server_index is the index of the interrupt server.
- *
- * @param vector is the interrupt vector number.
- *
- * @param routine is the visitor routine.
- *
- * @param arg is the visitor argument.
- *
- * For each installed handler at the interrupt vector and interrupt server the
- * visitor function specified by ``vector`` will be called with the argument
- * specified by ``routine`` and the handler information, options, routine and
- * argument.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``server_index``.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
- * number specified by ``vector``.
- *
- * @par Notes
- * @parblock
- * The directive is intended for system information and diagnostics.
- *
- * Never install or remove an interrupt handler within the visitor function.
- * This may result in a deadlock.
- * @endparblock
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive may obtain and release the object allocator mutex. This may
- * cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_server_handler_iterate(
- uint32_t server_index,
- rtems_vector_number vector,
- rtems_interrupt_per_handler_routine routine,
- void *arg
-);
-
-/* Generated from spec:/rtems/intr/if/server-action */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This structure represents an interrupt server action.
- *
- * @par Notes
- * This structure shall be treated as an opaque data type from the API point of
- * view. Members shall not be accessed directly.
- */
-typedef struct rtems_interrupt_server_action {
- /**
- * @brief This member is the reference to the next action or NULL.
- */
- struct rtems_interrupt_server_action *next;
-
- /**
- * @brief This member is the interrupt handler.
- */
- rtems_interrupt_handler handler;
-
- /**
- * @brief This member is the interrupt handler argument.
- */
- void *arg;
-} rtems_interrupt_server_action;
-
-/* Generated from spec:/rtems/intr/if/server-entry */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This structure represents an interrupt server entry.
- *
- * @par Notes
- * This structure shall be treated as an opaque data type from the API point of
- * view. Members shall not be accessed directly. An entry is initialized by
- * rtems_interrupt_server_entry_initialize() and destroyed by
- * rtems_interrupt_server_entry_destroy(). Interrupt server actions can be
- * prepended to the entry by rtems_interrupt_server_action_prepend(). The
- * entry is submitted to be serviced by rtems_interrupt_server_entry_submit().
- */
-typedef struct {
- /**
- * @brief This member is the node for the interrupt entry processing.
- */
- Chain_Node node;
-
- /**
- * @brief This member references the interrupt server used to process the
- * entry.
- */
- rtems_interrupt_server_control *server;
-
- /**
- * @brief This member is the interrupt vector number.
- */
- rtems_vector_number vector;
-
- /**
- * @brief This member is the interrupt server actions list head.
- */
- rtems_interrupt_server_action *actions;
-} rtems_interrupt_server_entry;
-
-/* Generated from spec:/rtems/intr/if/server-entry-initialize */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Initializes the interrupt server entry.
- *
- * @param server_index is the interrupt server index. The constant
- * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
- * interrupt server.
- *
- * @param entry is the interrupt server entry to initialize.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``server_index``.
- *
- * @par Notes
- * After initialization, the list of actions of the interrupt server entry is
- * empty. Actions may be prepended by rtems_interrupt_server_action_prepend().
- * Interrupt server entries may be moved to another interrupt vector with
- * rtems_interrupt_server_entry_move(). Server entries may be submitted to get
- * serviced by the interrupt server with rtems_interrupt_server_entry_submit().
- * Server entries may be destroyed by rtems_interrupt_server_entry_destroy().
- *
- * @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
- */
-rtems_status_code rtems_interrupt_server_entry_initialize(
- uint32_t server_index,
- rtems_interrupt_server_entry *entry
-);
-
-/* Generated from spec:/rtems/intr/if/server-action-prepend */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Prepends the interrupt server action to the list of actions of the
- * interrupt server entry.
- *
- * @param[in,out] entry is the interrupt server entry to prepend the interrupt
- * server action. It shall have been initialized via
- * rtems_interrupt_server_entry_initialize().
- *
- * @param[out] action is the interrupt server action to initialize and prepend
- * to the list of actions of the entry.
- *
- * @param routine is the interrupt handler routine to set in the action.
- *
- * @param arg is the interrupt handler argument to set in the action.
- *
- * @par Notes
- * No error checking is performed by the directive.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive will not cause the calling task to be preempted.
- *
- * * The interrupt server entry shall have been initialized by
- * rtems_interrupt_server_entry_initialize() and further optional calls to
- * rtems_interrupt_server_action_prepend().
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_action_prepend() with the same interrupt server
- * entry. Calling the directive under this condition is undefined behaviour.
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_entry_move() with the same interrupt server entry.
- * Calling the directive under this condition is undefined behaviour.
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_entry_submit() with the same interrupt server
- * entry. Calling the directive under this condition is undefined behaviour.
- *
- * * The directive shall not be called while the interrupt server entry is
- * pending on or serviced by its current interrupt server. Calling the
- * directive under these conditions is undefined behaviour.
- * @endparblock
- */
-void rtems_interrupt_server_action_prepend(
- rtems_interrupt_server_entry *entry,
- rtems_interrupt_server_action *action,
- rtems_interrupt_handler routine,
- void *arg
-);
-
-/* Generated from spec:/rtems/intr/if/server-entry-destroy */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Destroys the interrupt server entry.
- *
- * @param[in,out] entry is the interrupt server entry to destroy.
- *
- * @par Notes
- * No error checking is performed by the directive.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within task context.
- *
- * * The directive shall not be called from within the context of an interrupt
- * server. Calling the directive from within the context of an interrupt
- * server is undefined behaviour.
- *
- * * The directive sends a request to another task and waits for a response.
- * This may cause the calling task to be blocked and unblocked.
- *
- * * The interrupt server entry shall have been initialized by
- * rtems_interrupt_server_entry_initialize() and further optional calls to
- * rtems_interrupt_server_action_prepend().
- * @endparblock
- */
-void rtems_interrupt_server_entry_destroy(
- rtems_interrupt_server_entry *entry
-);
-
-/* Generated from spec:/rtems/intr/if/server-entry-submit */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Submits the interrupt server entry to be serviced by the interrupt
- * server.
- *
- * @param entry is the interrupt server entry to submit.
- *
- * The directive appends the entry to the pending entries of the interrupt
- * server. The interrupt server is notified that a new entry is pending. Once
- * the interrupt server is scheduled it services the actions of all pending
- * entries.
- *
- * @par Notes
- * @parblock
- * This directive may be used to do a two-step interrupt processing. The first
- * step is done from within interrupt context by a call to this directive. The
- * second step is then done from within the context of the interrupt server.
- *
- * No error checking is performed by the directive.
- *
- * A submitted entry may be destroyed by
- * rtems_interrupt_server_entry_destroy().
- * @endparblock
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive may unblock a task. This may cause the calling task to be
- * preempted.
- *
- * * The interrupt server entry shall have been initialized by
- * rtems_interrupt_server_entry_initialize() and further optional calls to
- * rtems_interrupt_server_action_prepend().
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_action_prepend() with the same interrupt server
- * entry. Calling the directive under this condition is undefined behaviour.
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_entry_move() with the same interrupt server entry.
- * Calling the directive under this condition is undefined behaviour.
- * @endparblock
- */
-void rtems_interrupt_server_entry_submit(
- rtems_interrupt_server_entry *entry
-);
-
-/* Generated from spec:/rtems/intr/if/server-entry-move */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Moves the interrupt server entry to the interrupt server.
- *
- * @param entry is the interrupt server entry to move.
- *
- * @param server_index is the index of the destination interrupt server. The
- * constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the
- * default interrupt server.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``server_index``.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive may obtain and release the object allocator mutex. This may
- * cause the calling task to be preempted.
- *
- * * The interrupt server entry shall have been initialized by
- * rtems_interrupt_server_entry_initialize() and further optional calls to
- * rtems_interrupt_server_action_prepend().
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_action_prepend() with the same interrupt server
- * entry. Calling the directive under this condition is undefined behaviour.
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_entry_move() with the same interrupt server entry.
- * Calling the directive under this condition is undefined behaviour.
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_entry_submit() with the same interrupt server
- * entry. Calling the directive under this condition is undefined behaviour.
- *
- * * The directive shall not be called while the interrupt server entry is
- * pending on or serviced by its current interrupt server. Calling the
- * directive under these conditions is undefined behaviour.
- * @endparblock
- */
-rtems_status_code rtems_interrupt_server_entry_move(
- rtems_interrupt_server_entry *entry,
- uint32_t server_index
-);
-
-/* Generated from spec:/rtems/intr/if/server-request */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This structure represents an interrupt server request.
- *
- * @par Notes
- * This structure shall be treated as an opaque data type from the API point of
- * view. Members shall not be accessed directly. A request is initialized by
- * rtems_interrupt_server_request_initialize() and destroyed by
- * rtems_interrupt_server_request_destroy(). The interrupt vector of the
- * request can be set by rtems_interrupt_server_request_set_vector(). The
- * request is submitted to be serviced by
- * rtems_interrupt_server_request_submit().
- */
-typedef struct {
- /**
- * @brief This member is the interrupt server entry.
- */
- rtems_interrupt_server_entry entry;
-
- /**
- * @brief This member is the interrupt server action.
- */
- rtems_interrupt_server_action action;
-} rtems_interrupt_server_request;
-
-/* Generated from spec:/rtems/intr/if/server-request-initialize */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Initializes the interrupt server request.
- *
- * @param server_index is the interrupt server index. The constant
- * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
- * interrupt server.
- *
- * @param[out] request is the interrupt server request to initialize.
- *
- * @param routine is the interrupt handler routine for the request action.
- *
- * @param arg is the interrupt handler argument for the request action.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
- * index specified by ``server_index``.
- *
- * @par Notes
- * An interrupt server requests consists of an interrupt server entry and
- * exactly one interrupt server action. The interrupt vector of the request
- * may be changed with rtems_interrupt_server_request_set_vector(). Interrupt
- * server requests may be submitted to get serviced by the interrupt server
- * with rtems_interrupt_server_request_submit(). Requests may be destroyed by
- * rtems_interrupt_server_request_destroy().
- *
- * @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
- */
-rtems_status_code rtems_interrupt_server_request_initialize(
- uint32_t server_index,
- rtems_interrupt_server_request *request,
- rtems_interrupt_handler routine,
- void *arg
-);
-
-/* Generated from spec:/rtems/intr/if/server-request-set-vector */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Sets the interrupt vector in the interrupt server request.
- *
- * @param[in,out] request is the interrupt server request to change.
- *
- * @param vector is the interrupt vector number to be used by the request.
- *
- * @par Notes
- * @parblock
- * By default, the interrupt vector of an interrupt server request is set to a
- * special value which is outside the range of vectors supported by the
- * interrupt controller hardware.
- *
- * Calls to rtems_interrupt_server_request_submit() will disable the interrupt
- * vector of the request. After processing of the request by the interrupt
- * server the interrupt vector will be enabled again.
- * @endparblock
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive will not cause the calling task to be preempted.
- *
- * * The interrupt server request shall have been initialized by
- * rtems_interrupt_server_request_initialize().
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_request_set_vector() with the same interrupt server
- * request. Calling the directive under this condition is undefined
- * behaviour.
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_request_submit() with the same interrupt server
- * request. Calling the directive under this condition is undefined
- * behaviour.
- *
- * * The directive shall not be called while the interrupt server entry is
- * pending on or serviced by its current interrupt server. Calling the
- * directive under these conditions is undefined behaviour.
- * @endparblock
- */
-static inline void rtems_interrupt_server_request_set_vector(
- rtems_interrupt_server_request *request,
- rtems_vector_number vector
-)
-{
- request->entry.vector = vector;
-}
-
-/* Generated from spec:/rtems/intr/if/server-request-destroy */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Destroys the interrupt server request.
- *
- * @param[in,out] request is the interrupt server request to destroy.
- *
- * @par Notes
- * No error checking is performed by the directive.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within task context.
- *
- * * The directive shall not be called from within the context of an interrupt
- * server. Calling the directive from within the context of an interrupt
- * server is undefined behaviour.
- *
- * * The directive sends a request to another task and waits for a response.
- * This may cause the calling task to be blocked and unblocked.
- *
- * * The interrupt server request shall have been initialized by
- * rtems_interrupt_server_request_initialize().
- * @endparblock
- */
-static inline void rtems_interrupt_server_request_destroy(
- rtems_interrupt_server_request *request
-)
-{
- rtems_interrupt_server_entry_destroy( &request->entry );
-}
-
-/* Generated from spec:/rtems/intr/if/server-request-submit */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief Submits the interrupt server request to be serviced by the interrupt
- * server.
- *
- * @param[in,out] request is the interrupt server request to submit.
- *
- * The directive appends the interrupt server entry of the request to the
- * pending entries of the interrupt server. The interrupt server is notified
- * that a new entry is pending. Once the interrupt server is scheduled it
- * services the actions of all pending entries.
- *
- * @par Notes
- * @parblock
- * This directive may be used to do a two-step interrupt processing. The first
- * step is done from within interrupt context by a call to this directive. The
- * second step is then done from within the context of the interrupt server.
- *
- * No error checking is performed by the directive.
- *
- * A submitted request may be destroyed by
- * rtems_interrupt_server_request_destroy().
- * @endparblock
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within interrupt context.
- *
- * * The directive may be called from within device driver initialization
- * context.
- *
- * * The directive may be called from within task context.
- *
- * * The directive may unblock a task. This may cause the calling task to be
- * preempted.
- *
- * * The interrupt server request shall have been initialized by
- * rtems_interrupt_server_request_initialize().
- *
- * * The directive shall not be called concurrently with
- * rtems_interrupt_server_request_set_vector() with the same interrupt server
- * request. Calling the directive under this condition is undefined
- * behaviour.
- * @endparblock
- */
-static inline void rtems_interrupt_server_request_submit(
- rtems_interrupt_server_request *request
-)
-{
- rtems_interrupt_server_entry_submit( &request->entry );
-}
-
#ifdef __cplusplus
}
#endif
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/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/clock.h b/cpukit/include/rtems/rtems/clock.h
index e158b18947..7247b483db 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 struct timespec 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 struct timeval 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 struct timespec 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 struct timeval 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/intr.h b/cpukit/include/rtems/rtems/intr.h
index 7663541adc..573cdf6f17 100644
--- a/cpukit/include/rtems/rtems/intr.h
+++ b/cpukit/include/rtems/rtems/intr.h
@@ -7,7 +7,7 @@
*/
/*
- * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2008, 2021 embedded brains GmbH (http://www.embedded-brains.de)
* Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
*
* Redistribution and use in source and binary forms, with or without
@@ -54,9 +54,16 @@
#ifndef _RTEMS_RTEMS_INTR_H
#define _RTEMS_RTEMS_INTR_H
+#include <stddef.h>
#include <stdint.h>
+#include <sys/cpuset.h>
+#include <rtems/rtems/attr.h>
+#include <rtems/rtems/modes.h>
+#include <rtems/rtems/options.h>
#include <rtems/rtems/status.h>
+#include <rtems/rtems/types.h>
#include <rtems/score/basedefs.h>
+#include <rtems/score/chain.h>
#include <rtems/score/cpu.h>
#include <rtems/score/isr.h>
#include <rtems/score/isrlevel.h>
@@ -82,31 +89,14 @@ extern "C" {
* task to be preempted upon exit from an ISR.
*/
-/* Generated from spec:/rtems/intr/if/isr */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
- *
- * @brief This type defines the return type of interrupt service routines.
- *
- * This type can be used to document interrupt service routines in the source
- * code.
- */
-typedef ISR_Handler rtems_isr;
-
-/* Generated from spec:/rtems/intr/if/isr-entry */
+/* Generated from spec:/rtems/intr/if/vector-number */
/**
* @ingroup RTEMSAPIClassicIntr
*
- * @brief Interrupt service routines installed by rtems_interrupt_catch() shall
- * have this type.
+ * @brief This integer type represents interrupt vector numbers.
*/
-#if CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE
- typedef ISR_Handler_entry rtems_isr_entry;
-#else
- typedef void ( *rtems_isr_entry )( void * );
-#endif
+typedef ISR_Vector_number rtems_vector_number;
/* Generated from spec:/rtems/intr/if/level */
@@ -117,33 +107,31 @@ typedef ISR_Handler rtems_isr;
*/
typedef ISR_Level rtems_interrupt_level;
-/* Generated from spec:/rtems/intr/if/lock */
+/* Generated from spec:/rtems/intr/if/isr */
/**
* @ingroup RTEMSAPIClassicIntr
*
- * @brief This structure represents an ISR lock.
- */
-typedef ISR_lock_Control rtems_interrupt_lock;
-
-/* Generated from spec:/rtems/intr/if/lock-context */
-
-/**
- * @ingroup RTEMSAPIClassicIntr
+ * @brief This type defines the return type of interrupt service routines.
*
- * @brief This structure provides an ISR lock context for acquire and release
- * pairs.
+ * This type can be used to document interrupt service routines in the source
+ * code.
*/
-typedef ISR_lock_Context rtems_interrupt_lock_context;
+typedef ISR_Handler rtems_isr;
-/* Generated from spec:/rtems/intr/if/vector-number */
+/* Generated from spec:/rtems/intr/if/isr-entry */
/**
* @ingroup RTEMSAPIClassicIntr
*
- * @brief This integer type represents interrupt vector numbers.
+ * @brief Interrupt service routines installed by rtems_interrupt_catch() shall
+ * have this type.
*/
-typedef ISR_Vector_number rtems_vector_number;
+#if CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE
+ typedef ISR_Handler_entry rtems_isr_entry;
+#else
+ typedef void ( *rtems_isr_entry )( void * );
+#endif
/* Generated from spec:/rtems/intr/if/catch */
@@ -503,6 +491,25 @@ rtems_status_code rtems_interrupt_catch(
*/
#define rtems_interrupt_is_in_progress() _ISR_Is_in_progress()
+/* Generated from spec:/rtems/intr/if/lock */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure represents an ISR lock.
+ */
+typedef ISR_lock_Control rtems_interrupt_lock;
+
+/* Generated from spec:/rtems/intr/if/lock-context */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure provides an ISR lock context for acquire and release
+ * pairs.
+ */
+typedef ISR_lock_Context rtems_interrupt_lock_context;
+
/* Generated from spec:/rtems/intr/if/lock-initialize */
/**
@@ -874,6 +881,680 @@ rtems_status_code rtems_interrupt_catch(
#define RTEMS_INTERRUPT_LOCK_REFERENCE( _designator, _target ) \
ISR_LOCK_REFERENCE( _designator, _target )
+/* Generated from spec:/rtems/intr/if/shared */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This interrupt handler install option allows that the interrupt
+ * handler may share the interrupt vector with other handler.
+ */
+#define RTEMS_INTERRUPT_SHARED ( (rtems_option) 0x00000000 )
+
+/* Generated from spec:/rtems/intr/if/unique */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This interrupt handler install option ensures that the interrupt
+ * handler is unique.
+ *
+ * This option prevents other handler from using the same interrupt vector.
+ */
+#define RTEMS_INTERRUPT_UNIQUE ( (rtems_option) 0x00000001 )
+
+/* Generated from spec:/rtems/intr/if/replace */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This interrupt handler install option requests that the interrupt
+ * handler replaces the first handler with the same argument.
+ */
+#define RTEMS_INTERRUPT_REPLACE ( (rtems_option) 0x00000002 )
+
+/* Generated from spec:/rtems/intr/if/is-shared */
+
+/**
+ * @brief Checks if the interrupt handler shared option is set.
+ *
+ * @param _options is the interrupt handler option set to check.
+ *
+ * @return Returns true, if the interrupt handler shared option
+ * #RTEMS_INTERRUPT_SHARED is set, otherwise false.
+ */
+#define RTEMS_INTERRUPT_IS_SHARED( _options ) \
+ ( ( _options ) & RTEMS_INTERRUPT_SHARED )
+
+/* Generated from spec:/rtems/intr/if/is-unique */
+
+/**
+ * @brief Checks if the interrupt handler unique option is set.
+ *
+ * @param _options is the interrupt handler option set to check.
+ *
+ * @return Returns true, if the interrupt handler unique option
+ * #RTEMS_INTERRUPT_UNIQUE is set, otherwise false.
+ */
+#define RTEMS_INTERRUPT_IS_UNIQUE( _options ) \
+ ( ( _options ) & RTEMS_INTERRUPT_UNIQUE )
+
+/* Generated from spec:/rtems/intr/if/is-replace */
+
+/**
+ * @brief Checks if the interrupt handler replace option is set.
+ *
+ * @param _options is the interrupt handler option set to check.
+ *
+ * @return Returns true, if the interrupt handler replace option
+ * #RTEMS_INTERRUPT_REPLACE is set, otherwise false.
+ */
+#define RTEMS_INTERRUPT_IS_REPLACE( _options ) \
+ ( ( _options ) & RTEMS_INTERRUPT_REPLACE )
+
+/* Generated from spec:/rtems/intr/if/handler */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Interrupt handler routines shall have this type.
+ */
+typedef void ( *rtems_interrupt_handler )( void * );
+
+/* Generated from spec:/rtems/intr/if/per-handler-routine */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Visitor routines invoked by rtems_interrupt_handler_iterate() shall
+ * have this type.
+ */
+typedef void ( *rtems_interrupt_per_handler_routine )(
+ void *,
+ const char *,
+ rtems_option,
+ rtems_interrupt_handler,
+ void *
+);
+
+/* Generated from spec:/rtems/intr/if/entry */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure represents an interrupt entry.
+ *
+ * @par Notes
+ * This structure shall be treated as an opaque data type from the API point of
+ * view. Members shall not be accessed directly. An entry may be initialized
+ * by RTEMS_INTERRUPT_ENTRY_INITIALIZER() or
+ * rtems_interrupt_entry_initialize(). It may be installed for an interrupt
+ * vector with rtems_interrupt_entry_install() and removed from an interrupt
+ * vector by rtems_interrupt_entry_remove().
+ */
+typedef struct rtems_interrupt_entry {
+ /**
+ * @brief This member is the interrupt handler routine.
+ */
+ rtems_interrupt_handler handler;
+
+ /**
+ * @brief This member is the interrupt handler argument.
+ */
+ void *arg;
+
+ /**
+ * @brief This member is the reference to the next entry or NULL.
+ */
+ struct rtems_interrupt_entry *next;
+
+ /**
+ * @brief This member is the descriptive information of the entry.
+ */
+ const char *info;
+} rtems_interrupt_entry;
+
+/* Generated from spec:/rtems/intr/if/entry-initializer */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Statically initializes an interrupt entry object.
+ *
+ * @param _routine is the interrupt handler routine for the entry.
+ *
+ * @param _arg is the interrupt handler argument for the entry.
+ *
+ * @param _info is the descriptive information for the entry.
+ *
+ * @par Notes
+ * Alternatively, rtems_interrupt_entry_initialize() may be used to dynamically
+ * initialize an interrupt entry.
+ */
+#define RTEMS_INTERRUPT_ENTRY_INITIALIZER( _routine, _arg, _info ) \
+ { _routine, _arg, NULL, _info }
+
+/* Generated from spec:/rtems/intr/if/entry-initialize */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Initializes the interrupt entry.
+ *
+ * @param[out] entry is the interrupt entry to initialize.
+ *
+ * @param routine is the interrupt handler routine for the entry.
+ *
+ * @param arg is the interrupt handler argument for the entry.
+ *
+ * @param info is the descriptive information for the entry.
+ *
+ * @par Notes
+ * Alternatively, RTEMS_INTERRUPT_ENTRY_INITIALIZER() may be used to statically
+ * initialize an interrupt entry.
+ *
+ * @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
+ */
+static inline void rtems_interrupt_entry_initialize(
+ rtems_interrupt_entry *entry,
+ rtems_interrupt_handler routine,
+ void *arg,
+ const char *info
+)
+{
+ entry->handler = routine;
+ entry->arg = arg;
+ entry->next = NULL;
+ entry->info = info;
+}
+
+/* Generated from spec:/rtems/intr/if/entry-install */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Installs the interrupt entry at the interrupt vector.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param options is the interrupt entry install option set.
+ *
+ * @param entry is the interrupt entry to install.
+ *
+ * One of the following mutually exclusive options
+ *
+ * * #RTEMS_INTERRUPT_UNIQUE, and
+ *
+ * * #RTEMS_INTERRUPT_SHARED
+ *
+ * shall be set in the ``options`` parameter.
+ *
+ * The handler routine of the entry specified by ``entry`` will be called with
+ * the handler argument of the entry when dispatched. The order in which
+ * shared interrupt handlers are dispatched for one vector is defined by the
+ * installation order. The first installed handler is dispatched first.
+ *
+ * If the option #RTEMS_INTERRUPT_UNIQUE is set, then it will be ensured that
+ * the handler will be the only one for the interrupt vector.
+ *
+ * If the option #RTEMS_INTERRUPT_SHARED is set, then multiple handlers may be
+ * installed for the interrupt vector.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``entry`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The handler routine of the entry was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
+ * interrupt context.
+ *
+ * @retval ::RTEMS_INVALID_NUMBER An option specified by ``options`` was not
+ * applicable.
+ *
+ * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_UNIQUE option was set
+ * in ``entry`` and the interrupt vector was already occupied by a handler.
+ *
+ * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_SHARED option was set
+ * in ``entry`` and the interrupt vector was already occupied by a unique
+ * handler.
+ *
+ * @retval ::RTEMS_TOO_MANY The handler routine of the entry specified by
+ * ``entry`` was already installed for the interrupt vector specified by
+ * ``vector`` with an argument equal to the handler argument of the entry.
+ *
+ * @par Notes
+ * When the directive call was successful, the ownership of the interrupt entry
+ * has been transferred from the caller to the interrupt service. An installed
+ * interrupt entry may be removed from the interrupt service by calling
+ * rtems_interrupt_entry_remove().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ *
+ * * The interrupt entry shall have been initialized by
+ * rtems_interrupt_entry_initialize() or RTEMS_INTERRUPT_ENTRY_INITIALIZER().
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_entry_install(
+ rtems_vector_number vector,
+ rtems_option options,
+ rtems_interrupt_entry *entry
+);
+
+/* Generated from spec:/rtems/intr/if/entry-remove */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Removes the interrupt entry from the interrupt vector.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param entry is the interrupt entry to remove.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``entry`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
+ * interrupt context.
+ *
+ * @retval ::RTEMS_UNSATISFIED The entry specified by ``entry`` was not
+ * installed at the interrupt vector specified by ``vector``.
+ *
+ * @par Notes
+ * When the directive call was successful, the ownership of the interrupt entry
+ * has been transferred from the interrupt service to the caller.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ *
+ * * The interrupt entry shall have been installed by
+ * rtems_interrupt_entry_install().
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_entry_remove(
+ rtems_vector_number vector,
+ rtems_interrupt_entry *entry
+);
+
+/* Generated from spec:/rtems/intr/if/handler-install */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Installs the interrupt handler routine and argument at the interrupt
+ * vector.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param info is the descriptive information of the interrupt handler to
+ * install.
+ *
+ * @param options is the interrupt handler install option set.
+ *
+ * @param routine is the interrupt handler routine to install.
+ *
+ * @param arg is the interrupt handler argument to install.
+ *
+ * One of the following mutually exclusive options
+ *
+ * * #RTEMS_INTERRUPT_UNIQUE,
+ *
+ * * #RTEMS_INTERRUPT_SHARED, and
+ *
+ * * #RTEMS_INTERRUPT_REPLACE
+ *
+ * shall be set in the ``options`` parameter.
+ *
+ * The handler routine will be called with the argument specified by ``arg``
+ * when dispatched. The order in which shared interrupt handlers are
+ * dispatched for one vector is defined by the installation order. The first
+ * installed handler is dispatched first.
+ *
+ * If the option #RTEMS_INTERRUPT_UNIQUE is set, then it will be ensured that
+ * the handler will be the only one for the interrupt vector.
+ *
+ * If the option #RTEMS_INTERRUPT_SHARED is set, then multiple handler may be
+ * installed for the interrupt vector.
+ *
+ * If the option #RTEMS_INTERRUPT_REPLACE is set, then the handler specified by
+ * ``routine`` will replace the first handler with the same argument for the
+ * interrupt vector if it exists, otherwise an error status will be returned.
+ * A second handler with the same argument for the interrupt vector will remain
+ * unchanged. The new handler will inherit the unique or shared options from
+ * the replaced handler.
+ *
+ * An informative description may be provided in ``info``. It may be used for
+ * system debugging and diagnostic tools. The referenced string has to be
+ * persistent as long as the handler is installed.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``routine`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
+ * interrupt context.
+ *
+ * @retval ::RTEMS_NO_MEMORY There was not enough memory available to allocate
+ * data structures to install the handler.
+ *
+ * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_UNIQUE option was set
+ * in ``options`` and the interrupt vector was already occupied by a handler.
+ *
+ * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_SHARED option was set
+ * in ``options`` and the interrupt vector was already occupied by a unique
+ * handler.
+ *
+ * @retval ::RTEMS_TOO_MANY The handler specified by ``routine`` was already
+ * installed for the interrupt vector specified by ``vector`` with an
+ * argument equal to the argument specified by ``arg``.
+ *
+ * @retval ::RTEMS_UNSATISFIED The #RTEMS_INTERRUPT_REPLACE option was set in
+ * ``options`` and no handler to replace was installed.
+ *
+ * @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
+ */
+rtems_status_code rtems_interrupt_handler_install(
+ rtems_vector_number vector,
+ const char *info,
+ rtems_option options,
+ rtems_interrupt_handler routine,
+ void *arg
+);
+
+/* Generated from spec:/rtems/intr/if/handler-remove */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Removes the interrupt handler routine and argument from the interrupt
+ * vector.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param routine is the interrupt handler routine to remove.
+ *
+ * @param arg is the interrupt handler argument to remove.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``routine`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
+ * interrupt context.
+ *
+ * @retval ::RTEMS_UNSATISFIED There was no handler routine and argument pair
+ * installed specified by ``routine`` and ``arg``.
+ *
+ * @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
+ */
+rtems_status_code rtems_interrupt_handler_remove(
+ rtems_vector_number vector,
+ rtems_interrupt_handler routine,
+ void *arg
+);
+
+/* Generated from spec:/rtems/intr/if/vector-is-enabled */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Checks if the interrupt vector is enabled.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param[out] enabled is the pointer to a ``bool`` object. When the directive
+ * call is successful, the enabled status of the interrupt associated with
+ * the interrupt vector specified by ``vector`` will be stored in this
+ * object. When the interrupt was enabled for the processor executing the
+ * directive call at some time point during the call, the object value will
+ * be set to true, otherwise to false.
+ *
+ * The directive checks if the interrupt associated with the interrupt vector
+ * specified by ``vector`` was enabled for the processor executing the
+ * directive call at some time point during the call.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``enabled`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @par Notes
+ * Interrupt vectors may be enabled by rtems_interrupt_vector_enable() and
+ * disabled by rtems_interrupt_vector_disable().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_vector_is_enabled(
+ rtems_vector_number vector,
+ bool *enabled
+);
+
+/* Generated from spec:/rtems/intr/if/vector-enable */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Enables the interrupt vector.
+ *
+ * @param vector is the number of the interrupt vector to enable.
+ *
+ * The directive enables the interrupt vector specified by ``vector``. This
+ * allows that interrupt service requests are issued to the target processors
+ * of the interrupt vector. Interrupt service requests for an interrupt vector
+ * may be raised by rtems_interrupt_raise(), rtems_interrupt_raise_on(),
+ * external signals, or messages.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_UNSATISFIED The request to enable the interrupt vector has
+ * not been satisfied.
+ *
+ * @par Notes
+ * The rtems_interrupt_get_attributes() directive may be used to check if an
+ * interrupt vector can be enabled. Interrupt vectors may be disabled by
+ * rtems_interrupt_vector_disable().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_vector_enable( rtems_vector_number vector );
+
+/* Generated from spec:/rtems/intr/if/vector-disable */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Disables the interrupt vector.
+ *
+ * @param vector is the number of the interrupt vector to disable.
+ *
+ * The directive disables the interrupt vector specified by ``vector``. This
+ * prevents that an interrupt service request is issued to the target
+ * processors of the interrupt vector.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_UNSATISFIED The request to disable the interrupt vector has
+ * not been satisfied.
+ *
+ * @par Notes
+ * The rtems_interrupt_get_attributes() directive may be used to check if an
+ * interrupt vector can be disabled. Interrupt vectors may be enabled by
+ * rtems_interrupt_vector_enable(). There may be targets on which some
+ * interrupt vectors cannot be disabled, for example a hardware watchdog
+ * interrupt or software generated interrupts.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_vector_disable( rtems_vector_number vector );
+
+/* Generated from spec:/rtems/intr/if/is-pending */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Checks if the interrupt is pending.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param[out] pending is the pointer to a ``bool`` object. When the directive
+ * call is successful, the pending status of the interrupt associated with
+ * the interrupt vector specified by ``vector`` will be stored in this
+ * object. When the interrupt was pending for the processor executing the
+ * directive call at some time point during the call, the object value will
+ * be set to true, otherwise to false.
+ *
+ * The directive checks if the interrupt associated with the interrupt vector
+ * specified by ``vector`` was pending for the processor executing the
+ * directive call at some time point during the call.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``pending`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_UNSATISFIED The request to get the pending status has not
+ * been satisfied.
+ *
+ * @par Notes
+ * Interrupts may be made pending by calling the rtems_interrupt_raise() or
+ * rtems_interrupt_raise_on() directives or due to external signals or
+ * messages. The pending state may be cleared by rtems_interrupt_clear().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_is_pending(
+ rtems_vector_number vector,
+ bool *pending
+);
+
/* Generated from spec:/rtems/intr/if/raise */
/**
@@ -997,6 +1678,1576 @@ rtems_status_code rtems_interrupt_raise_on(
*/
rtems_status_code rtems_interrupt_clear( rtems_vector_number vector );
+/* Generated from spec:/rtems/intr/if/get-affinity */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Gets the processor affinity set of the interrupt vector.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param affinity_size is the size of the processor set referenced by
+ * ``affinity`` in bytes.
+ *
+ * @param[out] affinity is the pointer to a cpu_set_t object. When the
+ * directive call is successful, the processor affinity set of the interrupt
+ * vector will be stored in this object. A set bit in the processor set
+ * means that the corresponding processor is in the processor affinity set of
+ * the interrupt vector, otherwise the bit is cleared.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``affinity`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_INVALID_SIZE The size specified by ``affinity_size`` of the
+ * processor set was too small for the processor affinity set of the
+ * interrupt vector.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_get_affinity(
+ rtems_vector_number vector,
+ size_t affinity_size,
+ cpu_set_t *affinity
+);
+
+/* Generated from spec:/rtems/intr/if/set-affinity */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Sets the processor affinity set of the interrupt vector.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param affinity_size is the size of the processor set referenced by
+ * ``affinity`` in bytes.
+ *
+ * @param affinity is the pointer to a cpu_set_t object. The processor set
+ * defines the new processor affinity set of the interrupt vector. A set bit
+ * in the processor set means that the corresponding processor shall be in
+ * the processor affinity set of the interrupt vector, otherwise the bit
+ * shall be cleared.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``affinity`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_INVALID_NUMBER The referenced processor set was not a valid
+ * new processor affinity set for the interrupt vector.
+ *
+ * @retval ::RTEMS_UNSATISFIED The request to set the processor affinity of the
+ * interrupt vector has not been satisfied.
+ *
+ * @par Notes
+ * The rtems_interrupt_get_attributes() directive may be used to check if the
+ * processor affinity of an interrupt vector can be set.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_set_affinity(
+ rtems_vector_number vector,
+ size_t affinity_size,
+ const cpu_set_t *affinity
+);
+
+/* Generated from spec:/rtems/intr/if/signal-variant */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This enumeration provides interrupt trigger signal variants.
+ */
+typedef enum {
+ /**
+ * @brief This interrupt signal variant indicates that the interrupt trigger
+ * signal is unspecified.
+ */
+ RTEMS_INTERRUPT_UNSPECIFIED_SIGNAL,
+
+ /**
+ * @brief This interrupt signal variant indicates that the interrupt cannot be
+ * triggered by a signal.
+ */
+ RTEMS_INTERRUPT_NO_SIGNAL,
+
+ /**
+ * @brief This interrupt signal variant indicates that the interrupt is
+ * triggered by a low level signal.
+ */
+ RTEMS_INTERRUPT_SIGNAL_LEVEL_LOW,
+
+ /**
+ * @brief This interrupt signal variant indicates that the interrupt is
+ * triggered by a high level signal.
+ */
+ RTEMS_INTERRUPT_SIGNAL_LEVEL_HIGH,
+
+ /**
+ * @brief This interrupt signal variant indicates that the interrupt is
+ * triggered by a falling edge signal.
+ */
+ RTEMS_INTERRUPT_SIGNAL_EDGE_FALLING,
+
+ /**
+ * @brief This interrupt signal variant indicates that the interrupt is
+ * triggered by a raising edge signal.
+ */
+ RTEMS_INTERRUPT_SIGNAL_EDGE_RAISING
+} rtems_interrupt_signal_variant;
+
+/* Generated from spec:/rtems/intr/if/attributes */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure provides the attributes of an interrupt vector.
+ *
+ * The rtems_interrupt_get_attributes() directive may be used to obtain the
+ * attributes of an interrupt vector.
+ */
+typedef struct {
+ /**
+ * @brief This member is true, if the interrupt vector is maskable by
+ * rtems_interrupt_local_disable(), otherwise it is false.
+ *
+ * Interrupt vectors which are not maskable by rtems_interrupt_local_disable()
+ * should be used with care since they cannot use most operating system
+ * services.
+ */
+ bool is_maskable;
+
+ /**
+ * @brief This member is true, if the interrupt vector can be enabled by
+ * rtems_interrupt_vector_enable(), otherwise it is false.
+ *
+ * When an interrupt vector can be enabled, this means that the enabled state
+ * can always be changed from disabled to enabled. For an interrupt vector
+ * which can be enabled it follows that it may be enabled.
+ */
+ bool can_enable;
+
+ /**
+ * @brief This member is true, if the interrupt vector may be enabled by
+ * rtems_interrupt_vector_enable(), otherwise it is false.
+ *
+ * When an interrupt vector may be enabled, this means that the enabled state
+ * may be changed from disabled to enabled. The requested enabled state change
+ * should be checked by rtems_interrupt_vector_is_enabled(). Some interrupt
+ * vectors may be optionally available and cannot be enabled on a particular
+ * target.
+ */
+ bool maybe_enable;
+
+ /**
+ * @brief This member is true, if the interrupt vector can be disabled by
+ * rtems_interrupt_vector_disable(), otherwise it is false.
+ *
+ * When an interrupt vector can be disabled, this means that the enabled state
+ * can be changed from enabled to disabled. For an interrupt vector which can
+ * be disabled it follows that it may be disabled.
+ */
+ bool can_disable;
+
+ /**
+ * @brief This member is true, if the interrupt vector may be disabled by
+ * rtems_interrupt_vector_disable(), otherwise it is false.
+ *
+ * When an interrupt vector may be disabled, this means that the enabled state
+ * may be changed from enabled to disabled. The requested enabled state change
+ * should be checked by rtems_interrupt_vector_is_enabled(). Some interrupt
+ * vectors may be always enabled and cannot be disabled on a particular target.
+ */
+ bool maybe_disable;
+
+ /**
+ * @brief This member is true, if the interrupt vector can be raised by
+ * rtems_interrupt_raise(), otherwise it is false.
+ */
+ bool can_raise;
+
+ /**
+ * @brief This member is true, if the interrupt vector can be raised on a
+ * processor by rtems_interrupt_raise_on(), otherwise it is false.
+ */
+ bool can_raise_on;
+
+ /**
+ * @brief This member is true, if the interrupt vector can be cleared by
+ * rtems_interrupt_clear(), otherwise it is false.
+ */
+ bool can_clear;
+
+ /**
+ * @brief This member is true, if the pending status of the interrupt
+ * associated with the interrupt vector is cleared by an interrupt
+ * acknowledge from the processor, otherwise it is false.
+ */
+ bool cleared_by_acknowledge;
+
+ /**
+ * @brief This member is true, if the affinity set of the interrupt vector can
+ * be obtained by rtems_interrupt_get_affinity(), otherwise it is false.
+ */
+ bool can_get_affinity;
+
+ /**
+ * @brief This member is true, if the affinity set of the interrupt vector can
+ * be set by rtems_interrupt_set_affinity(), otherwise it is false.
+ */
+ bool can_set_affinity;
+
+ /**
+ * @brief This member is true, if the interrupt associated with the interrupt
+ * vector can be triggered by a message.
+ *
+ * Interrupts may be also triggered by signals, rtems_interrupt_raise(), or
+ * rtems_interrupt_raise_on(). Examples for message triggered interrupts are
+ * the PCIe MSI/MSI-X and the ARM GICv3 Locality-specific Peripheral Interrupts
+ * (LPI).
+ */
+ bool can_be_triggered_by_message;
+
+ /**
+ * @brief This member describes the trigger signal of the interrupt associated
+ * with the interrupt vector.
+ *
+ * Interrupts are normally triggered by signals which indicate an interrupt
+ * request from a peripheral. Interrupts may be also triggered by messages,
+ * rtems_interrupt_raise(), or rtems_interrupt_raise_on().
+ */
+ rtems_interrupt_signal_variant trigger_signal;
+} rtems_interrupt_attributes;
+
+/* Generated from spec:/rtems/intr/if/get-attributes */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Gets the attributes of the interrupt vector.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param[out] attributes is the pointer to an rtems_interrupt_attributes
+ * object. When the directive call is successful, the attributes of the
+ * interrupt vector will be stored in this object.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``attributes`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_get_attributes(
+ rtems_vector_number vector,
+ rtems_interrupt_attributes *attributes
+);
+
+/* Generated from spec:/rtems/intr/if/handler-iterate */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Iterates over all interrupt handler installed at the interrupt
+ * vector.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param routine is the visitor routine.
+ *
+ * @param arg is the visitor argument.
+ *
+ * For each installed handler at the interrupt vector the visitor function
+ * specified by ``routine`` will be called with the argument specified by
+ * ``arg`` and the handler information, options, routine and argument.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INCORRECT_STATE The service was not initialized.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``routine`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
+ * interrupt context.
+ *
+ * @par Notes
+ * @parblock
+ * The directive is intended for system information and diagnostics.
+ *
+ * Never install or remove an interrupt handler within the visitor function.
+ * This may result in a deadlock.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_handler_iterate(
+ rtems_vector_number vector,
+ rtems_interrupt_per_handler_routine routine,
+ void *arg
+);
+
+/* Generated from spec:/rtems/intr/if/server-default */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief The constant represents the index of the default interrupt server.
+ */
+#define RTEMS_INTERRUPT_SERVER_DEFAULT 0
+
+/* Generated from spec:/rtems/intr/if/server-control */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure represents an interrupt server.
+ *
+ * @par Notes
+ * This structure shall be treated as an opaque data type from the API point of
+ * view. Members shall not be accessed directly. The structure is initialized
+ * by rtems_interrupt_server_create() and maintained by the interrupt server
+ * support.
+ */
+typedef struct rtems_interrupt_server_control {
+ #if defined(RTEMS_SMP)
+ /**
+ * @brief This member is the ISR lock protecting the server control state.
+ */
+ rtems_interrupt_lock lock;
+ #endif
+
+ /**
+ * @brief This member is the chain of pending interrupt entries.
+ */
+ Chain_Control entries;
+
+ /**
+ * @brief This member is the identifier of the server task.
+ */
+ rtems_id server;
+
+ /**
+ * @brief This member is the error count.
+ */
+ unsigned long errors;
+
+ /**
+ * @brief This member is the server index.
+ */
+ uint32_t index;
+
+ /**
+ * @brief This member is the node for the interrupt server registry.
+ */
+ Chain_Node node;
+
+ /**
+ * @brief This member is the optional handler to destroy the interrupt server
+ * control.
+ */
+ void ( *destroy )( struct rtems_interrupt_server_control * );
+} rtems_interrupt_server_control;
+
+/* Generated from spec:/rtems/intr/if/server-config */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure defines an interrupt server configuration.
+ *
+ * @par Notes
+ * See also rtems_interrupt_server_create().
+ */
+typedef struct {
+ /**
+ * @brief This member is the task name of the interrupt server.
+ */
+ rtems_name name;
+
+ /**
+ * @brief This member is the initial task priority of the interrupt server.
+ */
+ rtems_task_priority priority;
+
+ /**
+ * @brief This member is the task storage area of the interrupt server.
+ *
+ * It shall be NULL for interrupt servers created by
+ * rtems_interrupt_server_create().
+ */
+ void *storage_area;
+
+ /**
+ * @brief This member is the task storage size of the interrupt server.
+ *
+ * For interrupt servers created by rtems_interrupt_server_create() this is the
+ * task stack size.
+ */
+ size_t storage_size;
+
+ /**
+ * @brief This member is the initial mode set of the interrupt server.
+ */
+ rtems_mode modes;
+
+ /**
+ * @brief This member is the attribute set of the interrupt server.
+ */
+ rtems_attribute attributes;
+
+ /**
+ * @brief This member is an optional handler to destroy the interrupt server
+ * control handed over to rtems_interrupt_server_create().
+ *
+ * The destroy handler is optional and may be NULL. If the destroy handler is
+ * present, it is called from within the context of the interrupt server to be
+ * deleted, see also rtems_interrupt_server_delete().
+ */
+ void ( *destroy )( rtems_interrupt_server_control * );
+} rtems_interrupt_server_config;
+
+/* Generated from spec:/rtems/intr/if/server-initialize */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Initializes the interrupt server tasks.
+ *
+ * @param priority is the initial task priority of the created interrupt
+ * servers.
+ *
+ * @param stack_size is the task stack size of the created interrupt servers.
+ *
+ * @param modes is the initial mode set of the created interrupt servers.
+ *
+ * @param attributes is the attribute set of the created interrupt servers.
+ *
+ * @param[out] server_count is the pointer to an uint32_t object or NULL. When
+ * the pointer is not equal to NULL, the count of successfully created
+ * interrupt servers is stored in this object regardless of the return
+ * status.
+ *
+ * The directive tries to create an interrupt server task for each online
+ * processor in the system. The tasks will have the initial priority specified
+ * by ``priority``, the stack size specified by ``stack_size``, the initial
+ * mode set specified by ``modes``, and the attribute set specified by
+ * ``attributes``. The count of successfully created server tasks will be
+ * returned in ``server_count`` if the pointer is not equal to NULL.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INCORRECT_STATE The interrupt servers were already
+ * initialized.
+ *
+ * @return The directive uses rtems_task_create(). If this directive fails,
+ * then its error status will be returned.
+ *
+ * @par Notes
+ * @parblock
+ * Interrupt handlers may be installed on an interrupt server with
+ * rtems_interrupt_server_handler_install() and removed with
+ * rtems_interrupt_server_handler_remove() using a server index. In case of an
+ * interrupt, the request will be forwarded to the interrupt server. The
+ * handlers are executed within the interrupt server context. If one handler
+ * blocks on something this may delay the processing of other handlers.
+ *
+ * Interrupt servers may be deleted by rtems_interrupt_server_delete().
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_server_initialize(
+ rtems_task_priority priority,
+ size_t stack_size,
+ rtems_mode modes,
+ rtems_attribute attributes,
+ uint32_t *server_count
+);
+
+/* Generated from spec:/rtems/intr/if/server-create */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Creates an interrupt server.
+ *
+ * @param[out] control is the pointer to an rtems_interrupt_server_control
+ * object. When the directive call was successful, the ownership of the
+ * object was transferred from the caller of the directive to the interrupt
+ * server management.
+ *
+ * @param config is the interrupt server configuration.
+ *
+ * @param[out] server_index is the pointer to an uint32_t object. When the
+ * directive call was successful, the index of the created interrupt server
+ * will be stored in this object.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @return The directive uses rtems_task_create(). If this directive fails,
+ * then its error status will be returned.
+ *
+ * @par Notes
+ * See also rtems_interrupt_server_initialize() and
+ * rtems_interrupt_server_delete().
+ *
+ * @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
+ */
+rtems_status_code rtems_interrupt_server_create(
+ rtems_interrupt_server_control *control,
+ const rtems_interrupt_server_config *config,
+ uint32_t *server_index
+);
+
+/* Generated from spec:/rtems/intr/if/server-handler-install */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Installs the interrupt handler routine and argument at the interrupt
+ * vector on the interrupt server.
+ *
+ * @param server_index is the interrupt server index. The constant
+ * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
+ * interrupt server.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param info is the descriptive information of the interrupt handler to
+ * install.
+ *
+ * @param options is the interrupt handler install option set.
+ *
+ * @param routine is the interrupt handler routine to install.
+ *
+ * @param arg is the interrupt handler argument to install.
+ *
+ * The handler routine specified by ``routine`` will be executed within the
+ * context of the interrupt server task specified by ``server_index``.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``server_index``.
+ *
+ * @retval ::RTEMS_CALLED_FROM_ISR The directive was called from within
+ * interrupt context.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``routine`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_INVALID_NUMBER An option specified by ``info`` was not
+ * applicable.
+ *
+ * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_UNIQUE option was set
+ * in ``info`` and the interrupt vector was already occupied by a handler.
+ *
+ * @retval ::RTEMS_RESOURCE_IN_USE The #RTEMS_INTERRUPT_SHARED option was set
+ * in ``info`` and the interrupt vector was already occupied by a unique
+ * handler.
+ *
+ * @retval ::RTEMS_TOO_MANY The handler specified by ``routine`` was already
+ * installed for the interrupt vector specified by ``vector`` with an
+ * argument equal to the argument specified by ``arg``.
+ *
+ * @retval ::RTEMS_UNSATISFIED The #RTEMS_INTERRUPT_REPLACE option was set in
+ * ``info`` and no handler to replace was installed.
+ *
+ * @par Notes
+ * See also rtems_interrupt_handler_install().
+ *
+ * @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
+ */
+rtems_status_code rtems_interrupt_server_handler_install(
+ uint32_t server_index,
+ rtems_vector_number vector,
+ const char *info,
+ rtems_option options,
+ rtems_interrupt_handler routine,
+ void *arg
+);
+
+/* Generated from spec:/rtems/intr/if/server-handler-remove */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Removes the interrupt handler routine and argument from the interrupt
+ * vector and the interrupt server.
+ *
+ * @param server_index is the interrupt server index. The constant
+ * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
+ * interrupt server.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param routine is the interrupt handler routine to remove.
+ *
+ * @param arg is the interrupt handler argument to remove.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``server_index``.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @retval ::RTEMS_UNSATISFIED There was no handler routine and argument pair
+ * installed specified by ``routine`` and ``arg``.
+ *
+ * @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.
+ *
+ * * The directive shall not be called from within the context of an interrupt
+ * server. Calling the directive from within the context of an interrupt
+ * server is undefined behaviour.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_server_handler_remove(
+ uint32_t server_index,
+ rtems_vector_number vector,
+ rtems_interrupt_handler routine,
+ void *arg
+);
+
+/* Generated from spec:/rtems/intr/if/server-set-affinity */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Sets the processor affinity of the interrupt server.
+ *
+ * @param server_index is the interrupt server index. The constant
+ * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
+ * interrupt server.
+ *
+ * @param affinity_size is the size of the processor set referenced by
+ * ``affinity`` in bytes.
+ *
+ * @param affinity is the pointer to a cpu_set_t object. The processor set
+ * defines the new processor affinity set of the interrupt server. A set bit
+ * in the processor set means that the corresponding processor shall be in
+ * the processor affinity set of the task, otherwise the bit shall be
+ * cleared.
+ *
+ * @param priority is the new real priority for the interrupt server.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``server_index``.
+ *
+ * @return The directive uses rtems_scheduler_ident_by_processor_set(),
+ * rtems_task_set_scheduler(), and rtems_task_set_affinity(). If one of
+ * these directive fails, then its error status will be returned.
+ *
+ * @par Notes
+ * @parblock
+ * The scheduler is set determined by the highest numbered processor in the
+ * affinity set specified by ``affinity``.
+ *
+ * This operation is only reliable in case the interrupt server was suspended
+ * via rtems_interrupt_server_suspend().
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may change the processor affinity of a task. This may cause
+ * the calling task to be preempted.
+ *
+ * * The directive may change the priority of a task. This may cause the
+ * calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_server_set_affinity(
+ uint32_t server_index,
+ size_t affinity_size,
+ const cpu_set_t *affinity,
+ rtems_task_priority priority
+);
+
+/* Generated from spec:/rtems/intr/if/server-delete */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Deletes the interrupt server.
+ *
+ * @param server_index is the index of the interrupt server to delete.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * server index specified by ``server_index``.
+ *
+ * @par Notes
+ * @parblock
+ * The interrupt server deletes itself, so after the return of the directive
+ * the interrupt server may be still in the termination process depending on
+ * the task priorities of the system.
+ *
+ * See also rtems_interrupt_server_create().
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive shall not be called from within the context of an interrupt
+ * server. Calling the directive from within the context of an interrupt
+ * server is undefined behaviour.
+ *
+ * * 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
+ */
+rtems_status_code rtems_interrupt_server_delete( uint32_t server_index );
+
+/* Generated from spec:/rtems/intr/if/server-suspend */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Suspends the interrupt server.
+ *
+ * @param server_index is the index of the interrupt server to suspend. The
+ * constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the
+ * default interrupt server.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``server_index``.
+ *
+ * @par Notes
+ * Interrupt server may be resumed by rtems_interrupt_server_resume().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive shall not be called from within the context of an interrupt
+ * server. Calling the directive from within the context of an interrupt
+ * server is undefined behaviour.
+ *
+ * * 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
+ */
+rtems_status_code rtems_interrupt_server_suspend( uint32_t server_index );
+
+/* Generated from spec:/rtems/intr/if/server-resume */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Resumes the interrupt server.
+ *
+ * @param server_index is the index of the interrupt server to resume. The
+ * constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the
+ * default interrupt server.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``server_index``.
+ *
+ * @par Notes
+ * Interrupt server may be suspended by rtems_interrupt_server_suspend().
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive shall not be called from within the context of an interrupt
+ * server. Calling the directive from within the context of an interrupt
+ * server is undefined behaviour.
+ *
+ * * 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
+ */
+rtems_status_code rtems_interrupt_server_resume( uint32_t server_index );
+
+/* Generated from spec:/rtems/intr/if/server-move */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Moves the interrupt handlers installed at the interrupt vector and
+ * the source interrupt server to the destination interrupt server.
+ *
+ * @param source_server_index is the index of the source interrupt server. The
+ * constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the
+ * default interrupt server.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param destination_server_index is the index of the destination interrupt
+ * server. The constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to
+ * specify the default interrupt server.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``source_server_index``.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``destination_server_index``.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive shall not be called from within the context of an interrupt
+ * server. Calling the directive from within the context of an interrupt
+ * server is undefined behaviour.
+ *
+ * * 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
+ */
+rtems_status_code rtems_interrupt_server_move(
+ uint32_t source_server_index,
+ rtems_vector_number vector,
+ uint32_t destination_server_index
+);
+
+/* Generated from spec:/rtems/intr/if/server-handler-iterate */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Iterates over all interrupt handler installed at the interrupt vector
+ * and interrupt server.
+ *
+ * @param server_index is the index of the interrupt server.
+ *
+ * @param vector is the interrupt vector number.
+ *
+ * @param routine is the visitor routine.
+ *
+ * @param arg is the visitor argument.
+ *
+ * For each installed handler at the interrupt vector and interrupt server the
+ * visitor function specified by ``vector`` will be called with the argument
+ * specified by ``routine`` and the handler information, options, routine and
+ * argument.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``server_index``.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
+ * number specified by ``vector``.
+ *
+ * @par Notes
+ * @parblock
+ * The directive is intended for system information and diagnostics.
+ *
+ * Never install or remove an interrupt handler within the visitor function.
+ * This may result in a deadlock.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_server_handler_iterate(
+ uint32_t server_index,
+ rtems_vector_number vector,
+ rtems_interrupt_per_handler_routine routine,
+ void *arg
+);
+
+/* Generated from spec:/rtems/intr/if/server-action */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure represents an interrupt server action.
+ *
+ * @par Notes
+ * This structure shall be treated as an opaque data type from the API point of
+ * view. Members shall not be accessed directly.
+ */
+typedef struct rtems_interrupt_server_action {
+ /**
+ * @brief This member is the reference to the next action or NULL.
+ */
+ struct rtems_interrupt_server_action *next;
+
+ /**
+ * @brief This member is the interrupt handler.
+ */
+ rtems_interrupt_handler handler;
+
+ /**
+ * @brief This member is the interrupt handler argument.
+ */
+ void *arg;
+} rtems_interrupt_server_action;
+
+/* Generated from spec:/rtems/intr/if/server-entry */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure represents an interrupt server entry.
+ *
+ * @par Notes
+ * This structure shall be treated as an opaque data type from the API point of
+ * view. Members shall not be accessed directly. An entry is initialized by
+ * rtems_interrupt_server_entry_initialize() and destroyed by
+ * rtems_interrupt_server_entry_destroy(). Interrupt server actions can be
+ * prepended to the entry by rtems_interrupt_server_action_prepend(). The
+ * entry is submitted to be serviced by rtems_interrupt_server_entry_submit().
+ */
+typedef struct {
+ /**
+ * @brief This member is the node for the interrupt entry processing.
+ */
+ Chain_Node node;
+
+ /**
+ * @brief This member references the interrupt server used to process the
+ * entry.
+ */
+ rtems_interrupt_server_control *server;
+
+ /**
+ * @brief This member is the interrupt vector number.
+ */
+ rtems_vector_number vector;
+
+ /**
+ * @brief This member is the interrupt server actions list head.
+ */
+ rtems_interrupt_server_action *actions;
+} rtems_interrupt_server_entry;
+
+/* Generated from spec:/rtems/intr/if/server-entry-initialize */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Initializes the interrupt server entry.
+ *
+ * @param server_index is the interrupt server index. The constant
+ * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
+ * interrupt server.
+ *
+ * @param entry is the interrupt server entry to initialize.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``server_index``.
+ *
+ * @par Notes
+ * After initialization, the list of actions of the interrupt server entry is
+ * empty. Actions may be prepended by rtems_interrupt_server_action_prepend().
+ * Interrupt server entries may be moved to another interrupt vector with
+ * rtems_interrupt_server_entry_move(). Server entries may be submitted to get
+ * serviced by the interrupt server with rtems_interrupt_server_entry_submit().
+ * Server entries may be destroyed by rtems_interrupt_server_entry_destroy().
+ *
+ * @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
+ */
+rtems_status_code rtems_interrupt_server_entry_initialize(
+ uint32_t server_index,
+ rtems_interrupt_server_entry *entry
+);
+
+/* Generated from spec:/rtems/intr/if/server-action-prepend */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Prepends the interrupt server action to the list of actions of the
+ * interrupt server entry.
+ *
+ * @param[in,out] entry is the interrupt server entry to prepend the interrupt
+ * server action. It shall have been initialized via
+ * rtems_interrupt_server_entry_initialize().
+ *
+ * @param[out] action is the interrupt server action to initialize and prepend
+ * to the list of actions of the entry.
+ *
+ * @param routine is the interrupt handler routine to set in the action.
+ *
+ * @param arg is the interrupt handler argument to set in the action.
+ *
+ * @par Notes
+ * No error checking is performed by the directive.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ *
+ * * The interrupt server entry shall have been initialized by
+ * rtems_interrupt_server_entry_initialize() and further optional calls to
+ * rtems_interrupt_server_action_prepend().
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_action_prepend() with the same interrupt server
+ * entry. Calling the directive under this condition is undefined behaviour.
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_entry_move() with the same interrupt server entry.
+ * Calling the directive under this condition is undefined behaviour.
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_entry_submit() with the same interrupt server
+ * entry. Calling the directive under this condition is undefined behaviour.
+ *
+ * * The directive shall not be called while the interrupt server entry is
+ * pending on or serviced by its current interrupt server. Calling the
+ * directive under these conditions is undefined behaviour.
+ * @endparblock
+ */
+void rtems_interrupt_server_action_prepend(
+ rtems_interrupt_server_entry *entry,
+ rtems_interrupt_server_action *action,
+ rtems_interrupt_handler routine,
+ void *arg
+);
+
+/* Generated from spec:/rtems/intr/if/server-entry-destroy */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Destroys the interrupt server entry.
+ *
+ * @param[in,out] entry is the interrupt server entry to destroy.
+ *
+ * @par Notes
+ * No error checking is performed by the directive.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive shall not be called from within the context of an interrupt
+ * server. Calling the directive from within the context of an interrupt
+ * server is undefined behaviour.
+ *
+ * * The directive sends a request to another task and waits for a response.
+ * This may cause the calling task to be blocked and unblocked.
+ *
+ * * The interrupt server entry shall have been initialized by
+ * rtems_interrupt_server_entry_initialize() and further optional calls to
+ * rtems_interrupt_server_action_prepend().
+ * @endparblock
+ */
+void rtems_interrupt_server_entry_destroy(
+ rtems_interrupt_server_entry *entry
+);
+
+/* Generated from spec:/rtems/intr/if/server-entry-submit */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Submits the interrupt server entry to be serviced by the interrupt
+ * server.
+ *
+ * @param entry is the interrupt server entry to submit.
+ *
+ * The directive appends the entry to the pending entries of the interrupt
+ * server. The interrupt server is notified that a new entry is pending. Once
+ * the interrupt server is scheduled it services the actions of all pending
+ * entries.
+ *
+ * @par Notes
+ * @parblock
+ * This directive may be used to do a two-step interrupt processing. The first
+ * step is done from within interrupt context by a call to this directive. The
+ * second step is then done from within the context of the interrupt server.
+ *
+ * No error checking is performed by the directive.
+ *
+ * A submitted entry may be destroyed by
+ * rtems_interrupt_server_entry_destroy().
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may unblock a task. This may cause the calling task to be
+ * preempted.
+ *
+ * * The interrupt server entry shall have been initialized by
+ * rtems_interrupt_server_entry_initialize() and further optional calls to
+ * rtems_interrupt_server_action_prepend().
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_action_prepend() with the same interrupt server
+ * entry. Calling the directive under this condition is undefined behaviour.
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_entry_move() with the same interrupt server entry.
+ * Calling the directive under this condition is undefined behaviour.
+ * @endparblock
+ */
+void rtems_interrupt_server_entry_submit(
+ rtems_interrupt_server_entry *entry
+);
+
+/* Generated from spec:/rtems/intr/if/server-entry-move */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Moves the interrupt server entry to the interrupt server.
+ *
+ * @param entry is the interrupt server entry to move.
+ *
+ * @param server_index is the index of the destination interrupt server. The
+ * constant #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the
+ * default interrupt server.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``server_index``.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may obtain and release the object allocator mutex. This may
+ * cause the calling task to be preempted.
+ *
+ * * The interrupt server entry shall have been initialized by
+ * rtems_interrupt_server_entry_initialize() and further optional calls to
+ * rtems_interrupt_server_action_prepend().
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_action_prepend() with the same interrupt server
+ * entry. Calling the directive under this condition is undefined behaviour.
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_entry_move() with the same interrupt server entry.
+ * Calling the directive under this condition is undefined behaviour.
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_entry_submit() with the same interrupt server
+ * entry. Calling the directive under this condition is undefined behaviour.
+ *
+ * * The directive shall not be called while the interrupt server entry is
+ * pending on or serviced by its current interrupt server. Calling the
+ * directive under these conditions is undefined behaviour.
+ * @endparblock
+ */
+rtems_status_code rtems_interrupt_server_entry_move(
+ rtems_interrupt_server_entry *entry,
+ uint32_t server_index
+);
+
+/* Generated from spec:/rtems/intr/if/server-request */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure represents an interrupt server request.
+ *
+ * @par Notes
+ * This structure shall be treated as an opaque data type from the API point of
+ * view. Members shall not be accessed directly. A request is initialized by
+ * rtems_interrupt_server_request_initialize() and destroyed by
+ * rtems_interrupt_server_request_destroy(). The interrupt vector of the
+ * request can be set by rtems_interrupt_server_request_set_vector(). The
+ * request is submitted to be serviced by
+ * rtems_interrupt_server_request_submit().
+ */
+typedef struct {
+ /**
+ * @brief This member is the interrupt server entry.
+ */
+ rtems_interrupt_server_entry entry;
+
+ /**
+ * @brief This member is the interrupt server action.
+ */
+ rtems_interrupt_server_action action;
+} rtems_interrupt_server_request;
+
+/* Generated from spec:/rtems/intr/if/server-request-initialize */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Initializes the interrupt server request.
+ *
+ * @param server_index is the interrupt server index. The constant
+ * #RTEMS_INTERRUPT_SERVER_DEFAULT may be used to specify the default
+ * interrupt server.
+ *
+ * @param[out] request is the interrupt server request to initialize.
+ *
+ * @param routine is the interrupt handler routine for the request action.
+ *
+ * @param arg is the interrupt handler argument for the request action.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no interrupt server associated with the
+ * index specified by ``server_index``.
+ *
+ * @par Notes
+ * An interrupt server requests consists of an interrupt server entry and
+ * exactly one interrupt server action. The interrupt vector of the request
+ * may be changed with rtems_interrupt_server_request_set_vector(). Interrupt
+ * server requests may be submitted to get serviced by the interrupt server
+ * with rtems_interrupt_server_request_submit(). Requests may be destroyed by
+ * rtems_interrupt_server_request_destroy().
+ *
+ * @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
+ */
+rtems_status_code rtems_interrupt_server_request_initialize(
+ uint32_t server_index,
+ rtems_interrupt_server_request *request,
+ rtems_interrupt_handler routine,
+ void *arg
+);
+
+/* Generated from spec:/rtems/intr/if/server-request-set-vector */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Sets the interrupt vector in the interrupt server request.
+ *
+ * @param[in,out] request is the interrupt server request to change.
+ *
+ * @param vector is the interrupt vector number to be used by the request.
+ *
+ * @par Notes
+ * @parblock
+ * By default, the interrupt vector of an interrupt server request is set to a
+ * special value which is outside the range of vectors supported by the
+ * interrupt controller hardware.
+ *
+ * Calls to rtems_interrupt_server_request_submit() will disable the interrupt
+ * vector of the request. After processing of the request by the interrupt
+ * server the interrupt vector will be enabled again.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ *
+ * * The interrupt server request shall have been initialized by
+ * rtems_interrupt_server_request_initialize().
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_request_set_vector() with the same interrupt server
+ * request. Calling the directive under this condition is undefined
+ * behaviour.
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_request_submit() with the same interrupt server
+ * request. Calling the directive under this condition is undefined
+ * behaviour.
+ *
+ * * The directive shall not be called while the interrupt server entry is
+ * pending on or serviced by its current interrupt server. Calling the
+ * directive under these conditions is undefined behaviour.
+ * @endparblock
+ */
+static inline void rtems_interrupt_server_request_set_vector(
+ rtems_interrupt_server_request *request,
+ rtems_vector_number vector
+)
+{
+ request->entry.vector = vector;
+}
+
+/* Generated from spec:/rtems/intr/if/server-request-destroy */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Destroys the interrupt server request.
+ *
+ * @param[in,out] request is the interrupt server request to destroy.
+ *
+ * @par Notes
+ * No error checking is performed by the directive.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive shall not be called from within the context of an interrupt
+ * server. Calling the directive from within the context of an interrupt
+ * server is undefined behaviour.
+ *
+ * * The directive sends a request to another task and waits for a response.
+ * This may cause the calling task to be blocked and unblocked.
+ *
+ * * The interrupt server request shall have been initialized by
+ * rtems_interrupt_server_request_initialize().
+ * @endparblock
+ */
+static inline void rtems_interrupt_server_request_destroy(
+ rtems_interrupt_server_request *request
+)
+{
+ rtems_interrupt_server_entry_destroy( &request->entry );
+}
+
+/* Generated from spec:/rtems/intr/if/server-request-submit */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief Submits the interrupt server request to be serviced by the interrupt
+ * server.
+ *
+ * @param[in,out] request is the interrupt server request to submit.
+ *
+ * The directive appends the interrupt server entry of the request to the
+ * pending entries of the interrupt server. The interrupt server is notified
+ * that a new entry is pending. Once the interrupt server is scheduled it
+ * services the actions of all pending entries.
+ *
+ * @par Notes
+ * @parblock
+ * This directive may be used to do a two-step interrupt processing. The first
+ * step is done from within interrupt context by a call to this directive. The
+ * second step is then done from within the context of the interrupt server.
+ *
+ * No error checking is performed by the directive.
+ *
+ * A submitted request may be destroyed by
+ * rtems_interrupt_server_request_destroy().
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within interrupt context.
+ *
+ * * The directive may be called from within device driver initialization
+ * context.
+ *
+ * * The directive may be called from within task context.
+ *
+ * * The directive may unblock a task. This may cause the calling task to be
+ * preempted.
+ *
+ * * The interrupt server request shall have been initialized by
+ * rtems_interrupt_server_request_initialize().
+ *
+ * * The directive shall not be called concurrently with
+ * rtems_interrupt_server_request_set_vector() with the same interrupt server
+ * request. Calling the directive under this condition is undefined
+ * behaviour.
+ * @endparblock
+ */
+static inline void rtems_interrupt_server_request_submit(
+ rtems_interrupt_server_request *request
+)
+{
+ rtems_interrupt_server_entry_submit( &request->entry );
+}
+
#ifdef __cplusplus
}
#endif
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/partdata.h b/cpukit/include/rtems/rtems/partdata.h
index 196c2142ae..a6bcee229a 100644
--- a/cpukit/include/rtems/rtems/partdata.h
+++ b/cpukit/include/rtems/rtems/partdata.h
@@ -41,11 +41,13 @@ typedef struct {
*/
Objects_Control Object;
+#if defined(RTEMS_SMP)
/**
* @brief This lock protects the chain of unallocated buffers and the number
* of allocated buffers.
*/
- ISR_LOCK_MEMBER( Lock )
+ ISR_lock_Control Lock;
+#endif
/**
* @brief This member contains the base address of the buffer area.
diff --git a/cpukit/include/rtems/rtems/ratemondata.h b/cpukit/include/rtems/rtems/ratemondata.h
index f35fa7eb61..700285c7b4 100644
--- a/cpukit/include/rtems/rtems/ratemondata.h
+++ b/cpukit/include/rtems/rtems/ratemondata.h
@@ -71,10 +71,12 @@ typedef struct {
/** This field is the object management portion of a Period instance. */
Objects_Control Object;
+#if defined(RTEMS_SMP)
/**
* @brief Protects the rate monotonic period state.
*/
- ISR_LOCK_MEMBER( Lock )
+ ISR_lock_Control Lock;
+#endif
/** This is the timer used to provide the unblocking mechanism. */
Watchdog_Control Timer;
diff --git a/cpukit/include/rtems/rtems/ratemonimpl.h b/cpukit/include/rtems/rtems/ratemonimpl.h
index 62327c5b09..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.
diff --git a/cpukit/include/rtems/rtems/scheduler.h b/cpukit/include/rtems/rtems/scheduler.h
new file mode 100644
index 0000000000..8bd041558f
--- /dev/null
+++ b/cpukit/include/rtems/rtems/scheduler.h
@@ -0,0 +1,551 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSImplClassicScheduler
+ *
+ * @brief This header file defines the main parts of the Scheduler Manager API.
+ */
+
+/*
+ * Copyright (C) 2013, 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 1988, 2017 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.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+/* Generated from spec:/rtems/scheduler/if/header */
+
+#ifndef _RTEMS_RTEMS_SCHEDULER_H
+#define _RTEMS_RTEMS_SCHEDULER_H
+
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/cpuset.h>
+#include <rtems/rtems/status.h>
+#include <rtems/rtems/types.h>
+#include <rtems/score/smp.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Generated from spec:/rtems/scheduler/if/group */
+
+/**
+ * @defgroup RTEMSAPIClassicScheduler Scheduler Manager
+ *
+ * @ingroup RTEMSAPIClassic
+ *
+ * @brief The scheduling concepts relate to the allocation of processing time
+ * for tasks.
+ *
+ * The concept of scheduling in real-time systems dictates the ability to
+ * provide an immediate response to specific external events, particularly the
+ * necessity of scheduling tasks to run within a specified time limit after the
+ * occurrence of an event. For example, software embedded in life-support
+ * systems used to monitor hospital patients must take instant action if a
+ * change in the patient’s status is detected.
+ *
+ * The component of RTEMS responsible for providing this capability is
+ * appropriately called the scheduler. The scheduler’s sole purpose is to
+ * allocate the all important resource of processor time to the various tasks
+ * competing for attention.
+ */
+
+/* Generated from spec:/rtems/scheduler/if/ident */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Identifies a scheduler by the object name.
+ *
+ * @param name is the scheduler name to look up.
+ *
+ * @param[out] id is the pointer to an ::rtems_id object. When the directive
+ * call is successful, the identifier of the scheduler will be stored in this
+ * object.
+ *
+ * This directive obtains a scheduler identifier associated with the scheduler
+ * name specified in ``name``.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_NAME There was no scheduler associated with the
+ * name.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL.
+ *
+ * @par Notes
+ * @parblock
+ * The scheduler name is determined by the scheduler configuration.
+ *
+ * The scheduler identifier is used with other scheduler related directives to
+ * access the scheduler.
+ * @endparblock
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+rtems_status_code rtems_scheduler_ident( rtems_name name, rtems_id *id );
+
+/* Generated from spec:/rtems/scheduler/if/ident-by-processor */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Identifies a scheduler by the processor index.
+ *
+ * @param cpu_index is the processor index to identify the scheduler.
+ *
+ * @param[out] id is the pointer to an ::rtems_id object. When the directive
+ * call is successful, the identifier of the scheduler will be stored in this
+ * object.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_NAME The processor index was invalid.
+ *
+ * @retval ::RTEMS_INCORRECT_STATE The processor index was valid, however, the
+ * corresponding processor was not owned by a scheduler.
+ *
+ * @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
+ */
+rtems_status_code rtems_scheduler_ident_by_processor(
+ uint32_t cpu_index,
+ rtems_id *id
+);
+
+/* Generated from spec:/rtems/scheduler/if/ident-by-processor-set */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Identifies a scheduler by the processor set.
+ *
+ * @param cpusetsize is the size of the processor set referenced by ``cpuset``
+ * in bytes. The size shall be positive.
+ *
+ * @param cpuset is the pointer to a cpu_set_t. The referenced processor set
+ * will be used to identify the scheduler.
+ *
+ * @param[out] id is the pointer to an ::rtems_id object. When the directive
+ * call is successful, the identifier of the scheduler will be stored in this
+ * object.
+ *
+ * The scheduler is selected according to the highest numbered online processor
+ * in the specified processor set.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``cpuset`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_SIZE The processor set size was invalid.
+ *
+ * @retval ::RTEMS_INVALID_NAME The processor set contained no online
+ * processor.
+ *
+ * @retval ::RTEMS_INCORRECT_STATE The processor set was valid, however, the
+ * highest numbered online processor in the processor set was not owned by a
+ * scheduler.
+ *
+ * @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
+ */
+rtems_status_code rtems_scheduler_ident_by_processor_set(
+ size_t cpusetsize,
+ const cpu_set_t *cpuset,
+ rtems_id *id
+);
+
+/* Generated from spec:/rtems/scheduler/if/get-maximum-priority */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Gets the maximum task priority of the scheduler.
+ *
+ * @param scheduler_id is the scheduler identifier.
+ *
+ * @param[out] priority is the pointer to an ::rtems_task_priority object.
+ * When the directive the maximum priority of the scheduler will be stored in
+ * this object.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
+ * identifier specified by ``scheduler_id``.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``priority`` parameter was NULL.
+ *
+ * @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
+ */
+rtems_status_code rtems_scheduler_get_maximum_priority(
+ rtems_id scheduler_id,
+ rtems_task_priority *priority
+);
+
+/* Generated from spec:/rtems/scheduler/if/map-priority-to-posix */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Maps a Classic API task priority to the corresponding POSIX thread
+ * priority.
+ *
+ * @param scheduler_id is the scheduler identifier.
+ *
+ * @param priority is the Classic API task priority to map.
+ *
+ * @param[out] posix_priority is the pointer to an ``int`` object. When the
+ * directive call is successful, the POSIX thread priority value
+ * corresponding to the specified Classic API task priority value will be
+ * stored in this object.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``posix_priority`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
+ * identifier specified by ``scheduler_id``.
+ *
+ * @retval ::RTEMS_INVALID_PRIORITY The Classic API task priority was invalid.
+ *
+ * @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
+ */
+rtems_status_code rtems_scheduler_map_priority_to_posix(
+ rtems_id scheduler_id,
+ rtems_task_priority priority,
+ int *posix_priority
+);
+
+/* Generated from spec:/rtems/scheduler/if/map-priority-from-posix */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Maps a POSIX thread priority to the corresponding Classic API task
+ * priority.
+ *
+ * @param scheduler_id is the scheduler identifier.
+ *
+ * @param posix_priority is the POSIX thread priority to map.
+ *
+ * @param[out] priority is the pointer to an ::rtems_task_priority object.
+ * When the directive call is successful, the Classic API task priority value
+ * corresponding to the specified POSIX thread priority value will be stored
+ * in this object.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``priority`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
+ * identifier specified by ``scheduler_id``.
+ *
+ * @retval ::RTEMS_INVALID_PRIORITY The POSIX thread priority was invalid.
+ *
+ * @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
+ */
+rtems_status_code rtems_scheduler_map_priority_from_posix(
+ rtems_id scheduler_id,
+ int posix_priority,
+ rtems_task_priority *priority
+);
+
+/* Generated from spec:/rtems/scheduler/if/get-processor */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Returns the index of the current processor.
+ *
+ * Where the system was built with SMP support disabled, this directive
+ * evaluates to a compile time constant of zero.
+ *
+ * Where the system was built with SMP support enabled, this directive returns
+ * the index of the current processor. The set of processor indices is the
+ * range of integers starting with zero up to
+ * rtems_scheduler_get_processor_maximum() minus one.
+ *
+ * @return Returns the index of the current processor.
+ *
+ * @par Notes
+ * Outside of sections with disabled thread dispatching the current processor
+ * index may change after every instruction since the thread may migrate from
+ * one processor to another. Sections with disabled interrupts are sections
+ * with thread dispatching disabled.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+uint32_t rtems_scheduler_get_processor( void );
+
+/* Generated from spec:/rtems/scheduler/if/get-processor-macro */
+#define rtems_scheduler_get_processor() _SMP_Get_current_processor()
+
+/* Generated from spec:/rtems/scheduler/if/get-processor-maximum */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Returns the processor maximum supported by the system.
+ *
+ * Where the system was built with SMP support disabled, this directive
+ * evaluates to a compile time constant of one.
+ *
+ * Where the system was built with SMP support enabled, this directive returns
+ * the minimum of the processors (physically or virtually) available at the
+ * target and the configured processor maximum (see
+ * #CONFIGURE_MAXIMUM_PROCESSORS). Not all processors in the range from
+ * processor index zero to the last processor index (which is the processor
+ * maximum minus one) may be configured to be used by a scheduler or may be
+ * online (online processors have a scheduler assigned).
+ *
+ * @return Returns the processor maximum supported by the system.
+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within any runtime context.
+ *
+ * * The directive will not cause the calling task to be preempted.
+ * @endparblock
+ */
+uint32_t rtems_scheduler_get_processor_maximum( void );
+
+/* Generated from spec:/rtems/scheduler/if/get-processor-maximum-macro */
+#define rtems_scheduler_get_processor_maximum() _SMP_Get_processor_maximum()
+
+/* Generated from spec:/rtems/scheduler/if/get-processor-set */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Gets the set of processors owned by the scheduler.
+ *
+ * @param scheduler_id is the scheduler identifier.
+ *
+ * @param cpusetsize is the size of the processor set referenced by ``cpuset``
+ * in bytes.
+ *
+ * @param[out] cpuset is the pointer to a cpu_set_t object. When the directive
+ * call is successful, the processor set of the scheduler will be stored in
+ * this object. A set bit in the processor set means that the corresponding
+ * processor is owned by the scheduler, otherwise the bit is cleared.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ADDRESS The ``cpuset`` parameter was NULL.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
+ * identifier specified by ``scheduler_id``.
+ *
+ * @retval ::RTEMS_INVALID_SIZE The provided processor set was too small for
+ * the set of processors owned by the scheduler.
+ *
+ * @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
+ */
+rtems_status_code rtems_scheduler_get_processor_set(
+ rtems_id scheduler_id,
+ size_t cpusetsize,
+ cpu_set_t *cpuset
+);
+
+/* Generated from spec:/rtems/scheduler/if/add-processor */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Adds the processor to the set of processors owned by the scheduler.
+ *
+ * @param scheduler_id is the scheduler identifier.
+ *
+ * @param cpu_index is the index of the processor to add.
+ *
+ * This directive adds the processor specified by the ``cpu_index`` to the
+ * scheduler specified by ``scheduler_id``.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
+ * identifier specified by ``scheduler_id``.
+ *
+ * @retval ::RTEMS_NOT_CONFIGURED The processor was not configured to be used
+ * by the application.
+ *
+ * @retval ::RTEMS_INCORRECT_STATE The processor was configured to be used by
+ * the application, however, it was not online.
+ *
+ * @retval ::RTEMS_RESOURCE_IN_USE The processor was already assigned to a
+ * scheduler.
+ *
+ * @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
+ */
+rtems_status_code rtems_scheduler_add_processor(
+ rtems_id scheduler_id,
+ uint32_t cpu_index
+);
+
+/* Generated from spec:/rtems/scheduler/if/remove-processor */
+
+/**
+ * @ingroup RTEMSAPIClassicScheduler
+ *
+ * @brief Removes the processor from the set of processors owned by the
+ * scheduler.
+ *
+ * @param scheduler_id is the scheduler identifier.
+ *
+ * @param cpu_index is the index of the processor to remove.
+ *
+ * This directive removes the processor specified by the ``cpu_index`` from the
+ * scheduler specified by ``scheduler_id``.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
+ * identifier specified by ``scheduler_id``.
+ *
+ * @retval ::RTEMS_INVALID_NUMBER The processor was not owned by the 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
+ * all tasks of the system.
+ *
+ * @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
+ */
+rtems_status_code rtems_scheduler_remove_processor(
+ rtems_id scheduler_id,
+ uint32_t cpu_index
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTEMS_RTEMS_SCHEDULER_H */
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..e4609f6e9f 100644
--- a/cpukit/include/rtems/rtems/tasks.h
+++ b/cpukit/include/rtems/rtems/tasks.h
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (C) 2013, 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2020, 2021 embedded brains GmbH (http://www.embedded-brains.de)
* Copyright (C) 1988, 2017 On-Line Applications Research Corporation (OAR)
*
* Redistribution and use in source and binary forms, with or without
@@ -68,7 +68,6 @@
#include <rtems/score/context.h>
#include <rtems/score/cpu.h>
#include <rtems/score/object.h>
-#include <rtems/score/smp.h>
#include <rtems/score/stack.h>
#include <rtems/score/watchdogticks.h>
@@ -76,29 +75,6 @@
extern "C" {
#endif
-/* Generated from spec:/rtems/scheduler/if/group */
-
-/**
- * @defgroup RTEMSAPIClassicScheduler Scheduler Manager
- *
- * @ingroup RTEMSAPIClassic
- *
- * @brief The scheduling concepts relate to the allocation of processing time
- * for tasks.
- *
- * The concept of scheduling in real-time systems dictates the ability to
- * provide an immediate response to specific external events, particularly the
- * necessity of scheduling tasks to run within a specified time limit after the
- * occurrence of an event. For example, software embedded in life-support
- * systems used to monitor hospital patients must take instant action if a
- * change in the patient’s status is detected.
- *
- * The component of RTEMS responsible for providing this capability is
- * appropriately called the scheduler. The scheduler’s sole purpose is to
- * allocate the all important resource of processor time to the various tasks
- * competing for attention.
- */
-
/* Generated from spec:/rtems/task/if/group */
/**
@@ -442,457 +418,6 @@ rtems_task_priority _RTEMS_Maximum_priority( void );
*/
#define RTEMS_MAXIMUM_PRIORITY _RTEMS_Maximum_priority()
-/* Generated from spec:/rtems/scheduler/if/ident */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Identifies a scheduler by the object name.
- *
- * @param name is the scheduler name to look up.
- *
- * @param[out] id is the pointer to an ::rtems_id object. When the directive
- * call is successful, the identifier of the scheduler will be stored in this
- * object.
- *
- * This directive obtains a scheduler identifier associated with the scheduler
- * name specified in ``name``.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_NAME There was no scheduler associated with the
- * name.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL.
- *
- * @par Notes
- * @parblock
- * The scheduler name is determined by the scheduler configuration.
- *
- * The scheduler identifier is used with other scheduler related directives to
- * access the scheduler.
- * @endparblock
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within any runtime context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-rtems_status_code rtems_scheduler_ident( rtems_name name, rtems_id *id );
-
-/* Generated from spec:/rtems/scheduler/if/ident-by-processor */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Identifies a scheduler by the processor index.
- *
- * @param cpu_index is the processor index to identify the scheduler.
- *
- * @param[out] id is the pointer to an ::rtems_id object. When the directive
- * call is successful, the identifier of the scheduler will be stored in this
- * object.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_NAME The processor index was invalid.
- *
- * @retval ::RTEMS_INCORRECT_STATE The processor index was valid, however, the
- * corresponding processor was not owned by a scheduler.
- *
- * @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
- */
-rtems_status_code rtems_scheduler_ident_by_processor(
- uint32_t cpu_index,
- rtems_id *id
-);
-
-/* Generated from spec:/rtems/scheduler/if/ident-by-processor-set */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Identifies a scheduler by the processor set.
- *
- * @param cpusetsize is the size of the processor set referenced by ``cpuset``
- * in bytes. The size shall be positive.
- *
- * @param cpuset is the pointer to a cpu_set_t. The referenced processor set
- * will be used to identify the scheduler.
- *
- * @param[out] id is the pointer to an ::rtems_id object. When the directive
- * call is successful, the identifier of the scheduler will be stored in this
- * object.
- *
- * The scheduler is selected according to the highest numbered online processor
- * in the specified processor set.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``id`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``cpuset`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_SIZE The processor set size was invalid.
- *
- * @retval ::RTEMS_INVALID_NAME The processor set contained no online
- * processor.
- *
- * @retval ::RTEMS_INCORRECT_STATE The processor set was valid, however, the
- * highest numbered online processor in the processor set was not owned by a
- * scheduler.
- *
- * @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
- */
-rtems_status_code rtems_scheduler_ident_by_processor_set(
- size_t cpusetsize,
- const cpu_set_t *cpuset,
- rtems_id *id
-);
-
-/* Generated from spec:/rtems/scheduler/if/get-maximum-priority */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Gets the maximum task priority of the scheduler.
- *
- * @param scheduler_id is the scheduler identifier.
- *
- * @param[out] priority is the pointer to an ::rtems_task_priority object.
- * When the directive the maximum priority of the scheduler will be stored in
- * this object.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
- * identifier specified by ``scheduler_id``.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``priority`` parameter was NULL.
- *
- * @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
- */
-rtems_status_code rtems_scheduler_get_maximum_priority(
- rtems_id scheduler_id,
- rtems_task_priority *priority
-);
-
-/* Generated from spec:/rtems/scheduler/if/map-priority-to-posix */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Maps a Classic API task priority to the corresponding POSIX thread
- * priority.
- *
- * @param scheduler_id is the scheduler identifier.
- *
- * @param priority is the Classic API task priority to map.
- *
- * @param[out] posix_priority is the pointer to an ``int`` object. When the
- * directive call is successful, the POSIX thread priority value
- * corresponding to the specified Classic API task priority value will be
- * stored in this object.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``posix_priority`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
- * identifier specified by ``scheduler_id``.
- *
- * @retval ::RTEMS_INVALID_PRIORITY The Classic API task priority was invalid.
- *
- * @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
- */
-rtems_status_code rtems_scheduler_map_priority_to_posix(
- rtems_id scheduler_id,
- rtems_task_priority priority,
- int *posix_priority
-);
-
-/* Generated from spec:/rtems/scheduler/if/map-priority-from-posix */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Maps a POSIX thread priority to the corresponding Classic API task
- * priority.
- *
- * @param scheduler_id is the scheduler identifier.
- *
- * @param posix_priority is the POSIX thread priority to map.
- *
- * @param[out] priority is the pointer to an ::rtems_task_priority object.
- * When the directive call is successful, the Classic API task priority value
- * corresponding to the specified POSIX thread priority value will be stored
- * in this object.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``priority`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
- * identifier specified by ``scheduler_id``.
- *
- * @retval ::RTEMS_INVALID_PRIORITY The POSIX thread priority was invalid.
- *
- * @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
- */
-rtems_status_code rtems_scheduler_map_priority_from_posix(
- rtems_id scheduler_id,
- int posix_priority,
- rtems_task_priority *priority
-);
-
-/* Generated from spec:/rtems/scheduler/if/get-processor */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Returns the index of the current processor.
- *
- * Where the system was built with SMP support disabled, this directive
- * evaluates to a compile time constant of zero.
- *
- * Where the system was built with SMP support enabled, this directive returns
- * the index of the current processor. The set of processor indices is the
- * range of integers starting with zero up to
- * rtems_scheduler_get_processor_maximum() minus one.
- *
- * @return Returns the index of the current processor.
- *
- * @par Notes
- * Outside of sections with disabled thread dispatching the current processor
- * index may change after every instruction since the thread may migrate from
- * one processor to another. Sections with disabled interrupts are sections
- * with thread dispatching disabled.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within any runtime context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-uint32_t rtems_scheduler_get_processor( void );
-
-/* Generated from spec:/rtems/scheduler/if/get-processor-macro */
-#define rtems_scheduler_get_processor() _SMP_Get_current_processor()
-
-/* Generated from spec:/rtems/scheduler/if/get-processor-maximum */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Returns the processor maximum supported by the system.
- *
- * Where the system was built with SMP support disabled, this directive
- * evaluates to a compile time constant of one.
- *
- * Where the system was built with SMP support enabled, this directive returns
- * the minimum of the processors (physically or virtually) available at the
- * target and the configured processor maximum (see
- * #CONFIGURE_MAXIMUM_PROCESSORS). Not all processors in the range from
- * processor index zero to the last processor index (which is the processor
- * maximum minus one) may be configured to be used by a scheduler or may be
- * online (online processors have a scheduler assigned).
- *
- * @return Returns the processor maximum supported by the system.
- *
- * @par Constraints
- * @parblock
- * The following constraints apply to this directive:
- *
- * * The directive may be called from within any runtime context.
- *
- * * The directive will not cause the calling task to be preempted.
- * @endparblock
- */
-uint32_t rtems_scheduler_get_processor_maximum( void );
-
-/* Generated from spec:/rtems/scheduler/if/get-processor-maximum-macro */
-#define rtems_scheduler_get_processor_maximum() _SMP_Get_processor_maximum()
-
-/* Generated from spec:/rtems/scheduler/if/get-processor-set */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Gets the set of processors owned by the scheduler.
- *
- * @param scheduler_id is the scheduler identifier.
- *
- * @param cpusetsize is the size of the processor set referenced by ``cpuset``
- * in bytes.
- *
- * @param[out] cpuset is the pointer to a cpu_set_t object. When the directive
- * call is successful, the processor set of the scheduler will be stored in
- * this object. A set bit in the processor set means that the corresponding
- * processor is owned by the scheduler, otherwise the bit is cleared.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ADDRESS The ``cpuset`` parameter was NULL.
- *
- * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
- * identifier specified by ``scheduler_id``.
- *
- * @retval ::RTEMS_INVALID_SIZE The provided processor set was too small for
- * the set of processors owned by the scheduler.
- *
- * @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
- */
-rtems_status_code rtems_scheduler_get_processor_set(
- rtems_id scheduler_id,
- size_t cpusetsize,
- cpu_set_t *cpuset
-);
-
-/* Generated from spec:/rtems/scheduler/if/add-processor */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Adds the processor to the set of processors owned by the scheduler.
- *
- * @param scheduler_id is the scheduler identifier.
- *
- * @param cpu_index is the index of the processor to add.
- *
- * This directive adds the processor specified by the ``cpu_index`` to the
- * scheduler specified by ``scheduler_id``.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
- * identifier specified by ``scheduler_id``.
- *
- * @retval ::RTEMS_NOT_CONFIGURED The processor was not configured to be used
- * by the application.
- *
- * @retval ::RTEMS_INCORRECT_STATE The processor was configured to be used by
- * the application, however, it was not online.
- *
- * @retval ::RTEMS_RESOURCE_IN_USE The processor was already assigned to a
- * scheduler.
- *
- * @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
- */
-rtems_status_code rtems_scheduler_add_processor(
- rtems_id scheduler_id,
- uint32_t cpu_index
-);
-
-/* Generated from spec:/rtems/scheduler/if/remove-processor */
-
-/**
- * @ingroup RTEMSAPIClassicScheduler
- *
- * @brief Removes the processor from the set of processors owned by the
- * scheduler.
- *
- * @param scheduler_id is the scheduler identifier.
- *
- * @param cpu_index is the index of the processor to remove.
- *
- * This directive removes the processor specified by the ``cpu_index`` from the
- * scheduler specified by ``scheduler_id``.
- *
- * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
- *
- * @retval ::RTEMS_INVALID_ID There was no scheduler associated with the
- * identifier specified by ``scheduler_id``.
- *
- * @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.
- *
- * @par Notes
- * Removing a processor from a scheduler is a complex operation that involves
- * all tasks of the system.
- *
- * @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
- */
-rtems_status_code rtems_scheduler_remove_processor(
- rtems_id scheduler_id,
- uint32_t cpu_index
-);
-
/* Generated from spec:/rtems/task/if/create */
/**
@@ -1267,7 +792,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/rtems/tasksimpl.h b/cpukit/include/rtems/rtems/tasksimpl.h
index 62a618b635..f32255b0d9 100644
--- a/cpukit/include/rtems/rtems/tasksimpl.h
+++ b/cpukit/include/rtems/rtems/tasksimpl.h
@@ -111,6 +111,14 @@ RTEMS_INLINE_ROUTINE rtems_task_priority _RTEMS_Priority_From_core(
/**@}*/
+/**
+ * @defgroup RTEMSImplClassicScheduler Scheduler Manager
+ *
+ * @ingroup RTEMSImplClassic
+ *
+ * @brief This group contains the Scheduler Manager implementation.
+ */
+
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/rtems/taskmp.h>
#endif
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/cpustdatomic.h b/cpukit/include/rtems/score/cpustdatomic.h
index 5e1319037e..774b18def3 100644
--- a/cpukit/include/rtems/score/cpustdatomic.h
+++ b/cpukit/include/rtems/score/cpustdatomic.h
@@ -296,7 +296,7 @@ static inline uintptr_t _CPU_atomic_Load_uintptr( const CPU_atomic_Uintptr *obj,
static inline void _CPU_atomic_Store_uint( CPU_atomic_Uint *obj, unsigned int desired, CPU_atomic_Order order )
{
#if defined(_RTEMS_SCORE_CPUSTDATOMIC_USE_ATOMIC)
- obj->store( desired );
+ obj->store( desired, order );
#elif defined(_RTEMS_SCORE_CPUSTDATOMIC_USE_STDATOMIC)
atomic_store_explicit( obj, desired, order );
#else
@@ -316,7 +316,7 @@ static inline void _CPU_atomic_Store_uint( CPU_atomic_Uint *obj, unsigned int de
static inline void _CPU_atomic_Store_ulong( CPU_atomic_Ulong *obj, unsigned long desired, CPU_atomic_Order order )
{
#if defined(_RTEMS_SCORE_CPUSTDATOMIC_USE_ATOMIC)
- obj->store( desired );
+ obj->store( desired, order );
#elif defined(_RTEMS_SCORE_CPUSTDATOMIC_USE_STDATOMIC)
atomic_store_explicit( obj, desired, order );
#else
@@ -336,7 +336,7 @@ static inline void _CPU_atomic_Store_ulong( CPU_atomic_Ulong *obj, unsigned long
static inline void _CPU_atomic_Store_uintptr( CPU_atomic_Uintptr *obj, uintptr_t desired, CPU_atomic_Order order )
{
#if defined(_RTEMS_SCORE_CPUSTDATOMIC_USE_ATOMIC)
- obj->store( desired );
+ obj->store( desired, order );
#elif defined(_RTEMS_SCORE_CPUSTDATOMIC_USE_STDATOMIC)
atomic_store_explicit( obj, desired, order );
#else
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/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..1dfa7f628d 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_DEBUG 0
+ #endif
+
+ #if CPU_SIZEOF_POINTER > 4
+ #define PER_CPU_CONTROL_SIZE_BIG_POINTER 76
#else
- #define PER_CPU_CONTROL_SIZE_APPROX \
- ( 180 + CPU_PER_CPU_CONTROL_SIZE + CPU_INTERRUPT_FRAME_SIZE )
+ #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
@@ -452,10 +465,12 @@ typedef struct Per_CPU_Control {
* @brief Watchdog state for this processor.
*/
struct {
+#if defined(RTEMS_SMP)
/**
* @brief Protects all watchdog operations on this processor.
*/
- ISR_LOCK_MEMBER( Lock )
+ ISR_lock_Control Lock;
+#endif
/**
* @brief Watchdog ticks on this processor used for monotonic clock
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 df9477fbeb..55be638a8d 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 *,
@@ -245,12 +297,12 @@ typedef struct {
* this structure at the begin of its context structure.
*/
typedef struct Scheduler_Context {
+#if defined(RTEMS_SMP)
/**
* @brief Lock to protect this scheduler instance.
*/
- ISR_LOCK_MEMBER( Lock )
+ ISR_lock_Control Lock;
-#if defined(RTEMS_SMP)
/**
* @brief The set of processors owned by this scheduler instance.
*/
@@ -403,6 +455,24 @@ Priority_Control _Scheduler_default_Unmap_priority(
/**
* @brief Does nothing.
*
+ * This default implementation for the make and clean sticky operations
+ * should be used by uniprocessor schedulers if SMP support is enabled.
+ *
+ * @param scheduler is an unused parameter.
+ *
+ * @param the_thread is an unused parameter.
+ *
+ * @param node is an unused parameter.
+ */
+ void _Scheduler_default_Sticky_do_nothing(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread,
+ Scheduler_Node *node
+ );
+
+ /**
+ * @brief Does nothing.
+ *
* This default implementation for the thread pin or unpin operations should
* be used by uniprocessor schedulers if SMP support is enabled.
*
@@ -462,6 +532,8 @@ Priority_Control _Scheduler_default_Unmap_priority(
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, \
@@ -544,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.
diff --git a/cpukit/include/rtems/score/schedulercbs.h b/cpukit/include/rtems/score/schedulercbs.h
index 4b7efc8340..8a9a49ccd9 100644
--- a/cpukit/include/rtems/score/schedulercbs.h
+++ b/cpukit/include/rtems/score/schedulercbs.h
@@ -67,7 +67,6 @@ extern "C" {
_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_DEFAULT_SET_AFFINITY_OPERATION \
}
@@ -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 9e643b93eb..258563217f 100644
--- a/cpukit/include/rtems/score/scheduleredf.h
+++ b/cpukit/include/rtems/score/scheduleredf.h
@@ -66,7 +66,6 @@ extern "C" {
_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_DEFAULT_SET_AFFINITY_OPERATION \
}
diff --git a/cpukit/include/rtems/score/scheduleredfsmp.h b/cpukit/include/rtems/score/scheduleredfsmp.h
index 1841aa4a7b..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 {
@@ -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 50110ea6e7..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