Commit Graph

35682 Commits

Author SHA1 Message Date
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