Commit Graph

34382 Commits

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