#4458 closed enhancement (fixed)

Simplify trap table initialization

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 6.1
Component: arch/sparc Version: 6
Severity: normal Keywords: qualification
Cc: Blocked By:
Blocking:

Description (last modified by Sebastian Huber)

Currently, the trap table is statically initialized (see start.S). Unexpected traps end up in system error mode. Later during startup most traps are changed to jump to _ISR_Handler(). This is a side-effect of bsp_spurious_initialize(). The used functions for this dynamic initialization are a bit complex and need cache manager directives which involve all online processors. This should be simplified to cover only basic requirements.

  1. The _ISR_Vector_table should be initialized by _CPU_Initialize_vectors() to an new default handler _SPARC_ISR_handler_default() which just invokes _Terminate().
  1. The traps associated with external interrupts (0x11 up to including 0x1f) should be statically initialized in start.S to jump to _ISR_Handler().
  1. Standard synchronous exceptions such as
    • 0x01 instruction access exception
    • 0x02 illegal instruction
    • 0x03 privileged instruction
    • 0x04 fp disabled
    • 0x07 memory address not aligned
    • 0x08 fp exception
    • 0x09 data access exception
    • 0x0A tag overflow
    • 0x24 cp_disabled
    • 0x28 cp_exception

should also be statically initialize to jump to _ISR_Handler() to invoke the fatal error handler.

If software needs to change the default initialization, then it can use set_vector() or alternatives on demand.

Change History (8)

comment:1 Changed on Jun 18, 2021 at 3:20:54 PM by Sebastian Huber

Description: modified (diff)

comment:2 Changed on Jun 18, 2021 at 3:22:45 PM by Sebastian Huber

Description: modified (diff)

comment:3 Changed on Jun 24, 2021 at 10:30:27 AM by Sebastian Huber <sebastian.huber@…>

In 7a140e2/rtems:

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.

comment:4 Changed on Jun 24, 2021 at 10:30:30 AM by Sebastian Huber <sebastian.huber@…>

In 955c045b/rtems:

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.

comment:5 Changed on Jun 24, 2021 at 10:30:37 AM by Sebastian Huber <sebastian.huber@…>

In 5c30e3d3/rtems:

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.

comment:6 Changed on Jun 24, 2021 at 10:30:40 AM by Sebastian Huber <sebastian.huber@…>

In b9d5f516/rtems:

sparc: Move FP frame offset defines to cpuimpl.h

This makes them usable in multiple files.

Update #4458.

comment:7 Changed on Jun 24, 2021 at 10:30:47 AM by Sebastian Huber <sebastian.huber@…>

In be96cb43/rtems:

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.

comment:8 Changed on Aug 12, 2021 at 12:49:04 PM by Sebastian Huber

Resolution: fixed
Status: assignedclosed

The trap table is now statically initialized.

Note: See TracTickets for help on using tickets.