Compare commits

...

3481 Commits
5 ... base/6

Author SHA1 Message Date
Chris Johns
e14a740a99 spec/cpukit: Add libdl RISCV support
Closes #5144
2024-11-22 00:13:36 +00:00
Chris Johns
4a00b66bc6 cpukit/libdl/riscv: Fix warnings
Updates #5144
2024-11-22 00:13:36 +00:00
Kinsey Moore
9e42e61e6e bsps/aarch64/zynqmp: Factor out the CFC-400X management console
This moves the management console implementation into its own file so
that BSPs which do not need it do not carry the code around with them.

Closes #5120
2024-11-22 00:06:16 +00:00
Gedare Bloom
24c964e83c confdefs: do not CONFIGURE_FILESYSTEM_NFS in ALL
Fixes #5118.
2024-11-22 00:03:19 +00:00
Kinsey Moore
7d1a934884 bsps/shared/flash: Add a JFFS2 flashdev driver
This adds generic JFFS2 interworking code that allows JFFS2 to be used
on top of any flashdev backend. It currently only supports NOR flashdev
backends.
2024-11-21 23:44:37 +00:00
Aaron Nyholm
9d6367fd4f bsps/xilinx-zynq: Fixed QSPI Flash sector erase
Erases of exactly the sector size only erase one sector instead of
two.

Closes #5161
2024-11-21 16:54:56 +11:00
Sebastian Huber
f45ccfa167 build: Remove Windows quirk
The current version of gccdeps.py works on Windows.
2024-11-21 04:22:31 +01:00
Sebastian Huber
7c099f5613 build: Fix native Windows build
Replace the Windows path separator to get proper UIDs.
2024-11-21 04:22:31 +01:00
Sebastian Huber
f6e55fa4b0 build: Remove Python 2 quirks 2024-11-21 04:22:31 +01:00
Sebastian Huber
ae7a21c5e9 build: Report normal Git hash
Commit 3d782180ea changed the reported Git
hash to short.  Change this back to the normal Git hash.  Existing
support code may rely on this.  The short hash is generated based on the
current repository state.  The reported hash should be useful also for
future states of the repository.  If Git changes the hash algorithm in
the future, then the hash length may be used as an indicator for the
hash algorithm.  With a variable hash length this is more difficult.

Simplify expression.

Update #5037.
2024-11-20 15:13:45 +00:00
Sebastian Huber
e53dfabe36 sparc/leon3: Add leon3_l2c_lock
Use a single lock for all L2C support functions.

Close #4925.
2024-11-20 15:08:04 +00:00
Sebastian Huber
7d5c08db80 validation: Check bootloader L2C settings
Update #4925.
2024-11-20 15:08:04 +00:00
Martin Åberg
85add65a91 grlib/l2c: Prevent concurrent register access
Accesses to the L2C registers performed by the L2C driver are now
serialized with spin locks. This avoids concurrent access to the L2C
registers by multiple processors. Proposed by GRLIB-TN-0021.

Update #4925.
2024-11-20 15:08:04 +00:00
Martin Åberg
1ce6347976 grlib/l2c: Write to flush registers using atomic instructions
All writes to the L2C flush registers performed by the driver are now
done using atomic write instructions. Proposed by GRLIB-TN-0021.

Update #4925.
2024-11-20 15:08:04 +00:00
Martin Åberg
6198260d26 grlib/l2c: Access registers with helper functions 2024-11-20 15:08:04 +00:00
Martin Åberg
0a2c310d39 grlib/l2c: Use printk for debug print 2024-11-20 15:08:04 +00:00
Martin Åberg
ed55634d51 grlib/l2c: Fix whitespace
No functional change
2024-11-20 15:08:04 +00:00
Sebastian Huber
e5854b2a69 bsps/sparc: Add comments
Close #4875.
2024-11-20 15:07:29 +00:00
Martin Åberg
26b11e3830 LEON3: Update power-down function
This updates the implementation of the LEON3 processor power-down
function.

It now contains the workaround for the GR712RC power-down errata
described in GR712RC-UM, version 2.16, section 1.7.8. The workaround is
compatible with other LEON3/LEON4 components.

Update #4875.
2024-11-20 15:07:29 +00:00
Sebastian Huber
e661f400e2 score: Fix _Thread_Priority_apply()
Properly serialize explicit thread priority changes (for example
rtems_task_set_priority()) and thread priority changes carried out by
thread queues (locking protocols such as priority inheritance).

Update #5159.
2024-11-20 02:32:39 +01:00
Sebastian Huber
7ff3438cba validation: Test thread priority change detail
Test the proper serialization of explicit thread priority changes (for
example rtems_task_set_priority()) and thread priority changes carried
out by thread queues (locking protocols such as priority inheritance).

With RTEMS_DEBUG enabled, the new test case fails with an assertion.  It
is fixed in a follow up commit.

Update #5159.
2024-11-20 02:32:38 +01:00
Sebastian Huber
04f263ee82 validation: Add ticket lock helpers
Update #5159.
2024-11-20 02:32:11 +01:00
Sebastian Huber
1c12047098 score: Improve priority node debugging
Make sure the actions of priority aggregations are not reused while in
use.

Update #5159.
2024-11-20 02:32:11 +01:00
Chris Johns
133b335bae cpukit/libmisc/rtems-fdt: Add shell read and write handler support
The handlers allow indirect access to FDT resources registered with the
shell.

Closes #5152
2024-11-16 17:40:05 +11:00
Kinsey Moore
b3be636863 bsps/stm32h7/spi: Add IRQ support 2024-11-15 00:47:58 +00:00
Kinsey Moore
b1a350a18a bsps/stm32h7: Add full duplex support for SPI 2024-11-15 00:47:58 +00:00
Sebastian Huber
601e52f495 bsps: Fix Doxygen groups 2024-11-15 00:36:37 +00:00
yang.zhang
6f604aec83 libmisc/shell: Only restore terminal settings on exit when captured
Signed-off-by: yang.zhang <zhangyang01@kylinos.cn>
2024-11-15 00:35:26 +00:00
Sebastian Huber
d0b9c07b20 doxgen: Document build system provided files
Use the #include path.

Update #3707.
2024-11-15 00:19:50 +00:00
Sebastian Huber
83dccef48d libtests/ttest01: Fix CPU counter precision issues
Change the time to convert so that rounding issues do not propergate to
the second next digit.  Properly round the result used for the precision
estimate.
2024-11-14 03:45:46 +01:00
Sebastian Huber
f7b04e72f8 validation: Clarify SMP EDF test case
Update #3716.
2024-11-14 01:33:24 +01:00
Sebastian Huber
d386baedb5 rtems: Remove <rtems/rtemsdialer.h>
This header file belongs to the network stacks.
2024-11-13 23:30:21 +00:00
Sebastian Huber
be85180ee1 record: Fix rtems_record_server() clean up
Fix CID 1634787.

Fix #5150.
2024-11-13 23:07:02 +00:00
Christian Mauderer
2c4e3ab117 bsps/shared: Fix bug in driver for I2C RTCs
The two RTCs supported by that driver (MCP7940M and EOZ9) use slightly
different register order. Add support for a different order to the
i2c-rtc driver.
2024-11-13 23:06:47 +00:00
Sebastian Huber
5ed0bf3457 spfatal34/spfatal36: Avoid RTEMS_UNREACHABLE()
The RTEMS_UNREACHABLE() is a hint to the compiler that this code
location is unreachable.  The compiler may use this information to
optimize the code.  If a test case fails and we reach this code
location, then unpredictable things may happen making the test case
debugging more difficult than necessary.
2024-11-13 23:05:25 +00:00
Sebastian Huber
85facac39f spfatal26: Fix recursive test end 2024-11-13 23:05:25 +00:00
Sebastian Huber
f57652dcda powerpc/qoriq: Enable RTEMS_SMP for BSP family 2024-11-13 02:03:13 +01:00
Sebastian Huber
30fc123f8d record: Use only related uptime low/high events
In case of overflows, we may have an RTEMS_RECORD_UPTIME_HIGH event as
the first event.  This uptime high event has no associated
RTEMS_RECORD_UPTIME_LOW event.
2024-11-12 22:43:35 +00:00
Sebastian Huber
464a37ac07 record: Add uptime event to fatal dump 2024-11-12 22:43:35 +00:00
Sebastian Huber
0f2721c832 record: Dump only once in fatal handling 2024-11-12 22:43:35 +00:00
Sebastian Huber
e72ee949a0 record: Avoid non-monotonic event times
The uptime and CPU counter reads must be as close as possible.  Fix
rounding.
2024-11-12 22:43:35 +00:00
Sebastian Huber
d4762dbad1 record: Improve uptime association 2024-11-12 22:43:35 +00:00
Sebastian Huber
4655a7df00 record: Reorganize system event numbers
This allows a fast check if a system event may not have a time stamp.
2024-11-12 22:43:35 +00:00
Sebastian Huber
920f8d8897 record: Rework client
The ring buffer overflow handling is already performed by
rtems_record_fetch().
2024-11-12 22:43:35 +00:00
Sebastian Huber
be764f7dec record: Remove rtems_record_drain()
The rtems_record_drain() function is unreliable.  Replace it with
rtems_record_fetch().
2024-11-12 22:43:35 +00:00
Sebastian Huber
049b9b5c82 record: Add rtems_record_fetch()
This function will replace rtems_record_drain() which turned out to be
unreliable in SMP configurations.
2024-11-12 22:43:35 +00:00
Sebastian Huber
31ac9cd554 record: Remove drain header from record control 2024-11-12 22:43:35 +00:00
Sebastian Huber
3721dea3d0 record02: Fix test end
Include _Record_Fatal_dump_base64_zlib() in the test scope.
2024-11-12 22:43:35 +00:00
Sebastian Huber
3f7fdcc711 shell01: Fix test failure
Test failure was introduced by commit:

commit c4f9759068
Author: shuhua hua <huangshuhua@kylinos.cn>
Date:   Thu Sep 12 02:36:13 2024 +0000

    libtests/shell01:add test empty and NULL usernames check
2024-11-12 16:25:05 +00:00
Sebastian Huber
9fabe95dc6 fstests: Fix name of JFFS2 NAND tests 2024-11-12 16:23:03 +00:00
Sebastian Huber
2c64cf1bd8 dev/serial/sc16is752-spi: Fix warnings
Fix several may be used uninitialized warnings.
2024-11-12 16:21:20 +00:00
Sebastian Huber
f208860981 dev/slcr: Fix warning 2024-11-12 16:18:20 +00:00
Chris Johns
32b46899a3 spec/bsps/xilinx-microzed: Fix the default setting for the Avnet Microzed PCLK
Closes #5149
2024-11-12 16:16:19 +11:00
Aaron Nyholm
177a8c57ea bsps/xilinx-zynq: Add QSPI flash driver 2024-11-08 03:34:48 +00:00
Chris Johns
d6f3cd72ee libmisc/rtems-fdt: Path find need a sorted index table
Sort the index table so the bubble search works.
2024-11-08 03:28:23 +00:00
Joel Sherrill
dc7adff723 timespec.h, etc.: Eliminate use of 32-bit for time_t
This code had a uint32_t local variable for seconds from a timespec.
This was assigning a time_t to a uint32_t and ultimately returning it.
This propgated to rtems_timespec_add_to().

Coverity CID 1512527

Closes #5107.
2024-11-08 00:38:23 +00:00
Sebastian Huber
f4875c8f4d build: Fix spec cache
The updated waf version deletes the waf cache directory in the build
tree.  This removes also the build specification item cache.  Move the
cache directory so that it works across configure commands.
2024-11-08 00:24:21 +00:00
Kinsey Moore
84fe3d830c spec: Update smallmem test list 2024-11-08 00:13:46 +00:00
Kinsey Moore
c59b6c3825 spec: Update no-rfs test list 2024-11-08 00:09:10 +00:00
Sebastian Huber
e87f5ebe37 score: Use normal integers for C++ atomic objects
Since C++20 there is no longer a trivial default constructor available
for atomic objects.  See:

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0883r2.pdf

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117475

We already assume that an atomic integer can be stored in a normal
integer and has the same representation in C and C++.

Update #5145.
2024-11-07 03:24:09 +01:00
Aaron Nyholm
87c725b6ed flashdev: Add sector IOCTLs
Added new IOCTLs to flashdev to get sector info.
Updated flashdev shell command and flashdev test with new IOCTLs.
2024-11-06 22:35:20 +00:00
Kinsey Moore
c4625d8d86 cpukit/arm/pmsa: Add ability to find empty MPU regions 2024-11-04 17:17:10 -06:00
Kinsey Moore
a506c7f713 cpukit/arm/pmsa: Correctly determine the total number of MPU regions 2024-11-01 16:55:47 -05:00
Gedare Bloom
c6ad57b102 riscv: fix FDT loads during work area init
Fixes #5139
2024-10-31 23:14:09 +00:00
Gedare Bloom
a1eb04be66 riscv/beaglevfire: disable BSP_START_COPY_FDT_FROM_U_BOOT by default 2024-10-31 22:59:15 +00:00
Sam Price
90c4d36cb3 microblaze: fix warnings about clock.
Closes #5141
2024-10-31 22:53:37 +00:00
Chris Johns
45308bcc32 bsp/xilinx-zynq: Change devcfg prints to printk
Updates #5142
2024-10-31 14:05:12 +11:00
Chris Johns
fbbbe04cf5 bsp/xilinx-zynq: Change devcfg locks to self-contained mutexes
Updates #5142
2024-10-31 13:56:41 +11:00
Chris Johns
558e0b3b89 bsp/xilinx-zynq: Move devcfg DMA alignment size to the install header
Fix the dev path spelling mistake.

Updates #5142
2024-10-31 13:28:37 +11:00
Chris Johns
d1e507e010 bsp/xilinx-zynq: Add SPDX to devcfg and slcr files
Updates #5142
2024-10-31 13:27:08 +11:00
Chris Johns
bc8ffae115 bsp/xilinx-zynq: Add devcfg and slcr drivers
The devfg driver loads the PL with a bitfile image. The driver can also
support scrubbing.

These drivers are from Patrick Gauvin <pggauvin at gmail.com> and a thread
on the devel list: https://lists.rtems.org/pipermail/devel/2017-May/017705.html
2024-10-30 23:04:42 +00:00
Chris Johns
a1c3d4ba8e version: Add the release label interfaces
- Mark the VC key interfaces as deprecated in doxygen

Updates #5037
2024-10-30 22:40:15 +00:00
Chris Johns
3d782180ea waf: Fix handling of the VERSION file in a release
Fixes #5037
2024-10-30 22:40:15 +00:00
Chris Johns
2c4c73fd40 waf: Reformat using yapf 2024-10-30 22:40:15 +00:00
yang.zhang
64fe53a855 libfs/pipe: Fix panic caused by incomplete pipe dup
When dup fd, should also clone fctnl flags.
Also should check NULL param in pipe_* funcs.

Signed-off-by: yang.zhang <zhangyang01@kylinos.cn>
2024-10-30 20:03:58 +00:00
Kinsey Moore
1b5549ae69 bsps/arm/zynq: Make secondary core wait on QEMU
When using QEMU configurations that support SMP for Zynq7000 systems,
the second core is started at the same time as the first core instead of
waiting for an event to trigger a check for the value at 0xfffffff0
before jumping into RTEMS code. This makes the erroneously started core
wait as expected and prevents prefetch and data aborts from occurring
before the MMU has been properly configured. This was recently exposed
by cleanup done to the ARM GICv2 driver that removed some delays which
were allowing this to operate normally.
2024-10-30 18:56:36 +00:00
Kinsey Moore
95d904b036 spec: Apply CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR where expected
The general optclkbootcpu option is targeted at all ARM QEMU BSPs, but
is not actually linked in to the build tree. This links it in as
expected and removes a redundant and stale copy in the realview PBX BSP.
2024-10-30 18:56:36 +00:00
Matteo Concas
8820b8e63f grlib/b1553rt: Fix bit shift direction
The RT_TSW_OK field is set to 1 if there was no error. The Message Error
(ME) field indicates an error and must be set to 0 if there was no error
so the result of tsw&RT_TSW_OK must be negated. It is then left-shifted
to the Messsage Error (ME) bit field of the message information word.

Fix issue CID 1399772
2024-10-29 13:25:14 +00:00
Gedare Bloom
80ef0dee02 score: ignore -Wdanglingpointer= in _User_extensions_Iterate 2024-10-28 23:13:58 -06:00
Gedare Bloom
6ae5a04766 wscript: remove long_gcc for windows command line
waf now builds in support to detect the long command line problems
for windows.

Closes #5138.
2024-10-28 21:39:14 -06:00
Gedare Bloom
b9fa7a4082 gccdeps: import from waf-2.1.3 2024-10-28 21:39:14 -06:00
Gedare Bloom
5d074a263b waf: Update waf to version 2.1.3 2024-10-28 20:37:24 +00:00
Kinsey Moore
1bba349478 bsps: Remove imported Xilinx headers
This removes the headers imported from the embeddedsw repository in
favor of a much thinner shim. This also removes the complicated build
system configuration necessary to support use of these headers. The
primary reason for removal is that certain external Xilinx libraries
also require use of these headers and this causes version mismatches and
header conflicts that can be avoided.
2024-10-28 19:23:49 +00:00
Ning Yang
79bed0f191 aarch64/raspberrypi: optimize console return 2024-10-28 15:12:21 +00:00
Utkarsh Verma
d17116d310 aarch64/raspberrypi: improve UART
- Add support for four new ports, UART2-UART5.
- Add build options to allow console device configuration.
- Segregate device-specific definitions from the device family files. X macros
  are used to maintain a single source of truth and have the configuration
  done at compile-time
- Add raspberrypi_uart_init() to make it convenient for users to install uart
  devices

Close #5130

Co-authored-by: Ning Yang <yangn0@qq.com>
2024-10-28 15:12:21 +00:00
Kinsey Moore
ee34dd12f4 spec/aarch64: Rename Versal BPSs to be in line with ZynqMP 2024-10-28 08:21:36 +00:00
Purva Yeshi
eaaeebedda riscv/beaglevfire: Rename 'bvf' to 'beaglevfire' 2024-10-25 21:23:23 +00:00
Francescodario Cuzzocrea
9d45cf1b44 riscv: add bsp for beagle v fire
Signed-off-by: Francescodario Cuzzocrea <bosconovic@gmail.com>
2024-10-25 21:23:23 +00:00
Francescodario Cuzzocrea
0e3792edbf riscv: Work area size based on /memory node in fdt
* It is not granted that we will always access to natually aligned
   access. So, before handling endianess do byte-a-byte load using
   the appropriate libfdt function to avoid unaligned access issues

Signed-off-by: Francescodario Cuzzocrea <bosconovic@gmail.com>
2024-10-25 21:23:23 +00:00
Gedare Bloom
0d15487401 riscv/niosv: use default values that compile 2024-10-25 13:49:36 +00:00
Kevin Kirspel
e9957cd8e3 riscv/niosv: Adding a new NIOS V BSP to RISC-V 2024-10-25 13:49:36 +00:00
Kinsey Moore
d0e9ec85b0 cpukit/libmisc/shell: Remove shell prompt carriage return
This removes the carriage return printed before the shell prompt as it
can cause other output to be overwritten unexpectedly. This was
discovered when using the "cat" shell command on a file whose content
contained no trailing \n\r and was short enough to be entirely swallowed
by the prompt.
2024-10-25 02:44:37 +00:00
Amar Takhar
e0f1c8fe0b Set Python scripts to use Python 3
Several of these already required Python 3 and would not run under 2.7.
2024-10-24 23:26:05 +00:00
Kinsey Moore
83c1a305f7 cpukit/libfs/jffs2: Prevent memory corruption due to corrupted data
The rtime decompression routine does not fully check bounds during the
entirety of the decompression pass and can corrupt memory outside the
decompression buffer if the compressed data is corrupted. This adds the
required check to prevent this failure mode.

Updates #5072
2024-10-24 22:35:40 +00:00
Matteo Concas
a5f64ff27d grlib/ascs: Fix evaluation order violations, CIDs 1399778, 1399782 2024-10-21 07:02:51 +00:00
Matteo Concas
93413ed315 grlib/pwm: Fix PWM enable bit check, CID 1399774 2024-10-21 07:02:51 +00:00
Matteo Concas
de56c23c14 grlib/1553: Remove dead code, CID 1399770 2024-10-21 07:02:51 +00:00
Matteo Concas
ff22dd6f7c grlib/1553: Remove dead code, CID 1399764 2024-10-21 07:02:51 +00:00
Kinsey Moore
907ded868d spec/bsps/aarch64/zynqmp: Complete the transition to consistent naming
These references were missed in the last renaming patch causing the
ILP32 BSP to fail to build.

Closes #5119
2024-10-20 21:10:49 -05:00
Sebastian Huber
e7ee376803 aarch64/zynqmp: Fix build due to BSP renaming
Update #5119.
2024-10-20 09:55:19 +02:00
Kinsey Moore
a34bc70dc5 spec/bsps/aarch64/zynqmp: Remove overly specific BSP and rename generic BSP
Updates #5119
2024-10-20 02:50:22 +00:00
Sebastian Huber
4c75bd88f3 Revert "libmisc/stackchk: Change stack checker reporter function signatures"
This reverts commit c1aa06dbd2.

Extending the rtems_stack_checker_info like this breaks the existing
visitor API used by rtems_stack_checker_iterate().  After review, using
an information structure contradicts the intention of the reporter to
allow a minimal reporting.  Filling up the information structure with
all the details would pull in several dependencies, like
_Thread_Get_name().  The API should be improved to provide the user with
the necessary information from the TCB without having to access members
directly.
2024-10-19 15:43:07 +00:00
Kinsey Moore
b8bd1a1ce3 spec/bsps/aarch64: Update BSP naming to be more consice
This removes the xilinx and lp64 identifiers from the ZynqMP BSPs and
updates those names throughout the build system. The xilinx identifier
is being removed because it is implied by zynqmp and lp64 is being
removed because it is the default for AArch64.

This also renames grp_zu3eg.yml to grp_hardware.yml to more accurately
reflect its purpose.

Updates #5119
2024-10-19 02:21:49 +00:00
Kinsey Moore
e6cadcf0cc spec/bsps: Clean up stale references to minimum.exe in test configurations
Now that minimum.exe is minimum.norun.exe, the tester will not attempt
to run this sample test and will therefore not categorize it as a
failure since it includes no output. BSP-level test configurations for
this test can now be removed since those configurations only existed to
prevent it from being run.
2024-10-19 02:21:09 +00:00
Kinsey Moore
685a26315c bsps/aarch64/mmu: Update mapping function to new API
This was missed in the API change.
2024-10-19 02:04:34 +00:00
Sebastian Huber
a54e0deab1 rtems: Simplify optionsimpl.h
Replace ternary operator with a boolean expression.  Include <stdbool.h>
for the bool definition.  Fix formatting.
2024-10-18 20:02:39 +00:00
Kinsey Moore
3562f1d028 spec/bsps/arm: Remove the mercury-specific BSP
This BSP has been superceded by the generic BSPs supporting lockstep and
each of the cores in split mode.

Updates #5119
2024-10-17 21:33:51 -05:00
Kinsey Moore
c978b63c3a cpukit/libdl/arm: Support BLX relocations that require a trampoline
BLX relocations in Thumb code expect the target to be ARM code. This
means that the trampoline must be generated in ARM mode.
2024-10-17 22:32:47 +00:00
Kinsey Moore
689e9986cd cpukit/libdl: Fix spelling of trampoline 2024-10-17 22:32:47 +00:00
Mohamed Hassan
c1aa06dbd2 libmisc/stackchk: Change stack checker reporter function signatures
This helps in abstraction by encapsulating unnecessary data to be revealed to the user
2024-10-16 04:30:45 +00:00
shuhua hua
c4f9759068 libtests/shell01:add test empty and NULL usernames check 2024-10-15 13:12:25 +00:00
shuhua hua
bcd4b83e16 Ignore empty user names as input
* To unify the surrounding coding style
2024-10-15 13:11:42 +00:00
Sebastian Huber
ad378dcaf7 bsps/aarch64: Use clean invalidate
On other targets, the rtems_cache_flush_entire_data() also performs a
clean and invalidate.

This is a workaround for "Answer 68874 - Zynq UltraScale+ MPSoC, APU -
An Eviction Might Overtake A Cache Clean Operation".
2024-10-11 01:27:48 +02:00
Sebastian Huber
95734e3d6d bsps/aarch64: Simplify aarch64_mmu_map_block() 2024-10-11 01:27:48 +02:00
Sebastian Huber
bb2cd445e1 bsps/aarch64: Add AARCH64_MMU_PHYSICAL_ADDRESS_RANGE_BITS
This avoids dead code in the MMU setup.
2024-10-11 01:27:48 +02:00
Sebastian Huber
269f4ca5db bsps/aarch64: Use dependency injection
Let the caller provide the translation table base and the used page
tables to ease testing.

Simplify the error handling by using early returns.

Return RTEMS_TOO_MANY instead of RTEMS_NO_MEMORY if the page tables are
all used.
2024-10-11 01:27:48 +02:00
Sebastian Huber
4b1e80dff5 bsps/aarch64: Improve MMU mapping
Produce only one fatal error.  Fix potential integer overflow errors.
2024-10-11 01:27:48 +02:00
Sebastian Huber
8c4cc767b5 aarch64/xilinx-zynqmp: Move MMU config table 2024-10-11 01:27:48 +02:00
Sebastian Huber
41ed4b5d26 bsps/aarch64: Assume that all levels have a data cache
This is the case for all currently supported AArch64 targets.
2024-10-11 01:27:48 +02:00
Sebastian Huber
aac760584b bsps/aarch64: Fix entire data cache flush/invalidate
The cache maintenance operations affect only the current PE.  Make sure
that thread dispatching is disabled and interrupts cannot interfere.
2024-10-11 01:27:48 +02:00
Sebastian Huber
064a672fbb bsps/aarch64: Simplify AArch64_clidr_get_cache_type() 2024-10-11 01:27:48 +02:00
Sebastian Huber
098f8cb079 bsps/aarch64: Fix AArch64_get_ccsidr_for_level() 2024-10-11 01:27:48 +02:00
Sebastian Huber
77094f11b1 bsps/aarch64: Simplify I-cache invalidate 2024-10-11 01:27:48 +02:00
Sebastian Huber
cfd885850a bsps/aarch64: Use fatal error for data cache disable
On the Cortex-A cores, at least the L1 data cache is required to provide
support for atomic operations.

Update #5050.
2024-10-11 01:27:48 +02:00
Sebastian Huber
3fd063159d dev/irq: Simplify SMP GIC initialization
There is no need to wait on secondary processors for the GIC distributor
enable since the BSPs for real targets start the secondary processors
in _CPU_SMP_Start_processor().
2024-10-11 01:27:48 +02:00
Sebastian Huber
f43042cd06 bsps: Move <bsp/linker-symbols.h> to shared
Move architecture-independent items to a shared <bsp/linker-symbols.h>.
Allow architectures to customize it through <bsp/linker-symbols-arch.h>.
2024-10-11 01:27:48 +02:00
Sebastian Huber
c538079ec1 aarch64: Remove trapped FP exceptions support
Whether a floating-point implementation supports trapping of
floating-point exceptions is implementation defined.  At least Qemu,
Cortex-A53, and Cortex-A72 do not support them.
2024-10-11 01:27:48 +02:00
Sebastian Huber
42c6f727d6 dev/irq: Remove arm_gic_irq_generate_software_irq()
Replace uses with API calls.
2024-10-11 01:27:48 +02:00
Sebastian Huber
5a962e3bb7 arm/aarch64: Optimize _CPU_SMP_Send_interrupt()
Avoid superfluous error checks.
2024-10-11 01:27:48 +02:00
Sebastian Huber
5ff5bd3c10 aarch64: More robust SMP system start
In SMP configurations, check that we run on a configured processor.  If not,
then there is not much that can be done since we do not have a stack available
for this processor.  Just loop forever in this case.  Do this in assemlby to
ensure that no stack memory is used.
2024-10-11 01:27:48 +02:00
Sebastian Huber
1524b5f923 aarch64/xilinx-zynqmp: Move get I2C clocks
Not all applications use I2C.
2024-10-11 01:27:48 +02:00
Sebastian Huber
f630be8933 aarch64/xilinx-zynqmp: Simplify startup
There is no need to copy sections since the linker command file has no separate
runtime and load regions for the sections.
2024-10-11 01:27:48 +02:00
Sebastian Huber
8db6a45009 bsps: Assembly implementation for PSCI bsp_reset()
Avoid issues with potential dead code after the secure monitor or
hypervisor call.
2024-10-11 01:27:48 +02:00
Sebastian Huber
a8d3efe4b0 dev/irq: Simplify GICv2 set/get affinity 2024-10-11 01:27:48 +02:00
Sebastian Huber
2b36492366 aarch64: Move exception frame support
The exception frame handling support is optional.
2024-10-11 01:27:48 +02:00
Sebastian Huber
8d6e8f153c aarch64: Split exception support
Resuming a non-interrupt exception is optional.
2024-10-11 01:27:48 +02:00
Sebastian Huber
07217e3f5c bsps/aarch64: Customize EL2/EL3 start support
Make the support for starting in EL2/EL3 customizable.  A boot loader or
the Arm Trusted Firmware should start RTEMS in non-secure EL1 mode.

In start.S, use local labels.

For the aarch64/xilinx-zynqmp the support for starting in EL2/EL3 is
disabled by default.  For the Qemu xlnx-zcu102 machine, the default is
to start in non-secure EL1 mode.  This can be controlled by options, for
example "-machine xlnx-zcu102,secure=on,virtualization=on".
2024-10-11 01:27:44 +02:00
Sebastian Huber
dd3bc5bfb7 bsps: Remove superfluous include 2024-10-08 00:30:54 +02:00
Sebastian Huber
c388c3d19e bsps/arm: Add missing GICv3 distributor registers 2024-10-08 00:30:54 +02:00
Sebastian Huber
bd9f5c1eb0 Revert "build: Fix "set-value-enabled-by""
This reverts commit a616d26d6d.

The change was accidentally submitted and relates to a different branch.
2024-10-05 19:31:02 +00:00
Christian Mauderer
98f2ae3449 bsps/arm/beagle: Remove README.md and old script
The information from the README.md have been merged into the
documentation.

The necessary tools for the sdcard.sh are quite tricky to build. All
necessary information to create an SD image are in the documentation
already. So the script isn't necessary any more.

Update #5088
2024-10-05 19:29:15 +00:00
alessandronardin
d604ec899d posix/aio_misc.c: Added comment explaining coverity false positive.
Added comment in rtems_aio_handle() explaining why the Coverity
issue 1592927 is a false positive.
2024-10-05 19:28:27 +00:00
Kinsey Moore
85ccfe24bf bsps/aarch64/mmu: Align dynamically mapped blocks
Dynamically mapped blocks must be aligned to the MMU page size just like
startup-configured blocks. This was not being enforced and could cause a
hang with bad input.
2024-10-04 13:25:42 +00:00
Sebastian Huber
a616d26d6d build: Fix "set-value-enabled-by"
Fix Python error:

  File "wscript", line 1096, in _set_value_enabled_by
    if _is_enabled(conf.env.ENABLE, value_enabled_by["enabled-by"]):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: _is_enabled() missing 1 required positional argument: 'enabled_by'
2024-10-04 03:01:16 +02:00
Chris Johns
ea475e8719 waf: Update waf to version 2.1.2 2024-10-03 17:59:30 +00:00
Chris Johns
43e201e210 git: Remove auto* files from git ignore 2024-10-03 18:37:05 +10:00
Kinsey Moore
a9055cbf10 cpukit/aarch64: Fix spelling 2024-10-03 03:02:54 +00:00
Kinsey Moore
f80cee565b spec/libtests: Exclude Thumb-only BSPs from building dl13
This test requires ARM instruction support and causes build failures on
Thumb-only BSPs.
2024-10-03 02:03:09 +00:00
Sebastian Huber
410436b800 arm/xilinx-zynqmp-rpu: Use UART 0 by default
This simplifies the setup for sequential test runs of the APU and RPU
BSPs.
2024-10-02 05:36:00 +02:00
Sebastian Huber
9624b31408 arm/xilinx-zynqmp-rpu: Implement bsp_reset() 2024-10-02 05:36:00 +02:00
Sebastian Huber
95649a0aca arm/xilinx-zynqmp-rpu: Add section for the OCM 2024-10-02 05:36:00 +02:00
Sebastian Huber
75062c2dbf arm/xilinx-zynqmp-rpu: Simplify MPU configuration
Use the PMSAv7 support from <rtems/score/armv7-pmsa.h> instead of the
one from the Xilinx support.
2024-10-02 05:36:00 +02:00
Sebastian Huber
dddbdf4d9a arm/xilinx-zynqmp-rpu: Add split mode BSP variants
Rename xilinx_zynqmp_rpu BSP variant to zynqmp_rpu_lock_step to
emphasize that this BSP is for the lock-step mode RPU configuration.
Add BSP variants zynqmp_rpu_split_0 and zynqmp_rpu_split_1 for the split
mode RPU configuration for core 0 and 1 respectively.
2024-10-02 05:35:47 +02:00
Sebastian Huber
5f1a9d3346 arm/xilinx-zynqmp-rpu: Simplify startup
There is no need to copy sections since the linker command file has no separate
runtime and load regions for the sections.
2024-10-02 05:24:30 +02:00
Sebastian Huber
1b2ebe1516 arm/xilinx-zynqmp-rpu: Remove superfluous defines 2024-10-02 05:24:30 +02:00
Sebastian Huber
08f27b35aa arm/xilinx-zynqmp-rpu: Remove superfluous option 2024-10-02 05:24:30 +02:00
Sebastian Huber
a78d31de7f arm/xilinx-zynqmp-rpu: Fix file header and copyrights
Remove copyright from DornerWorks since the files contain not contributions
from this company.  Fix the copyright years of the embedded brains
contributions.
2024-10-02 05:24:30 +02:00
Sebastian Huber
c91b26ef76 arm/xilinx-zynqmp-rpu: Add cache manager support 2024-10-02 05:24:30 +02:00
Sebastian Huber
4515a7b593 arm/xilinx-zynqmp-rpu: Remove superfluous object 2024-10-02 05:24:30 +02:00
Sebastian Huber
7d9914b90e arm/xilinx-zynqmp-rpu: Use -O2 2024-10-02 05:24:30 +02:00
Sebastian Huber
c4a5dfeb5d arm/xilinx-zynqmp-rpu: Include standard header 2024-10-02 05:24:30 +02:00
Sebastian Huber
ddef4ed1b0 dev/irq: Conditionally enable GIC get/set group 2024-10-02 05:24:30 +02:00
Sebastian Huber
a947bba9df dev/irq: Add BSP_IRQ_HAVE_GET_SET_AFFINITY
Allow BSPs to provide the interrupt get/set affinity implementation even for
non-SMP configurations.
2024-10-02 05:24:30 +02:00
Sebastian Huber
2c2f9a1451 dev/irq: Add BSP_ARM_GIC_MULTI_PROCESSOR_SECONDARY
Add support for the BSP_ARM_GIC_MULTI_PROCESSOR_SECONDARY build option
for the GICv2 support.  This option is useful for multiprocessor systems
without SMP support.
2024-10-02 05:24:30 +02:00
Sebastian Huber
54c64352d5 bsps/arm: Add files to Doxygen group 2024-10-02 05:24:30 +02:00
Sebastian Huber
8c497f2693 bsps/shared/xil: Add files to Doxygen group 2024-10-02 05:24:30 +02:00
Sebastian Huber
559d90bb10 arm: Improve CPU_Exception_frame
Add a registers member to allow an indexed access to the registers.
2024-10-02 05:24:30 +02:00
Sebastian Huber
11b772c867 arm: Add support for PMSAv7 2024-10-02 05:24:30 +02:00
Sebastian Huber
9a5f00965b arm: Install missing header files 2024-10-02 05:24:30 +02:00
Sebastian Huber
5cc08c8f4c build: Add "set-value-enabled-by" build option action 2024-10-02 05:24:30 +02:00
Sebastian Huber
344526b3e4 build: Add "comment" build option action 2024-10-02 05:24:30 +02:00
Sebastian Huber
4ca49fc200 score: Remove _Per_CPU_State_wait_for_non_initial_state()
This function is unused.
2024-09-29 23:13:32 +00:00
Sebastian Huber
e2be5ac899 bsps/arm: Allow parallel start of processors
Do not wait in the individual _CPU_SMP_Start_processor() for the
secondary processor.  Wait for all of them in
_CPU_SMP_Finalize_initialization() before the L2 cache is enabled.
2024-09-29 23:13:32 +00:00
Sebastian Huber
276d2efb37 bsp/raspberrypi: Simplify SMP support
There is no need to wait for the secondary processor in
_CPU_SMP_Start_processor() since _CPU_SMP_Finalize_initialization() does
nothing.

The caller of _CPU_SMP_Start_processor() ensures that we do not start
the current processor.
2024-09-29 23:13:32 +00:00
Sebastian Huber
bbc87a471d bsps/aarch64: Simplify SMP support
Remove copy and paste from the arm SMP support.  The shared aarch64
implementation of rtems_cache_enable_data() does not enable a particular
cache, it just enables the C bit in the SCTLR_EL1.  This is already done
in aarch64_mmu_enable().  There is no need to wait for secondary
processors in _CPU_SMP_Start_processor().
2024-09-29 23:13:32 +00:00
Sebastian Huber
b0a688e69c bsps: Simplify _CPU_SMP_Finalize_initialization()
The processor count is always positive.
2024-09-29 23:13:32 +00:00
Sebastian Huber
d8822514e7 score: Add _SMP_Wait_for_ready_to_start_multitasking() 2024-09-29 23:13:32 +00:00
Sebastian Huber
296d7150f0 score: Set boot CPU properties before others
This allows other CPUs to figure out the boot CPU.
2024-09-29 23:13:32 +00:00
Sebastian Huber
7bd4725942 score: Use _Per_CPU_Get()
The _Per_CPU_Get() may be more efficient if
_CPU_Get_current_per_CPU_control() is available.
2024-09-29 23:13:32 +00:00
Alex White
38bafce42d Add aarch64 cpukit paravirtualization support 2024-09-27 20:01:34 +00:00
alessandronardin
653dbdcdbf posix/aio_misc.c: Added returns on error path in rtems_aio_init()
Coverity CID 1619695

Added returns on error path in rtems_aio_init().
Without them the code could access uninitialized memory.

Closes #5132.
2024-09-26 19:09:35 +02:00
alessandronardin
617808b979 posix/aio_misc.c/aio_init(): lock before accessing data
Coverity CID 1592924

added lock before accessing data.

Closes #5129.
2024-09-25 17:48:11 +00:00
alessandronardin
de196e0586 posix/aio_misc.c: changed malloc call into calloc
Coverity CID 1512510

Changed a call to malloc() into a call to calloc()
to avoid access to uninitialized memory.

Closes #5131.
2024-09-25 17:47:28 +00:00
Kinsey Moore
9eb23924e8 testsuites/sptree01: Fix missing prototype warning 2024-09-25 11:55:40 +00:00
Kinsey Moore
81930e2638 testsuites: Add dl13 test for Thumb to ARM transitions 2024-09-24 20:57:56 -05:00
Kinsey Moore
8f8d0c806b cpukit/libdl/arm: Add support for trailing Thumb to ARM calls
This expands the size of an ARM trampoline from 8 bytes to 10 bytes to
support THM_JUMP24 tail calls that require a BX instruction to change
modes.
2024-09-24 19:57:08 -05:00
Kinsey Moore
701e8b2d63 cpukit/libdl/arm: Obey instruction encoding requirements for Thumb BLX
Calls from Thumb code into ARM code require the use of a BLX instruction
and an optional offset prefix instruction. The BLX instruction encoding
requires that the least significant bit be 0 in all cases while the BL
instruction for Thumb-to-Thumb calls includes that bit as part of the
offset. This ensures that bit 0 of the BLX is set to 0 as required by
the instruction encoding specification.
2024-09-24 19:57:08 -05:00
Gedare Bloom
7cda579524 spec/build: make minimum sample norun 2024-09-24 14:53:02 -06:00
Sebastian Huber
6003ea9d94 aarch64: Add _AArch64_Get_current_processor_for_system_start()
This allows BSPs to customize how the current processor index is
determined during system start.

Update #5064.
2024-09-20 06:17:09 +02:00
Sebastian Huber
c311068a9e smpfatal08: Fix build for aarch64
Update #5064.
2024-09-20 06:17:09 +02:00
Kinsey Moore
3ec16d5f9d spec/aarch64: Add missing symbols to ILP32 linker script 2024-09-20 04:10:11 +00:00
zhengxiaojun
5e5214b786 bsp/aarch64:Fix _CPU_SMP_Get_current_processor()
Fix _CPU_SMP_Get_current_processor(), since read from register MPIDR_EL1
(the least significant byte) is not always right,for example the least
significant byte of MPIDR_EL1 is always zero for cortex-a55.

aarch64 has a thread ID register TPIDR_EL1 available for for OS management
purposes. RTEMS stores per-CPU control in TPIDR_EL1 when the core startup,
so we can use _Per_CPU_Get_index() to get current processor index.

update #5064
2024-09-19 19:15:10 +08:00
Ning Yang
1b5cd007e7 spec: Refactor arm-pl011 build options
Close #5026
2024-09-19 05:42:16 +00:00
Sebastian Huber
6482c5cc56 bsps/arm: Fix BSP_START_VECTOR_RESERVED_SLOT
The option value is a string.
2024-09-19 04:57:35 +02:00
Sebastian Huber
2aa921c3be validation: Fix synchronization issue 2024-09-19 04:35:20 +02:00
Sebastian Huber
518d27fa75 libtest: Fix format specifier
This fixes a ttest01 failure.
2024-09-19 04:34:55 +02:00
Sebastian Huber
1119981e7c tests: Enable ISR in fatal extensions
Fix code locations left over by commit
3332e54772.

Update #5067.
2024-09-19 04:34:38 +02:00
Sebastian Huber
1f52965f98 dev/serial: Fix uninitialized variable warnings
Use the reset values to get rid of uninitialized variable warnings.
2024-09-19 04:17:53 +02:00
Utkarsh Verma
0f42153959 dev/serial: Refactor the pl011 driver
- Refactor the pl011 driver to be extensible.
- Add IRQ support and baudrate configuration support for pl011 driver.
- Modify related BSP.
- Add doxygen comments for arm-pl011.

Close #5026

Co-authored-by: Ning Yang <yangn0@qq.com>
2024-09-18 19:30:21 +00:00
Sebastian Huber
d304a817db dev/serial: Move zynq_uart_input_clock()
This allows to wrap this function using the linker.
2024-09-17 01:53:58 +00:00
Sebastian Huber
3fe69b03a3 dev/serial: Optimize Zynq UART control reg writes
Just disable RX/TX to start the initialization sequence.  Do not double
disable RX/TX.  Enable RX/TX after the mode is set.
2024-09-17 01:53:58 +00:00
Sebastian Huber
ff9b19ad7c dev/serial: Rework Zynq UART baud calculation
Calculate the best approximation for the desired baud and return the
error.
2024-09-17 01:53:58 +00:00
Sebastian Huber
6efbf0c7b8 dev/serial: Rework Zynq UART Doxygen groups 2024-09-17 01:53:58 +00:00
Sebastian Huber
cf47b09c6a doxygen: Add console drivers group 2024-09-17 01:53:58 +00:00
Sebastian Huber
5d8d55a1cd dev/serial: Simplify zynq_uart_reset_tx_flush()
Load the status register only once.  Use _IO_Relax() to reduce bus
traffic while waiting and simplify testing.
2024-09-17 01:53:58 +00:00
Sebastian Huber
6757607199 dev/serial: Do not output '\r' during reset
It is not clear why this is necessary.  For example, the
zynq_uart_initialize() does not issue the '\r' before waiting for an
inactive transmission state.
2024-09-17 01:53:58 +00:00
Sebastian Huber
a078b091c1 dev/serial: Use _IO_Relax()
This reduces the system bus load while waiting for a state change.  In
addition, it simplifies testing by using a wrapped _IO_Relax().
2024-09-17 01:53:58 +00:00
Adrien Chardon
7be49773c0 bsps/shared/zynq-uart-polled: fix bug in zynq_uart_initialize()
Similar to the recent commit in tms570-sci.c, the assumption that a UART will
only see printable ASCII characters, instead of any value in the range
0x00-0xFF, is wrong.

A non forgiving binary protocol will be thrown off by this driver sending
"\r\r\r\r" when initializing.

If a user wants to flush the interface, they should explicitely use the
dedicated function `tcflush(fd, TCIOFLUSH);`.
2024-09-17 01:53:58 +00:00
alessandronardin
333a1aee2b posix/aio_misc-c/rtems_aio_completed_list_op(): Path with no lock release.
Coverity CID 1619144

In rtems_aio_completed_list_op() memory was getting freed without releasing
a lock.

This commit should also solve coverity issues 1619145, 1619143 and 1619142
since they all seem to be generated by rtems_aio_completed_list_op().

Closes #5127
2024-09-14 11:46:56 +02:00
zhengxiaojun
29a0d99bfd cpukit/libmisc/shell:fix command df overflow
- change type unsigned to uint64_t, it might overflowed if
    the size is greater the 4GB.
  - increase buffer size is to eliminate the compiler's warning
    that the buffer might be too small
2024-09-13 21:30:43 +00:00
alessandronardin
31c91be2ea posix/aio: updated documentation after changes to lio_listio()
updated the doxygen comment in aio.h
updated the description in spec/build/cpukit/optposix.yml
2024-09-13 21:30:02 +00:00
Christian Mauderer
3edf2bd579 bsps/arm/atsam: Remove README.md
Migrated to the rtems-docs repository.

Updates #5088
2024-09-13 20:55:15 +00:00
Mohamed Hassan
e91c136f67 libmisc/stackchk: fix Doxygen file comment
revert back to the original RTEMS Doxygen guidelines by adding @file and @ingroup
2024-09-13 00:56:13 +00:00
Sebastian Huber
ce1fb41a6c kvprintf(): Fix '+' conversion handling
For example, printf("%+i", 1) prints "+1".  However, kvprintf() did
print just "1" for this example.  According to PRINTF(3):

  A sign must always be placed before a number produced by a signed
  conversion.

For "%+r" radix conversions, keep the "+" handling as it is, since this
is a non-standard conversion.  For "%+p" pointer conversions, continue
to ignore the sign modifier to be in line with libc.

This change allows to support the ' conversion modifier in the future.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1310
2024-09-12 23:34:28 +00:00
Sebastian Huber
48618b1060 ntptime: Use time_t for tv_sec related variables
The struct timespec tv_sec member is of type time_t.  Make sure that all
variables related to this member are of the type time_t.  This is important for
targets where long is a 32-bit type and time_t a 64-bit type.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1373
2024-09-12 17:26:27 +00:00
Joel Sherrill
9d6f171039 bsps/i386/include/bsp/irq.h is pc386 specific
The IRQ list in this file are specific to PC hardware and should be
part of the BSP. Further, there are paravirtualized environments which
do not follow the PC hardware IRQ list. Moving this avoids collisions.
2024-09-12 04:58:14 +00:00
Joel Sherrill
3aa1f1faee poll.h and sys/poll.h were in both RTEMS and Newlib
Remove the copies in RTEMS. Most POSIX headers are in Newlib.

CLoses #5126
2024-09-12 04:57:43 +00:00
Sebastian Huber
a9bff015f6 stackchk: Avoid implementation header in API
Update #5047.
2024-09-12 02:26:15 +00:00
Sebastian Huber
4abed2b422 stackchk: Fix Doxygen file comment
Update #5047.
2024-09-12 02:26:15 +00:00
Sebastian Huber
5b1c17f85a confdefs: Fix extensions.h
Resurrect proper file comment.  Order copyrights according to template.  Remove
white space at the end of line.  Do error checks early.  Define objects under
optional extern "C".

Update #5047.
2024-09-12 02:26:15 +00:00
alessandronardin
d670dafaa4 posix/lio_listio.c: corrected return when RTEMS_POSIX_API is undefined
Modified the body of lio_listio(), to make sure it return -1 and sets
errno to ENOSYS, when RTEMS_POSIX_API is not defined.

The psxenosys test has been modified to test for lio_listio() only
when RTEMS_POSIX_API is not defined. In the test all the puts() have
been removed. If kept they would have made the output of the test depending
on the build configuration, making the content of psxenosys.scn inconsistent.
Removing the puts() makes the .scn file valid regardless of the build
configuration.

Additionally, rtems_aio_notify() in aio_misc.c has been modified,
simplifying it and reducing the part inside the ifdef.

Closes #5125
2024-09-10 08:41:53 +02:00
Joel Sherrill
fe6b7bc3cb score/cpu/arm/cpu.c: Fine tune paravirtualization for interrupt set/get level 2024-09-10 02:45:07 +00:00
Joel Sherrill
f075fa55cd spmsgq_err[12]: Add message sizes to configuration
The test had hard-coded numbers for maximum messages and message sizes.
As a result, it did not configure the memory required for message
storage.
2024-09-09 18:49:49 -05:00
Kinsey Moore
6dee307542 bsps/stm32h7: Add SPI support
This adds support for the 6 SPI interfaces on the STM32H7 series chips
with an initial example for the stm32h750b discovery kit development
board. Configuration is similar to existing peripherals. Chip select
lines are software-controlled since the SPI peripheral only supports a
single hardware-controlled chip select line. This implementation does
not use interrupts.
2024-09-06 01:15:21 +00:00
Kinsey Moore
bcf0cee545 cpukit/stackchk: Explicitly cast from void* to uintptr_t 2024-09-06 01:15:21 +00:00
Kinsey Moore
243f88992f bsps/arm/irq: Avoid array comparison
This removes the array comparison warning by explicitly taking the
address of the arrays.
2024-09-06 01:15:21 +00:00
Kinsey Moore
5b13baf96a bsps/stm32h7: Resolve HAL const warning
HAL init functions take a non-const reference parameter. Explicitly cast
away the constness to remove the warning.
2024-09-06 01:15:21 +00:00
Kinsey Moore
31d2a2acb1 bsps/stm32h7: Resolve warning due to missing prototype 2024-09-06 01:15:21 +00:00
alessandronardin
acd2a24d64 cpukit/posix/src/aio_misc.c: Fix for illegal memory access.
CID 1618881:  Memory - illegal accesses  (USE_AFTER_FREE)
2024-09-05 23:13:25 +00:00
Karel Gardas
f61086a404 Revert "bsps/stm32h7: Workaround STM32 H7 errata by enforcing aligned access only"
This reverts commit d81bf04501.

The commit is reverted as this is only partial solution and remaining part
to fix properly is extremely hard and usually done in completely diffetrent
way. Hence let's not enforce compiler but rather enforce RTEMS/H7 users.
2024-09-03 00:39:54 +00:00
alessandronardin
1b6684ee2b cpukit/posix/aio*: Added support for lio_listio()
This commit adds support for lio_listio().
psxaio05 has been added to test the new method.
To avoid code duplication, the body of aio_read and aio_write has been
moved in two helper methods. In this way i can use it also in lio_listio().

In addition to that, a limit on the number of total aio operation enqueued
has been added.

Updates rtems/programs/gsoc#29
2024-09-02 18:16:30 +02:00
Kinsey Moore
ad51286e2b cpukit/stackchk: Remove additional offset of SANITY_PATTERN_SIZE_WORDS
This offset is already accounted for by Stack_check_Usable_stack_start()
called from Stack_check_Visit_stack() and adding it a second time can
cause interaction beyond the bounds of the stack.
2024-08-28 13:42:37 +00:00
Sebastian Huber
cb0a530503 arm: Fix FIQ default handler
Save the registers of the previous context and not the banked registers
of the FIQ mode.
2024-08-28 04:19:40 +02:00
Sebastian Huber
2598428809 arm: Add _CPU_Exception_resume() 2024-08-28 04:19:39 +02:00
Sebastian Huber
5f75cbaa74 arm: Fix system call default exception handler 2024-08-28 04:19:39 +02:00
Sebastian Huber
eb8a39e115 arm: Simplify default exception handling
Writes to the execution state bits of the CPSR through MRS instructions
are ignored.
2024-08-28 04:19:39 +02:00
Sebastian Huber
7915631552 arm: Simplify default exception handling
Do not clear the VFP context pointer twice.
2024-08-28 04:19:39 +02:00
Sebastian Huber
5d86677dfe bsps/arm: Add BSP_START_VECTOR_RESERVED_SLOT
Allow BSPs to customize the reserved vector table slot.  By default, use
an undefined instruction.
2024-08-28 04:19:39 +02:00
Sebastian Huber
2174ec336a arm: Remove _ARMV4_Exception_reserved_default()
The default exception handler uses the Save Program Status Register
(SPSR), however, if _ARMV4_Exception_reserved_default() would get
called, the state of this register is unpredictable.  Replace potential
calls to _ARMV4_Exception_reserved_default() with an undefined
instruction.
2024-08-28 04:19:39 +02:00
Sebastian Huber
ea0e89b9a0 arm: Remove unused _ARMV4_Exception_irq_default() 2024-08-28 04:19:39 +02:00
Sebastian Huber
bd48d10b4e arm: Mark _ARM_Exception_default() as no return
Remove dead code.
2024-08-28 04:19:39 +02:00
Sebastian Huber
1d5149e392 arm: Do not alter saved PSR in default FIQ handler
Make sure we save the real PSR of the previous context to the exception
frame.
2024-08-28 04:19:39 +02:00
Sebastian Huber
0f55591fd6 bsps: Option BSP_ARM_GIC_ENABLE_FIQ_FOR_GROUP_0
Add BSP option BSP_ARM_GIC_ENABLE_FIQ_FOR_GROUP_0 to customize the ARM
GIC support.  Enable this option for arm/altera-cyclone-v and
arm/xilinx-zynq BSPs by default.
2024-08-28 04:19:39 +02:00
Sebastian Huber
3a7dd0be37 dev/irq: Do not enable FIQ by default
The default FIQ handler terminates the system.  Delegate the FIQ
enabling to the place which installs a proper FIQ handler.
2024-08-28 04:19:39 +02:00
Sebastian Huber
4bcfe04e27 build: Use shared object item for ARM GIC
BSPs which do not use the ARM GIC no longer install the related header
files.
2024-08-28 04:19:38 +02:00
Joel Sherrill
3cb090e341 aio_fsync.c: Use calloc() to ensure memory is initialized
Coverity CID 1512532

Closes #5102.
2024-08-27 23:55:36 +00:00
Christian Mauderer
3b053f6919 bsps/shared: Add Abracom EOZ9 RTC driver
The EOZ9 RTC has a similar register interface like the MCP7940M (and
quite some other I2C RTCs). This commit:

* Extracts the generic parts from MCP7940M and moves it into a generic
  i2c-rtc driver.
* Uses the new i2c-rtc for the MCP7940M.
* Uses the new i2c-rtc for the new Abracom EOZ9.
2024-08-27 21:54:43 +00:00
Matheus Pecoraro
acf7c725ca x86_64: Add TLS support 2024-08-27 21:20:48 +00:00
Matheus Pecoraro
77850f9f04 x86_64/amd64: Add issues to TODO comments 2024-08-27 21:16:58 +00:00
Matheus Pecoraro
018e7ad407 x86_64: x86_64 port doxygen and license cleanup 2024-08-27 21:16:58 +00:00
Matheus Pecoraro
e93bbe6534 x86_64/amd64: Add SMP support
Adds SMP support for the x86_64 amd64 BSP.
2024-08-27 21:16:58 +00:00
Kinsey Moore
43a581c712 spec/zynqmp: Install ECC header definitions
This needs to be installed for applications to make use of ECC
functionality.
2024-08-27 14:09:56 -05:00
Chris Johns
94443d497b bsp/aarch64/zynqmp: Add support for more than 2G of DDR memory
Add support to configure the second region of DDR memory if the
BSP configured RAM size is greater than 2G.

Add the second region's memory to the heap.
2024-08-27 15:00:09 +10:00
Amar Takhar
07728e0913 Rename COPYING to LICENSE.md
This follows current conventions.

Two have been left behind for now until we decide what to do as they are
imports.

  * cpukit/compression/xz/COPYING
  * cpukit/libmisc/uuid/COPYING
2024-08-23 20:58:25 +00:00
Loris Nardo
b5767d2c60 jffs2: Add checks for long file name
Add filename length checks to prevent the creation of files and folders
that cannot be listed, unlinked or renamed by subsequent calls.
These changes are sufficient to make the jffs2fsrenamelongname and
jffs2nandfsrenamelongname testcases pass.

Updates #5073
2024-08-23 20:28:23 +00:00
Kinsey Moore
c2b3a517f6 bsps/stm32h7: Honor the intent of the MPU alignment option
Currently, if a BSP is built without MPU alignment enforcement, the MPU
is still enabled and can produce a non-functional binary since code can
be mixed with data within a memory region and memory regions are marked
as read-only or no-execute based on section addresses and sizes leading
to overlapping regions being defined which causes the later-defined
region to take precedence. This change disables the MPU when alignment
is not enforced, allowing the binary to function.
2024-08-23 17:20:40 +00:00
Sebastian Huber
3332e54772 score: Disable ISR for fatal extensions
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
e81a5db70e score: Remove unused _CPU_Fatal_halt()
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
e80883b406 score: Simplify _Terminate()
In _Terminate(), everything after invoking the fatal extensions is essentially
dead code.  Simplify this code block and provide a reasonable safe fall-back
for badly configured applications.  Just disable masked interrupts and execute
an idle loop.

Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
e2ce9d426a score: Mark _CPU_Thread_Idle_body() as no-return
This helps the compiler to not generate dead code.

Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
cd748d5f6b nios2: Use higher level error handling
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
5cc04d5419 bsps: Simplify build
All BSPs use the default fatal extension.

Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
9b7d36c6db bsp/mcf5225x: Remove unused file
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
450f0d7e90 bsp/mrm332: Remove unused file
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
2128201616 bsp/niagara: Use default fatal extension
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
2bb8ce9741 bsps/sparc: Use default fatal extension
Provide bsp_reset() through the sparc CPU port.

Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
ca96857962 bsp/virtex5: Use default fatal extension
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
c88feda145 bsp/virtex4: Use default fatal extension
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
5ea022ff12 bsps/riscv: Provide bsp_reset()
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
002c6067ba bsps: Add fatal source/code to bsp_reset()
Mark bsp_reset() as no-return.  Use default BSP fatal handler in lm32 and m68k
BSPs.  Remove empty bsp_reset() implementation.

Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
aeae283541 bsp/mvme5500: Use default fatal extension
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
be9f339420 bsp/beatnik: Use default fatal extension
Update #5067.
2024-08-23 14:54:37 +00:00
Sebastian Huber
755474b78a bsp/altera-cyclone-v: Use default fatal extension
Update #5067.
2024-08-23 14:54:37 +00:00
shuhua hua
991b3b1695 Unify the parameters in the function declaration 2024-08-20 06:40:46 +00:00
Loris Nardo
606584d032 msdos: Fix file truncated to 0
Previously the first cluster of the file was not updated when
truncating to 0 but was in any case freed.
Now the first cluster of the file is updated during the truncation,
leaving the directory entry in a consistent state.

Closes #2757
2024-08-15 15:42:26 +00:00
Kinsey Moore
73918bc788 cpukit/libblock: Close all valid FDs
This is intended to close any valid FDs that were opened, but 0 is also
a valid FD. This change ensures that a FD of 0 is also closed properly.

Coverity CID 1467408 (original)

Coverity CID 1616151 (followup)

off_by_one: Testing whether handle fd is strictly greater than zero is
suspicious. fd leaks when it is zero.
2024-08-12 13:21:09 -05:00
Karel Gardas
d81bf04501 bsps/stm32h7: Workaround STM32 H7 errata by enforcing aligned access only
The patch changes compiler ABI flags option and adds -mno-unaligned-access
there. Usage of this option is also officially recommended way
by the errata document how to work around the issue. For more details
about the errata please see referenced issue number.

Closes #5110.
2024-08-11 22:43:39 +00:00
Loris Nardo
9c57576a4b open: Fix race condition when called with O_TRUNC
Fix a race condition in which a file opened with O_TRUNC is made
available to other file functions expecting a file descriptor before
the truncation is performed.

This is only possible if the other thread was using an invalid file
descriptor as the open call has yet to finish.

Closes #5109
2024-08-11 18:58:20 +00:00
Matheus Pecoraro
7440264601 amd64: Move APIC implementation out of clock.c
- Move the APIC implementation to its on file instead of having it in clock.c;
- Use the MADT for retrieving the Local APIC base address;
- Initialize the APIC during interrupt initialization.
2024-08-11 07:38:35 +00:00
Matheus Pecoraro
0665da8f1d amd64: Allow early ACPICA table subsystem init
Add a method for initializing the ACPICA table subsystem earlier than
the initilization of the entire ACPICA subsystem. Also add a method to
walk through the subtables of an ACPI table
2024-08-11 07:38:35 +00:00
Joel Sherrill
f920b6f1e4 cpukit/score/src/kern_ntptime.c: Use time_t not a 32-bit type
A time_t (tv_sec) was being assigned to a 32-bit variable. This
introduced a Y2038 issue.

Coverity CID 1512505

Closes #5111.
2024-08-11 02:31:27 +00:00
Joel Sherrill
5e6d7dca8f libblock/src/bdpart-register.c: Do not pass bad value to close()
Coverity CID 1467408

close() was called and fd can potentially be negative.

Closes #5113.
2024-08-11 02:30:19 +00:00
Ning Yang
447f767abc aarch64/raspberrypi: Add Watchdog Timer driver 2024-08-11 02:08:51 +00:00
Joel Sherrill
a51b7d4b57 objectinitializeinformation.c: Add Assert for API index too high
Coverity Scan spotted the possibility that the
_Objects_Information_table could be over-indexed if the API
value provided was too high. This function is only used during
initialization and the input should be trusted. Adding a debug
_Assert() emphasizes this trust.

Coverity CID 1512508

Closes #5084.
2024-08-11 01:31:01 +00:00
zak liang
4337300649 lashdisk.c: Invalid printf format string 2024-08-10 17:16:39 -04:00
Karel Gardas
e8172c8651 bsps/stm32h7: Fix typo causing crash on USB 2 initialization
There is certainly no USB 20 TG while there is a known USB 2 OTG tech. The
crash caused by this is well observed from media01.exe from libbsd compiled
for H7 and run on the board.
2024-08-09 14:28:40 +00:00
Amar Takhar
5eaf65953c bsps: Convert README and other file to MarkDown
These were missed in the last pass.
2024-08-08 23:31:51 +00:00
Sebastian Huber
89002394dd bsp/gen5200: Add section for GDB pretty-printing 2024-08-08 05:37:16 +02:00
zhengxiaojun
3211cba9f9 bbsps/shared/arm-gicv3: Calculate cpu_count correctly
cpu_count should be increased before exit condition.
2024-08-08 01:55:25 +00:00
Chris Johns
cc34558448 libdebugger/powerpc: Add PowerPC support
Closes #5098
2024-08-07 05:09:38 +00:00
Chris Johns
53a62631ac libdebugger/target: Add support for backend code writters
The call lets backends support special methods of writing code.

Updates #5098
2024-08-07 05:09:38 +00:00
Chris Johns
6a367f4689 libdebugger/target: Move global stepping variables in to the target data
Updates #5098
2024-08-07 05:09:38 +00:00
Joel Sherrill
f29986391d aio_fsync.c: Address Coverity dead code issue
Coverity CID 1616018

O_SYNC and O_DSYNC have the same value which led Coverity to note that
checking for both values in if's or switches leads to dead code. The
solution is to add a cpp check that they are equal and enough commentary
so if they ever are not the same, there is a hint as to why the cpp
check got tripped.

Closes #5100.
2024-08-07 03:05:50 +00:00
Kinsey Moore
8611d3d91f bsps/aarch64: Homogenize ZynqMP ECC info structs
This fixes the ECC info struct naming such that they all use the _Info
suffix. This also adds comments describing which structures are paired
with which event types.
2024-08-07 02:50:22 +00:00
Joel Sherrill
5580f70bbd disp_hmsc29xx.c: Address Coverity flagged negative shift
Coverity CID 1512508

Closes #5084.
2024-08-07 02:46:57 +00:00
Matheus Pecoraro
02a8935698 ACPICA: Add file for chosen ACPICA license 2024-08-06 21:28:15 +00:00
Matheus Pecoraro
bb950bd770 x86_64/amd64: ACPI support for the AMD64 BSP
- Implements necessary ACPICA OS Services Layer interfaces;
- Retrieve the RSDP from the FreeBSD Bootloader for amd64 or from multiboot2 for amd64efi;
- Add ACPI initialization routine;
- Use ACPI in bsp_reset.
2024-08-06 21:28:15 +00:00
Matheus Pecoraro
bd12e6f0af bsps/acpi: Shared ACPICA OSL methods and spec file
Add an implementation for port independent ACPICA OS Services Layer
methods and objacpi.yml spec file.
2024-08-06 21:28:15 +00:00
Matheus Pecoraro
c4bae407fc ACPICA: Add acrtems.h include in acenv.h
Add an include to acrtems.h in acenv.h so BSPs may provide their own
ACPICA defines and configurations
2024-08-06 21:28:15 +00:00
Matheus Pecoraro
5d6094c42c ACPICA: Initial ACPICA code import
ACPICA commit a8b050df914875839b717a51e1b32d6c6b86ae96
2024-08-06 21:28:15 +00:00
Mohamed Hassan
6ab27bb54e libtests/stackchk04: Add a new testsuite for the detailed reporter
Now as the default reporter is set to be a quiet reporter, we have stackchk test case for the default quiet reporter, stackchk03 for a custom user-defined reporter and stackchk04 for the detailed reporter function
2024-08-06 22:40:12 +03:00
Ning Yang
8f0c0bc379 aarch64/raspberrypi: Add SPI support
- Standard SPI master mode.
- Polling mode.
- Interrupt mode.

Close #5056
2024-08-05 22:45:42 +00:00
Karel Gardas
cb78150d86 bsps/stm32h7: update STM32 H7 HAL
This patch updates STM32 H7 HAL source files. The files are taken from two
STM projects from their github.com repositories:

(i)
https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git

The project files are still available under BSD-3 license
and the version/commit used is:

fec141ce999da655a48e1a15db83a72d564a1312

which represents Release v1.11.3 exactly.

(ii)
https://github.com/STMicroelectronics/cmsis_device_h7.git

The project files are available under Apache 2.0 license. Fortunately
the project does not contain NOTICE file so no need to do anything special
when used in RTEMS.

The project version/commit imported is:

faccfec37f82f7a1319c21638111b0f7335de7fe

which represents Release v1.10.4 exactly.
2024-08-05 22:42:52 +00:00
Joel Sherrill
7109dfdea1 bsps/m68k/uC5282/README.md: Delete timing results
Closes #5096.
2024-08-05 22:00:58 +00:00
Amar Takhar
83b380efc5 Add @docs group as approvers for docs under @arch
GitLab requires explicit exclusions and unfortunately it's one per line while it
does look gross it is clearer to read what's going on.

Also clean up some spacing.
2024-08-05 17:59:50 -04:00
Amar Takhar
81e81d1650 Convert LICENSE to LICENSE.md
This also fixes one spelling mistake:

  jffs2/src/LICENCE -> jffs2/src/LICENSE.md
2024-08-05 21:43:36 +00:00
Aaron Nyholm
1fd373a286 spec/arm/zynq: Set default UART on Microzed to UART1 2024-08-05 21:42:01 +00:00
Amar Takhar
a5370d1870 bsps: Fold various files into README.md 2024-08-05 21:41:15 +00:00
Amar Takhar
020681779d cpukit/libcsupport: merge TODO and CASES into README 2024-08-05 21:40:57 +00:00
Amar Takhar
fd49184934 bsps/sh/gensh2: Fold README.EVB7045F into README.md 2024-08-05 21:40:40 +00:00
Amar Takhar
28180a1fa9 bsps: Convert README to MarkDown 2024-08-05 21:37:42 +00:00
Amar Takhar
3139d38137 cpukit: Convert cpukit/*/README to MarkDown
There are a lot of README files this is just a cursory glance to convert but
will render fine online.  If they don't we can make changes.
2024-08-05 21:37:12 +00:00
the-m3chanic
e13236123c cpukit/sapi/src: fixed grammar mistake in comment in exinit.c 2024-08-05 21:29:58 +00:00
the-m3chanic
362deb38dc cpukit/sapi/src: removed macro, made asm() global at file scope and changed python script being loaded 2024-08-05 21:29:58 +00:00
the-m3chanic
c76f41afd3 linker scripts: some more formatting changes (tab --> space) 2024-08-05 21:29:58 +00:00
the-m3chanic
0c6b1f1184 linker scripts: fixed formatting - replaced tab with 2 spaces 2024-08-05 21:29:58 +00:00
the-m3chanic
79d5f22b5a lm32: modified linker scripts for gdb-inlined script support 2024-08-05 21:29:58 +00:00
the-m3chanic
39a2ad6232 bfin: modified linker scripts for all BSPs for gdb-inlined script support 2024-08-05 21:29:58 +00:00
the-m3chanic
56158c1cb4 m68k: modified BSP specific linker scripts 2024-08-05 21:29:58 +00:00
the-m3chanic
53c2dc6b7a or1k: modified linkcmds.base to add gdb-inlined script support 2024-08-05 21:29:58 +00:00
the-m3chanic
aea2f38500 mips: modified linker script files for gdb-inlined script support 2024-08-05 21:29:58 +00:00
the-m3chanic
fad8219a4e cpukit/sapi/src: added DEFINE_GDB_PY macro to exinit.c to embed gdb-inline section 2024-08-05 21:29:58 +00:00
the-m3chanic
5fa414f37a moxie: modified linkcmds for gdb-inlined script support 2024-08-05 21:29:58 +00:00
the-m3chanic
57ed8e5f31 x86_64: modified linkcmds for gdb-inlined script support 2024-08-05 21:29:58 +00:00
the-m3chanic
8276f817cf sh: modified linkcmds for all BSPs for gdb-inlined script support 2024-08-05 21:29:58 +00:00
the-m3chanic
a148c94c73 riscv: modified linkcmdsbase.yml to add new section for gdb-inlined script 2024-08-05 21:29:58 +00:00
the-m3chanic
51241988ac sparc64: modified linkcmds to add new section for GDB pretty-printing 2024-08-05 21:29:58 +00:00
the-m3chanic
065155b421 sparc: modified linkcmds.base to add new section for GDB pretty-printing 2024-08-05 21:29:58 +00:00
the-m3chanic
a9b39c800c powerpc: modified linkcmds.base to add new section for GDB pretty-printing 2024-08-05 21:29:58 +00:00
the-m3chanic
2ba6a3bbda m68k: modified linkcmds.base to add new section for GDB pretty-printing 2024-08-05 21:29:58 +00:00
the-m3chanic
9f559735c1 arm: modified linkcmds.base to add new section for GDB pretty-printing 2024-08-05 21:29:58 +00:00
the-m3chanic
489ef84549 aarch64: modified linkcmds.base to add new section for GDB pretty-printing 2024-08-05 21:29:58 +00:00
the-m3chanic
a54f06b678 arm: modified linkcmds.base to add new section for gdb-inlined script 2024-08-05 21:29:58 +00:00
Karel Gardas
a69269da7d make: Fix waf install of README.md 2024-08-05 14:10:19 +02:00
Loris Nardo
44d1710649 testsuites: Update list of excluded testcases for targets without JFFS2 and RFS
Update the list of testcases that should not be compiled for targets that explicitly do not compile JFFS2 and RFS testcases

Closes #5097
2024-08-05 07:13:02 +02:00
Amar Takhar
55a0356d7c cpukit: Convert files to README.md MarkDown 2024-08-02 21:43:39 +00:00
Amar Takhar
9b4ac0aa64 bsps: Fold external documentation into README.md 2024-08-02 21:21:42 +00:00
Amar Takhar
cfdd40935d testsuites/benchmarks/dhrystone: Convert documents to single README.md 2024-08-02 21:19:11 +00:00
Amar Takhar
52a9fdec5c Convert various files to README.md MarkDown 2024-08-02 21:13:35 +00:00
Amar Takhar
f16de5fae9 rtc: Convert STATUS and README.* to MarkDown 2024-08-02 21:07:27 +00:00
Loris Nardo
bd7e02d96b testsuites: Fix fstests/fsrmdirparent testcase
The testcase failed because the rmdir call in that case had two possibilities to fail and the implementation of rmdir checked the other possibility first.

Closes #5071
2024-08-02 20:58:33 +00:00
Amar Takhar
4c3d505811 testsuites: Convert */README to MarkDown 2024-08-02 20:43:00 +00:00
Amar Takhar
e8e099d5f8 testsuites: Convert README to MarkDown
This also merges PROBLEMS and README.testdata into a single README so it
displays nicely in the parent directory.
2024-08-02 20:39:13 +00:00
Amar Takhar
1b430bdff8 Remove ACKNOWLEDGEMENTS file.
This file is ancient and there have been many, many contributors to RTEMS that
deserve equal acknowledgement.

I have opened an issue to create a new contributrors section in the
documentation in the docs projects:

  * rtems/docs/rtems-docs#21

I have linked this version of the file there but this file should not ship with
the next version of RTEMS given the GitLab migration it will not be converted to
MarkDown
2024-08-02 20:31:39 +00:00
Amar Takhar
a661cb7a34 make: Convert README to MarkDown 2024-08-02 20:28:50 +00:00
Amar Takhar
a7f2cb4562 Convert bsps/*/README to MarkDown
Some of this content is really old we will have to go through it.
2024-08-02 20:21:38 +00:00
alessandronardin
adce380138 cpukit/posix/aio*: added support for O_DSYNC
The aio_fsync function now supports the value O_DSYNC for op.
Tests are added to improve coverage and test new features.

Closes #5040.
2024-08-02 20:02:58 +00:00
Mohamed Hassan
dc123bb828 libmisc/stackchk: Add configurability to the stack checker reporting function 2024-08-02 20:00:20 +00:00
shuhua huang
a0eecb52bc fix system fatal error caused by imperfect user input commands, e.g. "rtl sym -u" 2024-08-02 05:54:12 +00:00
Joel Sherrill
30ae3ef9da Revert "objectgetinfo.c: Add test case for API field too high"
This reverts commit 807070a696
2024-07-30 20:33:18 +00:00
Amar Takhar
4c2e5ad988 bsps: Convert README to MarkDown 2024-07-29 13:07:51 -04:00
Joel Sherrill
807070a696 objectgetinfo.c: Add test case for API field too high
This was spotted by Coverity as CID 1592935.

Closes #5076.
2024-07-27 10:29:05 -05:00
Amar Takhar
0bd9737e58 Move old devel links to GitLab 2024-07-26 21:37:42 +00:00
Amar Takhar
2ba94118a0 Remove MAINTAINERS file
This file is now obsolete now that we have moved to GitLab.  A ticket has been
opened in rtems/docs/rtems-docs#21 to discuss adding a contributors section.

GitLab lists who the 'Code Owners' are on top of every file in the web source
browser this is the canonical way to find out who maintainers are of those files
or directories.

Even with knowing who the maintainers are the best way to figure out who is
looking after what is to open an issue or an MR.  This way we can keep a group
level of maintainership over the code base and have CODEOWNERS enforce approvals
before merging.
2024-07-26 20:22:58 +00:00
Amar Takhar
9dce0426d4 Remove INSTALL file.
All this does is points to the README.  The README points to the docs website as
it should.

INSTALL files are falling out of favour since sites show README.* by default
over an INSTALL file.
2024-07-26 20:17:41 +00:00
Loris Nardo
b354087338 getdents: hold the IOP while performing the operation
As all the other functions about file descriptor, getdents should hold the IOP of the file descriptor it is working on.

Closes #5074
2024-07-26 20:01:40 +00:00
Amar Takhar
5c5ccbcc57 Remove errant URL.
Not sure what this is doing here found it during !134  Since there is nowhere to
point it to remove it.
2024-07-26 19:54:02 +00:00
Amar Takhar
84b56d69da Remove Makefile.maint
This file has not been relevant in at least 8 years and even then only for
texinfo?  The file calls itself Experimental and relies on CVS.  It was used for
cutting old RTEMS releases.
2024-07-26 19:49:16 +00:00
Amar Takhar
de8452e32c Update Doxygen to point to GitLab.
These are git.rtems.org links.

Point to LICENSE.md directly it has a TOC now the licenses can be found without
anchors and less to maintain.
2024-07-26 14:25:58 -04:00
Amar Takhar
8fd3ed26e7 Convert licenses to a single LICENSE.md file.
Merge all licenses into one large file with a TOC.  This way we can link to one
file and not have to worry about having many files everywhere.

The original licenses have been copied in without modification though it will
render differently online.
2024-07-25 23:24:33 +00:00
Loris Nardo
07bd3871ab testsuites: Allow finer control on the fstest result
Changed fstest support to allow control on the test result of each fstest, updated all fstest accordingly.
Modified FS_FAIL macro to fail hard and not just print a message which rtems-test runner ignores.
Split failing test cases from the ones that passes; added fsrenameexisting, fsrenamepermexisting, fsrmdirparent, fsrenamelongname and fsrenamemaxlinks test cases.

Marked fsrenameexisting, fsrenamepermexisting as expected to fail due to #2169.
Marked fsrmdirparent as expected to fail, covered by #5071.
Marked fssymlink as expected to fail due to rename problems partially covered by #2169.
Marked rfsfsrenamelongname as expected to fail, covered by #5069.
Marked *fsrenamemaxlinks as expected to fail, covered by #5070.
Marked jffs2fsrenamelongname and jffs2nandfsrenamelongname as expected to fail, as JFFS2 seems to not have a limit on the file name, covered by #5073
2024-07-25 22:09:17 +02:00
Loris Nardo
d7d1bec401 testsuites: Move some testcases of fsrename into fspermission and fssymlink so that fsrename can be used also for FAT filesystem 2024-07-25 18:22:46 +00:00
Loris Nardo
a558c96c64 msdos: update inode during rename
rename now actively changes the inode of the file being renamed.
This change has been done to fix an issue when the file being renamed is already opened before the rename, in particular failing to update the inode number (and the two lookup tables) could cause at least two problems:
1) A new file created in the same source folder of the file being renamed may get the same fat file descriptor of the renamed file
2) An open to the renamed file opens a new fat file descriptor, thus putting out of sync the operations on the file (two distinct fat file descriptor working on the same clusters and entries)

Previously the inode was in any case changed once the file was closed.

Another possible solution would have been to separate the inode number from the lookup table, but this solution would have required much more memory because it needed to keep track of all files seen in the file system up to the last operation and not only the opened ones.

Closes #5044
2024-07-25 18:22:46 +00:00
alessandronardin
1fe3d396d3 cpukit/posix/src/aio_misc.c: Fix incorrect operator in condition
Coverity Issue: CID 1615135 Control flow issues  (DEADCODE)
2024-07-25 17:29:48 +02:00
Chris Johns
43fd756f6d testsuite/libiofdopen: Add missing spec file 2024-07-25 12:33:00 +10:00
alessandronardin
3b96aaddde posix/aio*: Added notification on request completion
The patch adds the generation of a notification after an Asynchronous I/O
request has been completed. The notification is generated using the aio_sigevent
filed in the aiocb struct, as defined by the posix specifiations.
A new control, ensuring the validity of the field, is added on each call to
aio_read(), aio_write() and aio_fsync().
The patch also adds tests to cover the new code, and fixes formatting errors of
various aio files.
2024-07-24 11:05:21 +02:00
Chris Johns
e58ff8984c libcsupport/libio: Add rtems_libio_count_open_iops to return open descriptors
Close #5063
2024-07-24 03:23:06 +00:00
Sebastian Huber
7333afe0ae libdl: Constify TLS offset table 2024-07-20 01:31:57 +00:00
Amar Takhar
b21abd3fa5 Update to add docs group
Anyone in this group can edit text files I tried to customise it on a per-repo
basis if any files were missed please open an issue in this repo.
2024-07-19 18:20:31 -04:00
Sebastian Huber
a824ed6f7f smptests/smpipi01: Fix more sporadic test failures
The last fix in commit 70029fc7be did not work on
targets where you can have active and pending interrupts.
2024-07-19 12:52:58 +00:00
Sebastian Huber
5c5b4b832b libtests/dl*: Make build reproducible
Do not use a temporary file to create the symbol map.

Close #4941.
2024-07-18 00:12:02 +00:00
Chris Johns
cc034e7d2f libcsupport/getrusage: Return task and idle time using getrusage
Close #5062
2024-07-18 00:11:09 +00:00
Kinsey Moore
174b69afd6 cpukit/shell: Add window size retrieval control
This adds an environment variable that can be used to enable or disable
window size retrieval for the RTEMS shell. This will also disable window
size retrieval upon failure while allowing the user to re-enable it.
2024-07-18 00:10:15 +00:00
Kinsey Moore
8eb4932b13 cpukit/shell: Account for tick rate in timeouts
On systems that don't provide a proper terminal or have broken window
size detection, the RTEMS shell can take a long time execute commands if
the kernel tick interval is longer than 1ms. This updates the shell
window size retrieval timeout code to account for the kernel tick
interval bringing the experienced timeout from 12.5ms to 1.25ms when
using the default kernel tick interval (10ms).
2024-07-18 00:10:15 +00:00
Sebastian Huber
1dd384bb1b score: Add Doxygen file comment to bsd-tree.h
Update #5049.
2024-07-12 07:50:19 +02:00
Sebastian Huber
26b95e148c libtest: Move parts to extra files
Move the RTEMS test printer and rtems_test_exit() to separate files, to
remove dependencies from the begin/end test messsage support.

Update #4963.
2024-07-10 06:01:25 +00:00
Gedare Bloom
be8aa9b09d sptests/sptree01: add more detail to sptree01.doc 2024-07-09 22:52:40 +00:00
Gedare Bloom
ddbd0d574a score/bsd-tree.h: Clarify the rationale for the file in a comment. 2024-07-09 22:52:40 +00:00
Gedare Bloom
90e1a6500b testsuites: regenerate tc-score-rbtree.c 2024-07-09 22:52:40 +00:00
Gedare Bloom
88ca88f3fd cpukit/bsd-tree.h: prepend CPP with RTEMS_ scoping 2024-07-09 22:52:40 +00:00
Aaron Nyholm
c33ed55231 score/rbtree: install and use bsd-tree.h 2024-07-09 22:52:40 +00:00
Aaron Nyholm
b68ef66b49 score: Import <sys/tree.h> from Newlib
Import <sys/tree.h> from Newlib as <rtems/score/bsd-tree.h> using Newlib commit:

commit eb03ac17f16f1bd354482148426353fd35cd879d
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Tue Oct 5 15:53:47 2021 +0200

    sys/tree.h: Red child with black sibling rotations

    Add specialized rotations RB_RED_ROTATE_LEFT() and RB_RED_ROTATE_RIGHT() which
    may be used if we rotate a red child which has a black sibling.  Such a red
    node must have at least two child nodes so that the following red-black tree
    invariant is fulfilled:

      Every path from a given node to any of its descendant NULL nodes goes through
      the same number of black nodes.

          PARENT
         /      \
      BLACK     RED
               /   \
            BLACK BLACK

Close #5049.
2024-07-09 22:52:40 +00:00
Joel Sherrill
34485ccd92 x: Remove junk file 2024-07-09 20:42:06 +00:00
Sebastian Huber
6d65f2cff9 bsps/arm/xilinx-zynq: Enable SMP for all variants 2024-07-08 03:43:58 +00:00
Sebastian Huber
2f299f7f88 aarch64/xilinx-zynqmp: Fix BSP build
The build issue was introduced by b48166b9b6.
2024-07-08 03:42:40 +00:00
Sebastian Huber
ffa6e26879 dhrystone: Prevent procedure merging
From the Dhrystone RATIONALE:

  o No procedure merging

    Although Dhrystone contains some very short procedures where execution would
    benefit  from  procedure  merging (inlining, macro expansion of procedures),
    procedure merging is not to be used.  The reason is that the  percentage  of
    procedure  and  function  calls  is  part of the "Dhrystone distribution" of
    statements contained in [1].  This restriction does not hold for the  string
    functions  of  the  C  version  since ANSI C allows an implementation to use
    inline code for these functions.

Close #5058.
2024-07-05 21:18:57 +00:00
Sebastian Huber
89e795a42a validation: Fix bad thread dispatch validation
Where the robust thread dispatching is disabled, the
ISRDisabledOnDemandThreadDispatchTask() has to exit.

Update #3716.
2024-07-05 21:16:04 +00:00
Matheus Pecoraro
58748a3a71 amd64: Fix typo in amd64 obj.yml 2024-07-03 14:04:52 -03:00
xiaojun zheng
acf12498cf add rtems_counting_semaphore_wait_timed_ticks and rtems_counting_semaphore_try_wait for self-contained object counting semaphore
Closes #5055

## Summary
add rtems_counting_semaphore_wait_timed_ticks and rtems_counting_semaphore_try_wait for self-contained object counting semaphore.

1. rtems_counting_semaphore_wait_timed_ticks(rtems_counting_semaphore \*counting_semaphore,uint32_t ticks)
2. rtems_counting_semaphore_try_wait(rtems_counting_semaphore \*counting_semaphore)

close issue #5055.

<!-- Default settings, if it is a dropdown it will set after submission -->
2024-07-02 01:49:24 +00:00
Matheus Pecoraro
087645e58f amd64: Refactor amd64 and amd64efi spec files
Add a common group and object spec files for the amd64 and amd64efi BSPs
2024-07-01 17:49:11 +00:00
Matheus Pecoraro
dd882e1291 x86_64: Fix ISR handler macros
Modify the ISR handler macros for the x86_64 arch to follow the behavior
expected of them
2024-07-01 17:48:46 +00:00
Matheus Pecoraro
e46135290a x86_64: Enable and add support for FP tasks 2024-07-01 17:48:25 +00:00
Sebastian Huber
bba5a7a250 psxfenv01: Use a floating-point task 2024-06-28 14:29:04 +02:00
Sebastian Huber
c847f4c101 validation: Fix comment
Update #5050.
2024-06-26 12:02:04 +02:00
Sebastian Huber
e5b6fa026a bsp/tms570: Fix SCI baud calculation
The bug was introduced by cc6f1d86cc.

Update #4982.
2024-06-25 13:36:47 +00:00
Matheus Pecoraro
263cbb9408 amd64: Remove unneeded paging flags 2024-06-25 13:35:13 +00:00
Ranulfo Raphael
19d8888ac6 libtest/dl12: Fix build issue
Updated from ld to gcc in the build script to ensure consistency in ABI
flags during the creation of incrementally linked objects.

Update #5053
2024-06-25 13:31:22 +00:00
Kinsey Moore
39da0b7fd4 bsps/xqspipsu: Add timeouts to NOR transfers
This switches the XQspiPsu NOR driver layer to use the RTEMS event
system so that waits for interrupt-based data transfers can time out
instead of waiting indefinitely. It is sometimes possible for either the
controller or the NOR chip to fail to issue a transfer completion event
and recovery is preferable to a hang.
2024-06-25 06:47:48 +00:00
alessandronardin
cd4b6761ea cpukit/posix/aio*: Corrected aio_return() and aio_error() behaviour
Added field to the aio control block to track when a result is retrieved
and modified code accordingly.

Updated documentation for aio_return() and aio_error().
Updated test psxaio01 to make it compatible with specifications.

Closes #5039
2024-06-25 04:03:07 +00:00
Sebastian Huber
c4c3e68790 bsps/arm: Use fatal error for data cache disable
On the Cortex-A cores, at least the L1 data cache is required to provide
support for atomic operations.

Close #5050.
2024-06-25 03:58:34 +00:00
Sebastian Huber
3a281aca37 bsps/arm: Fix L2C-310 instruction enabled/disable
Set/clear SCTLR[I] on all online processors.  Do not enable/disable the
L2C-310 cache in the instruction cache enable/disable since it is a
unified cache.
2024-06-25 03:58:34 +00:00
Sebastian Huber
ef9b49dc24 bsps/arm: Fix Doxygen group placement 2024-06-25 03:58:34 +00:00
Sebastian Huber
2953f4c6e3 rtems: Fatal error for rtems_cache_disable_data()
On some targets or configurations, the data cache cannot be disabled.
The data cache may be necessary to provide atomic operations.  In SMP
configurations, the data cache may be required to ensure data coherency.

Close #5050.
2024-06-25 03:58:34 +00:00
Sebastian Huber
19a30cfa07 validation: Fix cache invalidation test case
Make sure that the invalidated data cache lines are contained in the
buffer.
2024-06-25 03:58:34 +00:00
Sebastian Huber
d09d61ffe4 doxygen: Clarify system termination 2024-06-24 06:32:26 +02:00
Sebastian Huber
2089f993c0 rtems: Fix typos in documentation 2024-06-21 18:30:34 +02:00
Sebastian Huber
7ce6667e38 score: Conditionally provide ISR_lock_Control
Use ISR_LOCK_NEEDS_OBJECT to determine if a lock object is needed.

Update #4957 and #5038.
2024-06-21 08:10:27 +02:00
Sebastian Huber
5d63827d07 score: Conditionally provide ISR_LOCK_INITIALIZER()
Use ISR_LOCK_NEEDS_OBJECT to determine if a lock object is needed.

Update #4957 and #5038.
2024-06-21 08:10:27 +02:00
Sebastian Huber
b0599ef35d score: Remove ISR_LOCK_MEMBER
Use ISR_LOCK_NEEDS_OBJECT to determine if a lock object is needed.

Update #4957 and #5038.
2024-06-21 08:10:27 +02:00
Sebastian Huber
283b4406c0 score: Remove ISR_LOCK_DECLARE()
Use ISR_LOCK_NEEDS_OBJECT to determine if a lock object is needed.

Update #4957 and #5038.
2024-06-21 08:10:27 +02:00
Sebastian Huber
fa24398857 score: Remove ISR_LOCK_REFERENCE()
Update #4957 and #5038.
2024-06-21 08:10:27 +02:00
Sebastian Huber
bdbda6a75f score: Remove ISR_LOCK_DEFINE()
Use ISR_LOCK_NEEDS_OBJECT to determine if a lock object is needed.

Update #4957 and #5038.
2024-06-21 08:10:27 +02:00
Sebastian Huber
050b61aab6 rtems: Add RTEMS_INTERRUPT_LOCK_NEEDS_OBJECT
If the RTEMS_INTERRUPT_LOCK_NEEDS_OBJECT define has a non-zero value,
then the interrupt lock operations require an object of type
rtems_interrupt_lock, otherwise no lock object is required.

This indication can be used to avoid the space overhead for lock objects
when they are not needed.  In this case, the lock operations will not
use a lock objects parameter.

Update #4957 and #5038.
2024-06-21 08:10:27 +02:00
Sebastian Huber
26a0bfcbc2 score: Improve _ISR_lock_Initialize()
Use do {} while (0) approach to avoid stray ';'.

Update #4957 and #5038.
2024-06-21 08:10:27 +02:00
Kinsey Moore
b48166b9b6 bsps/aarch64/zynqmp: Add memory error reporting
This adds error reporting for ZynqMP including L1 and L2 cache, on-chip
memory (OCM) error correcting code (ECC), and DDR ECC. OCM ECC supports
fault injection from within RTEMS. DDR ECC technically supports fault
injection as well, but requires that the program injecting faults
operate exclusively outside of DDR. The AArch64 port is not currently
capable of operating exclusively in OCM due to size constraints and
would need to be booted via JTAG or via a non-relocating u-boot to
accomplish this.
2024-06-21 05:57:21 +00:00
Kinsey Moore
27ec46f11b cpukit/aarch64: Add A53-specific registers
This adds registers specific to the Cortex-A53 processor that describe
L1 and L2 cache errors.
2024-06-21 05:57:21 +00:00
Ranulfo Raphael
78afce5bf2 testsuites/libtest: Add DL incremental link test
This commit adds a test to validate the incremental linking
functionality in RTL. The test is related to issue #3740.
2024-06-21 03:31:29 +00:00
Utkarsh Verma
dff15a820f aarch64/raspberrypi: Add gpio driver
Close #5029

Co-authored-by: Ning Yang <yangn0@qq.com>
2024-06-21 03:29:10 +00:00
Matheus Pecoraro
e233b5c16a amd64efi: Add amd64efi doxygen group 2024-06-20 15:38:01 +00:00
Matheus Pecoraro
5d90fc945b amd64: Add amd64 doxygen group 2024-06-20 15:38:01 +00:00
Matheus Pecoraro
ef5ed795ec x86_64: Load rflags after rsp on context restore
When starting multitasking there is a chance an interrupt could be fired
while rsp is still pointing to the ISR stack area if we load rflags
before rsp on "_CPU_Context_restore"
2024-06-20 15:25:23 +00:00
Matheus Pecoraro
3ca279e5b1 amd64: Use proper interrupt disable directive
Use rtems_interrupt_local_disable and enable in clock.c to avoid
enabling interrupts during system initialization
2024-06-20 15:25:23 +00:00
Matheus Pecoraro
2fe9209971 amd64: Add rtemsrwset section to linker script 2024-06-19 04:38:51 -03:00
Chris Johns
0bdeef72fe bsp/powerpc: Remove e500 machine state for asm functions
The e500 machine state was added when gcc 10 support appeared to deal with
the assembler's -many option being removed.

Close #5043
2024-06-18 04:27:46 +00:00
Matheus Pecoraro
7f2b904d6e x86_64: Set CPU_USE_LIBC_INIT_FINI_ARRAY to TRUE 2024-06-17 20:45:32 +00:00
Kinsey Moore
644041626d testsuites: Update lock init validation test
This test was broken by b031cf2b19 since
it expects the macros to evaluate to an empty string for non-SMP builds.
This updates the check for the new content.
2024-06-17 16:20:53 +00:00
Sebastian Huber
2c0ab5ba0b rtems: Format typedef parameters in comments 2024-06-17 11:26:43 +02:00
Matheus Pecoraro
20a663ccef amd64: Change console device_file to /dev/ttyS0
Change the device_file path from /dev/console to /dev/ttyS0 since it
will already be linked to /dev/console on console_initialize
2024-06-14 17:08:14 +00:00
Sebastian Huber
0951e4e617 bsps/aarch64: Unify clock driver build
Make sure <dev/clock/arm-generic-timer.h> is installed.  The installation was
erroneously removed by commit 00f0d307b4 for most
BSPs.
2024-06-14 02:47:01 +00:00
Kinsey Moore
b031cf2b19 cpukit: Resolve gcc14 warnings
This resolves several warnings upon upgrading to gcc14 and building
without SMP support.
2024-06-13 17:21:45 -05:00
Ning Yang
2d5a85f7d2 dev/pl011: Fix incorrect macro definition
Close #5036
2024-06-13 19:54:19 +00:00
Sebastian Huber
d773df1d0f build: Fix double use of objects item
In waf, install targets must not be specified more than once.
2024-06-13 19:49:52 +00:00
Sebastian Huber
1e68298847 dev/io: Fix "%hhi" conversion
The signedness of "char" is implementation-dependent.
2024-06-13 17:19:35 +00:00
Sebastian Huber
30125493b5 dev/io: Remove dead code in _IO_Vprintf() 2024-06-13 17:19:35 +00:00
Warner Losh
0c7a972b3c sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2024-06-13 17:19:35 +00:00
Warner Losh
c2041d3a0b sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2024-06-13 17:19:35 +00:00
Marius Strobl
a9e1c29aa6 kvprintf(9): add missing FALLTHROUGH
Reported by:	Coverity
CID:		1005166
2024-06-13 17:19:35 +00:00
Matheus Pecoraro
ad24b764d6 amd64: Add bsp_reset
Add a temporary implementation of bsp_reset using the keyboard
controller until the ACPI method can be implemented
2024-06-13 12:35:57 +00:00
Sebastian Huber
1d997f3338 bsps: Maybe fix Xilinx QSPI
Update #4870.
2024-06-12 00:17:59 +00:00
Sam Price
20939b213a microblaze: Move interrupt context save to BSP
The interrupt context save is now done in the BSP. This avoids an issue
where a register is modified by the interrupt handler before it is
saved. Specifically, the MSR register was modified by the `addi`
instruction in the interrupt handler before the MSR was saved. This
caused the MSR to be saved with the wrong value.

Closes #4962
2024-06-11 19:24:39 +00:00
Jacob Killelea
9fb9337b61 spec/stm32h7: Default nucleo-h755zi BSP to build for CORE_M7
## spec/stm32h7: Default nucleo-h755zi BSP to build for CORE_M7

Some of the STM32H7 parts have a secondary Cortex M4 core included and require the user to select which core they are compiling for. The `arm/nucleo-h755zi` BSP was lacking a default core selection, causing the BSP to fail to build with the default options selected. This PR changes the default option to select the larger Cortex M7 core by default.
2024-06-11 18:05:11 +00:00
alessandronardin
68951fb2a4 cpukit/posix/aio*: Updated aio files documentation
Updated the documentation in all aio files.
Moved the Doxygen comments to the headers when possible.
Fixed some formatting errors.

Updates #5027
2024-06-11 19:49:14 +02:00
Sebastian Huber
28c7475b17 aarch64/xilinx-zynqmp: Relocate RAM area
Use first 1GiB of the DDR RAM with the exception of a potential 64KiB NULL
pointer protection area by default.  The upper part of the DDR RAM may be used
by the RPU or for dynamic memory.
2024-06-10 18:01:08 +00:00
Sebastian Huber
80a22dc024 aarch64/xilinx-zynqmp: Replace file header
Use a template description.
2024-06-10 18:01:08 +00:00
Sebastian Huber
b826e20d8f aarch64/xilinx-zynqmp: Add BSP Doxygen group 2024-06-10 18:01:08 +00:00
Sebastian Huber
b9148332d9 aarch64/xilinx-zynqmp: Include standard header 2024-06-10 18:01:08 +00:00
Sebastian Huber
41b597e81e aarch64/xilinx-zynqmp: Use forward declaration
Remove the weak attribute from the declaration.  The weakness is a property of
the definition.
2024-06-10 18:01:08 +00:00
Sebastian Huber
ce3de68545 bsps/aarch64: Always set the start vector table 2024-06-10 18:01:08 +00:00
Sebastian Huber
36e596a057 bsps/aarch64: Use interrupt entry for IPI 2024-06-10 18:01:08 +00:00
Sebastian Huber
1421b9f7c0 bsps/aarch64: Use BSP fatal error 2024-06-10 18:01:08 +00:00
Aaron Nyholm
7bfe79c44d libmisc/shell: Improve print messages for flashdev command 2024-06-10 17:58:00 +00:00
Aaron Nyholm
e950c4d76a bsps: Add flash wrapper for Xilinx GQSPI
Closes #4870
2024-06-10 17:58:00 +00:00
Aaron Nyholm
fb4f9f8c4f build: Fix build issues with xqspipsu on versal
Updates #4870
2024-06-10 17:58:00 +00:00
Sebastian Huber
4f1b0ca27a bsps: Request SMP shutdown in fatal extension 2024-06-10 17:32:54 +00:00
Sebastian Huber
0bbb25b178 bsps: Disable interrupts in fatal extension 2024-06-10 17:32:54 +00:00
Christian Mauderer
fc68da47d5 bsps/imxrt1166*: Absolute address for pins in FDT
The i.MXRT1166 has three iomux controllers. The driver in RTEMS
(originally for i.MX6) doesn't support that. Switching to absolute
addresses for the pins in the FDT works around that.

Compared to changing the IOMUX driver, it has the following advantages:

- If a devicetree is written, the pinctrl-groups don't have to be split
up between different iomux controllers which makes device trees simpler
to read.

- A driver or application doesn't has to handle multiple pinctrl-groups
which simplifies the drivers.
2024-06-07 06:46:00 +00:00
Christian Mauderer
f83968f309 bsps/arm/imxrt: Add license header to fdt-blobs
The C files that provide the device trees are generated with
rtems-bin2c. Due to that, the license information in these files is
lost. Therefore this patch adds the header manually. Also adapt the
commands that are used to generate the files to reflect that.
2024-06-07 06:46:00 +00:00
Christian Mauderer
15f16def12 bsps/imx*: Add an i.MX* specific GPIO SPI driver
This driver uses the generic spi-gpio driver to implement one based on
the i.MX* GPIO API.
2024-06-07 06:46:00 +00:00
Christian Mauderer
0e7567bc2a bsps: Add a GPIO based SPI driver
The driver uses simple pin set or get functions to emulate an SPI. It
doesn't care much for speed settings and just tries it's best.
2024-06-07 06:46:00 +00:00
Christian Mauderer
7179f23340 bsps/imx*-gpio: Parse active level of FDT
This makes the active level of the FDT available to the user. It doesn't
change the current behaviour. It only provides a function to get the
active or inactive level of a pin.
2024-06-07 06:46:00 +00:00
Sebastian Huber
cbe60cea71 rtems: Clarify rtems_interrupt_set_priority()
Update #5002.
2024-06-06 23:41:13 +00:00
Sebastian Huber
e1be689980 smpschedaffinity02: Fix sporadic test failures
Under rare timing conditions, the polled mutex obtain can favour one processor
and starve the other.  This can lead to test failures.
2024-06-06 05:42:38 +00:00
Jacob Killelea
42ad53f395 New ST Nucleo STM32H755ZI BSP
## Implement a new ST Nucleo STM32H755ZI BSP

Hi all, for a project I recently acquired a Nucleo STM32H755ZI. Thanks to the work of @sebhub, @c-mauderer, and Karel Gardas, it was pretty easy to create a new Nucleo BSP for this chip by copying the Nucleo H743 BSP. I was not able to get the 8 MHz HSE clock enabled, so this is currently clocked off of the PLL using the 64 MHz HSI clock and the RTC clock is disabled. Other features haven't been thoroughly tested, but since they rely on the high quality STM32H7 HAL from ST, I have pretty high confidence in them. I've been able to run most testsuites.

I have tested:

* The CM7 core
* The CM4 core
* Console output on UART3 (the default USB UART) and the shell
* GPIO
* Sample programs like `hello`, `fileio` (and shell), `paranoia`, `unlimited`, etc.

Known Broken:

* Debugging with OpenOCD is wonky. I can set breakpoints, halt the processor and inspect memory and registers and return from functions, but stepping does not work.
* The program begins to run after being flashed but soon (under 1 second) stops running. Pressing the reset button makes the program run continuously afterward. The board resets nearly instantly.
* Shell commands `ls`, `cd`, `cpuuse`, etc. hang for a while before executing. I'm not sure where the time is spent because the built-in `time` command reports that these commands execute nearly instantly.

I haven't tested:

* Pretty much everything else

<!-- Default settings, if it is a dropdown it will set after submission -->
2024-06-06 05:37:35 +00:00
Sebastian Huber
25ba67963a score: Add _SMP_barrier_Wait_for_other()
This function may be used to ensure that a count of processors performed a set
of actions and then wait on the barrier performing only memory loads (no memory
stores).
2024-06-04 22:00:55 +00:00
Sebastian Huber
6c66526e82 bsp/tms570: Move ECLK pin initialization
Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
2fbee001f7 bsp/tms570: Use write-back/write-allocate SDRAM
Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
b4a4baa32d bsp/tms570: Use RTI for CPU counter
The performance monitor counter is stopped when the core is waiting for
interrupts.

Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
cb43ee6969 bsp/tms570: Add TMS570_FATAL_RTI_IRQ_INSTALL
Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
575ec7ed39 bsp/tms570: Fix clock driver
The clock tick rate was off by a factor of two in some configurations.
Use the maximum counter frequency to get the best time resolution.  Do
not use the automatic interrupt clear feature.

Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
cc6f1d86cc bsp/tms570: Add clock BSP options
Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
28e4a46d67 bsp/tms570: Add TMS570LC4357 PLL support
Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
123e0e6fb6 bsps/cache: Fix ARM CP-15 get cache size
The rtems_cache_get_data_cache_size() and
rtems_cache_get_instruction_cache_size() functions shall return the entire
cache size for a level of 0.  Levels greater than 0 shall return the size of
the associated level.

Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
ef570cf157 bsps/cache: Simplify Cortex-R5 cache support
Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
f67f1c8718 arm: Add arm_cp15_data_cache_all_invalidate()
Update #4982.
2024-06-04 15:50:57 +00:00
Sebastian Huber
b89101116f validation: Improve interrupt controller tests
Update #3716.
2024-05-31 20:04:31 +00:00
Alesandro Nardin
48f6b5006b cpukit/posix/src/aio_misc.c: created helper method rtems_aio_handle_helper()
Created an helper method that will be called by rtems_aio_handle().
The method will process the various types of aio requests.
Converted the old style documentation to Doxygen.
Formatted the code to adhere to rtems formatting rules.

Closes #5017
2024-05-29 18:54:36 +02:00
Ning Yang
4b45d42aee bsps/xilinx-versal: fix BSP_INTERRUPT_VECTOR_COUNT too large
Avoid use of reserved INTIDs. BSP_INTERRUPT_VECTOR_COUNT does not allow use reserved interrupt IDs.

Details !29
2024-05-29 02:52:31 +00:00
Joel Sherrill
e63c867104 x86_64/include/rtems/score/cpuimpl.h: Relicense to 2-BSD
This file had two copyrights but was missed in the earlier review.
Both parties had given permission.

Update #3053.
2024-05-28 15:44:37 -05:00
Matheus Pecoraro
b3a4f539c9 bsps/amd64: Add comments to start.s 2024-05-24 15:26:35 -03:00
Amar Takhar
64844f4468 Promote to group for libdrvmgr and add libdebugger, libdl
Two directories were missed and I forgot Gedare for libdrvmgr so it was promoted
to a group.
2024-05-23 23:06:12 -04:00
Amar Takhar
10727117a3 Typo aarch -> aarch64
This is in the approvers group.
2024-05-23 22:35:14 -04:00
Amar Takhar
39fa5a6755 Convert librtemscxx and libstdthreads to groups.
Sebastian has been added the groups are in /approvers/cpukit/
2024-05-23 21:58:28 -04:00
Sebastian Huber
869071dfb2 score: Add _Processor_mask_And_not()
Add it for completeness.
2024-05-23 21:44:22 +00:00
Sebastian Huber
a85402f76f build: Simplify wscript code 2024-05-23 20:55:21 +00:00
Alessandro Nardin
3225f69db6 posix: Fixed header comment of aio_read.c
Corrected the header comment of aio_read.c

Fixes #5015
2024-05-23 19:10:32 +00:00
Sebastian Huber
80c94eeff4 bsps: Assign file to Doxygen group
Add standard file header.
2024-05-23 19:03:09 +00:00
Sebastian Huber
e74cea4172 arm: Fix Armv7-M floating-point support
The _ARMV7M_Pendable_service_call() and _ARMV7M_Supervisor_call() work
as a team. The --ef and ++ef is there to preserve the original exception
frame across the jump to and from _ARMV7M_Thread_dispatch().

void _ARMV7M_Pendable_service_call( void )
{
   Per_CPU_Control *cpu_self = _Per_CPU_Get();

   /*
    * We must check here if a thread dispatch is allowed.  Right after a
    * "msr basepri_max, %[basepri]" instruction an interrupt service may
still
    * take place.  However, pendable service calls that are activated during
    * this interrupt service may be delayed until interrupts are enable
again.
    */
   if (
     ( cpu_self->isr_nest_level |
cpu_self->thread_dispatch_disable_level ) == 0
   ) {
     ARMV7M_Exception_frame *ef;

     cpu_self->isr_nest_level = 1;

     _ARMV7M_SCB->icsr = ARMV7M_SCB_ICSR_PENDSVCLR;
     _ARMV7M_Trigger_lazy_floating_point_context_save();

At this point, the floating point context should be saved on the
exception frame.  The FPCCR.LSPACT bit should be 0, to indicate that lazy
state preservation is no longer active.

     ef = (ARMV7M_Exception_frame *) _ARMV7M_Get_PSP();
     --ef;
     _ARMV7M_Set_PSP( (uint32_t) ef );

This new exception frame is just there to jump to
_ARMV7M_Thread_dispatch(). Here was the problem, that FPCCR.LSPACT was
not set to 1.  This resulted in a floating-point context from
uninitialized memory which could corrupt the floating-point state.  See
also:

https://developer.arm.com/documentation/ddi0403/d/System-Level-Architecture/System-Level-Programmers--Model/ARMv7-M-exception-model/Exception-return-behavior?lang=en

     /*
      * According to "ARMv7-M Architecture Reference Manual" section B1.5.6
      * "Exception entry behavior" the return address is half-word aligned.
      */
     ef->register_pc = (void *)
       ((uintptr_t) _ARMV7M_Thread_dispatch & ~((uintptr_t) 1));

     ef->register_xpsr = 0x01000000U;
   }
}

Close #4923.
2024-05-22 01:46:00 +00:00
Matheus Pecoraro
b874f4c99d x86_64: Fix stack aligment for x86-64 SysV ABI
Makes the code in bsp/x86_64/amd64/start/start.S and the stack frame
setup by _CPU_Context_Initialize align the stack properly according to
what is expected by the x86-64 SysV ABI
2024-05-22 01:31:06 +00:00
Kinsey Moore
2c03b41fdc cpukit/libdl/aarch64: Improve debug output 2024-05-21 23:28:03 +00:00
Kinsey Moore
f094427708 bsps/shared/gicv3: Validate BSP vector count
Ensure that BSP_INTERRUPT_VECTOR_COUNT does not allow for reserved
interrupt IDs.
2024-05-21 23:26:37 +00:00
Kinsey Moore
ba1f92fcba bsps/aarch64/a72: Avoid use of reserved INTIDs
Interrupt IDs 1020, 1021, 1022, and 1023 are reserved as special INTIDs
and should be ignored for normal RTEMS operation as they signal internal
changes in the interrupt controller that RTEMS itself is directly
causing.
2024-05-21 23:26:37 +00:00
Kinsey Moore
7eb3ef09b0 spec/xilinx-zynqmp-rpu: Calculate correct RAM area
There were some problems in the math calculating RAM length and NOCACHE
origin location. These have been resolved in this patch allowing RTEMS
RAM space to be relocated above 0xfe00000 to better accomodate other
elements in the system.
2024-05-21 22:55:13 +00:00
Alesandro Nardin
fca3f2b820 corrected the content of psxaio01.scn 2024-05-21 20:21:36 +00:00
Amar Takhar
cfb9f96c51 Re-add move of maintainers group.
In e95dabc77 approvers/maintainer was moved to general/maintainer.  It was moved
back in the last commit to test permissions though I forgot to note it there.

Re-add since things are working as expected.
2024-05-21 13:36:58 -04:00
Amar Takhar
79b385c804 Add CPUKit code owners.
Also add some headings for clarity and a note about creating groups.
2024-05-21 00:55:34 -04:00
Amar Takhar
e95dabc77d Move approvers/maintainer to approvers/general/maintainer
This change is to avoid anyone who is in the 'approvers' group for maintenance
showing up as approvers.  Access goes only one level up from the current group
so having approval groups one level down was causing issues with me, Chris and
Kinsey showing up.
2024-05-19 22:15:07 -04:00
Amar Takhar
d4923b098f Remove approvers/general
This will not work as intended for now Guests were never meant to be approvers
the fact they show up in the list is a bug see:

* https://gitlab.com/gitlab-org/gitlab/-/issues/220054
* https://gitlab.com/gitlab-org/gitlab/-/issues/220627
2024-05-17 23:47:12 -04:00
Amar Takhar
fafd85e1e4 Remove [1] behind groups.
It is the default and having it there is confusing.
2024-05-17 15:31:48 -04:00
Amar Takhar
4780871435 Fix typos
Plus an additional one.

Closes administration/gitlab/#50
2024-05-17 14:16:49 -04:00
Amar Takhar
4aec3093ab Add initial CODEOWNERS file. 2024-05-14 17:25:09 -04:00
Sebastian Huber
ab8817ca03 rtems: Add get/set interrupt priorities
Add directives to get and set the priority of an interrupt vector.

Implement the directives for the following BSP families:

* arm/lpc24xx
* arm/lpc32xx
* powerpc/mpc55xxevb
* powerpc/qoriq

Implement the directives for the following interrupt controllers:

* GICv2 and GICv3 (arm and aarch64)
* NVIC (arm)
* PLIC (riscv)

Update #5002.
2024-05-10 13:26:22 +00:00
Josef 'Jeff' Sipek
89ccc65d1a Remove a reference to xrpu from timetc.h
It was removed in 2007, so doesn't make a good example.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44462
2024-05-10 13:24:36 +00:00
Jake Freeland
c71d561bf8 timerfd: Move implementation from linux compat to cpukit/score/src
Move the timerfd impelemntation from linux compat code to cpukit/score/src. Use
it to implement the new system calls for timerfd. Add a hook to kern_tc
to allow timerfd to know when the system time has stepped. Add kqueue
support to timerfd. Adjust a few names to be less Linux centric.

RelNotes: YES
Reviewed by: markj (on irc), imp, kib (with reservations), jhb (slack)
Differential Revision: https://reviews.freebsd.org/D38459
2024-05-10 13:24:36 +00:00
Warner Losh
7867005def sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2024-05-10 13:24:36 +00:00
Warner Losh
770ef97a45 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2024-05-10 13:24:36 +00:00
Dmitriy Alexandrov
426492407b kern_ntptime: Fix undefined behavior of the shift operator
L_LINT macro is used with negative numbers [i.e.
L_LINT(time_freq, -MAXFREQ)], it could cause undefined
behavior. It should be similar to the L_RSHIFT(v, n) macro.

MFC after:	2 weeks
Reviewed by:	cy
Pull Request:	https://github.com/freebsd/freebsd-src/pull/769
Signed-off-by: Dmitriy Alexandrov <d06alexandrov@gmail.com>
2024-05-10 13:24:36 +00:00
Warner Losh
e11536c339 spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2024-05-10 13:24:36 +00:00
Pedro F. Giffuni
b294ef236d sys/sys: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2024-05-10 13:24:36 +00:00
Sebastian Huber
f6c8726cb7 bsps/arm: Move BSP-specific header file 2024-05-10 13:20:45 +00:00
Sebastian Huber
ee7f847432 bsps/arm: Use shared object for ARM920 MMU support 2024-05-10 13:20:45 +00:00
Sebastian Huber
5a3a85ccdd bsps/arm: Move BSP-specific header file installs 2024-05-10 13:20:45 +00:00
Sebastian Huber
dfc147fd33 aarch64/xilinx-zynqmp: Enable errata workarounds
Close #5003.
2024-05-08 12:19:07 +02:00
Sebastian Huber
40ddcf9580 bsps: Use interrupt entry in clock driver
This avoids a dependency on memory allocations.
2024-05-07 23:21:31 +00:00
Vincenzo Calabretta
1f4e0c1036 bsps/powerpc: Introduction of interrupt locks
Interrupt locks are introduced in shared vme device drivers to enable
compilation in an SMP configuration of the qoriq BSP.
2024-05-07 18:26:28 +02:00
Sebastian Huber
f5b52a3af0 bsps/arm: Fix Doxygen group assignment 2024-05-07 11:16:49 +02:00
Sebastian Huber
81f868ede4 bsps/arm: Add CMSIS files to Doxygen group 2024-05-07 11:16:49 +02:00
Sebastian Huber
7024401d76 bsps/arm: Add Doxygen group for Armv7-M SysTick
Change license to BSD-2-Clause according to file history and contributor
agreements.
2024-05-07 11:16:49 +02:00
Sebastian Huber
d19c322259 bsps/aarch64: Define Doxygen groups
Fix typos.
2024-05-07 11:16:49 +02:00
Sebastian Huber
dcdf399676 aarch64: Add files to Doxygen groups 2024-05-07 11:16:49 +02:00
Sebastian Huber
a8fba20baa bsps: Add Doxygen group for Arm Generic Timer 2024-05-07 11:16:49 +02:00
zhengxiaojun
4655ceee4d fix dynamic loading error, close #3740. 2024-05-03 18:03:13 +08:00
Ning Yang
00f0d307b4 bsps/aarch64/raspberrypi: Add system timer support
The clock from the ARM timer is derived from the system clock. This clock can
change dynamically e.g. if the system goes into reduced power or in low power
mode. Thus the clock speed adapts to the overall system performance
capabilities. For accurate timing it is recommended to use the system timers.

if BSP_CLOCK_USE_SYSTEMTIMER = 1, use the System Timer, otherwise use the ARM
Timer.
2024-04-30 01:39:06 -04:00
Sebastian Huber
d7447b2a5e validation: Fix typo 2024-04-30 01:39:06 -04:00
Sebastian Huber
ae00fcabed doxygen: Fix constraints
Somehow the constraints for CONFIGURE_TICKS_PER_TIMESLICE and
CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK got mixed up.

Update #4986.
2024-04-30 01:39:06 -04:00
Vincenzo Calabretta
b191af1619 bsp/qoriq: Include missing processormaskimpl.h 2024-04-30 01:39:06 -04:00
Sebastian Huber
76462bb64c bsps/arm: Improve GICv3 support
In addtion to 1023, the GICC_IAR register may return 1022 as a special value.
Simply check for a valid interrupt vector for the dispatching.

Check the GICC_IAR again after the dispatch to quickly process a next interrupt
without having to go through the interrupt prologue and epiloge.
2024-04-30 01:39:06 -04:00
Sebastian Huber
901e893087 arm/xen: Fix BSP_INTERRUPT_VECTOR_COUNT
Do not use reserved interrupt IDs.
2024-04-30 01:39:06 -04:00
Sebastian Huber
c594732cf2 validation: Improve bad thread dispatch validation 2024-04-30 01:39:06 -04:00
Sebastian Huber
286a80a80d validation: Test global construction on aarch64
Update #3716.
2024-04-30 01:39:06 -04:00
Sebastian Huber
bc7e6ae550 dev/irq: Improve Doxgyen group assignments
Make the GIC interrupt controller support a subgroup of the generic interrupt
controller support.
2024-04-30 01:39:06 -04:00
Sebastian Huber
39584528e9 bsps/arm: Improve GICv2 support
In addtion to 1023, the GICC_IAR register may return 1022 as a special value.
Simply check for a valid interrupt vector for the dispatching.

Check the GICC_IAR again after the dispatch to quickly process a next interrupt
without having to go through the interrupt prologue and epiloge.
2024-04-30 01:39:05 -04:00
Sebastian Huber
70029fc7be smptests/smpipi01: Fix sporadic test failure
Make sure that the last IPI is processed before the next test case is
carried out.
2024-04-30 01:39:05 -04:00
Sebastian Huber
a8ce68f002 smpmulticast01: Ignore SMP_FATAL_SHUTDOWN_RESPONSE
This fatal code is a part of the normal SMP termination procedure.
2024-04-30 01:39:05 -04:00
Sebastian Huber
2728023b24 testsuites/unit: Add tests for compiler builtins
On the arm target, __udivmoddi4() cannot be fully tested through normal
integer divisions.

Update #3716.
2024-04-30 01:39:05 -04:00
Ning Yang
b7a0e2a89b dev/clock: Move bcm2835-system-timer driver to shared space
This patch moves the bcm2835 system timer driver in the arm/raspberrypi directory to the shared directory and adjusts arm/raspberrypi BSP.
2024-04-30 01:39:05 -04:00
Sebastian Huber
087fc4351a bsps/xil-ttc: Improve clock driver
Make the clock driver parameters configurable.  Use the maximum counter
frequency to get the best time resolution.  Decouple the CPU counter from the
timecounter.  Make the tick catch up handling more robust.  Add a validation
test for the tick catch up.
2024-04-30 01:39:05 -04:00
Sebastian Huber
5a8e99546f bsps/xil-ttc: Add XIL_FATAL_TTC_IRQ_INSTALL 2024-04-30 01:39:05 -04:00
Sebastian Huber
42f86dfd75 bsps/xil-ttc: Use interrupt entry 2024-04-30 01:39:05 -04:00
Sebastian Huber
3f4fcc28df build: Install <rtems/score/processormaskimpl.h> 2024-04-30 01:39:05 -04:00
Sebastian Huber
83f0c0259b bsps: Include <rtems/score/processormaskimpl.h>
This fixes commit b678a199e499b6c3f0b453393434aefaee180423 for SMP
configurations.
2024-04-30 01:39:05 -04:00
Sebastian Huber
1d668054c0 bsp/qoriq: Do not build unused object 2024-04-30 01:39:05 -04:00
Sebastian Huber
237f8662ba score: Improve C/C++ standard compatibility
The processor mask implementation uses flsl() from <strings.h> which is
only BSD visible.  Move the implementation to a separate header file to
hide it from the API level.  This fixes build errors with GCC 14.
2024-04-30 01:39:05 -04:00
Sebastian Huber
7bc76732b0 validation: Fix powerpc in test case
The powerpc context switch restores the interrupt state.

Update #4955.
2024-04-30 01:39:05 -04:00
Bernd Moessner
b4c65f78a0 Fix: type-cast to wrong type 2024-04-30 01:39:05 -04:00
Amar Takhar
3d8ddd6230 Drop index.html from directory it loads by default.
Testing out the new approvers setup.

Refs administration/gitlab#35
2024-04-27 02:06:14 -04:00
Amar Takhar
e3429553ea Move to a toplevel approvers group.
approvers -> approvers/general
* -> approvers/*

Refs administration/gitlab#35
2024-04-27 01:27:48 -04:00
Amar Takhar
fb3d4a8f5a Add an additional line for consistency.
This is also to test the merge template which just sets the milestone.
2024-04-26 12:36:42 -04:00
Amar Takhar
64cdc31c2f Rename 'All Source' to 'General Approvers'
Makes it more clear who these approvers are.
2024-04-25 23:07:37 -04:00
Chris Johns
7db1948917 bsp/arm/zynq: Move README to README.md 2024-04-26 08:01:52 +10:00
Amar Takhar
3fc3a4f859 Convert README to MarkDown.
GitLab has it's own flavour and I've kept that in mind.

This greatly simplifies the document as well GitLab is quite a bit more verbose
than Trac was no need to replicate information.

This is just a first revision we can expand it as necessary.
2024-04-25 03:25:10 +00:00
Amar Takhar
5b5c4a05b9 Rename README to README.md
In preparation for moving to MarkDown.
2024-04-25 03:25:10 +00:00
Amar Takhar
bbe12d62a3 Switch from rtems to approvers group
Also bring down approvers limit to 1 for now so we can test.
2024-04-24 23:22:14 -04:00
Amar Takhar
912d757267 Remove section for testsuites.
It's covered by the global rule now.

I also did the foreign ticket reference wrong let's try it again

Ref administration/gitlab#6 and administration/gitlab#18
2024-04-24 15:29:16 -04:00
Amar Takhar
e89ff4a3c2 First attempt at requiring 2 approvers for all files.
Not sure if this is going to work at the moment.

Ref #6, #18 in administration/gitlab
2024-04-24 15:12:20 -04:00
Amar Takhar
92f3ac909a Fix typo.
Spotted by Gedare but it should also be OpenRISC 1000 and not or1k.
2024-04-20 23:07:23 -04:00
Amar Takhar
ebe0f58991 Fix typo in access list.
Unfortunately syntax checking only happens after the file is pushed no other
options.
2024-04-19 22:32:43 -04:00
Amar Takhar
e30bc81396 Setup to use groups instead of individual developers.
This will make it far easier to maintain rather than having to edit the file
constantly.
2024-04-19 22:31:45 -04:00
Amar Takhar
5e456fcca9 Try using a subgroup for ARM.
This uses the arch/arm subgroup.
2024-04-18 20:54:21 -04:00
Amar Takhar
67ba606931 Add the rest of the architectures to CODEOWNERS.
Also use glob where possible so we don't have to continuously add files.
2024-04-15 00:26:03 -04:00
Amar Takhar
195bdfef16 Remove ** from directories.
It's clearly not required not sure why the gitlab-org repo uses it.  I think
it's fine because * is a wildcard and ** is typically used for a recursive glob.
While it works it's not necessary.
2024-04-14 02:20:58 -04:00
Amar Takhar
0b81351900 Add ARM.
This also adds stubs in for the rest of the architectures and owners.

Note that any users not currently on our test instance aren't in here we will
have to add them after.
2024-04-14 02:00:21 -04:00
Amar Takhar
5b288dbc9d Add ** to glob all files below directory.
The GitLab documentation is not very clear about this.  I'm tryin gto use the
CODEOWNERS file from the gitlab-org project.
2024-04-14 00:17:29 -04:00
Amar Takhar
e6b3ae575c Fix owner names.
chrisj -> chris
kinsey -> opticron
2024-04-14 00:16:15 -04:00
Amar Takhar
710d90fbec Initial commit of CODEOWNERS
This will decide who is 'in charge' of what source code.

It also decides who is able to approve within the repository.
2024-04-13 22:42:47 -04:00
Amar Takhar
649f88320b Revert "First attempt at a default ticket template."
This reverts commit 7a03a30c15
2024-04-14 01:29:50 +00:00
Amar Takhar
7a03a30c15 First attempt at a default ticket template.
All templates in this directory will be set in the RTEMS namespace.
2024-04-13 21:09:37 -04:00
Sebastian Huber
53d092471f dev/serial: Add Zynq UART kernel I/O support
Replace the BSP_CONSOLE_MINOR BSP option for the Xilinx Zynq BSPs with the new
BSP option ZYNQ_UART_KERNEL_IO_BASE_ADDR.  Move the kernel I/O support to a
shared file.
2024-04-04 12:53:53 +02:00
Sebastian Huber
8ad3f92b9a dev/serial: Add ZYNQ_UART_[01]_BASE_ADDR
This helps to provide a shared implementation of the kernel I/O support.
2024-04-04 12:53:51 +02:00
Sebastian Huber
4c2da2c343 dev/serial: Simplify some Zynq UART functions
Make the initialization and polled functions independent of the Termios
context.  This helps to implement the kernel I/O support without a dependency
on the Termios framework.
2024-03-27 20:22:53 +01:00
Sebastian Huber
5b0e355ed7 bsps: Move declarations to <bsp/irq-generic.h>
Move declarations of bsp_interrupt_get_affinity() and
bsp_interrupt_set_affinity() to <bsp/irq-generic.h>.  Canonicalize the
<bsp/irq.h> includes.

Implement bsp_interrupt_get_affinity() and bsp_interrupt_set_affinity() only if
needed (usually RTEMS_SMP).

Provide stub implementations for i386 to fix build errors.
2024-03-27 20:20:38 +01:00
Sebastian Huber
1ef5fa07aa rtems: Avoid -Wundef warnings in API header 2024-03-23 10:56:25 +01:00
Sebastian Huber
1df822a922 Mark parameters as intentionally unused
The parameters are unused due to API constraints.  The functions are
used through function pointers.  Alternative implementations may use the
parameters.

Update #4862.
2024-03-22 08:12:22 +01:00
Sebastian Huber
1eed6f8bfc bsps: Avoid unused argument in clock interrupt
Pass the parameter of the clock interrupt handler to
Clock_driver_support_at_tick() and Clock_driver_timecounter_tick().  This makes
it possible to use the interrupt handler argument in clock drivers.

Use the interrupt handler provided by Clock_driver_support_install_isr() to
avoid local delarations of Clock_isr().

Update #4862.
2024-03-20 16:34:09 +01:00
Sebastian Huber
d62f299b34 Do not define CONFIGURE_TICKS_PER_TIMESLICE to 0
Unconditionally make a CONFIGURE_TICKS_PER_TIMESLICE value less than or equal
to zero an error.

Update #4986.
2024-03-20 10:52:16 +01:00
Sebastian Huber
9e0bcd4fc7 score: Include missing header file
This fixes:

heap.c:268:3: warning: implicit declaration of function 'memset'
2024-03-20 10:52:16 +01:00
Sebastian Huber
e1cb8830b7 testsuites: Exclude JFFS2 NAND tests 2024-03-20 08:27:40 +01:00
Sebastian Huber
2f5a747dcc dev/irq: Optional arm_gic_irq_processor_count()
Provide arm_gic_irq_processor_count() only in SMP configurations.
2024-03-20 07:40:41 +01:00
Sebastian Huber
431e335e7e bsps: Add xilinx_zynqmp_lp64_a53 BSP variant
Add a BSP variant without a board-specific name.
2024-03-20 07:40:41 +01:00
Sebastian Huber
1e406690a5 bsps: Add xilinx_zynq_rpu BSP variant
Add a BSP variant without a board-specific name.
2024-03-20 07:40:41 +01:00
Sebastian Huber
8f4b9d6611 xilinx-zynqmp-rpu: Remove URLs from copyrights 2024-03-20 07:40:41 +01:00
Sebastian Huber
5b5ff07016 bsps: Use bsps/arm/xilinx-zynqmp-rpu 2024-03-20 07:40:41 +01:00
Sebastian Huber
99398625f4 bsps: Use bsps/aarch64/xilinx-zynqmp 2024-03-20 07:40:41 +01:00
Sebastian Huber
bc910e1aac arm: Move _CPU_ISR_install_vector()
The use of this function is optional. Newer BSPs do not use it.
2024-03-20 07:40:41 +01:00
Stanislav Pankevich
ef9a74fc1a arm/xilinx-zynqmp-rpu: Fix clock driver
We observed a strange behavior of the 1Hz timer when running cFS on Zynq
RPU. After some investigation, we reduced the error to the truncation
issue. This patch fixes the issue.
2024-03-19 13:25:16 +01:00
Kinsey Moore
9c84037e93 cpukit: Gate ticks per timeslice config
Gate CONFIGURE_TICKS_PER_TIMESLICE appropriately behind
CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER.
2024-03-18 15:18:38 -05:00
Kinsey Moore
1ecb4e3047 cpukit/jffs2: Properly commit JFFS2 data
When unmounting a JFFS2 filesystem, any outstanding write buffers must
be flushed to disk. In some circumstances, these write buffers are
instantiated by a garbage collection pass and as such no inode number is
associated with it. Due to the way that JFFS2 processes these garbage
collection passes, a write buffer without any associated inodes will not
be flushed unless it is forced with jffs2_flush_wbuf_pad().
2024-03-14 17:13:23 -05:00
Zack leung
5ee87eee8a Ensure ticks per timeslice is greater than zero 2024-03-14 12:58:59 -05:00
Kinsey Moore
fd790b3431 bsps/shared/xqspipsu: Read correct status bits
When resetting the QSPI FIFOs, the driver was reading write-only bits of
a register for status information when it was actually in a different
register. This corrects the driver so that it reads the correct status
bits.
2024-03-11 12:09:59 -05:00
Kinsey Moore
33379dcfc4 bsps/shared/xnandpsu: Add opportunistic page cache
Add an opportunistic page cache to the xnandpsu driver since it does not
implement partial page reads and common filesystem access patterns
perform multiple reads from the same page. This has been seen to provide
a 10x speedup to read speeds and a 2x speedup on first initialization
when used with JFFS2.
2024-03-11 12:09:59 -05:00
Sebastian Huber
a7730cf1b1 aarch64/zynqmp: Fix build item BSP family 2024-03-11 16:43:40 +01:00
Sebastian Huber
85b55a7624 bsps/clock: Fix fast idle for SMP 2024-03-11 14:40:06 +01:00
Matt Joyce
461f118ad0 validation/tc-sched-smp: Fix synchronization issue
Update #3716.
2024-03-11 14:37:55 +01:00
Sebastian Huber
283f783d5d aarch64/zynqmp: Fix UART base addresses and IRQ
The base addresses and IRQ numbers for UART 0 and 1 were interchanged.
Fix this and set BSP_CONSOLE_MINOR to 0 for this BSP family.
2024-03-11 14:22:53 +01:00
Sebastian Huber
5cb666ba41 bsps/powerpc: Fix include order
The <rtems/irq.h> header file depends on the BSP-provided define
BSP_SHARED_HANDLER_SUPPORT.
2024-03-11 07:09:15 +01:00
Kinsey Moore
da967ece67 testsuites/dhrystone: Initialize before use
This resovles a warning where a variable could be used before it is
initialized in some code paths.
2024-03-05 08:49:41 -06:00
Kinsey Moore
3200933e13 cpukit/libtest: Remove unused variable
This unused variable causes a warning. It is never set or used.
2024-03-01 08:33:39 -06:00
Kinsey Moore
75d7af409f bsps/xnandpsu: Allow creation of BBT
This fixes a logic inversion that was preventing creation of a Bad Block
Table (BBT) from scratch on devices that lack one. This was discovered
during upstream integration testing. The BBT management layer in this
driver is not designed to be easily testable other than on real hardware.
2024-02-28 11:20:36 -06:00
Sebastian Huber
be81a22332 build: Fix script action
We have to use a custom dictionary to be able to set the "value" argument in
the exec() context.
2024-02-28 08:36:47 +01:00
Sebastian Huber
c454b1048f powerpc: Use RTEMS_XCONCAT()
Prefer macros with a proper namespace.
2024-02-27 16:20:18 +01:00
Sebastian Huber
a779b17764 bsps/powerpc: Include missing <rtems/irq.h>
The <rtems/irq.h> defines a legacy API.
2024-02-27 14:54:32 +01:00
Sebastian Huber
d6242196b5 bsp/qoriq: Use more specific include 2024-02-27 14:13:14 +01:00
Sebastian Huber
b544d070cf bsp/qoriq: Remove superfluous include 2024-02-27 14:13:14 +01:00
Sebastian Huber
65bfcc3944 bsp/qoriq: Remove <rtems/irq.h> in <bsp/irq.h>
The <rtems/irq.h> defines a legacy API.
2024-02-27 14:13:14 +01:00
Sebastian Huber
4fd930b7f0 bsp/qoriq: Use bsp_fatal() 2024-02-27 14:13:13 +01:00
Sebastian Huber
7e990236a7 bsp/qoriq: Use interrupt entry
Avoid heap usage in the basic BSP.
2024-02-27 14:13:13 +01:00
Sebastian Huber
4b0409f10b Update company name
The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.
2024-02-27 14:10:17 +01:00
Sebastian Huber
6582b70537 testsuites/unit: Add files to group 2024-02-27 14:10:06 +01:00
Kinsey Moore
cd12bf025d testsuites/jffs2: Add test for empty NOR FS
This adds a test to very that remounting a completely used, but empty
NOR JFFS2 filesystem is possible. Previously, this triggered an edge
condition in the JFFS2 scan code that prevented remount of a correctly
formed and uncorrupted filesystem.
2024-02-26 11:07:53 -06:00
Kinsey Moore
e3972d71ef cpukit/jffs2: Handle used empty file system
On JFFS2 file systems on NOR flash or dataflash that does not have spare
area for metadata and thus does not invoke delayed writes, it is
possible to put the file system into a state where all blocks have been
written to and all files have been deleted from the filesystem. There is
a bug in the JFFS2 file system scan routine that detects this situation
as a corrupted file system since the scan routine relies on "used" space
to discriminate a valid file system when there are blocks that need to
be erased. The correct fix would require a partial rewrite of the scan
routine, so instead this patch tracks the space marked as obsolete along
with space at the end of each block that is otherwise too small to
contain a JFFS2 node so that it can me compared with the dirty space.
Corrupted data (or otherwise non-JFFS2 blocks) will still cause this
check to fail as corrupted data isn't recognized as obsoleted (deleted)
nodes.
2024-02-26 11:07:53 -06:00
Kinsey Moore
5df1d15e8b spec/zynqmp-rpu: Clean up options
The RAM origin had an unnecessary alignment requirement and the RAM
lenght had a reference that couldn't possibly be used. This removes
those obsolete option specifiers.
2024-02-23 08:36:12 -06:00
Joel Sherrill
00e71f0b4b arm/altera-cyclone-v/README: Fix use of CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
The proper name is now CONFIGURE_MAXIMUM_FILE_DESCRIPTORS.
2024-02-23 08:35:59 -06:00
Sebastian Huber
e9c7ba3e05 libtest: Improve gcov info dump
Make sure there is no spurious empty line between the gcov info and the

*** END OF GCOV INFO BASE64 ***

line.  This helps to recalculate the hash correctly at the consumer
side.
2024-02-22 14:30:40 +01:00
Kinsey Moore
6b1222465e testsuites/dl11: Test TLS on a secondary thread
This adds a pthread that runs the test as well to increase test
coverage. The original test would have passed if all threads returned
the address of the Init task's errno since no additional threads or
tasks were checked.
2024-02-19 09:26:10 -06:00
Kinsey Moore
8f8f043234 bsps/qspipsu: Calculate correct parallel mode size
Stacked mode doubles the number of sectors and device size while
parallel mode doubles the sector size and the device size. Make sure
that this is accounted for in the device size accessor.
2024-02-19 09:26:04 -06:00
Sebastian Huber
fa3a918a2a doxygen: Fix link format 2024-02-16 09:32:04 +01:00
Sebastian Huber
fa17765bd4 crc: Add a CRC-24Q implementation 2024-02-16 09:32:04 +01:00
Matthew Joyce
2757b36098 base64: Add decoder 2024-02-16 09:32:04 +01:00
Sebastian Huber
c90e2b2fb2 base64: Make base64 encoding tables public
This makes them reusable.  Change the character type to uint8_t.
2024-02-16 09:32:04 +01:00
Sebastian Huber
317df86ba3 base64: Move base64 encoding support 2024-02-16 09:32:04 +01:00
Kinsey Moore
8d22b57969 i386: Restore SMP functionality
When the switch to waf occurred, the SMP support in i386 was left out
causing it to accumulate a minor amount of cruft. This enables SMP for
the i386 BSPs that support it and updates them for the API drift that
has occurred since the change.
2024-02-14 08:22:48 -06:00
Adrien Chardon
b1fdf75338 bsp/tms570: Fix console receive interrupts
`tms570_sci_interrupt_handler()` is called when an RX interrupt fires. It checks
in the register `FLR`, the `RXRDY` bit (Receiver ready flag - indicate that the
SCIRD contains new data). If it is set, it calls
`tms570_sci_read_received_chars()`.

`tms570_sci_read_received_chars()` checks the register `RD` against 0. If it is
non zero, it returns 1 to indicate that one byte was read.

In the old behavior, if it is zero, the function returns 0 to indicate that no
data was read.

The new behavior is to not silently drop 0x00 bytes. Ignoring 0x00 bytes is fine
when working with printable text (which, I assume, is how this driver was
tested), but as soon as the UART is used in non canonical (raw) mode, with
potentially 0x00 bytes, these bytes will be silently dropped, causing issues in
the data/protocol layer above.

Update #4982.
2024-02-01 07:54:57 +01:00
Kinsey Moore
b03aba3023 cpukit/libblock: Ignore sync status prior to purge 2024-01-31 14:03:33 -06:00
Kinsey Moore
0d5319d49a cpukit/libblock: Ignore error notify return value
This is already in the error path.
2024-01-31 14:03:33 -06:00
Christian Mauderer
55a1b9accd bsps/qoriq: Add VME support for MVME2500
This enables the VME support for the MVME2500. Note that the PCIe
support from libbsd is used. So you need the related libbsd patches for
this to work.

If the drivers in libbsd are not enabled, the linker should not pick up
anything from this patch.
2024-01-31 09:54:57 +01:00
Christian Mauderer
529b70c828 bsps/qoriq: Allow setting EIRQ polarity and sense
Add a function that allows to set the polarity (active-low / negative
edge triggered or active-high / positive edge triggered) and sense
(level or edge sensitive) of the external interrupts.
2024-01-31 09:54:57 +01:00
Christian Mauderer
c9dda8cda8 bsps/qoriq: Add MMU regions for PCIe based on fdt
Get the memory ranges for the PCIe from the FDT and add them to the MMU.
This is necessary so that the PCIe driver in libbsd can work.
2024-01-31 09:54:57 +01:00
Kinsey Moore
9a95f9c638 cpukit/libblock: Ignore return value on error path 2024-01-29 11:08:19 -06:00
Kinsey Moore
4c948a6ae5 cpukit/cache: Report coherent add area failures
This alters the API for rtems_cache_coherent_add_area to allow reporting
of failures that can occur during the process of adding a new area to
the coherent cache heap.
2024-01-26 08:19:15 -06:00
Kinsey Moore
572c95c375 cpukit/dosfs: Simplify expressions where possible 2024-01-22 09:56:40 -06:00
Kinsey Moore
07ee157e5e cpukit/libmisc: Cast getpid() before shifting
Cast getpid() before shifting to avoid truncation of upper bits before
the 64bit XOR occurs.
2024-01-22 09:56:40 -06:00
Kinsey Moore
df8e3fcbb6 cpukit/libmisc/uuid: Check for invalid FD 2024-01-22 09:56:40 -06:00
Kinsey Moore
487cdce64d cpukit/dosfs: Don't leak a FAT FD
The tmp_fat_fd variable is unconditionally opened in the branch where it
is used within the loop and so must be closed or else risk a resource
leak.
2024-01-22 09:56:40 -06:00
Sebastian Huber
3626fe833d fstests/tftpfs: Fix build dependency
Update #4666.
2024-01-18 17:36:16 +01:00
Sebastian Huber
2ee0159ed8 build: Fix target of build script 2024-01-18 17:36:16 +01:00
Kinsey Moore
659a79ef8f cpukit/score: Avoid overflow in multiplication
Change extend_count to uint32_t from uint16_t to avoid a possible
premature integer overflow when it is later used for multiplication.
2024-01-17 10:48:25 -06:00
Kinsey Moore
46c343dd23 cpukit/dosfs: Remove unused internal function arg 2024-01-16 10:57:44 -06:00
Kinsey Moore
6383390886 cpukit: Remove or use unused variable assignments 2024-01-16 10:57:44 -06:00
Bernd Moessner
a73b52d6a4 flashdev.c: return error if both buffers are NULL
Updates #4981
2024-01-16 10:57:43 -06:00
Bernd Moessner
bd898b503f flashdev: Add missing default case
Updates #4981
2024-01-16 10:57:43 -06:00
Bernd Moessner
a43163d058 flashdev.h: Add missing C++ include guards
Updates #4981
2024-01-16 10:57:43 -06:00
Stanislav Pankevich
7eee05a37d bsps/xilinx-zynqmp-rpu: Invalidate caches on start
This corrects an issue where caches can be dirty on warm boot.
2024-01-16 10:57:43 -06:00
Sebastian Huber
df378641e6 bsp/tms570: Use TMS570_OSCILLATOR_MAIN
This option replaces BSP_OSCILATOR_CLOCK.  It may be used in PLL setup
calculatios.

Update #4982.
2024-01-15 10:34:08 +01:00
Sebastian Huber
9a961eec67 bsp/tms570: Remove unused BSP options
Update #4982.
2024-01-15 10:34:06 +01:00
Tyler Miller
b47c8188bf bsp/tms570: Update README
Update #4982.
2024-01-15 10:34:04 +01:00
Tyler Miller
449d836800 bsp/tms570: Board-specific tms570_emif_sdram_init()
Update #4982.
2024-01-15 10:34:02 +01:00
Tyler Miller
87be7eaba2 bsp/tms570: Board-specific tms570_pinmux_init()
Update #4982.
2024-01-15 10:34:00 +01:00
Tyler Miller
42e013a5dd bsp/tms570: Board-specific tms570_map_clock_init()
Update #4982.
2024-01-15 10:33:59 +01:00
Tyler Miller
b300b967ee bsp/tms570: Board-specific tms570_pll_init()
Update #4982.
2024-01-15 10:33:57 +01:00
Tyler Miller
53cbe74878 bsp/tms570: Initialize MPU
Update #4982.
2024-01-15 10:33:56 +01:00
Sebastian Huber
65831d71ed bsp/tms570: Optimize tms570_debug_console_out()
Reduce number of interrupt disable/enable actions.

Update #4982.
2024-01-15 10:33:54 +01:00
Sebastian Huber
5a2f64cf34 bsp/tms570: Initialize and enable caches on demand
Update #4982.
2024-01-15 10:33:52 +01:00
Sebastian Huber
663bedd59e bsp/tms570: Use bsp_start_copy_sections_compact()
There is no need to relocate the text and read-only data.

Update #4982.
2024-01-15 10:33:50 +01:00
Sebastian Huber
d4c6def68b bsp/tms570: Use shared bsp_start_hook_1()
Update #4982.
2024-01-15 10:33:49 +01:00
Sebastian Huber
e9634471d9 bsp/tms570: Add header guards
Update #4982.
2024-01-15 10:33:47 +01:00
Sebastian Huber
3f75b58d46 bsp/tms570: The TMS570LC4357 has no TCRAM modules
Update #4982.
2024-01-15 10:33:45 +01:00
Sebastian Huber
2db0844b87 bsp/tms570: Initialize SRAM on demand
Update #4982.
2024-01-15 10:33:43 +01:00
Sebastian Huber
23ba8d2c2c bsp/tms570: Use asm code for tms570_memory_init()
Make sure that we do not use the stack for this function.

Update #4982.
2024-01-15 10:33:41 +01:00
Tyler Miller
f7530be75c bsp/tms570: Honor DBGRST for TMS570LC4357
Update #4982.
2024-01-15 10:33:39 +01:00
Sebastian Huber
b99013e580 bsp/tms570: Remove reset source handling
Do not clear SYSESR and let the application handle the reset source.

Update #4982.
2024-01-15 10:33:37 +01:00
Tyler Miller
ec79400503 bsp/tms570: Add HCLKCNTL register
Update #4982.
2024-01-15 10:33:36 +01:00
Tyler Miller
2bbacdb557 bsp/tms570: TMS570LC4x Errata DEVICE#60
Update #4982.
2024-01-15 10:33:34 +01:00
Sebastian Huber
75dd824079 bsp/tms570: Add errata SSWF021#45 handling
Update #4982.
2024-01-15 10:33:33 +01:00
Sebastian Huber
4d9c9c52ae bsp/tms570: Conditionalize TMS570LS3137 errata
Update #4982.
2024-01-15 10:33:31 +01:00
Sebastian Huber
eeaa318dc6 bsp/tms570: Simplify expression
Update #4982.
2024-01-15 10:33:29 +01:00
Tyler Miller
c14efe493b bsp/tms570: Add TMS570LC4357 power support
Update #4982.
2024-01-15 10:33:28 +01:00
Tyler Miller
4f6fa9746d bsp/tms570: Add TMS570LC4357 pin config support
Update #4982.
2024-01-15 10:33:26 +01:00
Tyler Miller
39fd4b142e bsp/tms570: Remove double pin configuration
Do not set pins to the default function before the actual setting is
applied.  If a pin setting needs to be done in a certain order, then
this should be done explicitly through multiple calls to
tms570_bsp_pinmmr_config().

Update #4982.
2024-01-15 10:33:24 +01:00
Tyler Miller
b995211907 bsp/tms570: Add tms570_pbist_run_and_check()
Update #4982.
2024-01-15 10:33:22 +01:00
Sebastian Huber
8569f0181b bsp/tms570: Enable hardware init for some variants
Update #4982.
2024-01-15 10:33:20 +01:00
Tyler Miller
048d81a076 bsp/tms570: Add TMS570LC4357 PBIST support
Update #4982.
2024-01-15 10:33:19 +01:00
Sebastian Huber
36192165e2 bsp/tms570: Fix PBIST clock enable
Bit 1 of the PACT is reserved (writes have no effect).

Update #4982.
2024-01-15 10:33:17 +01:00
Sebastian Huber
eb97cd148c bsp/tms570: Add TMS570LC4357 BSP variants
Update #4982.
2024-01-15 10:33:15 +01:00
Sebastian Huber
437da01f80 bsp/tms570: Add linkcmds.memory
Remove obsolete tms570ls3137_hdk_with_loader BSP variant.  With the new
memory origin/size build options this variant is no longer required.

Update #4982.
2024-01-15 10:33:13 +01:00
Sebastian Huber
1b7a8af575 bsp/tms570: Add variant enable to build
Update #4982.
2024-01-15 10:33:11 +01:00
Sebastian Huber
285d1a4056 bsp/tms570: Avoid vector overlay memory region
Reserve the space in a section.  This makes it possible to use a common
memory region definition.

Update #4982.
2024-01-15 10:33:09 +01:00
Sebastian Huber
1dae4f9560 bsp/tms570: Remove obsolete build option
Update #4982.
2024-01-15 10:33:08 +01:00
Sebastian Huber
df067e5b69 bsp/tms570: Add TM27 support
Update #4982.
2024-01-15 10:33:06 +01:00
Sebastian Huber
cf01329e24 bsp/tms570: Avoid spurious interrupts
Update #4982.
2024-01-15 10:33:05 +01:00
Sebastian Huber
8753604ed5 bsp/tms570: Implement interrupt is enabled/pending
Update #4982.
2024-01-15 10:33:03 +01:00
Sebastian Huber
a6482ebfaa bsp/tms570: Implement set/get interrupt priority
Update #4982.
2024-01-15 10:33:01 +01:00
Sebastian Huber
27e0abbdb5 bsp/tms570: Avoid errno for debug console
Update #4982.
2024-01-15 10:33:00 +01:00
Sebastian Huber
849210fff6 bsp/tms570: Fix bsp_reset()
Update #4982.
2024-01-15 10:32:58 +01:00
Sebastian Huber
8240caecc8 bsp/tms570: Rename tms570_initialize_and_clear()
Rename tms570_initialize_and_clear() in
tms570_pom_initialize_and_clear().

Update #4982.
2024-01-15 10:32:56 +01:00
Sebastian Huber
2110125f7c bsp/tms570: Add bsp_restart()
Update #4982.
2024-01-15 10:32:54 +01:00
Sebastian Huber
600bd56543 bsp/tms570: Use new pin define
Update #4982.
2024-01-15 10:32:52 +01:00
Sebastian Huber
8e8b9bc0b7 bsp/tms570: Relicense to BSD-2-Clause
Change license to BSD-2-Clause according to file history and contributor
agreements.  Add Doxygen file comments.

Update #3053.
Update #3707.
Update #4982.
2024-01-15 10:32:45 +01:00
Sebastian Huber
58521f15f3 bsp/tms570: Remove empty <bsp/tms570-vim.h>
Update #4982.
2024-01-15 10:32:44 +01:00
Sebastian Huber
72ec63e7d8 bsp/tms570: Remove empty <bsp/tms570-sci.h>
Update #4982.
2024-01-15 10:32:42 +01:00
Sebastian Huber
222c98903f bsp/tms570: Remove empty <bsp/tms570-rti.h>
Update #4982.
2024-01-15 10:32:41 +01:00
Sebastian Huber
7427caa1ae bsps/arm: Use shared empty bsp_start_hook_0()
Update #4982.
2024-01-15 10:32:23 +01:00
Sebastian Huber
5dd9bc96d4 smpopenmp01: Convert to JSON data
This avoids a dependency on the non-standard libxml2 module.
2024-01-15 07:26:05 +01:00
Sebastian Huber
4f6f5f4643 smplock01: Convert to JSON data
This avoids a dependency on the non-standard libxml2 module.
2024-01-15 07:26:05 +01:00
Sebastian Huber
8e26f7ef02 sptimecounter02: Convert to JSON data
This avoids a dependency on the non-standard libxml2 module.
2024-01-15 07:26:05 +01:00
Sebastian Huber
7cf8aa7f72 tmtimer01: Convert to JSON data
This avoids a dependency on the non-standard libxml2 module.
2024-01-15 07:26:05 +01:00
Sebastian Huber
b8a9e0831b tmfine01: Convert to JSON data
This avoids a dependency on the non-standard libxml2 module.  Reorder
test cases according to expected performance.
2024-01-15 07:26:05 +01:00
Sebastian Huber
c8acc75763 tmcontext01: Convert to JSON data
This avoids a dependency on the non-standard libxml2 module.
2024-01-15 07:26:05 +01:00
Sebastian Huber
0b7f28c557 tmcontext01: Improve timing measurements for sparc
Use a SPARC-specific method to flush the register windows.  This
improves the timing measurements.
2024-01-15 07:26:05 +01:00
Sebastian Huber
08fd47b803 tmcontext01: Prevent optimizations
The previous method to prevent optimizations no longer worked at least
with GCC 13.  Disable intra-procedural optimizations.
2024-01-15 07:26:05 +01:00
Kinsey Moore
150dcf5e47 libio: Clean up usage of rtems_termios_device_mode
This cleans up outputUsesInterrupts usage with rtems_termios_device_mode
enum values. The outputUsesInterrupts member was typed as an int, named
as if it were a boolean value, and used as if it were a
rtems_termios_device_mode enum. In this patch, values assigned to
outputUsesInterrupts have been converted to the corresponding
rtems_termios_device_mode enum value, conversions from
deviceOutputUsesInterrupts have been made explicit, and uses of
rtems_termios_device_mode enum values with deviceOutputUsesInterrupts
have been converted to booleans.
2024-01-10 14:43:53 -06:00
Kinsey Moore
4092fbb2c0 bsps/aarch64/cache: Clean up unused fuctions
When the CPU_CACHE_SUPPORT_PROVIDES_RANGE_FUNCTIONS definition was added
to AArch64 cache management, it obsoleted the *_1_data/instruction_line
functions. These have been removed since they are no longer referenced.
The AArch64_instruction_cache_inner_shareable_invalidate_all function is
only used when RTEMS_SMP is defined, so only define it in that
circumstance.
2024-01-10 14:43:53 -06:00
Kinsey Moore
c37fdedec2 cpukit/dosfs: Jump to correct error handler
When encountering an error during filesystem creation, fat_fd must be
cleaned up appropriately once the file is opened. There was an
opportunity for a resource leak due to jumping to the incorrect error
handling label.
2024-01-10 14:43:53 -06:00
Joel Sherrill
baec0608d6 Revert "Include Xilinx support files also for Zynq7000"
This reverts commit d1d3ceb502.

Per discussions on devel@ and Discord.
2024-01-09 16:35:19 -06:00
Bernd Moessner
9d07bf67a9 xparameters.h: fix typo in comment 2024-01-08 17:42:58 -06:00
Bernd Moessner
d1d3ceb502 Include Xilinx support files also for Zynq7000 2024-01-05 12:07:52 -06:00
Kinsey Moore
e6fce3cd3d cpukit/dosfs: Cast away ignored return
An error is already being reported. Checking the return value of this
function is not useful.
2024-01-05 08:29:25 -06:00
Kinsey Moore
981d24e22a testsuites/fstests: Add JFFS2 NAND support tests
This adds a second set of JFFS2 tests running on top of a simulated NAND
backend to ensure that interactions with delayed writes operate as
expected.
2023-12-22 19:51:52 -06:00
Kinsey Moore
efc36cb467 cpukit/jffs2: Revert to non-granular locking
Revert JFFS2 to non-granular locking. This makes the superblock
available to the delayed work that it owns so that delayed work
processing can ensure that shared resources are being exclusively
accessed. This change only affects NAND systems. Moving forward with
granular locking will require a significant investment of time in
producing a test harness that doesn't require hardware such that this
can get a reasonable amount of test coverage.
2023-12-22 19:51:52 -06:00
Sebastian Huber
36960f9d9b fstests/tftpfs: Use rtems_test_run() 2023-12-19 09:53:40 +01:00
Sebastian Huber
db2495a943 libtest: Change verbosity to normal
A verbose verbosity is not required for normal test suite runs.  It may
be used to debug test cases.
2023-12-19 09:53:40 +01:00
Sebastian Huber
a901ca3989 doxygen: CONFIGURE_JFFS2_DELAYED_WRITE_TASK_PRIORITY
Document CONFIGURE_JFFS2_DELAYED_WRITE_TASK_PRIORITY.

Update #4961.
2023-12-19 08:26:46 +01:00
Sebastian Huber
93f927de26 tm27: Add TM27_INTERRUPT_VECTOR_ALTERNATIVE
The TM27 support may define TM27_INTERRUPT_VECTOR_ALTERNATIVE to provide
an alternative software generated interrupt request which is raised by
_TM27_Raise_alternative() and cleared by _TM27_Clear_alternative().
Both functions shall return an RTEMS status code.  This interrupt vector
may be used to test the interrupt controller support on targets which do
not provide generic software generated interrupts.

Update #3716.
2023-12-19 08:26:46 +01:00
Sebastian Huber
2e71bd08ba tm27: Add optional TM27_INTERRUPT_VECTOR_DEFAULT
Let the BSP define TM27_INTERRUPT_VECTOR_DEFAULT to more efficiently and
reliably get the TM27 default interrupt vector.

Update #3716.
2023-12-19 08:22:37 +01:00
Sebastian Huber
d4b369814a ftpd: Fix set but not used warning 2023-12-19 08:03:42 +01:00
Kinsey Moore
3798c5735d bsps/xnandpsu: Allow manipulation of BBT
Expose functions to directly manipulate the bad block table (BBT). These
functions are necessary to correct possible BBT corruption caused by
bugs in the BBT management layer.
2023-12-14 13:40:03 -06:00
Kinsey Moore
437053282d bsps/xnandpsu: Constrain block erasure to device
The XNandPsu_EraseBlock function takes a target device and a block
offset for erasure. Ensure the block offset is within the size of the
target device.
2023-12-14 13:40:03 -06:00
Kinsey Moore
d77a873ddb bsps/xnandpsu: Mark correct reserved blocks
When marking the trailing blocks on a device as reserved for Bad Block
Table usage, ensure that the correct blocks are marked. This resolves an
off-by-one error that was marking one block too low and leaving the last
block in the device unmarked.
2023-12-14 13:40:03 -06:00
Kinsey Moore
f823dba027 bsps/xnandpsu: Write BBT to correct location
When writing out the Bad Block Table, write it to the targeted device
and ensure the block is appropriately mapped to the targeted device.
2023-12-14 13:40:03 -06:00
Kinsey Moore
757fbd6bc7 bsps/xnandpsu: Detect missing BBTs
Mark the BBT descriptor as invalid before scanning to ensure that
missing BBTs are detected and written correctly if necessary.
2023-12-14 13:40:03 -06:00
Kinsey Moore
d6b75cc248 bsps/xnandpsu: Read correct BBT size
The Bad Block Table is a per-device catalog of the dispositions of each
block in the device. Only read enough data to determine the dispositions
of blocks for the device being read.
2023-12-14 13:40:03 -06:00
Kinsey Moore
7946cff0bc bsps/xnandpsu: Fix BBT mapping functions
The xnandpsu driver includes functionality to map back and forth between
the flash-based BBT and the memory-based BBT with the values in each
being a bitwise inversion of each other. This resolves several bugs in
this process and simplifies the inversion from operating on the block
representation to operating on the entire BBT entry (4 blocks, 2 bits
per block, one byte total).

Bugs resolved in XNandPsu_ConvertBbt():
* The calculation of memory BBT entry offset was off by a factor of 4
* The entry offset into the flash BBT has been removed since each flash
  BBT directly describes the flash space it is contained within and has
  no reference to other devices in the chip

Bugs resolved in XNandPsu_WriteBbt():
* The BBT length calculated was reduced to NumTargetBlocks from
  NumBlocks since only the relevant portion of the in-memory BBT should
  be written to the flash-based BBT space
* An offset was applied to values retrieved from the in-memory BBT so
  that only the relevant portion was converted and written to the
  flash-based BBT
2023-12-14 13:40:03 -06:00
Kinsey Moore
a6aa6c6385 bsps/zynqmp/jffs2: Use BBT information directly
The XNandPsu_IsBlockBad() function is insufficient for JFFS2 to
determine whether a block is usable since the function does not report
reserved blocks. JFFS2 is also unable to use the last 4 blocks of each
target attached to the NAND controller since they are reserved for the
Bad Block Table (BBT), but not necessarily marked as such.
2023-12-14 13:40:03 -06:00
Jacob Killelea
0883f7ec58 bsps/arm/stm32f4: Enable USART RX interrupts
Hi all, this is my first email patch submission and my first contribution to RTEMS, so please give any
feedback you have!

This patch enables interrupt driven data reception on USART ports on
STM32F4 series chips. This feature is gated behind the config flag
BSP_CONSOLE_USE_INTERRUPTS. If this flag is not set to True, the older
polling implementation will be used. I tested this feature on STM32F401CE
(blackpill) and STM32 Nucleo F411RE boards, with both capable of keeping
up with a 115200 baud continous data stream. With the older polling
implementation, both would drop bytes at 9600 baud. In addition, I
updated the implementation of usart_set_attributes to support changing
the baud rate of the USART port based on the input speed.
2023-12-14 13:40:03 -06:00
Sebastian Huber
3fe4b72b06 libtest: Fix test printer in rtems_test_run()
Route the test output through T_vprintf() only while the test suite
runs.  Otherwise, the begin/end of test message may not show up.
2023-12-14 11:32:22 +01:00
Sebastian Huber
583b8ccae7 psxftw01: Simplify and use rtems_test_run() 2023-12-14 11:12:49 +01:00
Sebastian Huber
2a7df50a73 libtest: Set test printer in rtems_test_run()
Route the test output through T_vprintf().
2023-12-14 11:12:49 +01:00
Sebastian Huber
46b32dd662 ftpd: Make socket timeout optional
This feature is not supported by lwIP.
2023-12-14 11:12:49 +01:00
Chris Johns
a9905de7a4 rtems-fdt: Fix node property access on 64bit 2023-12-14 07:49:42 +11:00
Chris Johns
7260887fa9 libmisc/shell: Work around tmux bug in row and column
- Extend the timeout to 150 msec for long remote sessions

- Improve the performance of the detection

Closes #4975
Closes #4977
2023-12-13 18:13:16 +11:00
Sebastian Huber
cfaf2641ec build: Fix default value 2023-12-12 19:45:15 +01:00
Sebastian Huber
2286a2ec19 bsp/tms570: Do not use POM for internal flash 2023-12-06 17:04:46 +01:00
Sebastian Huber
05a4c70aa9 bsp/tms570: Improve POM handling
Place the vector table in the start section so that the overlay can be
avoided if we execute from internal flash.  The problem is that when the
POM is enabled, the ECC cannot be enabled for the internal flash.
2023-12-06 14:27:48 +01:00
Sebastian Huber
c374727c63 bsp/tms570: Adjust BSP_OSCILATOR_CLOCK 2023-12-06 13:35:40 +01:00
Sebastian Huber
c65466929f bsp/tms570: Fix debug console baud setting 2023-12-06 13:35:40 +01:00
Sebastian Huber
232180a502 bsp/tms570: Use internal RAM for fast data 2023-12-06 13:35:40 +01:00
Sebastian Huber
47c4093ad3 bsp/tms570: Add TMS570LC4357 support 2023-12-06 13:35:40 +01:00
Sebastian Huber
75b6d77680 bsp/tms570: Add TMS570_VARIANT 2023-12-06 13:35:40 +01:00
Sebastian Huber
e13b7340fe bsp/tms570: Use 0x for hex constants 2023-12-06 13:35:40 +01:00
Sebastian Huber
3a0dcd5ee9 bsp/tms570: Replace TMS570_MMR_SELECT_GMII_SEL
Replace TMS570_MMR_SELECT_GMII_SEL with TMS570_MMR_SELECT_MII_MODE and
TMS570_MMR_SELECT_RMII_MODE.
2023-12-06 13:35:40 +01:00
Sebastian Huber
da35b37f92 bsp/tms570: Add pin configuration variants
Rearrange pin function bit fields to allow the clearing of all function
bits through TMS570_PIN_AND_FNC().

Move implementation details to source file.
2023-12-06 13:35:40 +01:00
Sebastian Huber
4c6f562dc4 bsp/tms570: Enable cache manager implementation 2023-12-06 13:35:40 +01:00
Sebastian Huber
56fc9f1283 bsp/tms570: Export -mbe32 to pkg-config 2023-12-06 13:35:40 +01:00
Sebastian Huber
ba89aae89d bsps/arm: BSP_START_VECTOR_ADDRESS_TABLE_ALIGNMENT
Add the BSP option BSP_START_VECTOR_ADDRESS_TABLE_ALIGNMENT to
optionally define an alignment of the vector address table begin.
2023-12-06 13:35:37 +01:00
Sebastian Huber
d4d257a1c0 build: Add assert-in-set option action 2023-12-06 11:46:02 +01:00
Bernd Moessner
fe35c8d5ee ZYNQ7000: Add support PYNQ, PicoZed, MicroZed, ZYBO and ZYBO Z7
This patch adds basic support for the following boards:

xilinx_zynq_pynq - PYNQ Z1 / Z2
xilinx_zynq_microzed - MicroZed 7010 / 7020
xilinx_zynq_picozed - PicoZed 7010 / 7015 / 7020 / 7030
xilinx_zynq_zybo - ZYBO
xilinx_zynq_zybo_z7 - ZYBO Z7-10 / Z7-20

N.b. Arty Z7-20 is basically a PYNQ Z1 - different board
color and updated Eth PHY.
2023-11-28 12:51:34 -06:00
Bernd Moessner
b2dd594422 Fix zedboard clock settings 2023-11-28 12:51:34 -06:00
Bernd Moessner
8cb6e36e96 Fix add missing clock settings for zc706 2023-11-28 12:51:34 -06:00
Sebastian Huber
ac16e3b961 libtest: Add hash to gcov info dump
This helps to validate that the data was transferred correctly.
2023-11-28 14:30:46 +01:00
Sebastian Huber
528f0e1947 validation: Add nested test case remarks
Close #4971.
2023-11-28 14:30:46 +01:00
Sebastian Huber
d586b3c014 libtest: Add T_add_remark()
This can be used to report that nested test cases did run in a test
case.

Update #4971.
2023-11-28 14:30:46 +01:00
Christian Mauderer
ac0b4ae5c4 bsps/imxrt1166: Disable video_mux
The pinctrl-0 of the video_mux might overwrite pin settings done by
other peripherals. Disabling it by default prevents unexpected pin
settings.
2023-11-28 13:36:41 +01:00
Christian Mauderer
02f2316be7 bsp/imxrt1166: Support GPIO CS pins in LPSPI
With this, it is possible to use GPIOs as CS pins in the LPSPI. To avoid
additional complexity, the GPIOs will have the same limitations as the
native (hardware) CS pins.

The GPIO CS feature adds a number of extra code when starting SPI
transfers on this controller. Therefore it is possible to disable the
additional code by just setting the IMXRT_LPSPI_MAX_CS option to 0. In
that case only native CS pins are supported.

At the moment, this feature is only enabled on i.MXRT1166 by default
because it is not tested on i.MXRT1050. But it should work there too.
2023-11-28 13:36:41 +01:00
Christian Mauderer
a38f9c57f9 bsps/imx*: imx_gpio from pointer to fdt property
Device trees allow mixing different kinds of GPIOs in one property. For
that it is usefull to only provide a pointer to an arbitrary location in
the property and initialize a GPIO from that.
2023-11-28 13:36:41 +01:00
Sebastian Huber
a180c138c7 validation: Remove superfluous includes
Update #3716.
2023-11-23 19:05:05 +01:00
Sebastian Huber
f279017882 validation: Improve MrsP validation
For uniprocessor configurations, the selection of
RTEMS_MULTIPROCESSOR_RESOURCE_SHARING results in a priority ceiling
mutex.

Build the MrsP validation tests only if RTEMS_SMP is enabled.

Update #3716.
2023-11-23 14:58:21 +01:00
Chris Johns
72c11fa91a waf: Fix Python 3.12 escape sequences
Updates #4968
2023-11-23 08:25:38 +11:00
Sebastian Huber
71c024eaca score: Fix typo in name 2023-11-21 11:51:56 +01:00
Philip Kirkpatrick
793c0f4671 bsps/arm: Add BSP for ZynqMP RPU 2023-11-20 10:43:55 -06:00
Kinsey Moore
001a0a4db6 bsps/clock: Import Xilinx TTC hardware definitions
This imports the TTC hardware definitions for the triple timer counters
on various Xilinx platforms. This was imported as specified in the
VERSION file in this commit.
2023-11-20 10:43:55 -06:00
Sebastian Huber
b414abcffe validation: Fix typos 2023-11-07 15:23:26 +01:00
Sebastian Huber
1a3125c0fe validation: Improve thread idle bodies test
Update #3716.
2023-11-07 15:23:26 +01:00
Sebastian Huber
6486d0bff9 build: Do not use coverage for librtemstest
The goal is to get code and branch coverage from actual tests and not
the test support itself.
2023-11-03 08:53:59 +01:00
Sebastian Huber
00e910e1f0 bsps/leon3: Install header files 2023-11-03 07:43:25 +01:00
Sebastian Huber
06f3780d60 build: Exclude performance test if RTEMS_GCOV_COVERAGE
The code coverage build is usually done without compiler optimizations.
This results in long performance test runtimes and useless performance
results.
2023-11-03 07:25:53 +01:00
Sebastian Huber
1adf143246 testsuites/unit: Add tests for compiler builtins
Test some compiler builtins which may use integer library routines:

https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html

Update #3716.
2023-11-02 16:25:44 +01:00
Sebastian Huber
0c65f9faf3 score: Fix implicit integer conversion warnings 2023-11-02 13:40:33 +01:00
Sebastian Huber
963327eaf3 build: Improve testsuite build selection
Enable an individual testsuite only through the corresponding enable.
Use BUILD_TESTS to change the default value of the individual testsuite
enable options.  This allows the user to enable all testsuites with
specific exceptions.

For example, this builds all testsuites except the benchmarks:

[arch/bsp]
BUILD_TESTS = True
BUILD_BENCHMARKS = False
2023-11-02 13:34:22 +01:00
Sebastian Huber
51d596281c imfs: Constify rtems_tarfs_load()
Change the public image data type to a void pointer.
2023-11-02 13:34:22 +01:00
Kinsey Moore
b0bd4bff49 cpukit/libfs/dosfs: Use enum values for enum init 2023-10-30 16:43:01 -05:00
Kinsey Moore
894ce51cd5 cpukit/score: Convert Thread_Life_state to uint32_t
Thread_Life_state is used as a bitfield, but is declared as an enum.
This converts the enum typedef to a uint32_t typedef and associated bit
definitions.
2023-10-30 16:43:01 -05:00
Kinsey Moore
bb6ed3bed7 bsps/xnandpsu: Always wrap page to device size
The xnandpsu driver conditionally tries to wrap page index to NAND chip
size causing an off-by-one error where the first page of the second chip
is not wrapped correctly. This removes the conditional so that page
index is always wrapped.
2023-10-27 11:33:44 -05:00
Kinsey Moore
3363fabb9d bsps/xnandpsu: Avoid loop counter reset
On configurations where multiple NAND chips are in use, the erasure
loop in XNandPsu_Erase() can reset the loop counter variable once it
gets to blocks in the second chip causing an infinite loop overwriting
parts of the first chip. This change ensures that the loop counter is
not accidentally reset.
2023-10-27 11:33:44 -05:00
Kinsey Moore
3339afb82e bsps/aarch64/zynqmp/nand: Erase using offset
Prefer use of XNandPsu_Erase instead of XNandPsu_EraseBlock since the
XNandPsu driver does not expose the primitives necessary to ensure
device readiness after the operation is complete.
2023-10-27 11:33:44 -05:00
Alex White
f6b1840f70 validation: Add wrapped bsp_interrupt_dispatch for MicroBlaze
This adds a MicroBlaze-specific bsp_interrupt_dispatch wrapper which
fixes a linker error.
2023-10-27 09:40:58 -05:00
Kinsey Moore
8a2c3af9cf bsps/xil: Adjust Xilinx support code for Cortex-R5
This fixes some issues in the Xilinx support code that are critical to
support the Cortex-R5F cores present in my Xilinx SoCs. The imported
Cortex-R5 xil_cache.c matches the existing information in
bsps/shared/xil/VERSION.
2023-10-24 09:52:27 -05:00
Kinsey Moore
7ea60d29d8 bsps/xil: Import Xilinx Cortex-R5 support
This imports Xilinx support code for the MPU and cache on Cortex-R5
cores. This was imported as specified in bsps/shared/xil/VERSION.
2023-10-24 09:52:27 -05:00
Sebastian Huber
b8f1988f15 doxygen: Replace and move main page
Replace the main page with a high level description of the RTEMS feature
set similar to:

https://docs.rtems.org/branches/master/user/overview/index.html#features

The replaced content can be found in the RTEMS Classic API Guide:

https://docs.rtems.org/branches/master/c-user/overview.html

https://docs.rtems.org/branches/master/c-user/key_concepts.html

Update #3705.
2023-10-23 11:16:39 +02:00
Sebastian Huber
8b6c64f9ec build: Let the get-integer action return None
If used with the format-and-define action, this will result in an
undefined define.
2023-10-23 11:10:17 +02:00
Sebastian Huber
36b935f1c3 sparc: Fix move of CPU counter implementation
This fixes a build error with RTEMS_PROFILING enabled.

Update #4954.
2023-10-20 15:16:27 +02:00
Sebastian Huber
958d517215 bsps/leon3: Use DSU time tag for GR712RC
Close #4954.
2023-10-20 11:20:14 +02:00
Sebastian Huber
601b84c758 bsps/leon3: leon3_counter_use_irqamp_timestamp()
Simplify leon3_counter_use_irqamp_timestamp().

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
ffa29bac30 bsps/leon3: Statically initialize get timecount
Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
8266a8a335 bsps/leon3: Move code blocks
Move code blocks to simplify C preprocessor usage.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
abb2f8bd66 bsps/leon3: Use custom CPU counter implementation
Merge the timecounter and CPU counter support for the leon3 BSP family.
Remove now unused functions from the CPU counter support of the erc32
and leon3 BSPs.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
ff533cec9d bsps/leon3: Simplify clock and CPU counter
Share the timecounter instance between the clock and the CPU counter.
This greatly simplifies the clock driver since we have to do the device
selection only in one place, the CPU counter support.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
3f03a6d2ef bsps/leon3: Make GPTIMER fall back mandatory
Using the auto reload counter which generates the clock ticks for the
timecounter or CPU counter is quite difficult and only works in
uniprocessor configurations.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
b6dc4b4707 sparc: Move CPU counter implementation
Enable a BSP-specific CPU counter implementation.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
8fe0fc4721 bsps/leon3: Optional IRQ(A)MP timestamp support
This is necessary to run the tests on SIS with profiling enabled.

Update #4954.
2023-10-20 11:16:53 +02:00
Sebastian Huber
95cf6e57be bsps/leon3: Update due to register API changes 2023-10-20 11:16:53 +02:00
Sebastian Huber
c15132aafd mpci: Hide implementation details
This improves the standard compatibility of API headers.  It fixes
errors like this if RTEMS_MULTIPROCESSING is enabled:

cpukit/include/rtems/score/processormask.h: In function 'uint32_t _Processor_mask_Find_last_set(const Processor_mask*)':
cpukit/include/rtems/score/processormask.h:339:21: error: 'flsl' was not declared in this scope
  339 |   return (uint32_t) __BIT_FLS( CPU_MAXIMUM_PROCESSORS, a );
      |                     ^~~~~~~~~
2023-10-20 11:16:53 +02:00
Tian Ye
a738d69bcf bsps/aarch64: Disable use of TTBR1
Force use of addresses that would be translated by TTBR1 to cause a
translation fault. RTEMS on AArch64 does not use TTBR1 and so attempted
translation of that address range could cause unexpected behavior in the
form of other exception types since TTBR1 is never set.
2023-10-18 10:14:42 -05:00
Kinsey Moore
e7cb79c39d cpukit: Remove unused includes 2023-10-13 19:02:15 -05:00
Kinsey Moore
5b22003411 bsps: Remove unused includes 2023-10-13 19:02:15 -05:00
Sebastian Huber
406ad8a5ae powerpc/t32mppc: Improve terminal settings 2023-10-13 09:51:29 +02:00
Sebastian Huber
ed2817c4c6 powerpc/t32mppc: Remove obsolete config options 2023-10-13 09:51:29 +02:00
Sebastian Huber
8290784378 powerpc/t32mppc: Fix console driver
Make sure that the message buffers are not garbage collected by the
linker.
2023-10-13 09:51:29 +02:00
Kinsey Moore
0a1d0dce3b cpukit/jffs2: Correctly init jffs2_inode_info
The repeated reinitialization of jffs2_inode_info must be done by the
members of the struct to avoid altering others.
2023-10-12 18:56:43 -05:00
Kinsey Moore
d7aa1ab86f cpukit/jffs2: Implement JFFS2 spinlocks
This provides a non-noop implementation of spinlocks for JFFS2 in terms
of RTEMS mutexes. POSIX spinlocks are not appropriate for the types of
actions that occur during a held JFFS2 spinlock and can cause bad
dispatch level conditions.
2023-10-12 18:56:43 -05:00
Kinsey Moore
c5476e2b8c bsps/xilinx-zynqmp: Unify JFFS2 OOB write locking
Ensure that a single locking session is carried over OOB writes
including the OOB read that is sometimes required. This removes the
possibility of another write occurring between the read and write that
would make the write incorrect.
2023-10-12 18:56:43 -05:00
Joel Sherrill
b9f7eb2a92 fat_fat_operations.c: Fix incorrect indentation 2023-10-12 18:56:29 -05:00
Sebastian Huber
43b74b142e validation: Support powerpc in test case
Update #4955.
2023-10-12 16:33:37 +02:00
Sebastian Huber
f7632d0dad testsuites/unit: Fix build error on aarch64
Update #3716.
2023-10-12 15:22:22 +02:00
Sebastian Huber
429727cdf3 testsuites/unit: Add tests for compiler builtins
Explicitly test the 64-bit integer division and modulo operations.  They
are essential for the timekeeping services.  On most 32-bit targets,
they need a software implementation.

Update #3716.
2023-10-12 14:11:03 +02:00
Sebastian Huber
2cb3d75d9e validation: Test CPU performance
Measure the runtime of 1000 no-operation instructions.  This may help to
investigate runtime measurement variations which do not result from code
generation or source code changes.

The runtime measurement of a function which does nothing and just
returns gives an estimate of the measurement overhead.

Update #3716.
2023-10-12 14:10:57 +02:00
Sebastian Huber
1781b517dd validation: Check thread dispatching detail
Update #3716.
2023-10-12 14:10:45 +02:00
Sebastian Huber
1c36971d92 sparc: Fix stack corruption
Fix a potential stack corruption in uniprocessor configurations during
start multitasking.

The system initialization uses the interrupt stack.  A first level
interrupt shall never interrupt a context which uses the interrupt
stack.  Such a use would lead to stack corruption and undefined system
behaviour.  Unfortunately, in uniprocessor configurations this was the
case.  Multiprocessing is started using _CPU_Context_restore().  The
caller of this function (_Thread_Start_multitasking()) uses the
interrupt stack.  Later we have in cpukit/score/cpu/sparc/cpu_asm.S:

        mov     %g1, %psr                     ! restore status register and
                                              ! **** ENABLE TRAPS ****

        ld      [%o1 + G5_OFFSET], %g5        ! restore the global registers
        ld      [%o1 + G7_OFFSET], %g7

        ! Load thread specific ISR dispatch prevention flag
        ld      [%o1 + ISR_DISPATCH_DISABLE_STACK_OFFSET], %o2
        ! Store it to memory later to use the cycles

        ldd     [%o1 + L0_OFFSET], %l0        ! restore the local registers
        ldd     [%o1 + L2_OFFSET], %l2
        ldd     [%o1 + L4_OFFSET], %l4
        ldd     [%o1 + L6_OFFSET], %l6

        ! Now restore thread specific ISR dispatch prevention flag
        st      %o2, [%g6 + PER_CPU_ISR_DISPATCH_DISABLE]

        ldd     [%o1 + I0_OFFSET], %i0        ! restore the input registers
        ldd     [%o1 + I2_OFFSET], %i2
        ldd     [%o1 + I4_OFFSET], %i4
        ldd     [%o1 + I6_FP_OFFSET], %i6

        ldd     [%o1 + O6_SP_OFFSET], %o6     ! restore the output registers

Between the ENABLE TRAPS and the restore of the output registers, we
still use the stack of the caller and interrupts may be enabled.  If an
interrupt happens in this code block, the interrupt stack is
concurrently used which may lead to a crash.

Fix this by adding a new function _SPARC_Start_multiprocessing() for
uniprocessor configurations.  This function first sets the stack pointer
to use the stack of the heir thread.

Close #4955.
2023-10-12 14:10:40 +02:00
Chris Johns
25a4dff56e bsp/i386/pc686: Clean up warnings 2023-10-04 13:17:13 +11:00
Sebastian Huber
a1fc6555a6 libtest: Include missing header file
This fixes the build if RTEMS_PROFILING is enabled.
2023-10-02 07:31:20 +02:00
Kinsey Moore
f3f8aa5b9b cpukit/aarch64: Resolve warnings with ILP32 ABI
Casts from uint64_t to void* must go through a uintptr_t cast to avoid
warnings when building with the ILP32 ABI since this is otherwise an
implicit truncation to 32bits for a pointer.
2023-09-26 09:02:48 -05:00
Kinsey Moore
99c637fbd9 cpukit/jffs2: Avoid use of off-chain semantics
This reworks the JFFS2 delayed work queue to avoid use of
on-chain/off-chain semantics since they vary in behavior under
RTEMS_DEBUG and are not guaranteed to be safe to use in SMP systems.
This adds all delayed work structs to the chain on FS init and does not
remove them until umount.

Updates #4956
2023-09-26 09:02:48 -05:00
Kinsey Moore
41d43cef6c bsps/xnandpsu: Ensure buffer cache sync
When a buffer is modified by both hardware components such as DMA and by
software components, the buffer cache state must be kept in sync so that
data is not accidentally thrown away during future invalidations.
2023-09-26 09:02:48 -05:00
Kinsey Moore
2b5526aa5e bsps/xnandpsu: Don't rely on usleep for polling
When polling hardware registers in high performance situations, don't
rely on usleep or other standard sleep functions since they will
necessarily rely on kernel ticks to be woken up. This can easily cause
an immense reduction in throughput.
2023-09-26 09:02:48 -05:00
Sebastian Huber
5a21b1d133 validation: Compatibility for other RTEMS versions
Make some performance tests compatible to other RTEMS versions which do
not allow changing the priority of a task which owns a priority
inheritance mutex.

Update #3716.
2023-09-26 09:40:20 +02:00
Sebastian Huber
3fa6e41c4c validation: Simplify partition performance test
Do not depend on <rtems/chain.h>.

Update #3716.
2023-09-26 09:40:10 +02:00
Sebastian Huber
a986262380 validation: Check stack of interrupted context
Check the stack of the interrupted context during the multitasking
start.

Update #4955.
2023-09-26 08:08:06 +02:00
Sebastian Huber
b3e4c41941 arm: Use a valid signed integer constant
Enumerators are restricted to signed integers in some C standards.
2023-09-26 08:04:30 +02:00
Sebastian Huber
535999041a psx13: Fix use of uninitialized variable warning 2023-09-26 08:04:30 +02:00
Sebastian Huber
ee63681aeb tests: Add header for RTEMS test printer
The <rtems/test-info.h> header file is required for every RTEMS test
program.  Move the RTEMS test printer support to a dedicated header file
<rtems/test-printer.h>.  This removes an unnecessary dependency to the
RTEMS printer support in <rtems/test-info.h>.

Tests using the RTEMS Testing Framework no longer depend on the
<rtems/printer.h>.
2023-09-26 08:04:30 +02:00
Kinsey Moore
3f3c646dea bsps/xqspipsu: Add SFDP config space read ability
This adds a function to allow reading of the SFDP configuration space
that describes attributes of NOR flash chips.
2023-09-23 09:42:30 -05:00
Kinsey Moore
853429c3f8 bsps/xqspipsu: Break out RDID
Expose a function to read the NOR flash chip ID information beyond the
minimum 3 bytes for the lookup table.
2023-09-23 09:42:30 -05:00
Sebastian Huber
109479e874 build: Remove enabled-by special case
Doing the enabled-by processing just for the ldflags and just for the
link custom commands is confusing.  Use an option instead which is
intended to be used for such use cases.
2023-09-22 07:59:11 +02:00
Sebastian Huber
de25f012b7 libdl: Use _CPU_Get_TLS_thread_pointer()
Update #4920.
2023-09-15 10:44:08 +02:00
Sebastian Huber
49a88a73a8 score: Add _CPU_Get_TLS_thread_pointer()
Add _CPU_Get_TLS_thread_pointer() to get the thread pointer which is
used to get the address of thread-local storage objects associated with
a thread.

Update #4920.
2023-09-15 10:44:08 +02:00
Sebastian Huber
580a457724 build: Add target to build scripts
Document that the build scripts in the testsuites produce a test program.
2023-09-15 10:44:08 +02:00
Sebastian Huber
2111497c0f rtems: rtems_configuration_get_interrupt_stack_size()
Fix rtems_configuration_get_interrupt_stack_size() for some code models.

The _ISR_Stack_size symbol has an arbitrary absolute address and may not
be representable in the code model used by the compiler.

Update #4953.
2023-09-15 10:44:08 +02:00
Sebastian Huber
206bbeb31b score: Fix TLS support for some code models
Store symbols with an arbitrary absolute address such as _TLS_Size,
_TLS_Alignment, _TLS_Data_size, and _TLS_BSS_size in an object to avoid issues
with some code models.

Update #4953.
2023-09-15 10:44:08 +02:00
Sebastian Huber
36b330910d bsp/stm32h7: Exclude some tests 2023-09-15 10:44:08 +02:00
Sebastian Huber
92fc82b54d arm/lm3s69xx: Exclude monitor test program
It is too big with GCC 13.
2023-09-15 10:44:08 +02:00
Sebastian Huber
5f8415b92e validation: Add RTEMS_DEFINE_GLOBAL_SYMBOL() test
Update #4953.
2023-09-14 14:25:49 +02:00
Sebastian Huber
1e7733aca6 sp37: Check ISR level of system init 2023-09-14 07:59:18 +02:00
Sebastian Huber
5dc43a04ef build: Merge regulator build into library item
There is no need to use a separate build object item.
2023-09-13 07:56:38 +02:00
Sebastian Huber
d7a6e80398 tests: Improve RTEMS_DEFINE_GLOBAL_SYMBOL() tests
Use a symbol value relative to an existing symbol address to make the
test work on more code models.

Update #4953.
2023-09-13 07:45:35 +02:00
Sebastian Huber
0add2d2edc score: Fix RTEMS_DEFINE_GLOBAL_SYMBOL()
The availability of a proper RTEMS_DEFINE_GLOBAL_SYMBOL() implementation
depends on __asm__() and thus __GNUC__.

Clarify documentation.

Update #4953.
2023-09-13 07:45:35 +02:00
Alex White
2bb23c7e84 microblaze: Fix relocation targets
Previously the addend was only used in 64 bit relocations. This
behavior was incorrect but did not cause the RTEMS libdl tests to
fail.
2023-09-12 11:20:58 -05:00
Sebastian Huber
d2d1fa18a9 build: Use build context for custom commands
Revert duplicated listing of TEST_OPTIMIZATION_FLAGS.

Close #4947.
2023-09-11 11:36:58 +02:00
Kinsey Moore
e152c9e06d bsps/zynqmp: Add locking around JFFS2 NAND adapter
The internal JFFS2 locking does not guarantee that delayed writes will
not step on other reads and writes to the device. This adds locking to
prevent that in the JFFS2 NAND interworking layer.
2023-09-06 08:53:02 -05:00
Kinsey Moore
8cea348934 bsps/xnandpsu: Ensure correct cache maintenance
The changes here ensure correct cache maintenance around DMA operations.
One cache flush was missing and two cache invalidations occurred before
the corresponding read that would make them necessary.
2023-09-06 08:53:02 -05:00
Kinsey Moore
fa85760c99 cpukit/jffs2: Avoid delayed work lock inversion
This moves delayed work to a temporary chain to prevent a locking
inversion between the delayed work lock and the alloc_sem lock. Delayed
work is now processed after the delayed work lock is released. Locking
order is any JFFS2 locks before the delayed work lock.
2023-09-06 08:53:02 -05:00
Alex White
51a79912e0 microblaze: Add link options to dl07, dl08, and dl09
This adds `-u__extendsfdf2` to the `ldflags` for the dl07, dl08, and
dl09 tests to force the inclusion of `__extendsfdf2` in the base image.
This function is part of the GCC software floating point library and is
used in the tests to convert floats to doubles when calling `printf`.
2023-08-30 11:05:33 -05:00
Alex White
cfb8a68f51 build: Allow enabled-by in ldflags for link_cc and link_cxx
This allows for conditionally setting 'ldflags' in scripts that use
`link_cc` and `link_cxx`. The immediate use case is allowing a linker
flag to be used only for MicroBlaze builds of certain tests.
2023-08-30 11:05:33 -05:00
Alex White
cd7ad64602 microblaze: Add dl05 to expected failures
Updates #4949
2023-08-30 11:05:33 -05:00
Alex White
d5318d6ae3 microblaze: Add dl06 to expected failures
Updates #4948
2023-08-30 11:05:33 -05:00
Alex White
a1b23d0e23 microblaze: Align exception-related sections
This fixes unaligned data access exceptions found while debugging test
dl05.
2023-08-30 11:05:33 -05:00
Alex White
feee169aa7 microblaze: Add libdl support 2023-08-30 11:05:33 -05:00
Chris Johns
ceb136c7b6 cpukit/libdl: Fix incorrect operator precedence access the name
Coverity Issue: CID 1442635 Out-of-bounds access
2023-08-28 13:52:46 +10:00
Chris Johns
ac6de5a3e9 cpukit/libdl: Correctly account for section alignments
- Add the section alignment to the size as the allocator may not
  provide correctly aligned memory

- Only include symbols in the section when locating symbols. The
  powerpc was incorrectly adding SDATA BSS symbols to the BSS offset
  overrunning the section

Closes #4950
2023-08-28 13:21:48 +10:00
Chris Johns
b9f11607b1 libdl: Realloc text memory if there are trampolines
- Add resize to the allocator interface

- Rework the trampoline variables in the obj struct
  to make better sense of what is happening

Closes #4944
2023-08-27 07:31:49 +10:00
Chris Johns
dcc6409f91 spec/testsuite/dl: Fix optimization flags
Updates #4944
2023-08-27 07:30:41 +10:00
Kinsey Moore
78001d5860 cpukit/score/aarch64: Use correct MAIR index
The MAIR index currently assigned (1) for uncached memory segments is
not configured properly for this purpose. Instead, this switches
uncached memory segment flags to MAIR index 2 which is properly
configured for uncached inner and outer shareable domains.
2023-08-22 12:19:16 -05:00
Joel Sherrill
3d0dc8450e x86_64/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Joel Sherrill
f7a7ea67fb v850/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Joel Sherrill
9d63841f2f sparc64/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Joel Sherrill
d4785deb76 sh/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Joel Sherrill
75be09f745 moxie/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Joel Sherrill
c4926fbb58 mips/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Joel Sherrill
2272100022 m68k/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Joel Sherrill
592e53b0b8 lm32/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Joel Sherrill
7b7b3578c3 i386/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Joel Sherrill
ae6718eca4 bfin/include/rtems/score/cpuimpl.h: Address unused parameter warning 2023-08-21 11:40:20 -05:00
Christian Mauderer
094355d4f1 bsps/arm/imxrt: Optimize nocache memory settings
The nocache-memory was set as device memory. It's not necessary to be
that strict. Set it to normal non-cacheable non-shareable memory
instead.
2023-08-21 09:13:16 +02:00
Christian Mauderer
685f193280 bsps/arm/imxrt1166: Enable USB
Enable the USB modules in the FDT.
2023-08-21 09:13:16 +02:00
Christian Mauderer
91b1c7b0a6 bsps/imxrt: Fix enabling USBPHY in fsl_clock
The mcux-sdk tries to enable the USBPHY. But it uses the wrong register
for that. This patch fixes the bug.
2023-08-21 09:13:16 +02:00
Chris Johns
27da374e48 libdl: Add support to import base image TLS symbols
This change requires an rtems-tools update for symbol generation.

Working architectures:
 - aarch64
 - arm
 - powerpc
 - sparc

No newlib TLS support but checked:
 - i386
 - m69k

Updates #4920
2023-08-21 11:16:17 +10:00
Kinsey Moore
723c096d57 spec/cpukit: Omit Cortex-M from libdebugger build
The current ARM support in libdebugger does not cover Cortex-M series
cores since it requires support for CP14 system register accessor
instructions. Cortex-M series cores support debug monitor mode, but its
configuration is accessed by memory mapped registers instead of using
CP14. This omits building libdebugger from BSPs that use a cortex-m ABI
flag.
2023-08-18 09:21:17 -05:00
zack
7b33aa2675 Address Regulator warning for no prototype for memset()
Closes #4942.
2023-08-15 09:29:56 -05:00
Sebastian Huber
67925cebd8 build: Make gzip archives reproducible 2023-08-14 08:25:28 +02:00
Chris Johns
663e0dae8a cpukit/libdl: AARCH64 unwind uses DWARF 2 tables
Closes #4943
2023-08-12 16:35:39 +10:00
Joel Sherrill
fd693085ea Add the Regulator Interface and test
Updates #4924.

The Regulator is an application support class which is used to
deal with the scenario where there is a bursty input source
which needs to be metered out to a destination sink. The maximum
size of bursts needs to be known and the delivery method must
be configured to deliver messages at a rate that allows the
traffic to not overflow.
2023-08-11 13:44:47 -05:00
Sebastian Huber
0a766a88d7 build: Make tar archives reproducible
This helps to make the build reproducible.
2023-08-11 07:54:09 +02:00
Sebastian Huber
ffec9f96fc arm: Fix cache support for ARM926EJ-S
The ARM926EJ-S is an ARMv5T architecture processor and lacks some
features of ARMv6 processors such as the ARM1176JZF-S.

Close #4940.
2023-08-10 08:34:34 +02:00
Sebastian Huber
52e595104c build: Clarify PROGRAM_PREFIX description 2023-08-10 08:17:22 +02:00
Uchenna Ezeobi
ae534d10df spec: Add -mstrict-align to mvme2100 default build
Update #3767
2023-08-09 15:17:13 -05:00
Sebastian Huber
3d13ab866e samples/iostream: Produce proper begin/end message
Print the full test information.
2023-08-09 17:38:43 +02:00
Sebastian Huber
62e39a8e47 rtems: Install <rtems/dev/io.h> 2023-08-09 10:26:06 +02:00
Sebastian Huber
a96f5df50b bsp/lpc32xx: Fix lpc32xx_magic_zero_size 2023-08-09 07:22:10 +02:00
Sebastian Huber
6cef96b1ab bsp/lpc32xx: Increase SDRAM size to 64MiB
Increase stage 2 bootloader size to 16MiB.
2023-08-09 07:22:10 +02:00
Sebastian Huber
b0285e5c9a bsp/lpc32xx: Remove hard to maintain comments
These comments duplicate the memory and region definitions of the linker
command file.
2023-08-09 07:22:10 +02:00
Sebastian Huber
573a7202e6 bsp/lpc32xx: Restore lpc32xx_set_translation_table_entries()
This implementation disables the MMU during the modification of the
translation table.  This behaviour is required by boot loaders for these
boards.
2023-08-09 07:22:10 +02:00
Sebastian Huber
5c2f2b304a bsp/lpc32xx: Fix warning
The type is a pointer.
2023-08-09 07:22:10 +02:00
Sebastian Huber
9a975e5211 validation: Fix variable type
This fixes test failures on targets using short enums.

Update #3716.
2023-08-09 07:18:26 +02:00
Sebastian Huber
e02be3a8d1 psxkey07: Fix POSIX key value pair configuration
Make sure we have enough POSIX key value pairs available.  This fixes a test
failure on some targets.

Make objects and functions static.  Initialize variable to get rid of warnings.
2023-08-04 09:56:37 +02:00
Sebastian Huber
0d76cc9f04 build: Add PROGRAM_PREFIX option
Replace --rtems-version with a PROGRAM_PREFIX option.  This allows also
the use of vendor tools.
2023-08-03 09:23:10 +02:00
Christian Mauderer
5115e6524f bsps/shared: Fix Coverity warning in MCP7940M
Fixes the following Coverity warning:

** CID 1539495:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
/bsps/shared/dev/rtc/mcp7940m.c: 317 in mcp7940m_set_time()

Basically coverity warns that (buf[...] & 0x7) can't be bigger than 7.
Just remove the unnecessary comparison.
2023-08-03 07:18:37 +02:00
Sebastian Huber
54a04cc917 build: Fix build dependency order 2023-08-02 11:02:11 +02:00
Sebastian Huber
aca1724c4c build: Optionally use a VERSION file
Define the RTEMS version in the wscript.  Optionally use a VERSION file
to change the default values of the wscript.  Allow the command line
option --rtems-version to override __RTEMS_MAJOR__.  Remove support for
command line configurable options (--rtems-option).

Rename internal define RTEMS_VERSION_VC_KEY to
RTEMS_VERSION_CONTROL_KEY.
2023-08-02 07:27:51 +02:00
Vijay Kumar Banerjee
d4587a698a spec: Remove empty reset from mvme3100 2023-08-01 22:48:17 -05:00
Karel Gardas
f89f0d8476 Revert "bsps/arm/beagle/dcan: Added DCAN support"
This reverts commit 26d50bdfb6.
2023-08-01 16:00:49 +02:00
Christian Mauderer
9f571b6494 bsps/arm/imx: Enable shared RTC support
This allows to use a I2C RTC together with this BSP.
2023-08-01 09:24:33 +02:00
Christian Mauderer
38dd86355d bsps/shared: Add MCP7940M RTC driver
The MCP7940M is a I2C RTC chip. The new driver uses the dev/i2c API to
support the RTC. It is written with the intention, that the driver can
be adapted to other RTCs with a similar register layout by just
replacing the initialization function.
2023-08-01 09:24:33 +02:00
Karel Gardas
d01fb75f6c bsps/stm32h7: add modification notice required by Apache License 2.0 2023-07-31 15:47:58 +02:00
Karel Gardas
0c10626f75 arm/stm32h7: build and install files added by new HAL 2023-07-31 15:15:10 +02:00
Karel Gardas
f08f75f0bd bsps/stm32h7: fix compilation issue after HAL update
Based on:

commit 99494370d6
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Wed Mar 4 12:34:34 2020 +0100

    bsp/stm32h7: New BSP

    Update #3910.
2023-07-31 15:15:10 +02:00
Karel Gardas
ba8ac65929 bsp/stm32h7: Add and use BSP Doxygen group
Inspired by:

commit fe58f6ce4b
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Thu Nov 26 08:13:52 2020 +0100

    bsp/stm32h7: Add and use BSP Doxygen group

    Update #3910.
2023-07-31 15:15:10 +02:00
Karel Gardas
7f3dc31336 bsps/stm32h7: workaround compilation issue with libbsd
Part of the new HAL requires float_t type definition. For that it includes
math.h header file which unfortunately brings a lot of math functions in.
One of them, 'log' conflicts with FreeBSD log function defined in systm.h
Provided hack is really just a crude work around this issue. Never thought
that Motorola 68881 would help me even in 21st century.
2023-07-31 15:15:09 +02:00
Karel Gardas
93bcf4e7a2 bsps/stm32h7: disable ETH_UpdateDescriptor as unused function 2023-07-31 15:15:09 +02:00
Karel Gardas
c2bae70c5d bsps/stm32h7: recreate stm32h7xx_hal_conf.h
Re-apply based on:

    commit 6bb6b69bb6
    Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
    Date:   Tue Apr 6 09:43:23 2021 +0200

        arm/stm32h7: Add STM32H7_HSE_FREQUENCY
2023-07-31 15:15:09 +02:00
Karel Gardas
1e99148578 bsps/stm32h7: Add init for sdmmc pins
Re-apply based on:

    commit 8fd29cfbc5
    Author: Christian Mauderer <christian.mauderer@embedded-brains.de>
    Date:   Tue Mar 2 16:14:41 2021 +0100

        stm32h7: Add init for sdmmc pins

        Update #4372
2023-07-31 15:15:09 +02:00
Karel Gardas
ed358507a3 bsp/stm32h7: Enable LL drivers
Re-apply based on:

    commit abb78587b6
    Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
    Date:   Wed Apr 1 11:11:59 2020 +0200

        bsp/stm32h7: Enable LL drivers

        Update #3910.
2023-07-31 15:15:09 +02:00
Karel Gardas
4b3d7993d2 bsp/stm32h7: Disable unused functions
Re-apply based on:

    commit e4ba06f8b4
    Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
    Date:   Thu Apr 2 08:28:56 2020 +0200

        bsp/stm32h7: Disable unused functions

        Update #3910.
2023-07-31 15:15:09 +02:00
Karel Gardas
f728eb4dc4 bsps/stm32h7: update STM32 H7 HAL
This patch updates STM32 H7 HAL source files. The files are taken from two
STM projects from their github.com repositories:

(i)
https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git

The project files are still available under BSD-3 license
and the version/commit used is:

d5fc8d05fc16fa2a2a2f948cf6c6ab39e78358e1

which represents post Release v1.11.1 development tree.

(ii)
https://github.com/STMicroelectronics/cmsis_device_h7.git

The project files were re-licensed from previous BSD-3 to Apache 2.0
license. Fortunately the project does not contain NOTICE file so no need
to do anything special when used in RTEMS.

The project version/commit imported is:

6d5ef249bec5177e0e2a0880ed62df2132874d99

which is code-wise Release v1.10.3 exactly.
2023-07-31 15:15:09 +02:00
Karel Gardas
49c296b324 bsps/arm: fix nested extern decl. warnings brought by CMSIS files update 2023-07-28 22:15:10 +02:00
Sebastian Huber
a41611ab4a bsps/irq: Remove unused parameter
Update #4862.
2023-07-28 17:18:07 +02:00
Sebastian Huber
6293fc4fd5 score: Assert scheduler index validity
Update #4844.
2023-07-28 17:13:14 +02:00
Sebastian Huber
64d9fc6e01 doxygen: Fix group memberships in libtest 2023-07-28 12:25:01 +02:00
Sebastian Huber
3ba43da922 score: Move <rtems/score/gcov.h>
Move <rtems/score/gcov.h> to <rtems/test-gcov.h>.  These functions do
not belong to an super core service.
2023-07-28 11:58:32 +02:00
Sebastian Huber
527af2b7f2 score: Move formatted I/O functions
These functions do not belong to an super core service.
2023-07-28 11:58:32 +02:00
Sebastian Huber
4516a5b797 build: Export BSP base and family via pkg-config
This allows application and library build systems to derive option
values from the BSP base and family names.
2023-07-28 07:50:15 +02:00
Sebastian Huber
c173f0581a bsp/leon3: Make declarations conditional
The LEON3_IrqCtrl_Adev object is only defined if LEON3_IRQAMP_BASE is
not defined.

The LEON3_Timer_Adev object is only defined if LEON3_GPTIMER_BASE is not
defined.

Close #4850.
2023-07-28 07:50:15 +02:00
Gedare Bloom
c1cad595af Revert "cpukit/dev/can: Added CAN support"
This reverts commit cd91b37dce.

Closes #4803.
2023-07-27 12:41:28 -06:00
Gedare Bloom
08a6b8c1ba Revert "build: Fix copyright statement format"
This reverts commit 5b124432e2.
2023-07-27 12:24:04 -06:00
Gedare Bloom
9e72a793ca Revert "cpukit/dev/can: Resolve warnings in 64bit builds"
This reverts commit 4c0a2d47e1.
2023-07-27 12:23:55 -06:00
Sebastian Huber
1bc5d3e481 sys: Add files to Doxygen group
Canonicalize brief descriptions.

Update #3707.
2023-07-26 07:18:29 +02:00
Sebastian Huber
ec1e500f4f timecounter: Add files to Doxygen group
Update #3707.
2023-07-26 07:18:29 +02:00
Sebastian Huber
d3fe128d67 posix: Add files to Doxygen group
Canonicalize brief descriptions.

Update #3707.
2023-07-26 07:18:29 +02:00
Sebastian Huber
5ba465c03b libcsupport: Add file to Doxygen group
Update #3707.
2023-07-26 07:18:29 +02:00
Sebastian Huber
233c21a232 score: Add files to Doxygen groups
Update #3707.
2023-07-26 07:18:29 +02:00
Frank Kühndel
3e1521eea1 bsps/sparc: Add files to Doxygen groups
Update #3707.
2023-07-26 07:18:29 +02:00
Sebastian Huber
58840ffbb0 rtems: Add files to Doxygen groups
Provide basic Doxygen comments.

Update #3706.
Update #3707.
2023-07-26 07:18:29 +02:00
Sebastian Huber
f99f5cec85 libtest: Place files into a Doxygen group
Canonicalize the file headers.

Update #3707.
2023-07-26 07:18:29 +02:00
Karel Gardas
c48c7d6f88 import Apache License 2.0 text file 2023-07-25 18:17:12 +02:00
Sebastian Huber
f8d4f16da6 score: Add workaround for GCC bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108658

This GCC bug leads to an incomplete code coverage status.

Update #4932.
2023-07-25 08:04:08 +02:00
Sebastian Huber
23c8a039b3 validation: Task entry return for idle threads
Update #3716.
2023-07-25 07:27:42 +02:00
Sebastian Huber
11d571787d rtems: Link config options and global construction 2023-07-25 07:27:40 +02:00
Sebastian Huber
0e70e989e6 rtems: Improve task entry wording 2023-07-25 07:26:01 +02:00
Chris Johns
c1d9dcbbb2 bsps/arm: Fix CMSIS v5 install files list 2023-07-25 11:03:07 +10:00
Kinsey Moore
46a4c5ea79 bsps/stm32h7: Make UART7 pins configurable
This change allows for the pins assigned to UART7 to be reconfigured via
config.ini.
2023-07-24 16:32:08 -05:00
Sebastian Huber
c8cae1d82d score: Move _IO_Relax() to new <rtems/dev/io.h>
This function is not a super core service.
2023-07-24 17:51:48 +02:00
Christian Mauderer
4a3ace7c7a bsps/imxrt: Add imxrt1166_cm7_saltshaker BSP
The BSP is for a custom i.MXRT1166 based board. At the moment, only the
cortex M7 is supported.
2023-07-24 14:41:06 +02:00
Christian Mauderer
780149bc38 bsps/imsrt: Make flash config more flexible
The flash configuration is something very board specific. So move the
file to a board specific location. Beneath that, not all controllers and
configurations need the flash config right at the address 0 of the
flash. For example on the i.MXRT11xx, the config has an offset for some
flash types.
2023-07-24 14:40:59 +02:00
Christian Mauderer
5bfcad2641 bsps/imx*: Support more GPIO controllers
The imx-gpio driver used in i.MX and i.MXRT BSPs generates a name based
on a fixed string. The original code only used one digit for the
controller. With the 13 GPIO controllers of the i.MXRT1166, that isn't
enough any more. This patch extends the name to two digits which should
be enough for the next controller generations.
2023-07-24 14:40:49 +02:00
Christian Mauderer
376db78f92 imxrt/mcux-sdk: Add HREQ-related bits
According to the reference manual the bits exist and they can be used.
Also confirmed by NXP support in the community forum:

https://community.nxp.com/t5/i-MX-RT/i-MXRT1160-LPSPI-HREQ-supported/m-p/1668647#M25512
2023-07-24 14:40:40 +02:00
Christian Mauderer
b831014b12 bsps/imxrt: Fix getting qtmr clock for i.MXRT11xx
The function returned a multiplexer value instead of the frequency.
2023-07-24 14:40:25 +02:00
Christian Mauderer
ffd8004cae bsps/imxrt1050: Install device tree sources
Useful for creating an application specific device tree that is based on
the evaluation board.
2023-07-24 14:40:12 +02:00
Karel Gardas
6b2318acef bsps/arm: replace CMSIS v4 with CMSIS v5 files
CAVEAT: license change from BSD to Apache2 license!

Explanation:
The imported files come from CMSIS v5 project available on:

https://github.com/ARM-software/CMSIS_5/tree/develop

The files imported are located inside the CMSIS/Core/Include
project sub-directory.

The project does not provide any NOTICE file in its root directory nor
in the directory of the imported files.
The NOTICE file and its usage in the Apache 2 license was/is
so far the only issue mentioned in discussion of RTEMS developers/users
when considering inclusion of the code under Apache 2 license
into the RTEMS project.
Since the CMSIS v5 project is free from this legal hinder, we may freely
use it and update files to the latest version.

Technical: the patch replaces code from 2015 with the latest version
which brings quite a lot of bug fixes and most importantly opens
possibilities to support MCUs based on new ARM cores.
2023-07-21 17:30:14 +02:00
Sebastian Huber
3a754a3de2 validation: Fix formatting 2023-07-21 09:32:33 +02:00
Sebastian Huber
610b54d83a testsuites: Remove stray ';' 2023-07-21 09:32:33 +02:00
Sebastian Huber
723c634d61 validation: Improve sparc/leon3 shutdown test
Test the shutdown halt separately from the SMP-specific shutdown
request.

Update #3716.
2023-07-21 08:20:11 +02:00
Sebastian Huber
5fb9ebfc9b doxgen: Document build system provided files
Update #3707.
2023-07-21 07:55:31 +02:00
Frank Kühndel
0afbd00958 unit: Test unlimited objects configuration
This unit test covers code paths which are only reached if unlimited
objects are used.

Update #3716.
2023-07-21 07:43:34 +02:00
Frank Kühndel
2fc7e04280 unit: Test POSIX-specific message queue impl
This unit test covers code paths of the Message Handler which are only
reached by through POSIX message queue API.

Update #3716.
2023-07-21 07:43:34 +02:00
Kinsey Moore
c2083e81f2 arm/stm32h7: Add support for STM32H750B-DK
This adds support for the STM32H750B-DK discovery kit. This kit includes
a built-in STLINKv3 debugger which provides a USB serial bridge for
USART3. USART1 is routed to the Arduino header and USART2 is routed to
the STMOD connector. This BSP reuses what would otherwise be duplicated
files from the stm32h747i-disco BSP. Note that system_stm32h7xx.c has
been imported from the STM repository with two minor changes wrapped
with #if __rtems__. This hardware has been tested with hello and ticker.
2023-07-20 09:14:36 -05:00
Sebastian Huber
49356594d3 rtems: Fix typo
Update #4772.
2023-07-20 15:05:33 +02:00
Kinsey Moore
21429f681d rtems: Update references to rtems_task_wake_after
rtems_task_wake_after takes a parameter in terms of a count of clock
ticks and not a measure in a subunit of seconds. This updates
documentation to reflect that. This also makes obvious the caveat about
the first tick wait not being a whole tick and points the user at a
replacement for better accuracy.

Updates #4772
2023-07-20 11:31:25 +02:00
Vijay Kumar Banerjee
7bca38340b powerpc/beatnik: Remove RTEMS_NETWORKING check from bsp.h 2023-07-19 19:10:33 -05:00
Sebastian Huber
fb0eb31a55 bsps/grlib: Fix use of uninitialized variable
Fixes Coverity CID 1538314.
2023-07-17 08:00:46 +02:00
Karel Gardas
0e4e9dd421 score/arm: improve printed exception information for Cortex-Mx CPUs
Sponsored-By:	Precidata
2023-07-14 12:38:14 +02:00
Sebastian Huber
1425735738 bsp/leon3: Simplify shutdown
Do not wait for other processors to halt.
2023-07-14 12:21:33 +02:00
Sebastian Huber
e6de385a97 validation: Test sparc/leon3 BSP family
Update #3716.
2023-07-14 12:21:33 +02:00
Sebastian Huber
2ede66f1bc validation: grlib
Update #3716.
2023-07-14 12:21:33 +02:00
Sebastian Huber
8d30ae9aa1 bsp/leon3: Add specialized target hash 2023-07-14 12:21:33 +02:00
Sebastian Huber
97f5e1c0cb bsp/leon3: Fix group memberships
Update #3706.
2023-07-14 12:21:33 +02:00
Sebastian Huber
3e0314e8be bsps/sparc: Remove BSP_POWER_DOWN_AT_FATAL_HALT
Remove the BSP_POWER_DOWN_AT_FATAL_HALT BSP option.  Applications should
do the customization of the system termination with an initial fatal
extension.
2023-07-14 12:21:33 +02:00
Sebastian Huber
63626a5d2e bsp/leon3: Enable up-counter conditionally 2023-07-14 12:21:33 +02:00
Sebastian Huber
dc16709697 bsp/leon3: Use LEON3_GPTIMER_BASE 2023-07-14 12:21:33 +02:00
Sebastian Huber
f6b7279687 bsp/leon3: Add LEON3_IRQAMP_EXTENDED_INTERRUPT 2023-07-14 12:21:33 +02:00
Sebastian Huber
1d1c0e5d9a bsp/leon3: Add LEON3_PROBE_ASR_22_23_UP_COUNTER 2023-07-14 12:21:33 +02:00
Sebastian Huber
3773a63b2a bsp/leon3: Simplify fatal error handling 2023-07-14 12:21:33 +02:00
Sebastian Huber
2aff2d03cb bsp/leon3: Move leon3_power_down_loop() 2023-07-14 12:21:33 +02:00
Sebastian Huber
314945468c bsp/leon3: Add LEON3_L2CACHE_BASE 2023-07-14 12:21:33 +02:00
Sebastian Huber
de278269ac bsp/leon3: Add LEON3_HAS_ASR_22_23_UP_COUNTER 2023-07-14 12:21:33 +02:00
Sebastian Huber
3f1186fd07 bsp/leon3: Add LEON3_IRQAMP_PROBE_TIMESTAMP 2023-07-14 12:21:33 +02:00
Sebastian Huber
824556e0b8 bsp/leon3: Add LEON3_IRQAMP_BASE 2023-07-14 12:21:33 +02:00
Sebastian Huber
8f235798a6 bsp/leon3: Add LEON3_GPTIMER_BASE 2023-07-14 12:21:33 +02:00
Sebastian Huber
ac9c55b017 bsp/leon3: LEON3_PLB_FREQUENCY_DEFINED_BY_GPTIMER 2023-07-14 12:21:33 +02:00
Sebastian Huber
fc97810ce3 bsp/leon3: Add LEON3_APBUART_BASE 2023-07-14 12:21:33 +02:00
Sebastian Huber
37880fc656 bsp/leon3: Use new L2CACHE register block API 2023-07-14 12:21:33 +02:00
Sebastian Huber
d85c505ab0 bsp/leon3: Use new GPTIMER register block API 2023-07-14 12:21:33 +02:00
Sebastian Huber
8c9daf56f8 bsp/leon3: Move system control register support
Move, document, and reformat support functions from <leon.h> to
<bsp/leon3.h>.
2023-07-14 12:21:33 +02:00
Sebastian Huber
c77a20e85b bsp/leon3: Use new IRQ(A)MP register block API 2023-07-14 12:21:33 +02:00
Sebastian Huber
32ff60293b bsp/leon3: Move and simplify bsp_irq_fixup() 2023-07-14 12:21:33 +02:00
Sebastian Huber
a5f95cbb57 bsp/leon3: Untangle interrupt controller support
Separate the probing of the interrupt controller from the
initialization.
2023-07-14 12:21:33 +02:00
Sebastian Huber
8fdecf6c55 bsps: Use new APBUART register block API 2023-07-14 12:21:33 +02:00
Sebastian Huber
49ad450d70 bsps/grlib: Use GRLIB definition of GRSPWROUTER
Rename parts to match with GRLIB naming.

Close #4842.
2023-07-14 12:21:29 +02:00
Sebastian Huber
06f631546f bsps/grlib: Remove obsolete header file
This header file was an incomplete duplicate of <grlib/grspw2-regs.h>.

Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
181d989530 bsps/grlib: Use GRLIB definition of GRSPW2
Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
cba956b5d0 bsps/grlib: Move GR740-specific registers
Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
584be21c3d bsps/grlib: Expand GRCLKGATE register bit fields
Use the maximum width supported by the GRLIB even if this exceeds the
configuration limits of a particular IP instance.

Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
e6427f1ea9 bsps/grlib: Add GRCAN - CanTxIRQ
Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
845422b859 bsps/grlib: Fix SPWTDP register name
Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
fe23259633 bsps/grlib: Expand SpaceWire port bit fields
Use the maximum width supported by the SpaceWire standard even if this
exceeds the configuration limits of a particular IP instance.

Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
7575890200 bsps/grlib: Fix SpaceWire RMAP - Product ID
Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
b7eb7d1f59 bsps/grlib: Fix GRGPIO - IRQMAP bit fields
Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
e56cecf501 bsps/grlib: Fix FTMCTRL - MCFG1 bit fields
There was an off by one error in all bit fields.  Add the R flag.

Update #4842.
2023-07-14 09:11:19 +02:00
Sebastian Huber
2d71cba033 bsps/grlib: Add generated headers
Close #4828.
2023-07-14 09:11:19 +02:00
Kinsey Moore
f46c15fd76 spec: Add QEMU test annotations
QEMU is known to fail certain tests intermittently due to clock tick
delivery issues. This defines those tests as intermittent for BSPs
intended to run on QEMU alone.

Updates #4922
Updates #4072
2023-07-10 09:11:13 -05:00
Joel Sherrill
6264b14804 Revert accidentally committed "Remove unused _IO_Relax"
Sebastian has agreed to move this out of score. I should have
removed this patch from my tree but accidentally committed it
with another patch.
2023-07-03 10:32:53 -05:00
Kinsey Moore
3d8fa0ef00 aarch64/zynqmp: Use IRQs for management console
Swap the zynqmp management console to interrupt-driven operation to
avoid losing data in under-polled situations.
2023-07-03 10:13:44 -05:00
Joel Sherrill
e49e8daf3d Remove unused _IO_Relax
The only use was in a test.
2023-07-03 10:11:58 -05:00
Karel Gardas
56d21a7acc bsps/stm32h7: disable MPU alignment for M4-based BSP variants
There is no point in wasting precious memory space on enforced section
alignment for the purpose of MPU which is not implemented on M4 core
anyway.
2023-06-29 22:46:13 +02:00
Sebastian Huber
ca0a11e443 build: Remove superfluous attributes 2023-06-28 10:28:04 +02:00
Aaron Nyholm
4b209a322e cpukit/flash: Correct erase ioctl address
Previously, the erase ioctl call would ignore flash regions and erase at
the absolute address passed in. This adds a check for if the region is
set and adds the region offset accordingly.
2023-06-27 07:50:40 +10:00
Kinsey Moore
333fd02631 bsps/xqspipsu: Handle SMP systems properly
The NOR driver was not written with SMP systems and caching in mind.
This makes the IsBusy flag volatile for updates across cores and
introduces cache flushing and invalidation where necessary for data
manipulated by the DMA engine in the QSPI peripheral.
2023-06-22 10:46:33 -05:00
Sebastian Huber
65b0ba4d8a bsps/sparc: Deprecate BSP-specific interrupt API
Update #3269.
2023-06-16 07:30:50 +02:00
Sebastian Huber
4e3e9df1b4 bsps: Remove uses of BSP-specific interrupt API
Update #3269.
2023-06-16 07:30:50 +02:00
Sebastian Huber
83305f5050 pci: Do not use BSP-specific interrupt API
Update #3269.
2023-06-16 06:35:22 +02:00
Sebastian Huber
bbc9f7ef13 build: Remove unused file 2023-06-16 06:35:22 +02:00
Sebastian Huber
97a4b306f4 bsp/leon2: Include missing header file
Update #4458.
2023-06-15 20:04:22 +02:00
Sebastian Huber
32c14694db build: Format with yapf 2023-06-14 14:19:39 +02:00
Sebastian Huber
c9665ff1a1 build: Do not install removed files 2023-06-12 21:01:06 +02:00
Sebastian Huber
8383b56e48 Update company name
The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.
2023-06-12 07:46:23 +02:00
Sebastian Huber
a799809213 score: Remove CPU port atomic operations API
Use the C/C++ standard API directly.
2023-06-12 07:46:23 +02:00
Sebastian Huber
0613593148 score: Remove CPU port specific cpuatomic.h
All CPU ports used the same <rtems/score/cpustdatomic.h> header file to
provide the atomic operations.  Remove the header file indirection.
2023-06-12 07:46:23 +02:00
Sebastian Huber
e58f25a924 xilinx-zynqmp: Include <rtems/termiostypes.h>
Include <rtems/termiostypes.h> for the Termios device driver support.
2023-06-12 07:45:12 +02:00
Kinsey Moore
ea27adaa0d testsuites/flashdev01: Use correct page_size type
The page size ioctl requires an int pointer to retrieve the page size.
The test currently uses a size_t which mostly works fine for systems
where size_t and int are the same size, but can leave junk data in the
upper bits when they differ in size causing an assert in the test to
fail in some cases. This updates the variable to the correct type.
2023-06-10 11:02:29 -05:00
Kinsey Moore
09fd5dd353 bsps/xqspipsu: Use device information from the FCT
Instead of statically defining the device parameters, use the device
information available via the NOR device layer's Flash Configuration
Table.
2023-06-08 09:48:44 -05:00
Kinsey Moore
7a14c3df8b bsps/xqspipsu: Calculate erase sectors correctly
When given the exact bounds of a sector, the current algorithm
calculates that 3 sectors need to be erased. This corrects the
calculation such that only 1 sector needs to be erased for erasures that
exactly match sector boundaries.
2023-06-08 09:48:44 -05:00
Kinsey Moore
4ca4311036 bsps/xqspipsu: Correct s25fl512s flash definition
The definition for the s25fl512s flash chip is incorrect. This updates
the sector size and page size values to match the datasheet.
2023-06-08 09:48:44 -05:00
Kinsey Moore
a67aab6cd4 bsps/xqspipsu: Ensure NOR writes align
This change causes NOR writes to be broken according to page boundaries.
Writes across page boundaries cause the writes beyond the boundary to
fail silently. This also introduces a new function that will explicitly
write pages.
2023-06-08 09:48:44 -05:00
Joel Sherrill
b2967081e5 xilinx-zynqmp: Include <rtems/libio.h> for rtems_termios_initialize() 2023-06-06 17:34:43 -05:00
Joel Sherrill
bb5dbff74a Move various compression libraries into single subdirectory
This improves the organization of the cpukit.

Closes #4912.
2023-06-06 09:09:44 -05:00
Chris Johns
a83dc4a469 termios: Install <rtems/termiosdevice.h> 2023-06-05 11:49:30 +10:00
Sebastian Huber
0c3d6f58f1 termios: Add <rtems/termiosdevice.h>
Add <rtems/termiosdevice.h> which does not depend on <rtems/libio.h> to
provide rtems_termios_device_context and rtems_termios_device_handler.
For polled serial device drivers, this removes a header file dependency
to the full file system support.
2023-05-31 10:07:17 +02:00
Joel Sherrill
63415655e3 score/src/pheap*: Remove unreferenced methods
* _Protected_heap_Get_block_size
  * _Protected_heap_Iterate
  * _Protected_heap_Resize_block

Closes #4909.
2023-05-26 10:12:51 -05:00
Sebastian Huber
bdb4bc436f arm: Use RTEMS_XCONCAT()
Prefer macros with a proper namespace.
2023-05-26 06:56:11 +02:00
Sebastian Huber
5da3ff47df arm/xilinx-zynq: Initialize debug console once 2023-05-26 06:56:11 +02:00
Sebastian Huber
bc31fb65d2 arm/xilinx-zynq: Do not provide legacy API
The header file <rtems/irq.h> provides a legacy API.  Do not provide it
by default through <bsp/irq.h>.
2023-05-26 06:56:11 +02:00
Sebastian Huber
da2b49e7b7 bsps/arm: Use interrupt entry for IPI
Avoid a dynamic memory allocation for the inter-processor interrupt.
2023-05-26 06:56:11 +02:00
Sebastian Huber
eff408b64f bsps/arm: Use interrupt entry for clock driver
Avoid a dynamic memory allocation for the clock driver interrupt.
2023-05-26 06:56:11 +02:00
Sebastian Huber
363fafb780 bsps/arm: Use interrupt entry for <tm27.h>
Avoid a dynamic memory allocation for the <tm27.h> interrupts.  Replace
assert() with _Assert().
2023-05-26 06:56:11 +02:00
Sebastian Huber
49720a90d8 arm/xilinx-zynq: Improve Doxygen file comments 2023-05-26 06:56:11 +02:00
Sebastian Huber
ebe4224dce bsps/arm: Improve Doxygen groups 2023-05-26 06:56:11 +02:00
Sebastian Huber
f69326d0c2 bsps: Improve Doxygen file comments 2023-05-26 06:56:11 +02:00
Sebastian Huber
991919da3b arm: Improve Doxygen file comments 2023-05-26 06:56:11 +02:00
Sebastian Huber
eb299786c6 rtems: Document scheduler configuration API 2023-05-24 14:58:59 +02:00
Sebastian Huber
3c1e264db6 smptests: Print proper end of test message
Make sure that the end of test message is not mixed up with other test
output.
2023-05-23 14:19:13 +02:00
Kinsey Moore
6bc3ad3ed4 libdl: Add support for LDST128_ABS_LO12_NC 2023-05-22 08:55:47 -05:00
Christian Mauderer
6f034c18e8 imx_iomux: Don't set reserved bits in PAD_CTL
On most i.MX* the upper bits in SW_PAD_CTL are reserved. On some chips,
like the i.MXRT1166, they are a domain write protection. Setting them to
1 can have unexpected side effects.

The device tree uses these bits for some flags. Make sure that they are
not accidentally written to some value.
2023-05-22 09:45:42 +02:00
Christian Mauderer
2fdd1d0246 bsps/imxrt: Make the OCRAM address configurable
Depending on the chip variant, the OCRAM can have different addresses.
Make it configurable.
2023-05-22 09:45:42 +02:00
Christian Mauderer
97819b8a31 bsps/imxrt: Move board specific files
Move the files that are board specific and not specific to the chip
family into a separate folder.
2023-05-22 09:45:42 +02:00
Christian Mauderer
c1a949745f bsps/imxrt: Make chip start code chip specific
Some parts of the startup code don't apply for all chips. Make that part
chip specific.
2023-05-22 09:45:42 +02:00
Christian Mauderer
dd68ed6075 bsps/imxrt: Support more chip variants in header
The different variants of the i.MXRT have some minimal differences in
the fsl_flexspi_nor_config.h. Make sure that the header supports the
different chips.
2023-05-22 09:45:42 +02:00
Christian Mauderer
d941dd0dad bsps/imxrt: Remove unmaintained defines
The defines for the different clock frequencies in the
fsl_clock_config.h do not represent the clock frequencies that have been
set up in the registers. Remove them to avoid someone trusting in
correct values.
2023-05-22 09:45:42 +02:00
Christian Mauderer
bb2e2d0c30 bsps/shared: Fix header for fsl-edma
If a different chip variant is used in the i.mxrt BSP, a different
header would have to be included. Make sure that the fsl-edma driver
uses a header that doesn't have to be adapted.
2023-05-22 09:45:42 +02:00
Christian Mauderer
5e78c76c79 bsps/imxrt: Get clock for IMXRT11xx in drivers
The mcux_sdk has a different interface for getting the clock for
IMXRT11xx than for getting it in IMXRT10xx. Adapt simple drivers to
support that interface.
2023-05-22 09:45:42 +02:00
Christian Mauderer
f3df09352c bsps/imxrt1052: PLL config based on speed grade 2023-05-22 09:45:42 +02:00
Christian Mauderer
f467635161 bsps/imxrt: Adapt to new mcux-sdk version
Remove the old NXP MCUXpresso SDK and adapt the BSP so that it uses the
new mcux-sdk.
2023-05-22 09:45:36 +02:00
Christian Mauderer
4cb2b07402 bsps/imxrt: (Re-)Apply RTEMS patches to new lib
Reapply patches used in the old version of the NXP library and apply
patches necessary for the new version of the library.
2023-05-22 09:43:48 +02:00
Christian Mauderer
38ad41ecce bsp/imxrt: Update support library from mcux-sdk
This imports new files from the mcux-sdk support library. NXP now offers
the library as a git repository instead of a zip package. The git
repository supports multiple CPUs from the i.MXRT family:

  https://github.com/nxp-mcuxpresso/mcux-sdk.git

The imported files are from revision

  2b9354539e6e4f722749e87b0bdc22966dc080d9

This revision is the same as MCUXpresso 2.13.0 with small bug fixes.

For importing the files, a script has been used, that parses the
mcux-sdk cmake files and creates the yaml files for RTEMS:

https://raw.githubusercontent.com/c-mauderer/nxp-mcux-sdk/d21c3e61eb8602b2cf8f45fed0afa50c6aee932f/export_to_RTEMS.py
2023-05-22 09:43:48 +02:00
Sebastian Huber
bcef89f236 Update company name
The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.
2023-05-20 11:05:26 +02:00
Alex White
9b7a1da804 bsps/microblaze: Add device tree support to GPIO 2023-05-19 12:32:18 -05:00
Alex White
59f9ed28d8 bsps/microblaze: Remove GPIO build system options
The number of GPIO devices along with each of their particular
configurations is application-specific. Encoding this information as
build options also introduced a lot of clutter.
2023-05-19 12:32:18 -05:00
Sebastian Huber
c588daecb9 rtems: Reference types in construct directives 2023-05-19 08:09:37 +02:00
Sebastian Huber
60c291a128 rtems: Add constraint to types 2023-05-19 08:09:37 +02:00
Sebastian Huber
976f208ff2 validation: Add checks to static assert tests
This ensures that the test cases have at least one test step.

Update #3716.
2023-05-19 08:09:26 +02:00
Sebastian Huber
9db208019b validation: RTEMS_STATIC_ANALYSIS
Improve the validation of this define which is not defined for normal
builds.

Update #3716.
2023-05-19 08:08:45 +02:00
Sebastian Huber
1a2d797a97 validation: Fix formatting
Update #3716.
2023-05-19 08:08:45 +02:00
Sebastian Huber
28fabc299f validation: rtems_scheduler_get_maximum_priority()
Validate this directive for the EDF SMP scheduler.

Update #3716.
2023-05-19 08:08:45 +02:00
Sebastian Huber
367427d07b validation: Improve formatting
This enables automatic Doxygen links.

Update #3716.
2023-05-19 08:08:45 +02:00
Sebastian Huber
ee74893267 validation: Add group for runtime measurements
Update #3716.
2023-05-19 08:08:45 +02:00
Sebastian Huber
649dc37c8f validation: Use spec:* references
Update #3716.
2023-05-19 08:08:45 +02:00
Sebastian Huber
64fdb08900 validation: Fix formatting
Update #3716.
2023-05-19 08:08:45 +02:00
Sebastian Huber
72465f86d5 validation: Fix typo
Update #3716.
2023-05-19 08:08:45 +02:00
Sebastian Huber
8bc15aba56 validation: Validate RTEMS_NO_TIMEOUT
Update #3716.
2023-05-19 08:08:43 +02:00
Sebastian Huber
c821b925f7 validation: Test the global construction
Update #3716.
2023-05-19 07:47:37 +02:00
Sebastian Huber
94df7a0125 basedefs.h: Improve formatting 2023-05-19 07:47:37 +02:00
Sebastian Huber
69635b3b1c basedefs.h: Add proper brief description 2023-05-19 07:47:37 +02:00
Sebastian Huber
35106bd8e0 rtems: Conditionally include MPCI header 2023-05-19 07:47:37 +02:00
Aaron Nyholm
c2913ec414 libmisc/shell: Fix file pointer leak and improved input data sanitation.
Coverity #1530126
Coverity #1530125
2023-05-17 13:41:44 -05:00
Tian Ye
e06152b82d bsps/aarch64: Fix 128bit q register print bug 2023-05-16 08:41:29 -05:00
Joel Sherrill
3f4454b686 _TOD_Adjust method is unused. Remove it.
Use of this method was likely eliminated during the rework to use
FreeBSD bintime/sbintime.

Close #4905.
2023-05-16 08:40:51 -05:00
Aaron Nyholm
94a7d17b09 aarch64/versal: Fix uart interrupt issues 2023-05-16 12:48:53 +10:00
Aaron Nyholm
8e3ab34051 testsuites/libtests: Add test for flashdev 2023-05-16 12:48:23 +10:00
Aaron Nyholm
984693a4b3 libmisc/shell: Add flashdev command 2023-05-16 12:48:18 +10:00
Aaron Nyholm
15d4428e96 cpukit/flash: Add API for Flash devices 2023-05-16 12:48:13 +10:00
Sebastian Huber
1f00afcb5a zlib: Update from 1.2.5 to 1.2.13
The updated files were extracted from:

https://www.zlib.net/zlib-1.2.13.tar.xz

The archive had an SHA-256 hash value of:

d14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98

Close #4902.
2023-05-09 15:07:09 +02:00
Karel Gardas
bf53ff2de2 bsps/amd64: add a new EFI-based variant of AMD64 BSP
The new amd64efi BSP supports:
- multiboot2 boot format. Runs well with GRUB.
- console based on either EFI simple text output or GOP-based framebuffer
- clock based on EFI event/timer API
- early console using either hard-wired PC-AT serial or just memory buffer
- with EFI support disabled the BSP is more or less equivalent to amd64 BSP
  with multiboot2 support
2023-04-29 20:41:23 +02:00
Karel Gardas
1590df5f9a bsps/amd64: increase CPU alignment to 16
AMD64 requires SSE support which operates on 128bit data values.
2023-04-29 20:41:23 +02:00
Karel Gardas
8804422a48 bsps/shared: import FreeBSD libefi library
The library is imported in minimalist version just to support future
amd64efi BSP.

The FreeBSD tree commit id with imported libefi version is:
ce7b20e5129cf0f269951b313d336a9c7d54d790
2023-04-29 20:41:23 +02:00
Sebastian Huber
020163e5b7 build: Remove superfluous attribute 2023-04-26 11:40:09 +02:00
Sebastian Huber
6979b03b0c score: Simplify _Objects_Is_api_valid()
Close #4863.
2023-04-26 10:39:34 +02:00
Sebastian Huber
863b26ee3a score: Avoid cyclic header file dependencies
There was a cyclic dependency: For RTEMS_STATIC_ANALYSIS we needed
basedefs.h in assert.h. For RTEMS_UNREACHABLE() we needed _Assert() from
assert.h in basedefs.h.

Fix this by introducing _Debug_Unreachable() in basedefs.h.

Add RTEMS_FUNCTION_NAME to basedefs.h and use it in basedefs.h and
assert.h.

Close #4900.
2023-04-25 08:25:33 +02:00
Chris Johns
3e4fa73935 bsps/powerpc: Fix warnings with PPC_SPECIAL_PURPOSE_REGISTER 2023-04-24 09:13:45 +10:00
Maldonado, Sergio E. (GSFC-580.0)
fe6a5d0f7a bsps/microblaze: Fix UART transmit interrupt 2023-04-19 09:55:43 -05:00
Maldonado, Sergio E. (GSFC-580.0)
c627a13239 bsps/microblaze: Add support for multiple UARTs 2023-04-19 09:55:43 -05:00
Maldonado, Sergio E. (GSFC-580.0)
1fbfc4eeac bsps/microblaze: Allow copying FDT from U-Boot 2023-04-19 09:55:43 -05:00
Kinsey Moore
7e119562ae bsps/aarch64: Enable MMU during remaps
The MMU must be enabled during mapping changes and TLB invalidations.
When this is not the case, TLB updates do not occur correctly in all
cases. This is especially apparent when changing a block entry to a
table entry when remapping small memory ranges in an otherwise
contiguous block.
2023-04-18 08:28:35 -05:00
Kinsey Moore
078bbbc9c8 spec: Silence benign warnings in 3rd party code
Do not warn about excessive shifts in imported Xilinx driver code when
building with the ILP32 ABI. The two instances of this warning produce
the desired effect of setting the upper address bits to 0.
2023-04-17 17:16:38 -05:00
Kinsey Moore
5a37722b06 spec/pkgconfig: Allow builds to override headers
This allows any builds targeting an installed RTEMS BSP to override
headers in the installed BSP reliably, including headers previously
installed by that or other builds. This includes applications, network
stacks, libraries, and any other builds.

Closes #4896
2023-04-14 08:36:52 +10:00
Chris Johns
407c87cd88 bsps/powerpc: Fix warnings with PPC_SPECIAL_PURPOSE_REGISTER 2023-04-11 14:55:02 +10:00
Chris Johns
25e1a11402 bsps/motorola_powerpc: Change defines from BSP names to avoid clash
- Change mvme2100 to mot_pcc_mvme2100 to avoid clashing with the
  RTEMS_BSP value for the BSP. You cannot have a define that is the
  BSP name.
2023-04-11 14:54:54 +10:00
Chris Johns
2715d0953d bsps/motorola_powerpc: Add spec support for BSP defines
- These are need by the net legacy stack
2023-04-06 14:05:42 +10:00
Chris Johns
2138ce43c5 bsps/mvme2700: Add MVME2700 BSP 2023-04-06 08:41:16 +10:00
Kinsey Moore
05dd54d11c cpukit/libdl: Resolve size mismatch warnings
Resolve warnings about mismatched pointer and integer sizes in AArch64
libdl when building with the ILP32 ABI.
2023-04-05 08:19:09 -05:00
Sebastian Huber
675a741023 bsp/qoriq: Build VME Tundra Tsi148 driver 2023-04-05 14:24:39 +02:00
Sebastian Huber
e9127eeef4 bsps/vme: Remove quirk
printk() supports long long integers.
2023-04-05 14:21:49 +02:00
Sebastian Huber
64fe53cb51 bsps/vme: Include missing header file 2023-04-05 14:19:07 +02:00
Sebastian Huber
32fe5724a8 bsps: Mark argument as unused
Update #4862.
2023-04-05 14:18:12 +02:00
Alan Cudmore
4021b87e00 spec: add riscv kendrytek210 variant build options
This patch includes the spec/build options for the riscv kendrytek210
BSP variant. It includes options to allow the frdme310arty console
UART to be used on multiple BSPS, device tree options, memory
options, and other required options for the variant.

Updates #4876
2023-03-28 14:04:04 -05:00
Alan Cudmore
26853a0624 bsps/riscv: add riscv/kendrytek210 BSP variant source changes
This patch adds support for the Kendryte K210 RISC-V BSP variant.
The SoC uses the existing Interrupt Controller, Timer, and console UART.
It only needs SoC specific initialization and an embedded device tree binary
similar to the polarfire SoC BSP.

Updates #4876
2023-03-28 14:04:04 -05:00
Alan Cudmore
ca1c4e70f5 bsps/riscv: add device tree source and device tree blob header for k210 bsp variant
This patch adds the k210 device tree source and the corresponding
device tree blob encoded in the header which is used for the
embedded device tree blob for the Kendryte K210 BSP variant.

Updates #4876
2023-03-28 14:04:04 -05:00
Kinsey Moore
acf4eb271c cpukit/jffs2: Avoid possible null deref
This was added with the writebuffer work and should have been protected
by the error check.
2023-03-23 10:33:52 -05:00
Kinsey Moore
7163014e3f bsps/xqspipsu: Add support for reading ECC
This adds a helper function to read the ECC status for an ECC unit in
SPI-attached NOR memory.
2023-03-22 13:30:08 -05:00
Kinsey Moore
ddafdfe9ba bsps/zynqmp: Use correct include path
The existing include path only works from inside the RTEMS build. This
fixes the include path to work both in the RTEMS build and with builds
of external apps since this file gets installed with the BSP.
2023-03-22 13:30:07 -05:00
Sebastian Huber
74a6b33f3b validation: Replace enum Event with defines
There is a Doxygen limitation that all compound names (enum, struct,
class, union, group) within a project must be unique.

Update #3716.
2023-03-17 15:55:39 +01:00
Sebastian Huber
3353d3f3ad doxygen: Add group for FreeBSD kernel header files 2023-03-17 08:47:28 +01:00
Sebastian Huber
45234f58e5 doxygen: Add test files to groups 2023-03-17 08:47:28 +01:00
Sebastian Huber
de6568ed99 validation: Fix test case group identifiers
Update #3716.
2023-03-17 08:47:28 +01:00
Sebastian Huber
eaecc4971a doxygen: Add files to groups and fix group scopes 2023-03-17 08:47:28 +01:00
Sebastian Huber
3264c8152b doxygen: Fix group identifiers 2023-03-17 08:47:28 +01:00
Sebastian Huber
a60b816fa7 bsps/arm: Fix wording 2023-03-17 07:25:34 +01:00
Sebastian Huber
11cc51ef27 bsps/riscv: Use per-CPU mtimecmp in clock driver
Use the mtimecmp from the PLIC/CLINT initialization in the clock driver.  This
register is defined by the device tree and does not assume a fixed mapping.
2023-03-17 07:25:34 +01:00
Sebastian Huber
cbddf5decd bsps/riscv: Fix riscv_get_hart_index_by_phandle()
Take a non-zero RISCV_BOOT_HARTID into account.
2023-03-17 07:25:34 +01:00
Sebastian Huber
e5233057be bsps/riscv: Make SMP start more robust
In SMP configurations, check that we run on a configured processor.  If not,
then there is not much that can be done since we do not have a stack available
for this processor.  Just loop forever in this case.  Do this in assemlby to
ensure that no stack memory is used.
2023-03-17 07:25:23 +01:00
Sebastian Huber
0e773420f7 rtems/test.h: Use __attribute__ 2023-03-16 16:17:40 +01:00
Karel Gardas
139bc390b5 score/arm: enhance ARMV7M MPU setup with capability to set control register
Due to API change, the patch also fixes affected BSPs and uses
value provided by MPU CTRL spec option there.

Sponsored-By:	Precidata
2023-03-16 15:40:22 +01:00
Karel Gardas
8f6d4b7d96 spec: add MPU CTRL option to be usable on ARMV7M based BSPs
The patch also enables usage of the option on imxrt and stm32h7 based BSPs.

Sponsored-By:	Precidata
2023-03-16 15:40:22 +01:00
Sebastian Huber
19ce49c5c6 doxygen: Document hash algorithm files 2023-03-16 07:38:44 +01:00
Sebastian Huber
51fdc8f9b1 cpuuse: Add implementation Doxygen group 2023-03-16 07:38:44 +01:00
Kinsey Moore
caffdc4dab bsps/zynqmp: Add JFFS2 NAND adapter
This adds the glue code necessary to allow JFFS2 to operate on top of
NAND memory hosted by the XNandPsu peripheral/driver.
2023-03-15 13:29:12 -05:00
Kinsey Moore
5db68a5859 cpukit/jffs2: Add support for NAND under JFFS2
This adds write buffer and bad block support required for JFFS2
operation on NAND devices. This also adds the minor modifications
necessary for RTEMS support in the Linux header stubs and in wbuf.c.
Memory and NOR backed applications should experience no difference in
operation since they do not expose the callbacks required for write
buffer support.
2023-03-15 13:29:12 -05:00
Kinsey Moore
5635ec3362 cpukit/jffs2: Import wbuf.c from upstream
This pulls in wbuf.c from the upstream Linux repository at the state
specified in VERSION.
2023-03-15 13:29:12 -05:00
Kinsey Moore
8eb666fa96 cpukit/jffs2: Initialize and lock mutexes
Mutexes must be locked before they can be unlocked. JFFS2 doesn't
currently see this as an issue because all mutex operations are no-ops.
2023-03-15 13:29:12 -05:00
Kinsey Moore
10ff982834 bsps/xnandpsu: Allow use of both chip selects
By default, the Xilinx NAND driver does not probe the second chip
select. This alteration allows the second half of chips to be
detected when present.
2023-03-15 13:29:12 -05:00
Sebastian Huber
d0dd98cca0 sparc: Add header files to Doxygen group 2023-03-15 16:01:06 +01:00
Sebastian Huber
3a6efa2e7f score: Fix Doxygen group identifier 2023-03-15 16:01:06 +01:00
Sebastian Huber
09ddbde257 score: Add file to Doxygen group 2023-03-15 16:01:06 +01:00
Sebastian Huber
a0bb541d42 build: Use standard format 2023-03-15 16:01:06 +01:00
Sebastian Huber
03159bd837 build: Remove obsolete default-by-variant 2023-03-15 09:47:20 +01:00
Alex White
725e5ce27f bsps/microblaze: Add AXI GPIO driver 2023-03-14 09:29:16 -05:00
Sebastian Huber
e81701bc6c validation: Fix typo 2023-03-14 08:27:33 +01:00
Sebastian Huber
9bb2f59efe doxygen: Add groups for related test suites 2023-03-14 08:07:25 +01:00
Sebastian Huber
377eae4165 spsysinit01: Fix sem_open() call
The O_CREAT flag requires a mode and initial value as third and fourth
argument.

Close #4878.
2023-03-14 08:00:21 +01:00
Sebastian Huber
2859e422b3 Provide kernel space items only if needed
The kernel space parts of standard system header files were protected
against misuse by a preprocessor error directive.  This approach does
not work well with tools such as Doxygen.  Provide the kernel space
items only if the required defines are present.
2023-03-14 08:00:11 +01:00
Sebastian Huber
9bfe5f599d validation: Derive names from item UIDs
Use the item UID converted to CamelCase for Doxygen group names and
testsuite names.

Update #3716.
2023-03-13 14:00:59 +01:00
Karel Gardas
1a4e78b3a0 bsps/stm32h7: fix propagation of configured HSE freq. value into the code
Sponsored-By:	Precidata
2023-03-10 16:18:32 +01:00
Sebastian Huber
d5c386ff99 pps: Round to closest integer in pps_event()
The comment above bintime2timespec() says:

  When converting between timestamps on parallel timescales of differing
  resolutions it is historical and scientific practice to round down.

However, the delta_nsec value is a time difference and not a timestamp.  Also
the rounding errors accumulate in the frequency accumulator, see hardpps().
So, rounding to the closest integer is probably slightly better.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
d9f5345df6 pps: Simplify the nsec calculation in pps_event()
Let A be the current calculation of the frequency accumulator (pps_fcount)
update in pps_event()

  scale = (uint64_t)1 << 63;
  scale /= captc->tc_frequency;
  scale *= 2;
  bt.sec = 0;
  bt.frac = 0;
  bintime_addx(&bt, scale * tcount);
  bintime2timespec(&bt, &ts);
  hardpps(tsp, ts.tv_nsec + 1000000000 * ts.tv_sec);

and hardpps(..., delta_nsec):

  u_nsec = delta_nsec;
  if (u_nsec > (NANOSECOND >> 1))
          u_nsec -= NANOSECOND;
  else if (u_nsec < -(NANOSECOND >> 1))
          u_nsec += NANOSECOND;
  pps_fcount += u_nsec;

This change introduces a new calculation which is slightly simpler and more
straight forward.  Name it B.

Consider the following sample values with a tcount of 2000000100 and a
tc_frequency of 2000000000 (2GHz).

For A, the scale is 9223372036.  Then scale * tcount is 18446744994337203600
which is larger than UINT64_MAX (= 18446744073709551615).  The result is
920627651984 == 18446744994337203600 % UINT64_MAX.  Since all operands are
unsigned the result is well defined through modulo arithmetic.  The result of
bintime2timespec(&bt, &ts) is 49.  This is equal to the correct result
1000000049 % NANOSECOND.

In hardpps(), both conditional statements are not executed and pps_fcount is
incremented by 49.

For the new calculation B, we have 1000000000 * tcount is 2000000100000000000
which is less than UINT64_MAX. This yields after the division with tc_frequency
the correct result of 1000000050 for delta_nsec.

In hardpps(), the first conditional statement is executed and pps_fcount is
incremented by 50.

This shows that both methods yield roughly the same results.  However, method B
is easier to understand and requires fewer conditional statements.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
3cda5ad953 pps: Directly assign the timestamps in pps_event()
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
6730543457 pps: Move pcount assignment in pps_event()
Move the pseq increment.  This makes it possible to reuse registers earlier.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
2a30bbf852 pps: Simplify capture and event processing
Use local variables for the captured timehand and timecounter in pps_event().
This fixes a potential issue in the nsec preparation for hardpps().  Here the
timecounter was accessed through the captured timehand after the generation was
checked.

Make a snapshot of the relevent timehand values early in pps_event().  Check
the timehand generation only once during the capture and event processing.  Use
atomic_thread_fence_acq() similar to the other readers.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
069275f5fa pps: Load timecounter once in pps_capture()
This ensures that the timecounter and the tc_get_timecount handler belong
together.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Mateusz Guzik
bb06cdab42 ntptime: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-03-07 07:30:44 +01:00
Sebastian Huber
aff6af106d Clarify hardpps() parameter name and comment
Since 32c203577a5e by phk in 1999 (Make even more of the PPSAPI
implementations generic), the "nsec" parameter of hardpps() is a time
difference and no longer a time point.  Change the name to "delta_nsec"
and adjust the comment.

Remove comment about a clock tick adjustment which is no longer in the code.

Pull Request: https://github.com/freebsd/freebsd-src/pull/640
Reviewed by: imp
2023-03-07 07:30:44 +01:00
Mitchell Horne
2bac3364d2 set_cputicker: use a bool
The third argument to this function indicates whether the supplied
ticker is fixed or variable, i.e. requiring calibration. Give this
argument a type and name that better conveys this purpose.

Reviewed by:	kib, markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35459
2023-03-07 07:30:44 +01:00
firk
0c36cb6101 kern_tc.c/cputick2usec()
(which is used to calculate cputime from cpu ticks) has some imprecision and,
worse, huge timestep (about 20 minutes on 4GHz CPU) near 53.4 days of elapsed
time.

kern_time.c/cputick2timespec() (it is used for clock_gettime() for
querying process or thread consumed cpu time) Uses cputick2usec()
and then needlessly converting usec to nsec, obviously losing
precision even with fixed cputick2usec().

kern_time.c/kern_clock_getres() uses some weird (anyway wrong)
formula for getting cputick resolution.

PR:		262215
Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D34558
2023-03-07 07:29:58 +01:00
Sebastian Huber
3612dc7d61 build: Print item UID in case of errors
This helps to identify issues in build items.
2023-03-06 16:37:06 +01:00
Sebastian Huber
269562cfd2 bsps/riscv: Use medany cmodel for 64-bit variants
Updates #4775.
2023-03-02 15:08:23 +01:00
Kinsey Moore
d08dfc3d63 bsps/aarch64: Disable interrupts during MMU remap
Interrupts must be disabled during MMU remapping since the majority of
RTEMS including interrupts expects normal memory mapping semantics such
as unaligned accesses.
2023-02-27 12:31:48 -06:00
Joel Sherrill
9b4aed1fd1 waf: Update to waf 2.0.25
Updates #4860
2023-02-20 10:01:45 -06:00
Karel Gardas
673d7861e3 bsps/beagle: fix warning on possibly uninitialized clock control in pwmss. 2023-02-18 23:00:05 +01:00
Karel Gardas
4600dd1d2f bsps/beagle: fix warning on missing cast 2023-02-18 23:00:05 +01:00
Karel Gardas
14026f6b10 bsps/beagle: do not set values already set by spec file(s).
The patch fixes few symbol already defined warnings here.
2023-02-18 23:00:05 +01:00
Sebastian Huber
bb465c8548 doxygen: Add Doxygen files to a group
Update #3707.
2023-02-16 08:27:09 +01:00
zack
809e34e527 libmisc/shell/main_edit.c: User cannot cut using ctrl e and x
Closes #4557
2023-02-15 15:16:37 -06:00
Kinsey Moore
2a6aaf87bd bsps/aarch64: Fix off-by-one cache bug
The whole cache invalidation and flushing functions only ended up
flusing the first N-1 levels of cache due to an off by one error. This
resovles that issue and makes consistent the usage of levels as they
relate to caching.
2023-02-14 08:33:53 -06:00
Kinsey Moore
b44e26baa7 bsps/aarch64: Flush cache before disabling MMU
To ensure data consistency, the cache much be flushed before disabling
the MMU. When the MMU is disabled, all accesses are treated as
non-cachced and thus will bypass the cache.
2023-02-14 08:33:52 -06:00
Sebastian Huber
7629760e49 build: Remove superfluous attribute 2023-02-14 15:21:44 +01:00
Sebastian Huber
c2756c1476 doxygen: Document CONFIGURE_INIT 2023-02-14 15:16:04 +01:00
Sebastian Huber
bfc823dd83 doxygen: Fix header file path 2023-02-14 15:16:04 +01:00
Sebastian Huber
fa77ad1494 doxygen: Harmonize header file references 2023-02-14 15:16:04 +01:00
Sebastian Huber
1f8b26a809 doxygen: Use @anchor for appl config options
The application configuration options are documented in
"cpukit/doxygen/appl-config.h".  Since the application configuration
option defines are also present in multiple test program sources, the
"#OPTION" references cannot be mapped to a unique definition.  Add an
anchor for each option and reference it to avoid the issues with the
multiple definitions.

Update #3994.
2023-02-14 07:42:14 +01:00
Sebastian Huber
c508a3329e doxygen: Generalize appl config constraints
Rename the constaints section of application configuration options from
"Value Constraints" in "Constraints.  Adjust the constraint wording
accordingly.  This is in line with the RTEMS Classic API Guide.

Update #3994.
2023-02-14 07:42:14 +01:00
Sebastian Huber
bcdcdd01ac doxygen: Clarify CONFIGURE_DISABLE_BSP_SETTINGS
Each BSP may optionally provide default values for some application
configuration options.  Remove the documentation of these items, since
the BSP provided defines are not application configuration options, they
are optional default values.  Clarify CONFIGURE_DISABLE_BSP_SETTINGS
accordingly and move it into the "General System Configuration" group.

Update #3994.
2023-02-14 07:42:14 +01:00
Sebastian Huber
02f5c5c660 doxygen: Use quotes for href URLs
Update #3994.
2023-02-14 07:42:14 +01:00
Sebastian Huber
c68cfbd55b libtest: Fix Doxygen group identifier 2023-02-13 10:06:20 +01:00
Karel Gardas
0328a82c62 bsps/stm32h7: fix compilation failure of stm32h757i-eval-m4 BSP 2023-02-12 20:13:18 +01:00
Sebastian Huber
b993111594 bsp/leon3: Move SMP data to start.S
The LEON3_Boot_Cpu global object is only used by start.S.  Move the definition
of this object to start.S and use a local symbol .Lbootcpuindex for it.

Use a compare-and-swap instruction to assign the boot CPU.  This allows a
concurrent initialization.

Close #4845.
2023-02-10 16:15:52 +01:00
Sebastian Huber
519e288a96 bsps/irq: Clarify interrupt vector operations
Clarify that the presence of error conditions is
implementation-defined.

Close #4843.
2023-02-10 16:14:11 +01:00
Sebastian Huber
22d845d5b7 score: Replace goto with a break
The goto label was directly after the loop, so we can replace the goto
with a break.

Close #4847.
2023-02-10 16:14:11 +01:00
Joel Sherrill
26e1610833 shell/main_pci.c: Address Dereference after null error check
Coverity CID 1399716

Closes #431.
2023-02-10 07:55:17 -06:00
Joel Sherrill
77e7bd97dc libmisc/serdbg: Remove obsolete serial debug
Closes #2828.
2023-02-09 09:05:58 -06:00
Kinsey Moore
c0fad60c59 bsps/xil: Import full xil_exception.h
This imports the full xil_exception.h instead of an empty stub. This is
required for some Xilinx drivers. The imported files adhere to the
current VERSION file.
2023-02-08 14:11:47 -06:00
Kinsey Moore
d9f3dcba10 bsps/xil: Make sleep.h a stub
This makes xil/sleep.h a stub to prevent multiple differing definitions
of sleep functions from toolchain and local headers. The non-standard
sleep definitions were not in use and can be added later if needed.
2023-02-08 14:11:47 -06:00
Zhongjie Zhu
ebb9e8c0a6 score: Fix maybe uninitialized warning
There are different cases for _ISR_lock_ISR_disable() and
_ISR_lock_ISR_enable() in the case RTEMS_SMP is defined or
RTEMS_PROFILING is defined, so remove the related code.

../../../cpukit/include/rtems/score/threaddispatch.h: In function '_Thread_Dispatch_disable':
../../../cpukit/include/rtems/score/threaddispatch.h:231:14: warning: 'lock_context' may be used uninitialized [-Wmaybe-uninitialized]
  231 |   cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../cpukit/include/rtems/score/threaddispatch.h:210:32: note: by argument 1 of type 'const ISR_lock_Context *' to '_Thread_Dispatch_disable_critical' declared here
  210 | static inline Per_CPU_Control *_Thread_Dispatch_disable_critical(
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../cpukit/include/rtems/score/threaddispatch.h:225:21: note: 'lock_context' declared here
  225 |   ISR_lock_Context  lock_context;
      |                     ^~~~~~~~~~~~

Update #4662.
2023-02-07 17:45:24 +01:00
Kinsey Moore
a932d5d6e1 spec/bsps: Deduplicate objxilinxsupport
The objxilinxsupport build object was accidentally included twice in
some of the ZynqMP BSPs by two different drivers that required it. This
commit manually deduplicates the inclusions by moving that inclusion to
the BSP. Duplication of object inclusions is considered a bug and can
cause race conditions in the build system.
2023-02-06 17:33:13 -06:00
Ryan Long
9d5354e897 bsps/microblaze: Add device tree support to UART Lite 2023-02-06 14:29:24 -06:00
Ryan Long
3fd8cf2d37 bsps/microblaze: Add device tree support to JFFS2 QSPI 2023-02-06 14:29:24 -06:00
Ryan Long
cbac78afa9 bsps/microblaze: Add device tree support to AXI interrupt controller 2023-02-06 14:29:24 -06:00
Alex White
eb94aaff1d bsps/microblaze: Add device tree support to timer 2023-02-06 14:29:24 -06:00
Alex White
63b21ad5e0 bsps/microblaze: Add device tree getter
This allows drivers to read configuration data from the device tree if
the BSP is built with device tree support.
2023-02-06 14:29:24 -06:00
Sebastian Huber
a67b944329 sha512_224: Fix SHA512_224_Final() on little-endian machines.
PR:		266863
MFC after:	1 week
Reviewed by:	allanjude, cperciva, des
Differential Revision:	https://reviews.freebsd.org/D38372
2023-02-06 19:37:24 +01:00
Sebastian Huber
1d07dfad83 validation: Improve IRQ handler dispatch test
Clarify wording.  Use a function wrapper for the SMP spurious interrupt setup.

Update #3716.
2023-02-06 09:46:45 +01:00
Karel Gardas
f16b8fc32a bsps/stm32h7: allow config and usage of QSPI memory on stm32h757i-eval BSP
The QSPI memory is initialized and used only when the BSP configure file
sets QSPI memory size to non-zero value. Currently QSPI is run in memory
mapped mode which allows future RTEMS binary linkage and upload into QSPI
memory.

Sponsored-By:	Precidata
2023-02-05 20:42:24 +01:00
Karel Gardas
d068cdb384 bsps/stm32h7: import stm32h757i-eval QSPI memory high-level driver 2023-02-05 20:42:24 +01:00
Karel Gardas
f9169dca69 bsps/stm32h7: import MT25TL01G QSPI memory low-level driver 2023-02-05 20:42:24 +01:00
Chris Johns
edea93c40b libmisc/shell/edit: Return if no memory in move_gap
Closes #4835
2023-01-31 07:16:14 +11:00
Chris Johns
3ad2789fc6 libmisc/shell/edit: Fix closing the editor
Closes #4834
2023-01-31 07:16:14 +11:00
Kinsey Moore
ada805ea2e bsps/nand: Update Xilinx NAND driver
This resovles gcc warnings by updating to the latest Xilinx NAND
controller driver.
2023-01-30 10:44:24 -06:00
Kinsey Moore
4c0a2d47e1 cpukit/dev/can: Resolve warnings in 64bit builds
This resolves various gcc warnings in AArch64 LP64 builds of the CAN
framework.
2023-01-30 10:44:24 -06:00
Joel Sherrill
29a3ad1ba9 grlib: Fix snprintf() overflow warnings from gcc 12
Updates #4662.
2023-01-30 10:44:20 -06:00
Sebastian Huber
453939753b score: Help static analysis in thread init
Add an assert to _Thread_Initialize_scheduler_and_wait_nodes() which may
help a static analyzer.  Use a do/while loop since we have at least one
scheduler.

Update #4832.
2023-01-28 17:58:20 +01:00
Alex White
6fa3a3b32a spec: Fix XPS_SYS_CTRL_BASEADDR default value
The default value for XPS_SYS_CTRL_BASEADDR was given as an int rather
than an iterable.
2023-01-27 17:33:00 -06:00
Alex White
098ad421a1 bsps/xilinx-zynqmp: Add JFFS2 GQSPI NOR driver 2023-01-27 14:49:28 -06:00
Alex White
d55c131965 bsps: Add Xilinx GQSPI flash helper
This adds helper functions for working with NOR flash connected to the
Xilinx GQSPI controller. The helper functions are based on Xilinx's
QSPIPSU flash interrupt example.
2023-01-27 14:49:28 -06:00
Alex White
fd2f9d40b5 bsps: Import Xilinx GQSPI driver
This adds Xilinx's driver for the Xilinx GQSPI controller embedded in
the ZynqMP SoC. Within that device alone, it is possible to access this
peripheral from MicroBlaze, ARMv7, and ARMv8 cores. The imported files
are and should be able to remain unmodified. Import information is kept
in bsps/shared/dev/spi/VERSION.
2023-01-27 14:49:27 -06:00
Kinsey Moore
1da87d6293 spec: Install NandPsu headers correctly
These headers were mistakenly placed in the root of the installed BSP
include directory. They should be in dev/nand.
2023-01-26 13:23:44 -06:00
Joel Sherrill
a2360c4f03 cpukit/rtems/src/partcreate.c: Correct style by adding braces 2023-01-26 13:23:25 -06:00
Sebastian Huber
48f693a97e score: Remove unused return value
Several SMP message processing functions returned a value.  This value
was always unused.

Close #4822.
2023-01-24 16:53:03 +01:00
Sebastian Huber
5156cd6997 build: Add dl11 to libdl test exclude list 2023-01-24 11:40:59 +01:00
Sebastian Huber
d36070fec8 intr: Add Interrupt Manager implementation group
The shared BSP interrupt controller support code actually implements
parts of the Interrupt Manager.

Update #3706.
2023-01-24 09:56:53 +01:00
Sebastian Huber
0340fd9a98 cpuuse: Use standard wording and group name
Use standard wording in CPU usage reporting files.
2023-01-24 09:56:53 +01:00
Sebastian Huber
6136e28bf9 clockdrv: Add clock driver implementation group
Use standard wording in Clock Driver related files.

Update #3706.
2023-01-24 09:56:53 +01:00
Sebastian Huber
10ee41a8a3 tm27: Avoid function pointer casts
Add TM27_USE_VECTOR_HANDLER to select the interrupt handler type used by
the <tm27.h> implementation.

Close #4820.
2023-01-24 09:56:53 +01:00
Sebastian Huber
9ecb73f368 score: Clarify code block
Do not use a chained assignment for code clarity.

Close #4818.
2023-01-24 08:23:44 +01:00
Sebastian Huber
4f274b6925 powerpc: Increase MAS0 ESEL width
For example, the QorIQ T4240 has more than 16 TLB1 entries.
2023-01-23 09:56:52 +01:00
Sebastian Huber
004563465b build: Update PyYAML to 5.4.1 2023-01-23 09:56:52 +01:00
Martin Erik Werner
434d11b446 rtems: Fix typo 2023-01-23 08:57:07 +01:00
Martin Erik Werner
ff3a87c16e score: Fix minor Rhe->The typo in doxygen 2023-01-23 08:57:07 +01:00
Kinsey Moore
81085ca9f4 testsuites/libtest/dl11: Add DL test for TLS
This adds a test verifying basic TLS functionality in loadable modules
now that at least one architecture supports it.
2023-01-20 08:26:35 -06:00
Kinsey Moore
d3662980d0 cpukit/libdl: Add AArch64 TLS reloc support
This adds basic TLS relocation support for AArch64 to libdl. This lets
loadable modules use TLS symbols hosted in the main binary. This does
not allow loadable modules to host their own TLS symbols.
2023-01-20 08:26:35 -06:00
Kinsey Moore
189539f70d cpukit/libdl: Print the missing AArch64 reloc type
This prints the relocation type that was found to be missing in addition
to its address to aid in bug reports.
2023-01-20 08:26:35 -06:00
Kinsey Moore
df0de7810f cpukit/libdl: Use correct mask for reloc type
The mask 0xff is used by ELF32 while ELF64 uses 0xffffffff. These are
automatically selected based on the build type when using ELF_R_TYPE().
2023-01-20 08:26:35 -06:00
Kinsey Moore
f36d8b14e0 spec: Fix Xilinx support YAML licenses
This should use the CC 4.0 license to match the rest of the tree.
2023-01-19 15:38:31 -06:00
Sebastian Huber
5b124432e2 build: Fix copyright statement format 2023-01-17 10:11:00 +01:00
Sebastian Huber
70e2990c77 build: Remove bogus attribute 2023-01-17 09:46:26 +01:00
Sebastian Huber
45ef2dd3fe bsp/tms570: Fix define redefinition error 2023-01-17 08:31:48 +01:00
Sebastian Huber
f20078acea build: Use enabled by for defaults
Merge the "default" and "default-by-variant" attributes.  Use an
"enabled-by" expression to select the default value based on the enabled
set.  This makes it possible to select default values depending on other
options.  For example you could choose memory settings based on whether
RTEMS_SMP is enabled or disabled.

The change was tested by comparing the output of

  ./waf bspdefaults

before and after the change.
2023-01-17 08:31:48 +01:00
Sebastian Huber
d2664faa39 build: Replace variant patterns with a list
Replace the variant patterns in the default-by-variant list with an
explicit list of matching BSPs.

The change was tested by comparing the output of

  ./waf bspdefaults

before and after the change.
2023-01-17 08:31:48 +01:00
Sebastian Huber
336823191a build: Format build items
Use yaml.dump(data, default_flow_style=False, allow_unicode=True) with a
custom representer for integer default values to format all build items.
2023-01-17 08:31:46 +01:00
Sebastian Huber
cac528f85a build: Add reason to test state definitions 2023-01-17 08:30:21 +01:00
Sebastian Huber
2ea03be47c jffs2: Fix return code of rtime compress
The RTEMS and Linux JFFS2 compression support have a slightly different
interface.  This fixes a bug introduced by:

commit 17c3d536ca
Author: Yang Yang <yang.yang29@zte.com.cn>
Date:   Thu Jan 28 02:55:35 2021 -0800

    jffs2: check the validity of dstlen in jffs2_zlib_compress()

    KASAN reports a BUG when download file in jffs2 filesystem.It is
    because when dstlen == 1, cpage_out will write array out of bounds.
    Actually, data will not be compressed in jffs2_zlib_compress() if
    data's length less than 4.
2023-01-12 14:40:38 +01:00
Sebastian Huber
2271b69ac4 jffs2: Update baseline version to Linux v6.1 2023-01-12 08:16:30 +01:00
Gustavo A. R. Silva
b34b913a38 treewide: uapi: Replace zero-length arrays with flexible-array members
There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].

This code was transformed with the help of Coccinelle:
(linux-5.19-rc2$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)

@@
identifier S, member, array;
type T1, T2;
@@

struct S {
  ...
  T1 member;
  T2 array[
- 0
  ];
};

-fstrict-flex-arrays=3 is coming and we need to land these changes
to prevent issues like these in the short future:

../fs/minix/dir.c:337:3: warning: 'strcpy' will always overflow; destination buffer has size 0,
but the source string has length 2 (including NUL byte) [-Wfortify-source]
		strcpy(de3->name, ".");
		^

Since these are all [0] to [] changes, the risk to UAPI is nearly zero. If
this breaks anything, we can use a union with a new member name.

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/78
Build-tested-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/62b675ec.wKX6AOZ6cbE71vtF%25lkp@intel.com/
Acked-by: Dan Williams <dan.j.williams@intel.com> # For ndctl.h
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2023-01-12 08:16:30 +01:00
Haowen Bai
b4e04622e1 jffs2: Use kzalloc instead of kmalloc/memset
Use kzalloc rather than duplicating its implementation, which
makes code simple and easy to understand.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
[rw: Fixed printk string]
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
Matthew Wilcox (Oracle)
0dec20c532 fs: Change the type of filler_t
By making filler_t the same as read_folio, we can use the same function
for both in gfs2.  We can push the use of folios down one more level
in jffs2 and nfs.  We also increase type safety for future users of the
various read_cache_page() family of functions by forcing the parameter
to be a pointer to struct file (or NULL).

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
2023-01-12 08:16:30 +01:00
Matthew Wilcox (Oracle)
a594c8a7f6 jffs2: Pass the file pointer to jffs2_do_readpage_unlock()
In preparation for unifying the read_cache_page() and read_folio()
implementations, make jffs2_do_readpage_unlock() get the inode
from the page instead of passing it in from read_cache_page().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2023-01-12 08:16:30 +01:00
Baokun Li
20d7b3aa93 jffs2: fix memory leak in jffs2_scan_medium
If an error is returned in jffs2_scan_eraseblock() and some memory
has been added to the jffs2_summary *s, we can observe the following
kmemleak report:

--------------------------------------------
unreferenced object 0xffff88812b889c40 (size 64):
  comm "mount", pid 692, jiffies 4294838325 (age 34.288s)
  hex dump (first 32 bytes):
    40 48 b5 14 81 88 ff ff 01 e0 31 00 00 00 50 00  @H........1...P.
    00 00 01 00 00 00 01 00 00 00 02 00 00 00 09 08  ................
  backtrace:
    [<ffffffffae93a3a3>] __kmalloc+0x613/0x910
    [<ffffffffaf423b9c>] jffs2_sum_add_dirent_mem+0x5c/0xa0
    [<ffffffffb0f3afa8>] jffs2_scan_medium.cold+0x36e5/0x4794
    [<ffffffffb0f3dbe1>] jffs2_do_mount_fs.cold+0xa7/0x2267
    [<ffffffffaf40acf3>] jffs2_do_fill_super+0x383/0xc30
    [<ffffffffaf40c00a>] jffs2_fill_super+0x2ea/0x4c0
    [<ffffffffb0315d64>] mtd_get_sb+0x254/0x400
    [<ffffffffb0315f5f>] mtd_get_sb_by_nr+0x4f/0xd0
    [<ffffffffb0316478>] get_tree_mtd+0x498/0x840
    [<ffffffffaf40bd15>] jffs2_get_tree+0x25/0x30
    [<ffffffffae9f358d>] vfs_get_tree+0x8d/0x2e0
    [<ffffffffaea7a98f>] path_mount+0x50f/0x1e50
    [<ffffffffaea7c3d7>] do_mount+0x107/0x130
    [<ffffffffaea7c5c5>] __se_sys_mount+0x1c5/0x2f0
    [<ffffffffaea7c917>] __x64_sys_mount+0xc7/0x160
    [<ffffffffb10142f5>] do_syscall_64+0x45/0x70
unreferenced object 0xffff888114b54840 (size 32):
  comm "mount", pid 692, jiffies 4294838325 (age 34.288s)
  hex dump (first 32 bytes):
    c0 75 b5 14 81 88 ff ff 02 e0 02 00 00 00 02 00  .u..............
    00 00 84 00 00 00 44 00 00 00 6b 6b 6b 6b 6b a5  ......D...kkkkk.
  backtrace:
    [<ffffffffae93be24>] kmem_cache_alloc_trace+0x584/0x880
    [<ffffffffaf423b04>] jffs2_sum_add_inode_mem+0x54/0x90
    [<ffffffffb0f3bd44>] jffs2_scan_medium.cold+0x4481/0x4794
    [...]
unreferenced object 0xffff888114b57280 (size 32):
  comm "mount", pid 692, jiffies 4294838393 (age 34.357s)
  hex dump (first 32 bytes):
    10 d5 6c 11 81 88 ff ff 08 e0 05 00 00 00 01 00  ..l.............
    00 00 38 02 00 00 28 00 00 00 6b 6b 6b 6b 6b a5  ..8...(...kkkkk.
  backtrace:
    [<ffffffffae93be24>] kmem_cache_alloc_trace+0x584/0x880
    [<ffffffffaf423c34>] jffs2_sum_add_xattr_mem+0x54/0x90
    [<ffffffffb0f3a24f>] jffs2_scan_medium.cold+0x298c/0x4794
    [...]
unreferenced object 0xffff8881116cd510 (size 16):
  comm "mount", pid 692, jiffies 4294838395 (age 34.355s)
  hex dump (first 16 bytes):
    00 00 00 00 00 00 00 00 09 e0 60 02 00 00 6b a5  ..........`...k.
  backtrace:
    [<ffffffffae93be24>] kmem_cache_alloc_trace+0x584/0x880
    [<ffffffffaf423cc4>] jffs2_sum_add_xref_mem+0x54/0x90
    [<ffffffffb0f3b2e3>] jffs2_scan_medium.cold+0x3a20/0x4794
    [...]
--------------------------------------------

Therefore, we should call jffs2_sum_reset_collected(s) on exit to
release the memory added in s. In addition, a new tag "out_buf" is
added to prevent the NULL pointer reference caused by s being NULL.
(thanks to Zhang Yi for this analysis)

Fixes: e631ddba5887 ("[JFFS2] Add erase block summary support (mount time improvement)")
Cc: stable@vger.kernel.org
Co-developed-with: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
Baokun Li
33f28a9c02 jffs2: fix memory leak in jffs2_do_mount_fs
If jffs2_build_filesystem() in jffs2_do_mount_fs() returns an error,
we can observe the following kmemleak report:

--------------------------------------------
unreferenced object 0xffff88811b25a640 (size 64):
  comm "mount", pid 691, jiffies 4294957728 (age 71.952s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffffa493be24>] kmem_cache_alloc_trace+0x584/0x880
    [<ffffffffa5423a06>] jffs2_sum_init+0x86/0x130
    [<ffffffffa5400e58>] jffs2_do_mount_fs+0x798/0xac0
    [<ffffffffa540acf3>] jffs2_do_fill_super+0x383/0xc30
    [<ffffffffa540c00a>] jffs2_fill_super+0x2ea/0x4c0
    [...]
unreferenced object 0xffff88812c760000 (size 65536):
  comm "mount", pid 691, jiffies 4294957728 (age 71.952s)
  hex dump (first 32 bytes):
    bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb  ................
    bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb  ................
  backtrace:
    [<ffffffffa493a449>] __kmalloc+0x6b9/0x910
    [<ffffffffa5423a57>] jffs2_sum_init+0xd7/0x130
    [<ffffffffa5400e58>] jffs2_do_mount_fs+0x798/0xac0
    [<ffffffffa540acf3>] jffs2_do_fill_super+0x383/0xc30
    [<ffffffffa540c00a>] jffs2_fill_super+0x2ea/0x4c0
    [...]
--------------------------------------------

This is because the resources allocated in jffs2_sum_init() are not
released. Call jffs2_sum_exit() to release these resources to solve
the problem.

Fixes: e631ddba5887 ("[JFFS2] Add erase block summary support (mount time improvement)")
Cc: stable@vger.kernel.org
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
hongnanli
c43e39ed77 fs/jffs2: fix comments mentioning i_mutex
inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix
comments still mentioning i_mutex.

Signed-off-by: hongnanli <hongnan.li@linux.alibaba.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
Miklos Szeredi
a12144e105 vfs: add rcu argument to ->get_acl() callback
Add a rcu argument to the ->get_acl() callback to allow
get_cached_acl_rcu() to call the ->get_acl() method in the next patch.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2023-01-12 08:16:30 +01:00
Arnd Bergmann
4bb12f228f jffs2: avoid Wempty-body warnings
Building with W=1 shows a few warnings for empty macros:

fs/jffs2/scan.c: In function 'jffs2_scan_xattr_node':
fs/jffs2/scan.c:378:66: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  378 |                 jffs2_sum_add_xattr_mem(s, rx, ofs - jeb->offset);
      |                                                                  ^
fs/jffs2/scan.c: In function 'jffs2_scan_xref_node':
fs/jffs2/scan.c:434:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  434 |                 jffs2_sum_add_xref_mem(s, rr, ofs - jeb->offset);
      |                                                                 ^
fs/jffs2/scan.c: In function 'jffs2_scan_eraseblock':
fs/jffs2/scan.c:893:88: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  893 |                                 jffs2_sum_add_padding_mem(s, je32_to_cpu(node->totlen));
      |                                                                                        ^

Change all these macros to 'do { } while (0)' statements to avoid the
warnings and make the code a little more robust.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
lizhe
bce142bc83 jffs2: Fix kasan slab-out-of-bounds problem
KASAN report a slab-out-of-bounds problem. The logs are listed below.
It is because in function jffs2_scan_dirent_node, we alloc "checkedlen+1"
bytes for fd->name and we check crc with length rd->nsize. If checkedlen
is less than rd->nsize, it will cause the slab-out-of-bounds problem.

jffs2: Dirent at *** has zeroes in name. Truncating to %d char
==================================================================
BUG: KASAN: slab-out-of-bounds in crc32_le+0x1ce/0x260 at addr ffff8800842cf2d1
Read of size 1 by task test_JFFS2/915
=============================================================================
BUG kmalloc-64 (Tainted: G    B      O   ): kasan: bad access detected
-----------------------------------------------------------------------------
INFO: Allocated in jffs2_alloc_full_dirent+0x2a/0x40 age=0 cpu=1 pid=915
	___slab_alloc+0x580/0x5f0
	__slab_alloc.isra.24+0x4e/0x64
	__kmalloc+0x170/0x300
	jffs2_alloc_full_dirent+0x2a/0x40
	jffs2_scan_eraseblock+0x1ca4/0x3b64
	jffs2_scan_medium+0x285/0xfe0
	jffs2_do_mount_fs+0x5fb/0x1bbc
	jffs2_do_fill_super+0x245/0x6f0
	jffs2_fill_super+0x287/0x2e0
	mount_mtd_aux.isra.0+0x9a/0x144
	mount_mtd+0x222/0x2f0
	jffs2_mount+0x41/0x60
	mount_fs+0x63/0x230
	vfs_kern_mount.part.6+0x6c/0x1f4
	do_mount+0xae8/0x1940
	SyS_mount+0x105/0x1d0
INFO: Freed in jffs2_free_full_dirent+0x22/0x40 age=27 cpu=1 pid=915
	__slab_free+0x372/0x4e4
	kfree+0x1d4/0x20c
	jffs2_free_full_dirent+0x22/0x40
	jffs2_build_remove_unlinked_inode+0x17a/0x1e4
	jffs2_do_mount_fs+0x1646/0x1bbc
	jffs2_do_fill_super+0x245/0x6f0
	jffs2_fill_super+0x287/0x2e0
	mount_mtd_aux.isra.0+0x9a/0x144
	mount_mtd+0x222/0x2f0
	jffs2_mount+0x41/0x60
	mount_fs+0x63/0x230
	vfs_kern_mount.part.6+0x6c/0x1f4
	do_mount+0xae8/0x1940
	SyS_mount+0x105/0x1d0
	entry_SYSCALL_64_fastpath+0x1e/0x97
Call Trace:
 [<ffffffff815befef>] dump_stack+0x59/0x7e
 [<ffffffff812d1d65>] print_trailer+0x125/0x1b0
 [<ffffffff812d82c8>] object_err+0x34/0x40
 [<ffffffff812dadef>] kasan_report.part.1+0x21f/0x534
 [<ffffffff81132401>] ? vprintk+0x2d/0x40
 [<ffffffff815f1ee2>] ? crc32_le+0x1ce/0x260
 [<ffffffff812db41a>] kasan_report+0x26/0x30
 [<ffffffff812d9fc1>] __asan_load1+0x3d/0x50
 [<ffffffff815f1ee2>] crc32_le+0x1ce/0x260
 [<ffffffff814764ae>] ? jffs2_alloc_full_dirent+0x2a/0x40
 [<ffffffff81485cec>] jffs2_scan_eraseblock+0x1d0c/0x3b64
 [<ffffffff81488813>] ? jffs2_scan_medium+0xccf/0xfe0
 [<ffffffff81483fe0>] ? jffs2_scan_make_ino_cache+0x14c/0x14c
 [<ffffffff812da3e9>] ? kasan_unpoison_shadow+0x35/0x50
 [<ffffffff812da3e9>] ? kasan_unpoison_shadow+0x35/0x50
 [<ffffffff812da462>] ? kasan_kmalloc+0x5e/0x70
 [<ffffffff812d5d90>] ? kmem_cache_alloc_trace+0x10c/0x2cc
 [<ffffffff818169fb>] ? mtd_point+0xf7/0x130
 [<ffffffff81487dc9>] jffs2_scan_medium+0x285/0xfe0
 [<ffffffff81487b44>] ? jffs2_scan_eraseblock+0x3b64/0x3b64
 [<ffffffff812da3e9>] ? kasan_unpoison_shadow+0x35/0x50
 [<ffffffff812da3e9>] ? kasan_unpoison_shadow+0x35/0x50
 [<ffffffff812da462>] ? kasan_kmalloc+0x5e/0x70
 [<ffffffff812d57df>] ? __kmalloc+0x12b/0x300
 [<ffffffff812da462>] ? kasan_kmalloc+0x5e/0x70
 [<ffffffff814a2753>] ? jffs2_sum_init+0x9f/0x240
 [<ffffffff8148b2ff>] jffs2_do_mount_fs+0x5fb/0x1bbc
 [<ffffffff8148ad04>] ? jffs2_del_noinode_dirent+0x640/0x640
 [<ffffffff812da462>] ? kasan_kmalloc+0x5e/0x70
 [<ffffffff81127c5b>] ? __init_rwsem+0x97/0xac
 [<ffffffff81492349>] jffs2_do_fill_super+0x245/0x6f0
 [<ffffffff81493c5b>] jffs2_fill_super+0x287/0x2e0
 [<ffffffff814939d4>] ? jffs2_parse_options+0x594/0x594
 [<ffffffff81819bea>] mount_mtd_aux.isra.0+0x9a/0x144
 [<ffffffff81819eb6>] mount_mtd+0x222/0x2f0
 [<ffffffff814939d4>] ? jffs2_parse_options+0x594/0x594
 [<ffffffff81819c94>] ? mount_mtd_aux.isra.0+0x144/0x144
 [<ffffffff81258757>] ? free_pages+0x13/0x1c
 [<ffffffff814fa0ac>] ? selinux_sb_copy_data+0x278/0x2e0
 [<ffffffff81492b35>] jffs2_mount+0x41/0x60
 [<ffffffff81302fb7>] mount_fs+0x63/0x230
 [<ffffffff8133755f>] ? alloc_vfsmnt+0x32f/0x3b0
 [<ffffffff81337f2c>] vfs_kern_mount.part.6+0x6c/0x1f4
 [<ffffffff8133ceec>] do_mount+0xae8/0x1940
 [<ffffffff811b94e0>] ? audit_filter_rules.constprop.6+0x1d10/0x1d10
 [<ffffffff8133c404>] ? copy_mount_string+0x40/0x40
 [<ffffffff812cbf78>] ? alloc_pages_current+0xa4/0x1bc
 [<ffffffff81253a89>] ? __get_free_pages+0x25/0x50
 [<ffffffff81338993>] ? copy_mount_options.part.17+0x183/0x264
 [<ffffffff8133e3a9>] SyS_mount+0x105/0x1d0
 [<ffffffff8133e2a4>] ? copy_mnt_ns+0x560/0x560
 [<ffffffff810e8391>] ? msa_space_switch_handler+0x13d/0x190
 [<ffffffff81be184a>] entry_SYSCALL_64_fastpath+0x1e/0x97
 [<ffffffff810e9274>] ? msa_space_switch+0xb0/0xe0
Memory state around the buggy address:
 ffff8800842cf180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8800842cf200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8800842cf280: fc fc fc fc fc fc 00 00 00 00 01 fc fc fc fc fc
                                                 ^
 ffff8800842cf300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8800842cf380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Cc: stable@vger.kernel.org
Reported-by: Kunkun Xu <xukunkun1@huawei.com>
Signed-off-by: lizhe <lizhe67@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
Yang Yang
17c3d536ca jffs2: check the validity of dstlen in jffs2_zlib_compress()
KASAN reports a BUG when download file in jffs2 filesystem.It is
because when dstlen == 1, cpage_out will write array out of bounds.
Actually, data will not be compressed in jffs2_zlib_compress() if
data's length less than 4.

[  393.799778] BUG: KASAN: slab-out-of-bounds in jffs2_rtime_compress+0x214/0x2f0 at addr ffff800062e3b281
[  393.809166] Write of size 1 by task tftp/2918
[  393.813526] CPU: 3 PID: 2918 Comm: tftp Tainted: G    B           4.9.115-rt93-EMBSYS-CGEL-6.1.R6-dirty #1
[  393.823173] Hardware name: LS1043A RDB Board (DT)
[  393.827870] Call trace:
[  393.830322] [<ffff20000808c700>] dump_backtrace+0x0/0x2f0
[  393.835721] [<ffff20000808ca04>] show_stack+0x14/0x20
[  393.840774] [<ffff2000086ef700>] dump_stack+0x90/0xb0
[  393.845829] [<ffff20000827b19c>] kasan_object_err+0x24/0x80
[  393.851402] [<ffff20000827b404>] kasan_report_error+0x1b4/0x4d8
[  393.857323] [<ffff20000827bae8>] kasan_report+0x38/0x40
[  393.862548] [<ffff200008279d44>] __asan_store1+0x4c/0x58
[  393.867859] [<ffff2000084ce2ec>] jffs2_rtime_compress+0x214/0x2f0
[  393.873955] [<ffff2000084bb3b0>] jffs2_selected_compress+0x178/0x2a0
[  393.880308] [<ffff2000084bb530>] jffs2_compress+0x58/0x478
[  393.885796] [<ffff2000084c5b34>] jffs2_write_inode_range+0x13c/0x450
[  393.892150] [<ffff2000084be0b8>] jffs2_write_end+0x2a8/0x4a0
[  393.897811] [<ffff2000081f3008>] generic_perform_write+0x1c0/0x280
[  393.903990] [<ffff2000081f5074>] __generic_file_write_iter+0x1c4/0x228
[  393.910517] [<ffff2000081f5210>] generic_file_write_iter+0x138/0x288
[  393.916870] [<ffff20000829ec1c>] __vfs_write+0x1b4/0x238
[  393.922181] [<ffff20000829ff00>] vfs_write+0xd0/0x238
[  393.927232] [<ffff2000082a1ba8>] SyS_write+0xa0/0x110
[  393.932283] [<ffff20000808429c>] __sys_trace_return+0x0/0x4
[  393.937851] Object at ffff800062e3b280, in cache kmalloc-64 size: 64
[  393.944197] Allocated:
[  393.946552] PID = 2918
[  393.948913]  save_stack_trace_tsk+0x0/0x220
[  393.953096]  save_stack_trace+0x18/0x20
[  393.956932]  kasan_kmalloc+0xd8/0x188
[  393.960594]  __kmalloc+0x144/0x238
[  393.963994]  jffs2_selected_compress+0x48/0x2a0
[  393.968524]  jffs2_compress+0x58/0x478
[  393.972273]  jffs2_write_inode_range+0x13c/0x450
[  393.976889]  jffs2_write_end+0x2a8/0x4a0
[  393.980810]  generic_perform_write+0x1c0/0x280
[  393.985251]  __generic_file_write_iter+0x1c4/0x228
[  393.990040]  generic_file_write_iter+0x138/0x288
[  393.994655]  __vfs_write+0x1b4/0x238
[  393.998228]  vfs_write+0xd0/0x238
[  394.001543]  SyS_write+0xa0/0x110
[  394.004856]  __sys_trace_return+0x0/0x4
[  394.008684] Freed:
[  394.010691] PID = 2918
[  394.013051]  save_stack_trace_tsk+0x0/0x220
[  394.017233]  save_stack_trace+0x18/0x20
[  394.021069]  kasan_slab_free+0x88/0x188
[  394.024902]  kfree+0x6c/0x1d8
[  394.027868]  jffs2_sum_write_sumnode+0x2c4/0x880
[  394.032486]  jffs2_do_reserve_space+0x198/0x598
[  394.037016]  jffs2_reserve_space+0x3f8/0x4d8
[  394.041286]  jffs2_write_inode_range+0xf0/0x450
[  394.045816]  jffs2_write_end+0x2a8/0x4a0
[  394.049737]  generic_perform_write+0x1c0/0x280
[  394.054179]  __generic_file_write_iter+0x1c4/0x228
[  394.058968]  generic_file_write_iter+0x138/0x288
[  394.063583]  __vfs_write+0x1b4/0x238
[  394.067157]  vfs_write+0xd0/0x238
[  394.070470]  SyS_write+0xa0/0x110
[  394.073783]  __sys_trace_return+0x0/0x4
[  394.077612] Memory state around the buggy address:
[  394.082404]  ffff800062e3b180: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[  394.089623]  ffff800062e3b200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[  394.096842] >ffff800062e3b280: 01 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  394.104056]                    ^
[  394.107283]  ffff800062e3b300: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[  394.114502]  ffff800062e3b380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[  394.121718] ==================================================================

Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
Christian Brauner
4d80aaebcf fs: make helpers idmap mount aware
Extend some inode methods with an additional user namespace argument. A
filesystem that is aware of idmapped mounts will receive the user
namespace the mount has been marked with. This can be used for
additional permission checking and also to enable filesystems to
translate between uids and gids if they need to. We have implemented all
relevant helpers in earlier patches.

As requested we simply extend the exisiting inode method instead of
introducing new ones. This is a little more code churn but it's mostly
mechanical and doesnt't leave us with additional inode methods.

Link: https://lore.kernel.org/r/20210121131959.646623-25-christian.brauner@ubuntu.com
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2023-01-12 08:16:30 +01:00
Tom Rix
dbe830c979 jffs2: remove trailing semicolon in macro definition
The macro use will already have a semicolon.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
lizhe
c4b8ba842b jffs2: Allow setting rp_size to zero during remounting
Set rp_size to zero will be ignore during remounting.

The method to identify whether we input a remounting option of
rp_size is to check if the rp_size input is zero. It can not work
well if we pass "rp_size=0".

This patch add a bool variable "set_rp_size" to fix this problem.

Reported-by: Jubin Zhong <zhongjubin@huawei.com>
Signed-off-by: lizhe <lizhe67@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
Zhe Li
64c7497915 jffs2: Fix GC exit abnormally
The log of this problem is:
jffs2: Error garbage collecting node at 0x***!
jffs2: No space for garbage collection. Aborting GC thread

This is because GC believe that it do nothing, so it abort.

After going over the image of jffs2, I find a scene that
can trigger this problem stably.
The scene is: there is a normal dirent node at summary-area,
but abnormal at corresponding not-summary-area with error
name_crc.

The reason that GC exit abnormally is because it find that
abnormal dirent node to GC, but when it goes to function
jffs2_add_fd_to_list, it cannot meet the condition listed
below:

if ((*prev)->nhash == new->nhash && !strcmp((*prev)->name, new->name))

So no node is marked obsolete, statistical information of
erase_block do not change, which cause GC exit abnormally.

The root cause of this problem is: we do not check the
name_crc of the abnormal dirent node with summary is enabled.

Noticed that in function jffs2_scan_dirent_node, we use
function jffs2_scan_dirty_space to deal with the dirent
node with error name_crc. So this patch add a checking
code in function read_direntry to ensure the correctness
of dirent node. If checked failed, the dirent node will
be marked obsolete so GC will pass this node and this
problem will be fixed.

Cc: <stable@vger.kernel.org>
Signed-off-by: Zhe Li <lizhe67@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
Randy Dunlap
819374bebc jffs2: Fix if/else empty body warnings
When debug (print) macros are not enabled, change them to use the
no_printk() macro instead of <nothing>. This fixes gcc warnings when
-Wextra is used:

../cpukit/libfs/src/jffs2/src/nodelist.c:255:37: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
../cpukit/libfs/src/jffs2/src/nodelist.c:278:38: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
../cpukit/libfs/src/jffs2/src/nodelist.c:558:52: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
../cpukit/libfs/src/jffs2/src/xattr.c:1247:58: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
../cpukit/libfs/src/jffs2/src/xattr.c:1281:65: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]

Builds without warnings on all 3 levels of CONFIG_JFFS2_FS_DEBUG.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-01-12 08:16:30 +01:00
Sebastian Huber
e5a53d636e jffs2: Add <linux/printk.h>
A follow up patch uses no_printk().
2023-01-12 08:16:30 +01:00
Sebastian Huber
d46366a2e7 riscv: Resurrect RISCV_ENABLE_HTIF_SUPPORT
Low-end configurations may want to have the HTIF support removed.
Enable the option by default.  Fix formatting.  Fix node validity
checks.

Updates #4779.
2023-01-12 08:15:58 +01:00
Kinsey Moore
b76f382bd4 bsps/xil: Use the LP64 header for ILP32
Xilinx's upstream ILP32 xil_cache.h header is out of date and broken.
This provides a copy of the LP64 header in place of the ILP32 header
since the LP64 header includes all the correct types to work with either
data model.
2023-01-04 13:11:29 -06:00
Kinsey Moore
f65bbb4059 bsps: Move ZynqMP-specific info into the BSP
The address of the nandpsu peripheral is specific to the ZynqMP SoC and
not relevant to other devices that might have one or more instances of
this peripheral.
2023-01-04 13:11:29 -06:00
Sebastian Huber
f8cb1f483d arm: Enable thread ID register for ARMv6
Close #4759.
2023-01-03 09:01:46 +01:00
Sebastian Huber
0c0b2837a7 bsp/qoriq: Add qoriq_mmu_adjust_and_write_to_tlb1() 2023-01-03 09:01:46 +01:00
Sebastian Huber
0e052bcb3e bsp/qoriq: Add qoriq_mmu_find_free_tlb1_entry() 2023-01-03 09:01:46 +01:00
Sebastian Huber
ad454d1c63 bsp/qoriq: Support message signaled interrupts 2023-01-03 09:01:46 +01:00
Sebastian Huber
62932ec0cc bsp/qoriq: Clear shared message signaled interrupts 2023-01-03 08:24:03 +01:00
Sebastian Huber
ecbb565653 bsp/qoriq: Use only pic_is_ipi() 2023-01-03 08:18:07 +01:00
zack leung
c8c713c6bd rtems_shell_main_chmod: Correct argument indexing
Closes #4751
2022-12-26 13:51:03 -06:00
zack leung
4523c71340 rtems_shell_main_mmove problem
--0000000000006acec205efd38cd6
Content-Type: text/plain; charset="UTF-8"

Closes #4556
2022-12-23 13:10:39 -06:00
Kinsey Moore
30ca711d19 bsps: Import Xilinx NAND driver
This adds Xilinx's driver for the Xilinx NAND controller embedded in the
ZynqMP SoC. Within that device alone, it is possible to access this
peripheral from MicroBlaze, ARMv7, and ARMv8 cores. This has been added
to the hardware ZynqMP BSPs since QEMU does not support emulation of
this peripheral. This driver supports polled operation only. The
imported files are and should be able to remain unmodified. Import
information is kept in bsps/shared/dev/nand/VERSION.
2022-12-23 13:06:42 -06:00
Kinsey Moore
50539ba881 bsps: Import Xilinx support code
This support code is necessary for many Xilinx-provided bare metal device
drivers supported on ARM, AArch64, and MicroBlaze platforms. Support for
all of these architectures is kept under bsps/include due to multiple
architecture variants being supported which requires complex logic in
the build system. The imported files are and should be able to remain
unmodified. Import information is kept in bsps/shared/xil/VERSION.
2022-12-23 13:06:42 -06:00
Hesham Almatary
88b80a5fd0 RISC-V: Always probe for HTIF and remove RISCV_ENABLE_HTIF_SUPPORT
Updates #4779
2022-12-23 09:21:14 +00:00
Hesham Almatary
a430dd43d9 spec/build/riscv: Start all riscv/riscv BSPs at 0x80000000
To follow other RISC-V-based OSes conventions. Delete generic
BSPs that start at 0x70000000 as BSPs are now medany by default.

Updates #4775
2022-12-23 09:21:07 +00:00
Hesham Almatary
dd28005490 spec/build/riscv: Default rv64* BSPs to medany cmodel
Currently generic RISC-V BSPs (riscv/riscv) that start with rv64 and not
rv64*_medany will start at 0x70000000. This adds high maintenance overhead
and deviates from almost all other RISC-V-based OSes and baremetal programs
that start at 0x80000000. Further, testing now has to account for an extra
parameter (medany or not) that doubles the number of BSPs need to be
tested.

This commit defaults all RV64 BSPs to use medany code model to allow starting
all BSPs at 0x80000000. BSPs that require different code models and/or
start addresses are custom and need to add their own entries.

Updates #4775
2022-12-23 09:21:02 +00:00
Sebastian Huber
4bd504053b dtc: Update VERSION 2022-12-22 08:02:57 +01:00
Tadeusz Struk
b5db3f64e3 libfdt: prevent integer overflow in fdt_next_tag
Since fdt_next_tag() in a public API function all input parameters,
including the fdt blob should not be trusted. It is possible to forge
a blob with invalid property length that will cause integer overflow
during offset calculation. To prevent that, validate the property length
read from the blob before doing calculations.

Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Message-Id: <20221005232931.3016047-1-tadeusz.struk@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-12-22 08:02:57 +01:00
Tadeusz Struk
8632d58f97 libfdt: add fdt_get_property_by_offset_w helper
Add a new fdt_get_property_by_offset_w helper function.
It is a wrapper on fdt_get_property_by_offset that returns
a writable pointer to a property at a given offset.

Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Message-Id: <20221011182611.116011-1-tadeusz.struk@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-12-22 08:02:57 +01:00
Jia Xianhua
b4d005e3fb libdtc: remove duplicate judgments
There is no need to check the VALID_DTB repeatedly, and can be combined
into one if statement.

Signed-off-by: Jia Xianhua <jiaxianhua@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-12-22 08:02:57 +01:00
Sebastian Huber
f169b513d2 score: Fix _Processor_mask_To_uint32_t()
Correctly calculate the array index and shift value in
_Processor_mask_To_uint32_t().  The bugs had no impact yet since this
function was always called with a zero value for the index in RTEMS.
2022-12-20 17:08:14 +01:00
Christian Mauderer
f845b95a16 bsp/atsam: Allow to use custom SDRAM
With the old build system in RTEMS 5 that was possible by just
overwriting BOARD_Sdram_Config and setting a custom
ATSAM_MEMORY_SDRAM_SIZE during building the BSP. In the new build system
that ATSAM_MEMORY_SDRAM_SIZE is set exclusively by the selected SDRAM
chip.

This patch adds the possibility to specify a "custom-0x100000" or
similar as SDRAM type where the number gives the SDRAM size.
2022-12-15 09:20:53 +01:00
Christian Mauderer
7b968a2eb4 bsps/atsam: Add NULL pointer protection 2022-12-15 09:20:52 +01:00
Christian Mauderer
26050b5fb4 bsps/atsam: Fix unidirectional SPI transfers
A SPI transfer where the Rx or Tx buffer is set to NULL currently
transfers or overwrites data starting from address 0x00000000 via DMA.

This patch changes the DMA setup so that dummy transfers are done.
Just reading / writing to a single location is simpler than changing the
whole logic of the transfer depending on the passed buffers.
2022-12-15 09:20:52 +01:00
Kinsey Moore
1c189e1aa7 bsps/zynqmp: Fix and update device trees
Add ref-clock-num identifiers to the device tree to ensure that
interfaces use the correct clocks even when some are not used due to
unconnected MII busses. This also adjusts the default ZynqMP PHY
attachment to RGMII-ID which was the default before device trees were
introduced.
2022-12-07 07:38:03 -06:00
Frank Kühndel
997ba1d905 tftpDriver.c: Fix Coverity issues
CID 1506523: Unchecked return value from library (CHECKED_RETURN)
CID 1506522: Unchecked return value from library (CHECKED_RETURN)
CID 1437618: Unchecked return value from library (CHECKED_RETURN)

Close #4718
2022-12-02 09:32:01 -06:00
Sebastian Huber
c46fbb9552 config: Add CONFIGURE_RECORD_INTERRUPTS_ENABLED
This enables the tracing of interrupt entry/exit events through an
application configuration option.  The interrupt processing can be
viewed with Trace Compass using rtems-record-lttng from the RTEMS Tools.

Update #4769.
2022-12-02 10:25:44 +01:00
Sebastian Huber
0d5e41afde bsps/irq: Add bsp_interrupt_get_dispatch_table_slot()
Update #4769.
2022-12-02 10:25:44 +01:00
Sebastian Huber
71d1acd41d bsps/irq: Rename handler in dispatch table
The name handler table was a bit misleading after the last rework.
Rename it to distach table.  Update the documentation accordingly.

Update #4769.
2022-12-02 10:25:39 +01:00
Sebastian Huber
e012671cfd aarch64/raspberrypi: Remove duplicate files
These files are already provided by "../../objirq".
2022-12-01 13:05:19 +01:00
Alex White
c3e14019c8 bsps/microblaze: Fix console interrupt build errors
This fixes build errors seen when building with console interrupts
enabled. A few places were missing bspopts.h includes, and one of the
UART functions was not defined.
2022-11-29 16:59:26 -06:00
Kinsey Moore
240987228f spec/beagle: Add missing spi.h install
The beagle SPI functions are unusable by applications unless this file
is installed with the BSP. This ensures that the file is installed
properly.
2022-11-28 10:09:40 +11:00
Chris Johns
408dbeb922 libmisc/rtems-fdt: Support prop map items up to the size of uintptr_t
Updates #4729
2022-11-25 12:43:29 +11:00
Chris Johns
904a9112de libmisc/shell: Fix edit Coverity error
Coverity Id: CID 1517029, CID 1517030, CID 1517031
2022-11-25 12:16:02 +11:00
Sebastian Huber
d9c7db505c bsps/riscv: Simplify PLIC support
In uniprocessor configurations there is no need to take interrupt affinities
into account for the interrupt vector enable/disable.
2022-11-23 07:56:12 +01:00
Sebastian Huber
d448aa4d05 bsps/riscv: Fix PLIC enable register count 2022-11-23 07:56:12 +01:00
Sebastian Huber
733d9b750c bsps/riscv: Add riscv_plic_cpu_0_init()
Move boot processor initialization of PLIC to separate function.
2022-11-23 07:56:12 +01:00
Sebastian Huber
5756a6af10 bsps/riscv: Fix bsp_fdt_map_intr()
The interrupt numbers in the device tree are usually PLIC interrupts.  Map the
number to the vector number associated with an external interrupt.
2022-11-23 07:56:12 +01:00
Chris Johns
8425e679c1 libmisc/shell: Support terminal size as env variables
Closes #4763
2022-11-23 07:00:08 +11:00
Chris Johns
8436cf9764 aarch64/versal: Add UART interrupt support 2022-11-22 21:14:58 +11:00
Aaron Nyholm
c5fa19ecb3 rtems/versal: Updated mmu to include mapping for SDHCI devices on versal
Tested on VCK190

Updates #4762
2022-11-22 13:25:49 +11:00
Kinsey Moore
5b7eea631d cpukit/rtems-fdt: Avoid use of malloc/errno
Use of malloc implies errno which adds TLS dependencies and prevents use
of this FDT wrapper library in BSP initialization code. This change
makes use of rtems_malloc and rtems_calloc which avoid TLS dependencies.
2022-11-18 16:02:46 -06:00
Kinsey Moore
efe8c37046 bsps/zynqmp: Use direct fdt_* calls
This changes the ZynqMP device tree parsing over to direct libfdt calls
to avoid inclusion of malloc() in the base BSP which currently causes
sp01 to fail due to unexpected use of TLS space.
2022-11-18 09:21:10 -06:00
Kinsey Moore
a9861ceea0 aarch64/mmu: Prevent block descriptors at level -1
In the original implementation, level -1 was unused and all levels could
have block-like descriptors (level 2 block descriptors are called page
descriptors). When support for level -1 page tables was added the
constraint on level -1 block descriptors was not honored. This prevents
block descriptors from being mapped at level -1 since the hardware will
not map them properly.
2022-11-17 10:29:04 +11:00
Daniel Cederman
3f644aa874 testsuites/smptests: Change license to BSD-2 for files with Gaisler copyright
This patch changes the license to BSD-2 for all source files where the
copyright is held by Aeroflex Gaisler, Cobham Gaisler, or Gaisler Research.

Updates #3053.
2022-11-14 11:01:36 +01:00
Daniel Cederman
9384ac2d65 cpukit: Change license to BSD-2 for files with Gaisler copyright
This patch changes the license to BSD-2 for all source files where the
copyright is held by Aeroflex Gaisler, Cobham Gaisler, or Gaisler Research.
Some files also includes copyright right statements from OAR and/or
embedded Brains in addition to Gaisler.

Updates #3053.
2022-11-14 11:00:58 +01:00
Daniel Cederman
18a181c267 bsps/riscv: Change license to BSD-2 for files with Gaisler copyright
This patch changes the license to BSD-2 for all source files where the
copyright is held by Aeroflex Gaisler, Cobham Gaisler, or Gaisler Research.
Some files also includes copyright right statements from OAR and/or
embedded Brains in addition to Gaisler.

Updates #3053.
2022-11-14 11:00:14 +01:00
Daniel Cederman
e01e499490 bsps/sparc: Change license to BSD-2 for files with Gaisler copyright
This patch changes the license to BSD-2 for all source files where the
copyright is held by Aeroflex Gaisler, Cobham Gaisler, or Gaisler Research.
Some files also includes copyright right statements from OAR and/or
embedded Brains in addition to Gaisler.

Updates #3053.
2022-11-14 10:59:44 +01:00
Daniel Cederman
5d5b9eeb08 bsps/shared/grlib: Change license to BSD-2 for files with Gaisler copyright
This patch changes the license to BSD-2 for all source files where the
copyright is held by Aeroflex Gaisler, Cobham Gaisler, or Gaisler Research.
Some files also includes copyright right statements from OAR and/or
embedded Brains in addition to Gaisler.

Updates #3053.
2022-11-14 10:59:08 +01:00
Daniel Cederman
33f6e34b2d bsps/include/grlib: Change license to BSD-2 for files with Gaisler copyright
This patch changes the license to BSD-2 for all source files where the
copyright is held by Aeroflex Gaisler, Cobham Gaisler, or Gaisler Research.
Some files also includes copyright right statements from OAR and/or
embedded Brains in addition to Gaisler.

Updates #3053.
2022-11-14 10:58:31 +01:00
Daniel Cederman
fa427fa1d9 bsps/include/libchip: Remove legacy networking header file 2022-11-14 07:44:35 +01:00
Gedare Bloom
a640854b5e wscript: rename bsp_list to bsplist 2022-11-11 11:58:05 -07:00
Gedare Bloom
9c15524f15 wscript: rename bsp_defaults to bspdefaults 2022-11-11 11:58:05 -07:00
Sebastian Huber
68e1dc87a6 validation: Fix unused variable warning 2022-11-11 16:48:12 +01:00
Sebastian Huber
77c8d822c3 bsps/riscv: Fix software interrupt dispatching
In SMP configurations, there may be no software interrupt handler
installed when the software interrupt is processed.  Add the new
interrupt handler dispatch variant
bsp_interrupt_handler_dispatch_unlikely() for this special case.
2022-11-11 16:38:25 +01:00
Sebastian Huber
55318d17b4 validation: Improve spurious interrupt test case
Use the tm27 support to test a spurious interrupt.  This helps to run the
validation test case on targets which have no software interrupt available for
tests (for example riscv/PLIC/CLINT in the SMP configuration).
2022-11-11 16:38:25 +01:00
Sebastian Huber
908ffc7a93 bsps/noel: Fix interrupt support 2022-11-11 16:38:25 +01:00
Kinsey Moore
b5983c559a cpukit/fdt: Fix typos and clarify params 2022-11-10 15:18:18 -06:00
Joel Sherrill
ecd8aec911 Remove remnants of rtems_io_lookup_name
Updates #3420.
2022-11-10 15:18:12 -06:00
Sebastian Huber
bfdfc979fd bsps/riscv: Fix PLIC enable register count
Each PLIC enable register has 32 bits, so we have to divide by 32.
2022-11-10 15:17:07 +01:00
Sebastian Huber
8f6dd3ca1f arm: Fix Armv7-M TLS support
Set the thread ID register in the CPU context.

Update #3835.
Close #4753.
2022-11-10 11:10:46 +01:00
Sebastian Huber
e4210d5a08 bsps/riscv: Skip init on not configured processors 2022-11-10 08:55:38 +01:00
Sebastian Huber
3e5ccdd34e bsps/riscv: Simplify riscv_plic_init() 2022-11-10 08:55:38 +01:00
Sebastian Huber
d2bac3d730 bsps/riscv: Simplify riscv_clint_init() 2022-11-10 08:55:38 +01:00
Sebastian Huber
ccf09a6e16 bsps/riscv: Add tm27 support 2022-11-10 08:55:38 +01:00
Sebastian Huber
ba53a177ab bsps/riscv: Always dispatch software interrupts
This helps to run the interrupt API validation tests.
2022-11-10 08:55:38 +01:00
Sebastian Huber
47d156d706 bsps/riscv: bsp_interrupt_get/set_affinity()
Provide bsp_interrupt_get_affinity() and bsp_interrupt_set_affinity() only if
RTEMS_SMP is enabled.  Replace fatal error with a status code.
2022-11-10 08:55:38 +01:00
Sebastian Huber
1bf1c779e1 bsps/riscv: bsp_interrupt_raise_on()
Implement bsp_interrupt_raise_on() and bsp_interrupt_raise().
2022-11-10 08:55:38 +01:00
Sebastian Huber
8a51ecc7b9 bsps/riscv: bsp_interrupt_is_pending()
Implement this function.
2022-11-10 08:55:38 +01:00
Sebastian Huber
d156d7b2f8 bsps/riscv: bsp_interrupt_get_attributes()
Implement this function.
2022-11-10 08:55:38 +01:00
Sebastian Huber
a52fc42454 bsps/riscv: Improve bsp_interrupt_vector_disable()
Add support for hart-specific software and timer interrupts.
2022-11-10 08:55:38 +01:00
Sebastian Huber
e19d490fbe bsps/riscv: Improve bsp_interrupt_vector_enable()
Add support for hart-specific software and timer interrupts.
2022-11-10 08:55:38 +01:00
Sebastian Huber
16c352de2f bsps/riscv: bsp_interrupt_vector_is_enabled()
Implement this function.
2022-11-10 08:55:38 +01:00
Sebastian Huber
9c80a88694 bsps/riscv: bsp_interrupt_is_valid_vector()
Implement this function.
2022-11-10 08:55:38 +01:00
Sebastian Huber
7d17b99660 bsps/riscv: RISCV_MAXIMUM_EXTERNAL_INTERRUPTS
Increase RISCV_MAXIMUM_EXTERNAL_INTERRUPTS to 128 to support recent Qemu
versions by default.
2022-11-10 08:55:38 +01:00
Sebastian Huber
f151e6f680 validation: Properly teardown test cases
Make sure that the state of the testable interrupt vector is restored to the
state at the test case begin.
2022-11-09 16:55:15 +01:00
Sebastian Huber
4a46161b3f riscv: Simplify _CPU_ISR_Set_level()
Where CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE, the only supported interrupt
level allowed to set is 0 (interrupts enabled).  This constraint is enforced by
the API level functions which return an error status for other interrupt
levels.
2022-11-09 16:54:02 +01:00
Sebastian Huber
b66cda78b2 libmd: Remove extra digest copy in SHA256_Final()
The extra digest copy was introduced by an erroneous merge conflict resolution
for commit "crypto routines: Hint minimum buffer sizes to the compiler".
2022-11-09 16:54:02 +01:00
Sebastian Huber
3a38a0173b riscv: Remove superfluous init/fini functions 2022-11-09 16:54:02 +01:00
Sebastian Huber
0f9231002c config: Place init task storage area in .rtemsstack
This avoids a superfluous zero initialization of the task storage area.  This
reduces the system initialization time.
2022-11-09 16:54:02 +01:00
Kinsey Moore
080dc5d873 cpukit/aarch64: Emulate FPSR for FENV traps
The AArch64 TRM specifies that when FPCR is set to trap floating point
exceptions, the FPSR exception bits are not set. This ensures that FPSR
is updated as FENV expects even if floating point exception traps are
enabled.
2022-11-09 08:14:11 -06:00
Kinsey Moore
698227e6ea bsps/aarch64: Ensure FPU trap state is consistent
RTEMS may be booted from a dirty environment. Ensure that FPU trap
settings are consistent.
2022-11-09 08:14:11 -06:00
Kinsey Moore
7842a333e0 zynqmp: Add support for the CFC-400X
This adds a BSP variant for the ZynqMP BSP family to support the
Innoflight CFC-400X platform. To properly support the CFC-400X, device
trees were added to the ZynqMP platform due to both the optional
management interface as well as alternate physical configuration of the
ethernet interfaces.
2022-11-09 08:01:03 -06:00
Sebastian Huber
df81434421 rtems: Fix type in description 2022-11-08 07:40:55 +01:00
Gedare Bloom
dc8539c108 wscript: fix formatting with yapf 2022-11-07 09:49:38 -07:00
Sebastian Huber
e15c5e5623 build: Disable can01 for small memory BSPs 2022-11-07 10:07:50 +01:00
Sebastian Huber
b4ffaa7cdc bsps/riscv: Use start data for object
Maybe this helps to ensure that the object is properly aligned.

Update #4658.
2022-11-04 14:01:44 +01:00
Chris Johns
18b1a59184 cpukit/libdebugger: Fix stepping on ARM architectures
Closes #4744
2022-10-31 08:04:00 +11:00
Chris Johns
d64e10ea37 rtems-bsps: Generate empty config.ini for arc/bsp combinations
- Generate a config for all BSPs in an arch
2022-10-31 08:03:11 +11:00
Prashanth S
26d50bdfb6 bsps/arm/beagle/dcan: Added DCAN support 2022-10-30 09:35:54 +01:00
Prashanth S
cd91b37dce cpukit/dev/can: Added CAN support 2022-10-30 09:35:54 +01:00
Sebastian Huber
89ba2a9838 bsps/riscv: Workaround for sporadic linker issues
Disable the linker relaxation in start.S to work around an issue described
here:

https://mail.gnu.org/archive/html/bug-binutils/2021-03/msg00164.html

The real issue is probably in the linker command file or the linker itself.

Update #4658.
2022-10-28 14:05:02 +02:00
Dariusz Sabala
1eae6f24fe bsps/arm: fix Cortex-M7 systick reload value
- see ARM DUI 0646C Arm Cortex-M7 Devices Generic User Guide
  "The RELOAD value is calculated according to its use.
  For example, to generate a multi-shot timer with a period
  of N processor clock cycles, use a RELOAD value of N-1.
  If the SysTick interrupt is required every 100 clock pulses,
  set RELOAD to 99."
- see routines used in CMSIS project for reference

Close #4746.
2022-10-26 11:47:22 +02:00
Sebastian Huber
f6bcf1636b sptests: Avoid fatal error to end a test
End the test with a normal exit instead of
INTERNAL_ERROR_THREAD_EXITTED.
2022-10-25 08:00:32 +02:00
Sebastian Huber
468f21ed4f bsps: Add Cache Manager implementation group
Update #3707.
2022-10-24 13:34:32 +02:00
Chris Johns
d574e08663 libdebugger: Add a target break call to suspend all running threads
- Optionally wait if there is no remote debugger connected and break
  when the remote connects

Closes #4740
2022-10-18 07:37:57 +11:00
Alan Cudmore
1d2fab8a79 bsps: Improve riscv console FDT parsing
This fixes a problem with parsing the FDT compatible property by
replacing the RISCV_CONSOLE_IS_COMPATIBLE macro with calls to
the fdt_stringlist_contains function. The macro only works when
the compatible FDT entry is a single string and not a list of
strings. The new call will compare each item in the string list.

Close #4728.
2022-10-14 08:15:14 -05:00
Sebastian Huber
e9a69c5744 riscv: Move functions to avoid build issues
The _RISCV_Map_cpu_index_to_hardid() and _RISCV_Map_hardid_to_cpu_index()
functions must be available to all riscv BSPs.
2022-10-14 10:52:52 +02:00
Sebastian Huber
a7706515c7 validation: Use correct number of idle tasks
Update #3716.
2022-10-14 10:48:23 +02:00
Sebastian Huber
a1f23c2879 powerpc: Conditionally provide Context_Control_fp
This avoids a pedantic warning about a zero size Context_Control_fp.
2022-10-14 10:48:23 +02:00
Sebastian Huber
985aaac0ab powerpc: Fix 'noreturn' function does return 2022-10-14 10:48:23 +02:00
Sebastian Huber
64fbeaa0d1 score: INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL
Ensure that the IDLE storage allocator did allocate a suffiently large area.

Update #3835.
Update #4524.
2022-10-14 10:48:23 +02:00
Sebastian Huber
45ee958552 config: Add CONFIGURE_IDLE_TASK_STORAGE_SIZE
By default, allocate the IDLE task storage areas from the RTEMS Workspace.
This avoids having to estimate the thread-local storage size in the default
configuration.

Add the application configuration option CONFIGURE_IDLE_TASK_STORAGE_SIZE to
request a static allocation of the task storage area for IDLE tasks.

Update #3835.
Update #4524.
2022-10-14 10:48:23 +02:00
Sebastian Huber
6a8208533d stackchk01: Check CPU_STACK_MINIMUM_SIZE
Ensure that the CPU_STACK_MINIMUM_SIZE is suffiently larger than the stack
usage in simple applications.
2022-10-14 10:48:23 +02:00
Sebastian Huber
829e489230 stackchk: Add rtems_stack_checker_iterate() 2022-10-14 10:48:23 +02:00
Sebastian Huber
03ddd89459 stackchk: Avoid internal header file 2022-10-14 10:48:23 +02:00
Sebastian Huber
1ab93ba480 score: INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED
Add the INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED fatal error in case the
creation of an idle thread fails.  This may happen due to a failing create
extension provided by the application.
2022-10-14 10:48:22 +02:00
Sebastian Huber
8d44129da2 score: Simplify casts 2022-10-14 10:48:22 +02:00
Sebastian Huber
4c89fbcd31 score: Add CPU_THREAD_LOCAL_STORAGE_VARIANT
Update #3835.
2022-10-14 10:48:22 +02:00
Sebastian Huber
15bba4aecf score: Move Thread_Control::Registers member
Place this member placed directly after the end of the common block so that
the structure offsets are as small as possible.  This helps on instruction
set architectures with a very limited range for intermediate values.  For
example, see the __aeabi_read_tp() implementation for ARM Thumb-1.

Update #3835.
2022-10-14 10:48:22 +02:00
Sebastian Huber
2846b17d7e config: Changeable size for IDLE stack allocator
Allow the IDLE stack allocator to change the stack size.  This can be
used by applications with a very dynamic thread-local storage size to
adjust the thread storage area of the IDLE tasks dynamically.

Update #4524.
2022-10-14 07:29:41 +02:00
Sebastian Huber
23cdecd839 score: Require power of two CPU_STACK_MINIMUM_SIZE
For most CPU ports this was already the case.  This makes it possible to use
the size as an object alignment using RTEMS_ALIGNED().
2022-10-14 07:29:41 +02:00
Sebastian Huber
dc545608a7 sptls02: Fix alignment check 2022-10-14 07:29:41 +02:00
Sebastian Huber
b9212e242f sptls01: Disable file system and Newlib reentrancy
Update #4560.
2022-10-14 07:29:41 +02:00
Sebastian Huber
0307c81aa0 sptls0*: Enable stack checker
The thread-local storage area is located close to other stacks.  Try to detect
overwrites.
2022-10-14 07:29:41 +02:00
Chris Johns
580a3a6817 libmisc/rtems-fdt: Fix return error values
Updates #4729
2022-10-14 13:43:08 +11:00
Sebastian Huber
97fce5120c build: Enable RISCV_BOOT_HARTID only for riscv 2022-10-13 06:24:23 +02:00
Chris Johns
fe104e399a libmisc/rtems-fdt: Fix missing error string
- Coverity CID 1515930 issue

Updates #4729
2022-10-11 12:50:30 +11:00
Chris Johns
40eb58fd5e libmisc/rtems-fdt: Update to support 64bit addresses
- Add support to get the parent address and size cells

- Provide support to get a reg prop address map

- Change getting a set of properties to uintptr_t

- Improve the debug mode of the ls command to print all props

Closes #4729
2022-10-10 11:40:55 +11:00
Sebastian Huber
46f08961a2 psxrwlock01: Use an initilized lock for tests
Close #4738.
2022-10-07 07:14:51 +02:00
Sebastian Huber
0a9ba96389 config: CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE
Move CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE to the general configuration
options.
2022-10-06 09:17:24 +02:00
Sebastian Huber
3bad6b8ff9 validation: Fix wording 2022-10-06 09:03:06 +02:00
Mohd Noor Aman
b57c6541a1 bsp/aarch64: Add new Raspberry Pi 4B BSP
This patch adds new Raspberry pi 4B AArch64 BSP to the RTEMS Family. Currently
only LP64 ABI is supported. ILP32 is not supported. RAM starts from 0x80000 in
64Bit kernel mode and MMU from 0x0. All Raspberrypi Pi 4B models and Raspberry
Pi 400 are supported. All the IRQs are similiar to the older Raspberry pi 2 ARM
BSP.

Raspberry Pi 4B has 2 types of UARTs. Only PL011 serial is supported currently.
Mini-UART is not supported. Mini-UART is default UART on the board so it needs
to be disabled by adding "dtoverlay=disable-bt" to the config.txt. No support
for additional 4 PL011-UARTs on the board.

The raspberrypi.h includes many of the address required for the future
development of the RPi 4B BSP. This includes peripherals, ARM Timer, VideoCore
Timer, Watchdog, Mailbox, AUX, FIQs and IRQs.
2022-10-04 17:04:44 -05:00
Sebastian Huber
cc43dc3e22 rtems: Clarify application config info API
Update #3993.
2022-10-04 10:44:10 +02:00
Kinsey Moore
3af84c1bea cpukit/fdt: Free index before container
Ensure that the index is released before the structure containing it is
freed and NULLed.

Updates #4460
2022-10-03 13:24:46 -05:00
Kinsey Moore
584f5bc9af cpukit/fdt: Check correct allocation
The second allocation check was mistakenly rechecking the first
allocation. It now checks the correct allocation and ensures that names
is not NULL.

Updates #4462
2022-10-03 13:24:46 -05:00
Sebastian Huber
c6bd860f13 rtems: Fix format 2022-09-30 14:54:27 +02:00
Sebastian Huber
a3717de01c validation: Remove unused test suite
Update #3716.
2022-09-28 13:49:31 +02:00
Sebastian Huber
9ed7103c61 score: Simplify Chain_Node definition
Fix documentation.
2022-09-23 11:14:58 +02:00
Sebastian Huber
acf1e5b266 rtems: Add rtems_clock_get_ticks_since_boot() function
This function was declared, however, a definition was missing.  Add a
validation test for it.
2022-09-23 11:14:58 +02:00
Sebastian Huber
962904cd94 bsps: Fix format specifier
Close #4722.
2022-09-23 08:37:59 +02:00
Sebastian Huber
74a78fbfd1 rtems: Fix typo in rtems_build_name() definition 2022-09-22 13:20:59 +02:00
Sebastian Huber
ade8d995aa build: Install SHA header files
Update #3719.
2022-09-22 08:27:25 +02:00
Sebastian Huber
f6e7c62705 bsps/arm: Mark functions in start.S
Add the function type to _start() and bsp_start_hook_0_done() so that
the linker can generate ARM/Thumb interworking code.

Update #4202.
2022-09-22 08:05:06 +02:00
Sebastian Huber
3edf9cba67 bsps/arm: Move bsp_start_hook_0_done()
Declare bsp_start_hook_0_done() in <bsp/start.h>.
2022-09-22 07:59:05 +02:00
Sebastian Huber
80be0de40e bsps/arm: Add comment about banked FIQ registers 2022-09-22 07:59:04 +02:00
Padmarao Begari
d0b92735b0 bsps/shared/: Use device tree blob
If the bsp is integrated and supported a device tree
blob(dtb) then use dtb instead of using it from
the U-Boot (BSP_START_COPY_FDT_FROM_U_BOOT=False).
2022-09-20 12:00:51 -05:00
Padmarao Begari
6b0d3c9873 bsps/riscv: Add Microchip PolarFire SoC BSP variant
The Microchip PolarFire SoC support is implemented as a
riscv BSP variant to boot with any individual hart(cpu core)
or SMP based on the boot HARTID configurable and support
components are 4 CPU Cores (U54), Interrupt controller (PLIC),
Timer (CLINT), UART.
2022-09-20 12:00:51 -05:00
Padmarao Begari
974c6ea9d6 spec/build/bsps: Add dtb support
Add dtb and dtb header path configurable build option
2022-09-20 12:00:51 -05:00
Padmarao Begari
9cdc00881e bsps/riscv: Add device tree blob
Add the basic Microchip PolarFire SoC device tree source and blob

The mpfs-dtb.h is generated by the bin2hex

https://github.com/padmaraob/bin2hex

1.Compile and build the bin2hex.c
	$ gcc -o bin2hex bin2hex.c

2.Generate the mpfs.dtb from the mpfs.dts
	$ dtc -O dtb -o mpfs.dtb mpfs.dts

3.Generate the mpfs-dtb.h Header file from the mpfs.dtb.
	$ ./bin2hex mpfs.dtb
2022-09-20 12:00:51 -05:00
Sebastian Huber
63cf583365 bsp/tms570: Fix TMS570_USE_HWINIT_STARTUP
Make sure only one module is built which defines bsp_start_hook_0().
2022-09-20 10:35:06 +02:00
Sebastian Huber
f3f5b2781f bsp/tms570: Fix declarations
This avoids multiple definition errors.
2022-09-20 10:35:06 +02:00
Sebastian Huber
9a55120420 bsp/tms570: Add -mbe32 to LINKFLAGS
There is not just big-endian on ARM.  We have two variants BE32
(obsolete) and BE8.  The Cortex-R5F processor supports only BE8,
however, some TMS570 variants are BE32 internally.  In GCC 8 and later,
the --be8 option is passed to the linker based on the selected
architecture or CPU.  Use BE32 by default for the TMS570 BSP.

In GCC, see:

commit 63d03dcecdafe34715282a5155cfc2162375feca
Author: Richard Earnshaw <rearnsha@arm.com>
Date:   Mon Jul 3 13:22:05 2017 +0000

     [arm] Clean up generation of BE8 format images.
2022-09-20 10:34:35 +02:00
Alan Cudmore
88f4d44f00 bsps/riscv/riscv: Fix fe310_uart_read
Note: Resending after learning how to use git send-email, please disregard previous message.

This fixes the riscv fe310 console driver fe310_uart_read function. The function
reads the RX status/data register to check if data is available, but discards
the data and reads it a seconds time.
Also cleared the interrupt enable bit in the first_open function.

Close #4719
2022-09-19 17:10:01 +02:00
Sebastian Huber
a660e9dc47 Do not use RTEMS_INLINE_ROUTINE
Directly use "static inline" which is available in C99 and later.  This brings
the RTEMS implementation closer to standard C.

Close #3935.
2022-09-19 09:09:22 +02:00
Sebastian Huber
3803757b2c validation: Test deadlock detection special case
Update #3716.
2022-09-12 09:39:04 +02:00
Sebastian Huber
4fdf79cca5 score: Prevent an out of bounds warning
Update #4702.
2022-09-12 09:37:37 +02:00
Sebastian Huber
8d32b9884c validation: Fix integer type warning
Update #4662.
2022-09-09 08:09:11 +02:00
Sebastian Huber
270200e972 score: Remove _CPU_Counter_difference()
All CPU ports used the same _CPU_Counter_difference() implementation.  Remove
this CPU port interface and mandate a monotonically increasing CPU counter.

Close #3456.
2022-09-09 06:57:10 +02:00
Xin LI
fe90ada455 libcrypt: There is no need to clear message digest
context after they are finialized after r336539, so do not do it.

Submitted by:	David CARLIER <devnexen gmail com>
MFC after:	1 month (after r336539)
Differential Revision:	https://reviews.freebsd.org/D16059
2022-09-08 16:14:56 +02:00
Xin LI
1acb1925e9 Get rid of unused variables.
copied_key and copied_salt are assigned with NULL and never used
otherwise. Remove the two variables and related code.

Reviewed by:	pfg
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16314
2022-09-08 16:14:56 +02:00
Pedro F. Giffuni
6fe3acd0d7 lib: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2022-09-08 16:14:56 +02:00
Pedro F. Giffuni
4fe13bdab1 General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2022-09-08 16:14:56 +02:00
Sebastian Huber
ac31e2f993 libtests/sha: Add tests for SHA512-256 2022-09-08 16:14:56 +02:00
Sebastian Huber
fdbf89fee7 libtests/sha: Add tests for SHA512-224 2022-09-08 16:14:56 +02:00
Sebastian Huber
d37baa17e6 libtests/sha: Add tests for SHA384 2022-09-08 16:14:56 +02:00
Sebastian Huber
bea7e5a0ff libtests/sha: Add tests for SHA224 2022-09-08 16:14:56 +02:00
Xin LI
f5ee9a0e0b libmd: Always erase context in _Final method,
and when doing it, consistently use explicit_bzero().

Update manual pages to match the behavior.

Reviewed by:	pfg, allanjude, jmg
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D16316
2022-09-08 16:14:56 +02:00
Conrad Meyer
efd19aa7c1 Implement SHA2-224 submode of SHA2-256
Like SHA2-384:SHA2-512, SHA2-224 is simply a truncated SHA2-256 with a
different initial vector.  Add to round out the complete basic SHA2 family.
2022-09-08 16:14:56 +02:00
Alan Somers
48f7979f5d Fix C++ includability of crypto headers with static array sizes
C99 allows array function parameters to use the static keyword for their
sizes. This tells the compiler that the parameter will have at least the
specified size, and calling code will fail to compile if that guarantee is
not met. However, this syntax is not legal in C++.

This commit reverts r300824, which worked around the problem for
sys/sys/md5.h only, and introduces a new macro: min_size(). min_size(x) can
be used in headers as a static array size, but will still compile in C++
mode.

Reviewed by:	cem, ed
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D8277
2022-09-08 16:14:56 +02:00
Colin Percival
4ebb5f893e Retune SHA2 code for improved performance on CPUs
with more ILP and a preference for memory load instructions over large code
footprints with embedded immediate variables.

On amd64 CPUs from 2007-2008 there is not a significant change, but
amd64 CPUs from 2009-2010 get roughly 10% more throughput with this
code; amd64 CPUs from 2011-2012 get roughly 15% more throughput; and
AMD64 CPUs from 2013-2015 get 20-25% more throughput.  The Raspberry
Pi 2 increases its throughput by 6-8%.

Sponsored by:	Tarsnap Backup Inc.
Performance tested by:	allanjude
MFC after:	3 weeks
2022-09-08 16:14:56 +02:00
Allan Jude
7b4296ed19 Implement SHA-512 truncated (224 and 256 bits)
This implements SHA-512/256, which generates a 256 bit hash by
calculating the SHA-512 then truncating the result. A different initial
value is used, making the result different from the first 256 bits of
the SHA-512 of the same input. SHA-512 is ~50% faster than SHA-256 on
64bit platforms, so the result is a faster 256 bit hash.

The main goal of this implementation is to enable support for this
faster hashing algorithm in ZFS. The feature was introduced into ZFS
in r289422, but is disconnected because SHA-512/256 support was missing.
A further commit will enable it in ZFS.

This is the follow on to r292782

Reviewed by:	cem
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D6061
2022-09-08 16:14:56 +02:00
Conrad Meyer
3a22e5d30f crypto routines: Hint minimum buffer sizes to the compiler
Use the C99 'static' keyword to hint to the compiler IVs and output digest
sizes.  The keyword informs the compiler of the minimum valid size for a given
array.  Obviously not every pointer can be validated (i.e., the compiler can
produce false negative but not false positive reports).

No functional change.  No ABI change.

Sponsored by:	EMC / Isilon Storage Division
2022-09-08 16:14:56 +02:00
Allan Jude
225e7b9e75 Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
cperciva's libmd implementation is 5-30% faster

The same was done for SHA256 previously in r263218

cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation

Extend sbin/md5 to create sha384(1)

Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h}

Reviewed by:	cperciva, des, delphij
Approved by:	secteam, bapt (mentor)
MFC after:	2 weeks
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3929
2022-09-08 16:14:56 +02:00
Sebastian Huber
120c857ea1 minimum: Do not use unified work areas
The CONFIGURE_UNIFIED_WORK_AREAS option pulls in a system initialization
handler which initializes the unified heap.

Close #4108.
2022-09-08 16:14:56 +02:00
Sebastian Huber
52d566c864 bsp/qoriq: Enable VRSAVE optimization
Close #4712.
2022-09-08 15:54:23 +02:00
Sebastian Huber
d907c2294a powerpc: Add support for VRSAVE
The VRSAVE feature of the Altivec unit can be used to reduce the amount of
Altivec registers which need to be saved/restored during interrupt processing
and context switches.

In order to use the VRSAVE optimization a corresponding multilib (-mvrsave) is
required, see GCC configuration.  The -mvrsave option must be added to the
ABI_FLAGS of the BSP.

Currently only the -mcpu=e6500 based QorIQ BSP support this optimization.

Update #4712.
2022-09-08 15:54:23 +02:00
Sebastian Huber
85d482f122 rtems: Include <rtems/score/cpuopts.h>
Directly include <rtems/score/cpuopts.h> in header files using CPU build
options.
2022-09-08 15:28:54 +02:00
Sebastian Huber
548d005079 score: Improve formatting 2022-09-08 15:28:54 +02:00
Joel Sherrill
dbba943044 pthread_atfork(): Change to behavior from FACE Technical Standard
Closes #4713.
2022-09-06 17:09:11 -05:00
Martin Aberg
9ec9be834d bsp/riscv: Add NOEL-V BSP
Added support for Cobham Gaisler NOEL-V systems. The NOEL-V support
is implemented as a riscv BSP. Both 32-bit and 64-bit processor
systems are supported. Cobham Gaisler's NOEL-V RISC-V processor IP
is described here:
  https://www.gaisler.com/NOELV

Compatible with the following NOEL-V FPGA example design ranges
available from Cobham Gaisler. Follow the links for free
bit-streams, DTS/DTB, user's manuals and quick-start guides:
- NOEL-ARTYA7-EX    (https://www.gaisler.com/NOEL-ARTYA7)
- NOEL-PF-EX        (https://www.gaisler.com/NOEL-PF)
- NOEL-XCKU-EX      (https://www.gaisler.com/NOEL-XCKU)

Uses the shared GRLIB APBUART console driver "apbuart_termios.c".
APBUART devices are probed using device tree.

Closes #4225.
2022-09-06 16:15:58 +02:00
Daniel Cederman
ca07efd571 bsp/riscv: Work area size based on /memory node in fdt
Uses the first entry in the /memory node to determine the end of the
work area. Falls back on linker symbol if unable to parse the node.
2022-09-06 15:51:58 +02:00
Sebastian Huber
33f1223cab config: Add SMP scheduler configuration errors
Issue an error message if an SMP-specific scheduler is used and
RTEMS_SMP is disabled.  This might be a more informative compared to
compiler or linker errors.
2022-09-05 16:21:14 +02:00
Sebastian Huber
4e227f460c validation: CONFIGURE_SCHEDULER_TABLE_ENTRIES
Test this option in a configuration with only one processor.

Update #3716.
2022-09-05 15:46:32 +02:00
Sebastian Huber
444f56cdd8 score: Regenerate <rtems/score/basedefs.h>
Two interface specification items moved.
2022-09-05 15:46:32 +02:00
Sebastian Huber
98353136dd validation: Refine basedefs specification
Update #3716.
2022-09-05 15:46:32 +02:00
Sebastian Huber
e770067283 rtems: Add constraints for rtems_clock_tick() 2022-09-05 15:46:32 +02:00
Sebastian Huber
3247b16f7a Add items to Doxygen groups 2022-09-05 15:46:32 +02:00
Sebastian Huber
9e9ce43dcb validation: Regenerate
Update #4702.
2022-09-05 08:57:42 +02:00
Sebastian Huber
b06ec5b6d7 config: Document CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR
Update #4691.
2022-09-05 08:57:28 +02:00
Sebastian Huber
b1072f5ae2 validation: Ignore array bounds warnings
Update #4702.
2022-08-31 13:21:02 +02:00
Sebastian Huber
dad6d32271 Fix pedanic warnings without a storage increase
Use RTEMS_ZERO_LENGTH_ARRAY for flexible array member.

Update #4662.
2022-08-31 13:21:02 +02:00
Sebastian Huber
1be6dc18d3 libtest: Fix warnings without a pragma
It seems that recent GCC versions expect that functions with a "const type *"
parameter will read from the referenced location.

Update #4662.
2022-08-31 13:20:49 +02:00
Sebastian Huber
b3d2e3fefe config: Include <rtems/posix/timer.h> on demand
Updates #4691.
2022-08-31 13:18:19 +02:00
Sebastian Huber
c4472cef3e validation: Move flush filter stop validation
This gets rid of a cyclic dependency in the specification graph.

Update #3716.
2022-08-31 11:29:56 +02:00
Sebastian Huber
1dca588f63 validation: Support a partial thread queue flush
Update #3716.
2022-08-31 11:29:37 +02:00
Sebastian Huber
44b3bc65af validation: Fix use of uninitialized variables
Update #4662.
2022-08-30 07:30:42 +02:00
Sebastian Huber
c226990836 score: Do not expose <limits.h> to <rtems.h>
The <rtems.h> header file should not unnecessarily include standard C
header files.  The <string.h> and <limits.h> header includes were
removed in 2017.

Update #4662.
2022-08-30 06:59:37 +02:00
Sebastian Huber
9b16f24d9c score: Fix format
Update #4706.
2022-08-29 09:19:26 +02:00
Sebastian Huber
23b42f79f9 score: Fix format
Update #4706.
2022-08-29 09:15:03 +02:00
Sebastian Huber
3d2fbaf4a3 Revert "linkersets.h: Fix gcc 12 warning"
This reverts commit f930206724.

The linker set begin must be a symbol and not a zero-initialized item.
2022-08-29 08:53:22 +02:00
Chris Johns
a932829b01 libdebugger/aarch64: Set .start section to RW
- Stops the server crashing when setting breakpoints in .start
2022-08-25 14:10:21 +10:00
Chris Johns
a3b0f7d5a8 bsps/xilinx/versal: Add Cadence I2C driver support 2022-08-25 09:25:03 +10:00
Stephen Clark
c738be92a0 bsps/amd64: remove -Werror from ABI flags
The ABI flags for the amd64 BSP contain the -Werror=return-type flag. There is no reason for this to be there so it has been removed. The same option has also been removed amd64.cfg file.
2022-08-23 11:37:21 -05:00
Chris Johns
dee5ea8147 bsps/xilinx/versal: Remove IPL32 BSPs, add aiedge and change defaults
- Versal has IO mapped to the upper 64bit address space and
  needs full 64bit addresses.

- Add xilinx_versal_aiedge for custom hardware

- Make the hardware settings the defaults and qemu as variants

Closes #4693
2022-08-23 07:55:25 +10:00
Chris Johns
a329579ed5 cpukit/include: Fix including in C++
UPdates #4706
2022-08-22 08:30:00 +10:00
Chris Johns
f5233fe51c cpukit/include: Fixes for C++
Updates #4706
2022-08-22 08:30:00 +10:00
Chris Johns
eae542c02f spec/librtemscpu: Fix installed headers
- pci.h is only for sparc

- keyimpl.h is not referenced and so not needed

Updates #4705
2022-08-22 08:30:00 +10:00
Chris Johns
bb09755086 spec/bsps/aarch64: Install ELF machine types for libdl
Updates #4705
2022-08-22 08:30:00 +10:00
Chris Johns
e49a1c9b38 spec/bsps: Do not install tm27.h
Updates #4705
2022-08-22 08:30:00 +10:00
Ryan Long
f045b9ddd8 psxkey07/init.c: Add pragma for gcc 12 warning
Updates #4662
2022-08-19 15:34:47 -05:00
Ryan Long
f60f349d86 psxclock/init.c: Change print format for warning
Updates #4662
2022-08-19 15:34:47 -05:00
Ryan Long
978022eeb0 ttest01/test-checks.c: Initialize variables
These uninitialized variables were causing warnings to be generated.

Updates #4662
2022-08-19 15:34:47 -05:00
Ryan Long
a447b9b377 malloctest/init.c: Added pragmas to address gcc 12 warnings
Updates #4662
2022-08-19 15:34:47 -05:00
Ryan Long
dc0dcccf41 dl09/dl-load.c: Fix gcc 12 warning
Changed format of size_t variable being printed.

Updates #4662
2022-08-19 15:34:47 -05:00
Ryan Long
b092ad57e2 cpu.h: Fix gcc 12 warnings
Added two pragmas to address, and changed the value of
AARCH64_EXCEPTION_MAKE_ENUM_64_BIT to INT_MAX because the old value was not
in range of an int.

Updates #4662
2022-08-19 15:34:47 -05:00
Ryan Long
9e2289785b test.h: Add pragma for gcc 12 warning
Updates #4662
2022-08-19 15:34:47 -05:00
Ryan Long
5b87591515 schedulerpriority.h: Fix gcc 12 warning
Changed the size of the array to 1 to get rid of the warning.

Updates #4662
2022-08-19 15:34:47 -05:00
Ryan Long
c55bd16037 percpu.h: Add pragma for gcc 12 warning
Updates #4662
2022-08-19 15:34:46 -05:00
Ryan Long
df3fa4e005 interr.h: Fix gcc 12 warning
The warning that this fixes states that "ISO C restricts enumerator values to
range of 'int'."

Updates #4662
2022-08-19 15:34:46 -05:00
Ryan Long
f930206724 linkersets.h: Fix gcc 12 warning
Changing the offset from 0 to 1 got rid of a warning stating that offset 0 is
out of bounds.

Updates #4662
2022-08-19 15:34:46 -05:00
Ryan Long
ec7d6c092f threads.h: Add pragmas to get rid of gcc 12 errors
Updates #4662
2022-08-19 15:34:46 -05:00
Sebastian Huber
21a36ed19b bsps: Fix .data.rel.ro placement
The .data.rel.ro* linker input section pattern accidentally matches with
writeable data those symbol name starts with "ro".

Close #4701.
2022-08-12 10:10:17 +02:00
Joel Sherrill
996d18c212 psxtimer_face01: Improve coverage and documentation
Updates #4691.
2022-08-11 13:10:11 -05:00
Duc Doan
c655c72d05 build/cpukit: Add confdefs/face.h to install rule
Updates #4691
2022-08-11 15:49:15 +10:00
Joel Sherrill
36895bd2c5 cpukit/include/rtems/test-info.h: Change @returns to @return 2022-08-10 14:15:47 -05:00
Joel Sherrill
b6e00691ff psxtimer0[12]/psxtimer.c: Reformat file header. 2022-08-10 14:15:46 -05:00
Joel Sherrill
4b04589b09 Add support for CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR
This adds the configure option CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR
which allows the application to choose whether to have the POSIX
timer_create() function follow the behavior defined by POSIX or
the FACE Technical Standard.

Updates #4691.
2022-08-10 14:15:46 -05:00
Sebastian Huber
cf3d2b37c8 rtems/malloc.h: Add API level Doxygen group
The interfaces in the MallocSupport group belong to the implementation.  They
are used by confdefs.h for example.
2022-08-10 15:41:58 +02:00
Sebastian Huber
f6a38fb254 validation: Use T_report_hash_sha256_update()
Add the direct BSP character ouput to the report hash.

Update #3716.
2022-08-10 07:51:19 +02:00
Sebastian Huber
7219d3c0e9 libtest: Add T_report_hash_sha256_update()
Update #3716.
2022-08-10 07:51:14 +02:00
Ryan Long
5500232a89 libdl: Refactor shared code in ARM and AArch64
rtl-mdreloc-arm.c was used as the basis for rtl-mdreloc-aarch64.c. This lead
to some code being shared by the two files. The code was consolidated into
rtl-unwind-arm.c.

Closes #4686
2022-08-08 12:02:03 -05:00
Sebastian Huber
c3c4525a32 posix: Avoid dead code in clock_nanosleep()
This issue was reported by Coverity Scan for RTEMS:

CID 1507760: Control flow issues (DEADCODE)

Closes #4690.
2022-08-05 08:20:58 +02:00
Chris Johns
c36d608079 testsuite: Fix warnings
Updates #4662
2022-08-05 07:54:13 +10:00
Chris Johns
46131ce0e1 libdl: Fix warnings on 64bit architectures
Updates #4662
2022-08-05 07:54:13 +10:00
Chris Johns
1a883b9b55 testsuite/psxclock: Check setting realtime clock does not effect sleeping tasks
Closes #4690
2022-08-05 07:53:10 +10:00
Sebastian Huber
52b7a5840a build: Install <rtems/score/gcov.h>
Update #4670.
2022-08-04 19:37:46 +02:00
Sebastian Huber
c64c638f6d posix: Fix relative CLOCK_REALTIME sleep
A relative CLOCK_REALTIME time out shall not be affected by CLOCK_REALTIME
changes through clock_settime().  Since our CLOCK_REALTIME is basically just
CLOCK_MONOTONIC plus an offset, we can simply use the CLOCK_MONOTONIC watchdog
for relative CLOCK_REALTIME time outs.

Update #4690.
2022-08-04 07:55:30 +02:00
Chris Johns
071640d310 libmisc/shell: Add an 'rtems' command to report a running build
- Report version, cpu, bsp, tools and options.
2022-08-03 10:46:10 +10:00
Sebastian Huber
4d77f725ca sp54: Fix test case
Since commit 6a6580331d, the local table is
zero-initialized.  Use an initial object control block instead.

Update #4678.
2022-08-01 09:15:36 +02:00
Ryan Long
1c6ac88f93 cpukit/libdl/rtl-sym.c: Fix increment of variable
In rtems_rtl_symbol_global_add() the loop that gets to the end of the symbol
table used "unsigned long" to increment the index for the table. For most
architectures this resulted in 4, but with AArch64, it results in 8. This
resulted in the symbols being read in wrong. Changing this to void* along with
changing the RISC-V specific code for 8 byte pointers in rtems-tools to work
independent of the architecture.

Updates #4673
Closes #4682
2022-07-29 08:32:47 -05:00
Ryan Long
2ea37e8b0d libtests/dl*: Bump up the size of CONFIGURE_INIT_TASK_STACK_SIZE
Updates #4682
2022-07-29 08:32:47 -05:00
Ryan Long
0bd6514aa2 cpukit/libdl: Add support for AArch64
rtl-mdreloc-aarch64.c and elf_machdep.h came from NetBSD.

Updates #4682
2022-07-29 08:32:47 -05:00
Ryan Long
f643215648 libdl/rtl-elf.h: Fix aarch64 define
The aarch64 define was incorrect. This was causing the libdl tests to not
work correctly.

Updates #4682
2022-07-29 08:32:47 -05:00
Ryan Long
ad94dc352e sys/exec_elf.h: Bring in newer file
Updated this file with the newer version in NetBSD.

Updates #4682
2022-07-29 08:32:47 -05:00
Sebastian Huber
6a6580331d score: Allow linker garbage collection
Place the object control blocks in dedicated sections to allow a linker garbage
collection.

Update #4678.
2022-07-28 08:21:57 +02:00
Sebastian Huber
8a864bc62c score: Use PTHREAD_CANCELED for _Thread_Cancel()
The rtems_task_delete() directive is basically just a combined pthread_cancel()
and pthread_join().  In addition, it removes the PTHREAD_DETACHED state.  The
exit value returned by pthread_join() of threads cancelled by
rtems_task_delete() should reflect this by getting a PTHREAD_CANCELED value
instead of NULL which could be a normal exit value.

Close #4680.
2022-07-28 07:53:04 +02:00
Sebastian Huber
31036f1dc8 score: Use priority inheritance for thread join
Threads may join the thread termination of another thread using the
pthread_join() or rtems_task_delete() directives.  The thread cancel operation
used a special case priority boosting mechanism implemented by
_Thread_Raise_real_priority().  The problem was that this approach

* is not transitive,

* does not account for priority adjustments of the calling task
  while waiting for the join,

* does not support clustered scheduling, and

* does not detect deadlocks.

All these problems are fixed by using a priority inheritance thread queue for
the join operation.

Close #4679.
2022-07-28 07:52:59 +02:00
Chris Johns
51ffa21011 aarch64/versal: Support DDRMC0 region 0 and 1
- Support DDRMC0 region 0 up to 2G in size

- Support DDRMC0 region 1 with DDR memory greater than 2G
  up to the DDRMC0 max amount

- Extend the heap with region 1's memory

Closes #4684
2022-07-28 09:04:46 +10:00
Chris Johns
b868d0a722 basp/aarch64: Make the unexpected sections origin address 64bit
Update #4684
2022-07-28 09:04:46 +10:00
Sebastian Huber
5810a08b57 Use __asm__ for standard C compatibility 2022-07-27 17:01:14 +02:00
Sebastian Huber
e1fdf975ac psxconfig01: Increase region area
This fixes a test failure on 64-bit systems with RTEMS_DEBUG enabled.
2022-07-27 10:03:54 +02:00
Sebastian Huber
2501c64bb6 score: Fix objects local table initialization
The objects local table must be statically zero-initialized so that
_Objects_Get() and _Objects_Get_no_protection() return NULL if no object is
associated with the identifier.

Update #4678.
2022-07-27 08:59:45 +02:00
Sebastian Huber
4f94d47bc5 build: Move RISCV_MAXIMUM_EXTERNAL_INTERRUPTS 2022-07-26 13:38:33 +02:00
Sebastian Huber
7fe6d60bf0 score: Remove PRIORITY_PSEUDO_ISR thread priority
The uniprocessor schedulers had some special case logic for the
PRIORITY_PSEUDO_ISR priority.  Tasks with a priority of PRIORITY_PSEUDO_ISR
were allowed to preempt a not preemptible task.  If other higher priority task
are made ready while a PRIORITY_PSEUDO_ISR task preempts a not preemptible
task, then the other tasks run before the not preemptible task.  This made the
RTEMS_NO_PREEMPT mode ineffective.

Remove the PRIORITY_PSEUDO_ISR special case logic.  This simplifies the
uniprocessor schedulers.  Move the uniprocessor-specific scheduler support to
the new header file <rtems/score/scheduleruniimpl.h>.

Close #2365.
2022-07-26 11:26:22 +02:00
Sebastian Huber
0a1d2d7814 sptests/spstdc17: New test 2022-07-25 16:11:36 +02:00
Sebastian Huber
8dc651f8fc imfs: Add <rtems/imfsimpl.h> 2022-07-25 16:11:36 +02:00
Alex White
c0a4d56b16 bsps/microblaze: Fix build option definition order
The build option definitions were rearranged such that the option
definitions used in the linker script were not available. This caused
linker errors when building.
2022-07-25 09:01:51 -05:00
Sebastian Huber
e584ee4bde libtest: Add missing initializer 2022-07-25 10:02:18 +02:00
Kinsey Moore
10ef7087f6 aarch64: Use page table level 0
This alters the AArch64 page table generation and mapping code and MMU
configuration to use page table level 0 in addition to levels 1, 2, and
3. This allows the mapping of up to 48 bits of memory space and is the
maximum that can be mapped without relying on additional processor
extensions. Mappings are restricted based on the number of physical
address bits that the CPU supports.
2022-07-21 12:26:35 -05:00
Matt Joyce
6d4b390f99 Support _REENT_THREAD_LOCAL Newlib configuration
In case the Newlib _REENT_THREAD_LOCAL configuration option is enabled, the
struct _reent is not defined (there is only a forward declaration in
<sys/reent.h>).  Instead, the usual members of struct _reent are available as
dedicatd thread-local storage objects.

Update #4560.
2022-07-21 07:22:13 +02:00
Matt Joyce
57a569efe1 sptests: Disable Newlib reentrancy
Update #4560.
2022-07-21 07:22:13 +02:00
Sebastian Huber
ca7c2dd89b sptls04: Test an external TLS object 2022-07-21 07:22:13 +02:00
Sebastian Huber
d4c21e516a ada/sp09: The year 2100 cannot be set
Update #4338.
2022-07-20 09:47:03 +02:00
Sebastian Huber
25ccc19ae9 bsps/riscv: Sort .noinit* sections
Sort the .noinit* input sections by name first, then by alignment if two
sections have the same name.  This allows the placement of begin/end symbols to
initialize some areas with a special value.

Update #4678.
2022-07-20 08:46:13 +02:00
Sebastian Huber
329a1ccf93 build: Add missing cxxflags
Update #4670.
2022-07-20 08:46:13 +02:00
Sebastian Huber
098186b9b3 dtc: Update VERSION 2022-07-19 09:28:22 +02:00
LoveSy
6f79435915 Fix a UB when fdt_get_string return null
When fdt_get_string return null, `namep` is not correctly reset.
From the document of `fdt_getprop_by_offset`, the parameter `namep` will
be always overwritten (that is, it will be overwritten without exception
of error occurance).

As for the caller (like
e097c097fe/native/jni/magiskboot/dtb.cpp (L42)),
the code may be like:
```cpp
size_t size;
const char *name;
auto *value = fdt_getprop_by_offset(fdt, prop, &name, &size);
```
and if `value == nullptr`, `size` is also be overwritten correctly but
`name` is not, which is quite inconsistent.

This commit makes sure `name` and `size` behavior consistently (reset to
reasonable value) when error occurs.

Signed-off-by: LoveSy <shana@zju.edu.cn>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-07-19 09:28:22 +02:00
Sebastian Huber
0e5f4c5d32 spsysinit01: Account for use of .noinit section
The objects control blocks cannot be used to check the pre-initialization state
since they are allocated in a .noinit section.

Update #4678.
2022-07-18 15:52:20 +02:00
Sebastian Huber
12a03bea4f score: Fix unlimited objects support
Commit 21275b58a5 ("score: Static
Objects_Information initialization") introduced an off-by-one error in the
maintenance of inactive objects.

Close #4677.
2022-07-18 09:33:16 +02:00
Sebastian Huber
3bb79aabca spunlimited01: New test
Update #4677.
2022-07-18 09:33:16 +02:00
Sebastian Huber
e0942613f1 score: Fix _Objects_Active_count()
With unlimited objects the object maximum may be larger than the sum of active
and inactive objects.

Update #4677.
2022-07-18 09:33:16 +02:00
Kinsey Moore
1e360d3140 aarch64: Memory map the noinit section
This section was added recently and must be mapped to be accessed
without generating an exception.
2022-07-18 09:33:32 +10:00
Sebastian Huber
1bf878f7ff score: Extend memory dirty/zero actions
Dirty or zero also the part of the .noinit section used by RTEMS.

Close #4678.
2022-07-15 10:46:02 +02:00
Sebastian Huber
4b911a7516 score: Place object controls into .noinit sections
Place the statically allocated object control blocks, local tables, and thread
queue heads into the dedicated .noinit intput sections.  The output section is
not zero initialized.  Placing these elements into the .noinit section reduces
the system initialization time by decreasing the .bss section size.

It may improve the cache efficiency since the mostly read local tables are
placed in a contiguous memory area.

Update #4678.
2022-07-15 10:46:02 +02:00
Sebastian Huber
5ed0035377 bsps: Sort .noinit* sections
Sort the .noinit* input sections by name first, then by alignment if two
sections have the same name.  This allows the placement of begin/end symbols to
initialize some areas with a special value.

Update #4678.
2022-07-15 10:46:02 +02:00
Sebastian Huber
656765c74b cdtest: Restrict exceptions during sysinit
Exceptions during system initialization work only on targets which do not need
a registration of exception frames during the global construction.  In
particular, targets which use the DWARF2 unwinder cannot use exceptions during
system initialization.
2022-07-14 10:47:36 +02:00
Sebastian Huber
da016421cd spextensions01: Fix assertion
Commit 80090639a6 altered the system state
change.  Account for this in assert_allocator_protected_thread_context().
2022-07-14 10:47:36 +02:00
Sebastian Huber
cdc1eb7dcc validation: SMP-specific spurious interrupt test
Update #3716.
2022-07-14 10:46:43 +02:00
Sebastian Huber
013e028f87 sppps01: Fix test in SMP configurations
Update #2349.
2022-07-13 16:06:00 +02:00
Joel Sherrill
405639a67d bsps/v850/gdbv850sim: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:42 -05:00
Joel Sherrill
c1008e9da1 bsps/sparc64/usiii: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:42 -05:00
Joel Sherrill
ae71cf38eb bsps/sparc64/shared: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:42 -05:00
Joel Sherrill
a49acb6bef bsps/sparc64/niagara: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:42 -05:00
Joel Sherrill
749e9b63bd bsps/sparc64/include: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:42 -05:00
Joel Sherrill
f436fc7a18 bsps/sh/shsim: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:42 -05:00
Joel Sherrill
00913bb163 bsps/sh/shared: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:42 -05:00
Joel Sherrill
aacf9e23fb bsps/sh/gensh2: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
0fc7a4499c bsps/sh/gensh1: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
a73615a948 bsps/powerpc/virtex5: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
8a41efe424 bsps/powerpc/virtex4: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
77f1ae05dd bsps/powerpc/virtex: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
22d861ab9a bsps/powerpc/tqm8xx: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
a1fb8b7edb bsps/powerpc/t32mppc: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
9375d24dc8 bsps/powerpc/shared: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
8f4878ae1f bsps/powerpc/qoriq: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
a29b9bb4dd bsps/powerpc/qemuppc: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
5aea703542 bsps/powerpc/psim: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
88cf40e63c bsps/powerpc/mpc8260ads: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
bc374cd7a5 bsps/powerpc/mpc55xxevb: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
5ba0bb2afd bsps/powerpc/include: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
fe8b4b6c79 bsps/powerpc/83xx: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
a965590d64 bsps/powerpc/gen5200: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
d9d2cdff21 bsps/powerpc/beatnik: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
a3571e39fa bsps/no_cpu/no_bsp: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
5ee313155d bsps/nios2/nios2_iss: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
78a63729fa bsps/moxie/moxiesim: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
fdda5dfe41 bsps/mips/rbtx4938: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
01c5b57d39 bsps/mips/rbtx4925: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
36be074d36 bsps/mips/malta: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
d1dcf24924 bsps/mips/jmr3904: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
654ff835bb bsps/mips/include: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
334d90e324 bsps/mips/hurricane: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
5806ba0f56 bsps/mips/csb350: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Joel Sherrill
96a4b8c494 bsps/mips/shared: Change license to BSD-2
Updates #3053.
2022-07-12 08:15:41 -05:00
Sebastian Huber
5cc075712e irq/arm-gicv3.h: Customize CPU Interface init
Use the existing WRITE_SR() abstraction to access the interrupt group 0 and 1
enable registers.  This fixes the build for the AArch32 target.

Add BSP options which define the initial values of CPU Interface registers.
2022-07-12 08:26:46 +02:00
Joel Sherrill
1be68d8093 bsps/m68k/uC5282: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
a9a9916471 bsps/m68k/shared: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
c1137c7f04 bsps/m68k/mvme162: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
c669338a7e bsps/m68k/mvme147s: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
b4c3de78ea bsps/m68k/mvme147: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
35cfe73740 bsps/m68k/mrm332: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
c46ec2b497 bsps/m68k/mcf5329: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
e50bdda22c bsps/m68k/mvf5235: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
eb7b866f51 bsps/m68k/mcf5225x: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
8cc14e5a5e bsps/m68k/mcf52235: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
5382615860 bsps/m68k/mcf5206elite: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
62f31d05e5 bsps/m68k/include: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
810bdeb34a bsps/m68k/genmcf548x: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
cfadeccbfc bsps/m68k/gen68360: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
f888837dd6 bsps/m68k/gen68340: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
bdd4f6dcbc bsps/m68k/csv360: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
cb4fdffe16 m68k/bsps/av5282: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
2b87d7c5d8 bsps/lm32/shared: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
1670bb2ddd bsps/lm32/lm32_evr: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
2c48b89cb0 bsps/lm32/include: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
5e8ec63561 bsps/include: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
c1b1c0fa6c bsps/i386/shared/pci/pci_io.c:Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Joel Sherrill
a52aa5b43f bsps/i386/pc386: Change license to BSD-2
Updates #3053.
2022-07-11 17:14:47 -05:00
Gleb Smirnoff
388dd97e39 Add in_localip_fib(), in6_localip_fib().
Check if given address/FIB exists locally.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D32913
2022-07-11 13:28:10 +02:00
Gleb Smirnoff
94c33ba992 Use network epoch to protect local IPv4 addresses hash.
The modification to the hash are already naturally locked by
in_control_sx.  Convert the hash lists to CK lists. Remove the
in_ifaddr_rmlock. Assert the network epoch where necessary.

Most cases when the hash lookup is done the epoch is already entered.
Cover a few cases, that need entering the epoch, which mostly is
initial configuration of tunnel interfaces and multicast addresses.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D32584
2022-07-11 13:28:10 +02:00
Alexander V. Chernikov
7846249e1a routing: fix source address selection rules for IPv4 over IPv6.
Current logic always selects an IFA of the same family from the
 outgoing interfaces. In IPv4 over IPv6 setup there can be just
 single non-127.0.0.1 ifa, attached to the loopback interface.

Create a separate rt_getifa_family() to handle entire ifa selection
 for the IPv4 over IPv6.

Differential Revision: https://reviews.freebsd.org/D31868
MFC after:	1 week
2022-07-11 13:28:10 +02:00
John Baldwin
070f1b552c Remove copyinfrom() and copyinstrfrom().
These functions were added in 2001 and are currently unused.
copyinfrom() looks to have never been used.  copyinstrfrom() was used
for two weeks before the code was refactored to remove it's sole use.

Reviewed by:	brooks, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24928
2022-07-11 13:28:10 +02:00
Joel Sherrill
00e0fb916e bsps/arm/realview-pbx-a9: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
f6e9e89729 bsps/arm/raspberrypi: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
f3237b3186 bsps/arm/lpc32xx: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
445ddb31ef bsps/arm/lpc24xx: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
d42276615c bsps/arm/imxrt: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
c519d4589b bsps/arm/lpc176x: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
03cb6e819c bsps/arm/include: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
df50266c6a bsps/arm/imx: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
6505459565 bsps/arm/csb337: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
b1cc3dd07e bsps/arm/beagle: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
6fc04f4cfd bsps/arm/atsamv: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
9e0244e95f bsps/arm/altera-cyclone-v: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
8ca4b5c8bb bsps/arm/shared: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Sebastian Huber
e506df58ec validation: Test thread idle bodies
Update #3716.
2022-07-07 09:00:48 +02:00
Sebastian Huber
588a07e1a8 validation: Always test spurious interrupts
Update #3716.
2022-07-07 09:00:46 +02:00
Sebastian Huber
c75e03367a validation: Test thread free of FPU owner
Update #3716.
2022-07-07 09:00:44 +02:00
Sebastian Huber
af90f783f0 validation: Test scheduler detail
This particular state during a reconsider help request scheduler operation was
only covered by the existing test suites under some timing conditions.

Update #3716.
2022-07-07 09:00:29 +02:00
Sebastian Huber
e7d01e7803 rtems: Simplify rtems_scheduler_ident()
Use early returns to simplify rtems_scheduler_ident().
2022-07-07 08:48:26 +02:00
Sebastian Huber
80090639a6 score: Use RTEMS_SMP in _Thread_Create_idle()
Conditional expressions with inline functions are not optimized away if
optimization is disabled.  Avoid such expressions to prevent dead
branches.
2022-07-07 08:48:26 +02:00
Sebastian Huber
6e74cebb62 score: Conditional _Thread_Priority_replace()
This function is only used in SMP configurations.
2022-07-07 08:46:48 +02:00
Kinsey Moore
2f6ee01e9e bsps/aarch64: Use MMU pages appropriately
There were two bugs with MMU page use that were partially hiding each
other. The linker script page table section was 4x the size it needed to
be and the page table allocation routine was allocating pages PTRSIZE
times larger than it needed to. On ILP32, this resulted in incorrect but
functional allocation. On LP64, this resulted in allocation failures
earlier than expected.
2022-07-06 10:22:08 -05:00
Kinsey Moore
22015c0251 cpukit/aarch64: Remove _CPU_ISR_install_vector
This function was never actually used and is dead code.
2022-07-05 15:35:56 -05:00
Gabriel Moyano
eefaf0687c sppps01: Add test case for early returns of pps_event()
Update #2349.
2022-07-05 15:17:15 +02:00
Sebastian Huber
03e4d1e931 score: Add _CPU_Use_thread_local_storage()
At some point during system initialization, the idle threads are created.
Afterwards, the boot processor basically executes within the context of an idle
thread with thread dispatching disabled.  On some architectures, the
thread-local storage area of the associated thread must be set in dedicated
processor registers.  Add the new CPU port function to do this:

void _CPU_Use_thread_local_storage( const Context_Control *context )

Close #4672.
2022-07-04 08:30:42 +02:00
Sebastian Huber
9dd4bd3963 libtests/crypt01: Avoid stack overflows
The SHA512 functions may use huge amounts of stack space if compiled without
optimization.
2022-07-04 08:30:42 +02:00
Sebastian Huber
da8b234261 samples/minimum: Prevent a stack overflow
Prevent a stack overflow if RTEMS_COVERAGE is enabled.
2022-07-04 08:30:40 +02:00
Sebastian Huber
5c13a96f36 build: Add RTEMS_GCOV_COVERAGE option
Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
7452f67dd9 gcov: Add wrapper to dump the gcov info
Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
4f87edbb75 gcov: Add functions to dump the gcov information
Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
2bc233fe58 gcov: Add fork(), etc. gcov wrappers
The compiler wraps fork(), etc. system calls if coverage generation is enabled.
These functions must be provided by the system.  For RTEMS, they just return an
error status.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
a13047ca0e build: Allow separate optimization flags
Allow separate optimization flags for the BSP, cpukit, and tests.  For example,
the BSP and cpukit may be built without optimization if coverage
instrumentation is enabled, however, the tests may still use optimization.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
a0aaa394b6 build: Fix optimization flags definition order
OPTIMIZATION_FLAGS must be defined before /build/bsp/bspopts is processed.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
42da08dd9d build: Add cppflags, cflags, cxxflags to groups
Propagate the group defined cppflags, cflags, and cxxflags from parent groups
to child items through the build item context.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
0bb7b84698 build: Improve value substitution
The waf build system uses lists for tool flags.  The build items may use
variable substitution.  Add the ability to use the variable substitution in
lists.  For example:

MORE_FLAGS = ['-more', '-flags']

flags:
- -some-flag
- ${MORE_FLAGS}

Before this change, the ${MORE_FLAGS} was substituted to "-more -flags".  This
would be passed by waf as a single command line argument to the tool.

After this change, the ${MORE_FLAGS} list extends the flags list:

flags = ['-some-flag', '-more', '-flags']

This list extension is performed if a list element consists of exactly one
variable.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
4aeebaee5b build: Fix identifier pattern
Allow upper case characters in identifiers.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
281f39a600 build: Move BSP_INCLUDES split
The goal is to let the build items define as much as possible.
2022-07-04 08:29:52 +02:00
Sebastian Huber
857fb17db1 build: Add more flags to BuildItemContext
Add cppflags, cflags, and cxxflags to BuildItemContext.  This allows to
propagate the flags from parent items to child items.

Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
d07d6498c6 samples/cdtest: Test exceptions during system init
Update #4668.
Update #4672.
2022-07-04 08:09:48 +02:00
Sebastian Huber
c15842d99d bsps/xilinx-zynq: Init debug console only once
Initialize the debug console only once during early system initialization.
2022-07-01 06:50:16 +02:00
Sebastian Huber
00f39770ca bsp/lpc32xx: Optimize Ethernet transmit
The updated Ethernet interface driver in libbsd profits from more
transmit descriptors since it no longer uses transmit done interrupts.
2022-06-27 09:25:10 +02:00
Sebastian Huber
050eaa92ef bsp/stm32h7: Exclude some tests 2022-06-24 13:19:57 +02:00
Sebastian Huber
fea5ed5e7d bsp/rtl22xx: Exclude exit03 2022-06-24 13:15:00 +02:00
Sebastian Huber
58b31af20b tstsmallmem: Exclude exit03 and tftpfs 2022-06-24 13:15:00 +02:00
Sebastian Huber
39c09b3b3d riscv: Include missing header file 2022-06-24 13:15:00 +02:00
Sebastian Huber
ba56e23999 score: Account for <sys/bitset.h> API changes
Update #4667.
2022-06-23 10:29:31 +02:00
Sebastian Huber
a76988c881 score: Remove unused _Processor_mask_Nand()
Update #4667.
2022-06-23 10:29:31 +02:00
Sebastian Huber
89e910f1aa spcpuset01: Account for <sys/cpuset.h> API changes
Update #4667.
2022-06-23 10:29:19 +02:00
Sebastian Huber
5dffbc424e score: Make SMP only code explicit
Conditional expressions with inline functions are not optimized away if
optimization is disabled.  Avoid such expressions to prevent dead
branches.  It helps also during code review to immediately see if a loop
is used or not.
2022-06-23 10:28:49 +02:00
Sebastian Huber
94df3a7a6d kern_tc.c: Provide a weak hardpps() implementation
The real implementation of hardpps() is defined in kern_ntptime.c.  Use it only
if the NTP support is needed by the application.

Update #2349.
2022-06-23 09:47:48 +02:00
Sebastian Huber
cd50bea678 score: Use right clock for threadq timeouts
Use CLOCK_REALTIME and CLOCK_MONOTONIC for relative thread queue timeouts
instead of CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE.  This fixes an
issue with clock_nanosleep() in combination with clock_gettime().

Close #4669.
2022-06-23 09:20:11 +02:00
Sebastian Huber
085f3637aa TFTPFS: Fix test configuration for FP targets
The test uses snprintf().

Update #4666.
2022-06-21 16:11:37 +02:00
Sebastian Huber
e38d4f79fa TFTPFS: Reduce test configuration
Update #4666.
2022-06-21 16:11:37 +02:00
Frank Kühndel
3e2b4ec857 TFTPFS: Add tests
Update #4666.
2022-06-21 09:32:16 +02:00
Frank Kühndel
679e7f109a TFTPFS: Implement block and window size options
The original file cpukit/libfs/src/ftpfs/tftpDriver.c
is split into two:

tftpfs.c     - This file contains the code from tftpDriver.c
               related to file system operations such as mount(),
               open(), read(), and so on.

tftpDriver.c - In the original file remains only the code related
               to networking.  This code implements the Trivial
               File Transfer Protocol (TFTP).

Moreover, the code is extended to support

  * RFC 2347 TFTP Option Extension
  * RFC 2348 TFTP Blocksize Option
  * RFC 7440 TFTP Windowsize Option

Update #4666.
2022-06-21 09:32:11 +02:00
Frank Kühndel
c044f0502a TFTPFS: Cleanup: Remove spaces at lines ends
Update #4666.
2022-06-21 09:32:04 +02:00
Chris Johns
6b2c5b5da1 testsuite: Fix gcc 12 warnings 2022-06-21 10:21:13 +10:00
Sebastian Huber
775314d57f jffs2: Update baseline version to Linux v5.9 2022-06-20 13:25:32 +02:00
Gustavo A. R. Silva
413a00db20 treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2022-06-20 13:25:32 +02:00
Zhe Li
998ec9f545 jffs2: fix jffs2 mounting failure
Thanks for the advice mentioned in the email.
This is my v3 patch for this problem.

Mounting jffs2 on nand flash will get message "failed: I/O error"
with the steps listed below.
1.umount jffs2
2.erase nand flash
3.mount jffs2 on it (this mounting operation will be successful)
4.do chown or chmod to the mount point directory
5.umount jffs2
6.mount jffs2 on nand flash
After step 6, we will get message "mount ... failed: I/O error".

Typical image of this problem is like:
Empty space found from 0x00000000 to 0x008a0000
Inode node at xx, totlen 0x00000044, #ino 1, version 1, isize 0...

The reason for this mounting failure is that at the end of function
jffs2_scan_medium(), jffs2 will check the used_size and some info
of nr_blocks.If conditions are met, it will return -EIO.

The detail is that, in the steps listed above, step 4 will write
jffs2_raw_inode into flash without jffs2_raw_dirent, which will
cause that there are some jffs2_raw_inode but no jffs2_raw_dirent
on flash. This will meet the condition at the end of function
jffs2_scan_medium() and return -EIO if we umount jffs2 and mount it
again.

We notice that jffs2 add the value of c->unchecked_size if we find
an inode node while mounting. And jffs2 will never add the value of
c->unchecked_size in other situations. So this patch add one more
condition about c->unchecked_size of the judgement to fix this problem.

Signed-off-by: Zhe Li <lizhe67@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2022-06-20 13:25:32 +02:00
Kees Cook
e839daff5b treewide: Remove uninitialized_var() usage
Using uninitialized_var() is dangerous as it papers over real bugs[1]
(or can in the future), and suppresses unrelated compiler warnings
(e.g. "unused variable"). If the compiler thinks it is uninitialized,
either simply initialize the variable or make compiler changes.

In preparation for removing[2] the[3] macro[4], remove all remaining
needless uses with the following script:

git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \
	xargs perl -pi -e \
		's/\buninitialized_var\(([^\)]+)\)/\1/g;
		 s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;'

drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid
pathological white-space.

No outstanding warnings were found building allmodconfig with GCC 9.3.0
for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64,
alpha, and m68k.

[1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/
[2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
[3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
[4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/

Reviewed-by: Leon Romanovsky <leonro@mellanox.com> # drivers/infiniband and mlx4/mlx5
Acked-by: Jason Gunthorpe <jgg@mellanox.com> # IB
Acked-by: Kalle Valo <kvalo@codeaurora.org> # wireless drivers
Reviewed-by: Chao Yu <yuchao0@huawei.com> # erofs
Signed-off-by: Kees Cook <keescook@chromium.org>
2022-06-20 13:25:32 +02:00
Gustavo A. R. Silva
109815a82e jffs2: Replace zero-length array with flexible-array
There is a regular need in the kernel to provide a way to declare having a
dynamically sized set of trailing elements in a structure. Kernel code should
always use “flexible array members”[1] for these cases. The older style of
one-element or zero-length arrays should no longer be used[2].

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://github.com/KSPP/linux/issues/21

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2022-06-20 13:25:32 +02:00
Joel Stanley
44cd706c96 Revert "jffs2: Fix possible null-pointer dereferences in jffs2_add_frag_to_fragtree()"
This reverts commit f2538f999345405f7d2e1194c0c8efa4e11f7b3a. The patch
stopped JFFS2 from being able to mount an existing filesystem with the
following errors:

 jffs2: error: (77) jffs2_build_inode_fragtree: Add node to tree failed -22
 jffs2: error: (77) jffs2_do_read_inode_internal: Failed to build final fragtree for inode #5377: error -22

Fixes: f2538f999345 ("jffs2: Fix possible null-pointer dereferences...")
Cc: stable@vger.kernel.org
Suggested-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Richard Weinberger <richard@nod.at>
2022-06-20 13:25:32 +02:00
Wenwen Wang
e1a5720264 jffs2: Fix memory leak in jffs2_scan_eraseblock() error path
In jffs2_scan_eraseblock(), 'sumptr' is allocated through kmalloc() if
'sumlen' is larger than 'buf_size'. However, it is not deallocated in the
following execution if jffs2_fill_scan_buf() fails, leading to a memory
leak bug. To fix this issue, free 'sumptr' before returning the error.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: Richard Weinberger <richard@nod.at>
2022-06-20 13:25:32 +02:00
Christoph Hellwig
cdac3ca64a jffs2: Remove jffs2_gc_fetch_page and jffs2_gc_release_page
Merge these two helpers into the only callers to get rid of some
amazingly bad calling conventions.

Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
2022-06-20 13:25:32 +02:00
Jia-Ju Bai
9d9bfe5948 jffs2: Fix possible null-pointer dereferences in jffs2_add_frag_to_fragtree()
In jffs2_add_frag_to_fragtree(), there is an if statement on line 223 to
check whether "this" is NULL:
    if (this)

When "this" is NULL, it is used at several places, such as on line 249:
    if (this->node)
and on line 260:
    if (newfrag->ofs > this->ofs)

Thus possible null-pointer dereferences may occur.

To fix these bugs, -EINVAL is returned when "this" is NULL.

These bugs are found by a static analysis tool STCheck written by us.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2022-06-20 13:25:32 +02:00
Masahiro Yamada
b33c3d4b67 jffs2: Remove C++ style comments from uapi header
Linux kernel tolerates C++ style comments these days. Actually, the
SPDX License tags for .c files start with //.

On the other hand, uapi headers are written in more strict C, where
the C++ comment style is forbidden.

I simply dropped these lines instead of fixing the comment style.

This code has been always commented out since it was added around
Linux 2.4.9 (i.e. commented out for more than 17 years).

'Maybe later...' will never happen.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
2022-06-20 13:25:32 +02:00
Al Viro
22e83b00f5 jffs2: fix use-after-free on symlink traversal
free the symlink body after the same RCU delay we have for freeing the
struct inode itself, so that traversal during RCU pathwalk wouldn't step
into freed memory.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2022-06-20 13:25:32 +02:00
Matthew Wilcox
55529cf3d0 Convert jffs2 acl to struct_size
Need to tell the compiler that the acl entries follow the acl header.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
2022-06-20 13:25:32 +02:00
Sebastian Huber
f44ecd0ea9 jffs2: Use RTEMS_CONTAINER_OF 2022-06-20 13:25:32 +02:00
Chris Johns
e70384d3f4 aarch64/gicv3: Remove accesses to secure registers
RTEMS runs at EL1 and the removed register accesses are for
EL3 or the TF-A. This change aligns our driver with the Linux
and FreeBSD ones.
2022-06-16 10:21:46 +10:00
Chris Johns
4f6c90f40d bsps/versal: Support a 64bit RAM base
Set the constraint to be 64bits to allow the complete address range.
2022-06-16 10:21:46 +10:00
Chris Johns
bfc99a6e70 bsp/aarch64: Flush the cache before invalidating it
- Any page tables need to be flushed if the cache is enabled.
  Disabling the cache may only be available in secure mode.
2022-06-16 10:21:46 +10:00
Joel Sherrill
d6ebf4067e bsps/shared/*: Change license to BSD-2
Updates #3053.
2022-06-15 12:35:18 -05:00
Chris Johns
cb52e37464 bsps/arm: MP core timer setting off by one 2022-06-15 13:15:15 +10:00
Chris Johns
acc32a8e5c cpukit: Fixes for GCC 12 warnings
Updates #6442
2022-06-15 13:01:03 +10:00
Chris Johns
0cf0914efe cpukit: Change _COMPILING_NEWLIB to _LIBC for helper functions decls
Updates #4662
2022-06-15 13:00:48 +10:00
Chris Johns
5262b9c2ab score/cpu: Silence ARM and AARCH64 GCC 12 false trigger array warning
The false trigger is covered in:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578

GCC 11 and 12 has been patched for constant pointer casts above
4K. This code casts a constant pointer within the first 4K
page. As a result the patch disables the warning.

Updates #4662
2022-06-15 12:57:28 +10:00
Joel Sherrill
1f23640a9b sptests/spglobalcon01/init.cc: Change license to BSD-2
Updates #3053.
2022-06-14 10:31:39 -05:00
Joel Sherrill
3a22252782 samples/iostream/init.cc: Change license to BSD-2
Updates #3053.
2022-06-14 10:31:39 -05:00
Joel Sherrill
59a79edb95 sptests/*/*.doc: Change license to BSD-2
Updates #3053.
2022-06-14 10:31:39 -05:00
Joel Sherrill
7c6ff958e9 mptests/*/*.doc: Change license to BSD-2
Updates #3053.
2022-06-14 10:31:39 -05:00
Joel Sherrill
031f8fbcdc smptests/*/*.doc: Change license to BSD-2
Updates #3053.
2022-06-14 10:31:39 -05:00
Joel Sherrill
dcbba7c0e6 psxtmtests/*/*.doc: Change license to BSD-2
Updates #3053.
2022-06-14 10:31:39 -05:00
Joel Sherrill
731607b3b3 samples/*/*.doc: Change license to BSD-2
Updates #3053.
2022-06-14 10:31:39 -05:00
Joel Sherrill
f98b739119 smptests/*/*.py: Change license to BSD-2
Manually adjusted location of SPDX annotation so #! remains first line.

Updates #3053.
2022-06-14 10:31:39 -05:00
Christian Mauderer
b60d8327ac bsps/atsam: Fix type of options (part 2)
The patch "bsps/atsam: Fix type of options" missed to adapt some parts
of the yml. With that a custom value works well. But if no value is set,
configure doesn't fall back to the default value but instead just causes
an error. This patch fixes that.
2022-06-14 08:14:39 +02:00
Chris Johns
66dc06efce bsp/aarch64: Fix array warning
Updates #4664
2022-06-11 12:08:49 +10:00
Karel Gardas
ae2367c505 bsps/stm32h7: remove external memory initialization from nucleo-h743zi BSP
Nucleo board does not provide any external memory so code does not have
any function here anyway.

Sponsored-By:	Precidata
2022-06-10 11:17:17 +02:00
Karel Gardas
e5e1c00491 bsps/stm32h7: move BSP start hooks into boards subdirectories
The idea here is to prepare for better per-board specialization
of the hooks function code.

Sponsored-By:	Precidata
2022-06-10 11:17:17 +02:00
Karel Gardas
d7f3918d13 bsps/arm: fix installation of core_cm4.h 2022-06-10 11:15:08 +02:00
Gabriel Moyano
11621c9c52 kern_tc.c: Update pps_event() for uniprocessor configurations
Since pps->capgen equal to zero is not a special value in uniprocessor configurations, there is no need to check for this condition.

Update #2349
2022-06-10 11:12:03 +02:00
Christian Mauderer
7ba1503661 bsps/imx: Enable clock of ETH2 2022-06-09 09:04:40 +02:00
Matt Joyce
4152157e10 Newlib01: Add tests for rand() and lrand48()
Check that the state of rand() and lrand48() is thread-specific,
that they are properly initialized, and return the expected
sequence of pseudo-random numbers for default seed values.
2022-06-09 08:10:19 +02:00
Chris Johns
80aea6aee1 testsuite/libtests: Add exit03 to test exit() with C++
Updates #4661
2022-06-09 11:41:21 +10:00
Sebastian Huber
75af80a682 arm/lpc32xx: Implement new interrupt directives 2022-06-08 10:25:41 +02:00
Sebastian Huber
8d6190129a bsp/lpc32xx: bsp_interrupt_vector_enable()
The interrupt enables are used to implement a priority scheme in
bsp_interrupt_dispatch().  Enable interrupts through
bsp_interrupt_vector_enable() only if they are not already enabled to
not interfere with the priority scheme while
bsp_interrupt_vector_enable() is called during interrupt dispatching.
2022-06-08 10:25:41 +02:00
Sebastian Huber
4d0d7d5413 bsp/lpc32xx: bsp_interrupt_is_valid_vector()
Provide custom bsp_interrupt_is_valid_vector() implementation since
several interrupt vectors are reserved.
2022-06-08 10:25:41 +02:00
Sebastian Huber
88a53ca682 bsp/lpc32xx: Use standard timer 2 for tm27.h
This helps to run the validation tests of the Interrupt Manager
directives.
2022-06-08 10:25:37 +02:00
Sebastian Huber
5dc5ab5650 arm/lpc32xx: Hide MLC details 2022-06-08 09:33:20 +02:00
Sebastian Huber
bb29f8b5ff bsp/lpc32xx: Fix FIQ interrupt support
Do not sporadically service interrupts configured as FIQ by the IRQ
interrupt dispatch.
2022-06-08 09:33:20 +02:00
Sebastian Huber
9a69e43083 validation: Fix CallWithinISR()
Some BSPs require that Clear_tm27_intr() is called in the interrupt
service routine.

Update #3269.
2022-06-08 09:33:20 +02:00
Sebastian Huber
c93f0f01e5 arm: Fix PMSA regions for contiguous sections
Sections with identical attributes may be contiguous with a respective
begin and end address which is not on a minimum region boundary.  The
begin address is aligned down to the region base address.  The end
address is aligned up to the region end address.  Account for this in
the check for contiguous sections.

Update #4202.
2022-06-08 09:10:20 +02:00
Sebastian Huber
0b9497a6dd arm: Fix PMSA region mapping with 0x0 end address
A section may span up to the end of the address range.  In this case the
end address is zero.  Use the base address to check if a region should
be before another region.

Update #4202.
2022-06-08 09:10:12 +02:00
Sebastian Huber
ed51fad53a build: Assert value properties only if not None 2022-06-08 09:08:26 +02:00
Christian Mauderer
8beb1d2fb0 bsps/atsam: Fix type of options
ATSAM_CONSOLE_DEVICE_INDEX and ATSAM_CONSOLE_DEVICE_TYPE have to be
integers like suggested by their description. Otherwise it's not
possible to select (for example) USART2 as console device.
2022-06-07 08:31:26 +02:00
Sebastian Huber
a26b9936ff arm: Fix typo 2022-06-03 08:37:14 +02:00
Karel Gardas
c3ad1e3c27 bsps/stm32h7: set SDRAM 1 size to 0 by default on nucleo-h743zi BSP
Nucleo does not have any SDRAM, so 0 size is the only possible right
choice here.

Sponsored-By:	Precidata
2022-06-02 10:44:30 +02:00
Karel Gardas
925bcdb8e8 bsps/stm32h7: set default linkage to flash for nucleo-h743zi BSP
Nucleo does not have any SDRAM so default linkage to SDRAM does not make
any sense here.

Sponsored-By:	Precidata
2022-06-02 10:44:30 +02:00
Karel Gardas
5a1f87a071 bsps/stm32h7: set default printk instance on nucleo-h743zi BSP to USART3
This is the default configuration of the board out of the box.
Any other possible/supported configuration requires soldering,
so definitely not out of the box experience.

Sponsored-By:	Precidata
2022-06-02 10:44:30 +02:00
Karel Gardas
f2cf15b82a bsps/stm32h7: add stm32h747i-disco-m4 BSP variant
This patch adds stm32h747i-disco-m4 BSP variant and puts it in sync
with the stm32h747i-disco BSP variant hardware support. That means,
only USART 1, 2 and UART 8 are enabled. Also SDRAM 2 is set to 32MB,
SDRAM 1 size is set to 0.

Sponsored-By:	Precidata
2022-06-02 10:44:30 +02:00
Karel Gardas
8604b46ab6 bsps/stm32h7: set default SDRAM x sizes on stm32h747i-disco BSP
This means:

SDRAM 1: 0
SDRAM 2: 32 MB

Sponsored-By:	Precidata
2022-06-01 15:49:19 +02:00
Karel Gardas
587ce75111 bsps/stm32h7: disable all unsupported U(S)ARTs on stm32h747i-disco BSP
This patch disables all U(S)ARTs which are not supported by the board
itself and its provided connectors. That means only USART1 and 2
and UART8 are enabled.

Sponsored-By:	Precidata
2022-06-01 15:49:19 +02:00
Karel Gardas
8abb339640 bsps/stm32h7: add configuration and enable build of stm32h747i-disco BSP
Sponsored-By:	Precidata
2022-06-01 15:49:19 +02:00
Karel Gardas
a5bde172fe bsps/stm32h7: add board C files for stm32h747i-disco BSP
Besides C files for the BSP variant the patch also provides license
clarification on system_stm32h7xx.c file which is provided
in boards/stm/stm32h747i-disco directory.
The files comes from STM32CubeH7 project and references "root directory"
in its license comment and it's not clear where this points out.
Let's add clarification comment about it and also based on it
and resulting license let's add SPDX license identifier.

Sponsored-By:	Precidata
2022-06-01 15:49:19 +02:00
Karel Gardas
04fd4ef2b6 bsps/stm32h7: set default SDRAM x sizes on stm32h757i-eval-m4 BSP
This means:

SDRAM 1: 0
SDRAM 2: 32 MB

Sponsored-By:   Precidata
2022-06-01 11:20:59 +02:00
Karel Gardas
30b2ad318b bsps/stm32h7: disable all U(S)ARTs except USART1 on stm32h757i-eval-m4 BSP
This patch disables all U(S)ARTs which are not supported by the board
itself and its provided connectors.

Sponsored-By:   Precidata
2022-06-01 11:20:59 +02:00
Karel Gardas
250254ff8f bsps/stm32h7: add configuration and enable build of stm32h757i-eval-m4 BSP
This is minimalist configuration for the stm32h757i-eval-m4 BSP provided
here. The only general enhancement worth mention is a flash origin address
configuration which is needed for simplification as M4 core boots
from second flash bank which starts at 0x8100000 by default. The boot
address of the core may be changed by using STM32CubeProgrammer. If done
so then also BSP configuration needs to be changed accordingly.

As the BSP variant is running on M4 core, there is also more configuration
changes required here. E.g. boot core and ABI (compilation flags)
in comparison with stm32h757i-eval BSP. On the other hand, C code is shared
completely with this BSP variant.

Sponsored-By:   Precidata
2022-06-01 11:20:59 +02:00
Karel Gardas
7cb73a34d4 bsps/stm32h7: include CMSIS Cortex-M4 header when required by configuration
Sponsored-By:	Precidata
2022-06-01 11:20:59 +02:00
Karel Gardas
bdfc8d8f4d bsps/stm32h7: move cache implementation from obj to BSPs own yml file
This is done in preparation for future Cortex-M4 based BSP variants
which do not provide cache at all.

Sponsored-By:	Precidata
2022-06-01 11:20:59 +02:00
Karel Gardas
ec39a69529 bsps/stm32h7: enable cache and MPU only on Cortex-M7
Sponsored-By:	Precidata
2022-06-01 11:20:49 +02:00
Karel Gardas
ed814cd8bc bsps/arm: add CMSIS Cortex-M4 Core Peripheral Access Layer Header File 2022-05-30 01:34:24 +02:00
Karel Gardas
186c891182 bsps/stm32h7: set default SDRAM x sizes on stm32h757i-eval BSP
This means:

SDRAM 1: 0
SDRAM 2: 32 MB

Sponsored-By:	Precidata
2022-05-27 20:17:32 +02:00
Karel Gardas
99f00b12dd bsps/stm32h7: enable SDRAM 2 MPU region
Sponsored-By:	Precidata
2022-05-27 20:17:32 +02:00
Karel Gardas
42ed4a6338 bsps/stm32h7: provide linkcmds for SRAM, FLASH_SDRAM and SRAM_SDRAM linking
Sponsored-By:	Precidata
2022-05-27 20:17:32 +02:00
Karel Gardas
3aab95f3a7 bsps/stm32h7: add and enable test set exclusion for stm32h757i-eval BSP
Sponsored-By:	Precidata
2022-05-27 20:17:32 +02:00
Karel Gardas
1ea6540c62 bsps/stm32h7: disable all U(S)ARTs except USART1 on stm32h757i-eval BSP
This patch disables all U(S)ARTs which are not supported by the board
itself and its provided connectors.

Sponsored-By:	Precidata
2022-05-27 20:17:32 +02:00
Karel Gardas
124912445c bsps/stm32h7: add configuration and enable build of stm32h757i-eval BSP
This is minimalist configuration for the stm32h757i-eval BSP provided
here. The only general enhancement worth mention is boot core
configuration which is needed here as this is the first dual-core board
supported by stm32h7 BSP family and we need to choose boot core in order
to get C files compiling well.

Sponsored-By:	Precidata
2022-05-27 20:17:32 +02:00
Karel Gardas
2fded8138d bsps/stm32h7: add board C files for stm32h757i-eval BSP
Besides C files for the BSP variant the patch also provides license
clarification on system_stm32h7xx.c file which is provided
in boards/stm/stm32h757i-eval directory.
The files comes from STM32CubeH7 project and references "root directory"
in its license comment and it's not clear where this points out.
Let's add clarification comment about it and also based on it
and resulting license let's add SPDX license identifier.

Sponsored-By:	Precidata
2022-05-27 20:17:32 +02:00
Gabriel Moyano
34ba0e5a8e sppps01: Improve default handler test
Update #2349.
2022-05-27 13:42:56 +02:00
Sebastian Huber
044e8b6b97 score: Fix pps_fetch()
Return early only if there was a timeout, otherwise return the PPS info.

Update #2349.
2022-05-27 11:30:51 +02:00
Karel Gardas
f91f30f69a MAINTAINERS: Add myself to Write After Approval
Add myself also to Localized Write Permission for x86_64.
2022-05-26 20:40:34 +02:00
Sebastian Huber
495f8363de score: Reformat for code coverage
Close #2349.
2022-05-23 09:09:08 +02:00
Gabriel Moyano
6553bf4ab6 testsuites/sptests: Add sppps01 test
Update #2349.
2022-05-23 09:09:06 +02:00
Gabriel Moyano
5ccf9605dd timecounter.h: Add _Timecounter_Discipline()
Update #2349.
2022-05-23 09:09:03 +02:00
Gabriel Moyano
b3e4f5809d timepps.h: PPS_SYNC defined by default
Update #2349.
2022-05-23 09:09:01 +02:00
Gabriel Moyano
b304603b62 kern_ntptime.c: Add define in order to remove warning
Update #2349.
2022-05-23 09:08:59 +02:00
Gabriel Moyano
13513b8104 kern_tc.c: Enable PPS API support
Update #2349.
2022-05-23 09:08:57 +02:00
Gabriel Moyano
c34d3aecb1 kern_tc.c: Add definitions required by PPS API
Update #2349.
2022-05-23 09:08:55 +02:00
Gabriel Moyano
ac4ea53664 score: Rename tc_getfrequency()
Rename tc_getfrequency() to _Timecounter_Get_frequency().

Update #2349.
2022-05-23 09:08:52 +02:00
Gabriel Moyano
95c747d9e7 kern_tc.c: Replace FreeBSD event mechanism by adding pointers to function
Update #2349.
2022-05-23 09:08:50 +02:00
Gabriel Moyano
bf61753a92 kern_tc.c: Add atomic dependencies required by the PPS API
Update #2349.
2022-05-23 09:08:48 +02:00
Gabriel Moyano
a3930e8c49 kern_ntptime.c: Add lmax() qmin() definitions
Update #2349.
2022-05-23 09:08:46 +02:00
Gabriel Moyano
9b4212c7b0 kern_ntptime.c: Disable freebsd features
Update #2349.
2022-05-23 09:08:29 +02:00
Karel Gardas
635cd68aa7 bsp/arm: allocate .rtemsstack on REGION_STACK instead of on REGION_WORK
REGION_WORK may be backed by external RAM which may not be initialized
in a time we need stack to work well. E.g. code loaded in flash,
stack allocated on in-cpu SRAM and data (REGION_WORK) on external SDRAM.

Sponsored-By:	Precidata
2022-05-23 08:36:41 +02:00
Sebastian Huber
89c498ccda score: Add SPDX License Identifier
Remove URL in copyright notice.

Update #3053.
2022-05-18 11:34:53 +02:00
Sebastian Huber
93800e09d7 rtems: Relicense rtemsmaxprio.c
Change license to BSD-2-Clause according to file history.

Update #3053.
2022-05-18 11:34:50 +02:00
Sebastian Huber
6476cdc67c bsps: Relicense <bsp/fatal.h>
Add Doxygen documentation.  Change license to BSD-2-Clause according
to file history.

Update #3053.
2022-05-18 11:34:45 +02:00
Sebastian Huber
be580201dd bsps: Relicense <bsp/default-initial-extension.h>
Replace Doxygen documentation.  Change license to BSD-2-Clause according
to file history.

Update #3053.
2022-05-18 11:34:38 +02:00
Sebastian Huber
f49ef6b6cb Add file descriptions to kernel space headers 2022-05-18 10:01:29 +02:00
Sebastian Huber
b9926483b1 Fix copyright notice of kernel space headers
Use the copyright notice of the associated header file from FreeBSD if the
kernel space header file contains a substantial amount of imported code.
2022-05-18 10:01:29 +02:00
Sebastian Huber
81962136cc Add include guard checks to kernel space headers 2022-05-18 10:01:29 +02:00
Sebastian Huber
3ccfb58311 Synchronize all file descriptors in sync()
Synchronize all file descriptors and not just the ones associated with a FILE
object.

Close #4656.
2022-05-17 15:20:37 +02:00
Karel Gardas
135d5274bd bsp/stm32h7: remove system files from start directory
The files are already presented in boards directories and are not needed
in start directory anymore.

Sponsored-By:	Precidata
2022-05-16 10:23:27 +02:00
Karel Gardas
31f756b07c bsp/stm32h7: copy system files to nucleo-h743zi board directory
Also adjust BSP spec file to make it buildable with board files.

Sponsored-By:	Precidata
2022-05-16 10:23:27 +02:00
Karel Gardas
f8a9a47de1 bsp/stm32h7: copy system files to stm32h743i-eval board directory
Also adjust BSP spec file to make it buildable with board files.

Sponsored-By:	Precidata
2022-05-16 10:23:27 +02:00
Karel Gardas
6b051182a9 bsp/stm32h7: remove stm32h7b3i-dk related changes from start system files
Sponsored-By:	Precidata
2022-05-16 10:23:27 +02:00
Karel Gardas
d8017f203e bsp/stm32h7: update stm32h7b3i-dk board system_stm32h7xx.c file
Updated content comes from STM32CubeIDE 1.9.0 generated for STM32H7B3I-DK
board and have RTEMS related changes merged in.

Sponsored-By:	Precidata
2022-05-16 10:23:27 +02:00
Karel Gardas
63e327f9fb bsp/stm32h7: cleanup osc, clk, per files for stm32h7b3i-dk board
Sponsored-By:	Precidata
2022-05-16 10:23:27 +02:00
Karel Gardas
7234516cc5 bsp/stm32h7: copy system files to stm32h7b3i-dk board directory
Also adjust BSP spec file to make it buildable with board files.

Sponsored-By:	Precidata
2022-05-16 10:23:27 +02:00
Karel Gardas
836eeb686b bsp/stm32h7: move compilation of system files to BSPs spec. files
The patch is done in preparation for stm32h7 BSP tree refactoring.

Sponsored-By:	Precidata
2022-05-16 10:23:27 +02:00
Sebastian Huber
5a165982ec score: Fix SMP priority affinity scheduler yield 2022-05-13 13:16:57 +02:00
Tian Ye
901bc146b0 score: Add SMP priority affinity scheduler yield 2022-05-12 09:02:26 +02:00
Sebastian Huber
4e449f49ac build: Check for psxtests prerequisites
Close #4645.
2022-05-05 08:18:29 +02:00
Ryan Long
3afdf65634 error.c: Add file header and license
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:07 -05:00
Ryan Long
86a6aca9d7 ftpd.c: Add file header and license
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:07 -05:00
Ryan Long
6b32f5ed70 rtems-rfs-dir-hash.c: Add file headers and licenses
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:07 -05:00
Ryan Long
cee6e7f616 telnetd/des.h: Add file header and license
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:07 -05:00
Ryan Long
37bcb0e19f __getpid: Add file headers and licenses
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:07 -05:00
Ryan Long
a0a9248d64 t-test-checks-psx.c: Add file headers and licenses
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:07 -05:00
Ryan Long
7dc7ca0e6c rtems-jffs2-config.h: Add file headers and licenses
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:07 -05:00
Ryan Long
ebfccb05b8 include: Add file headers and licenses
These files had no header, copyright, or license. Based on git history,
added appropriate copyrights and licenses.
2022-05-04 09:12:06 -05:00
Ryan Long
feffc4546a score/src: Add file headers and licenses
These files had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:06 -05:00
Ryan Long
0c17d0e55d ftpd.h: Add file header and license
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Ryan Long
5cbad67bc8 include/pci: Add file header and license
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Ryan Long
17c92ad829 cpukit/include/rtems: Add file headers and licenses
These files had no header, copyright, or licenses. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Ryan Long
45a78fdbf5 sparc64-syscall.h: Add file headers and licenses
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Ryan Long
cce7074279 cpukit/microblaze: Add file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Ryan Long
27fd10d76b cpukit/libmisc: Add file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Ryan Long
f789175f32 adasupp.c: Add file header and license
This file had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Ryan Long
a8b63fd082 cpukit/libcsupport: Adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-05-04 09:11:55 -05:00
Ryan Long
47e84cbde2 cpukit/include: Adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-05-04 09:11:50 -05:00
Sebastian Huber
d56d8a6069 termios06: Fix warning
Update #4493.
2022-04-28 09:37:49 +02:00
Sebastian Huber
8b18037f20 heap: Fix heap statistics with protection enabled
Close #4644.
2022-04-28 09:16:54 +02:00
Ryan Long
9a7e6d346b sp65/init.c: Add file header and license
This file had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-04-27 15:19:25 -05:00
Ryan Long
853860c55a sp47/init.c: Add file header and license
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-04-27 15:19:24 -05:00
Ryan Long
a1c1d3ada3 sp44/init.c: Add file header and license
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-04-27 15:19:24 -05:00
Ryan Long
b99d119604 psxtmtests/psxtmcond*: Add file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-04-27 15:19:24 -05:00
Ryan Long
2bb6004104 ada/samples: Manually adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-04-27 15:19:24 -05:00
Ryan Long
9a6aeb71b1 sptests/sp27*: Manually adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-04-27 15:19:24 -05:00
Ryan Long
48d9dc6c89 libtests/dl06: Manually adding file headers and licenses.
These files had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-04-27 15:19:24 -05:00
Ryan Long
5e0e0675e2 libdl: Manually adding file headers and licenses
These files had no file header, copyright, or license. Chris identified
that these were made by him.

Updates #4521
2022-04-27 15:19:24 -05:00
Ryan Long
db1be840ec support: Manually adding file headers and licenses
This file had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-04-27 15:19:24 -05:00
Ryan Long
187ab79064 samples: Manually adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyrights and licenses.
2022-04-27 15:19:24 -05:00
Ryan Long
49a110718f psxtests: Adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyrights and licenses.
2022-04-27 15:19:24 -05:00
Ryan Long
5b29f1ebc7 libtests: Adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyrights and licenses.
2022-04-27 15:19:24 -05:00
Ryan Long
855ddeaf51 sptests: Manually adding file headers and licenses
Theses files had no file header, copyright, or license. Based on git
history, added appropriate copyrights and licenses.
2022-04-27 15:19:24 -05:00
Ryan Long
0419c1e14d tmtests: Manually adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyrights and licenses.
2022-04-27 15:19:23 -05:00
Ryan Long
d036f373b9 mptests: Manually adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyrights and licenses.
2022-04-27 15:19:23 -05:00
Kinsey Moore
88dc1880ec wscript: Allow start code to be written in C
Start code for most platforms requires hand-coded ASM but some can be
bootstrapped entirely in C, especially for paravirtualized platforms.
This change allows start code to be written in C where possible instead
of requiring architecture-specific ASM to bridge to C.
2022-04-26 09:23:22 -05:00
Gedare Bloom
76b4bb27a3 MAINTAINERS: add emeritus category and retire some maintainers 2022-04-24 06:43:19 -06:00
Kinsey Moore
c3e8a97baf wscript: Allow substitution outside values
This expands the ability to substitute variables outside the current
limitation of values in options to asflags, cflags, cppflags, cxxflags,
ldflags, and includes. It is possible for all of these flags to utilize
user-defined information in config.ini, especially for paths to external
resources.
2022-04-14 13:11:45 -05:00
Joel Sherrill
842a7dd813 psxtmtests/psxtmkey02/init.c: Manually change license to BSD-2
This has yet another typo in the license and was missed by the script.

Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
ceeca0db5b psxtmtests/psxtmthread06/init.c: Adjust formatting 2022-04-12 13:35:39 -05:00
Joel Sherrill
e71f09094f testsuites/samples: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
3f5d8c9c56 testsuites/psxtests/psxhdrs/unistd/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
88b6293a63 testsuites/psxtests/psxhdrs/time/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
15db02f6cc testsuites/psxtests/psxhdrs/sys/socket/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
e1448e9790 testsuites/psxtests/psxhdrs/sys/mman/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
7f78f064fb testsuites/psxtests/psxhdrs/signal*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
7f209b9841 testsuites/psxtests/psxhdrs/sched/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
9e6b2a9c83 testsuites/psxtests/psxhdrs/pthread/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
ab9faf9a6f testsuites/psxtests/psxhdrs/devctl/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
94fa540cc2 testsuites/psxtmtests: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
ecdac5988a testsuites/psxtests/include: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
5594854647 testsuites/psxtests/psx[n-z]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
9e07bccac2 testsuites/psxtests/psx[g-m1]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
ede291588a testsuites/psxtests/psx[a-f]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
a3610bb924 testsuites/psxtests/psx[01]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
e8878d4815 fstests/fsdosfsname01/create_image.sh: Manually change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
6d410fe86b testsuites/fstests/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
d1c10d6a1e testsuites/libtests/*/*.dts. stackchk02.doc: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
52a67757ef testsuites/libtests/[m-z]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
33078a2bfb testsuites/libtests/[a-l]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
e0d673639b testsuites/support/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
194d9ca5d2 testsuites/tmtests/*/*.py: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
04b6c51e01 testsuites/tmtests/ remainder: Change license to BSD-2
+ include
    + tmck
    + tmfine01
    + tmonetoone
    + tmtimer01

Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
2c1d928fdc testsuites/tmtests/tm[23]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
ef9df16afa testsuites/rmtests/tm[01]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
e19e650f31 testsuites/benchmarks/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
2c292f3ff9 testsuites/ada/mptests/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
b6656a0078 testsuites/ada/tmtests/tmck: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
2bf4acfc50 testsuites/ada/tmtests/tm2*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
61ac3ab09c testsuites/ada/tmtests/tm0*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
37426caa67 testsuites/ada/tmtests/tm1*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
20cec598c6 testsuites/ada/sptests/spatcb01, spname01: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
a767a2bacb testsuites/ada/sptests/sp2*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
3d8f2a55a5 testsuites/ada/sptests/sp1*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
2df35d7e4d testsuites/ada/sptests/sp0*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
28052b744b testsuites/ada/samples/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Joel Sherrill
8d5eb7eba5 testsuites/ada/support/*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:38 -05:00
Sebastian Huber
873e7dab34 validation: Avoid double fatal error
In the SMP_FATAL_MULTITASKING_START_ON_NOT_ONLINE_PROCESSOR test case,
the boot processor ends up in the idle body.  Do not issue a fatal error
here and instead enter the idle loop.  The secondary processor will
terminate the system.
2022-04-12 08:37:54 +02:00
Sebastian Huber
ba36e4a236 validation: Allow custom idle task body 2022-04-12 08:37:54 +02:00
Joel Sherrill
6f40354dba Remove duplicate SPDX lines accidentally added 2022-04-08 08:41:50 -05:00
Ryan Long
5efcd021ef x86_64/elf_machdep.h: Replace stub with NetBSD version
The other ports included that architecture's version of this file from
NetBSD. This patch follows that pattern.

closes #4641
2022-04-08 08:36:24 -05:00
Joel Sherrill
74e532f1f6 testsuites/smptests/*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
e2ffe959c5 testsuites/fstests/*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
acceb478ec testsuites/libtests/[p-z]*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
1ef07d4620 testsuites/libtests/[d-o]*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
366711fcfa testsuites/libtests/dl*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
85cc173d6e testsuites/libtests/[a-c]*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
b331f409a8 testsuites/tmtests/*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
42d4ebe1a5 testsuites/mptests/*: Change license to BSD-2.
Updates #3053.
2022-04-07 08:38:56 -05:00
Christian Mauderer
43119193ef imfs: Fix index underrun when extending empty file
Currently the following sequence causes a endless loop when extending an
IMFS file:

- Create a file with zero length and close it.
- Make sure nearly no allocatable memory is left.
- Open the file and write enough data into it that more than the
  remaining memory will be used.

In that case when extending the IMFS file, the file currently need zero
blocks. If allocating enough new blocks fails, the already allocated new
blocks will be freed again.

The comparison of block>=old_blocks that has been used prior to this
patch compared two unsigned numbers. If old_blocks was zero, the
comparison of these two numbers always evaluated to true.

This patch frees the last block in a separate step to avoid this
problem.

Fixes #4639
2022-04-07 10:37:23 +02:00
Karel Gardas
409b566571 bsp/stm32h7: update FMC configuration for SRAM and SDRAM usage
The patch merges differences in FMC configuration between system_stm32h7xx.c
file generated by STM32CubeIDE for 743i-eval2 board and the current RTEMS
ext-mem-ctl.c file.

Sponsored-By: Precidata
2022-04-07 08:04:19 +02:00
Sebastian Huber
23426257c6 shell: Add rtems_shell_run_main_loop()
In contrast to rtems_shell_main_loop(), this new function does not
perform all sorts of initialization based on environment settings.  For
example, due to the use of isatty() in rtems_shell_main_loop() it is
impossible to run an interactive shell through a socket connection.
2022-04-06 16:26:52 +02:00
Sebastian Huber
a800e4de12 shell: Move rtems_shell_init_environment() call
Move rtems_shell_init_environment() call to rtems_shell_set_shell_env()
since this function uses the POSIX key.
2022-04-06 16:26:52 +02:00
Sebastian Huber
3407a3b1bc shell: Add and use SHELL_MAGIC 2022-04-06 16:26:52 +02:00
Sebastian Huber
e765cfb450 shell: Simplify rtems_shell_dup_current_env()
Do not assign members already provided by the global environment.
2022-04-06 16:26:52 +02:00
Sebastian Huber
1a8ad7e68f shell: Refactor rtems_shell_main_loop()
Disentangle the shell main loop from setup and teardown code.  Move main
loop into shell_main_loop().
2022-04-06 16:26:52 +02:00
Sebastian Huber
9320c7ecaa shell: Move line editor output check
Move call to isatty() to caller of rtems_shell_line_editor().  This
avoids a dependency on isatty() in rtems_shell_line_editor().
2022-04-06 16:26:52 +02:00
Sebastian Huber
7beb4fa3b8 build: Remove obsolete test excludes 2022-04-06 16:26:52 +02:00
Sebastian Huber
0725b200e7 bsps: Add gicv3_get_attributes() 2022-04-06 09:48:52 +02:00
Sebastian Huber
d8b23fa488 bsps: Add gicv3_sgi_ppi_get_priority() 2022-04-06 09:48:52 +02:00
Sebastian Huber
f828ddd1a9 bsps: Add gicv3_sgi_ppi_set_priority() 2022-04-06 09:48:52 +02:00
Sebastian Huber
3026859d41 bsps: Move gicv3_init_cpu_interface()
Make the processor index a parameter.
2022-04-06 09:48:52 +02:00
Sebastian Huber
b3519336fd bsps: Move gicv3_init_dist()
Make the distributor register block a parameter.
2022-04-06 09:48:52 +02:00
Sebastian Huber
ea353b4bfa bsps: Add gicv3_sgi_ppi_disable() 2022-04-06 09:48:52 +02:00
Sebastian Huber
f74b120c24 bsps: Add gicv3_sgi_ppi_enable() 2022-04-06 09:48:52 +02:00
Sebastian Huber
42c806fc84 bsps: Add gicv3_sgi_ppi_is_enabled() 2022-04-06 09:48:52 +02:00
Sebastian Huber
be25de5ff8 bsps: Add gicv3_ppi_clear_pending() 2022-04-06 09:48:52 +02:00
Sebastian Huber
2e5b1312c8 bsps: Add gicv3_ppi_set_pending() 2022-04-06 09:48:52 +02:00
Sebastian Huber
518330069d bsps: Add gicv3_trigger_sgi() 2022-04-06 09:48:52 +02:00
Sebastian Huber
f10c551f54 bsps: Add gicv3_sgi_ppi_is_pending() 2022-04-06 09:48:52 +02:00
Sebastian Huber
9abcaaebc3 bsps: Add <dev/irq/arm-gicv3.h>
Separate the Interrupt Manager implementation from the generic Arm GICv3
support.  Move parts of the Arm GICv3 support into a new header file.  This
helps to support systems with a clustered structure in which multiple GICv3
instances are present.  For example, two clusters of two Cortex-R52 cores where
each cluster has a dedicated GICv3 instance.
2022-04-06 09:48:51 +02:00
Sebastian Huber
c1a6e6275b unit: Test red-black trees 2022-04-06 09:38:09 +02:00
Sebastian Huber
7ca6eeee79 unit: Add test for misaligned builtin memcpy() 2022-04-06 09:38:09 +02:00
Sebastian Huber
95e3ade435 unit: Add a unit test suite 2022-04-06 09:38:09 +02:00
Sebastian Huber
39439d4c85 bsp/stm32h7: Disable some tests for a variant
Making this BSP a small memory target is a bit coarse and could be improved.
2022-04-06 09:38:09 +02:00
Karel Gardas
282fba3c88 bsps/stm32h7: link to flash on STM32H7B3I-DK
The patch is needed due to smaller SRAM and completely disabled
SDRAM on the BSP variant.
2022-04-06 08:18:23 +02:00
Chris Johns
500e69639e libmisc/untar: Use a larger block size to read and write files
- A larger block size lets files systems work better. On JFFS
  a 512 byte compressed block means lots of small flash updates

Closes #4635
2022-04-06 08:02:30 +10:00
Joel Sherrill
4160547a24 sp0*/*.doc: Remove junk UTF-8 character 2022-04-05 13:14:14 -05:00
Joel Sherrill
3ed59872de testsuites/sptests/sp[i-z]*/*.doc: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
df6a7e0a1d testsuites/sptests/sp[a-h]*/*.doc: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
ce8d47be72 testsuites/sptests/sp[0-7]*/*.doc: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
d865c65efe testsuites/sptests/sp[s-z]*: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
0473b2b36a testsuites/sptests/sp[g-r]*: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
e7d46b738c testsuites/sptests/sp[a-f*]*: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
c50bb51b19 testsuites/sptests/sp[4-7]*: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
d987a57be4 testsuites/sptests/sp[2-3]*: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
eb579662e4 testsuites/sptests/sp1*: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
725101151c testsuites/sptests/sp0*: Change license to BSD-2
Updates #3053.
2022-04-05 13:14:14 -05:00
Joel Sherrill
5f8c41c389 Update email address of Fernando Ruiz Casas to <fruizcasas@gmail.com>
This was requested to be executed prior to relicensing to BSD-2.
2022-04-05 13:13:31 -05:00
Sebastian Huber
2b54d2e8b8 bsp/stm32h7: Convert to UNIX line endings 2022-04-05 11:34:25 +02:00
Karel Gardas
ef2c5f70e7 bsp/stm32h7: bring all required changes into system_stm32h7xx for STM32H7B3I-DK BSP variant
The changes provided here are a result of a merge from various examples
system_stm32h7xx.c files provided by STMicroelectronics for the STM32H7B3I-DK
board with the original RTEMS file provided for the STM32H743I-EVAL2 board.
2022-04-05 10:35:31 +02:00
Karel Gardas
e2b673d410 bsp/stm32h7: properly ifdef all unsupported features in start -hal file while compiling for STM32H7B3I-DK BSP 2022-04-05 09:56:06 +02:00
Karel Gardas
2c4331a14d bsp/stm32h7: configure peripheral clocks for STM32H7B3xxQ (e.g. STM32H7B3I-DK BSP) 2022-04-05 09:56:06 +02:00
Karel Gardas
074cb1c61d bsp/stm32h7: configure oscillator for STM32H7B3xxQ (e.g. STM32H7B3I-DK BSP) 2022-04-05 09:56:06 +02:00
Karel Gardas
b50f3e88c2 bsp/stm32h7: configure AHB clock divider for STM32H7B3xxQ (e.g. STM32H7B3I-DK BSP) 2022-04-05 09:56:06 +02:00
Karel Gardas
27d1707f20 bsp/stm32h7: disable ethernet for STM32H7B3I-DK BSP variant
Note: the ethernet port is not presented on the board anyway.
2022-04-05 09:56:06 +02:00
Karel Gardas
bf64ff2bb7 bsp/stm32h7: use appropriate STM32H7B3xxQ define for STM32H7B3I-DK BSP variant 2022-04-05 09:56:06 +02:00
Karel Gardas
2414d9b151 bsp/stm32h7: configure S(D)RAM values for STM32H7B3I-DK BSP variant
Caveat: SDRAM 1 is completely disabled for now.
2022-04-05 09:56:05 +02:00
Karel Gardas
c2e4128f73 bsp/stm32h7: HSE clock value configuration for STM32H7B3I-DK BSP variant 2022-04-05 09:56:05 +02:00
Karel Gardas
c48bedd13a bsp/stm32h7: add flash latency configuration 2022-04-05 09:56:05 +02:00
Karel Gardas
0acc136039 bsp/stm32h7: add configuration for USART1 GPIO pins, registers and alternate function 2022-04-05 09:56:05 +02:00
Karel Gardas
51db61ae48 bsp/stm32h7: disable UART 5, 7, 8, 9 and USART 3, 6, 10 for STM32H7B3I-DK BSP 2022-04-05 09:56:05 +02:00
Karel Gardas
044bc3ceab bsp/stm32h7: add power supply configuration 2022-04-05 09:56:05 +02:00
Karel Gardas
1050b6294d bsp/stm32h7: add spec file for the STM32H7B3I-DK BSP variant 2022-04-05 09:56:05 +02:00
Joel Sherrill
2a7f7767ff cpukit/libmisc/dumpbuf/dumpbuf.c: Manually change license to BSD-2
There was a typo in the license text and this file was missed by
the script.

Updates #3053
2022-04-02 14:17:59 -05:00
Joel Sherrill
3a6c3c1bde cpukit/include; Remove SPDX from Gaisler files NOT changed to BSD-2 2022-04-02 14:15:16 -05:00
Joel Sherrill
821e89dab2 cpukit/libcsupport/src/_*: Change license to BSD-2
Updates #3053.
2022-04-01 10:02:30 -05:00
Joel Sherrill
70432fcff2 cpukit/libcsupport/src/[g-r]*: Change license to BSD-2
Updates #3053.
2022-04-01 10:02:30 -05:00
Joel Sherrill
df1cb9f397 cpukit/libcsupport/src/[s-z]*: Change license to BSD-2
Updates #3053.
2022-04-01 10:02:30 -05:00
Joel Sherrill
d90e2dc1e8 cpukit/libcsupport/src/[a-f]*: Change license to BSD-2
Updates #3053.
2022-04-01 10:02:30 -05:00
Joel Sherrill
54ec02640d cpukit/include/rtems/timespec.h: Change license to BSD-2
Permission received from Krzysztof Miesowicz.

Updates #3053.
2022-04-01 10:02:30 -05:00
Joel Sherrill
59fba6f520 cpukit/include/rtems/cbs.h: Change license to BSD-2
Permission received from Petr Benes

Updates #3053.
2022-04-01 10:02:30 -05:00
Joel Sherrill
ffaaae2cf5 cpukit/score/cpu/moxie: Change license to BSD-2
Permission received from Anthony Green.

Updates #3053.
2022-04-01 10:02:30 -05:00
Sebastian Huber
a340ca191a libcsupport: Use _fwalk_reent()
Use _fwalk_reent() instead of _fwalk(), since _fwalk() was removed from Newlib.
Include <sys/reent.h> and remove local declarations.
2022-04-01 08:04:19 +02:00
Matt Joyce
ea4d756672 newlib01: Added tests for exit procedures
Added tests for exit procedures to ensure proper resource
cleanup. The test now checks cleanup for files assigned
to stdio streams and non-stdio streams.
2022-03-31 17:19:39 +02:00
Sebastian Huber
9f9f1408a1 rtems: Clarify scheduler of created task 2022-03-29 17:19:42 +02:00
Sebastian Huber
c2d7376f06 validation: Use individual names for ident tests
Make the task configuration reusable.

Update #3716.
2022-03-29 17:19:42 +02:00
Joel Sherrill
9bbf4003f3 cpukit/include/rtems/confdefs/libpci.h: Manual file header clean up 2022-03-25 11:19:28 -05:00
Joel Sherrill
c35816aaa1 cpukit/include/pci: Manual header file clean up 2022-03-25 11:19:28 -05:00
Joel Sherrill
9982e8e4c1 cpukit/include/drvmgr: Manual header file clean up 2022-03-25 11:19:28 -05:00
Joel Sherrill
06c9ab3e2f cpukit/include/pci.h: Manual header clean up 2022-03-25 11:19:28 -05:00
Joel Sherrill
3d43589812 cpukit/include/*.h: Change license to BSD-2
Updates #3053.
2022-03-25 11:19:28 -05:00
Joel Sherrill
77d1ac6c22 cpukit/include/sys: Change license to BSD-2.
Updates #3053.
2022-03-25 11:19:28 -05:00
Joel Sherrill
fb5f575b9f cpukit/include/rtems: Change license to BSD-2
Updates #3053.
2022-03-25 11:19:28 -05:00
Joel Sherrill
3ec0b2676d cpukit/include/linux: Change license to BSD-2
Updates #3053.
2022-03-25 11:19:28 -05:00
Joel Sherrill
35d1f9a238 cpukit/include/dev: Change license to BSD-2
Updates #3053.
2022-03-25 11:19:28 -05:00
Joel Sherrill
e4cc56a792 cpukit/libmisc/monitor/: Manually change to BSD-2 license
This code did not have any copyrights or licenses and a bit
of archeology was needed to determine authorship.

This code was in the initial import into the RTEMS CVS repository when
it was established in May 1995. There was very little, if any, code not
written by OAR Corporation in that initial import.  After discussion
with Chris Johns, it was determined that this code was from OAR
Corporation and that he had added a few features later. Both
Chris Johns and OAR Corporation have given permission to relicense.

Updates #3053.
2022-03-24 12:45:03 -05:00
Joel Sherrill
753873e54b Update Eric Norum contact info and start to normalize file headers 2022-03-24 10:01:51 -05:00
Joel Sherrill
c9625a21ac testsuites/: Update Eric Norum contact info and normalize file headers 2022-03-24 10:01:51 -05:00
Joel Sherrill
628bd9b682 cpukit/: Update Eric Norum contact info and normalize file headers 2022-03-24 10:01:51 -05:00
Sebastian Huber
10d1de250a validation: Clarify comment 2022-03-24 11:20:26 +01:00
Sebastian Huber
36615183d6 smp: Add fatal error
Add SMP-specifc SMP_FATAL_MULTITASKING_START_ON_NOT_ONLINE_PROCESSOR
fatal error.  This fatal error helps to diagnose a broken SMP startup
sequence.  Without this error a context switch using the NULL pointer
for the thread control block happens which may be difficult to debug.
2022-03-24 11:10:49 +01:00
Sebastian Huber
14de245d05 validation: Test support functions
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
ab2c04a86f validation: Test thread implementation
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
4a8f4b7202 validation: Test SMP-specific aspects
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
ff50664c5c validation: Test scheduler operations
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
9f283e79f2 validation: Test C libary functions
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
c24747a69b validation: Test <sys/lock.h> mutex operations
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
5fb7ce8835 validation: Test futex support
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
fa660c4d5b validation: Test status code directives
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
7eb4fc8d43 validation: Test timecounter
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
bc0cd6951e validation: Test object services
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
c88db0f5fb validation: Test User Extensions Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Frank Kühndel
565a7e6654 validation: Test Timer Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
6b29390484 validation: Test Task Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
32e472a765 validation: Test Signal Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
43adf2ed59 validation: Test Semaphore Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
1c87bb585f validation: Test Scheduler Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Frank Kühndel
98091b6d88 validation: Test Rate Monotonic Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
5c850245bf validation: Test Partition Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
372ff260c8 validation: Test options
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
b63084a916 validation: Test task modes
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Frank Kühndel
04fb7b6040 validation: Test Message Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
134b4cb709 validation: Test IO Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:49 +01:00
Sebastian Huber
aebf6b6619 validation: Test Interrupt Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
8d3fe04499 validation: Test Event Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
32ca0c479e validation: Test rtems_cpu_usage_reset()
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Frank Kühndel
034d0b2f0b validation: Test Clock Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
b322a3ba44 validation: Test Cache Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Frank Kühndel
99544e3f87 validation: Test <rtems/score/basedefs.h>
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
1410d5b8bf validation: Test Barrier Manager
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
0b26e0994c validation: Test attributes
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
ca4d9ea23b validation: Test application configuration
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
d9a07fd87a validation: Test object identification
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
a4b771844a validation: Test mutex operations
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
a6b4a3b07c validation: Test semaphore operations
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
7db4c14b9e validation: Test thread queues
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
c39133b882 validation: Add system termination test suites
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
212b0ca440 validation: Add test suites
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.

Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
40cc4f5009 validation: Improve support library
Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
6aa0552403 libtest: Increase line length
Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
cc1c944042 libtest: Add scheduler test support
Add support to record scheduler operations.  This support is especially
important for tests in SMP configurations since the thread switch extension is
quite difficult to use due to the asynchronous nature of thread dispatching.
In contrast, the scheduler operations occur normally in a deterministic order.

Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
d0de6fdfa8 score: Add _IO_Relax()
This function may be used to burn a couple of processor cycles with
minimum impact on the system bus.  It may be used in busy wait loops.
Since it is a global function, it is possible to wrap it in device
driver test code.
2022-03-24 11:10:48 +01:00
Sebastian Huber
3345415211 newlib01: Adjust variable name 2022-03-24 11:10:48 +01:00
Matt Joyce
c82eb0b0fb newlib01: Check exit processing for file objects 2022-03-24 11:06:22 +01:00
Sebastian Huber
5b1b2aa67a build: Exclude rcxx01 test for sh BSPs
There seems to be a code size increase with GCC 12.
2022-03-23 17:17:56 +01:00
Joel Sherrill
fab1a86221 cpukit/libmisc/untar: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
ed4200e770 cpukit/libmisc/check: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
50ec42c353 cpukit/libmisc/serdbg: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
c02836c485 cpukit/libmisc/rtems-fdt: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
aa4c01027a cpukit/libmisc/redirector: Manually change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
903bba259f cpukit/libmisc/mouse: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
8227a27943 cpukit/libmisc/fsmount/fsmount.c: Manual header clean up 2022-03-22 11:34:23 -05:00
Joel Sherrill
ccf8287197 cpukit/libmisc/fsmount: Change license to BSD-2.
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
3674288ad2 cpukit/libmisc/dumpbuf: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
9723662214 cpukit/libmisc/dummy: Change license to BSD-2.
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
183209b5e7 cpukit/libmisc/devnull/devzero.c: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
f1470914fb cpukit/libmisc/cpuuse: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
4b7fbc7c44 cpukit/libmisc/capture: Manually change license to BSD-2
These files did not follow the standard format and needed to be
changed manually.

Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
1dc5ba2a45 cpukit/capture: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
152ab750ca cpukit/libmisc/bspcmdline: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
1db3d3c3ee cpukit/libtest: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
1b33b9d0e5 cpukit/libpci: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
f083c84fe5 cpukit/libgnat: Change license to BSD-2.
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
2830ee959b cpukit/libfs/src/rfs: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
4ad52d62fe cpukit/libds/src/ftpfs/tftpDriver.c: Manually update license to BSD-2
Eric Norum granted permission plus git log archeology to get year for
his copyright.

Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
67a5936f58 cpukit/libfs/src/imfs: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
5dec08934f cpukit/libdl: Manual file header reordering (SPDX, Doxygen, Copyright)
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
60060e695a cpukit/libfs/src/defaults: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
72d83c61d4 cpukit/libdrvmsg: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
5a65257d0c cpukit/libdl Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
a50839ffd8 cpukit/libdl/rtl-alloc-check.py: Change to BSD-2 by hand
Updates #3053.
2022-03-22 11:34:23 -05:00
Sebastian Huber
7fe3c62329 thread.hpp: Fix redefinition of default argument
A default argument shall be defined only once.

Close #4632.
2022-03-18 16:13:04 +01:00
Sebastian Huber
1a5991e4e7 build: Apply command line options to all variants
Update #4548.
2022-03-18 14:57:43 +01:00
Sebastian Huber
b837c83869 shell: Avoid potential stack corruption
The rtems_shell_init() passed the address of a stack variable
(exit_code) to rtems_shell_run().  If wait == false, then the stack
variable goes out of scope but may be accessed by the created shell
thread.

The rtems_shell_script() was affected by the same problem.

Close #4629.
2022-03-16 07:35:27 +01:00
Sebastian Huber
f311caf984 bsps/irq: Improve affinity set handling
Restrict the affinity set to the set of online processors.  Make sure
the affinity set for an interrupt vector contains at least one online
processor.

Update #3269.
2022-03-16 07:29:27 +01:00
Sebastian Huber
ca4fa22e51 bsps/irq: Fix formatting
Update #3269.
2022-03-16 07:29:27 +01:00
Alex White
14381c432a microblaze: Add JFFS2 AXI QSPI driver
This driver has been tested with Micron NOR Flash via AXI Quad SPI.
2022-03-15 10:46:19 -05:00
Sebastian Huber
e7a2470d06 bsps/arm: Fix bsp_start_memcpy() for ARMv7-AR
Synchronize data and instruction streams.
2022-03-14 09:23:54 +01:00
Kinsey Moore
3e3393ac1e cpukit/aarch64: Add Per_CPU_Control accessor
Add an architecture-specific implementation for
_CPU_Get_current_per_CPU_control() to reduce overhead for getting the
current CPU's Per_CPU_Control structure.
2022-03-12 11:55:11 -06:00
Sebastian Huber
74d3abc1db arm: Fix PMSA section to region mapping
Fix move of regions.  Allow sections to be contained in a region (may
happen due to region alignment).
2022-03-11 09:24:57 +01:00
Sebastian Huber
ca74566f7e arm: Add _AArch32_PMSA_Map_sections_to_regions()
This simplifies unit testing.
2022-03-11 09:24:57 +01:00
Sebastian Huber
1a23ee6176 bsp/fvp: Use only vector table of start section 2022-03-11 09:24:54 +01:00
Christian Mauderer
817ee56327 bsps/.../disp_hcms29xx.h: Fix comment block
Update #4625
2022-03-10 14:43:10 +01:00
Christian Mauderer
947c66456c bsps/m68k: Restore license file
Quite some files in the bsps/m68k/genmcf548x mention a
Freescale_license.txt file. The file has been accidentally removed
during the source reorganization in 2018. This commit restores it and
moves it to the right location for licenses.

Update #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
3293a21c73 bsps: Automated IMD header file clean up
Use the same form of IMD in all copyright lines

Update #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
bb2e149e0b cpukit: Automated IMD header file clean up
Use the same form of IMD in all copyright lines

Update #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
4f9db3fae6 bsps/powerpc/gen5200: Manual Header clean up
Update #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
c39c12b97f bsps/powerpc/gen83xx/start/cpuinit.c: Manual Header clean up
There is not really anything left from the referenced cpuinit.c file
from MPC8260ads CPU initialization. So ignore that part of the header
during rework.

Update #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
d7955b245e bsps and cpukit: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
52a8cc97ef bsps/powerpc/gen5200: Manual file header clean up
This cleans some of the more complex headers including IPR.

Updates #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
5028a9f6c4 testsuites: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
f0f6e88882 bsps/powerpc: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
3fb2a815c7 bsps/powerpc/gen5200: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
6d4a72eb06 bsps/powerpc: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
a11e1219c4 bsps/powerpc/gen83xx: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
eeea4feeca bsps/powerpc/tqm8xx: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
4a85ce8d6a bsps/shared: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Christian Mauderer
98e43e833b bsps/m68k: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Joel Sherrill
bbe71c611b bsps/testsuites/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
fe6d96cc85 bsps/include/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
099dda2df5 bsps/m68k/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
e560ee85cf bsps/powerpc/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
51e06729b1 bsps/sh/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
9bf813c5f1 bsps/shared/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
ba619b7f36 bsps/arm/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
7a9b240801 bsps/sparc: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
9a9442e85c m68k/genmcf548x/: Manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
621ddfce91 m68k/genmcf548x: Manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
9a60aa72a7 bsps/m68k/gen68360/spi/m360_spi.h: Manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
1ea6f50f25 bsps/lm32/include/bsp/irq.h: manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
3a17ee8e45 bsps/include/libchip/spi-memdrv.h: Manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
e77f7260d7 bsps/include/libchip/spi-fram-fm25l256.h: Manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
100873796b bsps/include/libchip/disp_hcms29xx.h: Manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
2ccb2fc565 include/libchip/spi-flash-m25p40.h: Manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
9365dd7c46 powerpc/mpc55xxevb: Manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
3878b0107f m68k/genmcf548x/README: Manual file header clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
8c6bf983ba m68k/gen68360/spi/m360_spi.c: Manual file header clean up
Updates #4625.
2022-03-10 08:43:49 +01:00
Joel Sherrill
255fe433fd cpukit/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:49 +01:00
Joel Sherrill
d836922525 libmisc/serdbg: Manual header clean up
Updates #4625.
2022-03-10 08:43:49 +01:00
Joel Sherrill
78af9249f3 telnetd.c: Manual cleanup of embedded brains File Headers
This file's text looked different from others. Fixed by hand.

Updates #4625.
2022-03-10 08:43:49 +01:00
Joel Sherrill
da7204301a testsuites/fstests/fsdosfsname01/create_files.cs: Convert to UNIX CR/LF.
This file had a mix of both DOS and UNIX CR/LF.

Updates #4625.
2022-03-10 08:43:49 +01:00
Joel Sherrill
951fa14a1e bsps/m68k/genmcf548x/README: Manual cleanup of embedded brains File Headers
Updates #4625.
2022-03-10 08:43:49 +01:00
Joel Sherrill
5fbb477952 testsuites/.../*doc: Manual cleanup of embedded brains File Headers
There were not a lot of these and they did not match the patterns
of the C.

Updates #4625.
2022-03-10 08:43:49 +01:00
Sebastian Huber
32f0f11a68 SMP: Fix start multitasking for some targets
The previous SMP multitasking start assumed that the initial heir thread of a
processor starts execution in _Thread_Handler().  The _Thread_Handler() sets
the interrupt state explicitly by _ISR_Set_level() before it calls the thread
entry.  Under certain timing conditions, processors may perform an initial
context switch to a thread which already executes its thread body (see
smptests/smpstart01).  In this case, interrupts are disabled after the context
switch on targets which do not save/restore the interrupt state during a
context switch (aarch64, arm, and riscv).

Close #4627.
2022-03-09 21:11:10 +01:00
Marcus Ritter
bafeff6095 bsp/altera-cyclone-v: fix the creation of reserved memory regions 2022-03-09 09:13:36 +01:00
Sebastian Huber
5fcc2caa10 score: Disable thread dispatching earlier
Disable thread dispatching earlier on secondary processors.  This ensures that
fatal error and per-CPU job handlers are called with thread dispatching
disabled.  On the boot processor, the thread dispatching is already disabled by
_Thread_Dispatch_initialization().
2022-03-08 19:29:09 +01:00
Sebastian Huber
b08ba92819 smptests/smpstart01: New test program
Update #4627.
2022-03-08 09:47:01 +01:00
Sebastian Huber
709dfd4907 mpci: Fix RTEMS_DEBUG support 2022-03-08 08:12:47 +01:00
Sebastian Huber
1b1ace7620 bsp/leon3: Fix warning 2022-03-08 08:12:47 +01:00
Sebastian Huber
cfeb3cbb68 bsp/leon3: Include missing header file
The <leon.h> include was removed from <bsp.h> in commit
1577a48369.
2022-03-08 08:12:47 +01:00
Joel Sherrill
f381e9bab2 cpukit/libblock: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
2dcc54f9c6 cpukit/ftpd: Change license to BSD-2
Not all files could be changed.

Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
2fb29836b0 cpukit/include/adainclude: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
c0ec0b29e9 score/cpu/v850: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
ef32245bee score/cpu/sparc64: Change license to BSD-2 2022-02-28 10:28:05 -06:00
Joel Sherrill
e111974ab8 score/cpu/sparc: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
87076c94d2 score/cpu/powerpc: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
2ec78aaf4a score/cpu/or1k: Change license to BSD-2 2022-02-28 10:28:05 -06:00
Joel Sherrill
3ca8895f3a score/cpu/no_cpu: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
4b5e64ac04 score/cpu/nios2: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
bf10d5b912 score/cpu/mips: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
51366002f2 score/cpu/m68k: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
f42730ae7a score/cpu/i386: Change license to BSD-2
sse_test.c was deliberarely NOT changed.

Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
e47a3b758f score/cpu/arm: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
bd2e898c9e sapi/src/*.c: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
46a16ada0c cpukit/include/rtems/posix/*.h: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
fee27716f0 posix/src/_execve.c: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
380fb9fb91 cpukit/posix/src/[p-z]*.c: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
0a645dadd5 cpukit/posix/src/[a-o]*.c: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
a2ed06e38f cpukit/include/rtems/rtems/*.h: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:05 -06:00
Joel Sherrill
b3b6d21e6f cpukit/rtems/src/[s-z]*.c: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:04 -06:00
Joel Sherrill
c4fb617030 cpukit/rtems/src/[a-r]*.c: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:04 -06:00
Joel Sherrill
7b85efb8c4 cpukit/include/rtems/score/[s-z]*.h: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:04 -06:00
Joel Sherrill
7ebce35902 cpukit/include/rtems/score/[a-r]*.h: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:04 -06:00
Joel Sherrill
2a1449c517 score/src/[t-z]*.c: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:04 -06:00
Joel Sherrill
4a0e418024 score/src/[n-s]*.c: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:04 -06:00
Joel Sherrill
ab02824417 score/src/[a-m]*.c: Change license to BSD-2
Updates #3053.
2022-02-28 10:28:04 -06:00
Sebastian Huber
a286d28695 powerpc: Use .machine any for some inline asm 2022-02-26 07:40:17 +01:00
Sebastian Huber
faaffbd913 riscv: Use zicsr architecture extension
This is required for ISA 2.0 support, see chapter

"Zicsr", Control and Status Register (CSR) Instructions, Version 2.0

in

RISC-V Instruction Set Manual, Volume I: RISC-V User-Level ISA
2022-02-25 20:38:20 +01:00
Sebastian Huber
4b09a4c7b8 bsps/riscv: Add missing include 2022-02-25 20:38:20 +01:00
Sebastian Huber
3cf618b398 bsps/riscv: Support .riscv.attributes 2022-02-25 15:34:06 +01:00
Sebastian Huber
8a640bf817 bsps/powerpc: Do no use Newlib internals
The struct _reent::__sdidinit member was renamed in a recent Newlib.
2022-02-25 15:34:06 +01:00
Joel Sherrill
4bc34704a1 cpukit/libblock: Clean up before license change 2022-02-23 16:30:46 -06:00
Joel Sherrill
cc9f4339e3 score/cpu/i386: Clean up file headers in prep for license change. 2022-02-23 16:30:46 -06:00
Joel Sherrill
1011484867 score/src/schedulersimple*.c: Replace found in found in with found in
Updates #3053.
2022-02-23 16:30:46 -06:00
Kinsey Moore
fa944c5eac spec/microblaze: Use configurable RAM size
When committed, the MicroBlaze RAM size was hard-coded to 16MB. This
changes the default to 256MB and sets the KCU105 BSPs to 2GB since that
is what the board has on it.
2022-02-23 12:33:55 -06:00
Kinsey Moore
3317d1e8f0 cpukit/libdebugger: Add MicroBlaze support
Add MicroBlaze support for libdebugger. This uses only software break
type instructions to provide self-hosted GDB debugging support for
applications since internal control of debug hardware is not possible.

Also of note, this implementation for MicroBlaze would typically use the
brki instruction for software break, but instead uses an illegal opcode
to manage software breaks as exceptions. This is due to poor interaction
with the debug hardware where the debug hardware will intercept software
breaks instead of allowing the software break vector to execute.
2022-02-23 08:35:45 -06:00
Kinsey Moore
16d40ce7ff cpukit/libdebugger: Avoid cascade for interrupts
This updates behavior of libdebugger to handle debug exceptions in
interrupt context by temporarily removing a software breakpoint,
stepping, and then resuming afterward.
2022-02-23 08:35:45 -06:00
Kinsey Moore
dbdf38ea7b microblaze: Decouple exceptions from interrupts
Exception handling should be enabled at all times during execution to
ensure that exceptions are not ignored which would cause further
problems. This separates use of the exception enable bit from use of the
interrupt enable bit in the machine status register so that they can be
manipulated independently.
2022-02-23 08:35:45 -06:00
Kinsey Moore
ea1a4fd29b cpukit/libdebugger: Add pure swbreak capability
Add a capability that allows for implementations that operate purely
using software breaks. Due to this implementation method, software
breaks must not be restored until just before returning control to the
thread itself and will be handled by the implementation through thread
switch and interrupt hooks.
2022-02-23 08:35:45 -06:00
Kinsey Moore
924993a4bc cpukit/libdebugger: Avoid missed swbreak removal
It is possible to remove software breaks without actually restoring the
original instruction to memory. When this happens, the original
instruction is lost. This ensures that the original instruction is
restored when a software break is removed.
2022-02-23 08:35:45 -06:00
Sebastian Huber
fa65ad7f02 config: Document CONFIGURE_SCHEDULER_TABLE_ENTRIES 2022-02-22 16:10:03 +01:00
Sebastian Huber
8f1e8f8f26 kern_ntptime.c: Port to RTEMS
Remove previous adjtime() implementation.

Update #2348.
2022-02-21 14:16:41 +01:00
Sebastian Huber
91057b3bdf kern_ntptime.c: Import from FreeBSD
The file was imported from this repository:

https://github.com/freebsd/freebsd.git

This commit was used:

commit 3ec0dc367bff27c345ad83240625b2057af391b9
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Mon Feb 7 14:16:16 2022 -0700

    kern_ntptime.c: Remove ntp_init()

    The ntp_init() function did set a couple of global objects to zero.  These
    objects are in the .bss section and already initialized to zero during kernel
    or module loading.

Update #2348.
2022-02-21 14:16:29 +01:00
Andriy Gapon
870cf9695f kern_tc: unify timecounter to bintime delta conversion
There are two places where we convert from a timecounter delta to
a bintime delta: tc_windup and bintime_off.
Both functions use the same calculations when the timecounter delta is
small.  But for a large delta (greater than approximately an equivalent
of 1 second) the calculations were different.  Both functions use
approximate calculations based on th_scale that avoid division.  Both
produce values slightly greater than a true value, calculated with
division by tc_frequency, would be.  tc_windup is slightly more
accurate, so its result is closer to the true value and, thus, smaller
than bintime_off result.

As a consequence there can be a jump back in time when time hands are
switched after a long period of time (a large delta).  Just before the
switch the time would be calculated with a large delta from
th_offset_count in bintime_off.  tc_windup does the switch using its own
calculations of a new th_offset using the large delta.  As explained
earlier, the new th_offset may end up being less than the previously
produced binuptime.  So, for a period of time new binuptime values may
be "back in time" comparing to values just before the switch.

Such a jump must never happen.  All the code assumes that the uptime is
monotonically nondecreasing and some code works incorrectly when that
assumption is broken.  For example, we have observed sleepq_timeout()
ignoring a timeout when the sbinuptime value obtained by the callout
code was greater than the expiration value, but the sbinuptime obtained
in sleepq_timeout() was less than it.  In that case the target thread
would never get woken up.

The unified calculations should ensure the monotonic property of the
uptime.

The problem is quite rare as normally tc_windup should be called HZ
times per second (typically 1000 or 100).  But it may happen in VMs on
very busy hypervisors where a VM's virtual CPU may not get an execution
time slot for a second or more.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	Panzura LLC
2022-02-21 14:07:29 +01:00
Mark Johnston
ede2278d8d timecounter: Initialize tc_lock earlier
Hyper-V wants to register its MSR-based timecounter during
SI_SUB_HYPERVISOR, before SI_SUB_LOCK, since an emulated 8254 may not be
available for DELAY().  So we cannot use MTX_SYSINIT to initialize the
timecounter lock.

PR:		259878
Reviewed by:	kib
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33014
2022-02-21 14:01:31 +01:00
Sebastian Huber
d69acf87dc config: CONFIGURE_DISABLE_NEWLIB_REENTRANCY
Do not initialize Thread_Control::libc_reent if
CONFIGURE_DISABLE_NEWLIB_REENTRANCY is defined.  This helps to catch errors
with a NULL pointer exception rather than a corruption of the thread control
block.
2022-02-21 11:08:30 +01:00
Christian Mauderer
6fe6622489 bsp/imxrt: Enforce alignment for devicetree
A device tree binary has to be 8 byte aligned in memory. This is checked
since RTEMS commit 34052ef78c "libfdt: Add
FDT alignment check to fdt_check_header()".
2022-02-21 09:30:05 +01:00
Chris Johns
1e0a163388 bsp/arm/zynq: Cadence I2C has moved, update to the new path 2022-02-17 16:55:03 +11:00
Matt Joyce
d24da94f62 newlib01: Edit asserts to check initialization
Edit assert statements in worker thread to check initialization against the
__cleanup member of struct _reent instead of __sdidinit.  This will allow the
removal of sdidinit in a follow up Newlib patch.
2022-02-16 08:25:42 +01:00
Christian Mauderer
cff16379c9 bsp/atsam: Improve UART / USART tx performance
Put the next character into the send buffer if the buffer is empty and
not when the last character has been sent out to the line. This improves
the performance slightly.

Before that patch, the receive path was faster than the transmit path.
Therefore a simple echo could drop characters on a busy connection.
With this patch sending and receiving has about the same performance so
that no characters are lost.

Fixes #4610
2022-02-11 09:03:42 +01:00
Christian Mauderer
0074c9ecf3 bsp/atsam/i2c: Add error return and fix edge cases
The driver didn't return with an error on (for example) a NACK on the
bus. This adds the expected error return. Due to the new case that a
transfer can be interrupted on an error, there were some new edge cases.
This patch therefore also fixes these edge cases by removing the
transfer_state that more or less duplicated the interrupt states.

Fixes #4592
2022-02-10 09:08:03 +01:00
Christian Mauderer
974d24f8a8 bsp/atsam/i2c: Simplify driver
Do some clean ups. Remove superfluous variables. Eliminate some overly
complex logic (information about transfer and remaining bytes has been
tracked redundantly in multiple variables).

This patch doesn't change the behavior of the driver.

Update #4592
2022-02-10 09:07:46 +01:00
Christian Mauderer
7b5948d4d2 termios: Pass number of sent chars to l_start
At the moment the line discipline start function (l_start) has no
possibility to get feedback about the number of characters that have
been sent. This patch passes that information via an additional
parameter.

The change might trigger a warning on existing code because of a pointer
mismatch but it shouldn't break it. An existing function with the old
API will just ignore the additional parameter.

Update #4493
2022-02-10 09:07:26 +01:00
Kinsey Moore
17e05426ca cpukit/microblaze: Simplify dispatch assembly
The dispatch code was unnecessarily saving and restoring an extra
interrupt frame. This avoids the extra frame and folds the dispatch call
into a fallthrough to the interrupt frame restoration code.
2022-02-04 11:31:00 -06:00
Kinsey Moore
c6d8d1cb2b cpukit/microblaze: Clarify interrupt frame usage
Avoid use of magic numbers in favor of named constants and add MSR to
the interrupt frame so that thread dispatch can occur on exceptions as
well.
2022-02-04 11:30:59 -06:00
Kinsey Moore
ace9955fc4 cpukit/microblaze: Add exception extensions
Add the functions necessary to support RTEMS_EXCEPTION_EXTENSIONS and
mark this functionality as available on MicroBlaze.
2022-02-04 11:30:59 -06:00
Kinsey Moore
530a8c2494 cpukit/microblaze: Add debug vector and handler
This patch adds a vector for debug events along with a hook similar to
the exception framework. The debug vector generates an exception frame
for use by libdebugger.
2022-02-04 11:30:59 -06:00
Kinsey Moore
127980c799 cpukit/microblaze: Add exception framework
This patch updates the CPU_Exception_frame to include all necessary
registers, combines hardware snd software exception handlers into a
shared vector, provides an architecture-specific hook for taking
control of exception handling, and moves exception handling over to
actually using the CPU_Exception_frame instead of a minimal interrupt
stack frame. As the significant contents of _exception_handler.S have
been entirely rewritten, the copyright information on this file has been
updated to reflect that.
2022-02-04 11:30:59 -06:00
Alex White
37543e1968 microblaze: Add support for libbsd networking
This includes fixes and improvements necessary to get libbsd networking
running.
2022-02-01 16:58:24 -06:00
Jennifer Averett
50a6580da0 microblaze: Add support for libbsd. 2022-02-01 16:58:24 -06:00
Sebastian Huber
20ca3b09ba sparc: Mark dl06 as expected fail 2022-01-28 08:43:19 +01:00
Sebastian Huber
b519e509a9 sptests: Avoid a dependency on errno
Avoid a dependency on errno which might be a thread-local object.  The tests
sp01, spstkalloc02, and sptls03 assume that no thread-local storage object is
present.

Update #4560.
2022-01-28 08:03:48 +01:00
Kinsey Moore
b539af865e cpukit: Prevent error with disabled stack checker
When the stack checker is not enabled, the stack checker reporting
function can still be called. This prevents that call from performing a
null memory access in trying to find the high water mark if the stack
checker was never initialized.

This also introduces a test to ensure this call does not cause a crash.

Closes #4588
2022-01-27 13:07:30 -06:00
Sebastian Huber
2145e0c7bf Remove obsolete rtems_gxx_*() implementation
GCC versions prior to 6.1 used a RTEMS thread model based on
rtems_gxx_*() functions. GCC version 6.1 or later uses the
self-contained synchronization objects of Newlib <sys/lock.h> for the
RTEMS thread model.

Remove the obsolete implementation.

Close #3143.
2022-01-27 11:06:46 +01:00
Sebastian Huber
e3f70b379b bsps: Avoid use of memcpy() in bsp_fdt_copy()
The memcpy() function may be not loaded at the time bsp_fdt_copy() is
called.
2022-01-19 08:11:20 +01:00
Christian Mauderer
aa95122c17 bsp/atsam: Optionally use DMA for UART Rx
If the system is busy with other interrupts and the UART is set to a
fast baud rate, it's possible to loose UART interrupts and therefore
characters. This allows to optionally enable a DMA for the UARTs so that
a number of lost interrupts can be tolerated.

The number of DMAs on this chip is limited and not not all applications
need that feature. Therefore the DMA is disabled by default.

Close #4578
2022-01-18 08:41:15 +01:00
Christian Mauderer
fbd18c09af bsp/atsam: Merge USART and UART driver
If no extended features of the USART are used and if the comparison
feature of the UART is not used, the two modules are compatible. The
drivers were nearly identical except for some names of the defines.

This patch merges the two drivers into one.

Update #4578
2022-01-18 08:41:11 +01:00
Sebastian Huber
12a2a8e442 arm: Optimize interrupt handling
Use the SRS (Store Return State) instruction if available.  This
considerably simplifies the context save and restore.
2022-01-17 08:14:12 +01:00
Sebastian Huber
84ba194477 arm: Fix stack alignment during interrupt handling
On a public interface, the stack pointer must be aligned on an 8-byte
boundary.  However, it may temporarily be only aligned on a 4-byte
boundary.  The interrupt handling code must ensure that the stack
pointer is properly aligned before it calls a function.  See also:

https://developer.arm.com/documentation/den0013/d/Interrupt-Handling/External-interrupt-requests/Nested-interrupt-handling

Update #4579.
2022-01-17 08:14:12 +01:00
Sebastian Huber
41a1903dd9 arm: Avoid duplicate move from CPSR
Update #4579.
2022-01-17 08:12:15 +01:00
Sebastian Huber
0290e44b28 arm: Rework per-CPU control in interrupt handling
Use volatile register r0 for the per-CPU control of the current
processor instead of the non-volatile register r7.  This enables the use
of r7 in a follow up patch.  Do the interrupt handling in ARM mode.

Update #4579.
2022-01-15 19:49:41 +01:00
Sebastian Huber
2d1ea1abae arm: Use push/pop instructions for readability
Update #4579.
2022-01-15 19:49:41 +01:00
Sebastian Huber
4e530464b0 bsps: Default to CPU counter benchmark timer
Most BSPs which used the stubbed benachmark timer provide a CPU counter.
All BSPs provide at least a stub CPU counter.  Simply use the benchmark
timer implementation using the CPU counter.
2022-01-15 19:49:41 +01:00
Sebastian Huber
944c210b3d bsp/imx7: dl06 fails expectedly 2022-01-14 16:26:54 +01:00
Sebastian Huber
93ebc9da69 libtests/dl10: Enter shell on demand
Use rtems_shell_wait_for_input() similar to other potentially
interactive test programs.
2022-01-14 08:02:38 +01:00
Sebastian Huber
671f126a3a libtests/ofw01: Fix device tree blob alignment
A device tree blob must be aligned on an 8-byte boundary.
2022-01-13 15:15:52 +01:00
Gedare Bloom
6c36cb7a48 aarch64: always boot into EL1NS
Always start the executive in Exception Level 1, Non-Secure mode.
If we boot in EL3 Secure with GICv3 then we have to initialize
the distributor and redistributor to set up G1NS interrupts
early in the boot sequence before stepping down from EL3S to EL1NS.

Now there is no need to distinguish between secure and non-secure
world execution after the primary core boots, so get rid of the
AARCH64_IS_NONSECURE configuration option.
2022-01-12 09:00:19 -07:00
Gedare Bloom
63d27156cb arm/gicv3: refactor DIST initialization to helper 2022-01-12 09:00:19 -07:00
Gedare Bloom
ea7b1b79f8 bsps/aarch64: refactor register init and hooks 2022-01-12 09:00:19 -07:00
Sebastian Huber
37377b0f9d spintrcritical21: Clear pending events
The test runner checks that there are no pending events after a test
case.
2022-01-12 14:24:23 +01:00
Sebastian Huber
00081b30a8 Fix device tree blob alignment
A device tree blob must be aligned on an 8-byte boundary.
2022-01-11 18:01:17 +01:00
Sebastian Huber
cbc92325a1 bsp/qoriq: Implement Interrupt Manager directives
Update #3269.
2022-01-11 16:18:11 +01:00
Sebastian Huber
963a26c34b libtests/ofw01: Fix wrapped in bsp_fdt_get()
Use the stack pointer to check if we have to return the real device tree
since bsp_fdt_get() may get called before the BSS is cleared to zero.
2022-01-11 16:18:11 +01:00
Sebastian Huber
b982b8d44f build: Fix build item format 2022-01-11 16:18:11 +01:00
Sebastian Huber
8657986989 libtest: Check for pending events
Make sure there are no pending events after a test case.
2021-12-22 10:29:13 +01:00
Sebastian Huber
d40477161e rtems: Fix Clock Manager parameter descriptions
Update #4572.
2021-12-22 08:17:50 +01:00
Sebastian Huber
18e47db518 bsp/mrm332: Fix TLS support in linker command file 2021-12-22 08:17:49 +01:00
Joel Sherrill
e92bc25453 Remove powerpc/haleakala board
Closes #4302.
2021-12-17 10:28:07 -06:00
Ryan Long
98ab69323e libmisc/rtems-fdt: close() file 'bf'
close() file 'bf' to avoid leaking descriptor.

CID 1437645: Resource leak in rtems_fdt_load().

Closes #4297
2021-12-17 10:27:27 -06:00
Sebastian Huber
60cec828e7 dtc: Update VERSION 2021-12-14 16:06:19 +01:00
Vikram Garhwal
75b3f48aa3 libfdt: overlay: make overlay_get_target() public
This is done to get the target path for the overlay nodes which is very useful
in many cases. For example, Xen hypervisor needs it when applying overlays
because Xen needs to do further processing of the overlay nodes, e.g. mapping of
resources(IRQs and IOMMUs) to other VMs, creation of SMMU pagetables, etc.

Signed-off-by: Vikram Garhwal <fnu.vikram@xilinx.com>
Message-Id: <1637204036-382159-2-git-send-email-fnu.vikram@xilinx.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Elvira Khabirova
8b21a1b9b2 libfdt: fix an incorrect integer promotion
UINT32_MAX is an integer of type unsigned int. UINT32_MAX + 1 overflows
unless explicitly computed as unsigned long long. This led to some
invalid addresses being treated as valid.

Cast UINT32_MAX to uint64_t explicitly.

Signed-off-by: Elvira Khabirova <e.khabirova@omp.ru>
2021-12-14 16:00:44 +01:00
Georg Kotheimer
4c05a91712 libfdt: Add ALIGNMENT error string
The ALIGNMENT error was missing a string, leading to <unknown error>
being returned.

Signed-off-by: Georg Kotheimer <georg.kotheimer@kernkonzept.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
c07e23899b fdtget: Fix signedness comparisons warnings
With -Wsign-compare, compilers warn about a mismatching signedness in
the different legs of the conditional operator, in fdtget.c.

In the questionable expression, we are constructing a 16-bit value out of
two unsigned 8-bit values, however are relying on the compiler's
automatic expansion of the uint8_t to a larger type, to survive the left
shift. This larger type happens to be an "int", so this part of the
expression becomes signed.

Fix this by explicitly blowing up the uint8_t to a larger *unsigned* type,
before doing the left shift. And while we are at it, convert the hardly
readable conditional operator usage into a sane switch/case expression.

This fixes "make fdtget", when compiled with -Wsign-compare.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20210618172030.9684-3-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
David Gibson
21351a2f79 Fix CID 1461557
Coverity gets a bit confused by loading fdt_size_dt_strings() and
using it in a memmove().  In fact this is safe because the callers
have verified this information (via FDT_RW_PROBE() in fdt_pack() or
construction in fdt_open_into()).

Passing in strings_size like we already do struct_size seems to get
Coverity to follow what's going on here.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Rob Herring
34052ef78c libfdt: Add FDT alignment check to fdt_check_header()
Only checking the FDT alignment in fdt_ro_probe_() means that
fdt_check_header() can pass, but then subsequent API calls fail on
alignment checks. Let's add an alignment check to fdt_check_header() so
alignment errors are found up front.

Cc: Tom Rini <trini@konsulko.com>
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20210406190712.2118098-1-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
David Gibson
a3fa0702c8 libfdt: Fix a possible "unchecked return value" warning
Apparently the unchecked return value of the first fdt_next_tag() call in
fdt_add_subnode_namelen() is tripping Coverity Scan in some circumstances,
although it appears not to for the scan on our project itself.

This fdt_next_tag() should always return FDT_BEGIN_NODE, since otherwise
the fdt_subnode_offset_namelen() above would have returned BADOFFSET or
BADSTRUCTURE.

Still, add a check to shut Coverity up, gated by a can_assume() to avoid
bloat in small builds.

Reported-by: Ryan Long <ryan.long@oarcorp.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Justin Covell
a582ab37c2 Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into
Changes in v3:
- Remove noop version sets
- Set version correctly on loaded fdt in fdt_open_into

Fixes: f1879e1a50eb ("Add limited read-only support for older (V2 and V3) device tree to libfdt.")

Signed-off-by: Justin Covell <jujugoboom@gmail.com>

Message-Id: <20201229041749.2187-1-jujugoboom@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
David Gibson
0b85832782 libfdt: Tweak description of assume-aligned load helpers
There's a small inaccuracy in the comment describing these new helpers.
This corrects it, and reformats while we're there.

Fixes: f98f28ab ("libfdt: Internally perform potentially unaligned loads")
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Tom Rini
03b601aff1 libfdt: Internally perform potentially unaligned loads
Commits 6dcb8ba4 "libfdt: Add helpers for accessing unaligned words"
introduced changes to support unaligned reads for ARM platforms and
11738cf01f15 "libfdt: Don't use memcpy to handle unaligned reads on ARM"
improved the performance of these helpers.

On further discussion, while there are potential cases where we could be
used on platforms that do not fixup unaligned reads for us, making this
choice the default is very expensive in terms of binary size and access
time.  To address this, introduce and use new fdt{32,64}_ld_ functions
that call fdt{32,64}_to_cpu() as was done prior to the above mentioned
commits.  Leave the existing load functions as unaligned-safe and
include comments in both cases.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Message-Id: <20201211022736.31657-1-trini@konsulko.com>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Tom Rini
064a1d76a4 libfdt: Check for 8-byte address alignment in fdt_ro_probe_()
The device tree must be loaded in to memory at an 8-byte aligned
address.  Add a check for this condition in fdt_ro_probe_() and a new
error code to return if we are not.

Signed-off-by: Tom Rini <trini@konsulko.com>
Message-Id: <20201104130605.28874-1-trini@konsulko.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
611a2a5a51 libfdt: Fix kernel-doc comments
The API documentation in libfdt.h seems to follow the Linux kernel's
kernel-doc format[1].

Running "scripts/kernel-doc -v -none" on the file reports some problems,
mostly missing return values and missing parameter descriptions.

Fix those up by providing the missing bits, and fixing the other small
issues reported by the script.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/doc-guide/kernel-doc.rst
Message-Id: <20201012165331.25016-1-andre.przywara@arm.com>

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
65b98121da libfdt: fdt_strerror(): Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_strerror().

Force FDT_ERRTABSIZE to be signed (it's surely small enough to fit), so
that the types match. Also move the minus sign to errval, as this is
actually what we use in the next line.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20201001164630.4980-7-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
140935c560 libfdt: fdt_get_string(): Fix sequential write comparison warnings
With -Wsign-compare, compilers warn about a mismatching signedness in
comparisons in fdt_get_string().

Introduce a new usigned variable, which holds the actual (negated)
stroffset value, so we avoid negating all the other variables and have
proper types everywhere.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20201001164630.4980-6-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
58b4fe7cd5 libfdt: libfdt_wip: Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_setprop_inplace_namelen_partial().

fdt_getprop_namelen() will only return negative error values in "proplen"
if the return value is NULL. So we can rely on "proplen" being positive
in our case and can safely cast it to an unsigned type.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20201001164630.4980-5-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
113cc99965 libfdt: fdt_create_with_flags(): Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_create_with_flags().

By making hdrsize a signed integer (we are sure it's a very small
number), we avoid all the casts and have matching types.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20201001164630.4980-4-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
a5ec1266e5 libfdt: fdt_move(): Fix comparison warnings
With -Wsign-compare, compilers warn about a mismatching signedness
in comparisons in fdt_move().

This stems from "bufsize" being passed in as a signed integer, even
though we would expect a buffer size to be positive.

Short of changing the prototype, check that bufsize is not negative, and
cast it to an unsigned type in the comparison.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20201001164630.4980-3-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
89e5744e02 libfdt: fdt_add_string_(): Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_add_string_().

Make all variables unsigned, and express the negative offset trick via
subtractions in the code.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20201001164630.4980-2-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
26bee33547 libfdt: fdt_node_offset_by_phandle(): Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_node_offset_by_phandle().

Uses a better suited bitwise NOT operator to denote the special value of
-1, which automatically results in an unsigned type.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20200921165303.9115-14-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
bcc2bdebd3 libfdt: fdt_resize(): Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_resize().

A negative buffer size will surely do us no good, so let's rule this
case out first.
In the actual comparison we then know that a cast to an unsigned type is
safe.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20200921165303.9115-10-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
28f7e7635d libfdt: fdt_splice_(): Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_splice_().

Since we just established that oldlen is not negative, we can safely
cast it to an unsigned type.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20200921165303.9115-8-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Simon Glass
3437b91356 libfdt: fdt_get_string(): Fix comparison warnings
With -Wsign-compare, compilers warn about a mismatching signedness in
comparisons in fdt_get_string().

In the first two cases, we have just established that the signed values
are not negative, so it's safe to cast the values to an unsigned type.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20200921165303.9115-7-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
11df656602 libfdt: fdt_grab_space_(): Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_grab_space_().

All the involved values cannot be negative, so let's switch the types of
the local variables to unsigned to make the compiler happy.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20200921165303.9115-4-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
0df1a41f62 libfdt: fdt_mem_rsv(): Fix comparison warnings
With -Wsign-compare, compilers warn about a mismatching signedness
in comparisons in fdt_mem_rsv().

Since all involved values must be positive, change the used types to be
unsigned.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20200921165303.9115-3-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
00125807e2 libfdt: fdt_offset_ptr(): Fix comparison warnings
With -Wsign-compare, compilers warn about mismatching signedness in
comparisons in fdt_offset_ptr().

This mostly stems from "offset" being passed in as a signed integer,
even though the function would not really tolerate negative values.

Short of changing the prototype, check that offset is not negative, and
use an unsigned type internally.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20200921165303.9115-2-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Frank Mehnert
5a03ce84b8 libfdt: fix fdt_check_node_offset_ w/ VALID_INPUT
fdt_check_node_offset_() checks for a valid offset but also changes the
offset by calling fdt_next_tag(). Hence, do not skip this function if
ASSUME_VALID_INPUT is set but only omit the initial offset check in that
case.

As this function works very similar to fdt_check_prop_offset_(), do the
offset check there as well depending on ASSUME_VALID_INPUT.
Message-Id: <1913141.TlUzK5foHS@noys4>

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Patrick Oppenlander
f5379faf35 libfdt: add extern "C" for C++
Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Message-Id: <20200616011217.15253-1-patrick.oppenlander@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Patrick Oppenlander
fcf257a773 libfdt: trivial typo fix
Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Message-Id: <20200618042117.131731-1-patrick.oppenlander@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:43 +01:00
Simon Glass
eaadf70497 libfdt: Correct condition for reordering blocks
This condition uses bitwise OR but should be logical OR. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: kernel test robot <lkp@intel.com>
Message-Id: <20200615160033.87328-1-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:43 +01:00
Jan Beulich
caa59e66fd libfdt: fix undefined behaviour in fdt_splice_()
libfdt: fix undefined behaviour in fdt_splice_()

Along the lines of commit d0b3ab0a0f46 ("libfdt: Fix undefined behaviour
in fdt_offset_ptr()"), fdt_splice_() similarly may not use pointer
arithmetic to do overflow checks. (The left side of the checks added by
d4c7c25c9ed1 ["libfdt: check for potential overrun in _fdt_splice()"]
doesn't really lend itself to similar replacement though.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Message-Id: <f2d09e81-7cb8-c5cc-9699-1ac05b0626ff@suse.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:43 +01:00
Simon Glass
16420fbbd5 libfdt: Use VALID_INPUT for FDT_ERR_BADSTATE checks
This error indicates a logic bug in the code calling libfdt, so VALID_DTB
is not really the right check. Update it to use VALID_INPUT instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200302190255.51426-4-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:43 +01:00
Simon Glass
fe0b99d3eb libfdt: Add support for disabling internal checks
If libfdt returns -FDT_ERR_INTERNAL that generally indicates a bug in the
library. Add a new assumption for these cases since it should be save to
disable these checks regardless of the input.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200302190255.51426-3-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:43 +01:00
Simon Glass
1f2b9ad8f0 libfdt: Improve comments in some of the assumptions
Add a little more detail in a few of these comments.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200302190255.51426-2-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:43 +01:00
Simon Glass
f7a174eff9 libfdt: Fix a few typos
Fix 'saftey' and 'additional' typos noticed in the assumption series.
Reword the ASSUME_NO_ROLLBACK slightly to improve clarity.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200302190255.51426-1-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:43 +01:00
Sebastian Huber
f44e2c99cc bsp/leon3: Do not invalidate cache in SMP start
Since the trap table is now statically initialized, there is no need to
invalidate the instruction cache.
2021-12-13 07:32:58 +01:00
Sebastian Huber
044701eb8b bsp/leon3: Use interrupt entry for tm27 support
Using rtems_interrupt_entry_install() instead of
rtems_interrupt_handler_install() avoids a dependency on the dynamic memory
allocation.

Use Interrupt Manager directives instead of a BSP-specific API.  Use inline
functions.  In SMP configurations, set an affinity to all online processors and
raise the interrupt on the current processor.
2021-12-13 07:32:58 +01:00
Sebastian Huber
1179430fb4 bsp/leon3: Use interrupt entry for the SMP support
Using rtems_interrupt_entry_install() instead of
rtems_interrupt_handler_install() avoids a dependency on the dynamic memory
allocation.
2021-12-13 07:32:58 +01:00
Sebastian Huber
6318154199 bsp/leon3: Use interrupt entry for Clock Driver
Using rtems_interrupt_entry_install() instead of
rtems_interrupt_handler_install() avoids a dependency on the dynamic memory
allocation.
2021-12-13 07:32:58 +01:00
Sebastian Huber
2d75d5db4f bsps/arm: Add missing Cache Manager source file 2021-12-13 07:32:58 +01:00
Sebastian Huber
96221e40dd bsps/aarch64: Support .noinit linker section 2021-12-13 07:32:58 +01:00
Sebastian Huber
868e6d8a75 rtems: Improve ordering in <rtems/rtems/intr.h>
Move the data structure definitions closer to the directives which use
them.
2021-12-13 07:32:58 +01:00
Kinsey Moore
68b0db358c bsps/aarch64: Remove erroneous cache feature
The AArch64 cache implementation does not define
rtems_cache_disable_data(), but declares that it does via
CPU_CACHE_SUPPORT_PROVIDES_DISABLE_DATA. The existing implementation of
_CPU_cache_disable_data() is sufficient to enable this functionality
without the erroneous cache feature flag.

Closes #4569
2021-12-12 12:04:02 -06:00
Sebastian Huber
fb17dfb1ad Avoid ISR_LOCK_MEMBER() since it confuses Doxygen
If RTEMS_SMP is not defined, then Doxygen adds the comments intended for
conditional the lock member to the next member.
2021-12-09 16:37:30 +01:00
Kinsey Moore
0f5fa026ec spec: Update location of cadence I2C
When the cadence I2C code was moved to a shared directory, the
references were updated but the install locations weren't. This updates
the install locations to match what out-of-tree applications expect.
2021-12-09 08:35:49 -06:00
Sebastian Huber
4c20360d72 build: Move test header to right library item 2021-12-09 13:32:30 +01:00
Christian Mauderer
ffc57e3cf3 untar: Make behavior similar to GNU or BSD tar
RTEMS untar implementation had problems with overwriting or integrating
archives into existing directory structures. This patch adapts the
behavior to mimic that of a GNU tar or BSD tar and extends the tar01
test to check for the behavior. That is:

* If a directory structure exists, the files from the archive will be
  integrated. Existing files are overwritten.

* If a file exists and the archive contains a directory with the same
  name, the file is removed and a directory is created. In the above
  example: if l1/l2 is a file it will be overwritten with a new
  directory.

* If a directory exists and the archive contains a file with the same
  name, the directory will be replaced if it is empty. If it contains
  files, the result is an error.

* An archive also can contain only a file without the parent
  directories. If in that case one of the parent directories exists as a
  file extracting the archive results in an error. In the example: if
  l1/l2 is a file and the archive doesn't contain the directories but
  only the file l1/l2/x.txt that would be an error.

* In case of an error, it is possible that the archive has been
  partially extracted.

Closes #4568
2021-12-09 08:23:47 +01:00
Sebastian Huber
39e6f53298 score: Fix _Workspace_Initialize_for_one_area()
In _Workspace_Initialize_for_one_area(), properly check  if there is enough
free memory available for the configured workspace size.

The bug was introduced by commit 3d0620b607.
2021-12-07 16:32:54 +01:00
Sebastian Huber
e543a1695b libtest: Fix sample reporting
The sample reporting wronly added values to the wrong bin in some cases.
2021-12-07 12:53:40 +01:00
Sebastian Huber
5e3607bc7d libtest: Fix overlap in measurement context 2021-12-07 12:53:39 +01:00
Sebastian Huber
69d643f711 score: Fix atomic stores for C++
Close #4566.
2021-12-07 12:24:15 +01:00
Sebastian Huber
9089bcc7b9 rtems: Move all Interrupt Manager stuff to intr.h
Since the previous Interrupt Manager Extension API moved to the
Interrupt Manager, we can move the interfaces to <rtems/rtems/intr.h> so
that they are available via #include <rtems.h>.
2021-12-02 15:11:39 +01:00
Sebastian Huber
0d83bed2e5 rtems: Move scheduler directives to own header
Move all rtems_scheduler_* directives to the new header file
<rtems/rtems/scheduler.h>.  Add a Scheduler Manager API and
implementation group.
2021-12-02 14:09:51 +01:00
Sebastian Huber
d7205f0083 libc: Optimize malloc() initialization
The BSPs provide memory for the separate C Program Heap initialization
via _Memory_Get().  Most BSPs provide exactly one memory area.  Only two
BSPs provide more than one memory area (arm/altera-cyclone-v and
bsps/powerpc/mpc55xxevb).  Only if more than one memory area is
provided, there is a need to use _Heap_Extend().  Provide two
implementations to initialize the separate C Program Heap and let the
BSP select one of the implementations based on the number of provided
memory areas.  This gets rid of a dependency on _Heap_Extend().  It
also avoids dead code sections for most BSPs.

Change licence to BSD-2-Clause according to file history.

Update #3053.
2021-11-30 08:33:12 +01:00
Sebastian Huber
3d0620b607 score: Optimize Workspace Handler initialization
The BSPs provide memory for the workspace initialization via
_Memory_Get().  Most BSPs provide exactly one memory area.  Only two
BSPs provide more than one memory area (arm/altera-cyclone-v and
bsps/powerpc/mpc55xxevb).  Only if more than one memory area is
provided, there is a need to use _Heap_Extend().  Provide two
implementations to initialize the workspace handler and let the BSP
select one of the implementations based on the number of provided memory
areas.  This gets rid of a dependency on _Heap_Extend().  It also avoids
dead code sections for most BSPs.
2021-11-30 08:31:59 +01:00
Sebastian Huber
2de3a6e82c build: Use common objects item for get memory 2021-11-30 08:17:29 +01:00
Sebastian Huber
0bd28daef6 score: Split wkspace.c
Splitting the file avoids unnecessary link-time dependencies.
2021-11-30 08:17:29 +01:00
Sebastian Huber
b070e0127d wkspace.c: Change license to BSD-2-Clause
Change licence according to file history.

Update #3053.
2021-11-30 08:17:29 +01:00
Sebastian Huber
73305a1044 arm: Add AARCH32_PMSA_DATA_READ_WRITE_DEFAULT
Add default memory attributes for read-write data.  The actual
attributes depend on the RTEMS_SMP build option.

Update #4202.
2021-11-30 08:16:36 +01:00
Sebastian Huber
7fec89e24d arm: Fix AARCH32_PMSA_DATA_READ_WRITE_CACHED
Fix definition of AARCH32_PMSA_DATA_READ_WRITE_CACHED.  Since
AARCH32_PMSA_ATTR_AP_EL1_RW_EL0_NO is zero, this fix is only cosmetic.

Update #4202.
2021-11-30 08:16:29 +01:00
Joel Sherrill
e945e3fc4d */aclocal/*: Remove remnants of autoconf/automae build system
Updates #4081.
2021-11-29 09:05:10 -06:00
Joel Sherrill
dd70c81699 bsp_specs: Delete last remnants of these.
Updates #3937.
2021-11-29 08:50:03 -06:00
Sebastian Huber
61d0df45db build: Remove trailing white space 2021-11-29 08:58:22 +01:00
Sebastian Huber
bdcc814343 sparc: Add workaround for GRLIB-TN-0011
Affected components are the GR712RC, UT699, UT699E, UT700, and
LEON3FT-RTAX.  Strictly, the workaround is only necessary if the MMU is
enabled.  Use __FIX_LEON3FT_B2BST to enable the workaround.  This is not
100% appropriate, but the best thing we can use to enable the
workaround.

Close #4551.
2021-11-26 10:43:12 +01:00
Sebastian Huber
675e879b8b rtems: Replace "precision" with "resolution"
Resolution is the right term for the documented property.
2021-11-23 15:18:25 +01:00
Sebastian Huber
546846472a score: Properly continue the thread during restart
The _Thread_queue_Extract() does not deal with potential priority
updates and the SMP locking protocol handling.  Use
_Thread_queue_Continue().  For the POSIX signals processing this is
currently probably unnecessary, however, the use case is similar to the
restart so use the same appoach.

Close #4546.
2021-11-23 11:00:28 +01:00
Sebastian Huber
3b6e263ab6 score: _Thread_queue_Surrender_no_priority()
Simplify _Thread_queue_Surrender_no_priority() and use
_Thread_queue_Resume().

Update #4546.
2021-11-23 11:00:28 +01:00
Sebastian Huber
2e56aabdb1 score: Move _Thread_queue_Extract()
Move _Thread_queue_Extract() since this function is not used by the core
services (threads, semaphores, mutexes, message queues).

Update #4546.
2021-11-23 11:00:28 +01:00
Sebastian Huber
e429e9742a score: Simplify thread wait state handling
Remove the THREAD_WAIT_STATE_READY_AGAIN and simply use the initial value to
indicate that a thread does not wait on something.  Rename
THREAD_WAIT_FLAGS_INITIAL to THREAD_WAIT_STATE_READY.  This change is necessary
so that _Thread_Continue() can be called for threads which never waited on
something (for example dormant threads).

Update #4546.
2021-11-23 11:00:28 +01:00
Sebastian Huber
50aef135a4 score: Add _Thread_MP_Extract_proxy()
Remove _Thread_queue_Extract_with_proxy() and move the proxy extraction
to _Thread_MP_Extract_proxy().  Move similar code blocks of the previous
caller of _Thread_queue_Extract_with_proxy() to helper functions.

Update #4546.
2021-11-23 11:00:28 +01:00
Sebastian Huber
cd791039b9 score: Remove thread timer earlier
The earlier we remove the thread timer the less likely is a superfluous
thread timeout processing.

Update #4546.
2021-11-23 11:00:28 +01:00
Sebastian Huber
834a86fe21 score: Restrict affinity for EDF SMP scheduler
The SMP EDF scheduler supports a one-to-one and one-to-all thread to
processor affinity. It accepted affinity sets which are a proper
subset of the online processor containing at least two processors owned by
the scheduler. In this case it used a one-to-one thread to processor
affinity. This leads to undefined behaviour if a processor is removed
since the higher level check in rtems_scheduler_remove_processor() does
not account for this implementation detail.

Restrict the affinity set accepted by the SMP EDF scheduler to

1. all online processors, or

2. exactly one processor owned by the scheduler.

Close #4545.
2021-11-23 11:00:28 +01:00
Sebastian Huber
c69a70a597 rtems: Fix rtems_scheduler_remove_processor()
Return an error status for the following error condition in
rtems_scheduler_remove_processor():

While an attempt is made to remove a processor from a scheduler, while
the processor is the only processor owned by the scheduler, if a thread
exists which uses the scheduler as a helping scheduler, then the
processor shall not be removed.

The reason is that ask for help requests and withdraw node requests are
processed asynchronously in any order.  An ask for help request carried
out on a scheduler without a processor is undefined behaviour.

Update error status description.

Update #4544.
2021-11-23 11:00:28 +01:00
Sebastian Huber
6443c9dbb7 score: Fix assertion in SMP scheduler framework
Properly assert that the scheduled chain is not empty.  Fix formatting.

Close #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
fc64e837c3 score: Rework ask for help requests
Process ask for help requests on the current processor.  This avoids
using inter-processor interrupts to make the system behaviour a bit more
predictable.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
4d90289e71 score: _Scheduler_SMP_Schedule_highest_ready()
Simplify callers of _Scheduler_SMP_Schedule_highest_ready().  Move the node
state change and the extraction from scheduled into
_Scheduler_SMP_Schedule_highest_ready().  Move the idle thread release to the
caller which have more information about the presence of an idle thread.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
d0434b8863 score: Remove victim thread from CPU allocation
Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
c6362f640a score: Move _Scheduler_Unblock_node()
Move _Scheduler_Unblock_node() into _Scheduler_SMP_Unblock().  This simplifies
the code and makes it easier to review.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
dcd8b939ba score: Move _Scheduler_Block_node()
Move _Scheduler_Block_node() into _Scheduler_SMP_Block().  This simplifies the
code and makes it easier to review.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
f767ef8059 score: Simplify _Scheduler_SMP_Yield()
There is not need to actively ask for help in a yield operation.  The helping
is already done on demand by the other scheduler operations.
2021-11-23 11:00:28 +01:00
Sebastian Huber
b9990b8d46 score: Fix SMP EDF priority group ordering
The SMP EDF scheduler supports one-to-one and one-to-all thread to
processor affinities.  The one-to-one thread to processor affinity
introduces a constraint on the ordering of threads.  The implementation
uses one ready queue for threads which have a one-to-all affinity and
one for each one-to-one affinity group.  To order threads across the
ready queues, a generation number is used.  However, the approach to
update the generation number each time a thread is inserted into a ready
queue was wrong.  The generation number needs to be updated only in the
enqueue and enqueue scheduled operations where an insert priority is
available.  The scheduled chain needs to take the generation number into
account.

An example scenario which shows the bug is this.  Let T be a high
priority task affine to processor X.  Let A be a lower priority task
affine to processor X.  Let B be a lower priority task with no affinity
to a particular processor which executes on processor Y.  Let B be in
the same priority group than A and after A.  Let T set the affinity to
all processors.  Now A (higher priority relative to B) should execute on
X and T (high priority) should execute on Y.

Close #4534.
2021-11-23 11:00:28 +01:00
Sebastian Huber
6d20f0c525 score: Add node to insert to Chain_Node_order
This allows to use additional members of the nodes for comparision.

Update #4534.
2021-11-23 11:00:28 +01:00
Sebastian Huber
ff20bc9816 score: Rework idle handling in SMP schedulers
This patch fixes an issue with the idle thread handling in the SMP
scheduler framework used for the MrsP locking protocol.  The approach to
use a simple chain of unused idle threads is broken for schedulers which
support thread to processor affinity.  The reason is that the thread to
processor affinity introduces another ordering indicator which may under
certain conditions lead to a reordering of idle threads in the scheduled
chain.  This reordering is not propagated to the chain of unused idle
threads.  This could lead to use an idle thread for a sticky scheduler
node which is already in use.  This locks up the system in infinite
loops in the thread context switch procedure.

To fix this, the SMP scheduler implementations must now provide
callbacks to get and release an unused idle thread.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
3d6ebde1ac score: Add SMP scheduler make/clean sticky
This patch fixes the following broken behaviour:

  While a thread is scheduled on a helping scheduler, while it does not
  own a MrsP semaphore, if it obtains a MrsP semaphore, then no
  scheduler node using an idle thread and the ceiling priority of the
  semaphore is unblocked for the home scheduler.

This could lead to priority inversion issues and is not in line
with the MrsP protocol.

Introduce two new scheduler operations which are only enabled if
RTEMS_SMP is defined.  The operations are used to make the scheduler
node of the home scheduler sticky and to clean the sticky property.
This helps to keep the sticky handing out of the frequently used
priority update operation.

Close #4532.
2021-11-23 11:00:28 +01:00
Sebastian Huber
3781709f28 score: Add SMP scheduler idle exchange callback
Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
75527ef386 score: Optimize SMP EDF move to ready operation
If a node is moved from the scheduled chain to the ready queue, then we
know that it is the highest priority ready node.  So, it can be
prepended to the ready queue without doing any comparisons.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
9d3e821279 score: Rework affine ready queue handling
Rework the handling of the affine ready queue for the EDF SMP scheduler.
Do the queue handling in the node insert, move, and extract operations.
Remove the queue handling from _Scheduler_EDF_SMP_Allocate_processor().

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
a53229bbb6 score: Use extract from scheduled callbacks
Use the extract from scheduled callback provided by the scheduler
implementation in the SMP scheduler framework.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
757a10964f score: Remove return value from enqueue scheduled
The return value was unused.  Remove it.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
6286a40aa3 score: Scheduler insert after move
Insert nodes after moving the second node to reduce the items in the
data structure for the insert operation.  This also avoids having two
nodes for the same processor inserted into the scheduled chain.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
81659420b0 score: Add missing idle thread exchanges
Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
e787091764 score: Add missing idle thread releases
Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
bd55f69f5b score: Simplify _Scheduler_Exchange_idle_thread()
Remove superfluous idle parameter.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
f0f60a1ec3 score: Change _Scheduler_Try_to_schedule_node()
Add the victim node as parameter instead of the idle thread.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
7ae4f56929 score: Not set CPU in _Scheduler_Use_idle_thread()
Do not set the CPU of the idle thread in _Scheduler_Use_idle_thread().  This
helps to use _Scheduler_Try_to_schedule_node() under more general conditions in
the future, for example in case the owner and user of a node are not the same.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
45e942d1ae score: Rename _Scheduler_Set_idle_thread()
Rename _Scheduler_Set_idle_thread() in _Scheduler_Node_set_idle_user() and move
it to <rtems/score/schedulernodeimpl.h>.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
577262a737 score: Add red-black tree append/prepend
These functions are a faster alternative to _RBTree_Insert_inline() if
it is known that the new node is the maximum/minimum node.

Update #4531.
2021-11-23 11:00:28 +01:00
Sebastian Huber
3c0760414e score: Simplify _Scheduler_Generic_block()
If we block the executing thread and it is not the heir thread, then there is
no need to run the schedule operation.  The scheduler already selected a new
heir.
2021-11-23 11:00:28 +01:00
Kinsey Moore
1eb266bb0b cpukit: Consistize OAR copyright headers
These two OAR copyright headers are the only two in the codebase with
a format that differs from the typical OAR copyright header. This makes
all of the OAR copyright headers consistent.
2021-11-22 15:51:40 -06:00
Kinsey Moore
50cf19320d cpukit: Enable debug for SMP AArch64
Ensure when both RTEMS_DEBUG is specified and pointers are large that
enough space is allocated to accomodate the Per_CPU_Control structure.
This changes the calculation to be more compositional instead of trying
to list out every permutation of options possible.
2021-11-22 15:51:40 -06:00
Sebastian Huber
18484f02ad rtems: Add external functions
These external functions rtems_scheduler_get_processor() and
rtems_scheduler_get_processor_maximum() which may be used by bindings
for languages other than C/C++.
2021-11-18 20:06:17 +01:00
Sebastian Huber
9b6362da71 rtems: Use RTEMS_WHO_AM_I for rtems_task_ident() 2021-11-18 19:59:14 +01:00
Sebastian Huber
99fdfcdd87 rtems: Add signal header to implementation group 2021-11-17 20:10:05 +01:00
Sebastian Huber
c47daf6f68 config: Fix IO driver table initialization
Check all IO driver table configuration options which are used to initialize
_IO_Driver_address_table[].  Checks for the following settings were missing:

* CONFIGURE_BSP_PREREQUISITE_DRIVERS

* CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS

* CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER

* CONFIGURE_APPLICATION_EXTRA_DRIVERS

Update #3875.
2021-11-17 09:16:17 +01:00
Sebastian Huber
32cee88357 config: CONFIGURE_DISABLE_BSP_SETTINGS
Evaluate CONFIGURE_DISABLE_BSP_SETTINGS for each affected application
configuration option.  This makes the code easier to review since the influence
of CONFIGURE_DISABLE_BSP_SETTINGS is locally visible in the code.

Update #3875.
2021-11-17 09:16:17 +01:00
Sebastian Huber
c1395ca056 build: Add --rtems-version command line option
Update #4548.
2021-11-17 09:16:13 +01:00
Sebastian Huber
f06dd3e176 build: Optional __RTEMS_MAJOR__ via command line
Update #4548.
2021-11-16 07:46:45 +01:00
Sebastian Huber
a0650f5f32 build: Support command line specified options
Update #4548.
2021-11-16 07:46:16 +01:00
Sebastian Huber
9551f340d0 Revert "optvermaj.yml: Allow __RTEMS_MAJOR__ to be overridden so RTEMS 7 tools can be tested"
This reverts commit d1bbfbea5f.
2021-11-15 11:14:12 +01:00
Sebastian Huber
ccbcfb679d rtems: Add new clock manager directives
Update #4527.
2021-11-15 11:14:12 +01:00
Sebastian Huber
1b5db7926b rtems: Simplify rtems_semaphore_set_priority()
Do not write to the object referenced by old_priority in error paths.
This is in line with other directives.
2021-11-15 11:14:12 +01:00
Sebastian Huber
ee57a7f1a1 score: Fix _CORE_ceiling_mutex_Set_priority()
We have to use a second thread queue context to acquire and release the
thread wait lock.

Close #4356.
2021-11-15 09:53:17 +01:00
Sebastian Huber
16b50ac63c score: Always check if a prio ceiling is defined
Priority ceiling semaphores (in contrast to MrsP semaphores) have only
one priority ceiling which is defined for the home scheduler of the task
which created the semaphore.  Always check during a semaphore seize that
the home scheduler of the calling task is equal to this scheduler.

This avoids a scheduler mismatch if the semphore is acquired after the
calling thread blocked on the semaphore.
2021-11-15 09:53:17 +01:00
Sebastian Huber
7a591d0cd4 score: Fix thread pinning assertions 2021-11-15 09:53:17 +01:00
Sebastian Huber
ffb8833dd2 score: Add _Timecounter_Set_NTP_update_second()
Allow the installation of an NTP update second handler which may be used by an
NTP service.

Update #2348.
2021-11-15 08:56:54 +01:00
Sebastian Huber
b936ce5a8c score: Optimize timehand updates for non-SMP
In uniprocessor configurations, the timehand updates are done with
interrupts disabled.  So, it is impossible to observe a generation
number of zero.
2021-11-15 08:56:54 +01:00
Sebastian Huber
52c53a5914 score: Port large time delta support to RTEMS 2021-11-15 08:56:54 +01:00
Sebastian Huber
b88d9cb3e1 score: Initialize timehand generation to UINT_MAX
This leads to a timehand generation overflow right at the system start
and helps to get code coverage in test programs.
2021-11-15 08:56:54 +01:00
Mark Johnston
c3a68059d8 timecounter: Load the currently selected tc once in tc_windup()
Reported by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32729
2021-11-15 08:56:54 +01:00
Sebastian Huber
346755874b kern_tc.c: Scaling/large delta recalculation
This change is a slight performance optimization for systems with a slow
64-bit division.

The th->th_scale and th->th_large_delta values only depend on the
timecounter frequency and the th->th_adjustment. The timecounter
frequency of a timehand only changes when a new timecounter is activated
for the timehand. The th->th_adjustment is only changed by the NTP
second update. The NTP second update is not done for every call of
tc_windup().

Move the code block to recalculate the scaling factor and
the large delta of a timehand to the new helper function
recalculate_scaling_factor_and_large_delta().

Call recalculate_scaling_factor_and_large_delta() when a new timecounter
is activated and a NTP second update occurred.

MFC after:	1 week
2021-11-15 08:56:54 +01:00
Mark Johnston
ea389aaadd timecounter: Lock the timecounter list
Timecounter registration is dynamic, i.e., there is no requirement that
timecounters must be registered during single-threaded boot.  Loadable
drivers may in principle register timecounters (which can be switched to
automatically).  Timecounters cannot be unregistered, though this could
be implemented.

Registered timecounters belong to a global linked list.  Add a mutex to
synchronize insertions and the traversals done by (mpsafe) sysctl
handlers.  No functional change intended.

Reviewed by:	imp, kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32511
2021-11-15 08:56:54 +01:00
Mark Johnston
66d4077c98 timecounter: Let kern.timecounter.stepwarnings be set as a tunable
MFC after:	1 week
2021-11-15 08:56:54 +01:00
Ed Maste
d84e3b6ed7 Remove "All Rights Reserved" from
FreeBSD Foundation sys/ copyrights

These ones were unambiguous cases where the Foundation was the only
listed copyright holder (in the associated license block).

Sponsored by:	The FreeBSD Foundation
2021-11-15 08:56:54 +01:00
Warner Losh
87d7a6e54b kern: clarify boot time
In FreeBSD, the current time is computed from uptime + boottime. Uptime
is a continuous, smooth function that's monotonically increasing. To
effect changes to the current time, boottime is adjusted.  boottime is
mutable and shouldn't be cached against future need. Document the
current implementation, with the caveat that we may stop stepping
boottime on resume in the future and will step uptime instead (noted in
the commit message, but not in the code).

Sponsored by:		Netflix
Reviewed by:		phk, rpokala
Differential Revision:	https://reviews.freebsd.org/D30116
2021-11-15 08:56:54 +01:00
Konstantin Belousov
8d5fc57e65 Make kern.timecounter.hardware tunable
Noted and reviewed by:	kevans
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D29122
2021-11-15 08:56:54 +01:00
Konstantin Belousov
570e58e4fe Add ddb 'show timecounter' command.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-11-15 08:56:54 +01:00
Robert Watson
4b384f318c Changes that improve DTrace FBT reliability
on freebsd/arm64:

- Implement a dtrace_getnanouptime(), matching the existing
  dtrace_getnanotime(), to avoid DTrace calling out to a potentially
  instrumentable function.

  (These should probably both be under KDTRACE_HOOKS.  Also, it's not clear
  to me that they are correct implementations for the DTrace thread time
  functions they are used in .. fixes for another commit.)

- Don't allow FBT to instrument functions involved in EL1 exception handling
  that are involved in FBT trap processing: handle_el1h_sync() and
  do_el1h_sync().

- Don't allow FBT to instrument DDB and KDB functions, as that makes it
  rather harder to debug FBT problems.

Prior to these changes, use of FBT on FreeBSD/arm64 rapidly led to kernel
panics due to recursion in DTrace.

Reliable FBT on FreeBSD/arm64 is reliant on another change from @andrew to
have the aarch64 instrumentor more carefully check that instructions it
replaces are against the stack pointer, which can otherwise lead to memory
corruption.  That change remains under review.

MFC after:	2 weeks
Reviewed by:	andrew, kp, markj (earlier version), jrtc27 (earlier version)
Differential revision:	https://reviews.freebsd.org/D27766
2021-11-15 08:56:54 +01:00
Konstantin Belousov
18e6686d10 Remove double-calls to tc_get_timecount()
to warm timecounters.

It seems that second call does not add any useful state change for all
implemented timecounters.

Discussed with:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2021-11-15 08:56:54 +01:00
Pawel Biernacki
df77572247 Mark more nodes as CTLFLAG_MPSAFE
or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE.  All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by:	kib (mentor, blanket)
Commented by:	kib, gallatin, melifaro
Differential Revision:	https://reviews.freebsd.org/D23718
2021-11-15 08:56:54 +01:00
Konstantin Belousov
9fcf785d81 Consolidate read code for timecounters
and fix possible overflow in bintime()/binuptime().

The algorithm to read the consistent snapshot of current timehand is
repeated in each accessor, including the details proper rollup
detection and synchronization with the writer.  In fact there are only
two different kind of readers: one for bintime()/binuptime() which has
to do the in-place calculation, and another kind which fetches some
member from struct timehand.

Extract the logic into type-checked macros, GETTHBINTIME() for bintime
calculation, and GETTHMEMBER() for safe read of a structure' member.
This way, the synchronization is only written in bintime_off() and
getthmember().

In bintime_off(), use overflow-safe calculation of th_scale *
delta(timecounter).  In tc_windup, pre-calculate the min delta value
which overflows and require slow algorithm, into the new timehands
th_large_delta member.

This part with overflow fix was written by Bruce Evans.

Reported by:	Mark Millard <marklmi@yahoo.com> (the overflow issue)
Tested by:	pho
Discussed with:	emaste
Sponsored by:	The FreeBSD Foundation (kib)
MFC after:	3 weeks
2021-11-15 08:56:54 +01:00
Mateusz Guzik
ae5b0b29cf Remove duplicated empty lines from kern/*.c
No functional changes.
2021-11-15 08:56:54 +01:00
Konstantin Belousov
b825e213c3 Initialize timehands linkage much earlier.
Reported and tested by:	trasz
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-15 08:56:53 +01:00
Konstantin Belousov
71b71d6ad2 Make timehands count selectable at boottime.
Tested by:	O'Connor, Daniel <darius@dons.net.au>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D21563

This patch was modified by Sebastian Huber
<sebastian.huber@embedded-brains.de> to adjust it for RTEMS.  See
comment in the patch.
2021-11-15 08:56:53 +01:00
Olivier Houchard
045ed584fe Instead of using an incomplete list of platforms
that uses 64bits time_t in 32bits mode, special case amd64, as i386 is
the only arch that still uses 32bits time_t.
2021-11-15 08:56:53 +01:00
Andrew Turner
468568ff18 Create a new macro for static DPCPU data.
On arm64 (and possible other architectures) we are unable to use static
DPCPU data in kernel modules. This is because the compiler will generate
PC-relative accesses, however the runtime-linker expects to be able to
relocate these.

In preparation to fix this create two macros depending on if the data is
global or static.

Reviewed by:	bz, emaste, markj
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D16140
2021-11-15 08:56:53 +01:00
Mateusz Guzik
6a2363f7b7 tc: bcopy -> memcpy 2021-11-15 08:56:53 +01:00
Brooks Davis
4d6837da2d Move most of the contents of opt_compat.h
to opt_global.h.

opt_compat.h is mentioned in nearly 180 files. In-progress network
driver compabibility improvements may add over 100 more so this is
closer to "just about everywhere" than "only some files" per the
guidance in sys/conf/options.

Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of
sys/compat/linux/*.c.  A fake _COMPAT_LINUX option ensure opt_compat.h
is created on all architectures.

Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the
set of compiled files.

Reviewed by:	kib, cem, jhb, jtl
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14941
2021-11-15 08:56:53 +01:00
Sebastian Huber
c830bc643a score: Remove FreeBSD identifier 2021-11-15 08:56:53 +01:00
Konstantin Belousov
118208b1f1 Use atomic_load(9) to read ppsinfo sequence numbers.
In this case volatile qualifiers enusre that a compiler does not
optimize the accesses out.

Reviewed by:	alc, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D13534
2021-11-15 08:56:53 +01:00
Pedro F. Giffuni
bd0fdf4e50 SPDX: use the Beerware identifier. 2021-11-15 08:56:53 +01:00
Sebastian Huber
69aaf58745 libtest: Improve the interrupt test timing
If no state change occurred during the test action, then assume a late
interrupt.
2021-11-15 08:56:53 +01:00
Sebastian Huber
240a1f79b1 score: Introduce CPU budget operations
This patch set replaces the CPU budget algorithm enumeration with a set of CPU
budget operations which implement a particular CPU budget algorithm.  This
helps to hide the CPU budget algorithm implementation details from the general
thread handling.  The CPU budget callouts are turned into CPU budget
operations.  This slightly reduces the size of the thread control block.

All schedulers used the default scheduler tick implementation.  The tick
scheduler operation is removed and the CPU budget operations are directly used
in _Watchdog_Tick() if the executing thread uses a CPU budget algorithm.  This
is performance improvement for all threads which do not use a CPU budget
algorithm (default behaviour).
2021-11-15 08:56:53 +01:00
Sebastian Huber
6cef3f16b6 score: Do not shadow parameter 2021-11-15 08:56:53 +01:00
Joel Sherrill
d1bbfbea5f optvermaj.yml: Allow __RTEMS_MAJOR__ to be overridden so RTEMS 7 tools can be tested 2021-11-12 10:02:51 -06:00
Kinsey Moore
ef207e9ed5 bsps/aarch64: Restore interrupt nesting
Fixing the debug mask flag broke nested interrupts. This restores that
functionality.
2021-11-10 10:51:40 -06:00
zack leung
19c101281a libtests/calloc.c: Fix reported memory leak
This fix came from Code Inspector, flagged by one of the analysis that
was done.

This test code is compiled only but better to address the issues so
future static analysis reports will not include it.
2021-11-03 08:39:12 -05:00
Kinsey Moore
a857a225d0 cpukit/aarch64: Add libdebugger support
This adds support for libdebugger under AArch64 using software
breakpoints and the single-step execution mode present in all AArch64
CPUs.
2021-11-01 08:39:00 -05:00
Kinsey Moore
750bde8c78 bsps/aarch64: Mask debug events from startup
Debug events should be masked at least until after the first context
switch and should usually be masked until a debugger is attached for
application debugging.
2021-11-01 08:39:00 -05:00
Kinsey Moore
2d27725838 bsps/aarch64: Set interrupt level correctly
The existing code is functional but inccorrect and blindly modifies the
other masking bits. It is important to preserve those other bits since
they control masking of important system events.
2021-11-01 08:39:00 -05:00
Kinsey Moore
55a93ae3b4 bsps/aarch64: Add missing MMU map recursion check
Certain input parameters for MMU mapping operations could cause an
infinite recursion if block end boundaries didn't align to 4k. This
ensures that recursion descent does not exceed 2 levels and instead
rounds up to the nearest 4k block if necessary.
2021-11-01 08:39:00 -05:00
Kinsey Moore
2055e42362 aarch64: Break out MMU definitions
This moves the AArch64 MMU memory type definitions into cpukit for use
by libdebugger since remapping of memory is required to insert software
breakpoints.
2021-11-01 08:39:00 -05:00
Kinsey Moore
37684cfdc9 cpukit/aarch64: Use correct debug register names
The N used in the breakpoint and watchpoint register names is intended
to be an integer between 0 and 15 (inclusive) and will not compile when
used as is. This adds the accessors necessary to access all of these
breakpoint and watchpoint registers.
2021-11-01 08:38:59 -05:00
Kinsey Moore
102261043a cpukit/libdebugger: Use uintptr_t for pointers
Use uintptr_t instead of DB_UINT when the variable in question describes
a pointer.
2021-11-01 08:38:59 -05:00
Kinsey Moore
a678d1a99c cpukit: Compare the function result
Compare the function result instead of the function pointer for non-SMP
builds.
2021-11-01 08:38:59 -05:00
Kinsey Moore
c5986a5520 testsuite: Add machine exception signal map test
Add a test to verify that mapping of machine exceptions to POSIX signals
operates properly when the application requests it.
2021-10-29 12:40:56 -05:00
Kinsey Moore
4812a8b572 cpukit: Add signal mapping support
This adds a confdef option allowing an application to request mapping
machine exceptions to POSIX signals. This is required for some languages
such as Ada.
2021-10-29 12:40:56 -05:00
Kinsey Moore
3fc641abca testsuite: Add machine exception resume test
Add a test to verify that intercepted exceptions can be resolved and
execution can be resumed.
2021-10-29 12:40:56 -05:00
Kinsey Moore
02377c8b8f cpukit/aarch64: Add exception extensions support
This adds the function implementations necessary to add exception
extensions support to AArch64.
2021-10-29 12:40:56 -05:00
Kinsey Moore
db9e88510d cpukit: Add exception extensions
This adds the set of functions necessary to allow more generic handling
of machine exceptions. This initial patch offers the ability to
manipulate a CPU_Exception_frame and resume execution using that
exception information with or without thread dispatch. These functions
are gated behind the RTEMS_EXCEPTION_EXTENSIONS configuration option.
2021-10-29 12:40:56 -05:00
Stephen Clark
9b088157ed rtems-debugger: Fixed pointer types to work on 32 and 64 bit architectures
Using 32bit types like uint32_t for pointers creates issues on 64 bit
architectures like AArch64. Replaced occurrences of these with
uintptr_t, which will work for both 32 and 64 bit architectures. Added
hex_decode_addr function to rtems-debugger.
2021-10-27 13:25:30 -05:00
Sebastian Huber
75c133bda0 sptests/sp69: Remove test case
This error condition no longer exists.

Update #4528.
2021-10-25 18:04:28 +02:00
Sebastian Huber
6c3976e2fe score: Move code block to separate function
Move a code block to the new function _Thread_Scheduler_withdraw_nodes()
to ease code review.
2021-10-25 09:24:52 +02:00
Sebastian Huber
940b9b1881 score: Do not shadow lock_context local variable 2021-10-25 09:24:51 +02:00
Sebastian Huber
24922d0f54 rtems: rtems_rate_monotonic_get_status()
Mention that resetting the processor usage time of tasks has no impact
on the period status and statistics.

Remove no longer relevant RTEMS_NOT_DEFINED error status.

Update #4528.
2021-10-25 08:16:09 +02:00
Sebastian Huber
f1723d1293 rtems: Regenerate for IDLE task allocator option
Update #4524.
2021-10-25 08:02:45 +02:00
Sebastian Huber
28632b558c score: Fix typo 2021-10-25 08:01:02 +02:00
Sebastian Huber
0221da5f56 rtems: Fix rate monotonic statistics
The rate monotonic period statistics were affected by
rtems_cpu_usage_reset().  The logic to detect and work around a CPU
usage reset was broken.

The Thread_Contol::cpu_time_used is changed to contain the processor
time used throughout the entire lifetime of the thread.  The new member
Thread_Contol::cpu_time_used_at_last_reset is added to contain the
processor time used at the time of the last reset through
rtems_cpu_usage_reset().  This decouples the resets of the CPU usage and
the rate monotonic period statistics.

Update #4528.
2021-10-25 08:01:02 +02:00
Sebastian Huber
9be97a34db score: Optimize default idle task stack allocator
Update #4524.
2021-10-25 08:01:02 +02:00
Sebastian Huber
a4112bd8af score: Simplify _Watchdog_Next_first() 2021-10-25 08:01:02 +02:00
Chris Johns
3f0ad2b3b7 spec/libdebugger: Only enable for supported architectures
Closes #4533
2021-10-22 10:34:24 +11:00
Kinsey Moore
087e4ec973 spec/aarch64: Enable previously unbuildable tests
The spconfig01 and spmisc01 tests were disabled for all AArch64 BSPs due
to a toolchain issue preventing them from compiling correctly. The
binutils version that contains the fix has been released and integrated
into RSB such that these two tests now build and operate correctly.
2021-10-20 09:32:12 -05:00
Alex White
d03776e804 microblaze: Rework for RTEMS 6
This reworks the existing MicroBlaze architecture port and BSP to
achieve basic functionality using the latest RTEMS APIs.
2021-10-13 14:45:37 -05:00
Hesham ALMatary
0f62af0ef8 bsps: Add MicroBlaze FPGA BSP 2021-10-13 14:45:37 -05:00
Joel Sherrill
edf8b49ee5 score: Add MicroBlaze port 2021-10-13 14:45:37 -05:00
Joel Sherrill
822ebb4cae Add support for IDLE Thread stack allocator
Add a stack allocator hook specifically for allocation of IDLE thread stacks.
This allows the user to decide if IDLE thread stacks are statically allocated
or handled by the same custom allocator mechanism as other thread stacks.

Closes #4524.
2021-10-11 08:42:25 -05:00
Sebastian Huber
d61fbeda59 score: _Thread_queue_Surrender_priority_ceiling()
Do not use a direct thread dispatch in
_Thread_queue_Surrender_priority_ceiling() since it may be used in condition
variables using POSIX mutexes.

Close #4526.
2021-10-11 13:22:12 +02:00
Joel Sherrill
f6385b4edc libdl/rtl-mdreloc-h8300.c: Remove remnant of h8300 port
Updates #2452.
2021-10-08 10:44:44 -05:00
Sebastian Huber
3bb97a30b1 score: Always check queue in _Thread_Wait_cancel()
Commit 18c8a270c2 removed
_Thread_queue_Do_nothing_extract() so we have to check for a non-NULL
queue in all configurations.
2021-10-06 10:41:14 +02:00
Christian Mauderer
1fc3f17127 bsp/imx: Add cs_change support to SPI 2021-10-06 10:24:03 +02:00
Sebastian Huber
38c2147759 rtems: Set postponed jobs in rate-monotonic cancel
Set the postponed jobs count to zero in rtems_rate_monotonic_cancel() so that
rtems_rate_monotonic_get_status() returns a consistent status for inactive
periods.

Update #4511.
2021-10-06 08:46:21 +02:00
Sebastian Huber
226d0e9218 score: Optimize EDF SMP scheduler ops
The schedule operation is only called by rtems_task_mode().  It is
called if preempt mode of the executing thread changes from disabled to
enabled.  Since the EDF SMP scheduler does not support the disabled
preemption mode, the schedule operation is never called.
2021-10-06 08:37:50 +02:00
Sebastian Huber
344bb536a4 rtems: Generate <rtems/cpuuse.h>
Write the documentation from scratch.
2021-10-06 08:37:50 +02:00
Sebastian Huber
e9063644ae posix: Remove "RTEMS" from POSIX API group
Clarify group description.

Update #3706.
2021-10-06 08:37:50 +02:00
Sebastian Huber
8b762a88c1 scoe: Move workspace group definition
Define the group in the header file which is used by <rtems/confdefs.h>.

Update #3706.
2021-10-06 08:37:50 +02:00
Sebastian Huber
5a6f94da45 rtems: Add ASR implementation to existing group
Update #3706.
2021-10-06 08:37:50 +02:00
Sebastian Huber
a950c1355b score: Add Hash Handler to group
Update #3706.
2021-10-06 08:37:49 +02:00
Sebastian Huber
4c0b006fc0 rtems: Canonicalize Doxygen in <rtems/counter.h>
Update #3706.
2021-10-06 08:37:49 +02:00
Sebastian Huber
dba2e690bb rtems: Canonicalize Doxygen in <rtems/seterr.h>
Update #3706.
2021-10-06 08:37:49 +02:00
Zacchaeus Leung
4a5a41459a improve the format error reporting on i386 2021-10-04 17:33:18 -05:00
Alex White
772ffc0704 testsuites/fstests: Fix uninitialized utimbuf structs
The utimbuf structs in fsimfsconfig01 and fsimfsconfig02 were
being passed to utime uninitialized. This did not cause problems until
utime was changed to use utimensat behind the scenes. Now that
utimensat is called, the values of the utimbuf struct are checked, and
EINVAL is set for invalid values. The utimebuf structs in these tests
could contain invalid values since they are uninitialized.

By zero-initializing the utimbuf structs, we ensure that they pass the
checks in utimensat and that errno is set to the expected ENOTSUP.
2021-10-04 17:18:13 -05:00
Kinsey Moore
9c2cb68481 cpukit/aarch64: Use correct interrupt level types
All other architectures use uint32_t for interrupt levels and there is
no reason not to do so on AArch64.
2021-10-01 14:03:26 -05:00
Kinsey Moore
ccd1c5e560 cpukit/aarch64: Use correct context register sets
Context validation for AArch64 was ported from the ARM implementation
without a reinterpretation of the actual requirements. The spcontext01
test just happened to pass because the set of scratch registers in ARM
is a subset of the scratch registers in AArch64.
2021-10-01 12:52:41 -05:00
Sebastian Huber
61ef22bbeb score: Add Thread_queue_Deadlock_status
Replace the boolen return value with the new enum
Thread_queue_Deadlock_status.  This improves the code readability.
Improve documentation.  Shorten function names.
2021-10-01 13:19:38 +02:00
Sebastian Huber
82e2216713 score: Avoid dead code in thread queue surrender
For uniprocessor configurations, this patch removes dead code in the
_Thread_queue_Surrender() and _Thread_queue_Surrender_priority_ceiling()
functions.

Dead code is removed from _Thread_queue_Surrender_sticky().
2021-10-01 13:18:16 +02:00
Sebastian Huber
18c8a270c2 score: Remove _Thread_queue_Do_nothing_extract()
This function was unused.  It was a relict of the thread queue rework done
during the SMP support development.  In an early stage, the extract operation
was called with a NULL thread queue.  However, this is no longer the case.  The
extract operation is only called if we have a non-NULL thread queue.
2021-09-30 13:48:31 +02:00
Sebastian Huber
25f126e1c9 score: Regenerate <rtems/score/basedefs.h>
Reflect renamed specification item.
2021-09-30 07:31:58 +02:00
Sebastian Huber
99d5373b83 score: Add Doxygen group for <sys/lock.h> mutexes 2021-09-30 07:31:58 +02:00
Sebastian Huber
dde74af944 rtems: Adjust parameter names
Adjust parameter names to match with the declaration.  This avoid using
a name reserved by the C standard: "time".

Close #4035.
2021-09-30 07:29:57 +02:00
Sebastian Huber
abda5595f8 rtems: Justify integer conversions
Close #2548.
2021-09-30 07:29:57 +02:00
Sebastian Huber
3fe07115a0 score: Improve variable names in thread init 2021-09-22 18:31:46 +02:00
Sebastian Huber
c2f2404840 score: Simplify _Thread_Try_initialize()
Move a code block to its own new function
_Thread_Initialize_scheduler_and_wait_nodes().  Add comments.
2021-09-22 18:31:46 +02:00
Kinsey Moore
5f652cb27e cpukit: Add AArch64 SMP Support
This adds SMP support for AArch64 in cpukit and for the ZynqMP BSPs.
2021-09-21 08:58:32 -05:00
Kinsey Moore
670a5089e2 bsps/gicv2: Allow BSPs to define IRQ attributes
ARM's GICv2 is configurable and its attributes vary between
implementations including omission of specific interrupts. This allows
BSPs to accomodate those varying implementations with customized
attribute sets.
2021-09-21 08:58:32 -05:00
Kinsey Moore
5ffc01fb97 bsps/zynqmp: Use correct number of interrupts
GICv2 can support up to 1024 interrupts, but ZynqMP hardware is only
configured for 192 interrupts.
2021-09-21 08:58:31 -05:00
Kinsey Moore
e3971de417 testsuites/smpmulticast01: Enforce step ordering
The order in which step checks for 1 and 2 are not rigidly defined and
may actually occur in either order depending on how the threads execute.
This waits for the job to complete to enforce the existing ordering.
2021-09-21 08:58:31 -05:00
Kinsey Moore
3647725832 bsps/shared: Add PSCI SMP startup support
This adds the SMP function that supports spinup of additional CPU cores
using the ARM standard PSCI inteface. This interface is provided by QEMU
as well as ARM Trusted Firmware running in monitor mode (EL3) on ARMv7 and
AArch64 CPUs. This supports activation va SMC or HVC instructions
depending on BSP configuration.
2021-09-21 08:58:31 -05:00
Sebastian Huber
db8f598d56 build: Remove old build system
Close #3250.
Close #4081.
2021-09-21 07:39:09 +02:00
Sebastian Huber
04998451b9 arm/lpc24xx: Use common test definition file 2021-09-21 07:39:09 +02:00
Sebastian Huber
a6636d9957 libtest: Improve T_now_tick()
The T_now_tick() is a fall back time measurement using the CPU counter
in case no Clock Driver is configured.  Some CPU counter may overflow
during the test execution.  Accumulate the elapsed time to reduce the
chance of CPU counter overflows.
2021-09-21 07:39:09 +02:00
Sebastian Huber
cd198a5511 score: Remove unused default scheduler ops
If SMP support is enabled and the system has exactly one processor, then
it may use an uniprocessor scheduler.  The ask for help, reconsider help
request, and withdraw node operations can be NULL in this case, since
they are only used if a thread has at least one helping scheduler node.
At least two schedulers are required to get a helping node and each
scheduler involved must own at least one processor.  This is not
possible on a system with exactly one processor.
2021-09-21 07:39:09 +02:00
Sebastian Huber
3291b2a7d5 score: Ensure only one CPU if required
Issue the new fatal SMP error
SMP_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR if the system starts
with not exactly one processor and an uniprocessor scheduler is
configured.
2021-09-21 07:39:09 +02:00
Sebastian Huber
0036ddf1f6 score: Provide two thread pin/unpin defaults
The uniprocessor schedulers do not support systems with more than more
processors.  So they rivially support thread pinning and thus the
SMP_FATAL_SCHEDULER_PIN_OR_UNPIN_NOT_SUPPORTED cannot happen.

Add a second default implementation for SMP schedulers which do not
support thread pinning.

Change license to BSD-2-Clause according to file history and re-licensing
agreement.

Update #3053.
2021-09-21 07:39:09 +02:00
Sebastian Huber
59537c9648 score: SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY
Rename SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY in
SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION.  Add Doxygen comment.
2021-09-21 07:39:09 +02:00
Sebastian Huber
92b9f656e1 score: SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP
Rename SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP in
SCHEDULER_DEFAULT_SMP_OPERATIONS.  Add a Doxygen comment.
2021-09-21 07:39:08 +02:00
Ryan Long
3951d4da6f pxcdevctl: Adjust for standard
psxdevctl is supposed to return the value in errno. Before, it was
returning -1 and setting errno. Changed the tests to reflect these
changes. Added code from RRADE's posix_devctl.c.

Closes #4506
2021-09-20 13:31:25 -05:00
Chris Johns
9e30a716a3 powerpc/motorola_powerpc: Map LibBSD bus space to the PCI base address 2021-09-19 10:08:25 +10:00
Sebastian Huber
dbb7c956e6 rtems: Fix message manager documentation
Correct the description of the ``count`` parameter of
rtems_message_queue_flush().

Update #4508.
2021-09-16 09:36:00 +02:00
Chris Johns
691d0edd34 arm/xilinx: Fix zynq-uart interrupt receive
- Trigger on a single character entering the RX FIFO

- Disable the RX timeout

- Send up to a FIFO full of data
2021-09-16 11:11:13 +10:00
Alex White
0490be70ee testsuites: Wrap putchar
The linker flag to wrap putchar was lost in translation from make to waf.
2021-09-16 11:11:13 +10:00
Sebastian Huber
1567d9279b rtems: Add header files to Doxygen groups 2021-09-15 13:56:42 +02:00
Sebastian Huber
79efc81a71 rtems: Move Doxygen group definition
Move the definition of the top-level Classic API implementation group to
an implementation header file.
2021-09-15 13:39:23 +02:00
Sebastian Huber
a45bc321c2 rtems: Improve Classic API group description 2021-09-15 07:50:43 +02:00
Sebastian Huber
fe818cd4b9 rtems: Fix message manager documentation
Remove bogus return status from rtems_message_queue_receive().  Clarify
rtems_message_queue_flush().

Update #4508.
2021-09-15 07:50:43 +02:00
Sebastian Huber
466cd91744 rtems: Generate <rtems/extension.h>
Remove the duplicated description which is an out dated copy and paste
from the Classic API Guide.  Instead, thoroughly document the individual
extensions.

Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-09-15 07:50:43 +02:00
Sebastian Huber
606c9a642a rtems: Generate <rtems/rtems/cache.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
Update #4513.
2021-09-15 07:50:29 +02:00
Sebastian Huber
c274009d2e build: Remove invalid attributes 2021-09-14 14:39:20 +02:00
Sebastian Huber
af722b76d2 bsps/arm: Fix ABI flags for Cortex-M4
Close #4504.
2021-09-14 07:31:28 +02:00
Stephen Clark
7792ab88ca bsps/zynqmp: Added I2C support for ZynqMP
Added I2C drivers for ZynqMP and updated build system accordingly.
2021-09-09 14:19:57 -05:00
Stephen Clark
73c182a5ed bsps/zynq: Moved general i2c files to shared directories
Certain files related to the Zynq BSP's I2C driver are useable by the ZynqMP BSP as well.
Moved these files to shared directory in anticipation of I2C support for ZynqMP.
2021-09-09 14:19:57 -05:00
Sebastian Huber
82a61afd8c rtems: Initialize count of postponed jobs
The rtems_rate_monotonic_get_status() directive returns an arbitrary
number for the count of postponed jobs if it is called for a newly
created period object.  Set the count of postponed jobs to zero during
object creation.

Close #4511.
2021-09-09 15:05:51 +02:00
Sebastian Huber
c0435b5eb2 rtems: Document time of day constraints
Update #4338.
2021-09-06 12:41:02 +02:00
Sebastian Huber
f958d58a6a score: Split up rbtreenext.c
Split up rbtreenext.c since only _RBTree_Minimum() is used by the operating
system core services (thread queues and the EDF scheduler).

Change license to BSD-2-Clause according to file history and re-licensing
agreement.

Update #3053.
2021-09-06 12:24:06 +02:00
Sebastian Huber
ad41c17933 score: Change TOD_LATEST_YEAR to 2099
This simplifies the implementation a bit.  Declare _TOD_Days_to_date[] in
<rtems/score/todimpl.h>.  Make _TOD_Days_per_month[] and
_TOD_Days_since_last_leap_year[] static.

Update #4338.
2021-09-06 12:24:04 +02:00
Sebastian Huber
ff3df9f32f score: Simplify _TOD_Validate()
Split up the multi line if statement into smaller parts.
2021-09-06 12:22:44 +02:00
Sebastian Huber
6d2becb78d score: Limit the CLOCK_REALTIME setting
Limit the CLOCK_REALTIME setting to ensure that the CLOCK_REALTIME is defined
for a system uptime of at least 114 years.
2021-09-06 12:22:44 +02:00
Sebastian Huber
54b4b1f85a score: Add _TOD_Is_valid_new_time_of_day()
Move the TOD validation to the callers of _TOD_Set().  This avoids dead code in
case only rtems_clock_set() is used in an application because rtems_clock_set()
always calls _TOD_Set() with a valid time of day.
2021-09-06 12:22:44 +02:00
Sebastian Huber
c8e4de991d score: Remove TOD_TICKS_PER_SECOND_method()
Use _Watchdog_Ticks_per_second instead.
2021-09-06 12:22:44 +02:00
Sebastian Huber
8abd175669 score: Return status in _TOD_Adjust() 2021-09-06 12:22:44 +02:00
Sebastian Huber
fbd0a3cec3 score: Move _Thread_Dispatch()
The _Thread_Dispatch() function was customized over time and now the
work is done by _Thread_Do_dispatch() and specialized wrappers.  The
plain _Thread_Dispatch() is now only used in some CPU ports.  Move it to
a separate file to avoid dead code in the general.

Change license to BSD-2-Clause according to file history and
re-licensing agreement.

Update #3053.
2021-09-03 17:14:19 +02:00
Sebastian Huber
2647e76e8f score: Document thread queue operations 2021-09-03 08:21:14 +02:00
Sebastian Huber
01d22f7f79 bsps/leon3: Rename fatal error code
Rename LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR in
LEON3_FATAL_INVALID_CACHE_CONFIG_BOOT_PROCESSOR since the term
"boot processor" is used elsewhere in the code base.
2021-09-02 09:22:38 +02:00
Sebastian Huber
b2c626f016 Improve test of rtems_interrupt_get_affinity()
Use a CPU set which is larger than the internal processor set
representation.
2021-09-02 08:54:58 +02:00
Sebastian Huber
a93d0ce2f5 validation: Improve generated test code
Move the transition map members of the test context to a dedicated
structure.  Move the transition variant pre-condition prepare, action,
and post-condition checks to a separate function to reduce the
indentation level and allow skipping of transition variants.
2021-09-02 08:54:58 +02:00
Sebastian Huber
34099baa9c libtest: Return fixture context in T_case_begin()
This makes it similar to T_push_fixture().
2021-09-02 08:54:58 +02:00
Christian Mauderer
e495633887 bsps/imxrt: Improve SPI driver
It wasn't possible to keep the CS line low between multiple message
descriptors in one transfer. This patch reworks the driver so that it is
possible.

Update #4180
2021-09-02 08:38:54 +02:00
Sebastian Huber
25b0fddad9 score: Update priority only if necessary
In _Thread_queue_Flush_critical(), update the priority of the thread
queue owner only if necessary.  The scheduler update priority operation
could be expensive.
2021-09-01 21:23:16 +02:00
Sebastian Huber
ac9f115bdb score: Remove _Thread_queue_Unblock_critical()
This function was only used in one place.  Replace it with a call to
_Thread_queue_Resume().
2021-09-01 21:23:16 +02:00
Sebastian Huber
317774c99a score: Remove _Thread_queue_First_locked()
The _Thread_queue_First_locked() was only used in one place.  Move the code of
this inline function to this place.
2021-09-01 21:23:16 +02:00
Sebastian Huber
d9249c9bff score: Fix blocking message queue receive
In order to ensure FIFO fairness across schedulers, the thread queue
surrender operation must be used to dequeue a thread from the thread
queue.  The thread queue extract operation is intended for timeouts.

Add _Thread_queue_Resume() which may be used to make extracted or
surrendered threads ready again.

Remove the now unused _Thread_queue_Extract_critical() function.

Close #4509.
2021-09-01 20:24:57 +02:00
Sebastian Huber
9c0591f12d score: Fix priority discipline handling
The priority queues in clustered scheduling configurations use a per
scheduler priority queue rotation to ensure FIFO fairness across
schedulers.  This mechanism is implemented in the thread queue surrender
operation.  Unfortunately some semaphore and message queue directives
used wrongly the thread queue extract operation.  Fix this through the
use of _Thread_queue_Surrender().

Update #4358.
2021-09-01 20:24:57 +02:00
Sebastian Huber
ce8f31ced5 score: Document Futex Handler
The behaviour of the futex operations is defined by Linux:

https://man7.org/linux/man-pages/man2/futex.2.html

Use EAGIN instead of EWOULDBLOCK to be in line with the Linux man page.
These error numbers have the same value in Newlib.  Using the same error
numbers helps to avoid confusion.

When you look at the history of the Linux man page you see that they
replaced EWOULDBLOCK with EAGAIN over time.  At the time of the RTEMS
futex implementation they used EWOULDBLOCK.
2021-09-01 14:14:32 +02:00
Sebastian Huber
a8235fe728 rtems: Fix partitions with RTEMS_MULIPROCESSING
Replace call to removed _Partition_Free() with a call to _Objects_Free().
2021-08-31 13:13:15 +02:00
Sebastian Huber
b0f13f3778 psxtests/psxconfstr: Fix test case
Update #3373.
2021-08-30 19:32:18 +02:00
Sebastian Huber
30570b49c5 smpfatal01: Fix test time out on sparc/leon3
End the test on the processor which triggers the test condition.  This avoids
endless power down loops in the sparc/leon3 BSP.
2021-08-30 18:27:48 +02:00
Chris Johns
8f3973fe8d libmisc/shell: Check the shell command pointers when adding a command 2021-08-21 12:49:36 +10:00
Chris Johns
4dc81f65c7 libmisc/fdt: fix node initialise error with RTEMS_DEBUG 2021-08-21 12:46:32 +10:00
Chris Johns
522db76a96 cpukit/mghttpd: Support all descriptors in select
- Support all possible descriptors in a select call. Borrowed
  from Christain and his mDNS change in LibBSD

- If select (or poll) fails pause for a bit rather than
  locking up in a hard loop
2021-08-19 08:51:39 +10:00
Chris Johns
de14073960 aarch64/versal: Enable TX and RX FIFOs
- Wait for the tx holding register to empty in a tx flush
2021-08-19 08:47:30 +10:00
pranav
1c06068196 bsps/raspberrypi: Add SEV Instruction for RPi SMP firmware changes.
The Pi firmware added a wfe(wait for event), the cores 1-3 wait
for the start address being written to the mailbox register, followed
by a SEV poke to the mailbox that acts as a wfe wake-up event.
2021-08-18 13:50:34 -05:00
Eshan dhawan
574cd83b5d confstr() support for RTEMS
Closes #3373

confstr() style update

Signed-off-by: Eshan Dhawan <eshandhawan51@gmail.com>
2021-08-18 09:18:56 -05:00
Sebastian Huber
1dff0a382d score: Delete unused rtems_ada_self 2021-08-18 13:36:02 +02:00
Sebastian Huber
d433690591 score: Make zombie registry observable
This helps to write tests for _Thread_Wait_for_execution_stop().

Rename Thread_Zombie_control in Thread_Zombie_registry.
2021-08-18 13:36:02 +02:00
Sebastian Huber
923a922e01 score: Simplify _Thread_Kill_zombies() 2021-08-18 13:36:02 +02:00
Sebastian Huber
2f45324bb8 score: Simplify _Per_CPU_Wait_for_job()
The _SMP_Fatal() is a no-return function, so the "break" statement is
superfluous.
2021-08-18 13:36:02 +02:00
Sebastian Huber
7e85f4d6ca score: Simplify _Thread_Create_idle_for_CPU()
Online processors have a scheduler assigned.
2021-08-18 13:36:02 +02:00
Sebastian Huber
ebdfa24bff build: Merge default-by-family into by-variant
Prefix the BSP family name with "bsps/" to make it distinct to the BSP
variant names.

Update #4468.
2021-08-18 11:25:35 +02:00
Sebastian Huber
75af5be6a8 bsp/leon3: Fix rtems_interrupt_is_pending()
Take the interrupt force register into account in all configurations.

Update #3269.
2021-08-12 21:06:39 +02:00
Sebastian Huber
0a69ce0fb4 score: Simplify _Scheduler_Tick()
The NULL pointer check for the executing thread was introduced by
commit:

commit be3c257286
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Thu Jun 5 11:17:26 2014 +0200

    score: Avoid NULL pointer access

    Check that the executing thread is not NULL in _Scheduler_Tick().  It
    may be NULL in case the processor has an optional scheduler assigned and
    the system was not able to start the processor.

However, it is no longer necessary since now the clock interrupt is
distributed to the online processors.
2021-08-12 21:00:05 +02:00
Sebastian Huber
a0ec14ca22 score: Replace the single use of a sequence lock
In SMP configurations, on 64-bit architectures use plain atomic
operations to set/get the priority value of a scheduler node.  On 32-bit
architectures use an ISR lock.  Using a sequence lock has no real
benefit since it uses atomic read-modify-write operations for both the
read and the write lock.  Simply use a ticket lock instead so that only
one SMP synchronization primitive is used for everything.
2021-08-12 21:00:05 +02:00
Sebastian Huber
a5aaf20a2d score: Replace priority prepend it with an enum
Use the new Priority_Group_order enum instead of a boolean to indicated if a
priority should be inserted as the first or last node into its priority group.
This makes the code more expressive.  It is also a bit more efficient since a
branch in _Scheduler_Node_set_priority() is avoided and a simple bitwise or
operation can be used.
2021-08-12 20:58:26 +02:00
Sebastian Huber
9399e12c21 rtems: Fix rtems_partition_return_buffer()
The rtems_partition_return_buffer() wrongly accepted which were exactly
at the buffer area end.  Use the buffer area limit address for the range
checking.

Close #4490.
2021-08-12 10:09:04 +02:00
Sebastian Huber
59472042ec bsps/arm: More robust SMP start
Do not continue execution on processors which are not configured to prevent the
use of arbitrary memory for the initialization stack.
2021-08-12 10:04:11 +02:00
Zacchaeus Leung
8df57649b0 Test needed for timer_create with CLOCK_MONOTONC
the timer_create() method can use CLOCK_MONOTONIC
but there was  no test for this.
Also it implements the functionality to
create a CLOCK_MONOTONIC timer and gettime() .
Closes #3888
2021-08-11 11:47:11 -05:00
pranav
c71e34bee0 bsps: Move optfdt* files to shared parent directory 2021-08-09 12:14:18 -05:00
Joel Sherrill
6199de889d Turn off executable permissions for a number of source files
Cloning under Cygwin turned off executable permission on these
files. This shows them as modified even though they have not
explicitly been touched. Executable permission should not have
been on for these files so this is just a minor clean up.
2021-08-09 10:08:17 -05:00
Sebastian Huber
53c84ac5e5 score: Disable interrupts in SMP shutdown 2021-08-03 10:33:21 +02:00
Sebastian Huber
d999f865ea rtems: Generate <rtems/bspIo.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Place the group into the I/O Manager group.  Add all source files to the
group.

Update #3899.
Update #3993.
Update #4482.
2021-08-02 07:14:05 +02:00
Sebastian Huber
913b326a12 sptests: CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER
Remove obsolete CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER application
configuration option which is unsupported since commit
69aa33490b.
2021-07-30 15:42:24 +02:00
Sebastian Huber
0ea2638441 bsps/cache: Optimize smp_cache_broadcast()
Directly call the handler on the executing processor instead of doing this
indirectly via a per-CPU job.
2021-07-29 09:14:33 +02:00
Sebastian Huber
6c39df7e73 score: Change _SMP_Send_message() parameter type
Use the processor control to specify the target processor since this is what
the callers have available.
2021-07-29 09:03:50 +02:00
Sebastian Huber
c61b855c1a score: Assert job properties in _Per_CPU_Add_job() 2021-07-29 09:03:50 +02:00
Sebastian Huber
98a57511b6 score: Add _Per_CPU_Submit_job() 2021-07-29 09:03:50 +02:00
Sebastian Huber
59168e2ae3 score: Split SMP multicast action module
Split up the SMP multicast action module since the use of the SMP multicast
action variants depend on the architecture and BSP.
2021-07-29 08:05:26 +02:00
Sebastian Huber
28028961b1 score: Return value in _SMP_Process_message() 2021-07-28 21:08:13 +02:00
Sebastian Huber
8b65b57472 score: Canonicalize _CPU_Fatal_halt()
Move _CPU_Fatal_halt() declaration to <rtems/score/cpuimpl.h> and make sure it
is a proper declaration of a function which does not return.  Fix the type of
the error code.  If necessary, add the implementation to cpu.c.  Implementing
_CPU_Fatal_halt() as a function makes it possible to wrap this function for
example to fully test _Terminate().
2021-07-28 21:04:20 +02:00
Sebastian Huber
f799b4522f score: Move per-CPU jobs support
Add percpujobs.c to contain the per-CPU jobs implementation.
2021-07-28 19:32:24 +02:00
Sebastian Huber
70ec9bd44d score: Remove SMP message multicast/broadcast
Remove the unused _SMP_Send_message_multicast() and
_SMP_Send_message_broadcast().
2021-07-28 19:32:24 +02:00
Sebastian Huber
cbb1103a3c score: Simplify SMP processor state handling
The per-CPU states which control the SMP system initialization were added quite
early during the SMP support development.  Replace this initial implementation
with a simplified one.  There is no longer a global SMP lock required which
serialized the state changes of all processors.  The new implementation better
integrates with the per-CPU jobs.
2021-07-28 19:32:24 +02:00
Sebastian Huber
4adaed7328 score: Remove processor event broadcast/receive
Remove _CPU_SMP_Processor_event_broadcast() and
_CPU_SMP_Processor_event_receive().  These functions are hard to use since they
are subject to the lost wake up problem.
2021-07-28 19:07:37 +02:00
Sebastian Huber
6e82e9e89e libcsupport: Consistent rtems_putc() output
Use the same function to output the '\r\n' combination produced by
rtems_putc().  Fix the format.

Change licence according to file history.

Update #3053.
2021-07-28 19:05:42 +02:00
Sebastian Huber
79b94a2dcd libcsupport: Fix TOCTOU in getchark()
Use the same function pointer value to check against NULL and call the
function (if non-NULL).

Fix format, add Doxygen comments, and reduce includes.
2021-07-28 19:05:42 +02:00
Sebastian Huber
bf338f04c0 score: Remove _Internal_errors_What_happened
Users have access to the fatal error source and code though the fatal error
extension.  The user-specific fatal error handling should be done in statically
initialized fatal error handlers.  The _Internal_errors_What_happened was
updated after the fatal error extension. In addition, there was no API to get
the information stored in _Internal_errors_What_happened.  In SMP
configurations, this object could contain a mix of different fatal errors.
Remove this object to save some bytes of storage.
2021-07-28 08:39:54 +02:00
Sebastian Huber
c7b4eca7fa bsps/irq: bsp_interrupt_facility_initialize()
Do not return a status code in bsp_interrupt_facility_initialize() since this
leads to unreachable code in bsp_interrupt_initialize().  Use RTEMS_DEBUG
assertions in bsp_interrupt_facility_initialize() if necessary.
2021-07-27 10:03:19 +02:00
Sebastian Huber
67c033d39a validation: Test rtems_interrupt_handler_iterate()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
17fb523964 validation: Test rtems_interrupt_set_affinity()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
aab3713655 validation: Test rtems_interrupt_get_affinity()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
32c0cd8ff8 validation: Test rtems_interrupt_raise_on()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
163c1fd1a6 validation: Test rtems_interrupt_is_pending()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
1bf8139a9e validation: Test rtems_interrupt_clear()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
434105805f validation: Test rtems_interrupt_raise()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
7dbab6afee validation: Test rtems_interrupt_entry_remove()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
0996036986 validation: Test rtems_interrupt_entry_install()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
aa6c962668 validation: Test rtems_interrupt_vector_disable()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
7a3e6c74e3 validation: Test rtems_interrupt_vector_enable()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
d8be2b974e validation: rtems_interrupt_vector_is_enabled()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
e2894df9aa validation: Test rtems_interrupt_get_attributes()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
9e1fc36692 validation: GetTestableInterruptVector()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
bfec448682 validation: GetValidInterruptVectorNumber()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
1465e78a59 validation: HasInterruptVectorEntriesInstalled()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
f89cf8e8c4 validation: Add CallWithinISR()
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
b910e60e60 bsp/raspberrypi: Add interrupt get/set affinity
Add default implementations for bsp_interrupt_get_affinity() and
bsp_interrupt_set_affinity() which are required to link all tests in SMP
configurations.

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
e518323872 bsps/irq: Add rtems_interrupt_entry_install()
Add rtems_interrupt_entry_remove().  Split up irq-generic.c into several files.
In particular, place all functions which use dynamic memory into their own
file.

Add optional macros to let the BSP customize the vector installation after
installing the first entry and the vector removal before removing the last
entry:

* bsp_interrupt_vector_install()

* bsp_interrupt_vector_remove()

Use these new customization options in the m68k/genmcf548x BSP so re-use the
generic interrupt controller support.

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
70357f1731 bsps/irq: Move bsp_interrupt_handler_is_empty()
This function is only used by one BSP.

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
63d9e840b7 bsps/irq: Add bsp_interrupt_check_and_lock()
Return RTEMS_INCORRECT_STATE instead of RTEMS_INTERNAL_ERROR in case the
interrupt support is not initialized.  This is similar to
rtems_timer_server_fire_after() for example.

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
73fcbf4cff bsps/irq: Use rtems_interrupt_entry
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
81358d7586 rtems: Add rtems_interrupt_entry_install()
Add RTEMS_INTERRUPT_ENTRY_INITIALIZER(),
rtems_interrupt_entry_initialize(), and
rtems_interrupt_entry_remove().  This allows to install interrupt
handlers using user-provided storage as an alternative to
rtems_interrupt_handler_install() which has to allocate memory.

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
09be98d910 sparc/irq: Implement new interrupt directives
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
fe6ce5ac9c bsps/irq: Implement new directives for GICv2/3
Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
85a378510d bsps/irq: bsp_interrupt_set_affinity()
Return a status code for bsp_interrupt_set_affinity().

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
23ec04c48c bsps/irq: bsp_interrupt_get_affinity()
Return a status code for bsp_interrupt_get_affinity().

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
32f5a195d7 bsps/irq: bsp_interrupt_vector_disable()
Return a status code for bsp_interrupt_vector_disable().

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
bc86a5fa84 bsps/irq: bsp_interrupt_vector_enable()
Return a status code for bsp_interrupt_vector_enable().

Update #3269.
2021-07-26 19:57:30 +02:00
Sebastian Huber
deb5afb2f2 bsps/irq: Add rtems_interrupt_is_pending()
Add a default implementation which just returns RTEMS_UNSATISFIED.

Update #3269.
2021-07-26 17:08:42 +02:00
Sebastian Huber
eebecd09fa bsps/irq: Add rtems_interrupt_get_attributes()
Add a default implementation which clears the attributes to zero and
just returns RTEMS_SUCCESSFUL for valid parameters.

Update #3269.
2021-07-26 17:08:42 +02:00
Sebastian Huber
9832652c53 bsps/irq: Add rtems_interrupt_raise()
Add rtems_interrupt_raise_on() and rtems_interrupt_clear().

Add a default implementation which just returns RTEMS_UNSATISFIED for
valid parameters.

Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
781213f9ec bsps/irq: Add rtems_interrupt_vector_is_enabled()
Add a default implementation which just returns RTEMS_UNSATISFIED for
valid parameters.

Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
4969af4102 rtems: Add RTEMS_FATAL_SOURCE_SPURIOUS_INTERRUPT
Add RTEMS_FATAL_SOURCE_SPURIOUS_INTERRUPT as the fatal source for
spurious interrupts.  Use the interrupt vector number of the spurious
interrupt for the fatal code.

Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
faa4b63654 rtems: Add rtems_interrupt_is_pending()
Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
01e7c36b39 rtems: Add rtems_interrupt_vector_is_enabled()
Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
96265c87a3 rtems: Add rtems_interrupt_vector_enable()
Add rtems_interrupt_vector_disable().

Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
5e33aec041 rtems: Add rtems_interrupt_get_attributes()
Add a directive to query the attributes of an interrupt vector.   This
can be used for generic tests and system diagnostics.

Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
c4eafae279 rtems: Generate <rtems/irq-extension.h>
Use <rtems/score/chain.h> which just provides the data types and avoid a
dependency on <rtems/chain.h> which contains the full chain
implementation.

Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3269.
Update #3899.
Update #3993.
2021-07-26 07:54:25 +02:00
Sebastian Huber
ba9374598c rtems: Add rtems_interrupt_raise()
Add rtems_interrupt_raise_on().  Document the currently not implemented
rtems_interrupt_clear().  Remove the not implemented and badly named
rtems_interrupt_cause() directive.

Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
04c2c0804b bsps/irq: Move handler iterate to separate file
Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
1b3b5b8428 bsps/irq: Canonicalize get/set affinity errors
Bring the error conditions and status in line with
rtems_task_get_affinity() and rtems_task_set_affinity().

Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
efb3fc284a bsps/irq: Move get/set affinity to separate file
Update #3269.
2021-07-26 07:54:25 +02:00
Sebastian Huber
cc0bd0825b build: Bring Item.link() in line with waf link
The LDFLAGS are placed after the static libraries in the standard waf link
command, see "waflib/Tools/c.py" in the waf sources.
2021-07-26 07:54:25 +02:00
Sebastian Huber
827c6caab3 build: Remove superfluous library from rcxx01 2021-07-26 07:54:25 +02:00
Sebastian Huber
78b8360163 bsps: Fix bsp_fatal_extension()
The heap protection is conditional.
2021-07-23 16:01:30 +02:00
Chris Johns
350f501a39 bsp: Remove fatal from exit(0). Add extended heap error output 2021-07-23 08:56:14 +10:00
Sebastian Huber
217bf7be83 build: Add "bsps/" prefix to BSP family enable
BSP family and BSP variant names may be equal.  This prefix avoids
ambiguity in the enabled-by expressions.
2021-07-22 08:10:09 +02:00
Robin Mueller
5cc169573d Fixes for TMS570 BSP
When compiling the lwIP port for the TMS570, there
were issues with the BSP. Headers are expected in a folder
named ti_herc which did not exist. This fixes the issue.

Furthermore, there were multiple warnings about define redefinitions.
This was fixed as well.
2021-07-20 12:33:56 +02:00
Robin Mueller
b24e81423e STM32H7 ethernet pin corrections
These patches were submitted a few months ago, but it was found out
that the default-by-family: [] were missing in the GPIO .yml lines.
This was fixed in this patch.

This patch accounts for different pins for the ETH peripheral
on STM32H7 devices. For example, the Nucleo H743ZI has slightly
different pins than other STM32H7 boards.
2021-07-20 07:37:42 +02:00
Sebastian Huber
1577a48369 bsp/leon3: Remove <leon.h> include form <bsp.h>
The <leon.h> header file contains a lot of implementation details.  Hide them
from <bsp.h>.
2021-07-19 16:28:26 +02:00
Sebastian Huber
36655b870c cpukit: occured -> occurred 2021-07-16 13:42:27 +02:00
Sebastian Huber
b177cfc1c9 sparc: Prefer RTEMS_FATAL_SOURCE_EXCEPTION
Prefer RTEMS_FATAL_SOURCE_EXCEPTION over
INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT since the fatal code
(rtems_exception_frame) provides more context.
2021-07-15 15:37:35 +02:00
Sebastian Huber
19e4a3d25c build: Use objects of build context for programs 2021-07-15 15:37:35 +02:00
Sebastian Huber
394efd479c rtems: Fix Doxygen comment 2021-07-15 15:37:35 +02:00
Sebastian Huber
90f250e23a build: Add the BSP family to the enable set
This makes it possible to use the BSP family in expressions of the enabled-by
attribute.
2021-07-15 08:17:16 +02:00
Sebastian Huber
8bfc2080ca build: Fix format 2021-07-15 08:17:16 +02:00
Sebastian Huber
6c1928caed build: Prefer variant default value over family
Update #4468.
2021-07-15 08:07:28 +02:00
Sebastian Huber
b6092cb82c build: Fix bsp_defaults command
Update #4468.
2021-07-15 08:07:28 +02:00
Sebastian Huber
61071489ff build: Add missing default-by-family
Update #4468.
2021-07-15 08:07:28 +02:00
Sebastian Huber
aeaf6234f4 spcoverage: Remove test program
This program contained an optional test case.  It was enabled by the
RTEMS_COVERAGE define.  The functions under test are not implemented by RTEMS.
2021-07-15 07:46:22 +02:00
Chris Johns
87609bacd3 build: Fix the motorola_powerpc default baudrate 2021-07-15 09:59:15 +10:00
Chris Johns
6f2aa8ad36 build: Use BSP family for options
- Optionally add support for 'default-by-family' to allow
  option to be set by a family and so all related BSPs

Close #4468
2021-07-15 09:59:14 +10:00
Sebastian Huber
c7b3df3f51 bsps/sparc: Improve interrupt affinity support
Fully support the interrupt extension API to set/get the interrupt affinity.
Remove LEON3_irq_to_cpu which defined the interrupt to processor mapping in a
BSP-specific way.

Update #3269.
2021-07-09 15:29:04 +02:00
Sebastian Huber
7b2d5699be bsp/imx: Fix SMP start
Flush imx_gic_dist_base so that secondary processors can use the right
address.
2021-07-09 10:43:10 +02:00
Sebastian Huber
a398909dc2 bsps/arm: Fix SMP start
Skip the data cache initialization if we are a secondary processor.

The bug was introduced by e164df5e33 and
did not show up in tests using Qemu since the data cache behaviour is
not emulated.
2021-07-09 10:43:10 +02:00
Christian Mauderer
89b652a54d bsps/imxrt: Fix undefined symbol 2021-07-08 10:05:37 +02:00
Pranav Dangi
8b0e333487 bsps/arm: Add start up support for ARMv6 RPi Models 2021-07-07 20:09:47 +02:00
Sebastian Huber
b28c0c6690 bsp/raspberrypi: Fix <bsp/irq.h> header guard 2021-07-07 14:49:37 +02:00
Sebastian Huber
1b56073157 bsp/imx: Fix pointer from integer warning 2021-07-07 09:53:39 +02:00
Sebastian Huber
c9e0445932 build: Add option to customize the LINKFLAGS 2021-07-06 07:51:31 +02:00
Richi Dubey
3dcfdc3b32 Update test smpstrongapa01
Update smpstrongapa01 to account for task shifting.
2021-07-06 07:22:45 +02:00
Richi Dubey
b5f850495d Fix compiler warnings for schedulerstrongapa.c 2021-07-06 07:21:14 +02:00
Christian Mauderer
0d3453a47e bsps/imxrt: Simplify linkcmds and make it flexible
Calling the memory FLASH and EXTRAM instead of FLEXSPI and SDRAM makes
it simpler to support other types of external RAM. This patch also
removes some of the calculations and improves names and documentation to
avoid pitfalls. It removes a unnecessary memory definition.

Update #4180
2021-07-02 13:49:47 +02:00
Christian Mauderer
95a38dd3f1 bsps/imxrt: Allow different ARM PLL setting
Update #4180
2021-07-02 13:49:47 +02:00
Gedare Bloom
24e8ddca5c m68k/uC5282: linkcmds KEEP and SORT sections
Fixes a problem with bad epilog code in _fini and to keep sections
necessary with the -ffunction/data-sections.
2021-07-01 13:01:30 -06:00
Kinsey Moore
97d5fd9553 Revert "bsps/zynqmp: Allow any or all CGEMs to be enabled"
This reverts commit 10041a4cfc.

This type of configuration does not belong in RTEMS and is better
constrained to libbsd where the defines are actually being used.
2021-07-01 10:33:04 -05:00
Sebastian Huber
cb7d26845e bsp/leon3: Move bsp_interrupt_is_valid_vector()
This function is not performance critical.  There is no need to
implement it inline.
2021-07-01 16:43:35 +02:00
Sebastian Huber
52fb74ca65 bsp/leon3: Fix bsp_interrupt_is_valid_vector()
The fix to address CID 1399742 (NO_EFFECT) in commit
f8b6359415 introduced a bug since
LEON3_IrqCtrl_EIrq == -1 in case no extended interrupts are supported by
the interrupt controller.  Fix this by checking for
LEON3_IrqCtrl_EIrq > 0.

In addition, interrupt number 0 is reserved and should not be used.
2021-07-01 16:43:35 +02:00
Sebastian Huber
737e18dbca rtems: Do not broadcast to signal a condition var
Close #4463.
2021-07-01 13:20:51 +02:00
Sebastian Huber
f2b0877642 bsps: Fix GICv3 support for AArch32
The GICv3 support is shared between AArch32 and AArch64.  For AArch32,
the new AARCH64_IS_NONSECURE is never defined.  Use ARM_MULTILIB_ARCH_V4
instead.

This issue was introduced by 76c6caad52.

There is still a change in bsp_interrupt_vector_enable() for AArch32
compared to the version before 76c6caad52.
2021-06-30 16:28:52 +02:00
Kinsey Moore
c18b041b77 bsps/cadence-spi: Fix moduleid offset
Move the moduleid register to the correct offset according to Cadence IP
documentation.
2021-06-29 15:34:16 -05:00
Kinsey Moore
26d61c8670 bsps/zynq-uart: Make post baud change kick global
The existing fix for the ZynqMP UART hardware bug only caught the vast
majority of instances where it could occur. To fully fix the data
corruption, this fix must be applied after every baud rate change. This
makes the logic reset and kick apply in any locations where the baud
rate could be changed.
2021-06-29 11:42:06 -05:00
Gedare Bloom
4515ccf241 spec/aarch64: fix abi flags for xilinx_versal_ilp32_vck190 2021-06-29 10:04:03 -06:00
Sebastian Huber
bb9a4b816b arm: For AArch32 use non-shareable memory
The Cortex-R52 does not support cache coherency and the shareable memory
attribute.  If a region is configured to be shareable, then it falls
back to use non-cacheable memory.

Update #4202.
2021-06-29 14:53:42 +02:00
Sebastian Huber
9b84adb4aa arm: Fix AARCH32_PMSA_ATTR_XN value
Update #4202.
2021-06-29 14:53:42 +02:00
Sebastian Huber
b357680026 arm: Fix AArch32 memory attribute defines
Update #4202.
2021-06-29 14:53:41 +02:00
Sebastian Huber
13b18d129e arm: Disable alignment check in PMSA init
Disable the alignment check through SCTLR[A] in
_AArch32_PMSA_Initialize().

Update #4202.
2021-06-29 14:53:32 +02:00
Kinsey Moore
10041a4cfc bsps/zynqmp: Allow any or all CGEMs to be enabled
Provide the options necessary to enable any combination of CGEM ethernet
interfaces in LibBSD. The default is still CGEM3, so this should
continue to operate as expected on typical Zynq Ultrascale+ MPSoC
development hardware.
2021-06-28 09:13:16 -05:00
Gedare Bloom
17a9103c53 aarch64: whitespace fixes in start.S 2021-06-24 12:55:29 -06:00
Gedare Bloom
93088fb835 bsps/aarch64: replace boot options with asm switch code 2021-06-24 12:55:23 -06:00
Gedare Bloom
76c6caad52 bsps/aarch64: add non-secure mode and versal support 2021-06-24 09:37:31 -06:00
Gedare Bloom
207612957e bsps/aarch64: add physical secure timer 2021-06-24 09:37:31 -06:00
Gedare Bloom
bcad0aaee6 bsps/aarch64: add mnemonic for ICC_IGRPEN1_EL3 2021-06-24 09:37:31 -06:00
Gedare Bloom
fedd279f80 bsps/dev/irq: make icspicfgr an indexable array 2021-06-24 09:37:31 -06:00
Kinsey Moore
e613068ee6 aarch64: add support to drop EL3 to EL2 2021-06-24 09:37:31 -06:00
Gedare Bloom
37059626ac aarch64/xilinx-versal: new BSPs for qemu and vck190 2021-06-24 09:37:31 -06:00
Richi Dubey
6c23252cdd Update Strong APA Scheduler
This change allows for the migration of higher priority tasks on the
arrival of a lower priority task limited by affinity constraints.

Change license to BSD-2-Clause according to file history and
re-licensing agreement.

Update #3053.
2021-06-24 14:16:21 +02:00
Sebastian Huber
be96cb4345 sparc: Simplify trap table initialization
Move _ISR_Handler() to a separate file since it is now only used if a handler
is installed by _CPU_ISR_install_raw_handler().

Statically initialize the traps for external interrupts to use the new
_SPARC_Interrupt_trap() which directly dispatches the interrupt handlers
installed by rtems_interrupt_handler_install() via the BSP-provided
_SPARC_Interrupt_dispatch().

Since the trap table is now fully statically initialized, there is no longer a
dependency on the Cache Manager in the default configuration.

Update #4458.
2021-06-24 11:36:28 +02:00
Sebastian Huber
005c79beb9 bsps: bsp_interrupt_handler_dispatch_unchecked()
Add bsp_interrupt_handler_dispatch_unchecked() as an alternative to
bsp_interrupt_handler_dispatch().  It may be used if the caller can ensure that
the vector number is valid.
2021-06-24 11:36:28 +02:00
Sebastian Huber
b9d5f51630 sparc: Move FP frame offset defines to cpuimpl.h
This makes them usable in multiple files.

Update #4458.
2021-06-24 11:36:28 +02:00
Sebastian Huber
5c30e3d376 bsps/sparc: Use rtems_interrupt_handler_install()
Avoid using set_vector() which depends on _ISR_Vector_table().  Prepare for a
statically initialized trap table.

Update #4458.
2021-06-24 11:36:28 +02:00
Sebastian Huber
d73e657e06 sparc: More reliable bad trap handling
Statically initialize the trap table in start.S to jump to _SPARC_Bad_trap()
for all unexpected traps.  This enables a proper RTEMS fatal error handling
right from the start.  Do not rely on the stack and register settings which
caused an unexpected trap.  Use the ISR stack of the processor to do the fatal
error handling.  Save the full context which caused the trap.  Fatal error
handler may use it for error logging.

Unify the _CPU_Exception_frame_print() implementations and move it to cpukit.

Update #4459.
2021-06-24 11:36:28 +02:00
Sebastian Huber
955c045b3c sparc: Move ISR handler install routines
Move _CPU_ISR_install_raw_handler() and _CPU_ISR_install_vector() to separate
files.  The goal is to make their use optional.

Update #4458.
Update #4459.
2021-06-24 11:36:28 +02:00
Sebastian Huber
7a140e2ed5 bsps/sparc: Add a symbol for each trap table entry
This makes it easier to review start.o and set break points to trap table
entries.  This change was checked by inspecting the trap table in start.o with
objdump.

Update #4458.
2021-06-24 11:36:28 +02:00
Sebastian Huber
89c1e879c0 score: Move _ISR_Vector_table[] to separate file
The _ISR_Handler_initialization() does not touch the _ISR_Vector_table[].  Move
the definition of _ISR_Vector_table[] to a separate file.

Change license to BSD-2-Clause according to file history and re-licensing
agreement.

Update #3053.
2021-06-24 11:36:27 +02:00
Sebastian Huber
8d999f309f score: Remove bogus _ISR_Nest_level setting
This variable is actually contained in _Per_CPU_Information[] which is already
zero initialized.

Remove superfluous includes.
2021-06-24 11:36:27 +02:00
Sebastian Huber
26a09f2c5b score: Remove _CPU_Initialize_vectors()
This CPU port macro was not used.  Since the _ISR_Vector_table[] is statically
allocated, CPU ports could initialize this table in _CPU_Initialize() if
necessary.  Remove _CPU_Initialize_vectors() to simplify the CPU port
interface.
2021-06-24 11:36:27 +02:00
Sebastian Huber
6b7a38589a bsp/atsam: Fix BSP_INTERRUPT_VECTOR_COUNT
Fix an off by one error.

Update #3269.
2021-06-24 11:36:27 +02:00
Sebastian Huber
fdf2ee773a bsps/irq: Default BSP_INTERRUPT_VECTOR_COUNT == 0
Change the default value of BSP_INTERRUPT_VECTOR_COUNT so that no interrupt
vectors are supported and all related directives return RTEMS_INVALID_ID.

Update #3269.
2021-06-24 11:36:27 +02:00
Sebastian Huber
94cf67ca66 bsps/irq: Remove BSP_INTERRUPT_VECTOR_MAX
This define is no longer used.

Update #3269.
2021-06-24 11:36:27 +02:00
Sebastian Huber
3fee662093 bsps/irq: Use BSP_INTERRUPT_VECTOR_COUNT
Use BSP_INTERRUPT_VECTOR_COUNT instead of BSP_INTERRUPT_VECTOR_MAX.

Update #3269.
2021-06-24 11:36:25 +02:00
Sebastian Huber
049e2b64e1 bsps/irq: Remove BSP_INTERRUPT_VECTOR_NUMBER
Replace it with BSP_INTERRUPT_VECTOR_COUNT.

Update #3269.
2021-06-24 11:35:49 +02:00
Sebastian Huber
cd5573c09d bsps/irq: Add BSP_INTERRUPT_VECTOR_COUNT
Assert BSP_INTERRUPT_VECTOR_MAX + 1 == BSP_INTERRUPT_VECTOR_COUNT.

After building all BSPs with this patch, BSP_INTERRUPT_VECTOR_MAX can be
removed and replaced by BSP_INTERRUPT_VECTOR_COUNT.  The
BSP_INTERRUPT_VECTOR_COUNT allows a default implementation which supports no
interrupt vector at all.  Using COUNT instead of MAX may avoid some
interpretation issues, for example is the maximum value a valid vector number
or not.

Update #3269.
2021-06-24 11:35:49 +02:00
Sebastian Huber
900a84c5d1 smpcapture02: Fix use of BSP_INTERRUPT_VECTOR_MAX
This define represents the last valid interrupt vector number.

Update #3269.
2021-06-24 11:35:49 +02:00
Sebastian Huber
af73b7b64b bsps/irq: Remove BSP_INTERRUPT_VECTOR_MIN
Remove BSP_INTERRUPT_VECTOR_MIN and unconditionally let interrupt vector
numbers start with zero.

The BSP_INTERRUPT_VECTOR_MIN == 0 invariant was tested by the previous commit
and building all BSPs.

Update #3269.
2021-06-24 11:35:49 +02:00
Sebastian Huber
f3acb8bf03 bsps/irq: Assert BSP_INTERRUPT_VECTOR_MIN == 0
After building all BSPs with this patch, this BSP-specific define can be
removed to simplify the implementation.

Update #3269.
2021-06-24 11:35:49 +02:00
Sebastian Huber
5210c7c219 bsp/generic_or1k: Remove incomplete IRQ support
Update #3269.
2021-06-24 11:35:49 +02:00
Sebastian Huber
4146d3948d bsp/genmcf548x: Change BSP_INTERRUPT_VECTOR_MIN
This BSP uses a customized implementation of the interrupt extension API.  It
was the only BSP which defined BSP_INTERRUPT_VECTOR_MIN to a value other than
zero.  Define it to zero and use a custom bsp_interrupt_is_valid_vector()
function instead.

Update #3269.
2021-06-24 11:35:03 +02:00
Sebastian Huber
61d0be7214 bsps/irq: Remove BSP_INTERRUPT_NO_HEAP_USAGE
Remove the support for BSP_INTERRUPT_NO_HEAP_USAGE.  This was only used
by one BSP and provides no real benefit.

Update #3269.
2021-06-24 08:27:21 +02:00
Sebastian Huber
499a89b11d grlib: Register system console as /dev/console
Close #4461.
2021-06-24 08:27:21 +02:00
Vijay Kumar Banerjee
8416e7c322 bsps/powerpc, bsps/shared: Move remaining legacy networking header files 2021-06-23 13:20:38 -06:00
Sebastian Huber
a0a8262fd6 bsp/leon3: Fix compile error
Fix compile error with RTEMS_DRVMGR_STARTUP = True.
2021-06-23 08:12:49 +02:00
Christian Mauderer
5bb5e01356 i2c: Add non blocking read / write
This adds the possibility to open an I2C bus with O_NONBLOCK (or set it
later via fcntl) to get non-blocking transmissions. This means that if
the bus is busy, a read, write or transfer ioctl will return with a
EAGAIN errno.
2021-06-22 13:51:17 +02:00
Ryan Long
b47dbbc5f7 cpukit: Add timespecisnonnegative to Makefile.am 2021-06-21 15:01:10 -05:00
Christian Mauderer
8476715a49 cpu/armv7m: Fix initialization of MPU regions
The write to RBAR didn't have the valid flag set. Therefore the write to
RASR had an influence on the previously set region. That means for
example that if Region 0 had been enabled but 1 should be disabled due
to a size of 0, the previous code would have disabled region 0 instead.

This patch fixes that behaviour.

Close #4450
2021-06-21 16:11:36 +02:00
Christian Mauderer
5ad17be930 cpu/armv7m: Avoid regions with negative size
Don't initialze regions that have a negative size (for example due to a
wrong calculation).

Update #4450
2021-06-21 16:11:36 +02:00
Jan Sommer
93f9645595 bsps/i386: Update calibration of TSC to be more accurate
Closes #4455
2021-06-21 09:46:27 +02:00
Sebastian Huber
3ee19b7ac3 bsps/irq: Change license to BSD-2-Clause
Change license to BSD-2-Clause according to file history and
re-licensing agreement.

Update #3053.
2021-06-17 17:24:32 +02:00
Sebastian Huber
abe2d1596c rtems: Fix rtems_task_set_affinity() docs 2021-06-17 13:07:14 +02:00
Sebastian Huber
11cf6ae3e2 grlib: Simplify apbuart_inbyte_nonblocking() 2021-06-17 12:58:33 +02:00
Sebastian Huber
3af1e5e735 grlib: Fix apbuart_outbyte_polled() prototype
Callers usually want to output a character.
2021-06-17 12:58:33 +02:00
Sebastian Huber
af69a8693b grlib: Add apbuart_outbyte_wait() 2021-06-17 12:58:33 +02:00
Sebastian Huber
85febe7b10 grlib: Remove NL -> CR in apbuart_outbyte_polled()
This is already done in rtems_putc().
2021-06-17 12:58:33 +02:00
Sebastian Huber
634a2c0616 bsps/leon3: Auto initialization for printk()
Get rid of the hack to output into the idle stack during the early system
initialization.  This fixes also a couple of test program failures which fail
due to missing output.
2021-06-17 12:58:33 +02:00
Sebastian Huber
2c07f24af2 grlib: Add ambapp_plb()
Replace the global variable ambapp_plb with a function to allow an automatic on
demand initialization.
2021-06-17 12:58:33 +02:00
Sebastian Huber
c4c8d3fd50 grlib: Customizable allocation in ambapp_scan()
Make the memory allocations in ambapp_scan() customizable via the new struct
ambapp_context parameter which generalizes the memory copy handler.
2021-06-17 12:58:33 +02:00
Sebastian Huber
f89a527336 arm: Fix parameter use in AARCH32_PMSA_MEM_ATTR()
Update #4202.
2021-06-16 17:48:43 +02:00
Sebastian Huber
98cef4041b score: Comment _Thread_queue_Surrender_sticky()
The change also helps to avoid reports from static analysers since most
callers of _Thread_queue_Make_ready_again() check the unblock status.
2021-06-15 18:37:55 +02:00
Sebastian Huber
6abdd89f19 Use a common phrase for pointer parameters
Mention the type of the pointer in the parameter description.  Use the
more general term "object" instead of "variable".

Update #3993.
2021-06-15 10:39:47 +02:00
Sebastian Huber
fad01e6cf9 score: Add PER_CPU_DATA_NEED_INITIALIZATION()
Make the initialization of the per-CPU data optional.

Change license to BSD-2-Clause according to file history and
re-licensing agreement.

Update #3053.
2021-06-10 15:55:47 +02:00
Sebastian Huber
2769554243 splinkersets01: Test linker sets in library
Make sure that the linker sets work if placed in a library (this is how
they are used in RTEMS).
2021-06-10 08:43:28 +02:00
Sebastian Huber
93afcff7b5 bsps/sparc: Simplify memory initialization
Directly initialize the memory in the start sequence defined by start.S
instead of using a system initialization handler.  This avoids using the
global variable rdb_start which used a memory location which was shared
with _ERC32_MEC_Timer_Control_Mirror.  This change makes it possible to
use _Memory_Allocate() even before the system initialization is started.

Change license to BSD-2-Clause according to file history and
re-licensing agreement.

Update #3053.
2021-06-10 07:59:39 +02:00
Sebastian Huber
ef5a53bcf8 bsps/sparc: Simplify stack initialization
Initialize the stacks for all processors in one place.  Do not rely on
Per_CPU_Control::interrupt_stack_high and directly use the statically
allocated interrupt stack area.
2021-06-10 07:58:57 +02:00
Sebastian Huber
b823c9843d bsps/sparc: Unify stack initialization
Initialize the stacks in start.S in one place and identical to
_CPU_Context_Initialize().
2021-06-10 07:53:04 +02:00
Sebastian Huber
07f6a61d03 bsps/sparc: Remove support to load data section
Remove the support to load the data section and rely on the boot loader.  The
code is an artifact from the old erc32 days, when we would boot and execute
from ROM and the .data had to be copied over to RAM.  With leon1/2/3, this is
not used anymore as a boot loader is made from the RAM image using a custom
tool (mkprom).

In SMP configurations, this support was also broken since LEON3_Boot_Cpu
(in the data section due to the -1 initialization value) was used quite
early in the start sequence.

If the data copy is really necessary, then an application can still add this
step as a very early system initialization step, since boot_card() and the
system initialization loop does not use initialized read-write data (only
read-only and BSS data).  However, the SMP startup would still not work in this
case.  A boot loader is a better place to load the sections.
2021-06-10 07:50:00 +02:00
Sebastian Huber
7b8119a13a bsps/sparc: Remove unused __bsp_mem_init symbol 2021-06-10 07:50:00 +02:00
Sebastian Huber
6641cc87b8 score: Fix initialization of thread queue context
Set Thread_queue_Context::timeout_absolute in
_Thread_queue_Context_set_timeout_argument() to avoid using it uninitialized.

The bug was introduced by a89ecaa1a9.
2021-06-10 07:50:00 +02:00
Ryan Long
f83676d91f sysconf: Remove sysconf(515)
GCC originally needed this 20 years ago. No longer needed, so it
is being removed.

Closes #4391
2021-06-09 11:52:24 -05:00
Ryan Long
4127a6c056 main_edit.c: get rid of malloc warning
A warning was present when building RTEMS that stated that the argument
for malloc() exceeded the maximum object size. To get rid of this, I
  changed many places where 'int' was being used to 'size_t'.
2021-06-09 11:52:24 -05:00
Gedare Bloom
8299b79d66 aarch64: add qemu bsps for cortex-a72
The a72 BSPs are identical to the a53 BSPs just changing a53 to a72.
2021-06-09 10:32:08 -06:00
Joel Sherrill
7a723293ab futimens.c, utime.c: Remove unnecessary include of <sys/stat.h>. 2021-06-09 10:36:06 -05:00
Joel Sherrill
dbe355bfe7 fsnofs01/init.c: Check for ENOENT from utime().
The addition of the entire *utime*() family of functions resulted
in this call returning ENOENT not ENXIO. This is better aligned
with the POSIX definition of the methods.
2021-06-08 13:14:53 -05:00
Sebastian Huber
34b45b17c5 score: Remove unused _Per_CPU_Initialize() decl 2021-06-08 09:10:21 +02:00
Sebastian Huber
55ce66ca73 arm/fvp: Fix integer from pointer without a cast
Update #4202.
2021-06-07 09:41:07 +02:00
Sebastian Huber
2d1c494fa8 arm/fvp: Remove unused GICv2 BSP option
Update #4202.
2021-06-07 09:05:33 +02:00
Harrison Edward Gerber
9429115c8b cpukit/libdebugger: Fix for sockaddr_in not being initialized
See also CID 1468684

Closes #4445
2021-06-02 09:31:30 -06:00
Harrison Edward Gerber
6a56fd9340 cpukit/libmisc/monitor: Fix src/dest overlap of strcpy in mon-editor.c
See also CID 1399727

Closes #4444
2021-05-28 16:00:32 -06:00
Ryan Long
ea41722c92 Change filesystem utime_h handler to utimens_h
Also updated licenses.

Closes #4400
Updates #3899
2021-05-28 14:27:40 -05:00
Ryan Long
6171a88d9c psx13: Added tests for utimensat() and futimens()
Improved tests for utime() and utimes() and update license.

Close #4399
2021-05-28 14:27:39 -05:00
Ryan Long
ea881bf7a1 libcsupport: Implement utimes() in terms of utimensat()
utimes() now calls utimensat() to update file access
and modification timestamps.

Updated license.

Closes #4398
2021-05-28 14:27:39 -05:00
Ryan Long
bb70412306 libcsupport: Implement utime() in terms of utimensat()
utime() now calls utimensat() to update file access
and modification timestamps.

Updated license.

Closes #4397
2021-05-28 14:27:39 -05:00
Ryan Long
335f705082 libcsupport: Added futimens() and utimensat()
Created futimens.c and utimensat.c to add support for the POSIX
methods futimens() and utimensat().

utime() and utimes() are considered obsolote by POSIX, but RTEMS
will continue to support them.

Closes #4396
2021-05-28 14:27:39 -05:00
Ryan Long
2deba0240e main_help.c: Do not care what char is returned by getchar()
CID 1437650: Unchecked return value from library in rtems_shell_help().

Closes #4291
2021-05-28 12:15:50 -05:00
Ryan Long
f29b312ea4 main_cp.c: Ignore return value from stat()
CID 26051: Unchecked return value from library in main_cp().

Closes #4365
2021-05-28 12:15:50 -05:00
Ryan Long
a187b09228 gen_uuid.c: Ignore return values from fcntl()
CID 1049146: Unchecked return value from library in get_clock().
CID 1049147: Unchecked return value from library in get_random_fd().

Closes #4280
2021-05-28 12:15:50 -05:00
Christian Mauderer
156896526f thread-API: Add rtems_*mutex_try_lock
This adds a rtems_mutex_try_lock and a rtems_recursive_mutex_try_lock.

Update #4440.
2021-05-28 08:22:04 +02:00
Christian Mauderer
023a270962 cpukit: Add description of release version numbers
The release version in the git sources doesn't change. Add a note why
that is the case.
2021-05-28 08:22:04 +02:00
Sebastian Huber
bf36f5de94 score: Add RTEMS_UNREACHABLE() to a group 2021-05-28 07:49:36 +02:00
Kinsey Moore
d0eaf3ec1c spec/aarch64: Add BSPs for real ZynqMP hardware
Add the BSPs for running on the ZU3EG Ultrascale+ Zynq MPSoC and alter
the option defaults necessary for them to run properly using the
standard BOOT.BIN configured for PetaLinux that comes in the Out-of-Box
package.
2021-05-27 14:09:00 -05:00
Kinsey Moore
5fe49a0853 bsps/aarch64: Add MMU driver to relax alignment
Currently, the AArch64 BSPs have a hard time running on real hardware
without building the toolchain and the bsps with -mstrict-align in
multiple places. Configuring the MMU on these chips allows for unaligned
memory accesses for non-device memory which avoids requiring strict
alignment in the toolchain and in the BSPs themselves.

In writing this driver, it was found that the synchronous exception
handling code needed to be rewritten since it relied on clearing SCTLR_EL1 to
avoid thread stack misalignments in RTEMS_DEBUG mode. This is now
avoided by exactly preserving thread mode stack and flags and the new
implementation is compatible with the draft information provided on the
mailing list covering the Exception Management API.
2021-05-27 14:09:00 -05:00
Kinsey Moore
ae5e1d9797 bsps/a53: Increase available RAM
The default available RAM on the A53 BSP is quite small at 8MB. This
bumps that to 128MB to avoid allocation failures in tmcontext01 caused
by large allocations on a cache size of 16MB reported by the system
registers in QEMU.
2021-05-27 14:09:00 -05:00
Kinsey Moore
8810e08371 bsps/aarch64: Advertise cache function support
Ensure that cache functions are flagged as usable by the generic cache
implementation code.
2021-05-27 14:09:00 -05:00
Kinsey Moore
12ec459f4a bsps/aarch64: Align MVAs consistently
This fixes a bug where addresses were not being aligned correctly.
Addresses used in cache functions are now aligned consistently using
RTEMS_ALIGN_DOWN.
2021-05-27 14:09:00 -05:00
Kinsey Moore
25ca2ec4cb bsps/aarch64: Break out system registers
Break out system register definitions and accessors so that they're
usable by other parts of RTEMS.
2021-05-27 14:09:00 -05:00
Sebastian Huber
2fdd00fcdc rtems: Document new rtems_task_delete() error
Update #4414.
2021-05-27 07:12:49 +02:00
Harrison Edward Gerber
e2011dca26 cpukit/libpci: fix potential buffer overflow in pci_cfg_print_code.c
See also CID 1399721

Closes #4442
2021-05-26 16:43:26 -06:00
Kinsey Moore
342fe19842 score/aarch64: Align context validation frame
Ensure the stack remains aligned by keeping the context frame at a
multiple of 16 bytes. This avoids stack alignment exceptions which occur
when the stack pointer is not 16 byte aligned.
2021-05-26 16:08:25 -05:00
Sebastian Huber
de694b753c score: Direct thread dispatch in a self restart
Commit 73ebf9a27e accidentally removed the
direct thread dispatch in a self thread restart.  In case of a self
restart (always in task context) the directive shall not return.  If
this is not possible due to a bad thread dispatch disable level, then a
fatal error shall occur.

Update #4412.
2021-05-26 13:40:24 +02:00
Sebastian Huber
ce6319ade4 score: Fix _Thread_Cancel()
The _Thread_Cancel() (in contrast to _Thread_Restart() which used a
similar code block) may have produced ready threads with an active timer
in case the thread to cancel had its thread life protection enabled. The
problem was this code block:

    Priority_Control priority;

    _Thread_Add_life_change_request( the_thread );

    if ( _Thread_Is_life_change_allowed( previous ) ) {
      _Thread_State_release( the_thread, &lock_context );

      _Thread_queue_Extract_with_proxy( the_thread );
      _Thread_Timer_remove( the_thread );
    } else {
      _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
      _Thread_State_release( the_thread, &lock_context );
    }

    priority = _Thread_Get_priority( executing );
    _Thread_Raise_real_priority( the_thread, priority );
    _Thread_Remove_life_change_request( the_thread );

The life change request should only be added/removed if a life change is
allowed (see _Thread_Restart()).  Add _Thread_Try_life_change_request()
and use it in _Thread_Cancel() and _Thread_Restart().

Close #4435.
2021-05-26 13:40:24 +02:00
Sebastian Huber
29187be532 posix: Allow pthread_cancel() from within ISRs
Close #4413.
2021-05-26 13:40:24 +02:00
Sebastian Huber
3cef3198a5 score: Simplify calling _Thread_Exit()
Move common code into _Thread_Exit().  This enables a tail call
optimization in most cases.
2021-05-26 13:40:24 +02:00
Sebastian Huber
b81d1ffd23 rtems: Return RTEMS_CALLED_FROM_ISR
If rtems_task_delete() is called from within interrupt context, then
return RTEMS_CALLED_FROM_ISR.  This makes the behaviour predictable.

Update #4414.
2021-05-26 13:36:57 +02:00
Joel Sherrill
76d5722b4a sysinit: Do not open console when just referencing reentrancy structure.
This change eliminates a system initialization dependentcy which resulted
in an application without a file system or console referencing errno being
forced to include the code to open(/dev/console), close(), atexit(),
and the unmount infrastructure.

Closes #4439.
2021-05-25 08:33:04 -05:00
Joel Sherrill
402a206a1b powerpc/.../sbrk.c: Do not reference errno.
Closes #4r37.
2021-05-25 08:33:04 -05:00
Joel Sherrill
f9d590753a ppc-irq-legacy.c: Use rtems_malloc() instead of malloc().
Closes #4438.
2021-05-25 08:33:04 -05:00
Vijay Kumar Banerjee
71521ff21f telnetd.c: Remove RTEMS_NETWORKING check
Set the priority manually to make telnetd compatible with the
2021-05-20 17:55:33 -06:00
Vijay Kumar Banerjee
a5fd2935b7 testsuites: Remove telnetd01
telnetd01 test cannot be run without a network stack, so this test is being
moved to the rtems-net-legacy repository.
2021-05-20 17:52:37 -06:00
Sebastian Huber
a89ecaa1a9 score: Simplify thread queue timeout handling
Add Thread_queue_Context::timeout_absolute to specify an absolute or
relative timeout.  This avoid having to get the current time twice for
timeouts relative to the current time.  It moves also functionality to
common code.
2021-05-18 18:47:43 +02:00
Sebastian Huber
24c6293294 posix: Fix use of clock for relative times
Close #4426.
2021-05-18 18:47:18 +02:00
Sebastian Huber
d45f87cf35 score: Add _CPU_Context_switch_no_return()
The __builtin_unreachable() cannot be used with current GCC versions to
tell the compiler that a function does not return to the caller, see:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151

Add a no return variant of _CPU_Context_switch() to avoid generation of
dead code in _Thread_Start_multitasking() if RTEMS was built with SMP
support enabled.
2021-05-18 08:02:50 +02:00
Sebastian Huber
80b3c938ce score: Move _Thread_queue_Queue_get_name_and_id()
Move this diagnostic function to a separate file since it does not
provide a core function of the system.

Change license to BSD-2-Clause according to file history and
re-licensing agreement.

Update #3053.
2021-05-17 17:30:39 +02:00
Sebastian Huber
9918735448 posix: Use RTEMS_POSIX_API in clock_nanosleep()
It is only possible to get interrupted by a POSIX signal if
RTEMS_POSIX_API is defined.
2021-05-17 17:29:36 +02:00
Sebastian Huber
815a94326c posix: Move clock_nanosleep()
Move clock_nanosleep() to a separate file to avoid a dependency on errno
which pulls in the Newlib reentrancy support.  This is an issue since
most parts which are pulled in cannot be garbage collected by the linker
due to the system initialization linker set.
2021-05-17 17:29:36 +02:00
Christian Mauderer
15e26f4d7f bsps/imxrt: Enable DMA clock
The EDMA is intialized so make sure the the clock is initialized too.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
691fec407a bsps/imxrt: Fix OCRAM, ITCM and DTCM sizes
The sizes are configurable via fuses or per software via some registers.
At the moment the registers are not changed. Changing the registers
destroys data stored in the RAM areas (like application code or data).
So either the fuses or some bootloader should be used to set them before
the application starts.

This also adds an OCRAM only linker command file.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
988cc1a795 bsps/imxrt: Add addresses and interrupts to dts
Add addresses and interrupts for most internal peripherals to the dts.
The additional aliases make it possible for an application to easily
access these informations.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
c30566667d bsps/imxrt: Reduce devicetree size
Remove symbols that would be necessary for overlays and decrease padding
that would be necessary for adding stuff during run-time.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
08e4e6f2bb bsps/imxrt: Fix documentation error
Update #4180
2021-05-17 09:06:36 +02:00
Sebastian Huber
2cc25cf1b2 score: Add and use _Per_CPU_Is_ISR_in_progress()
Add _Per_CPU_Is_ISR_in_progress() as an optimized version of
_ISR_Is_in_progress().
2021-05-17 08:05:31 +02:00
Sebastian Huber
6f2c8f32e6 score: Improve parameters in _Thread_Change_life() 2021-05-17 08:05:31 +02:00
Sebastian Huber
98cb84ea2f arm/altera-cyclone-v: Fix compile error
Update #4406.
2021-05-17 08:05:31 +02:00
Sebastian Huber
73ebf9a27e rtems: Fix task restart within interrupt context
rtems_task_restart() may be called from within interrupt context.  So
checking only that the thread to restart is equal to the executing
thread is insufficient to determine a self restart.  We have to also
check that no ISR is in progress.  Merge _Thread_Restart_other() and
_Thread_Restart_self() into one _Thread_Restart() since they share a lot
of common code.

Close #4412.
2021-05-14 16:56:03 +02:00
Sebastian Huber
b9083c5597 rtems: Always set the real priority during restart
Unconditionally set the real priority of the task to its initial
priority during a task restart.

Close #4411.
2021-05-14 14:56:29 +02:00
Sebastian Huber
57be57c799 score: Return status in _Thread_Restart_other()
This simplifies rtems_task_restart().
2021-05-14 09:37:19 +02:00
Sebastian Huber
b87d2a6364 rtems: Check entry point in rtems_task_start()
Close #4410.
2021-05-14 09:20:26 +02:00
Sebastian Huber
410317ae3a validation: Add INVALID_ID to tx-support.h 2021-05-14 08:50:10 +02:00
Sebastian Huber
bc29c7c313 validation: Add support library
Add a library for support functions used by validation tests.  Rename
tc-support.* to tx-support.* since this file does not contain test
cases.
2021-05-14 08:48:38 +02:00
Sebastian Huber
45a3495325 rtems: Add TOD_Ticks_validation
Replace defines with an enum.

Update #4406.
2021-05-14 08:09:34 +02:00
Sebastian Huber
523867de9d rtems: Constify rtems_task_wake_when()
Add a parameter to _TOD_Validate() to disable the validation of the
ticks member.

There are two reasons for this change.  Firstly, in
rtems_task_wake_when() was a double check for time_buffer == NULL (one
in rtems_task_wake_when() and one in _TOD_Validate()).  Secondly, the
ticks member is ignored by rtems_task_wake_when().  This was done with a
write of zero to the ticks member and thus a modification of the
user-provided structure.  Now the structure is no longer modified.
Using a mask parameter is quite efficient. You just have to load an
immediate value and there are no additional branches in _TOD_Validate().

Close #4406.
2021-05-12 21:25:37 +02:00
Sebastian Huber
6136918ddf rtems: Document rtems_task_set_scheduler() errors 2021-05-12 21:08:12 +02:00
Sebastian Huber
51f7a82f08 rtems: Clarify rtems_task_get_priority() doc 2021-05-12 21:07:54 +02:00
Sebastian Huber
e3bec23d4d rtems: Use rtems_clock_get_ticks_per_second()
This avoids an integer division at runtime.
2021-05-12 06:41:10 +02:00
Frank Kühndel
3af2dc7802 _TOD_Validate(): Fix incorrect return code
This patch fixes bug #4403. Directives

* rtems_timer_fire_when()
* rtems_timer_server_fire_when()
* rtems_task_wake_when()

are documented to return RTEMS_INVALID_ADDRESS when their time-of-day
argument is NULL. But actually they return RTEMS_INVALID_CLOCK. To fix
the issue this patch changes _TOD_Validate() to return a
status code instead of just true/false.

Close #4403
2021-05-12 06:41:10 +02:00
Sebastian Huber
c2687666b1 rtems: Use _Objects_Free_nothing() for msg queues
Use _Objects_Free_nothing() for rtems_message_queue_construct() to avoid
unreachable code in _CORE_message_queue_Close() in case only
user-provided message buffers are used.

Update #4007.
2021-05-11 07:45:58 +02:00
Sebastian Huber
ab5aeb1be1 score: Rename _Stack_Free_nothing()
Rename _Stack_Free_nothing() in _Objects_Free_nothing() to make it
reusable for the message queue buffers.

Update #4007.
2021-05-11 07:45:58 +02:00
Sebastian Huber
6822af7579 rtems: rtems_scheduler_get_processor_set() docs
Document changed error status.

Update #4401.
2021-05-07 08:08:35 +02:00
Sebastian Huber
2146d347ab rtems_scheduler_ident_by_processor_set() docs
Document new error status.
2021-05-07 08:08:24 +02:00
Sebastian Huber
9f727f9379 validation: Fix handling of N/A pre-conditions
In the action requirements, some pre-conditions are not applicable
depending on the state of other pre-conditions.  There is no particular
order in the pre-conditions, so we have to check the N/A status
individually.
2021-05-07 07:44:07 +02:00
Sebastian Huber
c46d125569 Check the alignment in posix_memalign() earlier
Make sure all conditions to do a proper memory allocation are satisfied
before a zero size memory allocation is performed.

Update #4390.
2021-05-07 07:08:04 +02:00
G S Niteesh Babu
b391affc36 bsps/shared/ofw: Fix coverity defects
This patch adds asserts to fix coverity defects
1) CID 1474437 (Out-of-bounds access)
2) CID 1474436 (Out-of-bounds access)

From manual inspection, out of bounds access cannot occur due to
bounds checking but coverity fails to detect the checks.
We are adding asserts as a secondary check.
2021-05-06 16:44:38 -06:00
Sebastian Huber
2c5199bb04 Return NULL for zero size allocations
In POSIX, zero size memory allocations are implementation-defined
behaviour.  The implementation has two options:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html

https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html

Linux and FreeBSD return a unique pointer for zero size memory
allocations.   Return NULL on RTEMS to more likely catch the use of a
zero size memory area by erroneous applications.

Update #4390.
2021-05-06 08:03:58 +02:00
Sebastian Huber
5580b93f36 libc: Reimplement posix_memlign()
Move all error checks into posix_memalign() so that the returned memory
pointer is set to NULL under all error conditions except
memptr == NULL.

Use parameter names of POSIX documentation.
2021-05-06 08:03:58 +02:00
Sebastian Huber
48898b3a5d rtems: rtems_scheduler_get_processor_set() status
In case the processor set is not large enough to contain the processor
set owned by the scheduler return RTEMS_INVALID_SIZE instead of
RTEMS_INVALID_NUMBER. This is more in line with other directives since
the issue is related to the size of an object.

Close #4401.
2021-05-06 08:03:58 +02:00
Sebastian Huber
3f0c0bfe9a rtems: rtems_scheduler_ident_by_processor_set()
Check for a NULL processor set pointer.
2021-05-06 07:23:11 +02:00
Stephen Clark
e5590a3ea1 psxtests: Fix math function build warnings
Added conditionals to ensure that long double function tests were only
built when newlib has long double math functions.
2021-05-05 09:45:56 -05:00
Stephen Clark
cd5fd85730 stackchk: Fixed 32bit pointers
Using 32bit types like uint32_t for pointers creates issues on 64 bit
architectures like AArch64. Replaced occurrences of these with uintptr_t,
which will work for both 32 and 64 bit architectures.
2021-05-05 09:45:56 -05:00
Stephen Clark
ca02143321 rtems-fdt: Fixed 32bit pointers
Using 32bit types like uint32_t for pointers creates issues on 64 bit
architectures like AArch64. Replaced occurrences of these with uintptr_t,
which will work for both 32 and 64 bit architectures.
2021-05-05 09:45:56 -05:00
Sebastian Huber
3e16f1a6e2 score: Make _Once_Lock() and _Once_Unlock() static
These two functions are no longer used outside of _Once().
2021-05-04 09:37:06 +02:00
Sebastian Huber
024d4eaa2f rtems: Use allocator mutex for timer server
The allocator mutex is recursive and already used for the task creation
in rtems_timer_initiate_server().  Just use this mutex instead of the
once mutex to serialize the initialization.  This avoids a dependency on
condition variables which are not used here.
2021-05-04 09:37:06 +02:00
Sebastian Huber
d692c62dfb Make zero size allocation result consistent
The zero size allocations had no consistent behaviour in RTEMS.  For
example, malloc( 0 ) returned NULL and posix_memalign( &p, align, 0 )
returned in p a unique pointer (or NULL if no memory is available).  In
POSIX, zero size memory allocations are implementation-defined
behaviour.  The implementation has two options:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html

https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html

Linux and FreeBSD return a unique pointer for zero size memory
allocations.   Use this approach for RTEMS as well throughout the memory
allocation directives

Close #4390.
2021-05-04 09:37:06 +02:00
Sebastian Huber
eb7c33add0 bsps/riscv: Support RTEMS_NOINIT in linkcmds
Update #3866.
2021-05-03 14:05:19 +02:00
Sebastian Huber
5b97821bc8 libtest: Fix use of flexible array member
Flexible array members must not appear in the middle of a structure.
2021-05-03 06:58:53 +02:00
Sebastian Huber
1eb6cdde60 score: Add _Thread_Dispatch_direct_no_return()
The __builtin_unreachable() cannot be used with current GCC versions to
tell the compiler that a function does not return to the caller, see:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151

Add a no return variant of _Thread_Dispatch_direct() to avoid generation
of dead code.
2021-05-02 18:41:26 +02:00
Sebastian Huber
2df95414a7 spmisc01: Test RTEMS_NOINIT
Close #3866.
2021-05-02 18:41:26 +02:00
Sebastian Huber
e10dec0fe7 bsps: Support RTEMS_NOINIT in linkcmds
Update #3866.
2021-05-02 18:41:21 +02:00
Sebastian Huber
a84bf966b5 basedefs: Add RTEMS_NOINIT
Update #3866.
2021-04-30 15:47:03 +02:00
Sebastian Huber
8b15a3242e Use alias for rtems_task_self() and pthread_self()
This may reduce the code size a bit.
2021-04-30 07:56:28 +02:00
Sebastian Huber
09063212d4 appl-config: Add missing "the" 2021-04-30 07:20:52 +02:00
Sebastian Huber
901136e7c1 appl-config: CONFIGURE_BSP_PREREQUISITE_DRIVERS
Replace copy and paste with a proper description.
2021-04-30 07:20:52 +02:00
Sebastian Huber
eefe7009bb appl-config: Reformat option constraints
If only one constraint is present, then use a single sentence, otherwise
use a list for the constraints.  Format the constraints so that the line
length limit is maintained.
2021-04-30 07:20:52 +02:00
Vijay Kumar Banerjee
8e4f5782eb cpukit/Makefile.am: Remove remaining LIBNETWORKING files 2021-04-29 10:28:39 -06:00
Ryan Long
8cf30c41d9 main_rtrace.c: Add error return when malloc fails
CID 1399709: Dereference after null check in
rtems_trace_buffering_shell_save().

Closes #4329
2021-04-29 09:48:00 -05:00
Ryan Long
cdf66529fd objectextendinformation.c: Ensure information->object_blocks is not NULL
CID 26033: Dereference after null check in _Objects_Extend_information().

Closes #4326
2021-04-29 09:48:00 -05:00
Ryan Long
a70d60aff7 pwdgrp.c: Removed unused variable
The 'sc' variable was originally storing the return value of mkdir().
This was causing an issue, so it was changed to make it to where we
ignored the return value with (void). The 'sc' variable was left in
by mistake.
2021-04-29 08:23:22 -05:00
Sebastian Huber
263e00b26a bsps/arm: ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX
Change the ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX value to be in line
with the workspace entry in ARMV7_CP15_START_DEFAULT_SECTIONS.

Close #4395.
2021-04-29 13:42:24 +02:00
Ryan Long
fe3e05ffca psx13: Reworked and relicensed
Changed the way the tests were structured, added rtems_test_assert()'s,
updated psx13.scn and the license.

Update #3899
2021-04-28 10:01:04 -05:00
Sebastian Huber
a1679af380 rtems: Generate <rtems/rtems/tasks.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-28 07:38:50 +02:00
Sebastian Huber
b3d3186dc7 rtems: Generate <rtems/rtems/region.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-28 07:38:50 +02:00
Sebastian Huber
0b9e307f24 rtems: Generate <rtems/rtems/intr.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-28 07:38:50 +02:00
Sebastian Huber
278c7daabf rtems: Fix typo "cod" -> "code" 2021-04-28 07:38:29 +02:00
Sebastian Huber
55c6cb1daa rtems: Clarify constraints in documentation 2021-04-28 07:37:56 +02:00
Peter Dufault
f8b91c9503 powerpc/shared/console: "termios" first open sets console baud to 9600
When the PowerPC shared console baud rate starts at anything other than
9600 the termios code will set it to 9600 at the first open.
2021-04-27 16:46:52 -06:00
Peter Dufault
9c13e528a0 powerpc/shared/console: Make console baud rate configurable.
The "powerpc/shared/console" code has the start-up console value fixed
at 9600 baud.  This changes the hard-wired constant "9600" in the code
to the configuration setting "BSP_CONSOLE_BAUD" and adds configuration
support in both the "waf" and the legacy configuration systems.

Note that the VME BSPs beatnik, mvme3100, and mve5100 can be improved
by adding a "mvmexxxx" BSP family. This configuration change, as well
as future configuration changes, could then be made in a "grp.yml" file.
2021-04-27 16:46:48 -06:00
Sebastian Huber
bbc93c119c Return status code for _Thread_Start()
This avoids having conditional statements to get the API-specific status
code.
2021-04-27 19:40:13 +02:00
Sebastian Huber
9d82150f5a Return status code for _Scheduler_Set_affinity()
This avoids having conditional statements to get the API-specific status
code.
2021-04-27 19:40:13 +02:00
Sebastian Huber
4b7c77bce3 rtems: Change rtems_task_get_affinity() status
In case the processor set is not large enough to contain the processor
affinity set of the task return RTEMS_INVALID_SIZE instead of
RTEMS_INVALID_NUMBER. This is more in line with other directives since
the issue is related to the size of an object.

Close #4393.
2021-04-27 19:40:12 +02:00
Sebastian Huber
127a812f50 Simplify get affinitiy directives
There is no need to disable thread dispatching to get the affinity of a
task.
2021-04-27 19:40:12 +02:00
Sebastian Huber
1452699241 Return status code for _Scheduler_Get_affinity()
This avoids having conditional statements to get the API-specific status
code.
2021-04-27 19:40:12 +02:00
Sebastian Huber
2684f2a380 rtems: Constify timer fire when directives
Close #4392.
2021-04-27 19:34:30 +02:00
Vijay Kumar Banerjee
e29d5cd01d Makefile.am: Remove legacy networking files 2021-04-26 07:59:08 -06:00
Robin Mueller
37649355ce Implementation for STM32 HAL_GetTick using RTEMS
Uses configured millisecond per ticks
2021-04-26 11:24:22 +02:00
Robin Mueller
53bb397dfa Nucleo UART3 (console) pins correction
Now using default pins
2021-04-23 11:39:18 +02:00
Sebastian Huber
de6e5153c5 rtems: Generate <rtems/rtems/ratemon.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-23 08:42:03 +02:00
Sebastian Huber
73a0175406 rtems: Generate <rtems/rtems/message.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-23 08:33:32 +02:00
Sebastian Huber
f14cf0cd74 rtems: Check for NULL config in task construct
Since there are already excessive NULL pointer checks in the Classic
API, do this also in rtems_task_construct().

Update #3959.
2021-04-23 08:24:07 +02:00
Sebastian Huber
03747b5087 rtems: Check for NULL config in msgq construct
Since there are already excessive NULL pointer checks in the Classic
API, do this also in rtems_message_queue_construct().

Update #4007.
2021-04-23 08:23:59 +02:00
G S Niteesh Babu
d75b29d95e bsps/beagle: Refactored i2c driver
Refactored the i2c driver to parse register values from the device
tree rather than hardcoding them. But still the clocks have to
initialized manually.
2021-04-22 18:43:35 +02:00
Sebastian Huber
8854aec152 rtems: Mention timer server fire directives
A timer may be also reinitiated by the timer server fire directives.
2021-04-22 15:57:41 +02:00
Sebastian Huber
8c518a95f2 build: Remove duplicated attributes 2021-04-22 15:31:44 +02:00
Sebastian Huber
b229b4c2d6 rtems: Generate <rtems/rtems/support.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-21 19:46:12 +02:00
Sebastian Huber
e8be00473d rtems: Generate <rtems/rtems/mp.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-21 19:46:12 +02:00
Sebastian Huber
0be4b8821f rtems: Generate <rtems/rtems/dpmem.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-21 19:46:12 +02:00
Sebastian Huber
71a2e7eec7 rtems: Generate <rtems/init.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-21 19:46:12 +02:00
Sebastian Huber
97ba94b929 rtems: Generate <rtems/fatal.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-21 19:43:29 +02:00
Frank Kühndel
7bbbe4225c clock:_TOD_To_seconds(): Fix year 2514 overflow
This patch fixes issue #4338 by changing _TOD_Validate()
to only accept years till 2105. This requires another patch
to change the documentation of rtems_clock_set() and other
affected API functions (indicating the end date is 2105 not 2514).

I tried to support till year 2514 but it turned out that
this needs changing the Timer Manager too. That in turn
would mean to change _TOD_Seconds_since_epoch( void )
from 32 to 64 bit. Sebastian pointed out that a naive extension
leads to trouble with 32 bit processors. He deemed a safe
re-implementation too costly performance wise considering
that year 2106 is far away and current binaries using RTEMS
Classic API are unlikely to be in use by 2106.

The constant TOD_SECONDS_AT_2100_03_01_00_00 in
cpukit/rtems/src/clocktodtoseconds.c happens to be wrong by
1 hour. When setting the date 2100-Feb-28 23:59:59 and then
reading the date again you will find yourself in 2100-Feb-27.

Update #4338
2021-04-21 07:13:31 +02:00
Sebastian Huber
2a24f99d11 bsps/arm: Set MSP in ARMv7-M start code
Set the Main Stack Pointer (MSP) to the ISR stack area end just in case
we run using the Process Stack Pointer (PSP).  This helps if
applications are started by a boot loader.
2021-04-21 07:04:53 +02:00
Sebastian Huber
51defd9274 Fix calloc() behaviour in case of overflow
The multiplication to calculate the length of the memory area to
allocate may overflow.  Return NULL in case of an overflow.

Close #4389.
2021-04-20 20:33:03 +02:00
Sebastian Huber
6c66bbbadf malloc: Hide RTEMS_Malloc_Sbrk_amount
Move RTEMS_Malloc_Sbrk_amount to the only implementation file which uses
it and make it private to hide implementation-details from an API
header.
2021-04-20 19:18:23 +02:00
Sebastian Huber
d8a5e140ec libcsupport: Move rtems_calloc()
Move rtems_calloc() since it only depends on rtems_malloc().  This may
make it easier to customize the heap allocator.

Change licence to BSD-2-Clause according to file history.

Update #3053.
2021-04-20 19:18:23 +02:00
Sebastian Huber
2b32146400 Remove superfluous <rtems/score/wkspace.h> includes 2021-04-20 19:18:23 +02:00
Robin Mueller
100c050cbd Updated tick implementation for HAL_GetTick
This now uses rtems_clock_get_uptime_nanoseconds
to calculate the uptime ticks in milliseconds.
2021-04-20 19:11:15 +02:00
Sebastian Huber
ea1dc0eeb3 bsp/stm32h7: Remove duplicated build definitions
The links are already in spec/build/bsps/arm/stm32h7/grp.yml.
2021-04-20 11:07:11 +02:00
Sebastian Huber
0e49372ace score: Remove unused _Thread_queue_Dequeue()
Last use was removed by:

commit 54550e048d
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Fri May 13 08:16:30 2016 +0200

    posix: Rework pthread_join()

    Rework pthread_join() to use _Thread_Join().
2021-04-20 07:01:13 +02:00
Kinsey Moore
69bde47acc cpukit/aarch64: Restore ISR cookie bit mask
The _CPU_ISR_Is_enabled() function operates on ISR cookies and so must
mask off the appropriate status bits. This also fixes the naming of the
parameters of the _CPU_ISR_* functions to indicate use of ISR cookies
instead of interrupt enable/disable levels.
2021-04-19 10:51:02 -05:00
Kinsey Moore
3ea43bc9e7 bsps/xilinx-zynqmp: Avoid constant UART reinit
Constantly reinitializing the Cadence UART on every character output
causes data corruption/loss on some ZynqMP hardware. Only initialize
the UART once for early output and give it a kick on startup.
2021-04-19 10:51:02 -05:00
Sebastian Huber
00f9faf2de rtems: Document rtems_semaphore_obtain() errors 2021-04-19 07:20:49 +02:00
Moyano, Gabriel
5728e8e356 grlib/genirq: Taking into account that it could be more than one ISR enabled/disabled 2021-04-16 08:46:17 +02:00
Jiri Gaisler
a316a9ddae smpfatal08: block secondary processors
* On some SMP platforms, all cpus are started by the
	  boot-loader. We need to block the secondary cpus or they
	  will clobber the test output.
2021-04-13 22:31:22 +02:00
Vijay Kumar Banerjee
0cbbceff16 Revert "cpukit/include: Remove telnetd.h"
This reverts commit 8383572963.
2021-04-13 11:58:48 -06:00
Vijay Kumar Banerjee
650ac70066 Revert "cpukit: Remove telnetd"
This reverts commit 3299dda245.
2021-04-13 11:57:21 -06:00
Ryan Long
3cd58bdf2c disp_hcms29xx.c: Unused value (CID #1399752)
CID 1399752: Unused value in disp_hcms29xx_update_task().

Closes #4342
2021-04-08 17:58:19 -05:00
Ryan Long
09d811b8a5 fastlz.c: Unused value (CID #1399751)
CID 1399751: Unused value in fastlz2_compress().

Closes #4341
2021-04-08 17:58:19 -05:00
Ryan Long
0b2366024d print-ls.c: Unused value (CID #1255346)
CID 1255346: Unused value in rtems_shell_ls_printacol().

Closes #4340
2021-04-08 17:58:19 -05:00
Ryan Long
fbc764403f main_cp.c: Unused value (CID #1255344)
CID 1255344: Unused value in copy().

Closes #4339
2021-04-08 17:58:19 -05:00
Vijay Kumar Banerjee
8383572963 cpukit/include: Remove telnetd.h
Update #3850
2021-04-07 16:15:39 -06:00
Vijay Kumar Banerjee
df6d765c3a testsuites: Remove all legacy networking tests
Update #3850
2021-04-07 16:15:39 -06:00
Vijay Kumar Banerjee
633526d2a2 spec: Remove residue bsps spec files
Update #3850
2021-04-07 16:15:39 -06:00
Vijay Kumar Banerjee
3299dda245 cpukit: Remove telnetd
Update #3850
2021-04-07 16:15:39 -06:00
Vijay Kumar Banerjee
3dca9ed92b testsuites/libtests: Remove networking01
Update #3850
2021-04-07 16:15:38 -06:00
Vijay Kumar Banerjee
c90fa83041 bsps: Remove networking drivers
Update #3850
2021-04-07 16:15:38 -06:00
Vijay Kumar Banerjee
6692e03e9d cpukit/libfs: Remove nfsclient
Update #3850
2021-04-07 16:15:38 -06:00
Vijay Kumar Banerjee
369e6c5bf7 cpukit: remove pppd
Update #3850
2021-04-07 16:15:38 -06:00
Vijay Kumar Banerjee
2a13ad389a cpukit: Remove libnetworking
Update #3850
2021-04-07 16:15:38 -06:00
Vijay Kumar Banerjee
a28eafb2a4 cpukit: Move ftpfs from libnetworking to libfs
Update #3850
2021-04-07 16:15:38 -06:00
Vijay Kumar Banerjee
c6ba8dd4e0 spec: Remove RTEMS_NETWORKING options
Update #3850
2021-04-07 16:15:38 -06:00
Sebastian Huber
809b76ec3b rtems: Fix rtems_semaphore_release() documentation
The directive returns RTEMS_UNSATISFIED if the semaphore's count already
had the maximum value of UINT32_MAX.
2021-04-07 07:10:51 +02:00
Sebastian Huber
3e46a75e04 validation: Fix unused variable warning
Fix warning:

testsuites/validation/tc-signal-send.c:634:21: warning: unused variable
  'sc' [-Wunused-variable]
2021-04-07 06:43:55 +02:00
Sebastian Huber
b3364fc6cb libtests/block14: Fix warning
Fix warning:

testsuites/libtests/block14/init.c:198:8: warning: 'sc' may be used
  uninitialized in this function [-Wmaybe-uninitialized]

Update #3689.
2021-04-07 06:41:09 +02:00
Sebastian Huber
089e68181e score: Replace Objects_Name_or_id_lookup_errors
Replace Objects_Name_or_id_lookup_errors with new Status_Control codes.
Get rid of the _Status_Object_name_errors_to_status lookup table.
2021-04-07 06:31:46 +02:00
Sebastian Huber
d1c038c78e score: Fix internal error status number
The value of STATUS_CLASSIC_INTERNAL_ERROR must be equal to
RTEMS_INTERNAL_ERROR.  Add static assertions to ensure that the status
codes match.
2021-04-07 06:31:46 +02:00
Alex White
1af1c193bc cpukit/aarch64: Add ESR register decoding 2021-04-06 08:27:46 -05:00
Sebastian Huber
05cd707d28 arm/stm32h7: Add STM32H7_USART3_GPIO_* 2021-04-06 09:56:41 +02:00
Sebastian Huber
6bb6b69bb6 arm/stm32h7: Add STM32H7_HSE_FREQUENCY 2021-04-06 09:43:23 +02:00
Sebastian Huber
26307ef115 arm/nucleo-h743zi: New BSP variant 2021-04-06 09:42:53 +02:00
Sebastian Huber
3799375c5e build: Add group for arm/stm32h7 2021-04-06 09:41:44 +02:00
Christian Mauderer
8fd29cfbc5 stm32h7: Add init for sdmmc pins
Update #4372
2021-04-01 09:04:23 +02:00
Christian Mauderer
aa9e3c6211 stm32h7: Add SDMMC modules to clock
Update #4372
2021-04-01 09:04:21 +02:00
Jan Sommer
33fd9155a1 bsps/xilinx_zynq: Add Xilinx AXI SPI driver to autotools build
Closes #4321
2021-03-30 17:01:37 +02:00
Jan Sommer
7a1edf11a1 bsps/shared: Add Xilinx-AXI SPI driver to waf
Updates #4321
2021-03-30 17:01:36 +02:00
Jan Sommer
70667b5527 bsps/xilinx_zynq: Add SPI driver for xilinx-axi-spi
Updates #4321
2021-03-30 17:01:36 +02:00
Jiri Gaisler
4f12a1e365 Restore FDT in ofw01 to avoid test timeout on RISCV 2021-03-30 16:34:04 +02:00
Sebastian Huber
1e62e15f46 score: Add an assert to _Workspace_Free() 2021-03-27 18:08:13 +01:00
Sebastian Huber
e0aba8cb9e score: Fix task stack initialization
Do not adjust the stack area begin address since this may confuse the
stack allocator and result in failed stack frees.

Account for the alignment overhead in the stack space size estimate.

Check that the stack size is in the expected interval.
2021-03-27 18:05:05 +01:00
Joel Sherrill
d4d2f6487a pwdgrp.c: Change to simply ignore return value from mkdir(/etc)
At this point in time, /etc can be created in multiple ways. There
is a discussion (#4354) that would define a mechanism for
instantiating a base file system with some flexibility for the
set of directories included. For now, this particular mkdir()
call can fail because /etc could already have been created by
at least an initial filesystem image, the shell, or libbsd.

closes #4382.
2021-03-27 09:59:12 -05:00
Christian Mauderer
fd639b8abf dosfs: Use peek support
This speeds up reading fragmented files.

Fix #3689
2021-03-26 14:25:56 +01:00
Christian Mauderer
6ae79e6df6 libblock: Add rtems_bdbuf_peek()
Adds a peek function that allows (for example) a file system to suggest
the next blocks that should be used for read ahead. This can increase
the read speed of fragmented files.

Update #3689
2021-03-26 14:25:38 +01:00
Joel Sherrill
62bbb0cc46 gen_uuid.c: Revert previous patch (597e4f4765)
The patch was:
    gen_uuid.c: Fix two Unchecked return value from library errors

    CID 1049146: Unchecked return value from library in get_clock().
    CID 1049147: Unchecked return value from library in get_random_fd().

 Reopen #4280
2021-03-24 08:03:07 -05:00
Ryan Long
37fc6516d3 pwdgrp.c: Remove _Assert. /etc may already exist
Removed the _Assert_unused_variable_equals macro due to /etc
having already been created by the network stack initialization
or an initial filesystem image.

Closes #4282
2021-03-23 11:43:13 -05:00
Jan Sommer
1343fb5f01 bsps/riscv: Add per cpu clock interrupt
- Fixes failure of test smpclock01
2021-03-23 09:17:38 +01:00
Sebastian Huber
fec2b72472 validation: Use support functions 2021-03-23 07:57:13 +01:00
Sebastian Huber
8afe332348 validation: Add test case support functions 2021-03-23 07:57:13 +01:00
G S Niteesh Babu
bd9e45d91f rtems-fdt/rtems-fdt.c: Fix bug in loop termination
The while loop, loops infinitely in case of raw FDT data.
The loop condition (size) is not modified during iterations.
2021-03-21 12:33:08 +01:00
G S Niteesh Babu
56074644a7 bsp/beagle: Ported Beagle pinmux driver to RTEMS
The following files have been ported
1) ti_pinmux.c
2) ti_pinmux.h
3) am335x_scm_padconf.c
4) am335x_scm_padconf.h

Update #3784
2021-03-21 12:30:48 +01:00
G S Niteesh Babu
7589f1e01a bsps/beagle: Added SOC detection using FDT
Detects the SOC type using FDT and also replaces the ti_cpuid.h
header in FreeBSD with custom one.
2021-03-21 12:30:48 +01:00
G S Niteesh Babu
5c656ead88 bsp/beagle: Import Beagle pinmux from FreeBSD
This patch imports the beagle pinmux driver from FreeBSD into
RTEMS. Previously this driver was placed in RTEMS-libBSD but
this caused double initialization of few pins once during RTEMS
initialization and second time during libBSD initialization.
The following patches port the driver from FreeBSD to RTEMS and
will remove the driver from RTEMS-libBSD.

RTEMS Ticket Update: #3784

FreeBSD head: ca12b7e9534b10af022fed60c043984dbaf4003d

The following files have been imported from FreeBSD:
1) freebsd/sys/arm/ti/am335x/am335x_scm_padconf.h
2) freebsd/sys/arm/ti/am335x/am335x_scm_padconf.c
3) freebsd/sys/arm/ti/ti_pinmux.h
4) freebsd/sys/arm/ti/ti_pinmux.c
2021-03-21 12:30:48 +01:00
G S Niteesh Babu
fc7129067d bsps/shared/ofw: Add rtems_ofw_is_node_compatible
This patch extends the RTEMS OFW API by adding
rtems_ofw_find_device_by_compat

This function checks if a node has the expected compatible
property.
2021-03-21 12:30:47 +01:00
Christian Mauderer
65ab1cda10 bsps/arm/imxrt: Add FDT and FDT helper for QTMR
Makes it simpler to access the QTMR in an application via a FDT name or
link in an application specific FDT entry.
2021-03-21 12:30:29 +01:00
Sebastian Huber
53bd5e3246 rtems: Relax mode checks in rtems_signal_catch()
Check only for invalid modes if a valid handler is presented to
rtems_signal_catch().  When NULL is used for the handler, ASR processing
is disabled and the mode is not used.

Update #4244.
2021-03-19 16:55:48 +01:00
Sebastian Huber
fa1e7ea054 validation: Reduce source code/rodata size
Use a common wording for the tests.  Use the new templates for action
requirements described in the RTEMS Software Engineering manual.
2021-03-19 16:55:48 +01:00
Sebastian Huber
eb1cd404d0 build: Add test exclude for arm/lpc2362 2021-03-19 16:55:11 +01:00
Sebastian Huber
50abce31ef rtems: Fix rtems_task_mode()
Do the ASR and preemption mode change only if requested by the mode
mask.  The bug was introduced by
508f868237.
2021-03-18 10:38:53 +01:00
Sebastian Huber
b4eb937ecd rtems: Improve semaphore create error checks
Do not mix checks for different error indicators (RTEMS_NOT_DEFINED and
RTEMS_INVALID_NUMBER).  This simplifies the specification of
rtems_semaphore_create().
2021-03-16 14:57:41 +01:00
Sebastian Huber
4ebdbee815 rtems: Allow initially locked MrsP semaphores
Rejecting initially locked MrsP semaphores was due to a limitiation of
the early limitiation of the MrsP protocol.  This limitation no longer
exists.
2021-03-16 14:57:41 +01:00
Sebastian Huber
0965b7c8b7 rtems: Require RTEMS_PRIORITY for MrsP semaphores
MrsP semaphores are a generalization of the priority ceiling semaphores
for SMP configurations.  Priority ceiling semaphores are required to use
the priority task wait queue discipline.  Require this discipline also
for MrsP semaphores.

Close #4347.
2021-03-16 14:47:25 +01:00
Sebastian Huber
5d752e7b48 sp14: Fix for SMP or robust thread dispatch
Close #4343.
2021-03-16 14:01:08 +01:00
Sebastian Huber
c9a41b0043 score: Add Thread_Configuration::cpu_time_budget
Move the CPU time budget to the thread configuration.  This simplifies
_Thread_Initialize().
2021-03-16 12:48:37 +01:00
Sebastian Huber
5babc54d8d validation: Task create/construct
Run the task create/construct tests also on validation test suite 1
which has exactly one processor configured.
2021-03-16 12:47:52 +01:00
Sebastian Huber
586e06ec62 validation: Improve wording 2021-03-11 21:59:52 +01:00
Eshan dhawan
a26a326e55 Test suite for FTW.H methods
Signed-off-by: Eshan Dhawan <eshandhawan51@gmail.com>
2021-03-11 11:40:13 -06:00
Daniel Hellstrom
b2da982c87 leon,tn-0018: work around GRLIB-TN-0018 errata
Overview
========

The errata is worked around in the kernel without requiring toolchain
modifications. It is triggered the JMPL/RETT return from trap instruction
sequence never generated by the compiler and. There are also other
conditions that must must be true to trigger the errata, for example the
instruction that the trap returns to has to be a JMPL instruction. The
errata can only be triggered if certain data is corrected by ECC
(inflicted by radiation), thus it can not be triggered under normal
operation. For more information see:
	 www.gaisler.com/notes

Affected RTEMS target BSPs:
 * GR712RC
 * UT699
 * UT700/699E

The work around is enabled by defining __FIX_LEON3_TN0018 at build time.
After applying the following GCC patch, GCC will set the define when
compiling for an affected multilib:
  * GR712RC (-mcpu=leon3 -mfix-gr712rc)
  * UT700/UT699E (-mpcu=leon3 -mfix-ut700)
  * UT699 (-mcpu=leon -mfix-ut699)
When building for another multilib and TN0018 is still required, it
is possible to enable it on the RTEMS kernel configure line using the
TARGET_CFLAGS (-D__FIX_LEON3FT_TN0018) or other by other means.

The following GCC patch sets __FIX_LEON3FT_TN0018 for the affected RTEMS
multilibs:
---------
diff --git a/gcc/config/sparc/rtemself.h b/gcc/config/sparc/rtemself.h
index 6570590..ddec98c 100644
--- a/gcc/config/sparc/rtemself.h
+++ b/gcc/config/sparc/rtemself.h
@@ -33,6 +33,8 @@
        builtin_assert ("system=rtems");        \
        if (sparc_fix_b2bst)                    \
          builtin_define ("__FIX_LEON3FT_B2BST"); \
+       if (sparc_fix_gr712rc || sparc_fix_ut700 || sparc_fix_ut699) \
+         builtin_define ("__FIX_LEON3FT_TN0018"); \
     }                                          \
   while (0)
---------

Workaround Implementation
=========================

In general there are two approaches that the workaround uses:
 A) avoid ECC restarting the RETT instruction
 B) avoid returning from trap to a JMPL instruction

Where A) comes at a higher performance cost than B), so B) is used
where posssible. B) can be achived for certain returns from trap
handlers if trap entry is controlled by assembly, such as system calls.

A)
A special JMPL/RETT sequence where instruction cache is disabled
temporarily to avoid RETT containing ECC errors, and reading of RETT
source registers to "clean" them from incorrect ECC just before RETT
is executed.

B)
The work around prevents JMPL after system calls (TA instruction) and
modifies assembly code on return from traps jumping back to application
code. Note that for some traps the trapped instruction is always
re-executed and can therefore not trigger the errata, for example the
SAVE instruction causing window overflow or an float instruction causing
FPU disabled trap.

RTEMS SPARC traps workaround implementation:
   NAME                 NOTE   TRAP   COMMENT
 * window overflow         1 - 0x05   always returns to a SAVE
 * window underflow        1 - 0x06   always returns to a RESTORE
 * interrupt traps         2 - 0x10..1f special rett sequence workaround
 * syscall                 3 - 0x80   shutdown system - never returns
 * ABI flush windows       2 - 0x83   special rett sequence workaround
 * syscall_irqdis          4 - 0x89
 * syscall_irqen           4 - 0x8A
 * syscall_irqdis_fp       1 - 0x8B   always jumps back to FP instruction
 * syscall_lazy_fp_switch  5 - 0x04   A) jumps back to FP instruction, or to
                                      B) _Internal_error() starting with SAVE

 Notes:
 1) no workaround needed because trap always returns to non-JMPL instruction
 2) workaround implemented by special rett sequence
 3) no workaround needed because system call never returns
 4) workaround implemented by inserting NOP in system call generation. Thus
    fall into 1) when workaround is enabled and no trap handler fix needed.
 5) trap handler branches into both 1) and returning to _Internal_error()
    which starts with a SAVE and besides since it shuts down the system that
    RETT should never be in cache (only executed once) so fix not necessary
    in this case.

Any custom trap handlers may also have to be updated. To simplify that,
helper work around assembly code in macros are available in a separate
include file <libcpu/grlib-tn-0018.h>.

Close #4155.
2021-03-11 17:35:28 +01:00
Daniel Hellstrom
89d90c0019 sparc,leon: avoid triggering LEON3FT errata TN-0009
Close #4336.
2021-03-11 17:35:28 +01:00
Daniel Hellstrom
acad761b9c sparc,leon: avoid triggering TN-0009 bad sequence
Update #4336.
2021-03-11 17:35:28 +01:00
Daniel Hellstrom
6caff4d61d grlib,grspw_pkt: correct link state enum numbering
Not used by the driver itself, but shuold be correct if used by
application.
2021-03-11 17:35:28 +01:00
Martin Aberg
4e0735c650 leon, l2cache: prevent unused diagnostic access 2021-03-11 17:35:28 +01:00
Martin Aberg
51564f6383 leon, ahbstat: register definitions for AHBSTAT version 1 2021-03-11 17:35:27 +01:00
Martin Aberg
8660602ae2 leon, grspw_router: added router_port_link_div()
Allows user to set SpaceWire run clock divisor for an individual port.
2021-03-11 17:35:27 +01:00
Daniel Hellstrom
1d804cbcd4 sparc: fix bad register alignment for 64 bit store 2021-03-11 17:35:27 +01:00
Daniel Hellstrom
dfe7901c7f leon: restart and load timer counter at initialization
Without this smp05 and smpthreadlife01 tests may fail
depending on how the boot loader initialized the GPTIMER.
Before the time counter stopped counting when reaching
zero, but tests could work since it could take 2^32 us
before stopping.

The timer driver will potentially overwrite this, but it
happens later due to the initialization order having
RTEMS_SYSINIT_CPU_COUNTER very early.
2021-03-11 17:35:27 +01:00
Daniel Hellstrom
9c00cc1301 leon,ckinit: avoid assuming 1MHz timer pre-scaler clock 2021-03-11 17:35:27 +01:00
Daniel Hellstrom
b57436c8fc leon3: avoid dependency on apbuart/timer driver
Moves drvmgr_drivers[] from amba.c to a separate file in order
to avoid the dependecy on APBUART/GPTIMER drivers. This has
an effect when user configured not to use timer or uart
in their project.
2021-03-11 17:35:27 +01:00
Daniel Hellstrom
053b17ce8e leon,greth: added support for variable sized descriptor table sizes
The descriptor table size is equal to its alignment and set when
configuring the HW IP through VHDL generics. This SW patch simply
probes the HW how large the RX/TX descriptor tables are and adjusts
accordingly.

The number of descriptors actual used are controlled by other
settings (rxDescs and txDescs) controlled by the user.
2021-03-11 17:34:57 +01:00
Daniel Hellstrom
9bf8a9d147 leon,grcan: split out GRCAN non-FD specific support in separate file
Close #4324.
2021-03-11 17:31:21 +01:00
Daniel Hellstrom
9c76ca0c0c leon,grcanfd: split out GRCANFD specific support in separate file
Update #4324.
2021-03-11 17:31:21 +01:00
Daniel Hellstrom
43c903a1dc leon,grcan: added support for GRCANFD
The new GRCAN_FD IP supports CAN FD standard and is mostly backwards
compatible with GRCAN SW interface. The GRCAN driver have been extended
to support the GRCANFD IP using the same driver.

Additional functions have been added that uses a new CAN FD frame
format and read/write/baud-rate functions that supports both GRCANFD
and GRCAN. To keep the SW API fully backwards compatible with GRCAN,
the old functions remain.

Update #4324.
2021-03-11 17:31:21 +01:00
Daniel Hellstrom
b98d6b67f6 grlib: added 64-bit read no-cache function
Update #4324.
2021-03-11 17:31:21 +01:00
Daniel Hellstrom
65237ba01d leon,occan: use common CAN baud-rate calculation routine
Close #4323.
2021-03-11 17:31:21 +01:00
Daniel Hellstrom
4d19220742 leon,grcan: use common CAN baud-rate calculation routine
Update #4323.
2021-03-11 17:31:21 +01:00
Daniel Hellstrom
cff99cf1fa leon,can: introduce common CAN baud-rate calculation function
Reimplemented the baud-rate algorithm from scratch to cope with
GRCAN, GRCANFD and OC_CAN devices.

Update #4323.
2021-03-11 17:31:21 +01:00
Daniel Hellstrom
68c882ef45 grlib,ambapp: added new IP core IDs 2021-03-11 17:31:21 +01:00
Daniel Hellstrom
e227ae53ab leon,grspw: fix for SET_PACKET_SIZE
When the DMA table has been allocated dynamically, the IOCTL_SET_PACKETSIZE
will trigger an issue where pDev->rx and pDev->tx are not updated with
the new DMA tables base address. Instead the old pointers are used.

There is no point in reallocting the DMA tables because there is no
configuration option to it. Therefore the DMA tables allocation is
moved to a separate function never called from SET_PACKETSIZE.
2021-03-11 17:31:21 +01:00
Arvid Bjorkengren
50db7f2d6b leon,gr1553b: Only align allocated memory. Verify alignment of memory. 2021-03-11 17:31:21 +01:00
Arvid Bjorkengren
70f87f9e87 leon,gr1553b: set codec version
This is enables the updated codec for GR740 and is backwards compatible
with all other versions of the IP.
2021-03-11 17:31:21 +01:00
Arvid Bjorkengren
3344d0299f leon,gr1553rt: Fixed spinlock unlock 2021-03-11 17:31:21 +01:00
Arvid Bjorkengren
f798a75cd5 leon,gr1553rt: Fixed memory leak 2021-03-11 17:31:21 +01:00
Daniel Cederman
0cae482a45 sparc: Remove sequences that the B2BST scan script warns about
Update #4336.
2021-03-11 17:31:21 +01:00
Sebastian Huber
bfd1b6eef3 validation: Use common wording 2021-03-11 07:58:19 +01:00
Jan Sommer
92239318b1 bsps/xilinx_zynq: Add SPI driver to autotools build
Closes #4320
2021-03-10 20:12:08 +01:00
Jan Sommer
06129897a9 bsps/xilinx_zynq: Add SPI driver to waf
Updates #4320
2021-03-10 20:12:08 +01:00
Jan Sommer
cc825d0322 bsps/xilinx_zynq: Add SPI driver for cadence-spi
Updates #4320
2021-03-10 20:12:08 +01:00
Frank Kühndel
14bb077059 basedefs: Clarify RTEMS_STRING(), RTEMS_XSTRING() 2021-03-09 13:03:15 +01:00
Sebastian Huber
ba48f20e2a build: Fix broken link 2021-03-09 13:03:15 +01:00
Alex White
10db41e6f1 spec/aarch64: Enable previously disabled tests
This enables several testsuites that were initially disabled during
development.
2021-03-08 15:18:51 -06:00
Ryan Long
fbab8325a9 main_help.c: Unchecked return value from library (CID #1437650)
CID 1437650: Unchecked return value from library in rtems_shell_help().

Closes #4291
2021-03-08 14:04:10 -06:00
Ryan Long
55ba229d22 pwdgrp.c: Fix Unchecked return value from library (CID #1255518)
CID 1255518: Unchecked return value from library in pwdgrp_init().

Closes #4282
2021-03-08 14:04:10 -06:00
Ryan Long
8e34aa3b7b main_chmod.c: Fix Unchecked return value from library (CID #1063856)
CID 1063856: Unchecked return value from library in
rtems_shell_main_chmod().

Closes #4281
2021-03-08 14:04:10 -06:00
Ryan Long
597e4f4765 gen_uuid.c: Fix two Unchecked return value from library errors
CID 1049146: Unchecked return value from library in get_clock().
CID 1049147: Unchecked return value from library in get_random_fd().

Closes #4280
2021-03-08 14:04:10 -06:00
Ryan Long
3246fa42e2 main_edit.c: Fix Unchecked return value (CID #1255318)
CID 1255318: Unchecked return value in display_line().

Updates #4257
2021-03-08 14:04:10 -06:00
Sebastian Huber
e76470dfa7 validation: Use common wording 2021-03-08 11:04:55 +01:00
Sebastian Huber
1ce127e9df validation: Use common wording 2021-03-05 21:19:54 +01:00
Ryan Long
f762b7c272 grcan.c: Fix Unused value (CID #1437613)
CID 1437613: Unused value in grcan_set_filter().
This fix was recommended by Daniel Hellstrom (daniel@gaisler.com).

Closes #4301
2021-03-05 14:00:07 -06:00
Ryan Long
c57079a814 b1553brm.c: Fix Unsigned compared against 0 (CID #1399773)
CID 1399773: Unsigned compared against 0 in brm_write().

Closes #4295
2021-03-05 14:00:07 -06:00
Ryan Long
1f29ee4528 satcan.c: Fix Unsigned compared against 0 (CID #1399768)
CID 1399768: Unsigned compared against 0 in satcan_ioctl().

Closes #4294
2021-03-05 14:00:07 -06:00
Ryan Long
f804778881 gr_cpci_gr740.c: Unchecked return value from library (CID #1437630)
CID 1437630: Unchecked return value from library in gr_cpci_gr740_init1().

Closes #4290
2021-03-05 14:00:07 -06:00
Ryan Long
5f0a7ceb81 gr_tmtc_1553.c: Unchecked return value from library (CID #1399785)
CID 1399785: Unchecked return value from library in gr_tmtc_1553_init1().

Closes #4289
2021-03-05 14:00:07 -06:00
Ryan Long
4c0d9c5a57 gr_701.c: Unchecked return value from library (CID #1399783)
CID 1399783: Unchecked return value from library in gr701_init1().

Closes #4288
2021-03-05 14:00:06 -06:00
Ryan Long
91e38f8a8f gr_rasta_adcdac.c: Fix Unchecked return value from library (CID #1399780)
CID 1399780: Unchecked return value from library in gr_rasta_adcdac_init1().

Closes #4287
2021-03-05 14:00:06 -06:00
Ryan Long
17d525b584 gr_rasta_tmtc.c: Fix Unchecked return value from library (CID #1399771)
CID 1399771: Unchecked return value from library in gr_rasta_tmtc_init1().

Closes #4286
2021-03-05 14:00:06 -06:00
Ryan Long
570b558955 gr_leon4_n2x.c: Fix Unchecked return value from library (CID #1399767)
CID 1399767: Unchecked return value error from library in gr_cpci_leon4_n2x_init1().

Closes #4285
2021-03-05 14:00:06 -06:00
Ryan Long
0d33d10613 pci_cfg_read.c: Fix Missing break in switch (CID #1399723)
CID 1399723: Missing break in switch in pci_read_addressable().

Closes #4279
2021-03-05 14:00:06 -06:00
Ryan Long
b84ce61aa3 gr_rasta_io.c: Fix Unchecked return value from library (CID #1399763)
CID 1399763: Unchecked return value from library in gr_rasta_io_init1().

Closes #4284
2021-03-05 14:00:06 -06:00
Ryan Long
0443601356 gr_rasta_spw_router.c: Fix Unchecked return value from library (CID #1399760)
CID 1399760: Unchecked return value from library in gr_rasta_spw_router_init1().

Closes #4283
2021-03-05 14:00:05 -06:00
Ryan Long
c7eb89f82b cpuusagetop.c: Fix three Missing break in switch Coverity errors
CID 1399726: Missing break in switch in task_usage().
CID 1399728: Missing break in switch in task_usage().
CID 1399742: Missing break in switch in task_usage().

Closes #4278
2021-03-05 14:00:05 -06:00
Ryan Long
13d6fae8dd grtc.c: Fix four Missing break in switch Coverity errors
CID 1399761: Missing break in switch in process_dma().
CID 1399765: Missing break in switch in process_dma().
CID 1399766: Missing break in switch in process_dma().
CID 1399777: Missing break in switch in process_dma().

Closes #4277
2021-03-05 14:00:05 -06:00
Ryan Long
1eaf4e461f grspw.c: Fix Unchecked return value (CID #1399781)
CID 1399781: Unchecked return value in grspw_device_init().

Closes #4259
2021-03-05 14:00:05 -06:00
Jan Sommer
6ebf376bf2 bsps/shared: Allow setting baud rate for zynq uart 2021-03-05 19:06:25 +01:00
Kinsey Moore
f662420667 spec/aarch64: Rename ZynqMP QEMU BSPs
The current ZynqMP BSPs don't have _qemu in their name as do all other
RTEMS BSPs that are specifically made to run on QEMU. This fixes the
naming for those ZynqMP BSP variants for easier identification.
2021-03-05 10:40:28 -06:00
Kinsey Moore
a27ba3f20f bsps/aarch64: Add support for EL2 start
Add the stub necessary to boot on AArch64 under EL2 and drop to EL1 for
normal operation.
2021-03-05 08:43:15 -06:00
Kinsey Moore
9951cee08f bsps/aarch64: RTEMS_DEBUG stack alignment faults
Run with stack alignment faults enabled under RTEMS_DEBUG to catch any
stack misalignments early. This makes it easier to track them down
should they ever occur.
2021-03-05 08:43:15 -06:00
Kinsey Moore
9d77c0f425 spec: Move hypervisor start for use by AArch64
AArch64 on hardware is often started at EL2 instead of EL1 from either
u-boot or a first stage bootloader. This allows RTEMS to drop from EL2
execution to EL1 to operate as normal.
2021-03-05 08:43:15 -06:00
Alex White
0729781234 spec/aarch64: Remove sp37 from intermittent tests 2021-03-05 08:43:15 -06:00
Alex White
9aff7e5685 score/aarch64: Fix interrupt level reads 2021-03-05 08:43:15 -06:00
Kinsey Moore
bbc9974a24 cpukit: Explicitly enforce alignment requirements
According to commentary on GCC bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99143, the alignment
behavior of linker sections on which RTEMS has relied was never
guaranteed to be consistent across platforms and any alignment
requirements for linker sections needs to be enforced explicitly.
This adds those explicit alignment requirements.

Closes #4255.
2021-03-05 08:43:15 -06:00
Kinsey Moore
2ee12f023d bsps: Allow override of ARM TM27 IRQs
ZynqMP hardware appears to have an odd hard-wired SGI implementation in
which the SGIs are permanently set as enabled or disabled. Allow the
TM27 IRQs to be overridden as necessary.
2021-03-05 08:43:15 -06:00
Kinsey Moore
6bfbfb5a3d bsps/aarch64: Resolve usage of SUBALIGN()
Remove usage of SUBALIGN() in aarch64 linkcmds which works around a
difference in behavior on AArch64 platforms. This is no longer necessary
since alignment is now enforced explicitly.

Closes #4178.
2021-03-05 08:43:15 -06:00
Sebastian Huber
61d688bfcf aarch64: Fix context switch
The Per_CPU_Control::isr_dispatch_disable is a 32-bit integer.

Close #4206.
2021-03-05 15:06:18 +01:00
Sebastian Huber
524839568d score: Ensure stack alignment requirement
Make sure that a user-provided stack size is the minimum size allocated
for the stack.

Make sure we meet the stack alignment requirement also for CPU ports
with CPU_STACK_ALIGNMENT > CPU_HEAP_ALIGNMENT.
2021-03-05 06:58:33 +01:00
Sebastian Huber
1de00d685d CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE
Ensure that CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE meets the task
storage alignment requirement.
2021-03-05 06:58:33 +01:00
Sebastian Huber
8fe59be236 validation: Fix for 64-bit targets
Closes #4179.
2021-03-04 09:08:03 +01:00
Sebastian Huber
30f6fd5b3f rtems: Fix RTEMS_TASK_STORAGE_ALIGNMENT
Make sure we meet the stack alignment requirement for user-provided
thread storage areas.
2021-03-04 09:08:03 +01:00
Sebastian Huber
4a765b47a5 score: Enforce CPU_STACK_ALIGNMENT requirements
Clarify CPU_STACK_ALIGNMENT requirements in no_cpu port.  Add static
assertion to enforce CPU_STACK_ALIGNMENT requirements.
2021-03-04 09:08:03 +01:00
Jan Sommer
a510e24335 MAINTAINERS: Add myself to write after approval 2021-03-04 08:41:23 +01:00
Sebastian Huber
83b1b25d4c rtems: Simplify rtems_signal_catch()
In uniprocessor configurations, we can simplify rtems_signal_catch().
Add a validation test for the SMP special case.
2021-03-02 21:46:52 +01:00
Sebastian Huber
9a13f3796a rtems: Simplify _Signal_Action_handler()
Use the invariant that an ASR is only processed if ASR processing is
enabled.
2021-03-02 21:46:52 +01:00
James Fitzsimons
320cb42b18 bsps/beagle: Updating licences to latest BSD 2 clause 2021-03-02 19:48:48 +01:00
James Fitzsimons
db86c3eb4f bsps/beagle: Adding QEP driver support to BeagleBoneBlack BSP 2021-03-02 19:48:48 +01:00
Sebastian Huber
c0c4b8b8b5 validation: Format comment blocks 2021-03-02 07:56:15 +01:00
Sebastian Huber
441824ac7a score: Simplify _Objects_Name_to_id_u32()
Remove superfluous check for the objects maximum since the maximum is
also used as a loop limit.

Fix formatting.
2021-03-01 10:12:26 +01:00
Sebastian Huber
2ad03ded38 validation: Add comments to task tests 2021-03-01 10:12:26 +01:00
Sebastian Huber
81fcf16ae6 validation: Add comments to message queue tests
Split up post-condition.
2021-03-01 10:12:26 +01:00
Sebastian Huber
54c96305a8 validation: Add comments to signal tests 2021-03-01 10:12:26 +01:00
Sebastian Huber
34f279aa19 validation: Add comments to barrier tests
Unify code sections across tests.
2021-03-01 10:12:10 +01:00
Sebastian Huber
08cbd4ba20 score: Fix _Stack_Extend_size()
Check for an integer overflow.  Add a validation test for task create
errors.
2021-03-01 07:18:14 +01:00
Sebastian Huber
9dad735697 validation: Improve task construct error tests 2021-03-01 07:18:14 +01:00
Chris Johns
96918affc3 powerpc/motorola_power: Place any common data in the .bss section
- It seems the compiler how defaults to -fcommon and this means
  some uninitialised data is ignored.

Closes #4266
2021-02-28 13:17:05 +11:00
Chris Johns
75fb7a0ee5 powerpc/motorola_power: Link all text sections into the executable image
- The change to building all code with code and data sections means
  we have a section per function. Make sure all functions are
  placed in the text section.

Closes #4266
2021-02-28 13:16:53 +11:00
Vijay Kumar Banerjee
f0f8c111c5 getgrent.c, record-client.c: Add missing includes for assert.h 2021-02-27 08:51:53 -07:00
Ryan Long
e200265936 rtems-debugger-threads.c: Fix Unchecked return value error (CID #1468688)
CID 1468688: Unchecked return value in snapshot_thread().

Closes #4262
2021-02-26 16:56:07 -06:00
Ryan Long
e5e58da6df getgrent.c: Fix Unchecked return value error (CID #1459004)
CID 1459004: Unchecked return value in endgrent().

Closes #4261
2021-02-26 16:56:07 -06:00
Ryan Long
be3b87d471 record-client.c: Fix Unchecked return value (CID #1456677)
CID 1456677: Unchecked return value in resolve_hold_back().

Closes #4260
2021-02-26 16:56:07 -06:00
Ryan Long
1b322a6b83 printertask.c: Fix Unchecked return value (CID #1399710)
CID 1399710: Unchecked return value in printer_task().
CID 1472764: Unchecked return value in rtems_print_printer_task().

Closes #4258
2021-02-26 16:56:07 -06:00
Sebastian Huber
2428a8caf2 build: Install <rtems/score/hash.h>
Update #4267.
2021-02-26 09:57:05 +01:00
Sebastian Huber
de7df0419d bsps: Fix legacy build 2021-02-26 09:48:41 +01:00
Sebastian Huber
1ac4a85ebf score: Fix thread initialization
Close the thread object if a thread create extension fails.  Also call
the delete extension to avoid resource leaks in early extensions if a
late extension fails.

Close #4270.
2021-02-26 09:23:02 +01:00
Sebastian Huber
c96644e873 libtest: Print SHA256 hash in base64url 2021-02-26 09:10:09 +01:00
Sebastian Huber
74eff26c1d libtest: Report target hash
Update #4267.
2021-02-26 09:10:09 +01:00
Sebastian Huber
7480c34698 bsps: Add default rtems_get_target_hash()
Update #4267.
2021-02-26 09:10:09 +01:00
Sebastian Huber
bc6ffc3be8 Add system initialization step for target hash
Update #4267.
2021-02-26 09:10:09 +01:00
Sebastian Huber
fb17af2756 rtems: Add rtems_get_target_hash()
Update #4267.
2021-02-26 09:10:09 +01:00
Sebastian Huber
dea125d02c score: Add Hash Handler
Update #4267.
2021-02-26 09:10:07 +01:00
Sebastian Huber
5f8bc839e8 score: Add _IO_Base64url()
Update #4267.
2021-02-25 16:16:25 +01:00
Sebastian Huber
da8ad67e88 libtest: Report build label
Update #4269.
2021-02-25 16:16:20 +01:00
Sebastian Huber
d8bfa5a9bc rtems: Add rtems_get_build_label()
Update #4269.
2021-02-25 16:16:16 +01:00
Sebastian Huber
d138a7906a config: Adjust stack allocator initialization
Use the right system initialization step for the stack allocator
initialization.  Do the stack allocator initialization before the
workspace initialization so that _Memory_Allocate() can be used to get
memory for the allocator.
2021-02-24 13:32:35 +01:00
Sebastian Huber
32b0d6f84a bsps: Change license to BSD-2-Clause of some files
Change license to BSD-2-Clause according to file histories and
re-licensing agreement.

Update #3899.
2021-02-24 11:15:07 +01:00
Sebastian Huber
e8284a3458 build: Sort source lists
Use the Python sorted() function to sort the "source" lists.
2021-02-24 09:22:54 +01:00
Sebastian Huber
006c7020f4 validation: Simplify message queue construct tests 2021-02-24 09:22:36 +01:00
Sebastian Huber
fd83860323 validation: Add missing barrier create test case 2021-02-24 09:22:36 +01:00
Sebastian Huber
5be6e61481 libtest: Add support to seize/surrender objects 2021-02-24 09:22:36 +01:00
Sebastian Huber
d6a649d5bf rtems: Move rtems_task_priority definition
This type is not only used by Task Manager directives.  This is a
preparation to move the rtems_scheduler_*() directives from
<rtems/rtems/tasks.h> to a new <rtems/rtems/scheduler.h>.
2021-02-24 09:22:36 +01:00
Sebastian Huber
88543adeb5 score: Remove _CORE_barrier_Do_flush()
Call _Thread_queue_Flush_critical() directly.
2021-02-24 09:22:36 +01:00
Sebastian Huber
3cbdf19eac score: Simplify core barrier
Use the number of threads which must arrive at the barrier to trip the
automatic release also to indicate if the barrier is a manual release
barrier.
2021-02-24 09:22:36 +01:00
Sebastian Huber
0b263b0eb7 score: Remove _Objects_Open()
Use the type safe _Objects_Open_u32() instead.  Return the object
identifier to enforce a common usage pattern.
2021-02-24 09:22:36 +01:00
Sebastian Huber
3353820be7 build: Fix format in wscript 2021-02-23 10:05:52 +01:00
Sebastian Huber
508f868237 rtems: Simplify rtems_task_mode()
Do the preemption and ASR processing changes in one rush and acquire the
thread state lock only once.
2021-02-20 15:22:29 +01:00
Sebastian Huber
a7e180b95d rtems: Avoid potential recursion in ASR handling
Do the mode changes necessary for the ASR processing directly under
protection of the thread state lock to avoid the recursive calls to
thread dispatching done in rtems_task_mode().

Close #4244.
2021-02-20 15:21:34 +01:00
Sebastian Huber
08adc0dc7f rtems: Add _Modes_Apply_timeslice_to_thread()
Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
8778a0e118 rtems: New errors for rtems_signal_catch()
Ensure that no invalid modes are set during ASR processing.

Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
1739bd2439 rtems: Remove _Modes_Set_interrupt_level()
This call just obfuscated the call to _ISR_Set_level().

Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
b207b37898 posix: Remove superfluous check
The api pointer is never NULL.

Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
f6a97f5992 rtems: Simplify signal handling
Remove superfluous ASR_Information::signals_posted.  Move code out of
trivial inline functions.

Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
74ca8b7517 rtems: Move _Signal_Action_handler()
Move _Signal_Action_handler() and signal MP initialization to
rtems_signal_send().  The goal is to make _Signal_Action_handler() a
static function in a follow up patch.

Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
a52e5d9c7e rtems: Remove unused ASR_Information::nest_level
Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
9d5d73be63 rtems: Remove unused _Modes_Change()
Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
600360dadf rtems: Remove unused _Modes_Mask_changed()
Update #4244.
2021-02-20 15:18:49 +01:00
Sebastian Huber
f9a59164e8 score: Add _Thread_Append_post_switch_action()
Update #4244.
2021-02-20 15:18:48 +01:00
Sebastian Huber
fea848bbbc score: Change thread action locking
Require that the corresponding lock is acquired before the action
handler returns.  This helps to avoid recursion in the signal
processing.

Update #4244.
2021-02-20 15:18:48 +01:00
Sebastian Huber
3e7d658033 validation: Add signal manager tests
Update #4244.
2021-02-20 15:18:48 +01:00
Sebastian Huber
f38c0de407 validation: Add Validation1 test suite
Update #4244.
2021-02-20 15:18:48 +01:00
Ryan Long
fac1ff1820 grspw_pkt.c: Fix Dereference before null check (CID #1399846)
CID 1399846: Dereference before null check in grspw_addr_ctrl().

Closes #4253
2021-02-19 14:05:50 -06:00
Ryan Long
1fd56a96fc grtc.c: Fix Dereference before null check (CID #1399840)
CID 1399840: Dereference before null check in grtc_ioctl().

Closes #4252
2021-02-19 14:05:49 -06:00
Ryan Long
4edcdf43c7 b1553rt.c: Fix Deference before null check (CID #1399830)
CID 1399830: Dereference before null check in rt_control().

Closes #4251
2021-02-19 14:05:49 -06:00
Ryan Long
eff3d7c05f b1553brm.c: Fix Dereference before null check (CID #1399829)
CID 1399829: Dereference before null check in brm_control().

Closes #4250
2021-02-19 14:05:49 -06:00
Sebastian Huber
8b1b987201 rtems: Generate <rtems/rtems/signal.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-02-19 07:07:04 +01:00
Sebastian Huber
be60372136 basedefs: Add RTEMS_ALIGNOF() 2021-02-19 07:07:04 +01:00
Ryan Long
fa25b73ac1 shell.c: Fix Dereference before null check (CID #1467420)
CID 1467420: Dereference before null check in rtems_shell_line_editor().

Closes #4254
2021-02-18 13:34:33 -06:00
Sebastian Huber
407e351e11 rtems: Generate <rtems/rtems/sem.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-02-17 18:57:24 +01:00
Sebastian Huber
276828053e rtems: Generate <rtems/rtems/clock.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-02-17 18:57:24 +01:00
Sebastian Huber
0c4c03532c rtems: Generate <rtems/rtems/barrier.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-02-17 18:57:24 +01:00
Sebastian Huber
97825daf9c rtems: Clarify object services documentation
Unify the wording across similar directives of other managers.

Update #3993.
2021-02-17 18:57:07 +01:00
Sebastian Huber
7a1828ac61 rtems: Clarify IO manager documentation
Unify the wording across similar directives of other managers.

Update #3993.
2021-02-17 18:56:50 +01:00
Sebastian Huber
bf3b9f4536 rtems: Clarify partition manager documentation
Unify the wording across similar directives of other managers.

Update #3993.
2021-02-17 18:56:22 +01:00
Sebastian Huber
f9dc44afc7 rtems: Clarify timer manager documentation
Unify the wording across similar directives of other managers.  Add
"CONSTRAINTS" section.

Update #3993.
2021-02-17 18:56:04 +01:00
Sebastian Huber
2730599ca1 rtems: Clarify event manager documentation
Unify the wording across similar directives of other managers.  Add
"CONSTRAINTS" section.

Update #3993.
2021-02-17 18:55:24 +01:00
Chris Johns
026eb3db7e powerpc/motorola_powerpc: Add cache coherent memory to the allocator
Updates #4245
Updates #4243
2021-02-16 09:40:47 +11:00
Chris Johns
23aad642be powerpc/motorola_powerpc: Enable bus PCI support in LibBSD
Updates #4245
2021-02-16 09:40:29 +11:00
Chris Johns
6e3c6e044e powerpc/io: Make [out/in] le and be calls conditional
- These calls clash with the Linux IO header in LibBSD. Making these
  conditional here means BSPs build and the imported Linux header is
  untouched.

Updates #4245
2021-02-16 09:40:15 +11:00
Chris Johns
85df12728a powerpc/shared: Fix warnings in i8259 PIC code. 2021-02-16 09:40:03 +11:00
Chris Johns
53abbbd08d powerpc/shared: Fix warnings 2021-02-16 08:12:43 +11:00
Chris Johns
86f031d401 powerpc/motorola_powerpc: Fix tm27 warnings 2021-02-16 08:12:43 +11:00
Chris Johns
b5aef78b36 score: Fix warning in thread queue ops 2021-02-16 08:12:43 +11:00
Chris Johns
e1676c1a0d Update motorola_power to irq-generic interrupt management
- Add support to the BSP to enable irq-generic management

- Update the powerpc shared irq code to support irq-generic. This
  is an opt in option for existing powerpc bsps. This change
  should be simpler now

- Fix a number of issues in ISA IRQ controller handling by porting
  fixes from the i386 (PC) BSP

Closes #4238
Closes #4239
2021-02-13 13:26:07 +11:00
Ryan Long
f65d3384dd rtems-debugger-threads.c: Fix three Dereference before null check errors
CID 1468681: Dereference before null check in rtems_debugger_thread_continue().
CID 1468690: Dereference before null check in rtems_debugger_thread_system_resume().
CID 1468694: Dereference before null check in rtems_debugger_thread_find_index().

Closes #4241.
2021-02-12 17:13:19 -06:00
Ryan Long
3f4cdd8589 rtems-debugger-target.c: Fix Dereference before null check (CID #1468682)
CID 1468682: swbreaks is assigned a value dereferenced from target before
it has been verified that target is not null.

Closes #4240.
2021-02-12 17:13:16 -06:00
Ryan Long
14f5a0597a consolesimpletask.c: Fix Two Unchecked Return Values (CID #1437625 and #1472765)
CID 1437625: Unchecked return value from call to rtems_task_create().
CID 1472765: Unchecked return value from call to rtems_task_start().

Closes #4237.
2021-02-12 17:13:13 -06:00
Ryan Long
cc273ec10f Add macros to assert status and use it
These macros are to be used to check the status from calls that are flagged
by Coverity as 'Unchecked return value'.

Fix file assert.h
2021-02-12 17:13:10 -06:00
Chris Johns
426154f4fd cputkit/rtems: Remove warning 2021-02-13 07:09:38 +11:00
Chris Johns
03dff2019f libcsupport: Add sbrk greedy support to consume all sbrk memory
- Move the heap sbrk code into a separate routnine.

- Update heap and workspace greedy allocators to use the common
  sbrk greedy support.

Closes #3982
2021-02-10 17:28:32 +11:00
Sebastian Huber
570992dc27 bsp/riscv: Re-license to BSD-2-Clause
Change license to BSD-2-Clause according to file history.

Update #3053.
2021-02-09 08:18:58 +01:00
Sebastian Huber
286ff5868e basedefs: Add stringification of argument lists
Change RTEMS_STRING() and RTEMS_XSTRING() to accept a variable number of
arguments which is stringified.  This can be used for example to create
register lists for inline assembler statements.
2021-02-09 07:06:49 +01:00
G S Niteesh Babu
8b32f1d8c4 bsps/shared/ofw: Bug fixes
Fixed bugs in rtems_ofw_get_prop, rtems_ofw_get_prop_len
and removed hardcoded value.
2021-02-08 21:08:36 +01:00
G S Niteesh Babu
6da50db55b bsps/shared/ofw: Make rtems_ofw_get_effective_phandle iterative
Refactored recursive rtems_ofw_get_effective_phandle into a
iterative function.
2021-02-08 21:08:36 +01:00
G S Niteesh Babu
066687c43a bsps/shared/ofw: Use strlcpy instead of strncpy
Changed rtems_ofw_get_prop to use strlcpy instead of strncpy
to ensure the buffer is null terminated incase of overflow.
2021-02-08 21:08:36 +01:00
G S Niteesh Babu
c4985b7718 bsps/shared/ofw: Fix coverity reported defects
Fixed use after free and null pointer dereference defects

FIXES:
1) CID 1472601 (NULL_RETURNS)
2) CID 1472600 (USE_AFTER_FREE)
3) CID 1472599 (USE_AFTER_FREE)
4) CID 1472598 (USE_AFTER_FREE)
5) CID 1472596 (USE_AFTER_FREE)

The below two defects have to marked false positive
1) CID 1472597 (ARRAY_VS_SINGLETON)
2) CID 1472595 (ARRAY_VS_SINGLETON)
2021-02-08 21:08:36 +01:00
Sebastian Huber
fafc923044 validation: Tweak construct error tests
Unify the state names across tests and make sure the state names have a
similar length.
2021-02-08 08:44:14 +01:00
Sebastian Huber
e59efd8835 validation: Tests for barrier manager 2021-02-08 08:44:14 +01:00
Sebastian Huber
788fa865fb libtest: Add T_get_thread_timer_state() 2021-02-08 08:44:14 +01:00
Sebastian Huber
c9ceff92c3 validation: Add tests for rtems_build_name() 2021-02-08 07:52:42 +01:00
Chris Johns
7ca3b283ba libcsupport: Have greedy allocations use consume extended memory
- Call the heap extend handler until all memory has been
  requested.

Closes #3982
2021-02-08 17:45:52 +11:00
Chris Johns
822cad8967 libcsupport: Add no_regular_file_mknod as a mount option to the mount table
- Add the bool flag no_regular_file_mknod to the mount table so a file
  system can indicate creating regular files is not done by
  use the mknod handler. The file system will handle creating a
  file node in the open handler.

- Note, the mount option is an enum which means there is only one
  exclusive option supported. As a result no encapsulation is
  provided and file systems need to set no_regular_file_mknod directly.

Closes #4222
2021-02-08 13:10:37 +11:00
Chris Johns
ee14fdfe19 bsp/motorola_powerp: Print RTEMS_VERSION from the bootloader 2021-02-08 10:12:21 +11:00
Chris Johns
450e238bc6 powerpc/shared: ISA bus bridge fails to enable the openpic irq
- The call to enable the openpic irq for the ISA bridge fails
  because the IRQ used is offset by the ISA bus signals and
  the openpic call expects an IRQ relative to its signals.

- Add the MVME 2600/2700 to the list of boards with an ISA bridge.

Closes #4231
2021-02-08 10:11:13 +11:00
Sebastian Huber
96ea09ac4c score: Add barrier thread queue operations
This fixes a missing decrement of the number of waiting threads during a
barrier wait timeout.

Close #4230.
2021-02-06 20:55:51 +01:00
Sebastian Huber
9477d9aedb score: Make FIFO thread queue ops public
Update #4230.
2021-02-06 20:55:51 +01:00
Sebastian Huber
2b5ce23b99 score: Constify Thread_queue_First_operation
Update #4230.
2021-02-06 20:42:26 +01:00
Sebastian Huber
aa0060f4c1 rtems: Clarify partition manager documentation
Unify the wording across similar directives of other managers.  Add
"Constraints" paragraph.

Update #3993.
2021-02-03 06:10:21 +01:00
Sebastian Huber
98549e4524 score: _Objects_Build_name() signed/unsigned char
Change _Objects_Build_name() so that the result is independent of the
signedness of char.

Close #4228.
2021-02-03 05:58:49 +01:00
Sebastian Huber
ca68cfc898 rtems: Avoid duplicated implemenation
Use the rtems_clock_get_ticks_per_second() macro to implement the
rtems_clock_get_ticks_per_second() function.
2021-02-03 05:57:06 +01:00
Sebastian Huber
8a95e6f820 rtems: Rework object services API
Add a "Constraints" paragraph to the documentation.

Provide prototypes for programming language bindings.  Use the macro
implementation to implement the corresponding functions.

Update #3993.
2021-02-03 05:57:06 +01:00
Sebastian Huber
490e6e8809 score: Define _Assert() for static analysis runs
The goal is to reduce false positive NULL_RETURNS,
PW.NORETURN_FUNCTION_DOES_RETURN, PW.SET_BUT_NOT_USED,
UNUSED_VALUE, etc. issues produced by Coverity.

Define RTEMS_STATIC_ANALYSIS if a static analysis run by Coverity is
performed.
2021-02-01 14:19:28 +01:00
Sebastian Huber
8f7baef4a6 libtest: Remove double definition 2021-02-01 14:19:28 +01:00
Sebastian Huber
56494ed8d1 score: Clarify thread life state documentation 2021-02-01 12:48:10 +01:00
Sebastian Huber
05da65c297 score: Document Thread_Life_state 2021-02-01 10:15:57 +01:00
Sebastian Huber
51e59d59b7 nios2: Allow ISR nesting in dispatch variant
Rename _Nios2_ISR_Dispatch_with_shadow_non_preemptive() in
_Nios2_ISR_Dispatch_with_shadow_register_set().  Remove
_Nios2_ISR_Dispatch_with_shadow_preemptive().
2021-02-01 06:26:18 +01:00
Sebastian Huber
19acb3bc17 nios2: Optimize ISR dispatch variant
Use _Thread_Do_dispatch() in
_Nios2_ISR_Dispatch_with_shadow_non_preemptive().
2021-02-01 06:26:18 +01:00
Sebastian Huber
9165349d39 nios2: Use Per_CPU_Control::isr_dispatch_disable 2021-02-01 06:26:18 +01:00
Sebastian Huber
c968b27fbd nios2: Add TLS support
Update #4214.
2021-02-01 06:26:18 +01:00
Sebastian Huber
e324f8270f nios2: Make _ISR_Is_in_progress() weak
This allows the BSP to override this function.
2021-02-01 06:26:18 +01:00
Sebastian Huber
98c95d15e5 nios2: Fix ISR dispatch variants
The thread dispatch disabled level moved to _Per_CPU_Information some
time ago.
2021-02-01 06:26:18 +01:00
Sebastian Huber
9523887904 rtems: Fix implicit type conversions
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:26:18 +01:00
Sebastian Huber
fe08e454c6 score: Remove unused _SMP_Assert() 2021-02-01 06:26:18 +01:00
Sebastian Huber
9e56c85033 score: Fix implicit type conversion
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:26:16 +01:00
Sebastian Huber
d52c49611c rtems: Fix explicit type conversion
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:26:13 +01:00
Sebastian Huber
23f4e5b6c9 libtest: Fix implicit type conversions
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
c4db00db23 rtems: Mark value as used
This fix relates to a Coverity issue (UNUSED_VALUE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
0c992065b8 score: Remove double assignment
This fix relates to a Coverity issue (UNUSED_VALUE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
3b8137b094 libtest: Check return values with RTEMS_DEBUG
This fix relates to a Coverity issue (UNINIT).
2021-02-01 06:22:20 +01:00
Sebastian Huber
8d099f4ab4 score: Remove superfluous type qualifier
This fix relates to a Coverity issue
(PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
2c0506330f score: Simplify _CORE_message_queue_Broadcast()
This fix relates to a Coverity issue (PW.SET_BUT_NOT_USED).
2021-02-01 06:22:20 +01:00
Sebastian Huber
ab97ea6443 bsp/leon3: Improve printk() support
Use the idle stack to buffer early uses of printk().  Print the buffered
characters during initialization when the UART is available and before
the idle stack is used normally.

This fix relates to a Coverity issue (PW.SET_BUT_NOT_USED).
2021-02-01 06:22:20 +01:00
Sebastian Huber
3dcdb9c9e3 score: Simplify _MRSP_Wait_for_ownership()
Do not shadow the queue_context parameter with a local variable.  Reuse
the queue context to reduce the required stack space.

This fix relates to a Coverity issue (PW.PARAMETER_HIDDEN).
2021-02-01 06:22:20 +01:00
Sebastian Huber
5dc4f9c7f4 score: Fix implicit type conversion
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
c44ab8984e bsp/leon3: Fix incompatible function types
This fix relates to a Coverity issue (PW.INCOMPATIBLE_PARAM).
2021-02-01 06:22:20 +01:00
Sebastian Huber
198e92635c kern_tc.c: Remove unused code
This fix relates to a Coverity issue (PW.DECLARED_BUT_NOT_REFERENCED).
2021-02-01 06:22:20 +01:00
Sebastian Huber
450c170536 score: Add comments and asserts for clarification
This fix relates to a Coverity issue (NULL_RETURNS).
2021-02-01 06:22:20 +01:00
Sebastian Huber
64189a7076 score: Fix _CORE_message_queue_Submit() indentation
This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH).
2021-02-01 06:22:20 +01:00
Sebastian Huber
dc2a69871d bsp/leon3: Fix bsp_fatal_extension) indentation
Remove superfluous include.  Fix comment formatting.

This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH).
2021-02-01 06:22:20 +01:00
Sebastian Huber
395c15f655 score: Fix _Objects_Get_information() indentation
This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH).
2021-02-01 06:22:20 +01:00
Sebastian Huber
bf8d4b9479 score: Add _Thread_Get_objects_information()
We do not need all the checks if we have a valid indentifier to a thread
class object.

Using the new _Thread_Get_objects_information() instead of the inline
function _Thread_Get_objects_information_by_id() avoids dead code since
the identifier in a thread control is always valid and the return NULL
path in _Thread_Get_objects_information_by_id() would be dead code.  The
_Thread_Get_objects_information_by_id() should be an inline function
since it is used by _Thread_Get() and thus performance critical.  Static
analyzers which cannot derive that the identifier in a thread control is
always valid, may find a potential NULL pointer access (or otherwise
find dead code).

The identifier in an object control is always valid, see
_Objects_Initialize_information() and _Objects_Extend_information().

Move _RTEMS_tasks_Free() to the only source file which calls this
function.
2021-02-01 06:22:19 +01:00
Sebastian Huber
76eec484e5 score: Rename _Thread_Get_objects_information()
Rename _Thread_Get_objects_information() in
_Thread_Get_objects_information_by_id() to emphasize that this thread
method uses an object identifier and not a thread control.
2021-02-01 06:22:19 +01:00
Sebastian Huber
44ae183090 bsps/aarch64: Add missing include
Fixes:

bsps/shared/dev/irq/arm-gicv2.c:53:6: warning: no previous prototype for
'bsp_interrupt_dispatch' [-Wmissing-prototypes]

Close #4227.
2021-01-28 19:28:39 +01:00
Sebastian Huber
f8b6359415 bsp/leon3: Simplify bsp_interrupt_is_valid_vector()
There is not need to check that vector >= BSP_INTERRUPT_VECTOR_MIN since
BSP_INTERRUPT_VECTOR_MIN is zero and vector is unsigned.

This fix relates to CID 1399742 (NO_EFFECT).
2021-01-28 11:12:43 +01:00
Sebastian Huber
fcbefb5ee6 rtems: Use _Status_Get()
This fixes implicit conversions between different enum types.
2021-01-28 09:58:03 +01:00
Sebastian Huber
b361eabd93 bsps: Replace bsp_specs with an empty file
This fixes an issue with the latest tool chain which adds the default
linker script in the endfile specification.

Update #3250.
2021-01-28 06:28:33 +01:00
Sebastian Huber
e269e389ea libtest: Remove superfluous NULL pointer check
This fix relates to CID 1468683 (REVERSE_INULL).
2021-01-27 19:08:29 +01:00
Sebastian Huber
426b6cdba9 libtest: Use dependency injection
This helps static analyzers.
2021-01-27 19:08:29 +01:00
Sebastian Huber
361ec32070 cacheimpl.h: Avoid potential dead code
If CPU_DATA_CACHE_ALIGNMENT == CPU_INSTRUCTION_CACHE_ALIGNMENT we had
dead code with the previous implementation.

This fix relates to CID 1399776 (DEADCODE).
2021-01-27 19:02:03 +01:00
Sebastian Huber
3272dcb364 Update copyright notice to 2021 2021-01-27 09:41:07 +01:00
Sebastian Huber
b35ac9901c rtems: Add "Notes" paragraph header
Place the paragraphs in the same order as the directive documentation in
the RTEMS Classic API Guide.

Update #3993.
2021-01-27 06:01:48 +01:00
Sebastian Huber
30c71c3a69 heap: Fix _Heap_Area_overhead()
The first block must be a proper block.  Account for this in
_Heap_Area_overhead().
2021-01-26 15:29:36 +01:00
Sebastian Huber
c734e8660f cpucounter: Increase conversion accuracy
The maximum frequency is UINT32_MAX.  Converted to a uint64_t variable
it can be shifted by 32.  The addition does not overflow since bin_per_s
- 1 is UINT32_MAX.
2021-01-26 15:29:36 +01:00
Sebastian Huber
9d2db27adf build: Add CPPFLAGS to assembler command line
We use GCC to call the assembler.  This means the assembler files are
processed by the C preprocessor.
2021-01-26 15:29:36 +01:00
Sebastian Huber
9eb9813dc1 bsps: Add missing DWARF 5 sections
Sort alphabetically.
2021-01-26 15:29:36 +01:00
Sebastian Huber
40c4e2ecc3 build: Add test excludes 2021-01-26 07:17:50 +01:00
Sebastian Huber
33c12d5f92 bsps: Support DWARF 5 sections
GCC 11 uses DWARF 5 by default.
2021-01-25 12:56:00 +01:00
Sebastian Huber
a6689fb147 Improve file header comment in generated files 2021-01-25 06:49:27 +01:00
Sebastian Huber
c709017efb Fix RTEMS_LINKER_ROSET_ITEM_ORDERED_DECLARE()
Add "extern" similar to RTEMS_LINKER_RWSET_ITEM_ORDERED_DECLARE().

Close #4221.
2021-01-25 06:44:37 +01:00
Sebastian Huber
70c34fb58c splinkersets01: Fix declaration
GCC 11 produced warnings like this:

items.c:21:1: warning: ignoring attribute
'section (".rtemsrwset.test_rw.content.0.1")' because it conflicts with
previous 'section (".rtemsrwset.test_rw.content.1")' [-Wattributes]

items.c:23:1: warning: ignoring attribute
'section (".rtemsroset.test_ro.content.0.OC")' because it conflicts with
previous 'section (".rtemsroset.test_ro.content.1")' [-Wattributes]
2021-01-23 20:03:56 +01:00
Christian Mauderer
c45da42b7a bsps/shared: Build fsl-edma only for certain BSP
Move the Freescale EDMA driver to it's own object and build it only for
the BSP that is currently using it.
2021-01-22 15:51:14 +01:00
Christian Mauderer
7b99d7619e bsp/imx: Fix system counter init for imx6
For i.MX7 U-Boot initializes the system counter. On i.MX6 Barebox is
often used which doesn't initialize the counter. With this patch, we try
to auto-detect whether the counter is initialized or not and do the
initialization ourself if necessary.

Closes #3869
2021-01-21 10:17:31 +01:00
Christian Mauderer
36b4e8c394 bsps/imxrt: Add ioctl to LPSPI to get registers
This allows an application to get the registers of the LPSPI. That is
usefull for applications that want to use DMA for a very specialized and
highly optimized communication.

Update #4180
2021-01-21 10:17:31 +01:00
Christian Mauderer
b2f265ab9f cpukit/spi: Allow driver specific ioctl
This allows a SPI driver to add a hardware specific ioctl.
2021-01-21 10:17:31 +01:00
Christian Mauderer
d9794a1f97 bsps/imxrt: Add DMA numbers to dtsi
Also currently no driver uses these numbers, it is usefull for
applications that want to use the DMA.

Update #4180
2021-01-21 10:17:31 +01:00
Christian Mauderer
a434cc80cb bsps/shared: Adapt fsl-edma driver for imxrt
Note: The changes have been done with portability in mind. The driver
should (in theory) be able to replace the original one in the MPC BSPs
too. For full compatibility an adaption layer and especially a test
would be necessary. Because both are missing, don't integrate it into
the MPC BSP now.

Update #4180
2021-01-21 10:17:31 +01:00
Christian Mauderer
301bbc3a4d bsps/shared: Copy fsl-edma from mpc55xx
This is a preparation for making the driver universal.

Update #4180
2021-01-21 10:17:31 +01:00
Christian Mauderer
22e9dafb74 bsps/imxrt: Use standard names to avoid warnings
If spi or i2c slaves are "connected" to the spi or i2c bus, the device
tree compiler complains if the busses are not named spi or i2c.

Update #4180
2021-01-21 10:17:31 +01:00
Sebastian Huber
8ee22b2975 mrsp: Change error status for a nested seize
Return STATUS_DEADLOCK (RTEMS_INCORRECT_STATE) to indicate a nested
seize since this is a kind of deadlock.  This status code is also used
for other deadlocks.

Update #4217.
2021-01-21 10:10:34 +01:00
Kinsey Moore
7c30dca2b5 bsps/aarch64: Swap primary ZynqMP UART
Both Qemu and actual hardware treat the second UART in memory map as the
primary UART. This adjusts the ZynqMP BSPs to match.
2021-01-14 13:32:06 -06:00
Chris Johns
7696533b97 cpukit: Merge FreeBSD values for the priorities
It seems we need valid values or assumptions in the FreeBSD about
these values breaks some of the code.

Closes #4207
2021-01-08 09:51:48 +11:00
Sebastian Huber
6600585fc8 bsp/stm32h7: Split console configuration
This allows applications to individually provide configuration
structures.

Update #4209.
2021-01-04 19:23:15 +01:00
Sebastian Huber
affc8de85f bsp/stm32h7: Split start configuration
This allows applications to individually provide configuration
structures.

Update #4209.
2021-01-04 19:22:53 +01:00
G S Niteesh Babu
f867e7b6f4 libtests/ofw01: Added a test for RTEMS OFW
This commit adds a basic test that tests all the implemented
RTEMS OFW functions.
2020-12-27 10:05:09 +01:00
G S Niteesh Babu
9d2ed41fcb bsps/shared/ofw: Implement RTEMS OFW interface
RTEMS OFW is a FDT only implementation of the OpenFirmWare
interface. This API is created to be compatible with FreeBSD
OpenFirmWare interface. The main intention is to make
porting of FreeBSD drivers to RTEMS easier.

Most functions implemented have an direct one-one mapping
with the original OFW API and some extra auxiliary functions
were implemented to make working with device trees easier in
RTEMS.

Update #3784
2020-12-27 10:05:02 +01:00
Sebastian Huber
828ea6ee86 Update header.am 2020-12-23 10:25:33 +01:00
Sebastian Huber
81c7f5be92 arm/fvp: New BSP
This BSP supports the Arm Fixed Virtual Platform.  Only the Cortex-R52
processor configuration is supported by the BSP.  It should be easy to
add support for other variants if needed.

Update #4202.
2020-12-23 09:24:49 +01:00
Sebastian Huber
016bcb3f9d bsps/arm: Rely on initialized vector table
The arm_cp15_set_exception_handler() is a complicated function which
should be avoided if possible.

Update #4202.
2020-12-23 09:24:49 +01:00
Sebastian Huber
9f3a08ef2d bsps: Use header file for GIC architecture support
This avoids a function call overhead in the interrupt dispatching.

Update #4202.
2020-12-23 09:24:49 +01:00
Sebastian Huber
23d9223ad3 bsps/arm: Invalidate TLB in start.S
Update #4202.
2020-12-23 09:24:47 +01:00
Sebastian Huber
e164df5e33 bsps/arm: Clear SCTLR[M, I, A, C] in start.S
Initialize the data and unified cache levels.  Invalidate the
instruction cache levels.

Update #4202.
2020-12-23 09:19:28 +01:00
Sebastian Huber
b32fd22732 bsps/arm: Add arm-data-cache-loop-set-way.h
This makes it possible to reuse this loop.

Update #4202.
2020-12-23 09:19:28 +01:00
Sebastian Huber
46a3c0446f bsps/arm: Remove optional start hook arguments
The start hook arguments are not used by a BSP.  Removing them avoids
the need for a stack during the very early system initialization.

Update #4202.
2020-12-23 09:19:28 +01:00
Sebastian Huber
76a1a53780 bsps/arm: Invalidate branch predictors earlier
Make sure the branch predictors are invalidated before the first branch
is executed.

Update #4202.
2020-12-23 09:19:28 +01:00
Sebastian Huber
272534eb72 bsps/arm: Set VBAR in start.S
Set the VBAR to the vector table in the start section before
bsp_start_hook_0() is called to earlier handle exceptions in RTEMS.

Set the VBAR to the normal vector table in start.S for the main
processor.  Secondary processors set it in bsp_start_hook_0().

Update #4202.
2020-12-23 09:19:17 +01:00
Sebastian Huber
854ea2b4d8 arm: Add support for Arm PMSAv8-32
Update #4202.
2020-12-22 13:02:41 +01:00
Sebastian Huber
6944cd10e6 arm: Add header file for AArch32 System Registers
Update #4202.
2020-12-22 13:02:41 +01:00
Sebastian Huber
39ef7e5496 bsps: Fix includes
Update #4202.
2020-12-22 13:02:41 +01:00
Sebastian Huber
be5eee575b libdebugger: Fix for Armv8-R
This architecture variant has no MMU.

Update #4202.
2020-12-22 13:02:39 +01:00
Sebastian Huber
a299c4feef arm: Optimize arm_interrupt_disable()
Update #4202.
2020-12-16 11:00:03 +01:00
Sebastian Huber
b5aceef5d9 bsps: Remove gicvx_interrupt_dispatch()
Avoid one level of indirection.

Update #4202.
2020-12-16 11:00:03 +01:00
Sebastian Huber
747fb65c6e bsps: Add GICv3 arm_gic_irq_processor_count()
Update #4202.
2020-12-16 11:00:03 +01:00
Sebastian Huber
7cf7e1d61d build: Add ABI flags to gnatmake compiler flags 2020-12-16 11:00:03 +01:00
Sebastian Huber
d3f2ecc87a build: Fix duplicate install of jffs2.h 2020-12-16 07:12:25 +01:00
Sebastian Huber
0deeb02527 bsps/arm: Fix MMU configuration
Update #4184.
2020-12-15 11:25:44 +01:00
Christian Mauderer
eb2b915609 cpu/armv7m: Fix table based init for ARMV7M_MPU
Somehow the table index has been missing in the latest patch version.
With that, the configuration for the first region has been applied
multiple times.

Update #4180
2020-12-14 11:33:46 +01:00
Christian Mauderer
9b3def237a bsps/arm/imx*: Fix location of shared headers
When moving the headers from the imx BSP to the shared area, the wrong
directory has been selected. This patch fixes that problem.

Update #4180
2020-12-14 11:29:36 +01:00
Christian Mauderer
b63a187ec0 bsps/imxrt: Split up dts.
This allows simpler creation of own dts files for custom boards.

Update #4180
2020-12-14 11:10:38 +01:00
Christian Mauderer
1618e69f0e shell: Add i2c and spi commands
This adds some commands that are usefull for debugging simple serial
interfaces.

Even if they are a complete re-implementation, the i2c* commands use a
simmilar call like the Linux i2c tools.
2020-12-14 10:48:57 +01:00
Christian Mauderer
66723ee6d2 bsp/rtl22xx: Fix non-ASCII character 2020-12-14 10:48:57 +01:00
Christian Mauderer
2f509b572f bsp/mpc83xx: Fix non-ASCII characters 2020-12-14 10:48:57 +01:00
Christian Mauderer
21a0d20c68 bsps: Replace non-ASCII bullet points 2020-12-14 10:48:57 +01:00
Christian Mauderer
86d3c27525 bsps: Replace non-ASCII trademark symbol 2020-12-14 10:48:57 +01:00
Christian Mauderer
2fbc8897fa bsps: Replace non-ASCII copyright character 2020-12-14 10:48:57 +01:00
Sebastian Huber
fcd9618ac8 config: Fix invalid static assertions in C
Expressions in static assertions must be integral constant expressions.  In
integral constant expressions the use of address constant expressions is not
allowed.

In static initializers the address constant expressions are allowed.  Introduce
a new macro _CONFIGURE_ASSERT_NOT_NULL() which leads to a compile time error if
the second parameter is NULL.  It generates error messages like this if for
example

  #define CONFIGURE_INIT_TASK_ENTRY_POINT NULL

is provided by the application:

cpukit/include/rtems/confdefs/inittask.h:51:26: error: size of unnamed array is negative
   51 |     ( _type ) sizeof( int[ ( _value ) != NULL ? 1 : -1 ] ) )
      |                          ^
cpukit/include/rtems/confdefs/inittask.h:170:3: note: in expansion of macro '_CONFIGURE_ASSERT_NOT_NULL'
  170 |   _CONFIGURE_ASSERT_NOT_NULL(
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~

This fix relates to CID 1470570 (PARSE_ERROR).

Update #4181.
2020-12-12 11:35:22 +01:00
Kinsey Moore
9edca35dbe bsps/gicv3: Resolve build warnings on 64bit 2020-12-11 15:32:15 -06:00
Kinsey Moore
9e7b5ebd7d tm27: Use generic cpu index accessor
The arm_cp15 function for accessing the current CPU index is specific
to ARMv7 while this header is used for ARMv8 as well. Instead, use a
generic accessor that is part of the standard CPU API.
2020-12-11 15:32:15 -06:00
Sebastian Huber
bb57361bfd build: Clarify ARM_MMU_USE_SMALL_PAGES description 2020-12-11 11:40:35 +01:00
Jan Sommer
cadbd7d150 bsp/xilinx_zynq: Enable support for 4kiB MMU pages
- Disabled by default
- Enable using ARM_MMU_USE_SMALL_PAGES option

Close 4192.
2020-12-11 11:40:35 +01:00
Jan Sommer
1a7afb55a3 bsps/arm: Fix MMU small pages support
- For small tables only round to the next 4kiB instead of 1MiB

Close #4184.
2020-12-11 06:54:14 +01:00
Kinsey Moore
d188e6e882 cpukit/aarch64: Add explanation of exception flow 2020-12-10 11:37:50 -06:00
Kinsey Moore
f046af5804 cpukit/aarch64: Use hex consistently for offsets 2020-12-10 11:37:50 -06:00
Sebastian Huber
105e52032e bsps: Remove ARM GIC SGI target filter
Remove the target filter for software-generated interrupts since this
feature is not supported by the affinity routing in GICv3.

Update #4202.
2020-12-10 09:42:50 +01:00
Sebastian Huber
b6925e10c8 bsps: Fix GICv3 arm_gic_trigger_sgi()
Use the targets parameter to determine the targets of the SGI.  Change
targets parameter type to 32-bit to ease the parameter passing.  GICv3
supports up to 16 targets.

Update #4202.
2020-12-10 09:42:49 +01:00
Sebastian Huber
6b79abfbbc bsp/realview-pbx-a9: Fix smpfatal04 test 2020-12-10 09:42:49 +01:00
Sebastian Huber
617aeaf572 bsps/arm: Move BSP_START_IN_HYP_SUPPORT option
Clarify documentation.

Update #4202.
2020-12-10 07:58:03 +01:00
Sebastian Huber
bd7bef528d bsps/arm: Support system level ARM Generic Timer
Update #4202.
2020-12-10 07:58:03 +01:00
Sebastian Huber
5efa15b49d bsps/arm: Unify ARM Generic Timer options
Update #4202.
2020-12-10 07:58:03 +01:00
Sebastian Huber
e68827e1d9 arm/cache-cp15: Support Armv8
Update #4202.
2020-12-10 07:58:03 +01:00
Sebastian Huber
9955487de6 arm: Support Armv8 in <rtems/score/arm.h>
Update #4202.
2020-12-10 07:58:03 +01:00
Sebastian Huber
368fab5a82 bsps: Print CPU in default fatal error extension 2020-12-10 07:58:03 +01:00
Sebastian Huber
293cde73f3 build: Exclude performance-0 in small mem BSPs 2020-12-10 07:58:03 +01:00
Sebastian Huber
9ce47a52a4 bsps: Add SMP support to ARM GICv3
Update #4202.
2020-12-09 17:30:52 +01:00
Sebastian Huber
0e779a4c2e smptests/smpipi01: Fix sporadic test failure 2020-12-09 08:22:42 +01:00
Kinsey Moore
2365c93745 spec: Move zynq-uart into its own object
Currently, zynq-uart code is always built and has some requirements for
BSPs that use it. Instead of making all BSPs satisfy that requirement or
working around it by setting defaults, this moves the zynq-uart code
into its own spec build object so it can be included if needed.
2020-12-04 12:42:06 -06:00
Kinsey Moore
74c1c4021b spec/optconminor: Fix value type
The option for defining the console minor should be an integer, not a
boolean.
2020-12-04 07:57:15 -06:00
Kinsey Moore
a92d4ae685 Add AArch64 ZynpMP BSP
This adds a BSP family that runs on the Xilinx Ultrascale+ MPSOC
(ZynqMP) family of chips. It is configured to be usable on the Qemu
ZCU102 machine definition and should be almost trivially portable to
ZynqMP development boards and custom hardware. It is also configured to
be usable with libbsd.
2020-12-04 07:57:15 -06:00
Kinsey Moore
5686b44d13 zynq-uart: Fix set_attributes implementation
The zynq-uart set_attributes implementation was configured to always
return false which causes spconsole01 to fail. This restores the
disabled implementation which sets the baud rate registers
appropriately and allows spconsole01 to pass. This also expands the
set_attributes functionality to allow setting of the stop bits,
character width, and parity.
2020-12-03 17:35:28 -06:00
Kinsey Moore
2b56f5af5e samples/unlimited: Prevent compile error
For architectures with relatively large minimum stack sizes, this test
breaks during compilation due to a static check. The init task stack
size should not need to be set for this test.
2020-12-03 17:33:37 -06:00
Sebastian Huber
5b064a49f9 bsps: Remove unused bsp_stack_main_size 2020-12-03 15:41:38 +01:00
Sebastian Huber
7930fbdd9a score: Fix discard 'const' qualifier warning 2020-12-03 15:41:38 +01:00
Sebastian Huber
768327d06d rtems: Generate <rtems/rtems/timer.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-12-03 07:12:12 +01:00
Sebastian Huber
e2f888d145 score: Free old name in _Objects_Set_name()
This is the behaviour document in the RTEMS Classic API Guide.
2020-12-03 07:12:12 +01:00
Sebastian Huber
766009b4f1 rtems: Fix rtems_object_set_name()
Return RTEMS_NO_MEMORY if there is not memory available to duplicate the
name.
2020-12-03 07:12:12 +01:00
Sebastian Huber
13bab346c5 score: Return a status in _Objects_Set_name() 2020-12-03 07:12:12 +01:00
Sebastian Huber
65969c1b73 rtems: Generate <rtems/rtems/object.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-12-03 07:12:12 +01:00
Kinsey Moore
dfa34e0dbb spec/a53: Fix SPDX lines 2020-12-02 18:51:40 -06:00
Kinsey Moore
a151ee167e bsps: Move ARM GICv2 driver to bsps/shared
This moves the ARM GICv2 driver to bsps/shared to be usable by AArch64
code.
2020-12-02 18:51:40 -06:00
Kinsey Moore
f0859573f9 bsps: Move zynq-uart to bsps/shared
This moves the zynq-uart driver from bsps/arm/shared to bsps/shared to
accomodate use by AArch64 BSPs.
2020-12-02 18:51:40 -06:00
Sebastian Huber
ef0fe8ee60 dosfs: Fix Doxygen group placement
Update #3706.
2020-12-02 13:18:42 +01:00
Sebastian Huber
3393ff1dcf libfs: Fix Doxygen group placement
Update #3706.
2020-12-02 13:11:11 +01:00
Sebastian Huber
ab8538385b nfsclient: Remove from Doxygen output
The libnetworking is excluded from the Doxygen output.  Exclude also the
nfsclient source code, otherwise there are some orphaned Doxygen groups.

Update #3706.
2020-12-02 13:03:49 +01:00
Sebastian Huber
295b05f965 nfsclient: Rework Doxygen groups
Update #3706.
2020-12-02 13:03:32 +01:00
Sebastian Huber
7f1ba9c75c build: Add <rtems/rtems/clockimpl.h> 2020-12-02 11:41:09 +01:00
Sebastian Huber
1fa3821ad6 score: Fix Doxygen group membership
Update #3706.
2020-12-02 11:34:33 +01:00
Sebastian Huber
1c6062230f score: Fix Doxygen group name
Update #3706.
2020-12-02 11:34:29 +01:00
Sebastian Huber
c296d150db rtems: Fix Doxygen return description 2020-12-02 08:55:12 +01:00
Sebastian Huber
1af4493bdb rtems: Clarify invalid identifier descriptions
Update #3993.
2020-12-02 08:33:11 +01:00
Sebastian Huber
5a285e3844 rtems: Clarify rtems_partition_delete()
Move the PTCB sentence to the notes to be in line with
rtems_partition_create().

Update #3993.
2020-12-02 08:16:03 +01:00
Sebastian Huber
8756d5ce06 rtems: Clarify rtems_partition_create()
The rtems_partition_create() returns an object identifier and not just a
partition identifier.

Update #3993.
2020-12-02 08:16:03 +01:00
Sebastian Huber
5555c0cb98 rtems: Fix Doxygen group name
Update #3706.
2020-12-02 08:15:32 +01:00
Sebastian Huber
226b90b455 rtems: Fix Doxygen group memberships
Update #3706.
2020-12-02 08:13:26 +01:00
Sebastian Huber
70dbafbf5e config: Canonicalize @defgroup and @file comments
Adjust group identifier and names to be in line with a common pattern.
Use common phrases for the group and file brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
3db9c820e5 sapi: Canonicalize @defgroup and @file comments
Adjust group identifier and names to be in line with a common pattern.
Use common phrases for the group and file brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
9278f3d04f score: Canonicalize Doxygen @file comments
Use common phrases for the file brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
6b5f22dcbb rtems: Canonicalize Doxygen @file comments
Use common phrases for the file brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
23494c2bfa score: Always define RTEMSScoreMRSP group
This fixes a Doxygen warning.
2020-12-02 07:45:53 +01:00
Sebastian Huber
c81ac0e750 score: Canonicalize Doxygen groups
Adjust group identifier and names to be in line with a common pattern.
Use common phrases for the group brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
e07088d9ba rtems: Canonicalize implementation Doxygen groups
Rename Classic API top-level group from Classic to RTEMSImplClassic.
Use RTEMSImplClassic as a prefix for the subgroups.  Change the group
names to be in line with the API group names.  Use common phrases for
the group brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
9c20b987cd rtems: Add <rtems/rtems/clockimpl.h> 2020-12-02 07:45:53 +01:00
Sebastian Huber
501bd46fd6 shell: Rename "IO" typedef for better Doxygen
An automatic link from every place in the documentation which mentions
"IO" to this dd command internal "IO" typedef is not really nice.
2020-12-02 07:45:53 +01:00
Sebastian Huber
b1a8be45b0 rtems: Simplify includes in version.c 2020-12-02 07:45:53 +01:00
Sebastian Huber
3732c93182 posix: Delete unused _POSIX_Fatal_error() 2020-12-02 07:45:52 +01:00
Sebastian Huber
b48b1808a1 score: Delete empty pheapinit.c 2020-12-02 07:45:52 +01:00
Sebastian Huber
7995329f5c rtems: Fix documentation in <rtems/rtems/part.h>
Update #3993.
2020-12-01 14:42:16 +01:00
Sebastian Huber
6c8c774f5b rtems: Remove empty and unused rtclock.c 2020-11-27 16:15:04 +01:00
Sebastian Huber
6e566badc7 config: CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE
Fix the documentation.

Update #4181.
2020-11-27 09:52:42 +01:00
Sebastian Huber
3a5c33a7ce sapi: Remove obsolete README file 2020-11-27 09:07:40 +01:00
Sebastian Huber
2406fe894e rtems: Delete rtems_object_id_api_maximum_class()
This directive has no implementation.  It is documented in the RTEMS
Classic API Guide.

It was added by

commit 6c06288f64
Author: Joel Sherrill <joel.sherrill@OARcorp.com>
Date:   Tue Jan 29 21:52:21 2008 +0000

without an implementation.  The later change

commit fdc57ca4b6
Author: Joel Sherrill <joel.sherrill@OARcorp.com>
Date:   Mon Nov 23 14:53:04 2009 +0000

renamed the similar rtems_object_id_api_minimum_class() in
rtems_object_api_minimum_class().

The rtems_object_api_maximum_class() is documented and implemented.  It
can be assumed that the rtems_object_id_api_maximum_class() is a
fragement left over from development.
2020-11-27 08:44:43 +01:00
Sebastian Huber
06386fc76f Use CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE
Update #4181.
2020-11-26 11:10:22 +01:00
Sebastian Huber
6c1afc19f6 config: Check CONFIGURE_INIT_TASK_STACK_SIZE 2020-11-26 11:10:22 +01:00
Sebastian Huber
657e30c135 config: CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE
In order to better support applications which use the new
rtems_task_construct() directive add the
CONFIGURE_INIT_TASK_CONSTURCT_STORAGE_SIZE configuration option.  If
this option is specified, then the Classic API initialization task is
constructed with rtems_task_construct().

Update #4181.
2020-11-26 11:10:22 +01:00
Sebastian Huber
bc175a1cab Avoid INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL
Replace a runtime check with a compile time assertion.  This makes the
INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL obsolete.

Update #4181.
2020-11-26 11:10:21 +01:00
Sebastian Huber
ef8c4ebce7 config: Clarify the use of pragmas 2020-11-26 11:10:21 +01:00
Sebastian Huber
b2a677bb6f rtems: Move "Set Errno" group to the API 2020-11-26 11:10:21 +01:00
Sebastian Huber
41725e9533 score: Change _Per_CPU_Information declaration
Change the _Per_CPU_Information declaration so that Doxygen can parse
it.  This attribute placement is also in line with the _Alignas()
specifier of C11.
2020-11-26 11:10:21 +01:00
Sebastian Huber
139306c415 rtems: Remove unused barriermp.h 2020-11-26 11:10:21 +01:00
Sebastian Huber
fe58f6ce4b bsp/stm32h7: Add and use BSP Doxygen group
Update #3910.
2020-11-26 08:21:46 +01:00
Kinsey Moore
22c3d4f2ed spec/a53: Set conditionally failing test state
The spintrcritical03-05 and psx12 tests are known to fail on Qemu when
the host system is heavily loaded. A single run of Qemu per core
during a testsuite run tends to yield positive results, but any
additional load on a system will result in test failures.

This patch also applies the correct expected test state for intermittent
failures so that those tests will still build.
2020-11-24 10:06:49 -06:00
Kinsey Moore
0f5f42619b score/aarch64: Resolve warning in exception dump
This resolves a warning in the exception frame dump for AArch64 relating
to a missized printf format specifier.
2020-11-24 08:01:16 -06:00
Kinsey Moore
b2ea2bc333 wscript: Apply test state expectations correctly
The variety of expected test states are not currently applied to tests
with names containing '-' correctly due to a failure to replace '-' with
'_' before adding the CPPFLAGS to the environment for that test. This
ensures that all additions of CPPFLAGS have that replacement performed
so that the CPPFLAGS are applied properly during compilation.
2020-11-24 08:01:08 -06:00
Sebastian Huber
99c73303de rtems: Improve rtems_interrupt_server_create()
Also start interrupt server tasks on processors which do not have a
scheduler.  Applications may dynamically manage processors using
rtems_scheduler_remove_processor() and rtems_scheduler_add_processor().
2020-11-24 07:40:24 +01:00
Sebastian Huber
3c093d6752 rtems: Move _Partition_Allocate()
It is only used by rtems_partition_create().
2020-11-24 07:40:24 +01:00
Sebastian Huber
accbe3c40a rtems: Move _Partition_Initialize()
It is only used by rtems_partition_create().  Fix integer types.
2020-11-24 07:40:24 +01:00
Sebastian Huber
1784799b17 rtems: Move _Partition_Is_buffer_area_aligned()
It is only used by rtems_partition_create().  Move code directly into
directive which called the inline function.  Add a comment.
2020-11-24 07:40:16 +01:00
Sebastian Huber
1eafefbf4c rtems: Move _Partition_Is_buffer_size_aligned()
It is only used by rtems_partition_create().  Move code directly into
the directive which called the inline function.  Add a comment.
2020-11-24 07:40:11 +01:00
Sebastian Huber
a61e221d04 rtems: Move _Partition_Is_buffer_on_boundary()
It is used only by rtems_partition_return_buffer().    Make the PTCB the
first parameter.  Rename to _Partition_Is_address_on_buffer_boundary().
2020-11-24 07:38:41 +01:00
Sebastian Huber
2572a3f1c0 rtems: Move _Partition_Is_buffer_valid()
It is used only in one place.  Make the PTCB the first parameter.
Rename it to _Partition_Is_address_a_buffer_begin().
2020-11-24 07:38:41 +01:00
Sebastian Huber
aa1c6ddd5c libtest: Fix undefined setjmp() behaviour
Bug was introduced by 78baeb7579.

Update #3199.
2020-11-24 07:38:41 +01:00
Kinsey Moore
1cbe5773ab spec/aarch64: Only apply SUBALIGN(4) to ILP32
The SUBALIGN(4) required on rtemsroset and rtemsrwset for ILP32 builds
was previously present on LP64 builds and causes no issues within RTEMS,
but causes relocation/alignment issues when building libbsd. This
restricts those alignment changes to ILP32 builds.
2020-11-23 09:57:45 -06:00
Kinsey Moore
0c7bb0ebbd spec/aarch64: Ensure that libbsd can build properly
These files are required for libbsd to build against the AArch64 A53
BSPs.
2020-11-23 09:57:45 -06:00
Sebastian Huber
cbfacee436 rtems: Remove _Partition_Destroy()
It was a trivial function call wrapper used only in one place.
2020-11-23 10:43:19 +01:00
Sebastian Huber
3c029026da rtems: Remove _Partition_Free()
It was a trivial function call wrapper used only in one place.
2020-11-23 10:43:19 +01:00
Sebastian Huber
76263d8fc9 rtems: Move _Partition_Free_buffer()
It is only used by rtems_partition_return_buffer().
2020-11-23 10:43:19 +01:00
Sebastian Huber
6d413ef1f8 rtems: Move _Partition_Allocate_buffer()
It is only used by rtems_partition_get_buffer().
2020-11-23 10:43:19 +01:00
Sebastian Huber
ede8f51e54 rtems: Update partition documentation 2020-11-23 10:43:19 +01:00
Sebastian Huber
4c1e793a2d rtems: Canonicalize partition file documentation 2020-11-23 10:43:19 +01:00
Sebastian Huber
134fc76d3b rtems: Update event documentation 2020-11-23 10:36:46 +01:00
Sebastian Huber
83c37fc738 rtems: Remove unused _Event_Timeout() 2020-11-23 10:36:46 +01:00
Sebastian Huber
acf1a9870d rtems: Remove EVENT_SETS_NONE_PENDING
This define was only used in one place.
2020-11-23 10:36:46 +01:00
Sebastian Huber
422b00319a rtems: Remove unused EVENT_CURRENT 2020-11-23 10:36:46 +01:00
Sebastian Huber
72811c71af rtems: Canonicalize task event file documentation 2020-11-23 10:36:46 +01:00
Sebastian Huber
bdfc58fbd3 libio: Move to RTEMS implementation group 2020-11-23 10:36:46 +01:00
Sebastian Huber
6c078901b2 doxygen: Use common syntax for groups 2020-11-23 10:36:46 +01:00
Sebastian Huber
f1d932d510 doxygen: Rename Internal to Implementation
Use a top-level implementation group to gather implementation related
files.  The use of "Impl" is shorter and matches with the *impl.h file
names.
2020-11-23 10:36:46 +01:00
Christian Mauderer
7141afbb0e bsp/imxrt: Add new BSP
Update #4180
2020-11-20 08:53:19 +01:00
Christian Mauderer
57b5b29ce4 bsp/imxrt: Adapt imported files
Update #4180
2020-11-20 08:53:19 +01:00
Christian Mauderer
8abf858cf5 bsp/imxrt: Fix warnings for imported files
Update #4180
2020-11-20 08:53:18 +01:00
Christian Mauderer
48f6a6c302 bsp/imxrt: Import files from MCUXpresso SDK V2.8.5
The following files have been imported:

cp ${SDK}/boards/evkbimxrt1050/project_template/clock_config.c nxp/boards/evkbimxrt1050
cp ${SDK}/boards/evkbimxrt1050/project_template/clock_config.h include/fsl_clock_config.h
cp ${SDK}/boards/evkbimxrt1050/project_template/dcd.c start/flash-dcd.c
cp ${SDK}/boards/evkbimxrt1050/project_template/pin_mux.c nxp/boards/evkbimxrt1050
cp ${SDK}/boards/evkbimxrt1050/project_template/pin_mux.h include/fsl_pin_mux.h
cp ${SDK}/boards/evkbimxrt1050/xip/evkbimxrt1050_flexspi_nor_config.h include/fsl_flexspi_nor_config.h
cp ${SDK}/devices/MIMXRT1052/MIMXRT1052.h include
cp ${SDK}/devices/MIMXRT1052/MIMXRT1052_features.h include
cp ${SDK}/devices/MIMXRT1052/drivers/fsl_*.c nxp/devices/MIMXRT1052/drivers
cp ${SDK}/devices/MIMXRT1052/drivers/fsl_*.h include
cp ${SDK}/devices/MIMXRT1052/fsl_device_registers.h include
cp ${SDK}/devices/MIMXRT1052/system_MIMXRT1052.h include/
cp ${SDK}/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.c nxp/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.c
cp ${SDK}/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.h include

Update #4180
2020-11-20 08:53:18 +01:00
Christian Mauderer
b169095c7d cpu/armv7m: Add table based init for ARMV7M_MPU
Modify the MPU functions of the stm32h7 BSP to be table based and
available for all ARMV7M BSPs.

Update #4180
2020-11-20 08:53:18 +01:00
Christian Mauderer
6cece58544 bsps/imx: Move imx-gpio to arm/shared
Update #4180
2020-11-20 08:53:18 +01:00
Christian Mauderer
e00f443428 imx: Move imx_iomux to arm/shared
Update #4180
2020-11-20 08:53:18 +01:00
Sebastian Huber
c13fd2dbd8 score: Restore RTEMS_COMPILER_UNUSED_ATTRIBUTE
Commit 21af871992 accidentally removed the
RTEMS_COMPILER_UNUSED_ATTRIBUTE and added RTEMS_COMPILER_USED_ATTRIBUTE.
2020-11-20 08:14:18 +01:00
Sebastian Huber
298b5ef162 config: Initialize task stack allocator on demand
Register a custom task stack allocator initialization handler only if
necessary.
2020-11-19 17:41:26 +01:00
Sebastian Huber
c5af8aa070 config: Simplify task stack allocator init
Replace runtime checks with compile time assertions.  This makes the
INTERNAL_ERROR_BAD_STACK_HOOK obsolete.
2020-11-19 17:41:07 +01:00
Sebastian Huber
d6f13a468e validation/ts-performance-0: Add partition tests 2020-11-19 08:39:02 +01:00
Sebastian Huber
35c52a51b9 validation/ts-performance-0: Add test suite
Share a default test suite with ts-validation-0.
2020-11-19 08:39:02 +01:00
Sebastian Huber
c542345b25 libtest: Simplify "Load" environment reporting
Report all runtime measurement environments with a name only and encode
the worker count of the "Load" environment in the name.

Update #3199.
2020-11-19 08:39:02 +01:00
Sebastian Huber
78baeb7579 libtest: Allow assert checks during test begin
Allow assert checks in test begin actions and setup fixture methods.
2020-11-19 08:39:02 +01:00
Sebastian Huber
d2bc5945d3 libtest: Rename ValidCache in FullCache
This name better reflects the execution envirnoment in which the cache
is fully loaded with valid data unrelated to the body request handler.
2020-11-19 08:39:02 +01:00
Sebastian Huber
8882635636 libtest: Add primitive test case memory allocator
This primitive test case memory allocator uses memory from the low-level
memory information provided by the BSP.  At the beginning of each test
case, the memory available to the test case is reinitialized.  This
allows the use of a simple allocate only allocator.
2020-11-19 08:39:02 +01:00
Sebastian Huber
33cd037bf1 libtest: Simplify runtime measurement support
Use the test case allocator functions T_zalloc() and T_malloc().
Restore the task affinity of the runner task.
2020-11-19 08:39:02 +01:00
Sebastian Huber
eae22cc03e libtest: Make test case allocator configurable 2020-11-19 08:39:02 +01:00
Sebastian Huber
90b2dbecc2 build: Remove duplicate ARM_MMU_USE_SMALL_PAGES 2020-11-19 08:39:02 +01:00
Christian Mauderer
5d75050c93 Add License file for BSD-3-Clause
We have some files with a SPDX identifier for this license. Therefore
the license should be here too.
2020-11-17 10:03:41 +01:00
Kinsey Moore
eb3d7fbf65 score/aarch64: Size saved SP register for ABI
This ensures that the saved SP register is sized appropriately depending
on the chosen ABI and prevents a warning in the libmisc stack checker.
2020-11-13 12:31:41 -06:00
Sebastian Huber
21af871992 rtems: Generate <rtems/score/basedefs.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
ecc6b2f56c rtems: Generate <rtems/rtems/part.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
007ee134a4 rtems: Generate <rtems/rtems/event.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
f75e240f8c rtems: Generate <rtems/rtems/attr.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
9b4458e78e rtems: Generate <rtems/rtems/types.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
8de874b766 rtems: Generate <rtems/rtems/options.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
e05b100b3c rtems: Generate <rtems/rtems/modes.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
c0327d8617 rtems: Generate <rtems/rtems/status.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
da44df31b1 rtems: Generate <rtems/rtems/config.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
1af946088d rtems: Generate <rtems/config.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-11-12 08:54:59 +01:00
Sebastian Huber
96559b3a4a rtems: Include missing header file 2020-11-12 08:54:59 +01:00
Sebastian Huber
ced1302208 Improve automatically generated warning 2020-11-12 08:54:59 +01:00
Christian Mauderer
cab11b5b80 bsp/atsam: Fix XDMAD status
In "bsp/atsam: Simplify XDMAD_Handler()" (5f813694f6) the interrupt
callback has been made unconditional. That allowed to avoid some special
deadlock situations in error cases. But it removed part of the XDMAD
status handling.

This patch adds the ability to update the XDMAD status from the
callback if that is necessary for the driver.

Fixes #4173
2020-11-12 08:30:20 +01:00
Sebastian Huber
d5d9a89d03 build: Fix cache file placement
The "bsp_list" and "bsp_defaults" commands get a waflib.Context object
which has no build node.  Use a hard coded build path for these
commands.
2020-11-12 07:51:30 +01:00
Sebastian Huber
f435bdd545 dl06: Do not include loaded objs in base image 2020-11-11 08:30:41 +01:00
Sebastian Huber
dfe6b84d03 smpmulticast01: Fix NULL pointer access 2020-11-10 13:05:27 +01:00
Jiri Gaisler
4c2d5f271b Add correct link address for griscv waf build 2020-11-09 09:35:11 +01:00
Jiri Gaisler
b4c29b54e7 Add networking support for griscv bsp
* Only GRETH device supported for now
	* Fix endian problem in GRETH driver
	* Remove SPARC assembly from greth.c
	* Builds with both autoconf and waf
2020-11-09 09:35:11 +01:00
Sebastian Huber
7f0379c8dd libtrace: Move _Record_Stream_header_initialize()
This fixes the build if no function sections are used.
2020-11-09 08:10:57 +01:00
Sebastian Huber
350bba7a04 sparc: Add SPARC_INTERRUPT_SOURCE_TO_TRAP()
Update #4171.
2020-11-06 14:05:53 +01:00
Sebastian Huber
828114778d sparc: Add SPARC_INTERRUPT_TRAP_TO_SOURCE()
Update #4171.
2020-11-06 14:05:53 +01:00
Sebastian Huber
b7271f8c1e sparc: Add SPARC_IS_INTERRUPT_TRAP()
Update #4171.
2020-11-06 14:05:53 +01:00
Sebastian Huber
2c467ec767 sparc: Move SPARC-specific macros to sparc.h
Clarify Doxygen comments.  Fix formatting.

Update #4171.
2020-11-06 14:05:53 +01:00
Sebastian Huber
4cd885c305 rtems-bsps: Use build specification items
Close #4123.
2020-11-05 21:14:54 +01:00
Sebastian Huber
6cf0c559dc build: Place cache file in output directory
This improves support for the --out option.  Previously, the cache file
was placed in the source directory under "build/...".  Now, it is placed
in the output directory, which is "build" by default.  So, if you don't
use the --out option nothing changes.  However, if you use the --out
option, then the cache file is placed under the specified directory.
2020-11-05 18:53:49 +01:00
Jan Sommer
da9cc0b50c confdefs: Add extern C guards to libpci.h 2020-10-30 13:21:12 +11:00
Sebastian Huber
68239434c2 score: Fix unused parameter 'lock' warning 2020-10-28 14:53:12 +01:00
Sebastian Huber
eebad5ffcd build: Improve cache handling
Check the directory modification time to notice file removals.
2020-10-28 07:33:38 +01:00
Sebastian Huber
b052e3aefa build: Report caching errors
The ctx.fatal() method uses an exception to stop the build.  Do not
catch it.
2020-10-28 07:33:38 +01:00
Sebastian Huber
99494370d6 bsp/stm32h7: New BSP
Update #3910.
2020-10-27 06:11:45 +01:00
Sebastian Huber
c44e404888 bsp/stm32h7: Fix warnings
Update #3910.
2020-10-27 06:11:45 +01:00
Sebastian Huber
e4ba06f8b4 bsp/stm32h7: Disable unused functions
Update #3910.
2020-10-27 06:11:45 +01:00
Sebastian Huber
abb78587b6 bsp/stm32h7: Enable LL drivers
Update #3910.
2020-10-27 06:11:45 +01:00
Sebastian Huber
2f157e2007 bsp/stm32h7: Move <math.h> include
This is necessary for libbsd compatibility.

Update #3910.
2020-10-27 06:11:45 +01:00
Sebastian Huber
2cfcd005e9 bsp/stm32h7: Constify some functions
Update #3910.
2020-10-27 06:11:45 +01:00
Sebastian Huber
2131228f79 bsp/stm32h7: Import from STM32CubeMX-5.6.0
Update #3910.
2020-10-27 06:11:44 +01:00
Sebastian Huber
db94626bc3 bsp/leon3: Updat due to API changes 2020-10-26 15:10:05 +01:00
Sebastian Huber
273613f1a8 bsps/arm: Sort fast text/data sections 2020-10-21 07:58:38 +02:00
Sebastian Huber
3fccdc956c bsps/arm: Add support for MPU region alignment
Update #3910.
2020-10-21 07:58:34 +02:00
Frank Kühndel
daeb0a1881 rtems-fdt / shell - Fix string truncation warning
The compiler warning was:

../../../cpukit/libmisc/rtems-fdt/rtems-fdt.c:267:5: warning:
'strncpy' specified bound depends on the length of the source argument
  267 |     strncpy(path, name, namelen);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

It turns out that the `strncpy()` nor the buffer `path` is needed when
one uses `strncmp()` instead of `strcmp()`. This needs some change to
the algorithm but has the advantage that `name` is never truncated
to the size of the buffer `path`.
2020-10-20 07:01:29 +02:00
Sebastian Huber
bb4e534014 bsps: Fix rtems_interrupt_server_delete()
The ISR lock must be destroyed to prevent memory corruption if RTEMS_PROFILING
and RTEMS_SMP is enabled.

Close #4158.
2020-10-19 17:44:49 +02:00
Sebastian Huber
2b9fb3141c posix: Fix pthread_spin_unlock()
Prevent a call to _SMP_lock_Stats_register_or_max_section_time().  This fixes a
thread stack corruption in case RTEMS_PROFILING and RTEMS_SMP is enabled.

Close #4157.
2020-10-19 17:33:22 +02:00
Chris Johns
f514092f95 libfs/rfs: Check search bit map end on last bit
- Do not write past the last location of the search bit map
  whe nit is being created.

Closes #4148
2020-10-17 10:43:03 +11:00
Sebastian Huber
f9c8e14dcb grlib: Add ambapp_common_info to derived types
This avoids a cast in DEV_TO_COMMON().
2020-10-16 07:07:19 +02:00
Sebastian Huber
c15c520b96 grlib: Remove unused conversion macros 2020-10-16 07:07:19 +02:00
Sebastian Huber
3154203bba grlib: Remove superfluous forward decls 2020-10-16 07:07:19 +02:00
Sebastian Huber
cf1682130c bsps/arm: Add workaround for Errata 794072
Add a workaround for Cortex-A9 Errata 845369: A short loop including a DMB
instruction might cause a denial of service on another which executes a CP15
broadcast operation.

Close #4115.
2020-10-16 06:36:53 +02:00
Sebastian Huber
e7b878e42f bsps/arm: Workaround for Errata 845369
Add a workaround for Cortex-A9 Errata 845369: Under Very Rare Timing
Circumstances Transition into Streaming Mode Might Create Data Corruption.

Update #4115.
2020-10-16 06:36:06 +02:00
Sebastian Huber
e2250eeb94 Revert "rtems-fdt / shell - Fix string truncation warning"
This reverts commit 355bc37ad3.
2020-10-16 06:22:56 +02:00
Frank Kühndel
355bc37ad3 rtems-fdt / shell - Fix string truncation warning
The compiler warning was:

../../../cpukit/libmisc/rtems-fdt/rtems-fdt.c:267:5: warning:
'strncpy' specified bound depends on the length of the source argument
  267 |     strncpy(path, name, namelen);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

It turns out that the `strncpy()` nor the buffer `path` is needed when
one uses `strncmp()` instead of `strcmp()`. This needs some change to
the algorithm but has the advantage that `name` is never truncated
to the size of the buffer `path`.

Note:

rtems-fdt.c, rtems-fdt-shell.c and cpukit/include/rtems/rtems-fdt.h
seem to be dead code. They implement a shell command `fdt` but that
command is not part of the shell nor of any macro in
cpukit/include/rtems/shellconfig.h.
2020-10-15 19:15:50 +02:00
Frank Kühndel
1dbd1079a5 shell/main_edit.c: Fix string truncation warning
Using strlcpy() instead of strncpy():

1) Prevents the compiler warnings
2) Ensures, the string is NUL terminated.
3) Avoids that strncpy() unnecessary fills the unused part of the buffer with
   0 bytes.

(Note that realpath() also returns NULL if the file does not exist - that
happens always if someone creates a new file with the editor of the shell.)
2020-10-15 19:14:52 +02:00
Frank Kühndel
b03c103dbd shell/main_edit.c: Fix use of wrong constant
realpath() requires a buffer of size PATH_MAX and not of size
FILENAME_MAX according to 'man realpath (3)'.
2020-10-15 19:14:52 +02:00
Frank Kühndel
529402f597 shell/shell.c: Fix illegal string copy
This is an illegal use of strcpy() because one is not allowed to
use this function with overlapping source and destination buffers;
whereas memmove() is explicitly designed to handle such cases.

The copiler warning was:

../../../cpukit/libmisc/shell/shell.c:626:13: warning:
'strcpy' accessing between 1 and 2147483645 bytes at offsets
0 and [1, 2147483647] may overlap up to 2147483644 bytes at
offset [1, 2147483644] [-Wrestrict]
2020-10-15 19:14:48 +02:00
Frank Kühndel
2361b2c8cb shell/shell.c: Fix an implicit type cast
With some compiler warnings enabled, the implicit cast may trigger
a compiler warning. The explicit cast avoids this.
2020-10-15 19:12:15 +02:00
Frank Kühndel
0a761a58c9 fsdosfsname01: Fix string truncation warning
This patch fixes a compiler warning:

../../../testsuites/fstests/fsdosfsname01/init.c:430:19: warning:
'%s' directive output may be truncated writing up to 6424 bytes into
a region of size 257 [-Wformat-truncation=]

The buffer 'dirname' is exactly large enough so that no truncation
can ever occur. Using the return value of snprintf() is an official
supported way to suppress the warning.

I considered the comment of Joel Sherrill about not replacing snprintf():
https://lists.rtems.org/pipermail/devel/2020-September/062113.html
2020-10-15 19:12:15 +02:00
Sebastian Huber
3972085dba Remove *_Is_null() inline functions
Simply compare the values against NULL.
2020-10-14 18:10:50 +02:00
Sebastian Huber
df9cc1aee8 rtems: Remove superfluous include 2020-10-14 09:17:24 +02:00
Joel Sherrill
7db9c14434 lpc32xx_mzx_stage_1-testsuite.tcfg: Add ttest01 2020-10-12 10:14:38 -05:00
Joel Sherrill
2695e7d01f lpc2362-testsuite.tcfg: Add monitor and psxmsgq01 2020-10-12 10:14:38 -05:00
Joel Sherrill
562c2a718c lm3s3749-testsuite.tcfg: Add spcxx01 2020-10-12 10:14:38 -05:00
Sebastian Huber
1db60dffec build: Move drivers without SMP support
This fixes warnings like this:

warning: implicit declaration of function 'rtems_interrupt_disable'
warning: implicit declaration of function 'rtems_interrupt_enable'
warning: implicit declaration of function 'rtems_interrupt_flash'
2020-10-12 16:17:44 +02:00
Sebastian Huber
1229817a2f build: Fix format 2020-10-12 16:17:44 +02:00
Frank Kühndel
ec13365d77 testsuites/samples/fileio - Increase of stack size
When I use the 'shell' from the fileio sample with the command below:

   env QEMU_AUDIO_DRV="none" \
   qemu-system-arm -no-reboot -net none -nographic -M realview-pbx-a9 \
   -m 256M \
   -kernel build/arm/realview_pbx_a9_qemu/testsuites/samples/fileio.exe

The executable crashes with an "BLOWN STACK!!!" as soon as I try to login
as 'root' with password. (The logins without password work fine.)
Increasing the stack size of the affected thread a bit solves the issue.
Hence, I suggest this patch.

 My config.ini was

[arm/realview_pbx_a9_qemu]
RTEMS_DEBUG = True
RTEMS_NETWORKING = True
RTEMS_POSIX_API = True
RTEMS_SMP = True
BUILD_TESTS = True

RTEMS origin.master at a479686c11

Close #4143
2020-10-12 15:49:15 +02:00
Frank Kühndel
a479686c11 shell: Remove not functioning fdisk mount/unmount
The shell has an 'fdisk' command which has sub-commands 'mount' and 'unmount'.
These two sub-commands have a bug which causes them to be not able
to mount anything. This proposed patch removes the buggy file
cpukit/libblock/src/bdpart-mount.c and the mount/unmount commands
from 'fdisk' as bug fix. The 'fdisk' command itself is not removed.
The reasons for removing the sub-commands (instead of fixing the issue) are:

  1) The bug has been introduced on 2010-May-31 with commit
     29e92b090c. Since ten years no one
     can use this feature, nor has anybody complained about it.

  2) Besides of the 'fdisk' 'mount' sub-command, the shell has the
     usual 'mount' and 'unmount' commands which can serve as
     substitutes.

  3) There are additional minor issues (see further down) which needed to
     be addressed when the file will be kept.

What follows below is the precise bug description.

The bug is in function rtems_bdpart_mount() which is only be used
by the 'fdisk' shell command to mount all partitions of a disk with a
single command:

> fdisk DISK_NAME mount
>         mounts the file system of each partition of the disk
>
> fdisk DISK_NAME unmount
>         unmounts the file system of each partition of the disk

The whole command does not work because in file
cpukit/libblock/src/bdpart-mount.c line 103 specifies the file system type
of each partition to be "msdos". Yet, "msdos" does not exist. The name
must be "dosfs".

Beside of this fundamental problem, there are more issues with the code
in bdpart-mount.c:

  1) The function returns RTEMS_SUCCESSFUL despite the mount always fails.

  2) The reason for errors is not written to the terminal.

  3) The directory '/mnt' is created but not deleted later on (failure or not).

  3) There is no documentation about this special 'fdisk' feature in the
     RTEMS Shell Guide ('fdisk' is mentioned but its documentation is a
     bit short):
     https://docs.rtems.org/branches/master/shell/
     file_and_directory.html#fdisk-format-disk

  4) Only "msdos" formatted partitions can be mounted and all partitions
     are mounted read-only. This is hard coded and cannot be changed by
     options. Moreover, there is no information about this to the user of
     the shell (i.e. using 'fdisk' mount requires insider knowledge).

How to reproduce:

  1) For testing, I use the 'testsuites/samples/fileio.exe' sample with qemu:

> cd rtems
> env QEMU_AUDIO_DRV="none" qemu-system-arm -net none -nographic \
> -M realview-pbx-a9 -m 256M -kernel \
> build/arm/realview_pbx_a9_qemu/testsuites/samples/fileio.exe

  2) Type any key to stop the timer and enter the sample tool.
     Type 's' to enter the shell, login as 'root' with the password
     shown in the terminal.

  3) Type the following shell commands (they create a RAM disk,
     partition it, register it, format it and try to mount it):

> mkrd
> fdisk /dev/rda fat32 16 write mbr
> fdisk /dev/rda register
> mkdos /dev/rda1
> fdisk /dev/rda mount

  4) The last line above is the command which fails - without an error
  message. There exists a '/mnt' directory but no '/mnt/rda1' directory
  as it should be:

> ls -la /mnt

  5) If you change line 103 of 'cpukit/libblock/src/bdpart-mount.c'
     from "msdos" to "dosfs", compile and build the executable and
     re-run the above test, '/mnt/rda1' exists (but the file system
     is mounted read-only).

Close #4131
2020-10-12 13:18:27 +02:00
Frank Kühndel
f3df25b65c cpukit/libmisc/monitor: Fix an illegal string copy
This is actually an illegal use of strcpy() because one is not allowed to
use this function with overlapping source and destination buffers; whereas
memmove() is explicitly designed to handle such cases.

The compiler warning was:

../../../cpukit/libmisc/monitor/mon-editor.c:342:15: warning:
'strcpy' accessing 1 byte at offsets [0, 75] and [0, 75] overlaps
1 byte at offset [0, 74] [-Wrestrict]
2020-10-12 08:46:48 +02:00
Frank Kühndel
4763ef8d9b psxndbm01 - Fixing string truncation warning
This fixes the following compiler warning:

testsuites/psxtests/psxndbm01/init.c:221:3: warning: 'strncpy' output truncated
before terminating nul copying 5 bytes from a string of the same length
  221 |   strncpy( test_strings, "Hello", 5 );
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In addition, the comments from Sebastian Huber on an old version of
such a patch have been taken into account:

1) The use of `sizeof()` in `key.dsize = sizeof( test_strings );` is wrong.

2) There is no need to allocate the string. One can simply use a string
   constant.

(See https://lists.rtems.org/pipermail/devel/2020-August/061418.html)
2020-10-12 08:43:32 +02:00
Sebastian Huber
b434dc1874 libblock: Fix sparse disk
The qsort() in sparse_disk_get_new_block() may move the appended key
which invalidates the pointer.

Close #4142.
2020-10-12 08:21:42 +02:00
Sebastian Huber
8111a6ba88 rtems: Generate <rtems/io.h>
The manager documentation is a consolidation of the comments in Doxygen
markup and the documentation sources in Sphinx markup.  The
documentation was transfered to interface specification items.  This
header file was generated from the items by a script.

Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-10-11 16:07:20 +02:00
Sebastian Huber
243d3ed51d libblock: Add comment 2020-10-11 15:51:10 +02:00
Frank Kühndel
c8c1426c68 mghttpd/mongoose: Fix string truncation warning
This fixes the compiler warning below.

../../../cpukit/mghttpd/mongoose.c:1919:45: warning:
'.gz' directive output may be truncated writing 3 bytes into a region
of size between 1 and 255 [-Wformat-truncation=]
2020-10-10 15:05:41 +02:00
Frank Kühndel
bc7ac71f8a libblock: Fix string truncation warning
This patch does not only fix the compiler warning below. memcpy() is the
better function at this place as the terminating NUL character is never
copied here. Instead more characters will be appended to the
'logical_disk_name' later on.

../../../cpukit/libblock/src/bdpart-register.c:41:5:
warning: 'strncpy' output truncated before terminating nul copying
as many bytes from a string as its length [-Wstringop-truncation]
2020-10-10 15:04:48 +02:00
Frank Kühndel
f28a6defd1 disp_hcms29xx: Fix string truncation warning
The strlcpy() function ensures there is always a NUL character
at the end of the string. Hence it is safer as strncpy() and it avoids the
compiler warning
2020-10-10 15:04:15 +02:00
Frank Kühndel
0007d65f72 testsuits/dl10 : Prototype missing
Fix a compiler warning about a missing prototype.

If you wonder why the function name is not `static`:
The code in the file only serves a test where the dynamic object loader
(aka dlopen()) should handle duplicated symbols in an archive.

testsuites/libtests/dl10/dl10-o6.c:14:5: warning: no previous prototype
for 'rtems_main_o5' [-Wmissing-prototypes]
       14 | int rtems_main_o5 (void)
          |     ^~~~~~~~~~~~~
2020-10-10 15:03:14 +02:00
Frank Kühndel
59d0e6aed1 capture: Fix unaligned pointer value warning
rtems_name is a four byte integer.
Giving an rtems_name as value instead of a pointer to ctrace_task_name_add()
fixes not only the compiler warning but it is also a bit more safe

For those who have asked for the warning:

../../../cpukit/libmisc/capture/capture_support.c:352:49: warning:
taking address of packed member of 'struct rtems_capture_task_record'
may result in an unaligned pointer value [-Waddress-of-packed-member]
  352 |         ctrace_task_name_add (rec_out->task_id, &task_rec.name);
      |                                                 ^~~~~~~~~~~~~~
2020-10-10 15:02:56 +02:00
Sebastian Huber
3bbd47638f build: Add test excludes for RTEMS_PROFILING 2020-10-10 14:54:36 +02:00
Sebastian Huber
e261df005a build: Add test excludes for rcxx01 2020-10-10 14:48:01 +02:00
Sebastian Huber
d7a48e1b25 rtems: Improve RTEMS_NO_RETURN attribute
Provide RTEMS_NO_RETURN also in case RTEMS_DEBUG is defined to prevent errors
like this:

error: no return statement in function returning non-void [-Werror=return-type]

Use C11 and C++11 standard means to declare a no-return function.

Close #4122.
2020-10-10 14:00:37 +02:00
Sebastian Huber
e1a0e0c308 grlib: Add and use irqmp_has_timestamp()
Replace leon3_irqmp_has_timestamp() with irqmp_has_timestamp() and move
it to grlib.h.

Close #4128.
2020-10-10 14:00:37 +02:00
Sebastian Huber
6ca00e61dc build: Fix legacy Makefile support
Close #4140.
2020-10-10 13:50:41 +02:00
Chris Johns
558a19d3ad testsuite/rcxx01: Add examples for use in the User manual 2020-10-09 16:45:24 +11:00
Chris Johns
89a22be079 librtemscxx: Fix white space to match the coding standard 2020-10-09 10:46:25 +11:00
Chris Johns
6f2a219f57 librtemscxx: Add join() and detach() to the thread
- Do not start threads detached
2020-10-09 10:46:25 +11:00
Joel Sherrill
560c08cc3d bsps/include/bsp/fatal.h: Add GRLIB specific fatal error
updates #4028.
2020-10-08 08:30:00 -05:00
Sebastian Huber
b1eaacfbcd librtemscxx: Fix install 2020-10-08 15:21:31 +02:00
Sebastian Huber
69a35fb925 validation: Improve file header comment 2020-10-08 13:43:39 +02:00
Sebastian Huber
e697baf8d7 doxygen: Add "Generated from ..." comments
Improve file header comment.

Update #3994.
2020-10-08 07:40:08 +02:00
Sebastian Huber
f815d044ee rtems: Add "Generated from ..." comments
Improve file header comment.

Update #3993.
2020-10-08 07:40:08 +02:00
Sebastian Huber
c17181d464 build: Disable RTEMS_NETWORKING for some arch/bsp
The old network stack is not supported on 64-bit targets.
2020-10-08 07:40:08 +02:00
Chris Johns
cf95826089 cpukit/librcxx: Add a C++ thread interface with attributes 2020-10-08 11:01:59 +11:00
Joel Sherrill
0c74ff92b5 Misc: Correct spelling of occurred 2020-10-07 08:38:28 -05:00
Sebastian Huber
97e9728306 rtems: Add RTEMS_PARTITION_ALIGNMENT
Update #4105.
2020-10-07 08:10:52 +02:00
Sebastian Huber
94b8d85b16 build: Fix BSP name
Update #3818.
2020-10-07 08:06:34 +02:00
Sebastian Huber
ca9b2e34be build: Remove raspberrypi from RTEMS_SMP
Close #4116.
2020-10-07 07:45:35 +02:00
Sebastian Huber
883894562b build: Add test excludes for RTEMS_DEBUG 2020-10-06 07:43:49 +02:00
Kinsey Moore
ed9c88cea8 bsps: Add Cortex-A53 ILP32 BSP variant
This adds an AArch64 ILP32 BSP variant based on Qemu's Cortex-A53
emulation with interrupt support using GICv3 and clock support using
the ARM GPT.
2020-10-05 16:11:40 -05:00
Kinsey Moore
db68ea1b9b bsps: Add Cortex-A53 LP64 basic BSP
This adds an AArch64 basic BSP based on Qemu's Cortex-A53 emulation with
interrupt support using GICv3 and clock support using the ARM GPT.
2020-10-05 16:11:40 -05:00
Kinsey Moore
8387c52e47 score: Add AArch64 port
This adds a CPU port for AArch64(ARMv8) with support for exceptions and
interrupts.
2020-10-05 16:11:39 -05:00
Kinsey Moore
232fc52d4c spmsgq_err01: Use correct max values and fix 64bit
Fix spmsgq_err01 on systems with 64-bit pointers and correct max value
mismatches and inaccuracies that are more noticable on 64-bit systems.
2020-10-05 16:11:39 -05:00
Kinsey Moore
cb2afd2eaa bsps/shared: Add PSCI-based bspreset implementation
This adds a bsp_reset implementation based on the ARM PSCI
specification often present in ARMv8 systems.
2020-10-05 16:11:39 -05:00
Kinsey Moore
f8ad5bb2a4 bsps: Break out AArch32 GICv3 support
This breaks out AArch32-specific code so that the shared GICv3 code can
be reused by other architectures.
2020-10-05 16:11:39 -05:00
Kinsey Moore
1480c3f5e8 bsps: Break out AArch32 portions of GPT driver
This breaks AArch32-specific portions of the ARM GPT driver into their
own file so that the generic code can be moved for reuse by other
architectures.
2020-10-05 16:11:39 -05:00
Kinsey Moore
647a60e2c3 spec: Add missing spintrcritical24 definition 2020-10-05 16:11:39 -05:00
Kinsey Moore
1c03649312 Move ARM PL011 UART driver
This UART driver is now needed for BSPs other than ARM.
2020-10-05 16:11:39 -05:00
Sebastian Huber
83278070ba build: Add test excludes for RTEMS_DEBUG
Close #4121.
2020-10-05 19:34:26 +02:00
Sebastian Huber
a9995f101d bsp/lpc176x: Fix memory map
Due to the static allocation of operating system resources the .bss section
needs more space than the .work section.

Close #4117.
2020-10-05 19:34:10 +02:00
Sebastian Huber
2c36761768 build: Add testopts.h to configure script
Close #4120.
2020-10-05 12:00:29 +02:00
Sebastian Huber
f53712a0e3 build: Use exact match by default for BSP names
Update #3818.
2020-10-02 16:29:48 +02:00
Sebastian Huber
7c0744f5b3 build: Scope RTEMS_MULTIPROCESSING option
Enable it only for selected BSPs. Improve description.
2020-10-02 14:38:33 +02:00
Sebastian Huber
6a31ae63ce build: Fix typo 2020-10-02 14:38:33 +02:00
Sebastian Huber
f2185d1099 Decouple the C Program Heap initialization
Before this patch RTEMS_Malloc_Initialize() had a fixed dependency on
_Workspace_Area.  Introduce _Workspace_Malloc_initializer to have this
dependency only if CONFIGURE_UNIFIED_WORK_AREAS is defined by the
application configuration.
2020-10-01 19:05:33 +02:00
Sebastian Huber
71689a0775 rtems: Canonicalize name and id checks
Check the name followed by the id check in all create directives.

Compare pointers against NULL.  Fix formatting.
2020-10-01 18:05:58 +02:00
Sebastian Huber
2d8802b519 tests: Add and use <rtems/testopts.h>
Add the build option RTEMS_TEST_VERBOSITY to control the verbosity of
test suites using the RTEMS Test Framework.
2020-10-01 18:05:42 +02:00
Sebastian Huber
cb1b8260fc build: Enable RTEMS_SMP only for selected BSPs 2020-10-01 13:38:19 +02:00
Sebastian Huber
16b29af2c5 build: Fix build dependencies of JFFS2 tests
Close #4107.
2020-10-01 07:46:29 +02:00
Sebastian Huber
2da7e94fe5 libtests/sha: Fix test if -O0 is used 2020-09-30 13:01:45 +02:00
Sebastian Huber
31c333d71c build: Include cpuopts.h in "config.h"
The Autoconf/Automake build system did something similar.  This fixes
the build of sigprogmask.c which uses RTEMS_POSIX_API and expects to get
it defined via "config.h".

Update #3818.
2020-09-30 12:54:02 +02:00
Sebastian Huber
5ff5ce62f9 rtems: Remove rtems_io_driver_io_error()
The implementation was added and removed in 2009.
2020-09-29 15:30:23 +02:00
Ryan Long
0805930d0c rtems-bsps: add ability to print architecture/bsp list
Closes #4099.
2020-09-29 15:10:52 +10:00
Frank Kühndel
ffc928b9a2 Fixing bug in line editing of the shell with CTRL-U.
This patch fixes a tiny bug in the command line editing of the RTEMS shell.
Typing CTRL-U in the shell should remove all characters left of the cursor.
After pressing CTRL-U, the current implementation does wrongly place the cursor
at the end of the line instead at its beginning.

To reproduce the bug, start the shell and type 'abc123' (no <RETURN>):

> ~/src/rtems $ qemu-system-arm -net none -nographic -M realview-pbx-a9 \
  -m 256M -kernel build/arm/realview_pbx_a9_qemu/testsuites/libtests/dl10.exe
> *** BEGIN OF TEST libdl (RTL) 10 ***
> *** TEST VERSION: 6.0.0.d9bdf166644f612dd628fe4951c12c6f8e94ba5f
> *** TEST STATE: USER_INPUT
> *** TEST BUILD: RTEMS_DEBUG RTEMS_NETWORKING RTEMS_POSIX_API RTEMS_SMP
> *** TEST TOOLS: 10.2.1 20200904 \
  (RTEMS 6, RSB 31f936a7b74d60bda609a9960c6e1a705ba54974, Newlib a0d7982)
> RTL (libdl) commands: dl, rtl
>
> RTEMS Shell on /dev/foobar. Use 'help' to list commands.
> SHLL [/] # abc123

Then move the cursor onto the '1' by hitting three times the <ARROW-LEFT> key.
Next type <CTRL>-U:

> SHLL [/] # 123

Note that the cursor is at the end of the line (after '3') instead of correctly
at the beginning (on the '1'), now.

Continuing typing 'echo ' incorrectly results in the output:

> SHLL [/] # 123echo 123

The patch changes this behavior so that the cursor in the second last step will
be on the '1' and typing 'echo ' will then correctly reflected as:

> SHLL [/] # echo 123

Close #4097.
2020-09-28 14:16:06 +02:00
Sebastian Huber
f48d7834b0 doxygen: Fix use of getchark() and rtems_putc() 2020-09-28 09:10:00 +02:00
Sebastian Huber
febc66048a validation: Test rtems_message_queue_construct()
Update #4007.
2020-09-28 07:16:04 +02:00
Sebastian Huber
4a4f41ed64 rtems: Add rtems_message_queue_construct()
In contrast to message queues created by rtems_message_queue_create(), the
message queues constructed by this directive use a user-provided message buffer
storage area.

Add RTEMS_MESSAGE_QUEUE_BUFFER() to define a message buffer type for message
buffer storage areas.

Update #4007.
2020-09-28 07:16:01 +02:00
Sebastian Huber
24ea1cebeb rtems: Remove Message_queue_Control::attribute_set
Add Message_queue_Control::is_global if RTEMS_MULTIPROCESSING is defined.  This
reduces the Message_queue_Control size in standard RTEMS configurations.

Update #4007.
2020-09-28 06:19:52 +02:00
Sebastian Huber
2c09f54fc4 score: Add <rtems/score/coremsgbuffer.h>
Move the CORE_message_queue_Buffer definition to a separate header file to be
able to use it independent of the remaining Message Queue Handler API.

Change license to BSD-2-Clause according to file history.

Update #3053.
Update #4007.
2020-09-28 06:19:52 +02:00
Sebastian Huber
69b4fe592f score: Simplify CORE_message_queue_Buffer
Merge CORE_message_queue_Buffer structure into
CORE_message_queue_Buffer_control.

Use a zero-length array for the actual message buffer.  This reduces the
structure size on all targets.

Update #4007.
2020-09-28 06:19:52 +02:00
Sebastian Huber
5bc7c3724f score: Improve _CORE_message_queue_Initialize()
Return a status code and differentiate between error conditions.

Update #4007.
2020-09-28 06:19:52 +02:00
Sebastian Huber
34dd90a560 score: Gather message queue control initialization
Initialize the structure in a single code block after the error checks and
calculations.

Update #4007.
2020-09-28 06:19:52 +02:00
Sebastian Huber
fe2cb7c47c score: Fix allocation size calculation
The previous multiplication error check is broken on 64-bit machines.  Use the
recommended check from SEI CERT C Coding Standard, "INT30-C. Ensure that
unsigned integer operations do not wrap".

Make sure the message size computation does not overflow.

Update #4007.
2020-09-28 06:19:52 +02:00
Sebastian Huber
3c0255766d score: Use RTEMS_ALIGN_UP()
Update #4007.
2020-09-28 06:19:52 +02:00
Sebastian Huber
cbd4f542ec build: Add comment
Update #3818.
2020-09-28 06:18:19 +02:00
Sebastian Huber
71ccc156a5 build: Fix option default values
For the option default values we have to use the BSP name defined by the build
specification and not the user.

Update #3818.
2020-09-27 09:36:07 +02:00
Sebastian Huber
b8d84015a4 build: Fix enabled-by evaluation
For the enabled-by evaluation we have to use the BSP name defined by the
build specification and not the user.

Update #3818.
2020-09-27 09:35:06 +02:00
Sebastian Huber
9a27c9cfd8 build: Simplify get_compiler()
Update #3818.
2020-09-27 09:34:27 +02:00
Sebastian Huber
73926320d7 build: Add RTEMS_PROFILING
Update #3818.
2020-09-25 18:51:00 +02:00
Sebastian Huber
a72419b4de libtest: Remove superfluous assignment
Issue found by Coverity (CID 1437643).
2020-09-24 18:07:50 +02:00
Jan Sommer
1f77518fca bsps/pc386: Add missing license header
Closes #4093.
2020-09-23 08:25:30 -05:00
Sebastian Huber
18fe650ad0 or1k: Do not use printk() for _CPU_Fatal_halt()
Debug output can be added to user-defined fatal error handlers.
2020-09-23 07:35:05 +02:00
Sebastian Huber
2248b3781d or1k: Remove superfluous includes
Including <stdio.h> in <rtems/score/cpu.h> breaks libbsd.
2020-09-23 07:35:05 +02:00
Sebastian Huber
e8450a6c36 bsps/riscv: Add bsp_fdt_map_intr()
This function is required by libbsd.
2020-09-23 07:35:05 +02:00
Chris Johns
5ebba2c5f4 libmisc/capture: Add rtems-trace-buffer-default.c to the autotools build 2020-09-23 13:59:31 +10:00
Chris Johns
de58eb2f4f cpukit/rtems: Add taskconstruct.c to the autotools build 2020-09-23 13:46:48 +10:00
Sebastian Huber
d9bdf16664 rtems: Install missing header file
Update #3053.
2020-09-22 09:44:01 +02:00
Sebastian Huber
d110e6e3b3 bsp/gen83xx: Add missing source file
Update #3818.
2020-09-21 06:34:56 +02:00
Sebastian Huber
e59cb6a2b2 bsps/powerpc: Remove __ppc_generic define
Do not force BSPs to define __ppc_generic.

This was probably the last command line define in the BSPs.
2020-09-20 17:45:11 +02:00
Sebastian Huber
456b8ae371 bsp/motorola_powerpc: Remove obsolete GCC option
commit 20c89ab7c5091ee48535392cae2177aa1a1c43eb
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Fri Jan 12 21:50:52 2018 +0100

    rs6000: Remove -mstring

    -mstring is only enabled by default on 601, and with -Os on some
    configurations.  It is almost always slower (than not using it) and
    does not very often lead to smaller code.

    This patch disables it.  If a user uses -mstring he gets a warning
    (but not with -mno-string).  I left the target attribute in place, it
    just doesn't do anything anymore.

    The patch also deletes a whole bunch of code.  The 'N' and 'O' output
    modifiers are now unused, but now is not the time to delete them.
2020-09-20 17:42:11 +02:00
Sebastian Huber
3c68456a25 bsps/powerpc: Remove -fno-common
Remove -fno-common because it is the default since GCC 10.
2020-09-20 17:39:02 +02:00
Sebastian Huber
9f2a2075fc capture: Move default trace data
Provide the default trace data in a separate file to avoid issues on targets
with a small-data area.

Close #3883.
2020-09-20 17:32:10 +02:00
Sebastian Huber
2b1a4ac84f build: Fix linker path
Use -B for the linker since some architectures use extra start files defined by
the GCC specification and provided by the BSP, for example powerpc.  Start
files are not found by -L.

In the long run, the GCC defined start files should be provided by GCC.  This
is a GCC 11 topic.

Update #3818
2020-09-20 17:32:10 +02:00
Sebastian Huber
da27e962b1 score: Document _Scheduler_Try_to_schedule_node() 2020-09-18 19:38:24 +02:00
Sebastian Huber
0b410b8ac7 rtems: Generate <rtems.h>
Change license to BSD-2-Clause according to file history and
documentation re-licensing agreement.

Update #3053.
Update #3899.
Update #3993.
2020-09-18 18:55:09 +02:00
Sebastian Huber
7892ac0ca4 rtems: From <rtems.h> to <rtems/rtems/mp.h>
Move multiprocessing related definitions to <rtems/rtems/mp.h>.  This
makes <rtems.h> an include only header file.
2020-09-18 18:55:09 +02:00
Sebastian Huber
c161216d44 rtems: From <rtems.h> to <rtems/rtems/types.h>
Move type related definition to <rtems/rtems/types.h>.  The goal is to
make <rtems.h> an include only header file.
2020-09-18 18:55:09 +02:00
Sebastian Huber
d433b72427 rtems: From <rtems.h> to <rtems/rtems/tasks.h>
Move task related declarations and definitions to <rtems/rtems/tasks.h>.
The goal is to make <rtems.h> an include only header file.
2020-09-18 18:55:09 +02:00
Sebastian Huber
1615b5ff17 rtems: From <rtems.h> to <rtems/rtems/object.h>
Move object related declarations and definitions to
<rtems/rtems/object.h>.  The goal is to make <rtems.h> an include only
header file.
2020-09-18 18:55:09 +02:00
Sebastian Huber
5353ea89d7 rtems: Move from <rtems.h> to <rtems/config.h>
Move configuration related declarations and definitions to
<rtems/config.h>.  The goal is to make <rtems.h> an include only header
file.
2020-09-18 18:55:09 +02:00
Sebastian Huber
96ea30f0c9 score: Improve Scheduler Handler documentation 2020-09-18 18:52:49 +02:00
Gedare Bloom
031f8124f2 gitignore: ignore top-level ini files 2020-09-18 09:49:19 -06:00
Sebastian Huber
4e5327ff94 doxygen: Wrap long lines 2020-09-18 08:20:03 +02:00
Sebastian Huber
2f65e136e5 rtems: Fix typo
Update #3959.
2020-09-17 20:07:29 +02:00
Sebastian Huber
3dd4cbb50d validation: rtems_task_construct() errors
This is the first test case generated from a specification item in the
rtems-central repository.

Update #3959.
2020-09-17 17:42:25 +02:00
Sebastian Huber
139ffa25d9 validation: Add general purpose test suite
Add a general purpose test suite for validation tests.

This is the first test suite generated from a specification item in the
rtems-central repository.

Update #3959.
2020-09-17 17:42:25 +02:00
Sebastian Huber
ad22c6552a doxygen: Move top-level group definitions
Update #3959.
2020-09-17 17:42:25 +02:00
Sebastian Huber
6942e5f991 rtems: Add rtems_task_construct()
In contrast to rtems_task_create() this function constructs a task with
a user-provided task storage area.  The new directive uses a
configuration structure instead of individual parameters.

Add RTEMS_TASK_STORAGE_SIZE() to calculate the recommended size of a
task storage area based on the task attributes and the size dedicated to
the task stack and thread-local storage.  This macro may allow future
extensions without breaking the API.

Add application configuration option
CONFIGURE_MINIMUM_TASKS_WITH_USER_PROVIDED_STORAGE to adjust RTEMS
Workspace size estimate.

Update #3959.
2020-09-17 17:42:25 +02:00
Sebastian Huber
c312f3110e CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE
Add this application configuration option.  This configuration option can be
used to reserve space for the dynamic linking of modules with thread-local
storage objects.

Add RTEMS_TASK_STORAGE_ALIGNMENT to define the minium alignment of a
thread-local storage size.

Update #4074.
2020-09-17 17:42:25 +02:00
Sebastian Huber
dce1cdf19e rtems: Add RTEMS_ALIGN_UP()
Update #3959.
Update #4074.
2020-09-17 17:42:25 +02:00
Sebastian Huber
641b31a48d rtems: Add RTEMS_ALIGN_DOWN()
Update #3959.
Update #4074.
2020-09-17 17:42:25 +02:00
Sebastian Huber
11c1b862df build: Allow test program item UIDs with a "-"
Update #3818.
2020-09-17 17:42:25 +02:00
Sebastian Huber
845674e3fb build: Fix mghttpd01 test exclude
Update #3818.
2020-09-17 17:42:25 +02:00
Sebastian Huber
98d2adb935 libtest: Fix T_thread_switch_record()
If RTEMS_DEBUG is not defined, then we have to explicitly set the node
off the chain.

Update #3199.
2020-09-17 17:42:25 +02:00
Hesham Almatary
4897a82dec riscv: Make sifive_test finisher 4 bytes
QEMU is now stricter with MMIO sizes and accesses. uintptr_t on RV64
is 8 bytes and generates an sd instruction that Store/AMO faults
because sifive_test MMIO expects 4 bytes accesses.
2020-09-17 09:01:51 +01:00
Sebastian Huber
4eea8d4bc4 build: Fix dependencies for start and asm files
Add a feature to enforce an explicit target file for assembler sources.
Add a build start file node list and use it as a test program
dependency.

The fix for #3846 and #4080 needs to be combined, because the fix
for #3846 requires the removal of 'before=["cstlib"]'. This patch fixes
two issues:

1. The tracking of start file dependencies.

2. Reflect that executables depend on the start files.

We need a start.o file in the right path so that the linker can find is
as specified by the linker script, and not for example a start.S.17.o
file in some path. This part is addressed by the "explicit_asm_target"
feature.

This build process extension

@after("apply_link")
@feature("cprogram", "cxxprogram")
def process_start_files(self):
    if getattr(self, "start_files", False):
        self.link_task.dep_nodes.extend(self.bld.start_files)

addresses 2.

Close #3846.
Close #4080.
2020-09-17 08:57:54 +02:00
Sebastian Huber
4b767bd343 bsps/arm: Use RTEMS_SECTION() 2020-09-17 08:36:45 +02:00
Sebastian Huber
20d82377a6 arm: Fix arm_cp15_set_translation_table_entries()
In a multi-processor system we must broadcast the TLB maintenance operation to
the Inner Shareable domain to ensure that the other processors update their TLB
caches accordingly.

Close #4068.
2020-09-17 08:20:35 +02:00
Sebastian Huber
9979042a3a build: Fix multiple defintion error for i386/pc386
Make the objcopy an bld.objects() task generator.

Close #4079.
2020-09-15 20:07:47 +02:00
Sebastian Huber
2a4ccc4f8d bsp/pc386: Remove support for obsolete Binutils
Update #3818.
2020-09-15 15:14:38 +02:00
Sebastian Huber
8f424e4580 build: Fix i386/pc386 link of SMP start file
Update #3818.
2020-09-15 15:14:35 +02:00
Sebastian Huber
d9d31b381c build: Add RELOCADDR to i386/pc386 options
Update #3818.
2020-09-15 13:33:00 +02:00
Sebastian Huber
3be2380927 build: Fix i386/pc386 ABI flags
Update #3818.
2020-09-15 13:33:00 +02:00
Sebastian Huber
127c3ea527 build: Fix i386/pc386 with SMP enabled
Update #3818.
2020-09-15 09:20:28 +02:00
Sebastian Huber
2786b0aa38 bsps/riscv: Use far jump to boot_card()
Use a far jump to avoid errors like this:

relocation truncated to fit: R_RISCV_JAL against symbol `boot_card'
2020-09-15 09:20:27 +02:00
Sebastian Huber
4647789820 irqs01/smpirqs01: New tests
Close #4034.
2020-09-14 07:11:40 +02:00
Sebastian Huber
aa27a85a83 build: Use Python tarfile instead of pax
This patch is for the new build system.
2020-09-14 07:11:40 +02:00
Sebastian Huber
f3f0370f10 build: Alternative build system based on waf
Update #3818.
2020-09-14 07:11:32 +02:00
Gedare Bloom
9f096f4724 i386/score: fix assembly mnemonic
Closes #4076.
2020-09-12 09:11:28 -06:00
Joel Sherrill
5959b1e34c Remove tmoverhd which existed to produce the obsolete coverhd.h
Closes #4040.
2020-09-11 08:54:16 -05:00
Sebastian Huber
dd734d467d score: Fix _Thread_Initialize()
Fix an error cleanup path in SMP configurations to avoid a NULL pointer access.

Update #3959.
2020-09-11 15:47:02 +02:00
Joel Sherrill
e563e61c7a Remove remaining references to coverhd.h
Closes #4040.
2020-09-10 11:42:00 -05:00
Sebastian Huber
64d989d116 spintrcritical08: Increase clock tick interval
On some simulators, a clock tick interval of 1ms seems to be too short.
For example, the test failed on sparc/erc32 using the SIS.
2020-09-10 14:41:55 +02:00
Hesham Almatary
764ea57879 htif_console_handler is defined in htif.c
closes #4069.
2020-09-06 16:11:45 -05:00
Sebastian Huber
aedd92d147 score: Add stack free handler to TCB
This avoids a dependency to the stack free function in the thread
destruction.

Update #3959.
2020-08-31 17:30:17 +02:00
Sebastian Huber
2d5510307a score: Move _Stack_Allocator_free to separate file
This decouples the task stack allocation from the deallocation.

Update #3959.
2020-08-31 17:30:17 +02:00
Sebastian Huber
d8172209b3 score: Add _Stack_Allocator_do_initialize()
Do the stack allocator initialization and sanity check only if a
user-provided stack allocator was configured.  This avoids a dependency
of _Thread_Handler_initialization() on the stack allocator.

Update #3959.
2020-08-31 17:30:17 +02:00
Sebastian Huber
159db41166 score: Use _Freechain_Push()
The nodes are never NULL.

Update #3959.
2020-08-31 17:30:17 +02:00
Sebastian Huber
354c2b50a3 score: Add <rtems/score/freechainimpl.h>
Hide implementation details.

Update #3959.
2020-08-31 17:30:17 +02:00
Sebastian Huber
91c811a132 score: Add _Freechain_Push()
Update #3959.
2020-08-31 17:30:17 +02:00
Sebastian Huber
5bb93f22fc score: Fix debug assert
Do not access executing->current_state outside the protection of the
thread state lock.  Add missing state with a comment.
2020-08-31 17:30:17 +02:00
Sebastian Huber
6e6e23384f config: Add zero file descriptor data structures
Fix linker errors in the minimum test program on some BSPs introduced by
ced28f2cfc.
2020-08-31 17:30:17 +02:00
Sebastian Huber
ced28f2cfc config: Provide file descriptors only if necessary
Only provide the file descriptor array if
CONFIGURE_MAXIMUM_FILE_DESCRIPTORS > 0.  If someone configured
CONFIGURE_MAXIMUM_FILE_DESCRIPTORS == 0 and the appplication uses
something which requires a file descriptor, then a linker error will
show up.  An alternative would be to add a zero-length array
rtems_libio_iops[ 0 ] to librtemscpu.a which would be used in this
case.

Conditionally include some header files.
2020-08-31 16:19:57 +02:00
Sebastian Huber
1818b9a826 score: Optimize _Objects_Name_to_id_u32()
Remove the superfluous invalid name check since the object creation
directives ensure that objects with such a name cannot exist.  Also
finding an object with such a name would be no catastrophy if it really
exists.
2020-08-31 16:19:57 +02:00
Sebastian Huber
c7e30854f2 rtems: Add _RTEMS_Name_to_id()
Simplify object name to identifier directives.  Using
_RTEMS_Name_to_id() to implement the directives enables a tail call
optimization.

Change license to BSD-2-Clause according to file history.

Update #3053.
2020-08-31 16:19:57 +02:00
Sebastian Huber
33dbb3355f score: Constify objects name to id functions 2020-08-31 16:19:57 +02:00
Sebastian Huber
d556af3605 bsps: Always install IPI in SMP configs
The inter-processor interrupt (IPI) may be used to process per-CPU jobs.
See for example the blocked handler in T_interrupt_test().

Update #3199.
2020-08-31 16:19:53 +02:00
Jan Sommer
b87efa7599 bsp/xilinx-zynq: Flush TX-Buffer before initializing uart
Closes #4055
Closes #4056
2020-08-22 17:29:25 +10:00
Sebastian Huber
1a506170cc spintrcritical22: Use right thread wait flags 2020-08-21 13:48:48 +02:00
Sebastian Huber
cd74bd0c6d spintrcritical16: Use right thread wait flags 2020-08-21 13:48:44 +02:00
Sebastian Huber
a7a0a36461 config: Conditionally include header 2020-08-21 10:33:50 +02:00
Sebastian Huber
1bb2800102 mp03: Include missing header file 2020-08-21 09:18:29 +02:00
Sebastian Huber
abf25bcc99 score: Fix set but not used warning 2020-08-21 09:18:29 +02:00
Sebastian Huber
81efe37c35 confdefs: Fix cyclic dependency
Close #4061.
2020-08-21 08:57:09 +02:00
Sebastian Huber
75b2093afb sparc: Use RTEMS_XCONCAT()
Prefer macros with a proper namespace.
2020-08-20 14:55:14 +02:00
Sebastian Huber
fe6191f91a bsps/leon3: Remove superfluous includes 2020-08-20 14:54:18 +02:00
Sebastian Huber
95d37b6307 bsps/arm: Use _Assert() 2020-08-20 14:54:18 +02:00
eadler
208ebf2099 dd(1): Use a local swapbytes() function.
swab(3) has restrict qualifiers for src and dst.
Avoid relying on undefined overlapping swab behavior.

Obtained From: OpenBSD
2020-08-20 14:03:20 +02:00
Sebastian Huber
79fb53687b spintrcritical23: Fix unused variable warnings 2020-08-20 08:56:28 +02:00
Sebastian Huber
218053d0f1 sp37: Fix unused variable warnings 2020-08-20 08:56:28 +02:00
Aschref Ben Thabet
65e027c9ed psxkey01: Fix configuration
Key_ID array must have the right size, it shall have a value greater
than zero.
Note: In Standard C and C++, zero-size array is not
allowed..
2020-08-20 07:44:33 +02:00
Aschref Ben Thabet
cbfdcba555 Fix -Wchar-subscripts warnings
The argument to the ctype functions must be an int and the value of the
character must be representable as an unsigned char or equal to the
value of the macro EOF. If the argument has any other value, the
behavior is undefined.
2020-08-20 07:44:33 +02:00
Sebastian Huber
05d5772c1c ada: Add missing attributes 2020-08-19 06:48:32 +02:00
Sebastian Huber
593a67f6c8 rtems: Use unique option values
The RTEMS_BARRIER_AUTOMATIC_RELEASE and RTEMS_BINARY_SEMAPHORE options
had the same value.  In order to better detect a misuse of option values
(for example using RTEMS_BINARY_SEMAPHORE for rtems_barrier_create()),
the options should have unique values.

Close #4054.
2020-08-19 06:48:32 +02:00
Sebastian Huber
c728948434 libtest: Add T_push_plan() and T_pop_plan()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
13acd90003 libtest: Use a destructor
Do not set up a new test steps environment.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
72960bc7d4 libtest: Change T_step() and T_assert_step()
Normally, the expected test step must be a compile time constant.  Allow
variable expected test steps for the T_step() and T_assert_step().  This
can be used for parameterized test loops with individual fixtures.

Remove the ability to use custom failure messages due to some
implementation constraints.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
5383d4db04 libtest: Add fixture steps
Support a new test plan for each nested fixture.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
33eb113c36 libtest: Add T_check_steps()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
cbc1ba341d libtest: Use line buffer in T_check()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
5d614fdfa7 libtest: Add T_puts()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
a7af34d0cf libtest: Add T_do_is_runner()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
e67eff2b53 libtest: Add output buffer drain and fill
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
5a8114c6c5 libtest: Change fixture scope method
Return the produced character count.  There is no need for a NUL
termination.

Update #3199.
2020-08-18 07:08:51 +02:00
Aschref Ben Thabet
5869c64793 rtems/printer.h Fix build warnings -Wclass-memaccess 2020-08-17 11:59:00 +02:00
Chris Johns
3ec5f20484 powerpc/io: The eieio() function clashes with FreeBSD. Change. 2020-08-12 12:59:09 +10:00
Kinsey Moore
14749c4515 posix: Only check shm_unlink obj_err if necessary
In the nominal case checked by spsysinit01, obj_err is unmodified if
_POSIX_Shm_Get_by_name returns non-NULL. In the case of shm_unlink, this means
an uninitialized value is passed into the switch and it appears tests using it
were passing by virtue of the stack having the right value on it in most cases.
This now checks obj_err only if _POSIX_Shm_Get_by_name returns NULL.

Close #4016
2020-08-11 07:51:46 -05:00
Sebastian Huber
01677dd491 spintrcritical23: Restore runner priority 2020-08-11 10:03:53 +02:00
Aschref Ben Thabet
5d7ab6bd21 libtests/dl10: Delete unused functions 2020-08-11 09:49:02 +02:00
Sebastian Huber
c1354f0514 libtest: Add T_thread_switch_record()
Add support to record thread switch events.  This can be used to check
that a blocking operation results in the expected sequence of thread
switches.

Update #3199.
2020-08-11 08:03:47 +02:00
Sebastian Huber
20c79bf5eb libtest: Constify
Update #3199.
2020-08-10 11:49:28 +02:00
Sebastian Huber
6626ed504c Doxyfile: Change version to 6.0.0
Update #4020.
2020-08-10 11:49:28 +02:00
Chris Johns
20b1bdba72 shell: Only clear std handles when the shell task exits
Clearing the std file handles when the main loop exited crashes
telnetd as it reuses its session threads.
2020-08-08 18:12:26 +10:00
Sebastian Huber
f933b651e7 libtest: Improve T_check_task_context
Update #3199.
2020-08-07 18:09:56 +02:00
Sebastian Huber
e812f81c89 Document application configuration options
Add a new directory for Doxygen-specific documentation content.  Add a
Doxygen only header file containing documentation of the application
configuration options.  The header file is generated from specification
items.

Close #3994.
2020-08-07 07:24:01 +02:00
Sebastian Huber
6894e2f4b5 Remove accidentally committed file 2020-08-06 19:45:15 +02:00
Sebastian Huber
32f1f747cc libtest: Fix T_interrupt_test() in SMP configs
Update #3199.
2020-08-06 19:15:57 +02:00
Aschref Ben Thabet
6c4ca834fa psxhdrs/strncpy/stpncpy: Fix string turncation warning
Since we need to test the strncpy function, using a character array with
a fixed array size in this case in place of character pointer can avoid
the string turncation warning.
2020-08-05 14:21:17 +02:00
Sebastian Huber
d2c98c1104 dev/sc16is752: Fix declaration 2020-08-05 09:18:27 +02:00
Sebastian Huber
1b42158588 arm/atsam: Make interrupt server configurable
The external UART over SPI device SC16IS752 uses the interrupt server
for interrupt processing. The interrupt server is also heavily used by
libbsd. The interrupt processing for the SC16IS752 is time critical and
doesn't work if network traffic is processed at the same priority.
With #4033 custom interrupt servers are available. Change
atsam_sc16is752_spi_create() to support user-defined interrupt servers.
Introduced atsam_sc16is752_spi_config to cut down the argument count of
this function.

Close #4039.
2020-08-05 07:00:36 +02:00
Sebastian Huber
81631dea2e smpschededf02: Document reset() function 2020-08-04 15:48:32 +02:00
Sebastian Huber
9566538823 termios: Make rtems_termios_ttyMutex private
This mutex is used to maintain termios internal data structures.
2020-08-04 15:48:32 +02:00
Sebastian Huber
2ae557eb04 score: Use flexible-array member for C99 and later
This addresses compiler warnings like this:

warning: array subscript 0 is outside the bounds of an interior
zero-length array 'abc[0]' [-Wzero-length-bounds]
2020-08-04 15:48:32 +02:00
Christian Mauderer
87fdb206fa dosfs: Fix memory leak on failed mounts.
Currently if mount fails, a converter isn't destroyed. We have to take
care of two cases:

1. The user doesn't provide a converter.

In this case mounting a dosfs creates a default converter. This patch
makes sure that the converter is destroyed again if mount failes for
this case.

2. The user provides a converter.

In this case it's not sure that the dosfs specific routines are reached
because mount can fail before that. Therefore the user has to destroy
the converter himself again. This patch adds a documentation for that
and implements it in the media server.

Closes #4042.
2020-08-04 08:24:17 +02:00
Christian Mauderer
6014fadb5a bsps/beagle: Remove some debug output from I2C. 2020-08-03 09:11:13 +02:00
Sebastian Huber
29e7a069f8 dev/spi-memdrv: Fix use of uninit mem_param_ptr 2020-08-03 08:53:31 +02:00
Sebastian Huber
c60942ea5b rtems: Add rtems_interrupt_server_create()
Add rtems_interrupt_server_destroy().

Before this patch, the only way to create interrupt servers was
rtems_interrupt_server_initialize(). This function creates the default
interrupt server and in SMP configurations additional interrupt servers
for the additional processors. The interrupt server is heavily used by
libbsd. This includes the epoch based reclamation which performs time
consuming resource and memory deallocation work. This does not work well
with time critical services, for example an UART over SPI or I2C. One
approach to address this problem is to allow the application to create
custom interrupt servers with the right priority and task properties.
The interrupt server API accounted for this, however, it was not
implemented before this patch.

Close #4034.
2020-08-03 08:52:41 +02:00
Christian Mauderer
02c9eb8567 bsps/fdt: Make sure data is cache aligned
The cache of the fdt blob is flushed after copy. Therefore it should be
aligned.
2020-07-31 08:26:14 +02:00
Christian Mauderer
29a73d876c bsp/imx: Use GPIOs for SPI CS
The chip select lines of the iMX SPI module doesn't work well for a
generic API like the one RTEMS uses. The existing solution only worked
in some special cases and had odd bugs when trying transfers of
different sizes (like deselecting between each byte for lengths that are
not dividable by 4).

With this patch the same approach like on FreeBSD or Linux is used:
Treat the CS lines as GPIOs.

Update 3869
2020-07-31 08:26:14 +02:00
Christian Mauderer
0f4b911c01 bsp/imx: Add a GPIO driver
Update 3869
2020-07-31 08:26:14 +02:00
Sebastian Huber
a3bcc79a1f bsps/lm32: Use shared <bsp/irq.h>
Having a duplicate header with the shared includes is a build system
inconsistency.  You may use one header file to build the libraries and
another one is installed (overwriting the other).

Update #3269.
2020-07-31 07:01:09 +02:00
Aschref Ben Thabet
699f465c50 psxhdrs/strncat: Fix string truncation warning 2020-07-30 14:57:57 +02:00
Jan Sommer
21c7e3a41f i386: Fix possible race condition on first context restore
Make sure that the esp is restored before the eflags register.

When the init task is initially restored, system interrupts are activated when the
eflags register is loaded.
If the esp register still points to an address in the interrupt stack
area (from early system initlization) the ISR might overwrite its own
stack.

Closes #4031
2020-07-29 11:39:02 +02:00
Sebastian Huber
4444094d02 spmisc01: Include missing header file
Update #4032.
2020-07-24 07:31:43 +02:00
Sebastian Huber
7746b0def9 malloc: Make deferred free support optional
Only include the deferred free support if free() is actually used by the
application.

The free() implementation in RTEMS supports that allocated memory is
freed in interrupt context.  Since the heap is protected by a mutex, the
frees issued in interrupt context cannot immediately be freed to the
heap, instead they are placed on a deferred free list.  This list is
emptied by the core allocation function
rtems_heap_allocate_aligned_with_boundary().  This adds a dependency to
free() in rtems_heap_allocate_aligned_with_boundary(). In order to
better support applications which only allocate memory and never free
it, this dependency should be avoided.  Provide a weak default
implementation of _Malloc_Process_deferred_frees() for
rtems_heap_allocate_aligned_with_boundary().  In the free() module
provide the strong implementation.

Close #4032.
2020-07-24 07:14:02 +02:00
Sebastian Huber
6f94a830bd score: Add RTEMS_WEAK
Update #4032.
2020-07-24 07:12:58 +02:00
Sebastian Huber
b2ff5fe310 spintrcritical_support: Remove
This test support was replaced by T_interrupt_test() is no longer used.
2020-07-23 09:27:48 +02:00
Sebastian Huber
6b795cd75d spintrcritical24: Use T_interrupt_test() 2020-07-23 09:27:48 +02:00
Sebastian Huber
23b9debe12 spintrcritical23: Use T_interrupt_test() 2020-07-23 09:27:48 +02:00
Sebastian Huber
1414e710db spintrcritical22: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
59ee302074 spintrcritical21: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
38636e23c6 spintrcritical20: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
aebdd1dacb spintrcritical18: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
031e8246d4 spintrcritical16: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
1c2e05d4e3 spintrcritical15: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
5020a281b5 spintrcritical13/14: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
8cbba4496a spintrcritical11/12: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
be2f9d74cb spintrcritical10: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
a231276908 spintrcritical09: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
5f66ac86dd spintrcritical08: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
2831395812 spintrcritical06/spintrcritical07: Remove tests
These two tests check conditions which no longer exist in the thread
queue implementation.  The are obsolete since the change to use
red-black trees for the priority queues.
2020-07-23 09:27:47 +02:00
Sebastian Huber
21f7333979 spintrcritical01/2/3/4/5: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
857a65dc7e psxintrcritical01: Use T_interrupt_test() 2020-07-23 09:27:47 +02:00
Sebastian Huber
cc3fd8fcf1 libtest: Add T_interrupt_test()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
c9d2405848 libtest: Add rtems_test_run()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
dddc9a5818 libtest: Add quiet assert NULL pointer checks
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
467ef5b431 libtest: Add T_unreachable()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
d702c9f47d libtest: Make check message optional
This macro magic is in line with C11 and C++11, but limits the maximum
count of arguments.

Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
35d9af6901 libtest: Add T_CHECK_FMT
Rename internal function T_check_true() to T_check() and use the new
flag T_CHECK_FMT to indicate if a format string is present.  This is a
preparation step to make the format string optional.

Make the check context the first parameter.

The API remains the same.

Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
7781404026 libtest: Add T_stop()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
34e4df5590 libtest: Split POSIX Keys support
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
63e4278429 libtest: Add T_get_scope()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
cb3c6bdc0f libtest: Add push/pop fixture support
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
6b27e3251e libtest: Support custom scope messages via fixture
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
c081c68d34 libtest: Add T_make_runner()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
af9266541f libtest: Add T_get_one_clock_tick_busy()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
e3e3b871ee libtest: Add T_busy()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
361404e87d libtest: Move <t.h> to <rtems/test.h>
Update #3199.
2020-07-23 09:27:45 +02:00
Sebastian Huber
9de8d61a9a libtest: <rtems/test.h> to <rtems/test-info.h>
Rename this header file to later move <t.h> to <rtems/test.h>.  The main
feature provided by <rtems/test-info.h> is the output of standard test
information which is consumed by the RTEMS Tester.

Update #3199.
2020-07-23 09:27:10 +02:00
Sebastian Huber
33314eb60a bsps/clock: Fix fast idle clock tick support
If we interrupt a thread dispatch critical section (thread dispatch
disable level != ISR nest level), then we should not do the fast idle
mode since this may delay an ongoing system call forever.
2020-07-23 08:56:06 +02:00
Sebastian Huber
1fab9726c9 score: Improve _Thread_Start() description 2020-07-21 17:13:47 +02:00
Christian Mauderer
3a95a07d88 media-server: Add ability for retry.
This adds the possibility to request a retry in the media-listener if an
operation failed. Usefull for example if you want to automatically
reformat a disk if it wasn't possible to mount it.
2020-07-17 08:12:37 +02:00
Jan Sommer
9cb107c970 bsps/pc386: Fix IPI for non-consecutive APICIDs
- properly use the cpu <-> apic maps for IPIs

Closes #4029.
2020-07-16 08:00:32 -05:00
Sebastian Huber
a3ed421939 score: Remove deprecated Thread
This type was deprecated in RTEMS 5.1.

Close #3991.
2020-07-14 07:25:48 +02:00
Sebastian Huber
53a5af2155 rtems: Remove deprecated proc_ptr definition
Close #3586.
2020-07-14 07:25:47 +02:00
Sebastian Huber
2adf328d05 rtems: Remove support for RTEMS_DEPRECATED_TYPES
Close #3584.
2020-07-14 07:25:47 +02:00
Sebastian Huber
312fcf2fd4 rtems: Remove rtems_thread_cpu_usage_t
This type was deprecated in RTEMS 5.1.

Close #3594.
2020-07-14 07:25:47 +02:00
Sebastian Huber
1546b1c01d rtems: Remove region_information_block
This type was deprecated in RTEMS 5.1.

Close #3592.
2020-07-14 07:25:47 +02:00
Sebastian Huber
f8998f19da rtems: Remove rtems_context_fp
This type was deprecated in RTEMS 5.1.

Close #3590.
2020-07-14 07:25:47 +02:00
Sebastian Huber
df2dac388d rtems: Remove rtems_context
This type was deprecated in RTEMS 5.1.

Close #3588.
2020-07-14 07:25:47 +02:00
Sebastian Huber
65dc040bfb rtems: Remove rtems_rate_monotonic_period_time_t
This type was deprecated in RTEMS 5.1.

Close #3596.
2020-07-14 07:25:47 +02:00
Sebastian Huber
6a3fcd4974 rtems: Remove deprecated rtems_extension
This type was deprecated in RTEMS 5.1.

Close #3988.
2020-07-14 07:25:46 +02:00
Sebastian Huber
13a4b88077 rtems: Remove rtems_get_processor_count()
This function was deprecated in RTEMS 5.1.

Close #3990.
2020-07-14 07:25:46 +02:00
Sebastian Huber
e4215e433b rtems: Remove rtems_get_current_processor()
This function was deprecated in RTEMS 5.1.

Close #3989.
2020-07-14 07:25:46 +02:00
Sebastian Huber
dc4879bba4 rtems: Remove deprecated rtems_io_lookup_name()
Close #3420.
2020-07-14 07:25:46 +02:00
Sebastian Huber
39c2e28410 rtems: Remove deprecated <rtems/system.h>
Close #3980.
2020-07-14 07:25:46 +02:00
Sebastian Huber
479b2bfe87 rtems: Remove _Copyright_Notice from API header
Close #3981.
2020-07-14 07:25:46 +02:00
Sebastian Huber
b3686d7eb5 rtems: Remove RTEMS_MAXIMUM_NAME_LENGTH
Close #3979.
2020-07-14 07:25:45 +02:00
Sebastian Huber
90390118c0 rtems: Move declartion of _RTEMS_version
Close #3978.
2020-07-14 07:25:45 +02:00
James Fitzsimons
a3b86d6caf Fix for Beaglebone BSP PWM bug 2020-07-13 17:53:26 +02:00
Sebastian Huber
d76e7c1975 build: Fix RTEMS_CHECK_NETWORKING
Update #3941.
2020-07-05 20:33:16 +02:00
Sebastian Huber
401b237f93 epiphany: Remove support for this target
Due to an unmaintained toolchain (internal errors in GCC, no FSF GDB
integration) the Epiphany architecture was obsoleted in RTEMS 5.1.

Update #3941.
2020-07-05 18:05:25 +02:00
Sebastian Huber
523551ccf6 bsps/powerpc: Remove obsolete BSPs
Update #3951.
2020-07-05 12:56:05 +02:00
Sebastian Huber
70b803b554 bsps/powerpc: Remove SPE enabled variants
The PowerPC SPE support was removed from GCC.

Update #3951.
2020-07-05 12:56:01 +02:00
Sebastian Huber
69690f60b4 bsps/powerpc: Remove __atexit form start.o
Remove superflous __atexit stuff in start.o.  It is no longer required
by GCC and may cause linker problems.

See GCC commit:

commit 362c63a5e8b5aacfff3e5af0911e42ba7c775042
Author: Geoff Keating <geoffk@cygnus.com>
Date:   Fri Apr 14 23:16:25 2000 +0000
2020-07-05 12:56:01 +02:00
Sebastian Huber
9b5af6a47f bsps/powerpc: Fix tlbie instruction usage
GCC 10 no longer passes -many to the assembler.  This enables more
checks in the assembler.

The 0 in the tlbie instruction is the L operand which selects a 4KiB
page size.
2020-07-05 12:56:01 +02:00
Sebastian Huber
9b3b33d91a bsps/powerpc: Fix inline assembly
GCC 10 no longer passes -many to the assembler.  This enables more
checks in the assembler.
2020-07-05 12:56:01 +02:00
Sebastian Huber
b4a786df18 bsp/qoriq: Fix tlbwe sequence 2020-07-05 12:56:01 +02:00
Sebastian Huber
6a02c11b4e bsps/mips: Fix issues with -fno-common 2020-07-05 12:56:01 +02:00
Sebastian Huber
d0c1ce658e i386: Replace fpcr clobber with memory clobber
Update #3943.
2020-07-05 10:59:11 +02:00
Sebastian Huber
3c78e93c95 score: Clarify CPU_USE_LIBC_INIT_FINI_ARRAY option
Update #4018.
2020-06-30 09:51:33 +02:00
Kinsey Moore
48dd7b8c2e score: Add CPU_USE_LIBC_INIT_FINI_ARRAY
This introduces the CPU_USE_LIBC_INIT_FINI_ARRAY define for use by CPU
ports to determine which global constructor and destructor methods are
used instead of placing architecture defines where they shouldn't be.

Close #4018
2020-06-30 09:46:12 +02:00
Sebastian Huber
37c36def7a Change version to RTEMS 6
Update #4020.
2020-06-30 09:19:08 +02:00
Sebastian Huber
5faad36f97 psxtmtests: Fix test names
Tests PSXTMCOND 08, 09, and 10 had the same test name.
2020-06-23 10:34:57 +02:00
12021 changed files with 2141976 additions and 398652 deletions

10
.gitignore vendored
View File

@@ -1,6 +1,6 @@
aclocal.m4
autom4te.cache
configure
config.h.in
Makefile.in
/build
doc
/*.ini
.lock*
*.pyc
.waf*

261
CODEOWNERS Normal file
View File

@@ -0,0 +1,261 @@
# Please keep users, directories and files sorted alphabetically.
# Directories first
#
# If there is more than 1 user in a section it must be promoted to a group in
# /approvers
[General Maintainer] @approvers/general/maintainer
*
[Documentation] @approvers/docs
*/README
*.md
*.rst
*.txt
# CPUKit
########
[CPUKit libdebugger] @approvers/cpukit/libdebugger
/cpukit/libdebugger
[CPUKit libdl] @approvers/cpukit/libdl
/cpukit/libdl
[CPUKit libdrvmgr] @approvers/cpukit/libdrvmgr
/cpukit/libdrvmgr
[CPUKit libgnat] @joel
/cpukit/libgnat
[CPUKit librtemscxx] @approvers/cpukit/librtemscxx
/cpukit/librtemscxx
[CPUKit libstdthreads] @approvers/cpukit/libstdthreads
/cpukit/libstdthreads
# Architectures
###############
[Arch AArch64] @approvers/arch/aarch64
/bsps/aarch64/
/cpukit/score/cpu/aarch64/
/spec/build/bsps/aarch64/
/cpukit/libdebugger/rtems-debugger-aarch64.v
/cpukit/libdl/rtl-mdreloc-aarch64.c
/spec/build/cpukit/*aarch64.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch ARM] @approvers/arch/arm
/bsps/arm/
/bsps/include/arm/
/bsps/include/xil/arm/
/bsps/shared/freebsd/sys/arm/
/bsps/shared/xil/arm/
/cpukit/score/cpu/arm/
/spec/build/bsps/arm/
/cpukit/libdebugger/rtems-debugger-arm.c
/cpukit/libdl/*arm*
/spec/build/cpukit/*arm.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch Blackfin] @approvers/arch/bfin
/bsps/bfin/
/cpukit/score/cpu/bfin/
/spec/build/bsps/bfin/
/cpukit/libdl/rtl-mdreloc-bfin.c
/spec/build/cpukit/cpubfin.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch i386] @approvers/arch/i386
/bsps/i386/
/cpukit/score/cpu/i386/
/spec/build/bsps/i386/
/cpukit/libdebugger/rtems-debugger-i386.c
/cpukit/libdl/rtl-mdreloc-i386.c
/spec/build/cpukit/*i386*
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch LatticeMico32] @approvers/arch/lm32
/bsps/lm32/
/cpukit/score/cpu/lm32/
/spec/build/bsps/lm32/
/cpukit/libdl/rtl-mdreloc-lm32.c
/spec/build/cpukit/cpulm32.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch Motorola 68000] @approvers/arch/m68k
/bsps/m68k/
/cpukit/score/cpu/m68k/
/spec/build/bsps/m68k/
/cpukit/libdl/rtl-mdreloc-m68k.c
/spec/build/cpukit/*m68k*
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch MicroBlaze] @approvers/arch/microblaze
/bsps/include/xil/microblaze/
/bsps/microblaze/
/cpukit/score/cpu/microblaze/
/spec/build/bsps/microblaze/
/cpukit/libdebugger/rtems-debugger-microblaze.c
/cpukit/libdl/rtl-mdreloc-microblaze.c
/spec/build/cpukit/*microblaze*
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch MIPS] @approvers/arch/mips
/bsps/mips/
/cpukit/score/cpu/mips/
/spec/build/bsps/mips/
/cpukit/libdl/rtl-mdreloc-mips.c
/spec/build/cpukit/*mips.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch Moxie] @approvers/arch/moxie
/bsps/moxie/
/cpukit/score/cpu/moxie/
/spec/build/bsps/moxie/
/cpukit/libdl/rtl-mdreloc-moxie.c
/spec/build/cpukit/*moxie.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch Nios II] @approvers/arch/nios2
/bsps/nios2/
/cpukit/score/cpu/nios2/
/spec/build/bsps/nios2/
/spec/build/cpukit/*nios2.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch OpenRISC 1000] @approvers/arch/or1k
/bsps/or1k/
/cpukit/score/cpu/or1k/
/spec/build/bsps/or1k/
/spec/build/cpukit/*or1k.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch PowerPC] @approvers/arch/powerpc
/bsps/powerpc/
/cpukit/score/cpu/powerpc/
/spec/build/bsps/powerpc/
/cpukit/libdl/rtl-mdreloc-powerpc.c
/spec/build/cpukit/*powerpc.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch RISC-V] @approvers/arch/risc-v
/bsps/riscv
/cpukit/score/cpu/riscv
/spec/build/bsps/riscv
/cpukit/libdl/rtl-mdreloc-riscv.c
/spec/build/cpukit/*riscv.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch SuperH] @approvers/arch/superh
/bsps/sh/
/cpukit/score/cpu/sh/
/spec/build/bsps/sh/
/spec/build/cpukit/cpush.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch SPARC] @approvers/arch/sparc
/bsps/sparc/
/cpukit/score/cpu/sparc/
/spec/build/bsps/sparc/
/spec/build/cpukit/cpusparc.yml
/spec/build/cpukit/objdlsparc.yml
/spec/build/testsuites/validation/bsps/*-sparc-*
/testsuites/validation/bsps/*-sparc-*
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch SPARC64] @approvers/arch/sparc64
/bsps/sparc64/
/cpukit/score/cpu/sparc64/
/spec/build/bsps/sparc64/
/spec/build/cpukit/*sparc64.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch V850] @approvers/arch/v850
/bsps/v850/
/cpukit/score/cpu/v850/
/spec/build/bsps/v850/
/cpukit/libdl/rtl-mdreloc-v850.c
/spec/build/cpukit/*v850.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs
[Arch X86_64] @approvers/arch/x86_64
/bsps/x86_64/
/cpukit/score/cpu/x86_64/
/spec/build/bsps/x86_64/
/spec/build/cpukit/*x8664.yml
*/README @approvers/docs
*.md @approvers/docs
*.rst @approvers/docs
*.txt @approvers/docs

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = RTEMS
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 5.0.0
PROJECT_NUMBER = 6.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -812,7 +812,10 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = bsps cpukit
INPUT = bsps \
cpukit \
testsuites/fstests/tftpfs \
testsuites/validation
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -896,7 +899,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = cpukit/libnetworking
EXCLUDE = cpukit/libnetworking cpukit/libfs/src/nfsclient
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded

View File

@@ -1,4 +0,0 @@
Building RTEMS
==============
See the documentation referred to in the README.

20
LICENSE
View File

@@ -1,20 +0,0 @@
LICENSE INFORMATION
RTEMS is free software; you can redistribute it and/or modify it under
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version. RTEMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. You should have received
a copy of the GNU General Public License along with RTEMS; see
file COPYING. If not, write to the Free Software Foundation, 675
Mass Ave, Cambridge, MA 02139, USA.
As a special exception, including RTEMS header files in a file,
instantiating RTEMS generics or templates, or linking other files
with RTEMS objects to produce an executable application, does not
by itself cause the resulting executable application to be covered
by the GNU General Public License. This exception does not
however invalidate any other reasons why the executable file might be
covered by the GNU Public License.

View File

@@ -1,51 +0,0 @@
https://spdx.org/licenses/BSD-2-Clause.html
This license file serves as a template for the license header in files.
You are the copyright holder. Copy the comment below the top of the file in
which you want to use this license for your contribution. Replace the
<FIRST YEAR> placeholder with the year of your first substantial contribution
to this file. Update the <LAST YEAR> with the year of your last substantial
contribution to this file. If the first and last years are the same, then
remove the <LAST YEAR> placeholder with the comma. Replace the
<COPYRIGHT HOLDER> placeholder with your name. In case you are a real person,
then use the following format for <COPYRIGHT HOLDER>:
<FIRST NAME> <MIDDLE NAMES> <LAST NAME>
The <FIRST NAME> is your first name (also known as given name), the
<MIDDLE NAMES> are your optional middle names, the <LAST NAME> is your last
name (also known as family name).
If more than one copyright holder exists for a file, then sort the copyright
lines by the first year (earlier years are below later years) followed by the
copyright holder in alphabetical order (A is above B).
You must not alter anything else in the license comment.
/*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (C) <FIRST YEAR>, <LAST YEAR> <COPYRIGHT HOLDER>
*
* 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.
*/

View File

@@ -1,428 +0,0 @@
Attribution-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-ShareAlike 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -1,30 +0,0 @@
The files in this directory and elsewhere which refer to this LICENCE
file are part of JFFS2, the Journalling Flash File System v2.
Copyright © 2001-2007 Red Hat, Inc. and others
JFFS2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 or (at your option) any later
version.
JFFS2 is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with JFFS2; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
As a special exception, if other files instantiate templates or use
macros or inline functions from these files, or you compile these
files and link them with other works to produce a work based on these
files, these files do not by themselves cause the resulting work to be
covered by the GNU General Public License. However the source code for
these files must still be made available in accordance with section (3)
of the GNU General Public License.
This exception does not invalidate any other reasons why a work based on
this file might be covered by the GNU General Public License.

View File

@@ -1,59 +0,0 @@
The RTEMS TCP/IP stack is a port of the FreeBSD TCP/IP stack. The following
copyright and licensing information applies to this code.
This code is found under the c/src/libnetworking directory but does not
constitute the entire contents of that subdirectory.
=============================================================================
Copyright (c) 1980, 1983, 1988, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgment:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
-
Portions Copyright (c) 1993 by Digital Equipment Corporation.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and that
the name of Digital Equipment Corporation not be used in advertising or
publicity pertaining to distribution of the document or software without
specific, written prior permission.
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
=============================================================================

View File

@@ -1,40 +0,0 @@
The RTEMS RPC/XDR support is a port of the freely distributed
Sun Microsystems implementation. The following copyright and
licensing information applies to this code.
This code is in the c/src/librpc directory.
=============================================================================
Copyright (C) 1984, Sun Microsystems, Inc.
Sun RPC is a product of Sun Microsystems, Inc. and is provided for
unrestricted use provided that this legend is included on all tape
media and as a part of the software program in whole or part. Users
may copy or modify Sun RPC without charge, but are not authorized
to license or distribute it to anyone else except as part of a product or
program developed by the user.
SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
Sun RPC is provided with no support and without any obligation on the
part of Sun Microsystems, Inc. to assist in its use, correction,
modification or enhancement.
SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
OR ANY PART THEREOF.
In no event will Sun Microsystems, Inc. be liable for any lost revenue
or profits or other special, indirect and consequential damages, even if
Sun has been advised of the possibility of such damages.
Sun Microsystems, Inc.
2550 Garcia Avenue
Mountain View, California 94043
=============================================================================

1377
LICENSE.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,65 +0,0 @@
Maintainers
===========
This file contains information about people who are permitted to make
changes to RTEMS and its associated components and add-ons. Please do
not contact the people in this file directly to report problems with RTEMS.
For general information about RTEMS, please visit: http://www.rtems.org
To report problems in RTEMS, please visit: http://www.rtems.org/bugs.html
RTEMS is maintained by collection of volunteers. RTEMS is a very
broad and diverse project which requires expertise in many areas.
This breadth of knowledge exceeds the capabilities of any
single person. Each volunteer has areas of expertise where they
are more comfortable but each is capable of making technical
decisions across the entirety of RTEMS.
Blanket Write Privileges are granted to experienced RTEMS developers
who can be trusted to distinguish between changes which require
others to review, require a problem report, or can be safely committed
with limited review.
Write After Approval is granted to experienced but also trusted
RTEMS developers. These developers may be less familiar with
the breadth of RTEMS. Developers with write after approval need
to submit their patches for review. Once the patches have been approved by a
developer with Blanket Write Privileges, the patches may be checked in.
A BSP-specific patch may be checked in three work days after sending it to
devel@rtems.org in case nobody explicitly rejected the patch.
Localized Write Permission is for developers who have primary
responsibility for a port and all associated BSPs, a BSP, or other
specific aspects of RTEMS. These folks are allowed to make changes to
areas they maintain and related documentation, web pages, and test cases
without approval from anyone else, and approve other people's changes
in those areas. They must get approval for changes elsewhere in RTEMS.
Blanket Write Privileges
========================
Jennifer Averett jennifer.averett@OARcorp.com
Thomas Doefler Thomas.Doerfler@embedded-brains.de
Sebastian Huber sebastian.huber@embedded-brains.de
Chris Johns chrisj@rtems.org
Joel Sherrill joel.sherrill@OARcorp.com
Gedare Bloom gedare@rtems.org
Write After Approval
====================
Daniel Hellstrom daniel@gaisler.com
Ben Gras beng@rtems.org
Pavel Pisa ppisa@pikron.com
Christian Mauderer christian.mauderer@embedded-brains.de
Hesham Almatary heshamelmatary@gmail.com
Amaan Cheval amaan@rtems.org
Vijay Kumar Banerjee vijay@rtems.org
Localized Write Permission
==========================
sparc Daniel Hellstrom (daniel@gaisler.com)
beagle Ben Gras (beng@rtems.org)
tms570 Pavel Pisa (pisa@cmp.felk.cvut.cz)
raspberrypi Pavel Pisa (pisa@cmp.felk.cvut.cz)
x86_64 Amaan Cheval (amaan@rtems.org)
beagle Vijay Kumar Banerjee (vijay@rtems.org)

View File

@@ -1,55 +0,0 @@
#
# top level directory for RTEMS build tree
#
ACLOCAL_AMFLAGS = -I aclocal
SUBDIRS = $(build_SUBDIRS) $(host_SUBDIRS) $(target_SUBDIRS)
DIST_SUBDIRS = $(SUBDIRS)
noinst_SCRIPTS = bootstrap
dist-hook:
@files=`(cd $(srcdir); find cpukit c testsuites \
-name configure.ac -print | sed 's,/configure.ac,,' | sort)`; \
for i in $$files; do \
if test -f $(distdir)/$$i/configure.ac; then : ; \
else \
d=`dirname $(distdir)/$$i`; \
$(MKDIR_P) $$d;\
echo "cp -pR $(srcdir)/$$i $(distdir)/$$i"; \
cp -pR $(srcdir)/$$i $(distdir)/$$i; \
fi; \
done
rm -rf `find $(distdir) -name 'autom4te*'`
rm -rf `find $(distdir) -name CVS`
rm -f `find $(distdir) \( -name .cvsignore \
-o -name config.status \
-o -name config.log \)`
rm -f `find $(distdir) \( -name '*.bak' \
-o -name 'changes' -o -name 'diff' -o -name 'tmp' -o -name 'log' \
-o -name '*~' -o -name '.*~' -o -name '.#*' \)`
find $(distdir) -name '*.in' -print | while read a; do \
f=`echo $$a | sed 's,\.in$$,,'`; \
if test -f $$f; then echo "rm $$f"; rm $$f; fi; done
rtems_makedir = $(prefix)/make
dist_rtems_make_DATA =
dist_rtems_make_DATA += make/main.cfg
dist_rtems_make_DATA += make/leaf.cfg
rtems_make_Templatesdir = $(pkgdatadir)/make/Templates
dist_rtems_make_Templates_DATA =
dist_rtems_make_Templates_DATA += make/Templates/Makefile.dir
dist_rtems_make_Templates_DATA += make/Templates/Makefile.leaf
dist_rtems_make_Templates_DATA += make/Templates/Makefile.lib
rtems_make_customdir = $(rtems_makedir)/custom
dist_rtems_make_custom_DATA = make/custom/default.cfg
include $(top_srcdir)/automake/subdirs.am
include $(top_srcdir)/automake/host.am

View File

@@ -1,153 +0,0 @@
#
# Maintainer Makefile
#
# WARNING:
# THIS IS EXPERIMENTAL - DO NOT USE (YET) !
# * This Makefile is only useful to RTEMS maintainers
# * You must have write access to RTEMS CVS
# * Running this Makefile modifies RTEMS CVS
# * Watch out for warning and error messages - Do NOT IGNORE them!
# MAINTAINER notes:
# Cutting a new release:
# 1. Perform a non-anonymous cvs checkout of the BRANCH
# you want to cut a release tarball from
# 2. Run "make -f Makefile.maint new-revision"
# (rsp. "make -f Makefile.maint new-minor").
# 3. Run "make -f Makefile.maint commit"
# 4. Run "make -f Makefile.maint tag"
# 5. Run "make -f Makefile.maint tarball"
# -----------------
# SECURITY: Append a string to tag to avoid accidentially screwing up cvs-tags
# For "hot runs" you will want to use "make -f Makefile.maint TAG_SUFFIX= <command>"
TAG_SUFFIX = -test1
rtems_version := $(shell cat VERSION | sed -n '/.* Version /{s/^.*Version[ ]*\([0-9\.]\+\)/\1/p};')
rtems_tag := $(shell echo "rtems-$(rtems_version)" | tr . -)
rtems_api := 4.10
PATH := /opt/rtems-$(rtems_api)/bin:$(PATH)
# -----------------
# Cleanup check out and cvs-tag the files inside
tag:
cvs -q -z9 up -dP
./bootstrap -p >/dev/null
cvs -q tag -c $(rtems_tag)$(TAG_SUFFIX)
# -----------------
# Different stages of cvs-exporting
rtems-$(rtems_version)/stamp.export.$(rtems_tag)$(TAG_SUFFIX):
rm -rf rtems-$(rtems_version)
@cvs -q -z9 export -d rtems-$(rtems_version) -r $(rtems_tag)$(TAG_SUFFIX) rtems
@if ! test -f rtems-$(rtems_version)/VERSION; then \
echo "ERROR export failed"; \
echo " Did you run 'make -f Makefile.maint tag' ?"; exit 1; fi
echo "$(rtems_tag)$(TAG_SUFFIX)" > rtems-$(rtems_version)/stamp.export.$(rtems_tag)$(TAG_SUFFIX)
rtems-$(rtems_version)$(TAG_SUFFIX).tar.bz2: rtems-$(rtems_version)/stamp.autofiles \
rtems-$(rtems_version)/excludes \
rtems-$(rtems_version)/TOOL_VERSIONS
tar -cj -X rtems-$(rtems_version)/excludes \
-f rtems-$(rtems_version)$(TAG_SUFFIX).tar.bz2 rtems-$(rtems_version)
## Touching the top pages in the various manuals results in the date
## on their title page matching the release date.
rtems-$(rtems_version)/stamp.cleanup: rtems-$(rtems_version)/stamp.export.$(rtems_tag)$(TAG_SUFFIX)
find rtems-$(rtems_version) -name .cvsignore -exec rm -f {} \;
find rtems-$(rtems_version) -name preinstall.am -exec touch {} \;
rm -rf rtems-$(rtems_version)/contrib
touch rtems-$(rtems_version)/stamp.cleanup
rtems-$(rtems_version)/stamp.autofiles: rtems-$(rtems_version)/stamp.cleanup
cd rtems-$(rtems_version) && ./bootstrap -r
touch rtems-$(rtems_version)/stamp.autofiles
rtems-$(rtems_version)/excludes: Makefile.maint
@echo "Generating $@"
@echo "excludes" > $@
@echo "stamp.*" >> $@
@echo "autom4te.cache" >> $@
@echo "Makefile.maint" >> $@
tarball: rtems-$(rtems_version)$(TAG_SUFFIX).tar.bz2
rtems-$(rtems_version)/TOOL_VERSIONS: Makefile.maint
( \
date ; \
echo ; \
echo "This file contains configuration information on the " ; \
echo "primary computer used to test and make the $(rtems_version)" ; \
echo "version of RTEMS" ; \
echo ; \
echo "OS Version: " `head -1 /etc/issue` ; \
echo ; \
echo "The following RTEMS RPMs were installed on the machine" ; \
echo "where this release was made:" ; \
echo ; \
rpm -qa 'rtems-$(rtems_api)-*' | sort | sed -e 's/^/ /' ; \
echo \
) > $@
# -----------------
# Create a new minor release
# increments the 2nd digit of the version number
# set the 3rd digit of the version number to 0
# Example: 4.6.99.4 -> 4.7.0
new-minor:
@v=$$(echo $(rtems_version) | sed 's,^\([0-9]\+\).*,\1,'); \
r=$$(echo $(rtems_version) | sed 's,^[0-9]\+\.\([0-9]\+\).*,\1,'); \
r=$$(($$r + 1)); version="$$v.$$r.0"; \
echo "New minor release: $$version"; \
sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
$(VERSION_FILES); \
sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
# Create a new revision release
# increments the last digit of the version number
# Examples: 4.6.99.4 -> 4.6.99.5
# 4.7.0 -> 4.7.1
new-revision:
@m=$$(echo $(rtems_version) | sed 's,^\(.*\)\.[0-9]\+,\1,'); \
n=$$(echo $(rtems_version) | sed 's,^.*\.\([0-9]\+\),\1,'); \
n=$$(($$n + 1)); version="$$m.$$n";\
echo "New revision release: $$version"; \
sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
$(VERSION_FILES); \
sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
# -----------------
# Create a new branch
# increments the 2nd digit of the version number
# set the 3rd digit of the version number to 99
# set the 4rd digit of the version number to 0
# Example: 4.6.34.4 -> 4.7.99.0
new-branch:
v=$$(echo $(rtems_version) | sed 's,^\([0-9]\+\).*,\1,'); \
r=$$(echo $(rtems_version) | sed 's,^[0-9]\+\.\([0-9]\+\).*,\1,'); \
r=$$(($$r + 1)); version="$$v.$$r.99.0"; \
api="$$v.$$(($$r + 1))"; \
echo "New branch release: $$version"; \
sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[$$version\]|" \
-e "s|\[_RTEMS_API\],\[.*\]|\[_RTEMS_API\],\[$$api\]|" \
$(VERSION_FILES); \
sed -i -e "s,\(^RTEMS Version\).*,\1 $$version," VERSION
VERSION_FILES += aclocal/version.m4
VERSION_FILES += cpukit/aclocal/version.m4
VERSION_FILES += c/src/aclocal/version.m4
VERSION_FILES += testsuites/aclocal/version.m4
CVS_RUN := $(shell if [ -n "$(TAG_SUFFIX)" ]; then echo "cvs -n"; else echo "cvs"; fi)
commit:
$(CVS_RUN) commit -m "Upgrade to $(rtems_version)" \
$(VERSION_FILES) VERSION
.PHONY: commit new-minor new-revision new-branch tag tarball

57
README
View File

@@ -1,57 +0,0 @@
Real-Time Executive for Multiprocessing Systems (RTEMS)
-------------------------------------------------------
RTEMS, Real-Time Executive for Multiprocessor Systems, is a real-time executive
(kernel) which provides a high performance environment for embedded
applications with the following features:
- standards based user interfaces
- multitasking capabilities
- homogeneous and heterogeneous multiprocessor systems
- event-driven, priority-based, preemptive scheduling
- optional rate monotonic scheduling
- intertask communication and synchronization
- priority inheritance
- responsive interrupt management
- dynamic memory allocation
- high level of user configurability
- open source with a friendly user license
Project git repositories are located at https://git.rtems.org/
RTEMS Kernel: : https://git.rtems.org/rtems/
RTEMS Source Builder : https://git.rtems.org/rtems-source-builder/
RTEMS Tools : https://git.rtems.org/rtems-tools/
RTEMS Documentation : https://git.rtems.org/rtems-docs/
RTEMS FreeBSD : https://git.rtems.org/rtems-libbsd/
Online documentation is available at https://docs.rtems.org/
RTEMS User Manual : https://docs.rtems.org/branches/master/user/index.html
RTEMS RSB Manual : https://docs.rtems.org/branches/master/rsb/index.html
RTEMS Classic API : https://docs.rtems.org/branches/master/c-user/index.html
RTEMS POSIX API : https://docs.rtems.org/branches/master/posix-users/index.html
RTEMS Doxygen for CPUKit : https://docs.rtems.org/doxygen/branches/master/
RTEMS POSIX 1003.1 Compliance Guide :
https://docs.rtems.org/branches/master/posix-compliance/index.html
- Details the standards base functionality and profiles RTEMS supportsXo
RTEMS Developers Wiki : http://devel.rtems.org
- Bug reporting, community knowledge and tutorials.
RTEMS Mailing Lists : https://lists.rtems.org/mailman/listinfo
- The RTEMS Project maintains mailing lists which are used for most
discussions:
* For general-purpose questions related to using RTEMS, use the rtems-users
ml: https://lists.rtems.org/mailman/listinfo/users
* For questions and discussion related to development of RTEMS, use the
rtems-devel ml: https://lists.rtems.org/mailman/listinfo/devel
The version number for this software is indicated in the VERSION file.

46
README.md Normal file
View File

@@ -0,0 +1,46 @@
Real-Time Executive for Multiprocessing Systems
===============================================
RTEMS is a real-time executive (kernel) which provides a high performance
environment for embedded applications with the following features:
* Standards based user interfaces.
* Multitasking capabilities.
* Homogeneous and heterogeneous multiprocessor systems.
* Event-driven, priority-based, preemptive scheduling.
* Optional rate monotonic scheduling.
* Intertask communication and synchronisation.
* Priority inheritance.
* Responsive interrupt management.
* Dynamic memory allocation.
* High level of user configurability.
* Open source with a friendly user license.
Project git repositories are located at:
* https://gitlab.rtems.org/rtems/
Online documentation is available at:
* https://docs.rtems.org/
RTEMS Doxygen for CPUKit:
* https://docs.rtems.org/doxygen/branches/master/
RTEMS POSIX 1003.1 Compliance Guide:
* https://docs.rtems.org/branches/master/posix-compliance/
RTEMS Mailing Lists for general purpose use the users list and for developers
use the devel list.
* https://lists.rtems.org/mailman/listinfo
The version number for this software is indicated in the VERSION file.

View File

@@ -1,399 +0,0 @@
## All directories belong in one of 3 categories.
## ${HOST_CONFIGDIRS_LIST} is directories we build using the host tools.
## ${TARGET_CONFIGDIRS_LIST} is directories we build using the target tools.
## ${BUILD_CONFIGDIRS_LIST} is directories we build using the build tools
AC_PREREQ(2.60)
dnl RTEMS_ARG_VAR(VAR,HELP-STRING)
dnl An internal macros to have help strings pretty
dnl printed with configure --help, without letting autoconf spoil config subdir
dnl environments by trying to propagate them
dnl Stripped down version of autoconf-2.52's AC_ARG_VAR.
AC_DEFUN([_RTEMS_ARG_VAR],
[
m4_expand_once([m4_divert_once([HELP_VAR],
[AS_HELP_STRING([$1], [$2], [ ])])],
[$0($1)])dnl
])
AC_DEFUN([_RTEMS_SUBST_IFNOT],
[AS_IF([`echo " [$]$1 " | grep " $2 " > /dev/null`],
[],
[AC_SUBST([$1],["[$]$1 $2"])])
])
AC_DEFUN([_RTEMS_TOOLS],
[
m4_ifdef([_RTEMS_$2_CONFIGDIRS_LIST],
[
_RTEMS_ARG_VAR([CC_FOR_$2],
[c-compiler to be used for $1 subdirs (default: auto-detected)])
_RTEMS_ARG_VAR([CFLAGS_FOR_$2],
[c-flags to be used for $1 subdirs (default: provided by autoconf)])
_RTEMS_ARG_VAR([CXX_FOR_$2],
[c++-compiler to be used for $1 subdirs (default: auto-detected)])
_RTEMS_ARG_VAR([CXXFLAGS_FOR_$2],
[c++-flags to be used for $1 subdirs (default: provided by autoconf)])
])
])
AC_DEFUN([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS],
[
AC_CONFIG_COMMANDS_PRE([
if test -z "${build_alias}"; then
# build_alias is empty
if test -z "${host_alias}"; then
# host_alias is empty
if test -z "${target_alias}"; then
: target_alias is empty
else
: target_alias is not empty
fi
else
# host_alias is not empty
if test -z "${target_alias}"; then
: target_alias is empty
target_alias="${host_alias}"
else
: target_alias is not empty
fi
fi
else
# build_alias is not empty
if test -z "${host_alias}"; then
# host_alias is empty
if test -z "${target_alias}"; then
: target_alias is empty
else
: target_alias is not empty
fi
else
# host_alias is not empty
if test -z "${target_alias}"; then
: target_alias is empty
target_alias="${host_alias}"
else
: target_alias is not empty
fi
fi
fi
_RTEMS_BUILD_CONFIG_PREPARE
_RTEMS_HOST_CONFIG_PREPARE
_RTEMS_TARGET_CONFIG_PREPARE
build_subdir="."
build_SUBDIRS="${build_configdirs}"
build_configdirs="${build_configdirs}"
AS_IF([test $build != $host],
[dnl
host_subdir="${host_alias-$host}"
host_SUBDIRS=`echo "${host_configdirs}" | \
sed -e "s%\([[^ ]][[^ ]]*\)%$host_subdir/\1%g"`
host_configdirs="${host_configdirs}"
],[dnl
host_SUBDIRS="${host_configdirs}"
host_configdirs="${host_configdirs}"
])
AS_IF([test $build != $target],
[dnl
target_subdir="${target_alias-$target}"
target_SUBDIRS=`echo "${target_configdirs}" | \
sed -e "s%\([[^ ]][[^ ]]*\)%$target_subdir/\1%g"`
target_configdirs="${target_configdirs}"
],[dnl
target_SUBDIRS="${target_configdirs}"
target_configdirs="${target_configdirs}"
])
AC_SUBST(host_SUBDIRS)
AC_SUBST(target_SUBDIRS)
AC_SUBST(build_SUBDIRS)
])
AC_CONFIG_COMMANDS_POST([
_RTEMS_OUTPUT_SUBDIRS([build],[BUILD])
_RTEMS_OUTPUT_SUBDIRS([host],[HOST])
_RTEMS_OUTPUT_SUBDIRS([target],[TARGET])
])
])
dnl _RTEMS_SRCPATHS(BUILD-DIR-NAME)
dnl ----------------------------
dnl Inputs:
dnl - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'
dnl - `$srcdir' is `top-build -> top-src'
dnl
dnl Outputs:
dnl - `ac_builddir' is `.', for symmetry only.
dnl - `ac_top_builddir' is `build -> top_build'.
dnl If not empty, has a trailing slash.
dnl - `ac_srcdir' is `build -> src'.
dnl - `ac_top_srcdir' is `build -> top-src'.
dnl
dnl and `ac_buildpath' etc., the absolute paths.
m4_define([_RTEMS_SRCPATHS],
[
m4_if([$2],,
[dstdir=$1],
[case "$2" in
"." | "" ) # No subdir was given
dstdir=$1;;
* ) # A subdir was given
dstdir=$2/$1;;
esac])
ac_builddir=.
AS_IF([test $dstdir != .],
[ # Strip off leading ./
ac_builddir_suffix=/`echo $dstdir | sed 's,^\.[[\\/]],,'`
ac_srcdir_suffix=/`echo $1 | sed 's,^\.[[\\/]],,'`
# A "../" for each directory in $ac_dir_suffix.
ac_top_builddir=`echo "$ac_builddir_suffix" | sed 's,/[[^\\/]]*,../,g'`
],[
ac_dir_suffix= ac_top_builddir=
])
case $srcdir in
.) # No --srcdir option. We are building in place.
ac_srcdir=.
if test -z "$ac_top_builddir"; then
ac_top_srcdir=.
else
ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
fi ;;
[[\\/]]* | ?:[[\\/]]* ) # Absolute path.
ac_srcdir=$srcdir$ac_srcdir_suffix;
ac_top_srcdir=$srcdir;
;;
*) # Relative path.
ac_srcdir=$ac_top_builddir$srcdir$ac_srcdir_suffix;
ac_top_srcdir=$ac_top_builddir$srcdir;
;;
esac
dnl Don't blindly perform a `cd $1/$ac_foo && pwd` since $ac_foo can be
dnl absolute.
ac_buildpath=`cd $dstdir && cd $ac_builddir && pwd`
ac_top_buildpath=`cd $dstdir && cd $ac_top_builddir && pwd`
ac_srcpath=`cd $dstdir && cd $ac_srcdir && pwd`
ac_top_srcpath=`cd $dstdir && cd $ac_top_srcdir && pwd`
])# _AC_SRCPATHS
dnl _RTEMS_OUTPUT_SUBDIRS([host|target|build],[HOST|TARGET|BUILD])
AC_DEFUN([_RTEMS_OUTPUT_SUBDIRS],[
m4_ifdef([_RTEMS_$2_CONFIGDIRS_LIST],
[
if test "$no_recursion" != yes; then
if test -n "${$1_SUBDIRS}"; then
ac_sub_configure_args="[$]$1args"
# Always prepend --prefix to ensure using the same prefix
# in subdir configurations.
ac_sub_configure_args="'--prefix=$prefix' $ac_sub_configure_args"
# make sure that $1_subdir is not empty
test -n "$$1_subdir" || $1_subdir="."
case "$$1_subdir" in
"." ) ;;
* )
ac_sub_configure_args="$ac_sub_configure_args '--with-target-subdir=$$1_subdir'"
ac_sub_configure_args="$ac_sub_configure_args '--exec-prefix=${prefix}/$$1_subdir'"
ac_sub_configure_args="$ac_sub_configure_args '--includedir=${prefix}/$$1_subdir/include'"
;;
esac
ac_popdir=`pwd`
for ac_dir in : $$1_configdirs; do test "x$ac_dir" = x: && continue
# Do not complain, so a configure script can configure whichever
# parts of a large source tree are present.
test -d $srcdir/$ac_dir || continue
AC_MSG_NOTICE([configuring in $$1_subdir/$ac_dir])
AS_MKDIR_P(["$$1_subdir/$ac_dir"])
_RTEMS_SRCPATHS(["$ac_dir"],["$$1_subdir"])
cd $$1_subdir/$ac_dir
# Check for guested configure; otherwise get Cygnus style configure.
if test -f $ac_srcdir/configure.gnu; then
ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
elif test -f $ac_srcdir/configure; then
ac_sub_configure="$SHELL '$ac_srcdir/configure'"
elif test -f $ac_srcdir/configure.in; then
ac_sub_configure=$ac_configure
else
AC_MSG_WARN([no configuration information is in $ac_dir])
ac_sub_configure=
fi
# The recursion is here.
if test -n "$ac_sub_configure"; then
# Make the cache file name correct relative to the subdirectory.
case $cache_file in
[[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
*) # Relative path.
ac_sub_cache_file=$ac_top_builddir$cache_file ;;
esac
ac_sub_configure_vars=
ac_sub_configure_vars="$ac_sub_configure_vars '--cache-file=$ac_sub_cache_file'"
ac_sub_configure_vars="$ac_sub_configure_vars '--srcdir=$ac_srcdir'"
test -n "[$]CC_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CC=[$]CC_FOR_$2'"
test -n "[$]CXX_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CXX=[$]CXX_FOR_$2'"
test -n "[$]CFLAGS_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CFLAGS=[$]CFLAGS_FOR_$2'"
test -n "[$]CXXFLAGS_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CXXFLAGS=[$]CXXFLAGS_FOR_$2'"
# The eval makes quoting arguments work.
AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args $ac_sub_configure_vars])
eval $ac_sub_configure $ac_sub_configure_args $ac_sub_configure_vars ||
AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
fi
cd "$ac_popdir"
done
fi
fi
])
])
AC_DEFUN([_RTEMS_CONFIGURE_ARGS_PRUNE],
[
$1_prune()
{
$1=
for ac_arg
do
if test -n "$ac_prev"; then
ac_prev=
continue
fi
case $ac_arg in
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
| --c=*)
;;
--config-cache | -C)
;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
;;
-host* | --host* );;
-host | --host )
ac_prev=host_alias;;
-target* | --target* );;
-target | --target )
ac_prev=target_alias;;
-build* | --build* );;
-build | --build )
ac_prev=build_alias;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
;;
*_alias=* );;
m4_if([$2],,,[$2])
*) $1="$$1 '$ac_arg'" ;;
esac
done
export $1
}
])
## PUBLIC: RTEMS_BUILD_CONFIG_SUBDIRS(build_subdir)
# subdirs to be built for the build environment
AC_DEFUN([RTEMS_BUILD_CONFIG_SUBDIRS],[
m4_append([_RTEMS_BUILD_CONFIGDIRS_LIST],[ $1])
dnl Always append to build_configdirs
AC_SUBST(build_configdirs,"$build_configdirs $1")
m4_divert_text([DEFAULTS],
[ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"])
m4_expand_once([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS])
])
AC_DEFUN([_RTEMS_BUILD_CONFIG_PREPARE],[
## # Record the configure arguments in Makefile.
m4_ifdef([_RTEMS_BUILD_CONFIGDIRS_LIST],
[
m4_expand_once([_RTEMS_TOOLS([build],[BUILD])])
m4_expand_once([_RTEMS_CONFIGURE_ARGS_PRUNE([buildargs])])
eval buildargs_prune $ac_configure_args
buildargs="'--host=${build_alias-$build}' '--build=${build_alias-$build}' ${buildargs}"
buildargs="${buildargs} '--target=${target_alias-$target}'"
],[])
AC_SUBST(buildargs)
AC_SUBST(build_subdir)
])
## PUBLIC: RTEMS_HOST_CONFIG_SUBDIRS(host_subdir)
# subdirs to be build for the host environment
AC_DEFUN([RTEMS_HOST_CONFIG_SUBDIRS],[
m4_append([_RTEMS_HOST_CONFIGDIRS_LIST],[ $1])dnl
_RTEMS_SUBST_IFNOT([host_configdirs],[$1])
m4_divert_text([DEFAULTS],
[ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"])
m4_expand_once([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS])
])
AC_DEFUN([_RTEMS_HOST_CONFIG_PREPARE],[
m4_ifdef([_RTEMS_HOST_CONFIGDIRS_LIST],
[
m4_expand_once([_RTEMS_TOOLS([host],[HOST])])
m4_expand_once([_RTEMS_CONFIGURE_ARGS_PRUNE([hostargs])])
eval hostargs_prune $ac_configure_args
hostargs="'--host=${host_alias-$host}' '--build=${build_alias-$build}' '--target=${target_alias-$target}' ${hostargs}"
],[])
AC_SUBST(hostargs)
AC_SUBST(host_subdir)
])
## PUBLIC: RTEMS_TARGET_CONFIG_SUBDIRS(target_subdir)
# subdirs to be build for the target environment
AC_DEFUN([RTEMS_TARGET_CONFIG_SUBDIRS],[
AS_IF([test -d ${srcdir}/$1],[
m4_append([_RTEMS_TARGET_CONFIGDIRS_LIST],[ $1])
_RTEMS_SUBST_IFNOT([target_configdirs],[$1])
m4_divert_text([DEFAULTS],
[ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"])
m4_expand_once([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS])
])
])
AC_DEFUN([_RTEMS_TARGET_CONFIG_PREPARE],[
m4_ifdef([_RTEMS_TARGET_CONFIGDIRS_LIST],
[
m4_expand_once([_RTEMS_TOOLS([target],[TARGET])])
m4_expand_once([_RTEMS_CONFIGURE_ARGS_PRUNE([targetargs])])
eval targetargs_prune $ac_configure_args
targetargs="'--host=${target_alias-$target}' '--build=${build_alias-$build}' '--target=${target_alias-$target}' ${targetargs}"
],[])
AC_SUBST(targetargs)
AC_SUBST(target_subdir)
])

View File

@@ -1,20 +0,0 @@
dnl _RTEMS_BSP_ALIAS(BSP_ALIAS,RTEMS_BSP_FAMILY)
dnl Internal subroutine to RTEMS_BSP_ALIAS
AC_DEFUN([_RTEMS_BSP_ALIAS],[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
AC_REQUIRE([RTEMS_SOURCE_TOP])
# account for "aliased" bsps which share source code
for bsp_cfgs in `ls "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}"/*/"config/$1.cfg" 2>/dev/null`; do
$2=`echo "$bsp_cfgs" | sed \
-e "s,^${RTEMS_SOURCE_ROOT}/bsps/$RTEMS_CPU/,," \
-e "s,/config/.*\.cfg$,,"`
break
done
])
dnl RTEMS_BSP_ALIAS(BSP_ALIAS,RTEMS_BSP_FAMILY)
dnl convert a bsp alias $1 into its bsp directory RTEMS_BSP_FAMILY
AC_DEFUN([RTEMS_BSP_ALIAS],
[_RTEMS_BSP_ALIAS(m4_if([$1],,[$RTEMS_BSP],[$1]),
m4_if([$2],,[RTEMS_BSP_FAMILY],[$2]))]
)

View File

@@ -1,24 +0,0 @@
dnl canonicalize target cpu
dnl NOTE: Most rtems targets do not fulfil 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_CANONICAL_TARGET
AC_MSG_CHECKING(rtems target cpu)
case "${target}" in
no_cpu-*rtems*)
RTEMS_CPU=no_cpu
;;
riscv*-*rtems*)
RTEMS_CPU=riscv
;;
*)
RTEMS_CPU=`echo $target | sed 's%^\([[^-]]*\)-\(.*\)$%\1%'`
;;
esac
AC_SUBST(RTEMS_CPU)
AC_MSG_RESULT($RTEMS_CPU)
])

View File

@@ -1,25 +0,0 @@
dnl Report all available bsps for a target within the source tree
dnl
dnl RTEMS_CHECK_BSPS(bsp_list)
AC_DEFUN([RTEMS_CHECK_BSPS],
[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl sets RTEMS_CPU, target
AC_REQUIRE([RTEMS_SOURCE_TOP])dnl sets RTEMS_SOURCE_ROOT
AC_MSG_CHECKING([for available BSPs])
$1=
for bsp_make in `echo "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}"/*/config 2>/dev/null`; do
bsp_family=`echo "$bsp_make" | sed \
-e "s,^${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/,," \
-e "s,/config$,,"`
for bsp_cfgs in `ls "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/$bsp_family/config/"*.cfg 2>/dev/null`; do
bsp_cfg=`echo "$bsp_cfgs" | sed \
-e "s,^${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/$bsp_family/config/,," \
-e "s,\.cfg$,,"`
$1="[$]$1 $bsp_cfg"
done
done
AS_IF([test -z "[$]$1"],
[AC_MSG_RESULT([none])],
[AC_MSG_RESULT([$]$1)])
])dnl

View File

@@ -1,20 +0,0 @@
AC_DEFUN([_RTEMS_CHECK_CUSTOM_BSP],[
AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl sets RTEMS_CPU, target
AC_REQUIRE([RTEMS_SOURCE_TOP])dnl sets RTEMS_SOURCE_ROOT
$2=
for i in \
`ls "${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}"/*/config/$1 2>/dev/null`;
do
AS_IF([test -r $i],[
$2="$i"
break;
])
done
])
AC_DEFUN([RTEMS_CHECK_CUSTOM_BSP],[
_RTEMS_CHECK_CUSTOM_BSP([[$]$1.cfg],[BSP_FOUND])
AS_IF([test -z "$BSP_FOUND"],[
AC_MSG_ERROR([missing [$]$1.cfg])
])
])

View File

@@ -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$target_alias" != "x$host_alias"],
[rtems_tool_prefix=$target_alias-])
AC_CHECK_PROG($1, ${rtems_tool_prefix}$2, ${rtems_tool_prefix}$2, $3, $4)
])

View File

@@ -1,11 +0,0 @@
AC_DEFUN([RTEMS_ENABLE_CXX],
[
AC_ARG_ENABLE(cxx,
[AS_HELP_STRING([--enable-cxx],
[enable C++ support])],
[case "${enable_cxx}" in
yes) RTEMS_HAS_CPLUSPLUS=yes ;;
no) RTEMS_HAS_CPLUSPLUS=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;;
esac], [RTEMS_HAS_CPLUSPLUS=yes])
])

View File

@@ -1,12 +0,0 @@
AC_DEFUN([RTEMS_ENABLE_DRVMGR],
[
## AC_BEFORE([$0], [RTEMS_CHECK_DRVMGR_STARTUP])dnl
AC_ARG_ENABLE(drvmgr,
[AS_HELP_STRING([--enable-drvmgr],[enable Driver Manager 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])
])

View File

@@ -1,14 +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) test -z $enable_rtemsbsp && AC_MSG_ERROR([Multiprocessing requires BSPs to be provided, none have, see --enable-rtemsbsp])
;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;
esac],[enable_multiprocessing=no])
])

View File

@@ -1,13 +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])
AC_SUBST(RTEMS_HAS_NETWORKING)dnl
])

View File

@@ -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])
])

View File

@@ -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)
])

View File

@@ -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])
])

View File

@@ -1,54 +0,0 @@
dnl Override the set of BSPs to be built.
dnl used by the toplevel configure script
dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
AC_DEFUN([RTEMS_ENABLE_RTEMSBSP],
[
AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])
AC_ARG_ENABLE(rtemsbsp,
[AS_HELP_STRING([--enable-rtemsbsp="bsp1 bsp2 .."],
[BSPs to include in build, required for SMP and MP builds])],
[case "${enable_rtemsbsp}" in
yes ) enable_rtemsbsp="" ;;
no ) enable_rtemsbsp="no" ;;
*) enable_rtemsbsp="$enable_rtemsbsp"
srctop=${srcdir}
while test x${srctop} != x/
do
if test -d ${srctop}/cpukit -a -d ${srctop}/c/src/lib/libbsp; then
break
fi
srctop=$(dirname ${srctop})
done
if test x${srctop} = x/; then
AC_MSG_ERROR([Cannot find the top of source tree, please report to devel@rtems.org])
fi
target_arch=$(echo ${target_alias} | sed -e "s/\-.*//g")
libbsp=${srctop}/bsps
libbsp_e=$(echo ${libbsp} | sed -e 's/\//\\\//g')
cfg_list=$(LANG=C LC_COLLATE=C find ${libbsp} -mindepth 1 -name \*.cfg)
for bsp in ${enable_rtemsbsp};
do
found=no
for bsp_path in ${cfg_list};
do
cfg_bsp=$(echo ${bsp_path} | sed -e "s/.*\///" -e 's/\.cfg//')
if test x$bsp = x$cfg_bsp; then
cfg_arch=$(echo ${bsp_path} | sed -e "s/${libbsp_e}*\///" -e 's/\/.*//')
case ${target_arch} in
${cfg_arch}* )
;;
* )
AC_MSG_ERROR([BSP '$bsp' architecture does not match the --target architecture, run 'rtems-bsps' (in the top of the source tree) for a valid BSP list])
;;
esac
found=yes
break
fi
done
if test $found = no; then
AC_MSG_ERROR([BSP '$bsp' not found, run 'rtems-bsps' (in the top of the source tree) for a valid BSP list])
fi
done
;;
esac],[enable_rtemsbsp=""])
])

View File

@@ -1,18 +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) test -z $enable_rtemsbsp && AC_MSG_ERROR([SMP requires BSPs to be provided, none have, see --enable-rtemsbsp])
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])
])

View File

@@ -1,11 +0,0 @@
AC_DEFUN([RTEMS_ENABLE_TESTS],
[
AC_ARG_ENABLE(tests,
[AS_HELP_STRING([--enable-tests],[enable tests (default:samples)])],
[case "${enableval}" in
samples) enable_tests=samples;;
yes) enable_tests=yes ;;
no) enable_tests=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-tests]) ;;
esac], [enable_tests=samples])
])

View File

@@ -1,17 +0,0 @@
dnl This provides configure definitions used for multilib support
dnl parts of these macros are derived from newlib-1.8.2's 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")
])

View File

@@ -1,12 +0,0 @@
AC_DEFUN([RTEMS_PATH_KSH],
[
dnl NOTE: prefer bash over ksh over sh
AC_PATH_PROGS(KSH,bash ksh sh)
if test -z "$KSH"; then
dnl NOTE: This cannot happen -- /bin/sh must always exist
AC_MSG_ERROR(
[***]
[ Cannot determine a usable shell bash/ksh/sh]
[ Please contact your system administrator] );
fi
])

View File

@@ -1,17 +0,0 @@
dnl
dnl PROJECT_TOPdir .. relative path to the top of the build-tree
dnl PROJECT_ROOT .. relative path to the top of the temporary
dnl installation directory inside the build-tree
dnl RTEMS_TOPdir .. relative path of a subpackage's configure.ac to the
dnl toplevel configure.ac of the source-tree
dnl RTEMS_ROOT .. path to the top of a bsp's build directory
dnl [Applied by custom/*.cfg, deprecated otherwise]
dnl
AC_DEFUN([RTEMS_PROJECT_ROOT],
[dnl
AC_REQUIRE([RTEMS_TOP])
BIN2C=rtems-bin2c
AC_SUBST(BIN2C)
])

View File

@@ -1,41 +0,0 @@
dnl RTEMS_CONFIGURE_ARGS_QUOTE(dnl RETURN_VAR, [ADDITIONAL_CASES], [VAR_TO_PROCESS]])
dnl
AC_DEFUN([_RTEMS_CONFIGURE_ARGS_QUOTE],
[
$1_prune()
{
# Remove --cache-file and --srcdir arguments so they do not pile up.
$1=
ac_prev=
for ac_arg
do
if test -n "$ac_prev"; then
ac_prev=
continue
fi
case $ac_arg in
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
| --c=*)
;;
--config-cache | -C)
;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
;;
m4_if([$2],,,[$2])
*) $1="$$1 '$ac_arg'" ;;
esac
done
export $1
}
])
AC_DEFUN([RTEMS_CONFIGURE_ARGS_QUOTE],[
m4_expand_once([_RTEMS_CONFIGURE_ARGS_QUOTE([$1],[$2])])
eval $1_prune m4_if([$3],,[$ac_configure_args],[[$]$3])
])

View File

@@ -1,20 +0,0 @@
AC_DEFUN([RTEMS_ENABLE_RPMPREFIX],[
AC_ARG_ENABLE([rpmprefix],
[ --enable-rpmprefix=<rpmprefix> prefix rpms],
[case $enable_rpmprefix in
yes ) rpmprefix="rtems-"]_RTEMS_API["-";;
no ) rpmprefix="%{nil}";;
* ) AS_IF([test -z "$enable_rpmprefix"],
[rpmprefix="%{nil}"],
[rpmprefix="$enable_rpmprefix"]);;
esac],
[rpmprefix="rtems-"]_RTEMS_API["-"])
AC_ARG_ENABLE([osversions],
[ --enable-osversions whether to use version numbers in os-tripples],
[case $enable_osversions in
yes ) osversion=_RTEMS_API;;
* ) osversion=;;
esac],
[osversion=_RTEMS_API])
])

View File

@@ -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])
])

View File

@@ -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 than attempt to clean this crap up.
#
RTEMS_BUILD_ROOT="${with_rtems_build_top}"
AC_SUBST([RTEMS_BUILD_ROOT])
])dnl

View File

@@ -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])
])

View File

@@ -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

View File

@@ -1,34 +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([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])
RTEMS_TOPdir="$1";
AC_SUBST(RTEMS_TOPdir)
dots=`echo $with_target_subdir|\
sed -e 's,^\.$,,' -e 's%^\./%%' -e 's%[[^/]]$%&/%' -e 's%[[^/]]*/%../%g'`
PROJECT_TOPdir=${dots}${RTEMS_TOPdir}/'$(top_builddir)'
AC_SUBST(PROJECT_TOPdir)
PROJECT_ROOT="${RTEMS_TOPdir}/\$(top_builddir)"
AC_SUBST(PROJECT_ROOT)
AC_MSG_CHECKING([for RTEMS Version])
AC_MSG_RESULT([_RTEMS_VERSION])
pkgdatadir="${datadir}"/rtems[]_RTEMS_API;
AC_SUBST([pkgdatadir])
])dnl

View File

@@ -1,23 +0,0 @@
AC_DEFUN([RTEMS_TOOLPATHS],
[
# tooldir='$(exec_prefix)/'$target_alias
# Temporary work-around until building in source tree is supported
AC_REQUIRE([RTEMS_PROJECT_ROOT])
tooldir='$(PROJECT_ROOT)'
AC_SUBST(tooldir)
project_includedir='$(tooldir)'/include
AC_SUBST(project_includedir)
project_libdir='$(tooldir)/lib$(MULTISUBDIR)'
AC_SUBST(project_libdir)
project_bindir='$(tooldir)/bin'
AC_SUBST(project_bindir)
rtems_bspdir='$(prefix)/${RTEMS_BSP}'
AC_SUBST(rtems_bspdir)
rtems_makedir='$(prefix)/make'
AC_SUBST(rtems_makedir)
])

View File

@@ -1,4 +0,0 @@
AC_DEFUN([RTEMS_VERSIONING],
m4_define([_RTEMS_VERSION],[5.0.0]))
m4_define([_RTEMS_API],[5])

View File

@@ -1,5 +0,0 @@
## NOTE: This is a temporary work-around to keep
## RTEMS's non automake standard make targets working.
## Once automake is fully integrated these make targets
## and this file will probably be removed

View File

@@ -1,7 +0,0 @@
## Borrowed from automake-1.4 and adapted to RTEMS
## NOTE: This is a temporary work-around to keep
## RTEMS's non automake standard make targets working.
## Once automake is fully integrated these make targets
## and this file will probably be removed

326
bootstrap
View File

@@ -1,326 +0,0 @@
#!/bin/sh
#
# helps bootstrapping, when checked out from CVS
# requires GNU autoconf and GNU automake
#
# this is not meant to be exported outside the source tree
#
# NOTE: Inspired by libtool's autogen script
#
# to be run from the toplevel directory of RTEMS'
# source tree
progname=`basename $0`
top_srcdir=`dirname $0`
LC_ALL=C
export LC_ALL
verbose=""
quiet="false"
mode="autoreconf"
force=0
usage()
{
echo
echo "usage: ${progname} [-c|-h|-H] [-q][-v]"
echo
echo "options:"
echo " -c .. clean, remove all aclocal/autoconf/automake generated files"
echo " -h .. display this message and exit"
echo " -H .. regenerate headers.am files"
echo " -q .. quiet, don't display directories"
echo " -v .. verbose, pass -v to autotools"
echo
exit 1
}
if test ! -f $top_srcdir/aclocal/version.m4; then
echo "${progname}:"
echo " Installation problem: Can't find file aclocal/version.m4"
exit 1
fi
while test $# -gt 0; do
case $1 in
-h|--he|--hel|--help)
usage ;;
-q|--qu|--qui|--quie|--quiet)
quiet="true"
shift;;
-v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
verbose="-v"
shift;;
-c|--cl|--cle|--clea|--clean)
mode="clean"
shift;;
-f|--fo|--for|--forc|--force)
force=`expr $force + 1`
shift;;
-H|--headers)
mode="headers"
shift;;
-r|--re|--rec|--reco|--recon|--reconf)
mode="autoreconf"
shift;;
-g|--ge|--gen|--gene|--gener|--genera|--generat|--generate)
mode="generate"
shift;;
-*) echo "unknown option $1"
usage ;;
*) echo "invalid parameter $1"
usage ;;
esac
done
case $mode in
headers)
if test "." != "$top_srcdir"; then
echo "To generate the headers.am you must call the script via \"./$progname -H\""
exit 1
fi
base="$PWD"
# Generate cpukit/header-dirs.am
tmp="$base/cpukit/header-dirs.am.new"
hdr_dirs=`for i in cpukit/include cpukit/libnetworking cpukit/score/cpu/*/include ; do
cd "$i"
find -mindepth 1 -type d
cd "$base"
done | sort -u | sed 's%^\./%%'`
echo '## This file was generated by "./boostrap -H".' > "$tmp"
echo 'include_HEADERS =' >> "$tmp"
for dir in $hdr_dirs ; do
am_dir=`echo $dir | sed 's%[/-]%_%g'`
echo "include_${am_dir}dir = \$(includedir)/$dir" >> "$tmp"
echo "include_${am_dir}_HEADERS =" >> "$tmp"
done
diff -q "$tmp" "cpukit/header-dirs.am" || mv "$tmp" "cpukit/header-dirs.am"
rm -f "$tmp"
# Generate cpukit/*/headers.am
tmp="$base/headers.am.new"
cpukit="$base/cpukit"
cd "$cpukit"
for inc in include score/cpu/*/include ; do
echo '## This file was generated by "./boostrap -H".' > "$tmp"
hdr=`dirname $inc`
am_dir=""
cd $inc
for b in `find -type d | sort` ; do
for j in `find $b -mindepth 1 -maxdepth 1 -name '*.h' | sed 's%^\.%%' | sed 's%^/%%' | sort` ; do
dir=`dirname $j`
if test x$dir != x. ; then
am_dir=`echo $dir | sed 's%[/-]%_%g'`
am_dir="_$am_dir"
else
am_dir=""
fi
echo "include${am_dir}_HEADERS += $inc/$j" >> "$tmp"
done
done
cd "$cpukit"
diff -q "$tmp" "${hdr}/headers.am" || mv "$tmp" "${hdr}/headers.am"
done
rm -f "$tmp"
cd "$base"
# Generate bsps/*/headers.am
tmp="$base/headers.am.new"
for i in bsps/include bsps/*/include bsps/*/*/include ; do
dir=""
am_dir=""
echo '## This file was generated by "./boostrap -H".' > "$tmp"
case $i in
bsps/*/*/include)
hdr="../"
inc="../../../../../../$i/"
;;
bsps/*/include)
hdr="../"
inc="../../../../../$i/"
;;
bsps/include)
hdr="../"
inc="../../$i/"
;;
*)
hdr=""
inc=""
;;
esac
cd $i
for b in `find -type d | sort` ; do
for j in `find $b -mindepth 1 -maxdepth 1 -name '*.h' -or -name '*.inc' | sed 's%^\.%%' | sed 's%^/%%' | sort` ; do
d=`dirname $j`
if test x$d != x$dir ; then
dir=$d
if test x$d != x. ; then
am_dir=`echo $dir | sed 's%[/-]%_%g'`
am_dir="_$am_dir"
printf "\ninclude%sdir = \$(includedir)/$dir\n" "$am_dir" >> "$tmp"
else
am_dir=""
echo "" >> "$tmp"
fi
echo "include${am_dir}_HEADERS =" >> "$tmp"
fi
echo "include${am_dir}_HEADERS += $inc$j" >> "$tmp"
if test $j = bsp.h ; then
echo "include_HEADERS += include/bspopts.h" >> "$tmp"
fi
done
done
cd "$base"
diff -q "$tmp" "$i/${hdr}headers.am" || mv "$tmp" "$i/${hdr}headers.am"
done
rm -f "$tmp"
;;
generate)
AUTOCONF=${AUTOCONF-autoconf}
if test -z "$AUTOCONF"; then
echo "You must have autoconf installed to run $program"
exit 1
fi
AUTOHEADER=${AUTOHEADER-autoheader}
if test -z "$AUTOHEADER"; then
echo "You must have autoconf installed to run $program"
exit 1
fi
AUTOMAKE=${AUTOMAKE-automake}
if test -z "$AUTOMAKE"; then
echo "You must have automake installed to run $program"
exit 1
fi
ACLOCAL=${ACLOCAL-aclocal}
if test -z "$ACLOCAL"; then
echo "You must have automake installed to run $program"
exit 1
fi
case $top_srcdir in
/* ) aclocal_dir=$top_srcdir
;;
*) aclocal_dir=`pwd`/$top_srcdir
;;
esac
confs=`find . \( -name 'configure.in' -o -name 'configure.ac' \) -print`
for i in $confs; do
dir=`dirname $i`
configure=`basename $i`
( test "$quiet" = "true" || echo "$dir"
cd $dir
pat="s,\$(RTEMS_TOPdir),${aclocal_dir},g"
aclocal_args=`grep '^[ ]*ACLOCAL_AMFLAGS' Makefile.am | \
sed -e 's%.*ACLOCAL_AMFLAGS.*\=[ ]*%%g' -e $pat `
test "$verbose" = "-v" && echo "${ACLOCAL} $aclocal_args"
${ACLOCAL} $aclocal_args
test -n "`grep CONFIG_HEADER ${configure}`" && ${AUTOHEADER} \
&& test "$verbose" = "-v" && echo "${AUTOHEADER}"
test -n "`grep RTEMS_BSP_CONFIGURE ${configure}`" && ${AUTOHEADER} \
&& test "$verbose" = "-v" && echo "${AUTOHEADER}"
test -f Makefile.am && ${AUTOMAKE} -a -c $verbose
${AUTOCONF}
test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
&& echo timestamp > stamp-h.in
)
done
;;
autoreconf)
AUTORECONF=${AUTORECONF-autoreconf}
if test -z "$AUTORECONF"; then
echo "You must have autoreconf installed to run $program"
exit 1
fi
confs=`find . -name 'configure.ac' -print`
for i in $confs; do
dir=`dirname $i`
configure=`basename $i`
( test "$quiet" = "true" || echo "$dir"
cd $dir
${AUTORECONF} -i --no-recursive $verbose
test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
&& echo timestamp > stamp-h.in
)
done
;;
clean)
test "$quiet" = "true" || echo "removing automake generated Makefile.in files"
files=`find . -name 'Makefile.am' -print | sed -e 's%\.am%\.in%g'`
for i in $files; do
if test -f $i; then
rm -f $i
test "$verbose" = "-v" && echo "$i"
fi
done
test "$quiet" = "true" || echo "removing configure files"
files=`find . -name 'configure' -print`
for i in $files; do
if test -f $i; then
rm -f $i
test "$verbose" = "-v" && echo "$i"
fi
done
if test $force -gt 0; then
needles=""
if test $force -gt 1; then
# Manually maintained
needles="$needles config.sub"
needles="$needles config.guess"
fi
if test $force -gt 0; then
# Inherited from automake
needles="$needles compile"
needles="$needles depcomp"
needles="$needles install-sh"
needles="$needles missing"
needles="$needles mdate-sh"
fi
for j in $needles; do
files=`find . -name "$j" -print`
for i in $files; do
if test -f $i; then
rm -f $i
test "$verbose" = "-v" && echo "$i"
fi
done
done
fi
test "$quiet" = "true" || echo "removing aclocal.m4 files"
files=`find . -name 'aclocal.m4' -print`
test "$verbose" = "-v" && test -n "$files" && echo "$files"
for i in $files; do
if test -f $i; then
rm -f $i
test "$verbose" = "-v" && echo "$i"
fi
done
find . -name '*~' -print | xargs rm -f
find . -name 'bspopts.h.in' -print | xargs rm -f
find . -name '*.orig' -print | xargs rm -f
find . -name '*.rej' -print | xargs rm -f
find . -name 'config.status' -print | xargs rm -f
find . -name 'config.log' -print | xargs rm -f
find . -name 'config.cache' -print | xargs rm -f
find . -name 'Makefile' -and -not -path ./testsuites/ada/sptests/sp19/Makefile -print | xargs rm -f
find . -name '.deps' -print | xargs rm -rf
find . -name '.libs' -print | xargs rm -rf
find . -name 'stamp-h.in' | xargs rm -rf
find . -name 'autom4te*.cache' | xargs rm -rf
;;
esac
exit 0

View File

@@ -0,0 +1,70 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief Console Configuration
*/
/*
* Copyright (C) 2020 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 <rtems/bspIo.h>
#include <bsp.h>
#include <dev/serial/arm-pl011.h>
#include <bsp/console-termios.h>
#include <bspopts.h>
arm_pl011_context a53_qemu_vpl011_context = {
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("PL011"),
.regs = (arm_pl011_uart *) BSP_A53_QEMU_VPL011_BASE,
.initial_baud = 115200,
.clock = 24000000
};
const console_device console_device_table[] = {
{
.device_file = "/dev/ttyS0",
.probe = console_device_probe_default,
.handler = &arm_pl011_fns,
.context = &a53_qemu_vpl011_context.base
}
};
const size_t console_device_count = RTEMS_ARRAY_SIZE(console_device_table);
static void output_char( char c )
{
arm_pl011_write_polled(&a53_qemu_vpl011_context.base, c);
}
BSP_output_char_function_type BSP_output_char = output_char;
BSP_polling_getchar_function_type BSP_poll_char = NULL;

View File

@@ -0,0 +1,74 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief Core BSP definitions
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_A53_QEMU_BSP_H
#define LIBBSP_AARCH64_A53_QEMU_BSP_H
/**
* @addtogroup RTEMSBSPsAArch64
*
* @{
*/
#include <bspopts.h>
#ifndef ASM
#include <bsp/default-initial-extension.h>
#include <bsp/start.h>
#include <rtems.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_ARM_GIC_CPUIF_BASE 0x08010000
#define BSP_ARM_GIC_DIST_BASE 0x08000000
#define BSP_ARM_GIC_REDIST_BASE 0x080A0000
#define BSP_A53_QEMU_VPL011_BASE 0x9000000
#define BSP_A53_QEMU_VPL011_LENGTH 0x1000
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
/** @} */
#endif /* LIBBSP_AARCH64_A53_QEMU_BSP_H */

View File

@@ -0,0 +1,66 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP IRQ definitions
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_A53_IRQ_H
#define LIBBSP_AARCH64_A53_IRQ_H
#ifndef ASM
#include <rtems/irq.h>
#include <rtems/irq-extension.h>
#include <dev/irq/arm-gic-irq.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_INTERRUPT_VECTOR_COUNT 256
/* Interrupts vectors */
#define BSP_TIMER_VIRT_PPI 27
#define BSP_TIMER_PHYS_NS_PPI 30
#define BSP_VPL011_SPI 32
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
#endif /* LIBBSP_AARCH64_A53_IRQ_H */

View File

@@ -0,0 +1,46 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP tm27 header
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_TMTEST27
#error "This is an RTEMS internal file you must not include directly."
#endif
#ifndef __tm27_h
#define __tm27_h
#include <dev/irq/arm-gic-tm27.h>
#endif /* __tm27_h */

View File

@@ -0,0 +1,49 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP Startup
*/
/*
* Copyright (C) 2020 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.h>
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
void bsp_start( void )
{
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,
(uintptr_t) bsp_section_nocacheheap_size
);
}

View File

@@ -0,0 +1,52 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP Startup Hooks
*/
/*
* Copyright (C) 2020 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.h>
#include <bsp/start.h>
#ifdef BSP_START_ENABLE_EL3_START_SUPPORT
BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
{
/* Do nothing */
}
#endif
BSP_START_TEXT_SECTION void bsp_start_hook_1(void)
{
AArch64_start_set_vector_base();
bsp_start_copy_sections();
bsp_start_clear_bss();
}

View File

@@ -0,0 +1,70 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A72
*
* @brief Console Configuration
*/
/*
* Copyright (C) 2020 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 <rtems/bspIo.h>
#include <bsp.h>
#include <dev/serial/arm-pl011.h>
#include <bsp/console-termios.h>
#include <bspopts.h>
arm_pl011_context a72_qemu_vpl011_context = {
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("PL011"),
.regs = (arm_pl011_uart *) BSP_A72_QEMU_VPL011_BASE,
.initial_baud = 115200,
.clock = 24000000
};
const console_device console_device_table[] = {
{
.device_file = "/dev/ttyS0",
.probe = console_device_probe_default,
.handler = &arm_pl011_fns,
.context = &a72_qemu_vpl011_context.base
}
};
const size_t console_device_count = RTEMS_ARRAY_SIZE(console_device_table);
static void output_char( char c )
{
arm_pl011_write_polled(&a72_qemu_vpl011_context.base, c);
}
BSP_output_char_function_type BSP_output_char = output_char;
BSP_polling_getchar_function_type BSP_poll_char = NULL;

View File

@@ -0,0 +1,74 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A72
*
* @brief Core BSP definitions
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_A72_QEMU_BSP_H
#define LIBBSP_AARCH64_A72_QEMU_BSP_H
/**
* @addtogroup RTEMSBSPsAArch64
*
* @{
*/
#include <bspopts.h>
#ifndef ASM
#include <bsp/default-initial-extension.h>
#include <bsp/start.h>
#include <rtems.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_ARM_GIC_CPUIF_BASE 0x08010000
#define BSP_ARM_GIC_DIST_BASE 0x08000000
#define BSP_ARM_GIC_REDIST_BASE 0x080A0000
#define BSP_A72_QEMU_VPL011_BASE 0x9000000
#define BSP_A72_QEMU_VPL011_LENGTH 0x1000
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
/** @} */
#endif /* LIBBSP_AARCH64_A72_QEMU_BSP_H */

View File

@@ -0,0 +1,66 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A72
*
* @brief BSP IRQ definitions
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_A72_IRQ_H
#define LIBBSP_AARCH64_A72_IRQ_H
#ifndef ASM
#include <rtems/irq.h>
#include <rtems/irq-extension.h>
#include <dev/irq/arm-gic-irq.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_INTERRUPT_VECTOR_COUNT 1020
/* Interrupts vectors */
#define BSP_TIMER_VIRT_PPI 27
#define BSP_TIMER_PHYS_NS_PPI 30
#define BSP_VPL011_SPI 32
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
#endif /* LIBBSP_AARCH64_A72_IRQ_H */

View File

@@ -0,0 +1,46 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A72
*
* @brief BSP tm27 header
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_TMTEST27
#error "This is an RTEMS internal file you must not include directly."
#endif
#ifndef __tm27_h
#define __tm27_h
#include <dev/irq/arm-gic-tm27.h>
#endif /* __tm27_h */

View File

@@ -0,0 +1,49 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP Startup
*/
/*
* Copyright (C) 2020 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.h>
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
void bsp_start( void )
{
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,
(uintptr_t) bsp_section_nocacheheap_size
);
}

View File

@@ -0,0 +1,52 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64A53
*
* @brief BSP Startup Hooks
*/
/*
* Copyright (C) 2020 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.h>
#include <bsp/start.h>
#ifdef BSP_START_ENABLE_EL3_START_SUPPORT
BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
{
/* Do nothing */
}
#endif
BSP_START_TEXT_SECTION void bsp_start_hook_1(void)
{
AArch64_start_set_vector_base();
bsp_start_copy_sections();
bsp_start_clear_bss();
}

View File

@@ -0,0 +1,271 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup aarch64_start
*
* @brief AArch64 MMU configuration.
*/
/*
* Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_SHARED_AARCH64_MMU_H
#define LIBBSP_AARCH64_SHARED_AARCH64_MMU_H
#include <bsp/fatal.h>
#include <bsp/linker-symbols.h>
#include <bsp/start.h>
#include <bsp/utility.h>
#include <bspopts.h>
#include <libcpu/mmu-vmsav8-64.h>
#include <rtems/score/aarch64-system-registers.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct {
uintptr_t begin;
uintptr_t end;
uint64_t flags;
} aarch64_mmu_config_entry;
#define AARCH64_MMU_DEFAULT_SECTIONS \
{ \
.begin = (uintptr_t) bsp_section_fast_text_begin, \
.end = (uintptr_t) bsp_section_fast_text_end, \
.flags = AARCH64_MMU_CODE_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_fast_data_begin, \
.end = (uintptr_t) bsp_section_fast_data_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_start_begin, \
.end = (uintptr_t) bsp_section_start_end, \
.flags = AARCH64_MMU_CODE_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_vector_begin, \
.end = (uintptr_t) bsp_section_vector_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_text_begin, \
.end = (uintptr_t) bsp_section_text_end, \
.flags = AARCH64_MMU_CODE_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_rodata_begin, \
.end = (uintptr_t) bsp_section_rodata_end, \
.flags = AARCH64_MMU_DATA_RO_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_data_begin, \
.end = (uintptr_t) bsp_section_data_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_bss_begin, \
.end = (uintptr_t) bsp_section_bss_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_rtemsstack_begin, \
.end = (uintptr_t) bsp_section_rtemsstack_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_noinit_begin, \
.end = (uintptr_t) bsp_section_noinit_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_work_begin, \
.end = (uintptr_t) bsp_section_work_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_stack_begin, \
.end = (uintptr_t) bsp_section_stack_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
.begin = (uintptr_t) bsp_section_nocache_begin, \
.end = (uintptr_t) bsp_section_nocache_end, \
.flags = AARCH64_MMU_DEVICE \
}, { \
.begin = (uintptr_t) bsp_section_nocachenoload_begin, \
.end = (uintptr_t) bsp_section_nocachenoload_end, \
.flags = AARCH64_MMU_DEVICE \
}, { \
.begin = (uintptr_t) bsp_translation_table_base, \
.end = (uintptr_t) bsp_translation_table_end, \
.flags = AARCH64_MMU_DATA_RW_CACHED \
}, { \
/*
* The vector table must be in writable and executable memory as it stores both
* exception code and the mutable pointer to which it jumps
*/ \
.begin = (uintptr_t) bsp_start_vector_table_begin, \
.end = (uintptr_t) bsp_start_vector_table_end, \
.flags = AARCH64_MMU_CODE_RW_CACHED \
}
/**
* @brief This is the AArch64 MMU configuration table.
*
* The default table is provided by the BSP. Applications may provide their
* own.
*/
extern const aarch64_mmu_config_entry aarch64_mmu_config_table[];
/**
* @brief This is the count of entries in the AArch64 MMU configuration table.
*
* The default table is provided by the BSP. Applications may provide their
* own.
*/
extern const size_t aarch64_mmu_config_table_size;
/**
* @brief This structure represents the state to maintain the MMU translation
* tables.
*/
typedef struct {
/**
* @brief This member references the translation table base.
*/
uint64_t *ttb;
/**
* @brief This member contains the count of used page tables.
*
* A maximum of ::AARCH64_MMU_TRANSLATION_TABLE_PAGES can be used.
*/
size_t used_page_tables;
} aarch64_mmu_control;
/**
* @brief This object is used to maintain the MMU translation tables.
*/
extern aarch64_mmu_control aarch64_mmu_instance;
/**
* @brief Sets the MMU translation table entries associated with the memory
* region.
*
* @param[in, out] control is a reference to the MMU control state.
*
* @param[in] config is the configuration entry with the memory region and
* region attributes.
*
* @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
*
* @retval ::RTEMS_INVALID_ADDRESS The begin address of the memory region
* cannot be mapped by the MMU.
*
* @retval ::RTEMS_INVALID_SIZE The end address of the memory region cannot be
* mapped by the MMU.
*
* @retval ::RTEMS_TOO_MANY There was no page table entry available to perform
* the mapping.
*/
rtems_status_code aarch64_mmu_set_translation_table_entries(
aarch64_mmu_control *control,
const aarch64_mmu_config_entry *config
);
/**
* @brief Sets up the MMU translation table.
*
* The memory regions of the configuration table are mapped by the MMU. If a
* mapping is infeasible, then the BSP fatal error
* ::AARCH64_FATAL_MMU_CANNOT_MAP_BLOCK will be issued.
*
* @param[in, out] control is a reference to the MMU control state.
*
* @param[in] config_table is the configuration table with memory regions and
* region attributes.
*
* @param config_count is the count of configuration table entries.
*/
void aarch64_mmu_setup_translation_table(
aarch64_mmu_control *control,
const aarch64_mmu_config_entry *config_table,
size_t config_count
);
BSP_START_TEXT_SECTION static inline void
aarch64_mmu_enable( const aarch64_mmu_control *control )
{
uint64_t sctlr;
/* CPUECTLR_EL1.SMPEN is already set on ZynqMP and is not writable */
/* Flush and invalidate cache */
rtems_cache_flush_entire_data();
_AArch64_Write_ttbr0_el1( (uintptr_t) control->ttb );
_AARCH64_Instruction_synchronization_barrier();
/* Enable MMU and cache */
sctlr = _AArch64_Read_sctlr_el1();
sctlr |= AARCH64_SCTLR_EL1_I | AARCH64_SCTLR_EL1_C | AARCH64_SCTLR_EL1_M;
_AArch64_Write_sctlr_el1( sctlr );
}
BSP_START_TEXT_SECTION static inline void
aarch64_mmu_disable( void )
{
uint64_t sctlr;
/*
* Flush data cache before disabling the MMU. While the MMU is disabled, all
* accesses are treated as uncached device memory.
*/
rtems_cache_flush_entire_data();
/* Disable MMU */
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 */
/* 256TB/48 bits mappable (64-0x10) */
_AArch64_Write_tcr_el1(
AARCH64_TCR_EL1_T0SZ( 0x10 ) | AARCH64_TCR_EL1_IRGN0( 0x1 ) |
AARCH64_TCR_EL1_ORGN0( 0x1 ) | AARCH64_TCR_EL1_SH0( 0x3 ) |
AARCH64_TCR_EL1_TG0( 0x0 ) | AARCH64_TCR_EL1_IPS( 0x5ULL ) |
AARCH64_TCR_EL1_EPD1
);
/* Set MAIR */
_AArch64_Write_mair_el1(
AARCH64_MAIR_EL1_ATTR0( 0x0 ) | AARCH64_MAIR_EL1_ATTR1( 0x4 ) |
AARCH64_MAIR_EL1_ATTR2( 0x44 ) | AARCH64_MAIR_EL1_ATTR3( 0xFF )
);
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_SHARED_AARCH64_MMU_H */

View File

@@ -0,0 +1,86 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsLinkerSymbolsAArch64
*
* @brief This header file provides interfaces to AArch64-specific linker
* symbols and sections.
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_SHARED_LINKER_SYMBOLS_H
#define LIBBSP_AARCH64_SHARED_LINKER_SYMBOLS_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup RTEMSBSPsLinkerSymbolsAArch64 AArch64 Linker Symbols
*
* @ingroup RTEMSBSPsLinkerSymbols
*
* @brief This group provides support for AArch64-specific linker symbols and
* sections.
*
* @{
*/
#ifndef ASM
#define LINKER_SYMBOL(sym) extern char sym [];
#else
#define LINKER_SYMBOL(sym) .extern sym
#endif
LINKER_SYMBOL(bsp_stack_exception_size)
LINKER_SYMBOL(bsp_stack_hyp_size)
LINKER_SYMBOL(bsp_section_vector_begin)
LINKER_SYMBOL(bsp_section_vector_end)
LINKER_SYMBOL(bsp_section_vector_size)
LINKER_SYMBOL(bsp_vector_table_begin)
LINKER_SYMBOL(bsp_vector_table_end)
LINKER_SYMBOL(bsp_vector_table_size)
LINKER_SYMBOL(bsp_start_vector_table_begin)
LINKER_SYMBOL(bsp_start_vector_table_end)
LINKER_SYMBOL(bsp_start_vector_table_size)
LINKER_SYMBOL(bsp_translation_table_base)
LINKER_SYMBOL(bsp_translation_table_end)
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_SHARED_LINKER_SYMBOLS_H */

View File

@@ -0,0 +1,184 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup aarch64_start
*
* @brief Aarch64 system low level start.
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBBSP_AARCH64_SHARED_START_H
#define LIBBSP_AARCH64_SHARED_START_H
#include <string.h>
#include <bsp/linker-symbols.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup aarch64_start System Start
*
* @ingroup RTEMSBSPsAArch64Shared
*
* @brief Aarch64 system low level start.
*
* @{
*/
#define BSP_START_TEXT_SECTION __attribute__((section(".bsp_start_text")))
#define BSP_START_DATA_SECTION __attribute__((section(".bsp_start_data")))
/**
* @brief System start entry.
*/
void _start(void);
/**
* @brief Start entry hook 0.
*
* This hook will be called from the start entry code after all modes and
* stack pointers are initialized but before the copying of the exception
* vectors.
*/
void bsp_start_hook_0(void);
/**
* @brief Start entry hook 1.
*
* This hook will be called from the start entry code after copying of the
* exception vectors but before the call to boot_card().
*/
void bsp_start_hook_1(void);
BSP_START_TEXT_SECTION static inline void
bsp_start_memcpy_libc(void *dest, const void *src, size_t n)
{
if (dest != src) {
memcpy(dest, src, n);
}
}
/**
* @brief Copies all standard sections from the load to the runtime area.
*/
BSP_START_TEXT_SECTION static inline void bsp_start_copy_sections(void)
{
/* Copy .text section */
bsp_start_memcpy_libc(
(int *) bsp_section_text_begin,
(const int *) bsp_section_text_load_begin,
(size_t) bsp_section_text_size
);
/* Copy .rodata section */
bsp_start_memcpy_libc(
(int *) bsp_section_rodata_begin,
(const int *) bsp_section_rodata_load_begin,
(size_t) bsp_section_rodata_size
);
/* Copy .data section */
bsp_start_memcpy_libc(
(int *) bsp_section_data_begin,
(const int *) bsp_section_data_load_begin,
(size_t) bsp_section_data_size
);
/* Copy .fast_text section */
bsp_start_memcpy_libc(
(int *) bsp_section_fast_text_begin,
(const int *) bsp_section_fast_text_load_begin,
(size_t) bsp_section_fast_text_size
);
/* Copy .fast_data section */
bsp_start_memcpy_libc(
(int *) bsp_section_fast_data_begin,
(const int *) bsp_section_fast_data_load_begin,
(size_t) bsp_section_fast_data_size
);
}
/**
* @brief Copies the .data, .fast_text and .fast_data sections from the load to
* the runtime area using the C library memcpy().
*
* Works only in case the .start, .text and .rodata sections reside in one
* memory region.
*/
BSP_START_TEXT_SECTION static inline void bsp_start_copy_sections_compact(void)
{
/* Copy .data section */
bsp_start_memcpy_libc(
bsp_section_data_begin,
bsp_section_data_load_begin,
(size_t) bsp_section_data_size
);
/* Copy .fast_text section */
bsp_start_memcpy_libc(
bsp_section_fast_text_begin,
bsp_section_fast_text_load_begin,
(size_t) bsp_section_fast_text_size
);
/* Copy .fast_data section */
bsp_start_memcpy_libc(
bsp_section_fast_data_begin,
bsp_section_fast_data_load_begin,
(size_t) bsp_section_fast_data_size
);
}
BSP_START_TEXT_SECTION static inline void bsp_start_clear_bss(void)
{
memset(bsp_section_bss_begin, 0, (size_t) bsp_section_bss_size);
}
BSP_START_TEXT_SECTION static inline void
AArch64_start_set_vector_base(void)
{
__asm__ volatile (
"msr VBAR_EL1, %[vtable]\n"
: : [vtable] "r" (bsp_start_vector_table_begin)
);
}
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_AARCH64_SHARED_START_H */

View File

@@ -0,0 +1,88 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup DevIRQGIC
*
* @brief This header file provides interfaces of the ARM Generic Interrupt
* Controller (GIC) support specific to the AArch64 architecture.
*/
/*
* Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
* Written by Kinsey Moore <kinsey.moore@oarcorp.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_DEV_IRQ_ARM_GIC_AARCH64_H
#define _RTEMS_DEV_IRQ_ARM_GIC_AARCH64_H
#include <rtems/score/cpu.h>
#include <rtems/score/cpu_irq.h>
#include <bsp/irq-generic.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup DevIRQGIC
*
* @{
*/
static inline uint32_t arm_interrupt_enable_interrupts(void)
{
uint32_t status = _CPU_ISR_Get_level();
/* Enable interrupts for nesting */
_CPU_ISR_Set_level(0);
return status;
}
static inline void arm_interrupt_restore_interrupts(uint32_t status)
{
/* Restore interrupts to previous level */
_CPU_ISR_Set_level(status);
}
static inline void arm_interrupt_facility_set_exception_handler(void)
{
AArch64_set_exception_handler(
AARCH64_EXCEPTION_SPx_IRQ,
_AArch64_Exception_interrupt_no_nest
);
AArch64_set_exception_handler(
AARCH64_EXCEPTION_SP0_IRQ,
_AArch64_Exception_interrupt_nest
);
}
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* _RTEMS_DEV_IRQ_ARM_GIC_AARCH64_H */

View File

@@ -0,0 +1,176 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Console Configuration
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
* Copyright (C) 2023 Utkarsh Verma
* Copyright (C) 2024 Ning Yang
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/bspIo.h>
#include <bsp.h>
#include <dev/serial/arm-pl011.h>
#include <bsp/irq.h>
#include <bsp/console.h>
#include <bsp/fatal.h>
#include <bsp/rpi-gpio.h>
#include <bspopts.h>
#include <rtems/console.h>
#include <rtems/rtems/status.h>
#include <rtems/termiosdevice.h>
#include <stdint.h>
#define CONSOLE_DEVICE_CONTEXT_NAME(port_no) uart##port_no##_context
#define CONSOLE_DEVICE_CONTEXT( \
port_no, _file_name, regs_base, _size, clock_freq, irq_no, \
context_type, ... \
) \
static context_type CONSOLE_DEVICE_CONTEXT_NAME(port_no) = { \
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("UART" #port_no), \
.regs = (volatile arm_pl011_uart *) regs_base, \
.clock = clock_freq, \
.initial_baud = 115200, \
.irq = irq_no, \
};
#define CONSOLE_DEVICE( \
port_no, file_name, _base, _size, _clock, _irq,_context_type, dev_handler, \
write_char_func, rx_pin, tx_pin, gpio_func, ... \
) \
[CONSOLE_DEVICE_PORT2ENUM(port_no)] = { \
.file = file_name, \
.context = &CONSOLE_DEVICE_CONTEXT_NAME(port_no).base, \
.gpio = {.rx = rx_pin, .tx = tx_pin, .function = gpio_func}, \
.handler = dev_handler, \
.write_char_polled = write_char_func, \
},
typedef struct {
const unsigned int rx;
const unsigned int tx;
const raspberrypi_gpio_function function;
} raspberrypi_console_device_gpio_config;
typedef struct {
const char* file;
rtems_termios_device_context* context;
const raspberrypi_console_device_gpio_config gpio;
const rtems_termios_device_handler* handler;
void (*write_char_polled)(rtems_termios_device_context*, char);
} raspberrypi_console_device;
/* Initialize all console device contexts */
CONSOLE_DEVICES(CONSOLE_DEVICE_CONTEXT)
/* Initialize all device configurations */
static const raspberrypi_console_device devices[CONSOLE_DEVICE_COUNT] = {
CONSOLE_DEVICES(CONSOLE_DEVICE)
};
static rtems_status_code console_device_init_gpio(
const raspberrypi_console_device_gpio_config *gpio
)
{
rtems_status_code status = raspberrypi_gpio_set_function(
gpio->rx,
gpio->function
);
if (status != RTEMS_SUCCESSFUL)
return status;
status = raspberrypi_gpio_set_function(gpio->tx, gpio->function);
if (status != RTEMS_SUCCESSFUL)
return status;
status = raspberrypi_gpio_set_pull(gpio->rx, GPIO_PULL_NONE);
if (status != RTEMS_SUCCESSFUL)
return status;
status = raspberrypi_gpio_set_pull(gpio->tx, GPIO_PULL_NONE);
return status;
}
static void output_char(const char ch) {
const raspberrypi_console_device* device = &devices[BSP_CONSOLE_PORT];
device->write_char_polled(device->context, ch);
}
static int poll_char(void) {
const raspberrypi_console_device* device = &devices[BSP_CONSOLE_PORT];
return device->handler->poll_read(device->context);
}
rtems_status_code raspberrypi_uart_init(
raspberrypi_console_device_port uart_num
)
{
const raspberrypi_console_device *device = &devices[uart_num];
rtems_status_code status = console_device_init_gpio(&device->gpio);
if (status != RTEMS_SUCCESSFUL) {
return status;
}
status = rtems_termios_device_install(
device->file, device->handler, NULL, device->context
);
return status;
}
rtems_device_driver console_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg
)
{
const raspberrypi_console_device* device = &devices[BSP_CONSOLE_PORT];
rtems_status_code status = raspberrypi_uart_init(BSP_CONSOLE_PORT);
if (status != RTEMS_SUCCESSFUL) {
bsp_fatal(BSP_FATAL_CONSOLE_INSTALL_0);
}
rtems_termios_initialize();
if (link(device->file, CONSOLE_DEVICE_NAME) != 0) {
bsp_fatal(BSP_FATAL_CONSOLE_INSTALL_1);
}
return RTEMS_SUCCESSFUL;
}
BSP_output_char_function_type BSP_output_char = output_char;
BSP_polling_getchar_function_type BSP_poll_char = poll_char;

View File

@@ -0,0 +1,110 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief GPIO Driver
*/
/*
* Copyright (C) 2023 Utkarsh Verma
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/rtems/status.h>
#include <stdint.h>
#include <bsp/rpi-gpio.h>
#include <bsp/raspberrypi.h>
#define BSP_GPIO_BASE BCM2711_GPIO_BASE
#define BSP_GPIO_SIZE BCM2711_GPIO_SIZE
#define BSP_GPIO_PIN_COUNT BCM2711_GPIO_PIN_COUNT
#define GPFSEL0 BCM2835_REG(BSP_GPIO_BASE + 0x00)
#define GPSET0 BCM2835_REG(BSP_GPIO_BASE + 0x1c)
#define GPCLR0 BCM2835_REG(BSP_GPIO_BASE + 0x28)
#define GPIO_PUP_PDN_CTRL_REG0 BCM2835_REG(BSP_GPIO_BASE + 0xe4)
#define FSELn_SIZE 3
#define CLRn_SIZE 1
#define SETn_SIZE 1
#define REG_SET 1
static rtems_status_code raspberrypi_gpio_set_reg(
volatile uint32_t *base_reg,
const unsigned int pin,
const uint32_t value,
const unsigned int field_size
)
{
unsigned int field_mask, n_fields, shift, tmp;
volatile uint32_t *reg;
if (pin > BSP_GPIO_PIN_COUNT)
return RTEMS_INVALID_NUMBER;
field_mask = (1 << field_size) - 1;
if (value > field_mask)
return RTEMS_INVALID_NUMBER;
/* GPIO registers are uniformly subdivided */
n_fields = sizeof(uint32_t) * 8 / field_size;
/* Registers are sequentially mapped for each `n_field` GPIOs */
reg = base_reg + pin / n_fields;
shift = (pin % n_fields) * field_size;
tmp = *reg;
tmp &= ~(field_mask << shift); /* Clear the field */
tmp |= value << shift; /* Set value to the field */
*reg = tmp;
return RTEMS_SUCCESSFUL;
}
rtems_status_code raspberrypi_gpio_set_function(
const unsigned int pin,
const raspberrypi_gpio_function value
)
{
return raspberrypi_gpio_set_reg(&GPFSEL0, pin, value, FSELn_SIZE);
}
rtems_status_code raspberrypi_gpio_clear_pin(const unsigned int pin)
{
return raspberrypi_gpio_set_reg(&GPCLR0, pin, REG_SET, CLRn_SIZE);
}
rtems_status_code raspberrypi_gpio_set_pin(const unsigned int pin)
{
return raspberrypi_gpio_set_reg(&GPSET0, pin, REG_SET, SETn_SIZE);
}
rtems_status_code raspberrypi_gpio_set_pull(
const unsigned int pin,
const raspberrypi_gpio_pull value
)
{
return raspberrypi_gpio_set_reg(&GPIO_PUP_PDN_CTRL_REG0, pin, value, 2);
}

View File

@@ -0,0 +1,73 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief Core BSP definitions
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* 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 LIBBSP_AARCH64_RASPBERRYPI_4_BSP_H
#define LIBBSP_AARCH64_RASPBERRYPI_4_BSP_H
/**
* @addtogroup RTEMSBSPsAArch64
*
* @{
*/
#include <bspopts.h>
#ifndef ASM
#include <bsp/default-initial-extension.h>
#include <bsp/start.h>
#include <rtems.h>
/*Raspberry pi MMU initialization */
BSP_START_TEXT_SECTION void raspberrypi_4_setup_mmu_and_cache(void);
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_ARM_GIC_CPUIF_BASE 0xFF842000
#define BSP_ARM_GIC_DIST_BASE 0xFF841000
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
/** @} */
#endif /* LIBBSP_AARCH64_RASPBERRYPI_4_BSP_H */

View File

@@ -0,0 +1,71 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Console Configuration
*/
/*
* Copyright (C) 2023 Utkarsh Verma
* Copyright (C) 2024 Ning Yang
*
* 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 LIBBSP_AARCH64_RASPBERRYPI_BSP_CONSOLE_H
#define LIBBSP_AARCH64_RASPBERRYPI_BSP_CONSOLE_H
#include <bspopts.h>
#include <bsp/raspberrypi-uart.h>
#define CONSOLE_DEVICES RASPBERRYPI_CONSOLE_DEVICES
#define CONSOLE_DEVICE_PORT2ENUM(port_no) UART##port_no
#define CONSOLE_DEVICE_ENUM(port_no, ...) CONSOLE_DEVICE_PORT2ENUM(port_no),
typedef enum {
CONSOLE_DEVICES(CONSOLE_DEVICE_ENUM)
CONSOLE_DEVICE_COUNT,
} raspberrypi_console_device_port;
/**
* @brief Initialize gpio of UART and install UART to the dev directory.
*
* @param uart_num The optional devices are UART0, UART2, UART3, UART4, UART5.
*
* @retval RTEMS_SUCCESSFUL Successful operation.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
* @retval RTEMS_NO_MEMORY Not enough memory to create a device node.
* @retval RTEMS_UNSATISFIED Creation of the device file failed.
* @retval RTEMS_INCORRECT_STATE Termios is not initialized.
*/
rtems_status_code raspberrypi_uart_init(
raspberrypi_console_device_port uart_num
);
#undef CONSOLE_DEVICE_ENUM
#endif /* LIBBSP_AARCH64_RASPBERRYPI_BSP_CONSOLE_H */

View File

@@ -0,0 +1,93 @@
/**
* @file
*
* @ingroup raspberrypi_interrupt
*
* @brief Interrupt definitions.
*/
/**
* Copyright (c) 2013 Alan Cudmore
* Copyright (c) 2022 Mohd Noor Aman
* Copyright (c) 2024 Ning Yang
*
* 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_ARM_RASPBERRYPI_IRQ_H
#define LIBBSP_ARM_RASPBERRYPI_IRQ_H
#ifndef ASM
#include <rtems.h>
#include <dev/irq/arm-gic-irq.h>
/**
* @defgroup raspberrypi_interrupt Interrrupt Support
*
* @ingroup RTEMSBSPsARMRaspberryPi
*
* @brief Interrupt support.
*/
#define BCM2835_INTC_TOTAL_IRQ 216
#define BCM2835_IRQ_SET1_MIN 0
#define BCM2835_IRQ_SET2_MIN 32
#define BCM2711_IRQ_VC_PERIPHERAL_BASE 96
/* Interrupt Vectors: System Timer */
#define BCM2835_IRQ_ID_GPU_TIMER_M0 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 0)
#define BCM2835_IRQ_ID_GPU_TIMER_M1 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 1)
#define BCM2835_IRQ_ID_GPU_TIMER_M2 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 2)
#define BCM2835_IRQ_ID_GPU_TIMER_M3 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 3)
/* Interrupt Vectors: SPI */
#define BCM2711_IRQ_SPI (BCM2711_IRQ_VC_PERIPHERAL_BASE + 54)
/* Interrupt Vectors: Videocore */
#define BCM2711_IRQ_VC_PERIPHERAL_BASE 96
#define BCM2711_IRQ_AUX (BCM2711_IRQ_VC_PERIPHERAL_BASE + 29)
#define BCM2711_IRQ_PL011_UART (BCM2711_IRQ_VC_PERIPHERAL_BASE + 57)
#define BCM2835_IRQ_ID_USB 9
#define BCM2835_IRQ_ID_AUX 29
#define BCM2835_IRQ_ID_SPI_SLAVE 43
#define BCM2835_IRQ_ID_PWA0 45
#define BCM2835_IRQ_ID_PWA1 46
#define BCM2835_IRQ_ID_SMI 48
#define BCM2835_IRQ_ID_GPIO_0 49
#define BCM2835_IRQ_ID_GPIO_1 50
#define BCM2835_IRQ_ID_GPIO_2 51
#define BCM2835_IRQ_ID_GPIO_3 52
#define BCM2835_IRQ_ID_I2C 53
#define BCM2835_IRQ_ID_SPI 54
#define BCM2835_IRQ_ID_PCM 55
#define BCM2835_IRQ_ID_UART 57
#define BCM2835_IRQ_ID_SD 62
#define BCM2835_IRQ_ID_BASIC_BASE_ID 64
#define BCM2835_IRQ_ID_TIMER_0 64
#define BCM2835_IRQ_ID_MAILBOX_0 65
#define BCM2835_IRQ_ID_DOORBELL_0 66
#define BCM2835_IRQ_ID_DOORBELL_1 67
#define BCM2835_IRQ_ID_GPU0_HALTED 68
#define BCM2835_IRQ_ID_GPU1_HALTED 69
#define BCM2835_IRQ_ID_ILL_ACCESS_1 70
#define BCM2835_IRQ_ID_ILL_ACCESS_0 71
#define BSP_TIMER_VIRT_PPI 27
#define BSP_TIMER_PHYS_NS_PPI 30
#define BSP_VPL011_SPI 32
#define BSP_INTERRUPT_VECTOR_COUNT BCM2835_INTC_TOTAL_IRQ
#define BSP_INTERRUPT_VECTOR_INVALID (UINT32_MAX)
#define BSP_IRQ_COUNT (BCM2835_INTC_TOTAL_IRQ)
#endif /* ASM */
#endif /* LIBBSP_ARM_RASPBERRYPI_IRQ_H */

View File

@@ -0,0 +1,122 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup raspberrypi_4_spi
*
* @brief Raspberry Pi specific SPI definitions.
*/
/*
* Copyright (C) 2024 Ning Yang
*
* 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 LIBBSP_AARCH64_RASPBERRYPI_4_SPI_H
#define LIBBSP_AARCH64_RASPBERRYPI_4_SPI_H
#include <bsp/utility.h>
#include <bsp/rpi-gpio.h>
typedef struct
{
uint32_t spics;
#define RPI_SPICS_LEN_LONG BSP_BIT32(25)
#define RPI_SPICS_DMA_LEN BSP_BIT32(24)
#define RPI_SPICS_CSPOL2 BSP_BIT32(23)
#define RPI_SPICS_CSPOL1 BSP_BIT32(22)
#define RPI_SPICS_CSPOL0 BSP_BIT32(21)
#define RPI_SPICS_RXF BSP_BIT32(20)
#define RPI_SPICS_RXR BSP_BIT32(19)
#define RPI_SPICS_TXD BSP_BIT32(18)
#define RPI_SPICS_RXD BSP_BIT32(17)
#define RPI_SPICS_DONE BSP_BIT32(16)
#define RPI_SPICS_LEN BSP_BIT32(13)
#define RPI_SPICS_REN BSP_BIT32(12)
#define RPI_SPICS_ADCS BSP_BIT32(11)
#define RPI_SPICS_INTR BSP_BIT32(10)
#define RPI_SPICS_INTD BSP_BIT32(9)
#define RPI_SPICS_DMAEN BSP_BIT32(8)
#define RPI_SPICS_TA BSP_BIT32(7)
#define RPI_SPICS_CSPOL BSP_BIT32(6)
#define RPI_SPICS_CLEAR_TX BSP_BIT32(5)
#define RPI_SPICS_CLEAR_RX BSP_BIT32(4)
#define RPI_SPICS_CPOL BSP_BIT32(3)
#define RPI_SPICS_CPHA BSP_BIT32(2)
#define RPI_SPICS_CS(val) BSP_FLD32(val, 0, 1)
#define RPI_SPICS_CS_SET(reg,val) BSP_FLD32SET(reg, val, 0, 1)
uint32_t spififo;
#define RPI_SPIFIFO_DATA(val) BSP_FLD32(val, 0, 31)
#define RPI_SPIFIFO_DATA_GET(reg) BSP_FLD32GET(reg, 0, 31)
#define RPI_SPIFIFO_DATA_SET(reg, val) BSP_FLD32SET(reg, val, 0, 31)
uint32_t spiclk;
#define RPI_SPICLK_CDIV(val) BSP_FLD32(val, 0, 15)
#define RPI_SPICLK_CDIV_GET(reg) BSP_FLD32GET(reg, 0, 15)
#define RPI_SPICLK_CDIV_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
uint32_t spidlen;
#define RPI_SPIDLEN_LEN(val) BSP_FLD32(val, 0, 15)
#define RPI_SPIDLEN_LEN_GET(reg) BSP_FLD32GET(reg, 0, 15)
#define RPI_SPIDLEN_LEN_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
uint32_t spiltoh;
#define RPI_SPILTOH_TOH(val) BSP_FLD32(val, 0, 3)
#define RPI_SPILTOH_TOH_GET(reg) BSP_FLD32GET(reg, 0, 3)
#define RPI_SPILTOH_TOH_SET(reg, val) BSP_FLD32SET(reg, val, 0, 3)
uint32_t spidc;
#define RPI_SPIDC_RPANIC(val) BSP_FLD32(val, 24, 31)
#define RPI_SPIDC_RPANIC_GET(reg) BSP_FLD32GET(reg, 24, 31)
#define RPI_SPIDC_RPANIC_SET(reg, val) BSP_FLD32SET(reg, val, 24, 31)
#define RPI_SPIDC_RDREQ(val) BSP_FLD32(val, 16, 23)
#define RPI_SPIDC_RDREQ_GET(reg) BSP_FLD32GET(reg, 16, 23)
#define RPI_SPIDC_RDREQ_SET(reg, val) BSP_FLD32SET(reg, val, 16, 23)
#define RPI_SPIDC_TPANIC(val) BSP_FLD32(val, 8, 15)
#define RPI_SPIDC_TPANIC_GET(reg) BSP_FLD32GET(reg, 8, 15)
#define RPI_SPIDC_TPANIC_SET(reg, val) BSP_FLD32SET(reg, val, 8, 15)
#define RPI_SPIDC_TDREQ(val) BSP_FLD32(val, 0, 7)
#define RPI_SPIDC_TDREQ_GET(reg) BSP_FLD32GET(reg, 0, 7)
#define RPI_SPIDC_TDREQ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 7)
} raspberrypi_spi;
typedef enum {
raspberrypi_SPI0,
raspberrypi_SPI3,
raspberrypi_SPI4,
raspberrypi_SPI5,
raspberrypi_SPI6
} raspberrypi_spi_device;
/**
* @brief Register a spi device.
*
* @param device The optional devices are raspberrypi_SPI0, raspberrypi_SPI3,
* raspberrypi_SPI4, raspberrypi_SPI5, raspberrypi_SPI6.
*
* @retval RTEMS_SUCCESSFUL Successfully registered SPI device.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
* @retval RTEMS_UNSATISFIED This status code indicates that the request was
* not satisfied.
*/
rtems_status_code raspberrypi_spi_init(raspberrypi_spi_device device);
#endif /* LIBBSP_AARCH64_RASPBERRYPI_4_SPI_H */

View File

@@ -0,0 +1,72 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Raspberry Pi 4B Console Device Definitions
*/
/*
* Copyright (C) 2023 Utkarsh Verma
*
* 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 LIBBSP_AARCH64_RASPBERRYPI_BSP_RASPBERRYPI_UART_H
#define LIBBSP_AARCH64_RASPBERRYPI_BSP_RASPBERRYPI_UART_H
#include <bspopts.h>
#include <bsp/irq.h>
#include <bsp/raspberrypi.h>
#include <bsp/rpi-gpio.h>
#include <dev/serial/arm-pl011.h>
/*
* This macro exists to serve as a common point of definition for the
* parameters of the UARTs present in the Raspberry Pi 4. It is used in
* multiple locations with different rendering macros to prevent duplication
* of information.
*/
#define RASPBERRYPI_CONSOLE_DEVICES(CONSOLE_DEVICE_DEFINITION_RENDERER) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
0, "/dev/ttyAMA0", BCM2711_UART0_BASE,BCM2711_UART0_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 15, 14, GPIO_AF0) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
2, "/dev/ttyAMA1", BCM2711_UART2_BASE, BCM2711_UART2_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 1, 0, GPIO_AF4) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
3, "/dev/ttyAMA2", BCM2711_UART3_BASE, BCM2711_UART3_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 5, 4, GPIO_AF4) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
4, "/dev/ttyAMA3", BCM2711_UART4_BASE, BCM2711_UART4_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 9, 8, GPIO_AF4) \
CONSOLE_DEVICE_DEFINITION_RENDERER( \
5, "/dev/ttyAMA4", BCM2711_UART5_BASE, BCM2711_UART5_SIZE, \
BSP_PL011_CLOCK_FREQ, BCM2711_IRQ_PL011_UART, arm_pl011_context, \
&arm_pl011_fns, arm_pl011_write_polled, 13, 12, GPIO_AF4)
#endif /* LIBBSP_AARCH64_RASPBERRYPI_BSP_RASPBERRYPI_UART_H */

View File

@@ -0,0 +1,527 @@
/**
* @file
*
* @ingroup raspberrypi_4_regs
*
* @brief Register definitions.
*/
/*
* Copyright (c) 2022 Mohd Noor Aman
* Copyright (c) 2024 Ning Yang
*
* 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_AARCH64_RASPBERRYPI_RASPBERRYPI_4_H
#define LIBBSP_AARCH64_RASPBERRYPI_RASPBERRYPI_4_H
#include <bspopts.h>
#include <stdint.h>
#include <bsp/utility.h>
/**
* @defgroup raspberrypi_reg Register Definitions
*
* @ingroup RTEMSBSPsARMRaspberryPi
*
* @brief Register Definitions
*
* @{
*/
/**
* @name Register Macros
*
* @{
*/
#define BCM2711_REG(x) (*(volatile uint64_t *)(x))
#define BCM2711_BIT(n) (1 << (n))
#define BCM2835_REG(addr) (*(volatile uint32_t*)(addr))
/** @} */
/**
* @name Peripheral Base Register Address
*
* @{
*/
#define RPI_PERIPHERAL_BASE 0xFE000000
#define BASE_OFFSET 0xFE000000
#define RPI_PERIPHERAL_SIZE 0x01800000
/**
* @name Bus to Physical address translation
* Macro.
* @{
*/
#define BUS_TO_PHY(x) ((x) - BASE_OFFSET)
/** @} */
/**
* @name Internal ARM Timer Registers
*
* @{
*/
#define BCM2711_CLOCK_FREQ 250000000
#define BCM2711_TIMER_BASE (RPI_PERIPHERAL_BASE + 0xB400)
#define BCM2711_TIMER_LOD (BCM2711_TIMER_BASE + 0x00)
#define BCM2711_TIMER_VAL (BCM2711_TIMER_BASE + 0x04)
#define BCM2711_TIMER_CTL (BCM2711_TIMER_BASE + 0x08)
#define BCM2711_TIMER_CLI (BCM2711_TIMER_BASE + 0x0C)
#define BCM2711_TIMER_RIS (BCM2711_TIMER_BASE + 0x10)
#define BCM2711_TIMER_MIS (BCM2711_TIMER_BASE + 0x14)
#define BCM2711_TIMER_RLD (BCM2711_TIMER_BASE + 0x18)
#define BCM2711_TIMER_DIV (BCM2711_TIMER_BASE + 0x1C)
#define BCM2711_TIMER_CNT (BCM2711_TIMER_BASE + 0x20)
#define BCM2711_TIMER_PRESCALE 0xF9
/** @} */
/**
* @name Power Management and Watchdog Registers
*
* @{
*/
#define BCM2711_PM_PASSWD_MAGIC 0x5a000000
#define BCM2711_PM_BASE (RPI_PERIPHERAL_BASE + 0x100000)
#define BCM2711_PM_GNRIC (BCM2711_PM_BASE + 0x00)
#define BCM2711_PM_GNRIC_POWUP 0x00000001
#define BCM2711_PM_GNRIC_POWOK 0x00000002
#define BCM2711_PM_GNRIC_ISPOW 0x00000004
#define BCM2711_PM_GNRIC_MEMREP 0x00000008
#define BCM2711_PM_GNRIC_MRDONE 0x00000010
#define BCM2711_PM_GNRIC_ISFUNC 0x00000020
#define BCM2711_PM_GNRIC_RSTN 0x00000fc0
#define BCM2711_PM_GNRIC_ENAB 0x00001000
#define BCM2711_PM_GNRIC_CFG 0x007f0000
#define BCM2711_PM_AUDIO (BCM2711_PM_BASE + 0x04)
#define BCM2711_PM_AUDIO_APSM 0x000fffff
#define BCM2711_PM_AUDIO_CTRLEN 0x00100000
#define BCM2711_PM_AUDIO_RSTN 0x00200000
#define BCM2711_PM_STATUS (BCM2711_PM_BASE + 0x18)
#define BCM2711_PM_RSTC (BCM2711_PM_BASE + 0x1c)
#define BCM2711_PM_RSTC_DRCFG 0x00000003
#define BCM2711_PM_RSTC_WRCFG 0x00000030
#define BCM2711_PM_RSTC_WRCFG_FULL 0x00000020
#define BCM2711_PM_RSTC_WRCFG_CLR 0xffffffcf
#define BCM2711_PM_RSTC_SRCFG 0x00000300
#define BCM2711_PM_RSTC_QRCFG 0x00003000
#define BCM2711_PM_RSTC_FRCFG 0x00030000
#define BCM2711_PM_RSTC_HRCFG 0x00300000
#define BCM2711_PM_RSTC_RESET 0x00000102
#define BCM2711_PM_RSTS (BCM2711_PM_BASE + 0x20)
#define BCM2711_PM_RSTS_HADDRQ 0x00000001
#define BCM2711_PM_RSTS_HADDRF 0x00000002
#define BCM2711_PM_RSTS_HADDRH 0x00000004
#define BCM2711_PM_RSTS_HADWRQ 0x00000010
#define BCM2711_PM_RSTS_HADWRF 0x0000002
#define BCM2711_PM_RSTS_HADWRH 0x00000040
#define BCM2711_PM_RSTS_HADSRQ 0x00000100
#define BCM2711_PM_RSTS_HADSRF 0x00000200
#define BCM2711_PM_RSTS_HADSRH 0x00000400
#define BCM2711_PM_RSTS_HADPOR 0x00001000
#define BCM2711_PM_WDOG (BCM2711_PM_BASE + 0x24)
#define BCM2711_PM_WDOG_MASK 0x000fffff
/** @} */
/** @} */
/**
* @name AUX Registers
*
* @{
*/
#define BCM2711_AUX_BASE (RPI_PERIPHERAL_BASE + 0x215000)
#define AUX_ENABLES (BCM2711_AUX_BASE + 0x04)
#define AUX_MU_IO_REG (BCM2711_AUX_BASE + 0x40)
#define AUX_MU_IER_REG (BCM2711_AUX_BASE + 0x44)
#define AUX_MU_IIR_REG (BCM2711_AUX_BASE + 0x48)
#define AUX_MU_LCR_REG (BCM2711_AUX_BASE + 0x4C)
#define AUX_MU_MCR_REG (BCM2711_AUX_BASE + 0x50)
#define AUX_MU_LSR_REG (BCM2711_AUX_BASE + 0x54)
#define AUX_MU_MSR_REG (BCM2711_AUX_BASE + 0x58)
#define AUX_MU_SCRATCH (BCM2711_AUX_BASE + 0x5C)
#define AUX_MU_CNTL_REG (BCM2711_AUX_BASE + 0x60)
#define AUX_MU_STAT_REG (BCM2711_AUX_BASE + 0x64)
#define AUX_MU_BAUD_REG (BCM2711_AUX_BASE + 0x68)
/** @} */
/**
* @name PL011 UARTs
*
* @{
*/
#define BCM2711_PL011_BASE (RPI_PERIPHERAL_BASE + 0x201000)
#define BCM2711_PL011_SIZE 0xc00
#define BCM2711_PL011_DEVICE_SIZE 0x200
#define BCM2711_UART0_BASE (BCM2711_PL011_BASE + 0x000)
#define BCM2711_UART0_SIZE BCM2711_PL011_DEVICE_SIZE
#define BCM2711_UART2_BASE (BCM2711_PL011_BASE + 0x400)
#define BCM2711_UART2_SIZE BCM2711_PL011_DEVICE_SIZE
#define BCM2711_UART3_BASE (BCM2711_PL011_BASE + 0x600)
#define BCM2711_UART3_SIZE BCM2711_PL011_DEVICE_SIZE
#define BCM2711_UART4_BASE (BCM2711_PL011_BASE + 0x800)
#define BCM2711_UART4_SIZE BCM2711_PL011_DEVICE_SIZE
#define BCM2711_UART5_BASE (BCM2711_PL011_BASE + 0xa00)
#define BCM2711_UART5_SIZE BCM2711_PL011_DEVICE_SIZE
/** @} */
/**
* @name GPU Timer Registers
*
* @{
*/
/**
* NOTE: The GPU uses Compare registers 0 and 2 for
* it's own RTOS. 1 and 3 are available for use in
* RTEMS.
*/
#define BCM2711_GPU_TIMER_BASE (RPI_PERIPHERAL_BASE + 0x3000)
#define BCM2711_GPU_TIMER_CS (BCM2711_GPU_TIMER_BASE + 0x00)
#define BCM2711_GPU_TIMER_CS_M0 0x00000001
#define BCM2711_GPU_TIMER_CS_M1 0x00000002
#define BCM2711_GPU_TIMER_CS_M2 0x00000004
#define BCM2711_GPU_TIMER_CS_M3 0x00000008
#define BCM2711_GPU_TIMER_CLO (BCM2711_GPU_TIMER_BASE + 0x04)
#define BCM2711_GPU_TIMER_CHI (BCM2711_GPU_TIMER_BASE + 0x08)
#define BCM2711_GPU_TIMER_C0 (BCM2711_GPU_TIMER_BASE + 0x0C)
#define BCM2711_GPU_TIMER_C1 (BCM2711_GPU_TIMER_BASE + 0x10)
#define BCM2711_GPU_TIMER_C2 (BCM2711_GPU_TIMER_BASE + 0x14)
#define BCM2711_GPU_TIMER_C3 (BCM2711_GPU_TIMER_BASE + 0x18)
/**
* NOTE: compatible with the BCM2835 system timer
*/
#define BCM2835_GPU_TIMER_CS_M3 BCM2711_GPU_TIMER_CS_M3
#define BCM2835_GPU_TIMER_C3 BCM2711_GPU_TIMER_C3
#define BCM2835_GPU_TIMER_CLO BCM2711_GPU_TIMER_CLO
#define BCM2835_GPU_TIMER_CS BCM2711_GPU_TIMER_CS
/** @} */
/**
* @name GPIO Registers
*
* @{
*/
#define BCM2711_GPIO_BASE (RPI_PERIPHERAL_BASE + 0x200000)
#define BCM2711_GPIO_SIZE 0xf4
#define BCM2711_GPIO_PIN_COUNT 58
/** @} */
/**
* @name EMMC Registers
*
* @{
*/
/**
* NOTE: Since the SD controller follows the SDHCI standard,
* the rtems-libbsd tree already provides the remaining registers.
*/
#define BCM2711_EMMC_BASE (RPI_PERIPHERAL_BASE + 0x300000)
/** @} */
/**
* @name SPI Registers
*
* @{
*/
#define BCM2711_SPI0_BASE (RPI_PERIPHERAL_BASE + 0x204000)
#define BCM2711_SPI3_BASE (RPI_PERIPHERAL_BASE + 0x204600)
#define BCM2711_SPI4_BASE (RPI_PERIPHERAL_BASE + 0x204800)
#define BCM2711_SPI5_BASE (RPI_PERIPHERAL_BASE + 0x204A00)
#define BCM2711_SPI6_BASE (RPI_PERIPHERAL_BASE + 0x204C00)
/** @} */
/**
* @name Mailbox Registers
*
* @{
*/
#define BCM2711_MBOX_BASE (RPI_PERIPHERAL_BASE+0xB880)
#define BCM2711_MBOX_READ (BCM2711_MBOX_BASE+0x00)
#define BCM2711_MBOX_PEEK (BCM2711_MBOX_BASE+0x10)
#define BCM2711_MBOX_SENDER (BCM2711_MBOX_BASE+0x14)
#define BCM2711_MBOX_STATUS (BCM2711_MBOX_BASE+0x18)
#define BCM2711_MBOX_WRITE (BCM2711_MBOX_BASE+0x20)
#define BCM2711_MBOX_CONFIG (BCM2711_MBOX_BASE+0x1C)
#define BCM2711_MBOX_RESPONSE 0x80000000
#define BCM2711_MBOX_FULL 0x80000000
#define BCM2711_MBOX_EMPTY 0x40000000
/** @} */
/**
* @name Mailbox Channels
*
* @{
*/
/* Power Manager channel */
#define BCM2711_MBOX_CHANNEL_PM 0
/* Framebuffer channel */
#define BCM2711_MBOX_CHANNEL_FB 1
/* Virtual UART channel */
#define BCM2711_MBOX_CHANNEL_VUART 2
/* VCHIQ channel */
#define BCM2711_MBOX_CHANNEL_VCHIQ 3
/* LEDs channel */
#define BCM2711_MBOX_CHANNEL_LED 4
/* Button channel */
#define BCM2711_MBOX_CHANNEL_BUTTON 5
/* Touch screen channel */
#define BCM2711_MBOX_CHANNEL_TOUCHS 6
#define BCM2711_MBOX_CHANNEL_COUNT 7
/* Property tags (ARM <-> VC) channel */
#define BCM2711_MBOX_CHANNEL_PROP_AVC 8
/* Property tags (VC <-> ARM) channel */
#define BCM2711_MBOX_CHANNEL_PROP_VCA 9
/** @} */
/**
* @name Raspberry Pi 2 Interrupt Register Defines
*
* @{
*/
/* Timers interrupt control registers */
#define BCM2711_CORE0_TIMER_IRQ_CTRL_BASE 0xFF800040
#define BCM2711_CORE1_TIMER_IRQ_CTRL_BASE 0xFF800044
#define BCM2711_CORE2_TIMER_IRQ_CTRL_BASE 0xFF800048
#define BCM2711_CORE3_TIMER_IRQ_CTRL_BASE 0xFF80004C
#define BCM2711_CORE_TIMER_IRQ_CTRL(cpuidx) \
(BCM2711_CORE0_TIMER_IRQ_CTRL_BASE + 0x4 * (cpuidx))
/**
* @name Raspberry Pi 4 ARM_LOCAL registers
*
* @{
*/
#define BCM2711_LOCAL_REGS_BASE 0x4C0000000
#define BCM2711_LOCAL_REGS_SIZE 0x100
#define BCM2711_LOCAL_ARM_CONTROL (BCM2711_LOCAL_REGS_BASE + 0x00)
#define BCM2711_LOCAL_CORE_IRQ_CONTROL (BCM2711_LOCAL_REGS_BASE + 0x0c)
#define BCM2711_LOCAL_PMU_CONTROL_SET (BCM2711_LOCAL_REGS_BASE + 0x10)
#define BCM2711_LOCAL_PMU_CONTROL_CLR (BCM2711_LOCAL_REGS_BASE + 0x14)
#define BCM2711_LOCAL_PERI_IRQ_ROUTE0 (BCM2711_LOCAL_REGS_BASE + 0x24)
#define BCM2711_LOCAL_AXI_QUIET_TIME (BCM2711_LOCAL_REGS_BASE + 0x30)
#define BCM2711_LOCAL_LOCAL_TIMER_CONTROL (BCM2711_LOCAL_REGS_BASE + 0x34)
#define BCM2711_LOCAL_LOCAL_TIMER_IRQ (BCM2711_LOCAL_REGS_BASE + 0x38)
#define BCM2711_LOCAL_TIMER_CNTRL0 (BCM2711_LOCAL_REGS_BASE + 0x40)
#define BCM2711_LOCAL_TIMER_CNTRL1 (BCM2711_LOCAL_REGS_BASE + 0x44)
#define BCM2711_LOCAL_TIMER_CNTRL2 (BCM2711_LOCAL_REGS_BASE + 0x48)
#define BCM2711_LOCAL_TIMER_CNTRL3 (BCM2711_LOCAL_REGS_BASE + 0x4c)
#define BCM2711_LOCAL_MAILBOX_CNTRL0 (BCM2711_LOCAL_REGS_BASE + 0x50)
#define BCM2711_LOCAL_MAILBOX_CNTRL1 (BCM2711_LOCAL_REGS_BASE + 0x54)
#define BCM2711_LOCAL_MAILBOX_CNTRL2 (BCM2711_LOCAL_REGS_BASE + 0x58)
#define BCM2711_LOCAL_MAILBOX_CNTRL3 (BCM2711_LOCAL_REGS_BASE + 0x5c)
#define BCM2711_LOCAL_IRQ_SOURCE0 (BCM2711_LOCAL_REGS_BASE + 0x60)
#define BCM2711_LOCAL_IRQ_SOURCE1 (BCM2711_LOCAL_REGS_BASE + 0x64)
#define BCM2711_LOCAL_IRQ_SOURCE2 (BCM2711_LOCAL_REGS_BASE + 0x68)
#define BCM2711_LOCAL_IRQ_SOURCE3 (BCM2711_LOCAL_REGS_BASE + 0x6c)
#define BCM2711_LOCAL_FIQ_SOURCE0 (BCM2711_LOCAL_REGS_BASE + 0x70)
#define BCM2711_LOCAL_FIQ_SOURCE1 (BCM2711_LOCAL_REGS_BASE + 0x74)
#define BCM2711_LOCAL_FIQ_SOURCE2 (BCM2711_LOCAL_REGS_BASE + 0x78)
#define BCM2711_LOCAL_FIQ_SOURCE3 (BCM2711_LOCAL_REGS_BASE + 0x7c)
/**
* @name Raspberry Pi 4 Mailbox registers
*
* @{
*/
#define BCM2711_MAILBOX_00_WRITE_SET_BASE 0x4C000080
#define BCM2711_MAILBOX_01_WRITE_SET_BASE 0x4C000084
#define BCM2711_MAILBOX_02_WRITE_SET_BASE 0x4C000088
#define BCM2711_MAILBOX_03_WRITE_SET_BASE 0x4C00008C
#define BCM2711_MAILBOX_04_WRITE_SET_BASE 0x4C000090
#define BCM2711_MAILBOX_05_WRITE_SET_BASE 0x4C000094
#define BCM2711_MAILBOX_06_WRITE_SET_BASE 0x4C000098
#define BCM2711_MAILBOX_07_WRITE_SET_BASE 0x4C00009C
#define BCM2711_MAILBOX_08_WRITE_SET_BASE 0x4C0000A0
#define BCM2711_MAILBOX_09_WRITE_SET_BASE 0x4C0000A4
#define BCM2711_MAILBOX_10_WRITE_SET_BASE 0x4C0000A8
#define BCM2711_MAILBOX_11_WRITE_SET_BASE 0x4C0000AC
#define BCM2711_MAILBOX_12_WRITE_SET_BASE 0x4C0000B0
#define BCM2711_MAILBOX_13_WRITE_SET_BASE 0x4C0000B4
#define BCM2711_MAILBOX_14_WRITE_SET_BASE 0x4C0000B8
#define BCM2711_MAILBOX_15_WRITE_SET_BASE 0x4C0000BC
#define BCM2711_MAILBOX_00_READ_CLEAR_BASE 0x4C0000C0
#define BCM2711_MAILBOX_01_READ_CLEAR_BASE 0x4C0000C4
#define BCM2711_MAILBOX_02_READ_CLEAR_BASE 0x4C0000C8
#define BCM2711_MAILBOX_03_READ_CLEAR_BASE 0x4C0000CC
#define BCM2711_MAILBOX_04_READ_CLEAR_BASE 0x4C0000D0
#define BCM2711_MAILBOX_05_READ_CLEAR_BASE 0x4C0000D4
#define BCM2711_MAILBOX_06_READ_CLEAR_BASE 0x4C0000D8
#define BCM2711_MAILBOX_07_READ_CLEAR_BASE 0x4C0000DC
#define BCM2711_MAILBOX_08_READ_CLEAR_BASE 0x4C0000E0
#define BCM2711_MAILBOX_09_READ_CLEAR_BASE 0x4C0000E4
#define BCM2711_MAILBOX_10_READ_CLEAR_BASE 0x4C0000E8
#define BCM2711_MAILBOX_11_READ_CLEAR_BASE 0x4C0000EC
#define BCM2711_MAILBOX_12_READ_CLEAR_BASE 0x4C0000F0
#define BCM2711_MAILBOX_13_READ_CLEAR_BASE 0x4C0000F4
#define BCM2711_MAILBOX_14_READ_CLEAR_BASE 0x4C0000F8
#define BCM2711_MAILBOX_15_READ_CLEAR_BASE 0x4C0000FC
/**
* @name Raspberry Pi 4 ARM_C FIQ and IRQ registers
*
* @{
*/
#define BCM2711_ARMC_REGS_BASE (RPI_PERIPHERAL_BASE + 0xB200)
#define BCM2711_ARMC_REGS_SIZE 0x200
#define BCM2711_ARMC_IRQ0_PENDING0 (BCM2711_ARMC_REGS_BASE + 0x00)
#define BCM2711_ARMC_IRQ0_PENDING1 (BCM2711_ARMC_REGS_BASE + 0x04)
#define BCM2711_ARMC_IRQ0_PENDING2 (BCM2711_ARMC_REGS_BASE + 0x08)
#define BCM2711_ARMC_IRQ0_SET_EN_0 (BCM2711_ARMC_REGS_BASE + 0x10)
#define BCM2711_ARMC_IRQ0_SET_EN_1 (BCM2711_ARMC_REGS_BASE + 0x14)
#define BCM2711_ARMC_IRQ0_SET_EN_2 (BCM2711_ARMC_REGS_BASE + 0x18)
#define BCM2711_ARMC_IRQ0_CLR_EN_0 (BCM2711_ARMC_REGS_BASE + 0x20)
#define BCM2711_ARMC_IRQ0_CLR_EN_1 (BCM2711_ARMC_REGS_BASE + 0x24)
#define BCM2711_ARMC_IRQ0_CLR_EN_2 (BCM2711_ARMC_REGS_BASE + 0x28)
#define BCM2711_ARMC_IRQ_STATUS0 (BCM2711_ARMC_REGS_BASE + 0x30)
#define BCM2711_ARMC_IRQ_STATUS1 (BCM2711_ARMC_REGS_BASE + 0x34)
#define BCM2711_ARMC_IRQ_STATUS2 (BCM2711_ARMC_REGS_BASE + 0x38)
#define BCM2711_ARMC_IRQ1_PENDING0 (BCM2711_ARMC_REGS_BASE + 0x40)
#define BCM2711_ARMC_IRQ1_PENDING1 (BCM2711_ARMC_REGS_BASE + 0x44)
#define BCM2711_ARMC_IRQ1_PENDING2 (BCM2711_ARMC_REGS_BASE + 0x48)
#define BCM2711_ARMC_IRQ1_SET_EN_0 (BCM2711_ARMC_REGS_BASE + 0x50)
#define BCM2711_ARMC_IRQ1_SET_EN_1 (BCM2711_ARMC_REGS_BASE + 0x54)
#define BCM2711_ARMC_IRQ1_SET_EN_2 (BCM2711_ARMC_REGS_BASE + 0x58)
#define BCM2711_ARMC_IRQ1_CLR_EN_0 (BCM2711_ARMC_REGS_BASE + 0x60)
#define BCM2711_ARMC_IRQ1_CLR_EN_1 (BCM2711_ARMC_REGS_BASE + 0x64)
#define BCM2711_ARMC_IRQ1_CLR_EN_2 (BCM2711_ARMC_REGS_BASE + 0x68)
#define BCM2711_ARMC_IRQ2_PENDING0 (BCM2711_ARMC_REGS_BASE + 0x80)
#define BCM2711_ARMC_IRQ2_PENDING1 (BCM2711_ARMC_REGS_BASE + 0x84)
#define BCM2711_ARMC_IRQ2_PENDING2 (BCM2711_ARMC_REGS_BASE + 0x88)
#define BCM2711_ARMC_IRQ2_SET_EN_0 (BCM2711_ARMC_REGS_BASE + 0x90)
#define BCM2711_ARMC_IRQ2_SET_EN_1 (BCM2711_ARMC_REGS_BASE + 0x94)
#define BCM2711_ARMC_IRQ2_SET_EN_2 (BCM2711_ARMC_REGS_BASE + 0x98)
#define BCM2711_ARMC_IRQ2_CLR_EN_0 (BCM2711_ARMC_REGS_BASE + 0xA0)
#define BCM2711_ARMC_IRQ2_CLR_EN_1 (BCM2711_ARMC_REGS_BASE + 0xA4)
#define BCM2711_ARMC_IRQ2_CLR_EN_2 (BCM2711_ARMC_REGS_BASE + 0xA8)
#define BCM2711_ARMC_IRQ3_PENDING0 (BCM2711_ARMC_REGS_BASE + 0xC0)
#define BCM2711_ARMC_IRQ3_PENDING1 (BCM2711_ARMC_REGS_BASE + 0xC4)
#define BCM2711_ARMC_IRQ3_PENDING2 (BCM2711_ARMC_REGS_BASE + 0xC8)
#define BCM2711_ARMC_IRQ3_SET_EN_0 (BCM2711_ARMC_REGS_BASE + 0xD0)
#define BCM2711_ARMC_IRQ3_SET_EN_1 (BCM2711_ARMC_REGS_BASE + 0xD4)
#define BCM2711_ARMC_IRQ3_SET_EN_2 (BCM2711_ARMC_REGS_BASE + 0xD8)
#define BCM2711_ARMC_IRQ3_CLR_EN_0 (BCM2711_ARMC_REGS_BASE + 0xE0)
#define BCM2711_ARMC_IRQ3_CLR_EN_1 (BCM2711_ARMC_REGS_BASE + 0xE4)
#define BCM2711_ARMC_IRQ3_CLR_EN_2 (BCM2711_ARMC_REGS_BASE + 0xE8)
#define BCM2711_ARMC_FIQ0_PENDING0 (BCM2711_ARMC_REGS_BASE + 0x100)
#define BCM2711_ARMC_FIQ0_PENDING1 (BCM2711_ARMC_REGS_BASE + 0x104)
#define BCM2711_ARMC_FIQ0_PENDING2 (BCM2711_ARMC_REGS_BASE + 0x108)
#define BCM2711_ARMC_FIQ0_SET_EN_0 (BCM2711_ARMC_REGS_BASE + 0x110)
#define BCM2711_ARMC_FIQ0_SET_EN_1 (BCM2711_ARMC_REGS_BASE + 0x114)
#define BCM2711_ARMC_FIQ0_SET_EN_2 (BCM2711_ARMC_REGS_BASE + 0x118)
#define BCM2711_ARMC_FIQ0_CLR_EN_0 (BCM2711_ARMC_REGS_BASE + 0x120)
#define BCM2711_ARMC_FIQ0_CLR_EN_1 (BCM2711_ARMC_REGS_BASE + 0x124)
#define BCM2711_ARMC_FIQ0_CLR_EN_2 (BCM2711_ARMC_REGS_BASE + 0x128)
#define BCM2711_ARMC_FIQ1_PENDING0 (BCM2711_ARMC_REGS_BASE + 0x140)
#define BCM2711_ARMC_FIQ1_PENDING1 (BCM2711_ARMC_REGS_BASE + 0x144)
#define BCM2711_ARMC_FIQ1_PENDING2 (BCM2711_ARMC_REGS_BASE + 0x148)
#define BCM2711_ARMC_FIQ1_SET_EN_0 (BCM2711_ARMC_REGS_BASE + 0x150)
#define BCM2711_ARMC_FIQ1_SET_EN_1 (BCM2711_ARMC_REGS_BASE + 0x154)
#define BCM2711_ARMC_FIQ1_SET_EN_2 (BCM2711_ARMC_REGS_BASE + 0x158)
#define BCM2711_ARMC_FIQ1_CLR_EN_0 (BCM2711_ARMC_REGS_BASE + 0x160)
#define BCM2711_ARMC_FIQ1_CLR_EN_1 (BCM2711_ARMC_REGS_BASE + 0x164)
#define BCM2711_ARMC_FIQ1_CLR_EN_2 (BCM2711_ARMC_REGS_BASE + 0x168)
#define BCM2711_ARMC_FIQ2_PENDING0 (BCM2711_ARMC_REGS_BASE + 0x180)
#define BCM2711_ARMC_FIQ2_PENDING1 (BCM2711_ARMC_REGS_BASE + 0x184)
#define BCM2711_ARMC_FIQ2_PENDING2 (BCM2711_ARMC_REGS_BASE + 0x188)
#define BCM2711_ARMC_FIQ2_SET_EN_0 (BCM2711_ARMC_REGS_BASE + 0x190)
#define BCM2711_ARMC_FIQ2_SET_EN_1 (BCM2711_ARMC_REGS_BASE + 0x194)
#define BCM2711_ARMC_FIQ2_SET_EN_2 (BCM2711_ARMC_REGS_BASE + 0x198)
#define BCM2711_ARMC_FIQ2_CLR_EN_0 (BCM2711_ARMC_REGS_BASE + 0x1A0)
#define BCM2711_ARMC_FIQ2_CLR_EN_1 (BCM2711_ARMC_REGS_BASE + 0x1A4)
#define BCM2711_ARMC_FIQ2_CLR_EN_2 (BCM2711_ARMC_REGS_BASE + 0x1A8)
#define BCM2711_ARMC_FIQ3_PENDING0 (BCM2711_ARMC_REGS_BASE + 0x1C0)
#define BCM2711_ARMC_FIQ3_PENDING1 (BCM2711_ARMC_REGS_BASE + 0x1C4)
#define BCM2711_ARMC_FIQ3_PENDING2 (BCM2711_ARMC_REGS_BASE + 0x1C8)
#define BCM2711_ARMC_FIQ3_SET_EN_0 (BCM2711_ARMC_REGS_BASE + 0x1D0)
#define BCM2711_ARMC_FIQ3_SET_EN_1 (BCM2711_ARMC_REGS_BASE + 0x1D4)
#define BCM2711_ARMC_FIQ3_SET_EN_2 (BCM2711_ARMC_REGS_BASE + 0x1D8)
#define BCM2711_ARMC_FIQ3_CLR_EN_0 (BCM2711_ARMC_REGS_BASE + 0x1E0)
#define BCM2711_ARMC_FIQ3_CLR_EN_1 (BCM2711_ARMC_REGS_BASE + 0x1E4)
#define BCM2711_ARMC_FIQ3_CLR_EN_2 (BCM2711_ARMC_REGS_BASE + 0x1E8)
#define BCM2711_ARMC_SWIRQ_SET (BCM2711_ARMC_REGS_BASE + 0x1F0)
#define BCM2711_ARMC_SWIRQ_CLEAR (BCM2711_ARMC_REGS_BASE + 0x1F4)
/** @} */
#endif /* LIBBSP_ARM_RASPBERRYPI_RASPBERRYPI_H */

View File

@@ -0,0 +1,118 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Raspberry Pi 4B specific GPIO definitions.
*/
/*
* Copyright (C) 2023 Utkarsh Verma
*
* 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 LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_GPIO_H
#define LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_GPIO_H
#include <bspopts.h>
#include <rtems/rtems/status.h>
/**
* @brief Raspberry Pi GPIO functions.
*/
typedef enum {
GPIO_INPUT,
GPIO_OUTPUT,
GPIO_AF5,
GPIO_AF4,
GPIO_AF0,
GPIO_AF1,
GPIO_AF2,
GPIO_AF3,
} raspberrypi_gpio_function;
typedef enum {
GPIO_PULL_NONE,
GPIO_PULL_UP,
GPIO_PULL_DOWN,
} raspberrypi_gpio_pull;
/**
* @brief Set the operation of the general-purpose I/O pins. Each of the 58
* GPIO pins has at least two alternative functions as defined.
*
* @param pin The GPIO pin.
* @param value The optional functions are GPIO_INPUT, GPIO_OUTPUT, GPIO_AF5,
* GPIO_AF4, GPIO_AF0, GPIO_AF1, GPIO_AF2, GPIO_AF3.
*
* @retval RTEMS_SUCCESSFUL GPIO function successfully configured.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
*/
rtems_status_code raspberrypi_gpio_set_function(
const unsigned int pin,
const raspberrypi_gpio_function value
);
/**
* @brief Set a GPIO pin.
*
* @param pin The GPIO pin.
*
* @retval RTEMS_SUCCESSFUL GPIO pin set successfully.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
*/
rtems_status_code raspberrypi_gpio_set_pin(const unsigned int pin);
/**
* @brief Clear a GPIO pin.
*
* @param pin The GPIO pin.
*
* @retval RTEMS_SUCCESSFUL GPIO pin clear successfully.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
*/
rtems_status_code raspberrypi_gpio_clear_pin(const unsigned int pin);
/**
* @brief Control the actuation of the internal pull-up/down resistors.
*
* @param pin The GPIO pin.
* @param value The optional value are GPIO_PULL_NONE, GPIO_PULL_UP,
* GPIO_PULL_DOWN.
*
* @retval RTEMS_SUCCESSFUL GPIO pull set successfully.
* @retval RTEMS_INVALID_NUMBER This status code indicates that a specified
* number was invalid.
*/
rtems_status_code raspberrypi_gpio_set_pull(
const unsigned int pin,
const raspberrypi_gpio_pull value
);
#endif /* LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_GPIO_H */

View File

@@ -0,0 +1,97 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief API of the Watchdog driver for the raspberrypi4 bsp in RTEMS.
*/
/*
* Copyright (C) 2024 Ning Yang
*
* 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 LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_WATCHDOG_H
#define LIBBSP_AARCH64_RASPBERRYPI_BSP_RPI_WATCHDOG_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @note a brief example of expected usage.
*
* void raspberrypi_watchdog_example()
* {
* raspberrypi_watchdog_init();
* raspberrypi_watchdog_start(15000);
*
* raspberrypi_watchdog_reload();
* ...
* raspberrypi_watchdog_reload();
*
* raspberrypi_watchdog_stop();
* }
*
*/
/**
* @brief Initialize BSP watchdog routines.
*/
void raspberrypi_watchdog_init(void);
/**
* @brief Turn on the watchdog / begin the counter at the desired value.
*
* @param timeout Watchdog timeout value in ms.
* The watchdog device has 20 bits of timeout, so it only
* supports a maximum of 15999 ms for its timeout.
* This value should be between 0 and 15999.
*/
void raspberrypi_watchdog_start(uint32_t timeout_ms);
/**
* @brief Turn off the watchdog.
*/
void raspberrypi_watchdog_stop(void);
/**
* @brief Reload watchdog.
*/
void raspberrypi_watchdog_reload(void);
/**
* @brief Get the remaining time of the watchdog.
* The return value is still valid when the watchdog has been stopped.
*
* @retval Watchdog remaining time in ms.
*/
uint32_t raspberrypi_watchdog_get_remaining_time(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,46 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief BSP tm27 header
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* 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_TMTEST27
#error "This is an RTEMS internal file you must not include directly."
#endif
#ifndef __tm27_h
#define __tm27_h
#include <dev/irq/arm-gic-tm27.h>
#endif /* __tm27_h */

View File

@@ -0,0 +1,582 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief SPI Driver
*/
/*
* Copyright (C) 2024 Ning Yang
*
* 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/irq.h>
#include <bsp/raspberrypi.h>
#include <bsp/raspberrypi-spi.h>
#include <bsp/rpi-gpio.h>
#include <dev/spi/spi.h>
#include <bspopts.h>
typedef struct {
spi_bus base;
volatile raspberrypi_spi *regs;
const spi_ioc_transfer *msg;
uint32_t msg_todo;
uint8_t *rx_buf;
const uint8_t *tx_buf;
uint32_t todo;
uint8_t num_cs;
uint32_t in_transfer;
rtems_id task_id;
rtems_vector_number irq;
}raspberrypi_spi_bus;
static int raspberrypi_spi_check_msg(
raspberrypi_spi_bus *bus,
const spi_ioc_transfer *msg,
uint32_t n
)
{
while (n > 0) {
if (msg->bits_per_word != 8) {
return -EINVAL;
}
if ((msg->mode &
~(SPI_CPHA | SPI_CPOL | SPI_NO_CS)) != 0) {
return -EINVAL;
}
if (msg->cs >= bus->num_cs) {
return -EINVAL;
}
++msg;
--n;
}
return 0;
}
/* Calculates a clock divider to be used with the GPU core clock rate
* to set a SPI clock rate the closest (<=) to a desired frequency. */
static rtems_status_code rpi_spi_calculate_clock_divider(
uint32_t clock_hz,
uint16_t *clock_divider
)
{
uint16_t divider;
uint32_t clock_rate;
/* Calculates an initial clock divider. */
divider = GPU_CORE_CLOCK_RATE / clock_hz;
/* Because the divider must be a power of two (as per the BCM2835 datasheet),
* calculate the next greater power of two. */
--divider;
divider |= (divider >> 1);
divider |= (divider >> 2);
divider |= (divider >> 4);
divider |= (divider >> 8);
++divider;
clock_rate = GPU_CORE_CLOCK_RATE / divider;
/* If the resulting clock rate is greater than the desired frequency,
* try the next greater power of two divider. */
while (clock_rate > clock_hz) {
divider = (divider << 1);
clock_rate = GPU_CORE_CLOCK_RATE / divider;
}
*clock_divider = divider;
return RTEMS_SUCCESSFUL;
}
static int raspberrypi_spi_config(
raspberrypi_spi_bus *bus,
volatile raspberrypi_spi *regs,
uint32_t speed_hz,
uint32_t mode,
uint8_t cs
)
{
spi_bus *base = &bus->base;
uint32_t spics = regs->spics;
rtems_status_code sc;
uint16_t clock_divider;
/* Calculate the most appropriate clock divider. */
sc = rpi_spi_calculate_clock_divider(speed_hz, &clock_divider);
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
/* Set the bus clock divider. */
regs->spiclk = RPI_SPICLK_CDIV_SET(regs->spiclk, clock_divider);
if ((mode & SPI_CPHA) != 0) {
spics |= RPI_SPICS_CPHA;
} else {
spics &= ~RPI_SPICS_CPHA;
}
if ((mode & SPI_CPOL) != 0) {
spics |= RPI_SPICS_CPOL;
} else {
spics &= ~RPI_SPICS_CPOL;
}
if ((mode & SPI_CS_HIGH) != 0) {
spics |= RPI_SPICS_CSPOL;
} else {
spics &= ~RPI_SPICS_CSPOL;
}
spics = RPI_SPICS_CS_SET(spics, cs);
regs->spics = spics;
base->speed_hz = speed_hz;
base->mode = mode;
base->cs = cs;
return 0;
}
#ifdef BSP_SPI_USE_INTERRUPTS
static void raspberrypi_spi_done(raspberrypi_spi_bus *bus)
{
volatile raspberrypi_spi *regs;
regs = bus->regs;
regs->spics = regs->spics & ~RPI_SPICS_TA;
rtems_event_transient_send(bus->task_id);
}
static bool raspberrpi_spi_TX_FULL(volatile raspberrypi_spi *regs)
{
return !(regs->spics & RPI_SPICS_TXD);
}
static void raspberrypi_spi_push(
raspberrypi_spi_bus *bus,
volatile raspberrypi_spi *regs
)
{
uint8_t val;
while (bus->todo > 0 && !raspberrpi_spi_TX_FULL(regs)) {
val = 0;
if (bus->tx_buf != NULL) {
val = *bus->tx_buf;
++bus->tx_buf;
}
--bus->todo;
regs->spififo = val;
++bus->in_transfer;
}
}
static void raspberrypi_spi_next_msg(raspberrypi_spi_bus *bus)
{
const spi_ioc_transfer *msg;
spi_bus *base;
volatile raspberrypi_spi *regs;
regs=bus->regs;
if (bus->msg_todo > 0) {
base = &bus->base;
msg = bus->msg;
if (
msg->speed_hz != base->speed_hz
|| msg->mode != base->mode
|| msg->cs != base->cs
) {
raspberrypi_spi_config(
bus,
regs,
msg->speed_hz,
msg->mode,
msg->cs
);
}
bus->todo = msg->len;
bus->rx_buf = msg->rx_buf;
bus->tx_buf = msg->tx_buf;
raspberrypi_spi_push(bus, regs);
} else {
raspberrypi_spi_done(bus);
}
}
static void raspberrypi_spi_start(raspberrypi_spi_bus *bus)
{
volatile raspberrypi_spi *regs;
regs = bus->regs;
regs->spics = regs->spics | RPI_SPICS_INTR | RPI_SPICS_INTD;
/*
* Set TA = 1. This will immediately trigger a first interrupt with
* DONE = 1.
*/
regs->spics = regs->spics | RPI_SPICS_TA;
}
static bool raspberrypi_spi_irq(volatile raspberrypi_spi *regs)
{
/* Check whether the interrupt is generated by this SPI device */
if(regs->spics & RPI_SPICS_INTD && regs->spics & RPI_SPICS_DONE) {
return 1;
}
if(regs->spics & RPI_SPICS_INTR && regs->spics & RPI_SPICS_RXR) {
return 1;
}
return 0;
}
static void raspberrypi_spi_interrupt(void *arg)
{
raspberrypi_spi_bus *bus;
volatile raspberrypi_spi *regs;
uint32_t val;
bus = arg;
regs = bus->regs;
if (raspberrypi_spi_irq(regs)) {
if (bus->todo > 0) {
raspberrypi_spi_push(bus, regs);
} else {
--bus->msg_todo;
++bus->msg;
raspberrypi_spi_next_msg(bus);
}
while (regs->spics & RPI_SPICS_RXD && bus->in_transfer > 0) {
/* RX FIFO contains at least 1 byte. */
val = regs->spififo;
if (bus->rx_buf != NULL) {
*bus->rx_buf = (uint8_t)val;
++bus->rx_buf;
}
--bus->in_transfer;
}
}
}
#else
static void raspberrypi_spi_polling_tx_rx(raspberrypi_spi_bus *bus)
{
volatile raspberrypi_spi *regs = bus->regs;
const unsigned char *sbuffer = bus->tx_buf;
unsigned char *rbuffer;
unsigned int size;
unsigned int read_count, write_count;
unsigned int data;
while (bus->msg_todo) {
rbuffer = bus->rx_buf;
size = bus->todo;
regs->spics = regs->spics | RPI_SPICS_CLEAR_RX | RPI_SPICS_CLEAR_TX
| RPI_SPICS_TA;
read_count = 0;
write_count = 0;
while (read_count < size || write_count < size) {
if (write_count < size && regs->spics & RPI_SPICS_TXD) {
if (sbuffer) {
regs->spififo = *sbuffer++;
} else {
regs->spififo = 0;
}
write_count++;
}
if (read_count < size && regs->spics & RPI_SPICS_RXD) {
data = regs->spififo;
if (rbuffer) {
*rbuffer++ = data;
}
read_count++;
}
}
while (!(regs->spics & RPI_SPICS_DONE)) {
/*wait*/
}
regs->spics = (regs->spics & ~RPI_SPICS_TA);
bus->msg_todo--;
bus->msg++;
bus->rx_buf = bus->msg->rx_buf;
bus->tx_buf = bus->msg->tx_buf;
bus->todo = bus->msg->len;
}
}
static void raspberrypi_spi_transfer_msg(
raspberrypi_spi_bus *bus
)
{
volatile raspberrypi_spi *regs = bus->regs;
uint32_t msg_todo = bus->msg_todo;
const spi_ioc_transfer *msg = bus->msg;
if (msg_todo > 0) {
if (
msg->speed_hz != bus->base.speed_hz
|| msg->mode != bus->base.mode
|| msg->cs != bus->base.cs
) {
raspberrypi_spi_config(
bus,
regs,
msg->speed_hz,
msg->mode,
msg->cs
);
}
bus->todo = msg->len;
bus->rx_buf = msg->rx_buf;
bus->tx_buf = msg->tx_buf;
raspberrypi_spi_polling_tx_rx(bus);
}
}
#endif
static int raspberrypi_spi_transfer(
spi_bus *base,
const spi_ioc_transfer *msgs,
uint32_t msg_count
)
{
int rv = 0;
raspberrypi_spi_bus *bus;
bus = (raspberrypi_spi_bus *) base;
rv = raspberrypi_spi_check_msg(bus, msgs, msg_count);
if (rv == 0) {
bus->msg_todo = msg_count;
bus->msg = msgs;
#ifdef BSP_SPI_USE_INTERRUPTS
bus->task_id = rtems_task_self();
raspberrypi_spi_start(bus);
rtems_event_transient_receive(RTEMS_WAIT, RTEMS_NO_TIMEOUT);
#else
raspberrypi_spi_transfer_msg(bus);
#endif
}
return rv;
}
static void raspberrypi_spi_destroy(spi_bus *base)
{
raspberrypi_spi_bus *bus;
bus = (raspberrypi_spi_bus *) base;
#ifdef BSP_SPI_USE_INTERRUPTS
rtems_interrupt_handler_remove(
bus->irq,
raspberrypi_spi_interrupt,
bus
);
#endif
spi_bus_destroy_and_free(&bus->base);
}
static int raspberrypi_spi_setup(spi_bus *base)
{
raspberrypi_spi_bus *bus;
uint32_t mode = base->mode;
bus = (raspberrypi_spi_bus *) base;
if (mode & SPI_LOOP) {
return -EINVAL;
}
return raspberrypi_spi_config(
bus,
bus->regs,
bus->base.speed_hz,
bus->base.mode,
bus->base.cs
);
}
static rtems_status_code raspberrypi_spi_init_gpio(
raspberrypi_spi_device device
)
{
switch (device) {
case raspberrypi_SPI0:
raspberrypi_gpio_set_function(7, GPIO_AF0); /* CS1 */
raspberrypi_gpio_set_pull(7, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(8, GPIO_AF0); /* CS0 */
raspberrypi_gpio_set_pull(8, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(9, GPIO_AF0); /* MISO */
raspberrypi_gpio_set_function(10, GPIO_AF0); /* MOSI */
raspberrypi_gpio_set_function(11, GPIO_AF0); /* SCLK */
break;
case raspberrypi_SPI3:
raspberrypi_gpio_set_function(24, GPIO_AF5);
raspberrypi_gpio_set_pull(24, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(0, GPIO_AF3);
raspberrypi_gpio_set_pull(0, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(1, GPIO_AF3);
raspberrypi_gpio_set_function(2, GPIO_AF3);
raspberrypi_gpio_set_function(3, GPIO_AF3);
break;
case raspberrypi_SPI4:
raspberrypi_gpio_set_function(25, GPIO_AF5);
raspberrypi_gpio_set_pull(25, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(4, GPIO_AF3);
raspberrypi_gpio_set_pull(4, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(5, GPIO_AF3);
raspberrypi_gpio_set_function(6, GPIO_AF3);
raspberrypi_gpio_set_function(7, GPIO_AF3);
break;
case raspberrypi_SPI5:
raspberrypi_gpio_set_function(26, GPIO_AF5);
raspberrypi_gpio_set_pull(26, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(12, GPIO_AF3);
raspberrypi_gpio_set_pull(12, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(13, GPIO_AF3);
raspberrypi_gpio_set_function(14, GPIO_AF3);
raspberrypi_gpio_set_function(15, GPIO_AF3);
break;
case raspberrypi_SPI6:
raspberrypi_gpio_set_function(27, GPIO_AF5);
raspberrypi_gpio_set_pull(27, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(18, GPIO_AF3);
raspberrypi_gpio_set_pull(18, GPIO_PULL_NONE);
raspberrypi_gpio_set_function(19, GPIO_AF3);
raspberrypi_gpio_set_function(20, GPIO_AF3);
raspberrypi_gpio_set_function(21, GPIO_AF3);
break;
default:
return RTEMS_INVALID_NUMBER;
break;
}
return RTEMS_SUCCESSFUL;
}
rtems_status_code raspberrypi_spi_init(raspberrypi_spi_device device)
{
raspberrypi_spi_bus *bus;
int eno;
volatile raspberrypi_spi *regs;
const char *bus_path;
bus = (raspberrypi_spi_bus *) spi_bus_alloc_and_init(sizeof(*bus));
if (bus == NULL) {
return RTEMS_UNSATISFIED;
}
switch (device) {
case raspberrypi_SPI0:
regs = (volatile raspberrypi_spi *) BCM2711_SPI0_BASE;
bus_path = "/dev/spidev0";
break;
case raspberrypi_SPI3:
regs = (volatile raspberrypi_spi *) BCM2711_SPI3_BASE;
bus_path = "/dev/spidev3";
break;
case raspberrypi_SPI4:
regs = (volatile raspberrypi_spi *) BCM2711_SPI4_BASE;
bus_path = "/dev/spidev4";
break;
case raspberrypi_SPI5:
regs = (volatile raspberrypi_spi *) BCM2711_SPI5_BASE;
bus_path = "/dev/spidev5";
break;
case raspberrypi_SPI6:
regs = (volatile raspberrypi_spi *) BCM2711_SPI6_BASE;
bus_path = "/dev/spidev6";
break;
default:
spi_bus_destroy_and_free(&bus->base);
return RTEMS_INVALID_NUMBER;
break;
}
bus->regs = regs;
bus->num_cs = 2;
bus->base.transfer = raspberrypi_spi_transfer;
bus->base.destroy = raspberrypi_spi_destroy;
bus->base.setup = raspberrypi_spi_setup;
bus->base.bits_per_word = 8;
bus->base.max_speed_hz = 250000000;
bus->base.cs = 0;
#ifdef BSP_SPI_USE_INTERRUPTS
bus->irq = BCM2711_IRQ_SPI;
eno = rtems_interrupt_handler_install(
bus->irq,
"SPI",
RTEMS_INTERRUPT_SHARED,
raspberrypi_spi_interrupt,
bus
);
if (eno != RTEMS_SUCCESSFUL) {
return EAGAIN;
}
#endif
eno = spi_bus_register(&bus->base, bus_path);
if (eno != 0) {
spi_bus_destroy_and_free(&bus->base);
return RTEMS_UNSATISFIED;
}
eno = raspberrypi_spi_init_gpio(device);
if (eno != 0) {
spi_bus_destroy_and_free(&bus->base);
return RTEMS_INVALID_NUMBER;
}
return RTEMS_SUCCESSFUL;
}

View File

@@ -0,0 +1,49 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief BSP Startup
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* 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.h>
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
void bsp_start( void )
{
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,
(uintptr_t) bsp_section_nocacheheap_size
);
}

View File

@@ -0,0 +1,55 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief BSP Startup Hooks
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* 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.h>
#include <bsp/irq-generic.h>
#include <bsp/start.h>
#include <rtems/score/cpu.h>
#ifdef BSP_START_ENABLE_EL3_START_SUPPORT
BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
{
/* Do nothing */
}
#endif
BSP_START_TEXT_SECTION void bsp_start_hook_1(void)
{
AArch64_start_set_vector_base();
bsp_start_copy_sections();
raspberrypi_4_setup_mmu_and_cache();
bsp_start_clear_bss();
}

View File

@@ -0,0 +1,87 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Raspberrypi4
*
* @brief This source file contains the default MMU tables and setup.
*/
/*
* Copyright (C) 2022 Mohd Noor Aman
*
*
* 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.h>
#include <bsp/start.h>
#include <bsp/aarch64-mmu.h>
#include <bsp/raspberrypi.h>
#include <libcpu/mmu-vmsav8-64.h>
BSP_START_DATA_SECTION static const aarch64_mmu_config_entry
raspberrypi_4_mmu_config_table[] = {
AARCH64_MMU_DEFAULT_SECTIONS,
{ /* RPI peripheral address */
.begin = (unsigned)RPI_PERIPHERAL_BASE,
.end = (unsigned)RPI_PERIPHERAL_BASE + (unsigned)RPI_PERIPHERAL_SIZE,
.flags = AARCH64_MMU_DEVICE
},
{ /* RPI ARM local registers */
.begin = (unsigned)BCM2711_LOCAL_REGS_BASE,
.end = (unsigned)BCM2711_LOCAL_REGS_BASE + (unsigned)BCM2711_LOCAL_REGS_SIZE,
.flags = AARCH64_MMU_DEVICE
},
{ /* RPI GIC Interface address */
.begin = 0xFF800000U,
.end = 0xFFA00000U,
.flags = AARCH64_MMU_DEVICE
}
};
/*
* Make weak and let the user override.
*/
BSP_START_TEXT_SECTION void
raspberrypi_4_setup_mmu_and_cache( void ) __attribute__ ((weak));
BSP_START_TEXT_SECTION void
raspberrypi_4_setup_mmu_and_cache( void )
{
aarch64_mmu_control *control = &aarch64_mmu_instance;
aarch64_mmu_setup();
aarch64_mmu_setup_translation_table(
control,
&raspberrypi_4_mmu_config_table[ 0 ],
RTEMS_ARRAY_SIZE( raspberrypi_4_mmu_config_table )
);
aarch64_mmu_enable( control );
}

View File

@@ -0,0 +1,73 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64RaspberryPi
*
* @brief Watchdog Driver
*/
/*
* Copyright (C) 2024 Ning Yang
*
* 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/raspberrypi.h>
#include <bsp/watchdog.h>
#define PM_WDOG BCM2835_REG(BCM2711_PM_WDOG)
#define PM_RSTC BCM2835_REG(BCM2711_PM_RSTC)
uint32_t raspberrypi_watchdog_timeout;
void raspberrypi_watchdog_init()
{
raspberrypi_watchdog_timeout = 0;
}
void raspberrypi_watchdog_start(uint32_t timeout_ms)
{
raspberrypi_watchdog_timeout = timeout_ms;
PM_WDOG = BCM2711_PM_PASSWD_MAGIC |
((timeout_ms * 65536 / 1000) & BCM2711_PM_WDOG_MASK);
PM_RSTC &= BCM2711_PM_RSTC_WRCFG_CLR;
PM_RSTC = (BCM2711_PM_PASSWD_MAGIC | BCM2711_PM_RSTC_WRCFG_FULL);
}
void raspberrypi_watchdog_stop()
{
PM_RSTC = BCM2711_PM_PASSWD_MAGIC | BCM2711_PM_RSTC_RESET;
}
void raspberrypi_watchdog_reload()
{
raspberrypi_watchdog_start(raspberrypi_watchdog_timeout);
}
uint32_t raspberrypi_watchdog_get_remaining_time()
{
return (PM_WDOG & BCM2711_PM_WDOG_MASK)*1000/65536;
}

415
bsps/aarch64/shared/cache/cache.c vendored Normal file
View File

@@ -0,0 +1,415 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Shared
*
* @brief AArch64 cache defines and implementation.
*/
/*
* Copyright (C) 2020 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 <rtems.h>
#include <bsp.h>
#include <rtems/score/aarch64-system-registers.h>
#define CPU_DATA_CACHE_ALIGNMENT 64
#define CPU_INSTRUCTION_CACHE_ALIGNMENT 64
#define CPU_CACHE_SUPPORT_PROVIDES_RANGE_FUNCTIONS
#define CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS
#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 )
static inline
void AArch64_data_cache_clean_and_invalidate_line(const void *d_addr)
{
d_addr = AARCH64_CACHE_PREPARE_MVA(d_addr);
__asm__ volatile (
"dc civac, %[d_addr]"
:
: [d_addr] "r" (d_addr)
: "memory"
);
}
static inline void
_CPU_cache_flush_data_range(
const void *d_addr,
size_t n_bytes
)
{
_AARCH64_Data_synchronization_barrier();
if ( n_bytes != 0 ) {
size_t adx = (size_t) AARCH64_CACHE_PREPARE_MVA ( d_addr );
const size_t ADDR_LAST = (size_t) d_addr + n_bytes - 1;
for (; adx <= ADDR_LAST; adx += AARCH64_CACHE_L1_CPU_DATA_ALIGNMENT ) {
/* Store and invalidate the Data cache line */
AArch64_data_cache_clean_and_invalidate_line( (void*)adx );
}
/* Wait for L1 store to complete */
_AARCH64_Data_synchronization_barrier();
}
_AARCH64_Data_synchronization_barrier();
}
static inline void AArch64_data_cache_invalidate_line(const void *d_addr)
{
d_addr = AARCH64_CACHE_PREPARE_MVA(d_addr);
__asm__ volatile (
"dc ivac, %[d_addr]"
:
: [d_addr] "r" (d_addr)
: "memory"
);
}
static inline void
_CPU_cache_invalidate_data_range(
const void *d_addr,
size_t n_bytes
)
{
if ( n_bytes != 0 ) {
size_t adx = (size_t) AARCH64_CACHE_PREPARE_MVA ( d_addr );
const size_t end = (size_t)d_addr + n_bytes -1;
/* Back starting address up to start of a line and invalidate until end */
for (;
adx <= end;
adx += AARCH64_CACHE_L1_CPU_DATA_ALIGNMENT ) {
/* Invalidate the Instruction cache line */
AArch64_data_cache_invalidate_line( (void*)adx );
}
/* Wait for L1 invalidate to complete */
_AARCH64_Data_synchronization_barrier();
}
}
static inline void _CPU_cache_freeze_data(void)
{
/* TODO */
}
static inline void _CPU_cache_unfreeze_data(void)
{
/* TODO */
}
static inline void AArch64_instruction_cache_invalidate_line(const void *i_addr)
{
/* __builtin___clear_cache is explicitly only for instruction cacche */
__builtin___clear_cache((void *)i_addr, ((char *)i_addr) + sizeof(void*) - 1);
}
static inline void
_CPU_cache_invalidate_instruction_range( const void *i_addr, size_t n_bytes)
{
if ( n_bytes != 0 ) {
__builtin___clear_cache((void *)i_addr, ((char *)i_addr) + n_bytes - 1);
}
_AARCH64_Instruction_synchronization_barrier();
}
static inline void _CPU_cache_freeze_instruction(void)
{
/* TODO */
}
static inline void _CPU_cache_unfreeze_instruction(void)
{
/* TODO */
}
static inline uint64_t AArch64_get_ccsidr_for_level(
uint64_t level, bool instruction
)
{
uint64_t csselr = AARCH64_CSSELR_EL1_LEVEL(level - 1);
csselr |= instruction ? AARCH64_CSSELR_EL1_IND : 0;
_AArch64_Write_csselr_el1(csselr);
_AARCH64_Instruction_synchronization_barrier();
return _AArch64_Read_ccsidr_el1();
}
static inline uint64_t
AArch64_ccsidr_get_line_power(uint64_t ccsidr)
{
return AARCH64_CCSIDR_EL1_LINESIZE_GET(ccsidr) + 4;
}
static inline uint64_t
AArch64_ccsidr_get_associativity(uint64_t ccsidr)
{
return AARCH64_CCSIDR_EL1_ASSOCIATIVITY_GET_0(ccsidr) + 1;
}
static inline uint64_t
AArch64_ccsidr_get_num_sets(uint64_t ccsidr)
{
return AARCH64_CCSIDR_EL1_NUMSETS_GET_0(ccsidr) + 1;
}
static inline void
AArch64_data_cache_clean_and_invalidate_level(uint64_t level)
{
uint64_t ccsidr;
uint64_t line_power;
uint64_t associativity;
uint64_t way;
uint64_t way_shift;
ccsidr = AArch64_get_ccsidr_for_level(level, false);
line_power = AArch64_ccsidr_get_line_power(ccsidr);
associativity = AArch64_ccsidr_get_associativity(ccsidr);
way_shift = __builtin_clz(associativity - 1);
for (way = 0; way < associativity; ++way) {
uint64_t num_sets = AArch64_ccsidr_get_num_sets(ccsidr);
uint64_t set;
for (set = 0; set < num_sets; ++set) {
uint64_t set_and_way = (way << way_shift)
| (set << line_power)
| ((level - 1) << 1);
__asm__ volatile (
"dc cisw, %[set_and_way]"
:
: [set_and_way] "r" (set_and_way)
: "memory"
);
}
}
}
static inline
uint64_t AArch64_clidr_get_cache_type(uint64_t clidr, uint64_t level)
{
return (clidr >> (3 * level)) & 0x7;
}
static inline uint64_t AArch64_clidr_get_level_of_coherency(uint64_t clidr)
{
return AARCH64_CLIDR_EL1_LOC_GET(clidr);
}
static inline void AArch64_data_cache_clean_and_invalidate_all_levels(void)
{
uint64_t clidr = _AArch64_Read_clidr_el1();
uint64_t loc = AArch64_clidr_get_level_of_coherency(clidr);
uint64_t level = 0;
for (level = 1; level <= loc; ++level) {
/* Assume that all levels have a data cache */
AArch64_data_cache_clean_and_invalidate_level(level);
}
}
static inline void _CPU_cache_flush_entire_data(void)
{
rtems_interrupt_level isr_level;
rtems_interrupt_local_disable(isr_level);
_AARCH64_Data_synchronization_barrier();
AArch64_data_cache_clean_and_invalidate_all_levels();
_AARCH64_Data_synchronization_barrier();
rtems_interrupt_local_enable(isr_level);
}
static inline void AArch64_cache_invalidate_level(uint64_t level)
{
uint64_t ccsidr;
uint64_t line_power;
uint64_t associativity;
uint64_t way;
uint64_t way_shift;
ccsidr = AArch64_get_ccsidr_for_level(level, false);
line_power = AArch64_ccsidr_get_line_power(ccsidr);
associativity = AArch64_ccsidr_get_associativity(ccsidr);
way_shift = __builtin_clz(associativity - 1);
for (way = 0; way < associativity; ++way) {
uint64_t num_sets = AArch64_ccsidr_get_num_sets(ccsidr);
uint64_t set;
for (set = 0; set < num_sets; ++set) {
uint64_t set_and_way = (way << way_shift)
| (set << line_power)
| ((level - 1) << 1);
__asm__ volatile (
"dc isw, %[set_and_way]"
:
: [set_and_way] "r" (set_and_way)
: "memory"
);
}
}
}
static inline void AArch64_data_cache_invalidate_all_levels(void)
{
uint64_t clidr = _AArch64_Read_clidr_el1();
uint64_t loc = AArch64_clidr_get_level_of_coherency(clidr);
uint64_t level = 0;
for (level = 1; level <= loc; ++level) {
/* Assume that all levels have a data cache */
AArch64_cache_invalidate_level(level);
}
}
static inline void _CPU_cache_invalidate_entire_data(void)
{
rtems_interrupt_level isr_level;
rtems_interrupt_local_disable(isr_level);
_AARCH64_Data_synchronization_barrier();
AArch64_data_cache_invalidate_all_levels();
_AARCH64_Data_synchronization_barrier();
rtems_interrupt_local_enable(isr_level);
}
static inline void _CPU_cache_enable_data(void)
{
rtems_interrupt_level isr_level;
uint64_t sctlr;
rtems_interrupt_local_disable(isr_level);
sctlr = _AArch64_Read_sctlr_el1();
sctlr |= AARCH64_SCTLR_EL1_C;
_AArch64_Write_sctlr_el1(sctlr);
rtems_interrupt_local_enable(isr_level);
}
static RTEMS_NO_RETURN inline void _CPU_cache_disable_data(void)
{
_Internal_error( INTERNAL_ERROR_CANNOT_DISABLE_DATA_CACHE );
}
static inline void _CPU_cache_invalidate_entire_instruction(void)
{
/*
* There is no way to manage branch prediction in AArch64. See D4.4.12 in
* the ARM Architecture Reference Manual, ARMv8, for ARMv8-A architecture
* profile (ARM DDI 0487D.a).
*/
__asm__ volatile (
#ifdef RTEMS_SMP
/*
* Invalidate all instruction caches up to
* Point of Unification, Inner Shareable.
*/
"ic ialluis\n"
#else
/* Invalidate all instruction caches up to Point of Unification */
"ic iallu\n"
#endif
"isb"
:
:
: "memory"
);
}
static inline void _CPU_cache_enable_instruction(void)
{
rtems_interrupt_level isr_level;
uint64_t sctlr;
rtems_interrupt_local_disable(isr_level);
sctlr = _AArch64_Read_sctlr_el1();
sctlr |= AARCH64_SCTLR_EL1_I;
_AArch64_Write_sctlr_el1(sctlr);
rtems_interrupt_local_enable(isr_level);
}
static inline void _CPU_cache_disable_instruction(void)
{
rtems_interrupt_level isr_level;
uint64_t sctlr;
rtems_interrupt_local_disable(isr_level);
sctlr = _AArch64_Read_sctlr_el1();
sctlr &= ~AARCH64_SCTLR_EL1_I;
_AArch64_Write_sctlr_el1(sctlr);
rtems_interrupt_local_enable(isr_level);
}
static inline size_t AArch64_get_cache_size(
uint64_t level,
bool instruction
)
{
rtems_interrupt_level isr_level;
uint64_t clidr;
uint64_t loc;
uint64_t ccsidr;
clidr = _AArch64_Read_clidr_el1();
loc = AArch64_clidr_get_level_of_coherency(clidr);
if (level > loc) {
return 0;
}
rtems_interrupt_local_disable(isr_level);
ccsidr = AArch64_get_ccsidr_for_level(level, instruction);
rtems_interrupt_local_enable(isr_level);
return (1U << (AArch64_ccsidr_get_line_power(ccsidr)+4))
* AArch64_ccsidr_get_associativity(ccsidr)
* AArch64_ccsidr_get_num_sets(ccsidr);
}
static inline size_t _CPU_cache_get_data_cache_size(uint64_t level)
{
return AArch64_get_cache_size(level, false);
}
static inline size_t _CPU_cache_get_instruction_cache_size(uint64_t level)
{
return AArch64_get_cache_size(level, true);
}
#include "../../shared/cache/cacheimpl.h"

View File

@@ -0,0 +1,116 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Shared
*
* @brief AArch64-specific ARM GPT system register accessors.
*/
/*
* Copyright (C) 2020 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 <dev/clock/arm-generic-timer.h>
#include <bsp/irq.h>
uint64_t arm_gt_clock_get_compare_value(void)
{
uint64_t val;
__asm__ volatile (
#ifdef AARCH64_GENERIC_TIMER_USE_VIRTUAL
"mrs %[val], cntv_cval_el0"
#elif defined(AARCH64_GENERIC_TIMER_USE_PHYSICAL_SECURE)
"mrs %[val], cntps_cval_el1"
#else
"mrs %[val], cntp_cval_el0"
#endif
: [val] "=&r" (val)
);
return val;
}
void arm_gt_clock_set_compare_value(uint64_t cval)
{
__asm__ volatile (
#ifdef AARCH64_GENERIC_TIMER_USE_VIRTUAL
"msr cntv_cval_el0, %[cval]"
#elif defined(AARCH64_GENERIC_TIMER_USE_PHYSICAL_SECURE)
"msr cntps_cval_el1, %[cval]"
#else
"msr cntp_cval_el0, %[cval]"
#endif
:
: [cval] "r" (cval)
);
}
uint64_t arm_gt_clock_get_count(void)
{
uint64_t val;
__asm__ volatile (
#ifdef AARCH64_GENERIC_TIMER_USE_VIRTUAL
"mrs %[val], cntvct_el0"
#else
"mrs %[val], cntpct_el0"
#endif
: [val] "=&r" (val)
);
return val;
}
void arm_gt_clock_set_control(uint32_t ctl)
{
__asm__ volatile (
#ifdef AARCH64_GENERIC_TIMER_USE_VIRTUAL
"msr cntv_ctl_el0, %[ctl]"
#elif defined(AARCH64_GENERIC_TIMER_USE_PHYSICAL_SECURE)
"msr cntps_ctl_el1, %[ctl]"
#else
"msr cntp_ctl_el0, %[ctl]"
#endif
:
: [ctl] "r" (ctl)
);
}
void arm_generic_timer_get_config( uint32_t *frequency, uint32_t *irq )
{
uint64_t val;
__asm__ volatile (
"mrs %[val], cntfrq_el0"
: [val] "=&r" (val)
);
*frequency = val;
#ifdef ARM_GENERIC_TIMER_USE_VIRTUAL
*irq = BSP_TIMER_VIRT_PPI;
#elif defined(AARCH64_GENERIC_TIMER_USE_PHYSICAL_SECURE)
*irq = BSP_TIMER_PHYS_S_PPI;
#else
*irq = BSP_TIMER_PHYS_NS_PPI;
#endif
}

View File

@@ -0,0 +1,23 @@
/**
* @file
*
* @ingroup RTEMSImplDoxygen
*
* @brief This header file defines BSP-specific groups.
*/
/**
* @defgroup RTEMSBSPsAArch64 AArch64
*
* @ingroup RTEMSBSPs
*
* @brief This group contains AArch64 Board Support Packages.
*/
/**
* @defgroup RTEMSBSPsAArch64Shared Shared
*
* @ingroup RTEMSBSPsAArch64
*
* @brief This group contains support shared by AArch64 Board Support Packages.
*/

View File

@@ -0,0 +1,319 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup aarch64_start
*
* @brief AArch64 MMU configuration.
*/
/*
* 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 <bsp/fatal.h>
#include <bsp/linker-symbols.h>
#include <bsp/start.h>
#include <rtems/score/aarch64-system-registers.h>
#include <rtems/score/assert.h>
aarch64_mmu_control aarch64_mmu_instance = {
.ttb = (uint64_t *) bsp_translation_table_base,
/* One page table is used for the initial setup at the base */
.used_page_tables = 1
};
/* AArch64 uses levels 0, 1, 2, and 3 */
#define MMU_MAX_SUBTABLE_PAGE_BITS ( 3 * MMU_BITS_PER_LEVEL + MMU_PAGE_BITS )
/* setup straight mapped block entries */
BSP_START_TEXT_SECTION static inline void aarch64_mmu_page_table_set_blocks(
uint64_t *page_table,
uint64_t base,
uint32_t bits_offset,
uint64_t default_attr
)
{
uint64_t page_flag = 0;
if ( bits_offset == MMU_PAGE_BITS ) {
page_flag = MMU_DESC_TYPE_PAGE;
}
for ( uint64_t i = 0; i < ( 1 << MMU_BITS_PER_LEVEL ); i++ ) {
page_table[i] = base | ( i << bits_offset );
page_table[i] |= default_attr | page_flag;
}
}
BSP_START_TEXT_SECTION static inline uint64_t *
aarch64_mmu_page_table_alloc( aarch64_mmu_control *control )
{
size_t used_page_tables = control->used_page_tables;
if ( used_page_tables >= AARCH64_MMU_TRANSLATION_TABLE_PAGES ) {
return NULL;
}
control->used_page_tables = used_page_tables + 1;
return (uint64_t *)
( (uintptr_t) control->ttb + ( used_page_tables << MMU_PAGE_BITS ) );
}
BSP_START_TEXT_SECTION static inline uintptr_t aarch64_mmu_get_index(
uintptr_t root_address,
uintptr_t vaddr,
uint32_t shift
)
{
uintptr_t mask = ( 1 << ( MMU_BITS_PER_LEVEL + 1 ) ) - 1;
return ( ( vaddr - root_address ) >> shift ) & mask;
}
BSP_START_TEXT_SECTION static uint64_t *
aarch64_mmu_get_sub_table(
aarch64_mmu_control *control,
uint64_t *page_table_entry,
uintptr_t physical_root_address,
uint32_t shift
)
{
/* check if the index already has a page table */
if ( ( *page_table_entry & MMU_DESC_TYPE_TABLE ) == MMU_DESC_TYPE_TABLE ) {
/* extract page table address */
uint64_t table_pointer = *page_table_entry & MMU_DESC_PAGE_TABLE_MASK;
/* This cast should be safe since the address was inserted in this mode */
return (uint64_t *) (uintptr_t) table_pointer;
}
/* allocate new page table and set block */
uint64_t *sub_table = aarch64_mmu_page_table_alloc( control );
if ( sub_table == NULL ) {
return NULL;
}
aarch64_mmu_page_table_set_blocks(
sub_table,
physical_root_address,
shift - MMU_BITS_PER_LEVEL,
*page_table_entry & ~MMU_DESC_PAGE_TABLE_MASK
);
*page_table_entry = (uintptr_t) sub_table;
*page_table_entry |= MMU_DESC_TYPE_TABLE | MMU_DESC_VALID;
return sub_table;
}
BSP_START_TEXT_SECTION static inline rtems_status_code aarch64_mmu_map_block(
aarch64_mmu_control *control,
uint64_t *page_table,
uint64_t root_address,
uint64_t addr,
uint64_t size,
int8_t level,
uint64_t flags
)
{
uint32_t shift = ( 2 - level ) * MMU_BITS_PER_LEVEL + MMU_PAGE_BITS;
uint64_t granularity = 1LLU << shift;
do {
uintptr_t index = aarch64_mmu_get_index( root_address, addr, shift );
uint64_t block_bottom = RTEMS_ALIGN_DOWN( addr, granularity );
uint64_t chunk_size = granularity;
/* check for perfect block match */
if ( block_bottom == addr ) {
if ( size >= chunk_size ) {
/* level -1 can't contain block descriptors, fall through to subtable */
if ( level != -1 ) {
uint64_t page_flag = 0;
if ( level == 2 ) {
page_flag = MMU_DESC_TYPE_PAGE;
}
/* when page_flag is set the last level must be a page descriptor */
if ( page_flag || ( page_table[index] & MMU_DESC_TYPE_TABLE ) != MMU_DESC_TYPE_TABLE ) {
/* no sub-table, apply block properties */
page_table[index] = addr | flags | page_flag;
size -= chunk_size;
addr += chunk_size;
continue;
}
}
} else {
/*
* Block starts on a boundary, but is short.
*
* The size is >= MMU_PAGE_SIZE since
* aarch64_mmu_set_translation_table_entries() aligns the memory region
* to page boundaries. The minimum chunk_size is MMU_PAGE_SIZE.
*/
_Assert( level < 2 );
chunk_size = size;
}
} else {
uintptr_t block_top = RTEMS_ALIGN_UP( addr, granularity );
chunk_size = block_top - addr;
if ( chunk_size > size ) {
chunk_size = size;
}
}
/* Deal with any subtable modification */
uint64_t new_root_address = root_address + index * granularity;
rtems_status_code sc;
uint64_t *sub_table = aarch64_mmu_get_sub_table(
control,
&page_table[index],
new_root_address,
shift
);
if ( sub_table == NULL ) {
return RTEMS_TOO_MANY;
}
sc = aarch64_mmu_map_block(
control,
sub_table,
new_root_address,
addr,
chunk_size,
level + 1,
flags
);
if ( sc != RTEMS_SUCCESSFUL ) {
return sc;
}
size -= chunk_size;
addr += chunk_size;
} while ( size > 0 );
return RTEMS_SUCCESSFUL;
}
/* Get the maximum number of bits supported by this hardware */
BSP_START_TEXT_SECTION static inline uint64_t
aarch64_mmu_get_cpu_pa_bits( void )
{
#ifdef AARCH64_MMU_PHYSICAL_ADDRESS_RANGE_BITS
return AARCH64_MMU_PHYSICAL_ADDRESS_RANGE_BITS;
#else
uint64_t id_reg = _AArch64_Read_id_aa64mmfr0_el1();
switch ( AARCH64_ID_AA64MMFR0_EL1_PARANGE_GET( id_reg ) ) {
case 0:
return 32;
case 1:
return 36;
case 2:
return 40;
case 3:
return 42;
case 4:
return 44;
case 5:
return 48;
case 6:
return 52;
default:
return 48;
}
return 48;
#endif
}
BSP_START_TEXT_SECTION rtems_status_code
aarch64_mmu_set_translation_table_entries(
aarch64_mmu_control *control,
const aarch64_mmu_config_entry *config
)
{
uint64_t max_mappable = 1LLU << aarch64_mmu_get_cpu_pa_bits();
/* Align to page boundaries */
uintptr_t begin = RTEMS_ALIGN_DOWN( config->begin, MMU_PAGE_SIZE );
uintptr_t end = RTEMS_ALIGN_UP( config->end, MMU_PAGE_SIZE );
uintptr_t size = end - begin;
if ( config->begin == config->end ) {
return RTEMS_SUCCESSFUL;
}
if ( begin >= max_mappable ) {
return RTEMS_INVALID_ADDRESS;
}
if ( size > max_mappable - begin ) {
return RTEMS_INVALID_SIZE;
}
return aarch64_mmu_map_block(
control,
control->ttb,
0x0,
begin,
size,
-1,
config->flags
);
}
BSP_START_TEXT_SECTION void aarch64_mmu_setup_translation_table(
aarch64_mmu_control *control,
const aarch64_mmu_config_entry *config_table,
size_t config_count
)
{
size_t i;
aarch64_mmu_page_table_set_blocks(
control->ttb,
(uintptr_t) NULL,
MMU_MAX_SUBTABLE_PAGE_BITS,
0
);
/* Configure entries required for each memory section */
for ( i = 0; i < config_count; ++i ) {
rtems_status_code sc;
sc = aarch64_mmu_set_translation_table_entries( control, &config_table[i] );
if ( sc != RTEMS_SUCCESSFUL ) {
bsp_fatal( AARCH64_FATAL_MMU_CANNOT_MAP_BLOCK );
}
}
}

View File

@@ -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;
}

View File

@@ -0,0 +1,78 @@
/* 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
)
{
aarch64_mmu_config_entry config = {
.begin = addr,
.end = addr + size,
.flags = flags
};
rtems_status_code sc;
ISR_Level level;
aarch64_mmu_control *control = &aarch64_mmu_instance;
/*
* Disable interrupts so they don't run while the MMU tables are being
* modified.
*/
_ISR_Local_disable( level );
sc = aarch64_mmu_set_translation_table_entries(
control,
&config
);
_AARCH64_Data_synchronization_barrier();
__asm__ volatile(
"tlbi vmalle1\n"
);
_AARCH64_Data_synchronization_barrier();
_AARCH64_Instruction_synchronization_barrier();
_ISR_Local_enable( level );
return sc;
}

View File

@@ -0,0 +1,87 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Shared
*
* @brief SMP startup and interop code.
*/
/*
* 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 <rtems/score/smpimpl.h>
#include <bsp/irq.h>
static void bsp_inter_processor_interrupt( void *arg )
{
_SMP_Inter_processor_interrupt_handler( _Per_CPU_Get() );
}
uint32_t _CPU_SMP_Initialize( void )
{
return arm_gic_irq_processor_count();
}
static rtems_interrupt_entry aarch64_ipi_entry;
void _CPU_SMP_Finalize_initialization( uint32_t cpu_count )
{
rtems_status_code sc;
rtems_interrupt_entry_initialize(
&aarch64_ipi_entry,
bsp_inter_processor_interrupt,
NULL,
"IPI"
);
sc = rtems_interrupt_entry_install(
ARM_GIC_IRQ_SGI_0,
RTEMS_INTERRUPT_UNIQUE,
&aarch64_ipi_entry
);
_Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL );
}
void _CPU_SMP_Prepare_start_multitasking( void )
{
/* Do nothing */
}
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
{
arm_gic_trigger_sgi(
ARM_GIC_IRQ_SGI_0,
1U << target_processor_index
);
}
uint32_t _CPU_SMP_Get_current_processor( void )
{
return _Per_CPU_Get_index( _CPU_Get_current_per_CPU_control() );
}

View File

@@ -0,0 +1,443 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup bsp_linker
*
* @brief Linker command base file.
*/
/*
* Copyright (C) 2020 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.
*/
ENTRY (_start)
STARTUP (start.o)
/*
* Global symbols that may be defined externally
*/
bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 16;
bsp_stack_exception_size = DEFINED (bsp_stack_exception_size) ? bsp_stack_exception_size : 0;
bsp_stack_exception_size = ALIGN (bsp_stack_exception_size, bsp_stack_align);
bsp_vector_table_size = DEFINED (bsp_vector_table_size) ? bsp_vector_table_size : 64;
bsp_section_xbarrier_align = DEFINED (bsp_section_xbarrier_align) ? bsp_section_xbarrier_align : 1;
bsp_section_robarrier_align = DEFINED (bsp_section_robarrier_align) ? bsp_section_robarrier_align : 1;
bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1;
bsp_stack_hyp_size = DEFINED (bsp_stack_hyp_size) ? bsp_stack_hyp_size : 0;
bsp_stack_hyp_size = ALIGN (bsp_stack_hyp_size, bsp_stack_align);
MEMORY {
UNEXPECTED_SECTIONS : ORIGIN = 0xffffffffffffffff, LENGTH = 0
}
SECTIONS {
.start : ALIGN_WITH_INPUT {
bsp_section_start_begin = .;
KEEP (*(.bsp_start_text))
KEEP (*(.bsp_start_data))
bsp_section_start_end = .;
} > REGION_START AT > REGION_START
bsp_section_start_size = bsp_section_start_end - bsp_section_start_begin;
.xbarrier : ALIGN_WITH_INPUT {
. = ALIGN (bsp_section_xbarrier_align);
} > REGION_VECTOR AT > REGION_VECTOR
.text : ALIGN_WITH_INPUT {
bsp_section_text_begin = .;
*(.text.unlikely .text.*_unlikely)
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
} > REGION_TEXT AT > REGION_TEXT_LOAD
.init : ALIGN_WITH_INPUT {
KEEP (*(.init))
} > REGION_TEXT AT > REGION_TEXT_LOAD
.fini : ALIGN_WITH_INPUT {
KEEP (*(.fini))
bsp_section_text_end = .;
} > REGION_TEXT AT > REGION_TEXT_LOAD
bsp_section_text_size = bsp_section_text_end - bsp_section_text_begin;
bsp_section_text_load_begin = LOADADDR (.text);
bsp_section_text_load_end = bsp_section_text_load_begin + bsp_section_text_size;
.robarrier : ALIGN_WITH_INPUT {
. = ALIGN (bsp_section_robarrier_align);
} > REGION_RODATA AT > REGION_RODATA
.rodata : ALIGN_WITH_INPUT {
bsp_section_rodata_begin = .;
*(.rodata .rodata.* .gnu.linkonce.r.*)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.rodata1 : ALIGN_WITH_INPUT {
*(.rodata1)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.ARM.extab : ALIGN_WITH_INPUT {
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.ARM.exidx : ALIGN_WITH_INPUT {
__exidx_start = .;
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
__exidx_end = .;
} > REGION_RODATA AT > REGION_RODATA_LOAD
.eh_frame : ALIGN_WITH_INPUT {
KEEP (*(.eh_frame))
} > REGION_RODATA AT > REGION_RODATA_LOAD
.gcc_except_table : ALIGN_WITH_INPUT {
*(.gcc_except_table .gcc_except_table.*)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.tdata : ALIGN_WITH_INPUT {
_TLS_Data_begin = .;
*(.tdata .tdata.* .gnu.linkonce.td.*)
_TLS_Data_end = .;
} > REGION_RODATA AT > REGION_RODATA_LOAD
.tbss : ALIGN_WITH_INPUT {
_TLS_BSS_begin = .;
*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
_TLS_BSS_end = .;
} > REGION_RODATA AT > REGION_RODATA_LOAD
_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));
.preinit_array : ALIGN_WITH_INPUT {
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
} > REGION_RODATA AT > REGION_RODATA_LOAD
.init_array : ALIGN_WITH_INPUT {
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
PROVIDE_HIDDEN (__init_array_end = .);
} > REGION_RODATA AT > REGION_RODATA_LOAD
.fini_array : ALIGN_WITH_INPUT {
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
PROVIDE_HIDDEN (__fini_array_end = .);
} > REGION_RODATA AT > REGION_RODATA_LOAD
.data.rel.ro : ALIGN_WITH_INPUT {
*(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
*(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.jcr : ALIGN_WITH_INPUT {
KEEP (*(.jcr))
} > REGION_RODATA AT > REGION_RODATA_LOAD
.interp : ALIGN_WITH_INPUT {
*(.interp)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.note.gnu.build-id : ALIGN_WITH_INPUT {
*(.note.gnu.build-id)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.hash : ALIGN_WITH_INPUT {
*(.hash)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.gnu.hash : ALIGN_WITH_INPUT {
*(.gnu.hash)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.dynsym : ALIGN_WITH_INPUT {
*(.dynsym)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.dynstr : ALIGN_WITH_INPUT {
*(.dynstr)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.gnu.version : ALIGN_WITH_INPUT {
*(.gnu.version)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.gnu.version_d : ALIGN_WITH_INPUT {
*(.gnu.version_d)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.gnu.version_r : ALIGN_WITH_INPUT {
*(.gnu.version_r)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.rel.dyn : ALIGN_WITH_INPUT {
*(.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.bss .rel.bss.* .rel.gnu.linkonce.b.*)
PROVIDE_HIDDEN (__rel_iplt_start = .);
*(.rel.iplt)
PROVIDE_HIDDEN (__rel_iplt_end = .);
PROVIDE_HIDDEN (__rela_iplt_start = .);
PROVIDE_HIDDEN (__rela_iplt_end = .);
} > REGION_RODATA AT > REGION_RODATA_LOAD
.rela.dyn : ALIGN_WITH_INPUT {
*(.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.bss .rela.bss.* .rela.gnu.linkonce.b.*)
*(.rela.rtemsroset*)
*(.rela.rtemsrwset*)
PROVIDE_HIDDEN (__rel_iplt_start = .);
PROVIDE_HIDDEN (__rel_iplt_end = .);
PROVIDE_HIDDEN (__rela_iplt_start = .);
*(.rela.iplt)
PROVIDE_HIDDEN (__rela_iplt_end = .);
} > REGION_RODATA AT > REGION_RODATA_LOAD
.rel.plt : ALIGN_WITH_INPUT {
*(.rel.plt)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.rela.plt : ALIGN_WITH_INPUT {
*(.rela.plt)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.plt : ALIGN_WITH_INPUT {
*(.plt)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.iplt : ALIGN_WITH_INPUT {
*(.iplt)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.dynamic : ALIGN_WITH_INPUT {
*(.dynamic)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.tm_clone_table : ALIGN_WITH_INPUT {
*(.tm_clone_table)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.got : ALIGN_WITH_INPUT {
*(.got.plt) *(.igot.plt) *(.got) *(.igot)
} > REGION_RODATA AT > REGION_RODATA_LOAD
.rtemsroset : ALIGN_WITH_INPUT {
/* Special FreeBSD linker set sections */
__start_set_sysctl_set = .;
*(set_sysctl_*);
__stop_set_sysctl_set = .;
*(set_domain_*);
*(set_pseudo_*);
KEEP (*(SORT(.rtemsroset.*)))
bsp_section_rodata_end = .;
} > REGION_RODATA AT > REGION_RODATA_LOAD
bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin;
bsp_section_rodata_load_begin = LOADADDR (.rodata);
bsp_section_rodata_load_end = bsp_section_rodata_load_begin + bsp_section_rodata_size;
.rwbarrier : ALIGN_WITH_INPUT {
. = ALIGN (bsp_section_rwbarrier_align);
} > REGION_DATA AT > REGION_DATA
.vector : ALIGN_WITH_INPUT {
bsp_section_vector_begin = .;
. = . + DEFINED (bsp_vector_table_in_start_section) ? 0 : bsp_vector_table_size;
bsp_section_vector_end = .;
} > REGION_VECTOR AT > REGION_VECTOR
bsp_section_vector_size = bsp_section_vector_end - bsp_section_vector_begin;
bsp_vector_table_begin = DEFINED (bsp_vector_table_in_start_section) ? bsp_section_start_begin : bsp_section_vector_begin;
bsp_vector_table_end = bsp_vector_table_begin + bsp_vector_table_size;
.fast_text : ALIGN_WITH_INPUT {
bsp_section_fast_text_begin = .;
*(.bsp_fast_text)
bsp_section_fast_text_end = .;
} > REGION_FAST_TEXT AT > REGION_FAST_TEXT_LOAD
bsp_section_fast_text_size = bsp_section_fast_text_end - bsp_section_fast_text_begin;
bsp_section_fast_text_load_begin = LOADADDR (.fast_text);
bsp_section_fast_text_load_end = bsp_section_fast_text_load_begin + bsp_section_fast_text_size;
.fast_data : ALIGN_WITH_INPUT {
bsp_section_fast_data_begin = .;
*(.bsp_fast_data)
bsp_section_fast_data_end = .;
} > REGION_FAST_DATA AT > REGION_FAST_DATA_LOAD
bsp_section_fast_data_size = bsp_section_fast_data_end - bsp_section_fast_data_begin;
bsp_section_fast_data_load_begin = LOADADDR (.fast_data);
bsp_section_fast_data_load_end = bsp_section_fast_data_load_begin + bsp_section_fast_data_size;
.data : ALIGN_WITH_INPUT {
bsp_section_data_begin = .;
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
} > REGION_DATA AT > REGION_DATA_LOAD
.data1 : ALIGN_WITH_INPUT {
*(.data1)
} > REGION_DATA AT > REGION_DATA_LOAD
.rtemsrwset : ALIGN_WITH_INPUT {
KEEP (*(SORT(.rtemsrwset.*)))
bsp_section_data_end = .;
} > REGION_DATA AT > REGION_DATA_LOAD
bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
bsp_section_data_load_begin = LOADADDR (.data);
bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
.bss : ALIGN_WITH_INPUT {
bsp_section_bss_begin = .;
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
bsp_section_bss_end = .;
} > REGION_BSS AT > REGION_BSS
bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
.rtemsstack (NOLOAD) : ALIGN_WITH_INPUT {
bsp_section_rtemsstack_begin = .;
*(SORT_BY_ALIGNMENT (SORT_BY_NAME (.rtemsstack*)))
bsp_section_rtemsstack_end = .;
} > 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 = .;
*(SORT_BY_NAME (SORT_BY_ALIGNMENT (.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
* contains the RTEMS work space and heap.
*/
bsp_section_work_begin = .;
. += ORIGIN (REGION_WORK) + LENGTH (REGION_WORK) - ABSOLUTE (.);
bsp_section_work_end = .;
} > REGION_WORK AT > REGION_WORK
bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
.stack : ALIGN_WITH_INPUT {
/*
* The stack section will occupy the remaining REGION_STACK region and may
* contain the task stacks. Depending on the region distribution this
* section may be of zero size.
*/
bsp_section_stack_begin = .;
. += ORIGIN (REGION_STACK) + LENGTH (REGION_STACK) - ABSOLUTE (.);
bsp_section_stack_end = .;
} > REGION_STACK AT > REGION_STACK
bsp_section_stack_size = bsp_section_stack_end - bsp_section_stack_begin;
.nocache : ALIGN_WITH_INPUT {
bsp_section_nocache_begin = .;
*(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_nocache*)))
bsp_section_nocache_end = .;
} > REGION_NOCACHE AT > REGION_NOCACHE_LOAD
bsp_section_nocache_size = bsp_section_nocache_end - bsp_section_nocache_begin;
bsp_section_nocache_load_begin = LOADADDR (.nocache);
bsp_section_nocache_load_end = bsp_section_nocache_load_begin + bsp_section_nocache_size;
.nocachenoload (NOLOAD) : ALIGN_WITH_INPUT {
bsp_section_nocachenoload_begin = .;
*(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_noload_nocache*)))
bsp_section_nocacheheap_begin = .;
. += ORIGIN (REGION_NOCACHE) + LENGTH (REGION_NOCACHE) - ABSOLUTE (.);
bsp_section_nocacheheap_end = .;
bsp_section_nocachenoload_end = .;
} > REGION_NOCACHE AT > REGION_NOCACHE
bsp_section_nocacheheap_size = bsp_section_nocacheheap_end - bsp_section_nocacheheap_begin;
bsp_section_nocachenoload_size = bsp_section_nocachenoload_end - bsp_section_nocachenoload_begin;
/* FIXME */
RamBase = ORIGIN (REGION_WORK);
RamSize = LENGTH (REGION_WORK);
RamEnd = RamBase + RamSize;
WorkAreaBase = bsp_section_work_begin;
HeapSize = 0;
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1. */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions. */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2. */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2. */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions. */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* DWARF 3. */
.debug_pubtypes 0 : { *(.debug_pubtypes) }
.debug_ranges 0 : { *(.debug_ranges) }
/* DWARF 5. */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.debug_sup 0 : { *(.debug_sup) }
.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }
.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
/* Addition to let linker know about custom section for GDB pretty-printing support. */
.debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
/*
* This is a RTEMS specific section to catch all unexpected input
* sections. In case you get an error like
* "section `.unexpected_sections' will not fit in region
* `UNEXPECTED_SECTIONS'"
* you have to figure out the offending input section and add it to the
* appropriate output section definition above.
*/
.unexpected_sections : { *(*) } > UNEXPECTED_SECTIONS
}

View File

@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Shared
*
* @brief This source file contains the
* _AArch64_Get_current_processor_for_system_start() default implementation
* using the MPIDR_EL1.
*/
/*
* Copyright (C) 2024 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/asm.h>
FUNCTION_ENTRY(_AArch64_Get_current_processor_for_system_start)
/* Return the affinity level 0 reported by the MPIDR_EL1 */
mrs x0, mpidr_el1
and x0, x0, #0xff
ret
FUNCTION_END(_AArch64_Get_current_processor_for_system_start)

View File

@@ -0,0 +1,346 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64Shared
*
* @brief Boot and system start code.
*/
/*
* Copyright (C) 2020 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 <rtems/asm.h>
#include <rtems/score/percpu.h>
#include <bspopts.h>
/* Global symbols */
.globl _start
.section ".bsp_start_text", "ax"
/* Start entry */
_start:
/*
* We do not save the context since we do not return to the boot
* loader but preserve x1 and x2 to allow access to bootloader parameters
*/
#ifndef BSP_START_NEEDS_REGISTER_INITIALIZATION
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
mov x3, XZR
mov x4, XZR
mov x5, XZR
mov x6, XZR
mov x7, XZR
mov x8, XZR
mov x9, XZR
mov x10, XZR
mov x11, XZR
mov x12, XZR
mov x13, XZR
mov x14, XZR
mov x15, XZR
mov x16, XZR
mov x17, XZR
mov x18, XZR
mov x19, XZR
mov x20, XZR
mov x21, XZR
mov x22, XZR
mov x23, XZR
mov x24, XZR
mov x25, XZR
mov x26, XZR
mov x27, XZR
mov x28, XZR
mov x29, XZR
mov x30, XZR
#ifdef AARCH64_MULTILIB_VFP
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
#if defined(RTEMS_DEBUG)
/* Enable Stack alignment checking */
orr x0, x0, #(1<<3)
#endif
msr SCTLR_EL1, x0
#if defined(BSP_START_ENABLE_EL2_START_SUPPORT) || \
defined(BSP_START_ENABLE_EL3_START_SUPPORT)
mrs x0, CurrentEL
cmp x0, #(1<<2)
b.eq .L_el1_start
#endif
#if defined(BSP_START_ENABLE_EL3_START_SUPPORT)
cmp x0, #(2<<2)
b.eq .L_el2_start
.L_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 */
msr HCR_EL2, XZR
msr SCTLR_EL2, XZR
/* Set EL2 Execution state via SCR_EL3 */
mrs x0, SCR_EL3
/* Set EL2 to AArch64 */
orr x0, x0, #(1<<10)
/* Set EL1 to NS */
orr x0, x0, #1
msr SCR_EL3, x0
/* set EL2h mode for eret */
mov x0, #0b01001
msr SPSR_EL3, x0
/* Set EL2 entry point */
adr x0, .L_el2_start
msr ELR_EL3, x0
eret
#endif
#if defined(BSP_START_ENABLE_EL2_START_SUPPORT) || \
defined(BSP_START_ENABLE_EL3_START_SUPPORT)
.L_el2_start:
/* Drop from EL2 to EL1 */
/* Configure HCR_EL2 */
mrs x0, HCR_EL2
/* Set EL1 Execution state to AArch64 */
orr x0, x0, #(1<<31)
/* Disable ID traps */
bic x0, x0, #(1<<15)
bic x0, x0, #(1<<16)
bic x0, x0, #(1<<17)
bic x0, x0, #(1<<18)
msr HCR_EL2, x0
/* Set to EL1h mode for eret */
mov x0, #0b00101
msr SPSR_EL2, x0
/* Set EL1 entry point */
adr x0, .L_el1_start
msr ELR_EL2, x0
eret
.L_el1_start:
#endif
#ifdef RTEMS_SMP
bl _AArch64_Get_current_processor_for_system_start
/*
* Check that this is a configured processor. If not, then there is
* not much that can be done since we do not have a stack available for
* this processor. Just loop forever in this case.
*/
#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
ldr w1, =_SMP_Processor_configured_maximum
#else
ldr x1, =_SMP_Processor_configured_maximum
#endif
ldr w1, [x1]
cmp x1, x0
bgt .Lconfigured_processor
.Linvalid_processor_wait_for_ever:
wfe
b .Linvalid_processor_wait_for_ever
.Lconfigured_processor:
/*
* Get current per-CPU control and store it in PL1 only Thread ID
* Register (TPIDR_EL1).
*/
#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
ldr w1, =_Per_CPU_Information
#else
ldr x1, =_Per_CPU_Information
#endif
add x1, x1, x0, lsl #PER_CPU_CONTROL_SIZE_LOG2
msr TPIDR_EL1, x1
#endif
/* Calculate interrupt stack area end for current processor */
#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
ldr w1, =_ISR_Stack_size
#else
ldr x1, =_ISR_Stack_size
#endif
#ifdef RTEMS_SMP
add x3, x0, #1
mul x1, x1, x3
#endif
#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
ldr w2, =_ISR_Stack_area_begin
#else
ldr x2, =_ISR_Stack_area_begin
#endif
add x3, x1, x2
/* Disable interrupts and debug */
msr DAIFSet, #0xa
#ifdef BSP_START_NEEDS_REGISTER_INITIALIZATION
mov x8, XZR
mov x9, XZR
mov x10, XZR
mov x11, XZR
mov x12, XZR
mov x13, XZR
mov x14, XZR
mov x15, XZR
#endif
/*
* SPx: the stack pointer corresponding to the current exception level
* Normal operation for RTEMS on AArch64 uses SPx and runs on EL1
* Exception operation (synchronous errors, IRQ, FIQ, System Errors) uses SP0
*/
#ifdef AARCH64_MULTILIB_ARCH_V8_ILP32
ldr w1, =bsp_stack_exception_size
#else
ldr x1, =bsp_stack_exception_size
#endif
/* Switch to SP0 and set exception stack */
msr spsel, #0
mov sp, x3
/* Switch back to SPx for normal operation */
msr spsel, #1
sub x3, x3, x1
/* Set SP1 stack used for normal operation */
mov sp, x3
/* Stay in EL1 mode */
#ifdef AARCH64_MULTILIB_VFP
#ifdef AARCH64_MULTILIB_HAS_CPACR
/* Read CPACR */
mrs x0, CPACR_EL1
/* Enable EL1 access permissions for CP10 */
orr x0, x0, #(1 << 20)
/* Write CPACR */
msr CPACR_EL1, x0
isb
#endif
/* FPU does not need to be enabled on AArch64 */
/* Ensure FPU traps are disabled by default */
mrs x0, FPCR
bic x0, x0, #((1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) | (1 << 12))
bic x0, x0, #(1 << 15)
msr FPCR, x0
#endif /* AARCH64_MULTILIB_VFP */
/* Branch to start hook 1 */
bl bsp_start_hook_1
/* Branch to boot card */
mov x0, #0
bl boot_card

View File

@@ -0,0 +1,145 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64XilinxVersal
*
* @brief This source file contains this BSP's console configuration.
*/
/*
* Copyright (C) 2021 Gedare Bloom <gedare@rtems.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/console.h>
#include <rtems/bspIo.h>
#include <rtems/sysinit.h>
#include <bsp/irq.h>
#include <dev/serial/arm-pl011.h>
#include <dev/serial/versal-uart.h>
#include <bspopts.h>
static versal_pl011_context versal_uart_instances[2] = {
{
.pl011_ctx = {
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("Versal UART 0"),
.regs = (arm_pl011_uart *) 0xff000000,
.irq = VERSAL_IRQ_UART_0,
.clock = VERSAL_CLOCK_UART,
.initial_baud = VERSAL_UART_DEFAULT_BAUD
}
}, {
.pl011_ctx = {
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("Versal UART 1"),
.regs = (arm_pl011_uart *) 0xff010000,
.irq = VERSAL_IRQ_UART_1,
.clock = VERSAL_CLOCK_UART,
.initial_baud = VERSAL_UART_DEFAULT_BAUD
}
}
};
rtems_status_code console_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg
)
{
size_t i;
rtems_termios_initialize();
for (i = 0; i < RTEMS_ARRAY_SIZE(versal_uart_instances); ++i) {
char uart[] = "/dev/ttySX";
uart[sizeof(uart) - 2] = (char) ('0' + i);
rtems_termios_device_install(
&uart[0],
&versal_uart_handler,
NULL,
&versal_uart_instances[i].pl011_ctx.base
);
if (i == BSP_CONSOLE_MINOR) {
link(&uart[0], CONSOLE_DEVICE_NAME);
}
}
return RTEMS_SUCCESSFUL;
}
void versal_debug_console_flush(void)
{
versal_uart_reset_tx_flush(
&versal_uart_instances[BSP_CONSOLE_MINOR].pl011_ctx.base
);
}
static void versal_debug_console_out(char c)
{
rtems_termios_device_context *base =
&versal_uart_instances[BSP_CONSOLE_MINOR].pl011_ctx.base;
arm_pl011_write_polled(base, c);
}
static void versal_debug_console_init(void)
{
rtems_termios_device_context *base =
&versal_uart_instances[BSP_CONSOLE_MINOR].pl011_ctx.base;
(void) versal_uart_initialize(base);
BSP_output_char = versal_debug_console_out;
}
static void versal_debug_console_early_init(char c)
{
rtems_termios_device_context *base =
&versal_uart_instances[BSP_CONSOLE_MINOR].pl011_ctx.base;
(void) versal_uart_initialize(base);
BSP_output_char = versal_debug_console_out;
versal_debug_console_out(c);
}
static int versal_debug_console_in(void)
{
rtems_termios_device_context *base =
&versal_uart_instances[BSP_CONSOLE_MINOR].pl011_ctx.base;
return arm_pl011_read_polled(base);
}
BSP_output_char_function_type BSP_output_char = versal_debug_console_early_init;
BSP_polling_getchar_function_type BSP_poll_char = versal_debug_console_in;
RTEMS_SYSINIT_ITEM(
versal_debug_console_init,
RTEMS_SYSINIT_BSP_START,
RTEMS_SYSINIT_ORDER_LAST_BUT_5
);

View File

@@ -0,0 +1,378 @@
/*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (C) 2022 Chris Johns <chris@contemporary.software>
*
* 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 <dev/serial/versal-uart.h>
#include <dev/serial/arm-pl011.h>
#include <bsp/irq.h>
#include <bspopts.h>
static uint32_t versal_uart_intr_all(void)
{
return PL011_UARTI_OEI |
PL011_UARTI_BEI |
PL011_UARTI_PEI |
PL011_UARTI_FEI |
PL011_UARTI_RTI |
PL011_UARTI_TXI |
PL011_UARTI_RXI |
PL011_UARTI_DSRMI |
PL011_UARTI_DCDMI |
PL011_UARTI_CTSMI |
PL011_UARTI_RIMI;
}
#ifdef BSP_CONSOLE_USE_INTERRUPTS
static void versal_uart_intr_clear(volatile arm_pl011_uart *regs, uint32_t ints)
{
regs->base.uarticr = ints;
}
static void versal_uart_intr_clearall(volatile arm_pl011_uart *regs)
{
versal_uart_intr_clear(regs, versal_uart_intr_all());
}
static void versal_uart_intr_enable(volatile arm_pl011_uart *regs, uint32_t ints)
{
regs->base.uartimsc |= ints;
}
#endif
static void versal_uart_intr_disable(volatile arm_pl011_uart *regs, uint32_t ints)
{
regs->base.uartimsc &= ~ints;
}
static void versal_uart_intr_disableall(volatile arm_pl011_uart *regs)
{
versal_uart_intr_disable(regs, versal_uart_intr_all());
}
#ifdef BSP_CONSOLE_USE_INTERRUPTS
static bool versal_uart_flags_clear(volatile arm_pl011_uart *regs, uint32_t flags)
{
return (regs->base.uartfr & flags) == 0;
}
static void versal_uart_interrupt(void *arg)
{
rtems_termios_tty *tty = arg;
versal_pl011_context *ctx = rtems_termios_get_device_context(tty);
volatile arm_pl011_uart *regs = (volatile arm_pl011_uart *) ctx->pl011_ctx.regs;
uint32_t uartmis = regs->base.uartmis;
versal_uart_intr_clear(regs, uartmis);
if ((uartmis & (PL011_UARTI_RTI | PL011_UARTI_RXI)) != 0) {
char buf[32];
int c = 0;
while (c < sizeof(buf) &&
versal_uart_flags_clear(regs, PL011_UARTFR_RXFE)) {
buf[c++] = (char) PL011_UARTDR_DATA_GET(regs->base.uartdr);
}
rtems_termios_enqueue_raw_characters(tty, buf, c);
}
if (ctx->transmitting) {
int sent = ctx->pl011_ctx.tx_queued_chars;
ctx->transmitting = false;
ctx->pl011_ctx.tx_queued_chars = 0;
versal_uart_intr_disable(regs, PL011_UARTI_TXI);
rtems_termios_dequeue_characters(tty, sent);
}
}
#endif
void versal_uart_reset_tx_flush(rtems_termios_device_context *base)
{
volatile arm_pl011_uart *regs = (volatile arm_pl011_uart *) arm_pl011_get_regs(base);
int c = 4;
while (c-- > 0) {
arm_pl011_write_polled(base, '\r');
}
while ((regs->base.uartfr & PL011_UARTFR_TXFE) == 0) {
/* Wait for empty */
}
while ((regs->base.uartfr & PL011_UARTFR_BUSY) != 0) {
/* Wait for empty */
}
}
int versal_uart_initialize(rtems_termios_device_context *base)
{
volatile pl011_base *regs = (volatile pl011_base *)arm_pl011_get_regs(base);
arm_pl011_context *ctx = (arm_pl011_context *) base;
uint32_t maxerr = 3;
uint32_t ibauddiv = 0;
uint32_t fbauddiv = 0;
int rv;
versal_uart_reset_tx_flush(base);
rv = arm_pl011_compute_baudrate_params(
&ibauddiv,
&fbauddiv,
VERSAL_UART_DEFAULT_BAUD,
ctx->clock,
maxerr
);
if (rv != 0) {
return rv;
}
/* Line control: 8-bit word length, no parity, no FIFO, 1 stop bit */
regs->uartlcr_h = PL011_UARTLCR_H_WLEN( PL011_UARTLCR_H_WLEN_8 )
| PL011_UARTLCR_H_FEN;
/* Control: receive, transmit, uart enable, no CTS, no RTS, no loopback */
regs->uartcr = PL011_UARTCR_RXE
| PL011_UARTCR_TXE
| PL011_UARTCR_UARTEN;
regs->uartibrd = ibauddiv;
regs->uartfbrd = fbauddiv;
return 0;
}
static bool versal_uart_first_open(
rtems_termios_tty *tty,
rtems_termios_device_context *base,
struct termios *term,
rtems_libio_open_close_args_t *args
)
{
#ifdef BSP_CONSOLE_USE_INTERRUPTS
versal_pl011_context *ctx = (versal_pl011_context *) base;
volatile arm_pl011_uart *regs = (volatile arm_pl011_uart *) ctx->pl011_ctx.regs;
rtems_status_code sc;
ctx->transmitting = false;
ctx->pl011_ctx.tx_queued_chars = 0;
ctx->pl011_ctx.needs_sw_triggered_tx_irq = true;
#endif
rtems_termios_set_initial_baud(tty, VERSAL_UART_DEFAULT_BAUD);
versal_uart_initialize(base);
#ifdef BSP_CONSOLE_USE_INTERRUPTS
regs->base.uartifls = PL011_UARTIFLS_RXIFLSEL(2) | PL011_UARTIFLS_TXIFLSEL(2);
regs->base.uartlcr_h |= PL011_UARTLCR_H_FEN;
versal_uart_intr_disableall(regs);
sc = rtems_interrupt_handler_install(
ctx->pl011_ctx.irq,
"UART",
RTEMS_INTERRUPT_SHARED,
versal_uart_interrupt,
tty
);
if (sc != RTEMS_SUCCESSFUL) {
return false;
}
versal_uart_intr_clearall(regs);
versal_uart_intr_enable(regs, PL011_UARTI_RTI | PL011_UARTI_RXI);
#endif
return true;
}
#ifdef BSP_CONSOLE_USE_INTERRUPTS
static void versal_uart_last_close(
rtems_termios_tty *tty,
rtems_termios_device_context *base,
rtems_libio_open_close_args_t *args
)
{
versal_pl011_context *ctx = (versal_pl011_context *) base;
rtems_interrupt_handler_remove(ctx->pl011_ctx.irq, versal_uart_interrupt, tty);
}
#endif
static void versal_uart_write_support(
rtems_termios_device_context *base,
const char *buf,
size_t len
)
{
#ifdef BSP_CONSOLE_USE_INTERRUPTS
versal_pl011_context *ctx = (versal_pl011_context *) base;
volatile arm_pl011_uart *regs = (volatile arm_pl011_uart *) ctx->pl011_ctx.regs;
if (len > 0) {
size_t len_remaining = len;
const char *p = &buf[0];
versal_uart_intr_enable(regs, PL011_UARTI_TXI);
/*
* The PL011 IP in the Versal needs preloading the TX FIFO with
* exactly 17 characters for the first TX interrupt to be
* generated.
*/
if (ctx->pl011_ctx.needs_sw_triggered_tx_irq) {
ctx->pl011_ctx.needs_sw_triggered_tx_irq = false;
for (int i = 0; i < 17; ++i) {
regs->base.uartdr = PL011_UARTDR_DATA('\r');
}
}
while (versal_uart_flags_clear(regs, PL011_UARTFR_TXFF) &&
len_remaining > 0) {
regs->base.uartdr = PL011_UARTDR_DATA(*p++);
--len_remaining;
}
ctx->pl011_ctx.tx_queued_chars = len - len_remaining;
ctx->transmitting = true;
}
#else
ssize_t i;
for (i = 0; i < len; ++i) {
arm_pl011_write_polled(base, buf[i]);
}
#endif
}
static bool versal_uart_set_attributes(
rtems_termios_device_context *context,
const struct termios *term
)
{
versal_pl011_context *ctx = (versal_pl011_context *) context;
volatile arm_pl011_uart *regs = (volatile arm_pl011_uart *) ctx->pl011_ctx.regs;
int32_t baud;
uint32_t ibauddiv = 0;
uint32_t fbauddiv = 0;
uint32_t mode = 0;
int rc;
/*
* Determine the baud rate
*/
baud = rtems_termios_baud_to_number(term->c_ospeed);
if (baud > 0) {
uint32_t maxerr = 3;
rc = arm_pl011_compute_baudrate_params(
&ibauddiv,
&fbauddiv,
baud,
ctx->pl011_ctx.clock,
maxerr
);
if (rc != 0) {
return rc;
}
}
/*
* Configure the mode register
*/
mode = regs->base.uartlcr_h & PL011_UARTLCR_H_FEN;
/*
* Parity
*/
if ((term->c_cflag & PARENB) != 0) {
mode |= PL011_UARTLCR_H_PEN;
if ((term->c_cflag & PARODD) == 0) {
mode |= PL011_UARTLCR_H_EPS;
}
}
/*
* Character Size
*/
switch (term->c_cflag & CSIZE)
{
case CS5:
mode = PL011_UARTLCR_H_WLEN_SET(mode, PL011_UARTLCR_H_WLEN_5);
break;
case CS6:
mode = PL011_UARTLCR_H_WLEN_SET(mode, PL011_UARTLCR_H_WLEN_6);
break;
case CS7:
mode = PL011_UARTLCR_H_WLEN_SET(mode, PL011_UARTLCR_H_WLEN_7);
break;
case CS8:
default:
mode = PL011_UARTLCR_H_WLEN_SET(mode, PL011_UARTLCR_H_WLEN_8);
break;
}
/*
* Stop Bits
*/
if (term->c_cflag & CSTOPB) {
/* 2 stop bits */
mode |= PL011_UARTLCR_H_STP2;
}
versal_uart_intr_disableall(regs);
/*
* Wait for any data in the TXFIFO to be sent then wait while the
* transmiter is active.
*/
while ((regs->base.uartfr & PL011_UARTFR_TXFE) == 0 ||
(regs->base.uartfr & PL011_UARTFR_BUSY) != 0) {
/* Wait */
}
regs->base.uartcr = PL011_UARTCR_UARTEN;
/* Ignore baud rate of B0. There are no modem control lines to de-assert */
if (baud > 0) {
regs->base.uartibrd = ibauddiv;
regs->base.uartfbrd = fbauddiv;
}
regs->base.uartlcr_h = mode;
/* Control: receive, transmit, uart enable, no CTS, no RTS, no loopback */
regs->base.uartcr = PL011_UARTCR_RXE
| PL011_UARTCR_TXE
| PL011_UARTCR_UARTEN;
#ifdef BSP_CONSOLE_USE_INTERRUPTS
versal_uart_intr_clearall(regs);
versal_uart_intr_enable(regs, PL011_UARTI_RTI | PL011_UARTI_RXI);
#endif
return true;
}
const rtems_termios_device_handler versal_uart_handler = {
.first_open = versal_uart_first_open,
.set_attributes = versal_uart_set_attributes,
.write = versal_uart_write_support,
#ifdef BSP_CONSOLE_USE_INTERRUPTS
.last_close = versal_uart_last_close,
.mode = TERMIOS_IRQ_DRIVEN
#else
.poll_read = arm_pl011_read_polled,
.mode = TERMIOS_POLLED
#endif
};

View File

@@ -0,0 +1,94 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64XilinxVersal
*
* @brief This header file provides the core BSP definitions
*/
/*
* Copyright (C) 2021 Gedare Bloom <gedare@rtems.org>
*
* 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 LIBBSP_AARCH64_XILINX_VERSAL_BSP_H
#define LIBBSP_AARCH64_XILINX_VERSAL_BSP_H
/**
* @addtogroup RTEMSBSPsAArch64
*
* @{
*/
#include <bspopts.h>
#define BSP_RESET_SMC
#ifndef ASM
#include <bsp/default-initial-extension.h>
#include <bsp/linker-symbols.h>
#include <bsp/start.h>
#include <rtems.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_ARM_GIC_CPUIF_BASE 0xf9040000
#define BSP_ARM_GIC_DIST_BASE 0xf9000000
#define BSP_ARM_GIC_REDIST_BASE 0xf9080000
/*
* DDRMC mapping
*/
LINKER_SYMBOL(bsp_r0_ram_base)
LINKER_SYMBOL(bsp_r0_ram_end)
LINKER_SYMBOL(bsp_r1_ram_base)
LINKER_SYMBOL(bsp_r1_ram_end)
/**
* @brief Versal specific set up of the MMU.
*
* Provide in the application to override the defaults in the BSP.
*/
BSP_START_TEXT_SECTION void versal_setup_mmu_and_cache(void);
void versal_debug_console_flush(void);
uint32_t versal_clock_i2c0(void);
uint32_t versal_clock_i2c1(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
/** @} */
#endif /* LIBBSP_AARCH64_XILINX_VERSAL_BSP_H */

View File

@@ -0,0 +1,64 @@
/*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (C) 2022 Chris Johns <chris@contemporary.software>
* Copyright (C) 2014 embedded brains GmbH & Co. KG
*
* 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 LIBBSP_ARM_XILINX_VERSAL_I2C_H
#define LIBBSP_ARM_XILINX_VERSAL_I2C_H
#include <dev/i2c/cadence-i2c.h>
#include <bsp/irq.h>
#include <bsp.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
static inline int versal_register_i2c_0(void)
{
return i2c_bus_register_cadence(
"/dev/i2c-0",
0x00FF020000,
versal_clock_i2c0(),
VERSAL_IRQ_I2C_0
);
}
static inline int versal_register_i2c_1(void)
{
return i2c_bus_register_cadence(
"/dev/i2c-1",
0x00FF030000,
versal_clock_i2c1(),
VERSAL_IRQ_I2C_1
);
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_ARM_XILINX_VERSAL_I2C_H */

View File

@@ -0,0 +1,74 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64XilinxVersal
*
* @brief This header file provides the BSP's IRQ definitions.
*/
/*
* Copyright (C) Gedare Bloom <gedare@rtems.org>
*
* 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 LIBBSP_AARCH64_XILINX_VERSAL_IRQ_H
#define LIBBSP_AARCH64_XILINX_VERSAL_IRQ_H
#ifndef ASM
#include <rtems/irq.h>
#include <rtems/irq-extension.h>
#include <dev/irq/arm-gic-irq.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BSP_INTERRUPT_VECTOR_COUNT 1020
/* Interrupts vectors */
#define BSP_TIMER_VIRT_PPI 27
#define BSP_TIMER_PHYS_S_PPI 29
#define BSP_TIMER_PHYS_NS_PPI 30
#define VERSAL_IRQ_I2C_0 46
#define VERSAL_IRQ_I2C_1 47
#define VERSAL_IRQ_UART_0 50
#define VERSAL_IRQ_UART_1 51
#define VERSAL_IRQ_ETHERNET_0 88
#define VERSAL_IRQ_ETHERNET_0_WAKEUP 89
#define VERSAL_IRQ_ETHERNET_1 90
#define VERSAL_IRQ_ETHERNET_1_WAKEUP 91
#define VERSAL_IRQ_QSPI 157
/** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ASM */
#endif /* LIBBSP_AARCH64_XILINX_VERSAL_IRQ_H */

View File

@@ -0,0 +1,41 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsArmXilinxVersal
*
* @brief This header file provides BSP-specific interfaces.
*/
/*
* Copyright (C) 2024 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 LIBBSP_ARM_XILINX_ZYNQMP_RPU_BSP_XIL_COMPAT_H
#define LIBBSP_ARM_XILINX_ZYNQMP_RPU_BSP_XIL_COMPAT_H
#include <bsp/xil-compat-common.h>
#endif

View File

@@ -0,0 +1,73 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup versal_uart
*
* @brief Xilinx Versal UART support.
*/
/*
* Copyright (C) 2021 Gedare Bloom <gedare@rtems.org>
*
* 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 LIBBSP_ARM_XILINX_VERSAL_UART_H
#define LIBBSP_ARM_XILINX_VERSAL_UART_H
#include <rtems/termiostypes.h>
#include <dev/serial/arm-pl011.h>
#include <dev/serial/arm-pl011-regs.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup versal_uart Xilinx Versal UART Support
* @ingroup RTEMSBSPsARMVersal
* @brief UART Support
*
* This driver operates an instance of the Xilinx UART present in the
* family of Xilinx Versal SoCs.
*/
typedef struct {
arm_pl011_context pl011_ctx;
volatile bool transmitting;
} versal_pl011_context;
extern const rtems_termios_device_handler versal_uart_handler;
#define VERSAL_UART_DEFAULT_BAUD 115200
int versal_uart_initialize(rtems_termios_device_context *base);
void versal_uart_reset_tx_flush(rtems_termios_device_context *base);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBBSP_ARM_XILINX_VERSAL_UART_H */

View File

@@ -0,0 +1,45 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64XilinxVersal
*
* @brief This header file provides functionality for the tm27 test.
*/
/*
* Copyright (C) 2021 Gedare Bloom <gedare@rtems.org>
*
* 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_TMTEST27
#error "This is an RTEMS internal file you must not include directly."
#endif
#ifndef __tm27_h
#define __tm27_h
#include <dev/irq/arm-gic-tm27.h>
#endif /* __tm27_h */

View File

@@ -0,0 +1,60 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64XilinxVersal
*
* @brief This source file contains the implementation of bsp_start().
*/
/*
* Copyright (C) 2021 Gedare Bloom <gedare@rtems.org>
*
* 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.h>
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
#include <rtems/score/basedefs.h>
RTEMS_WEAK uint32_t versal_clock_i2c0(void)
{
return VERSAL_CLOCK_I2C0;
}
RTEMS_WEAK uint32_t versal_clock_i2c1(void)
{
return VERSAL_CLOCK_I2C1;
}
void bsp_start( void )
{
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,
(uintptr_t) bsp_section_nocacheheap_size
);
}

View File

@@ -0,0 +1,54 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
*
* @ingroup RTEMSBSPsAArch64XilinxVersal
*
* @brief This source file contains the implementation of this BSP's startup
* hooks.
*/
/*
* Copyright (C) 2021 Gedare Bloom <gedare@rtems.org>
*
* 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.h>
#include <bsp/irq-generic.h>
#include <bsp/start.h>
#ifdef BSP_START_ENABLE_EL3_START_SUPPORT
BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
{
bsp_interrupt_facility_initialize();
}
#endif
BSP_START_TEXT_SECTION void bsp_start_hook_1(void)
{
AArch64_start_set_vector_base();
bsp_start_copy_sections();
versal_setup_mmu_and_cache();
bsp_start_clear_bss();
}

Some files were not shown because too many files have changed in this diff Show More