Commit Graph

26350 Commits

Author SHA1 Message Date
Sebastian Huber
c4ff0271e7 score: Wait for per-CPU state changes later
Wait for per-CPU changes into PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING
later.  There is no need to delay the initialization of the main
processor at this point.
2014-02-19 09:59:42 +01:00
Sebastian Huber
b1d08a58b2 score: Initialize per-CPU locks 2014-02-19 09:59:42 +01:00
Sebastian Huber
282bfd3b41 score: Move _SMP_Handler_initialize() 2014-02-19 09:59:42 +01:00
Sebastian Huber
a171e0a867 bsp/leon3: Declare LEON3_IrqCtrl_EIrq only once 2014-02-19 09:59:41 +01:00
Sebastian Huber
f71f3d3196 bsp/leon3: Declare leon3_ext_irq_init() in header 2014-02-19 09:59:41 +01:00
Sebastian Huber
4d9bd56d29 score: Rename rtems_smp_process_interrupt()
Rename rtems_smp_process_interrupt() into
_SMP_Inter_processor_interrupt_handler().  Delete unused header file
<rtems/bspsmp.h>.
2014-02-19 09:59:41 +01:00
Sebastian Huber
911b1d228b score: Rename rtems_smp_secondary_cpu_initialize()
Rename rtems_smp_secondary_cpu_initialize() into
_SMP_Start_multitasking_on_secondary_processor().  Move declaration to
<rtems/score/smpimpl.h>.
2014-02-19 09:59:41 +01:00
Sebastian Huber
6ca4f6af8a score: Add and use <rtems/score/smpimpl.h>
Collect SMP implementation specific parts in the
<rtems/score/smpimpl.h> header file.
2014-02-19 09:59:41 +01:00
Sebastian Huber
f8ff2a011c score: Delete bsp_smp_broadcast_interrupt()
Since the per-CPU SMP lock must be acquired and released to send the
message a single interrupt broadcast operations offers no benefits.  If
synchronization is required, then a SMP barrier must be used anyway.
2014-02-19 09:59:41 +01:00
Sebastian Huber
4627fcdab1 score: Rename bsp_smp_initialize()
Rename bsp_smp_initialize() into _CPU_SMP_Initialize() since every CPU
port must supply this function.
2014-02-19 09:59:40 +01:00
Sebastian Huber
2afe065785 score: Remove ASM guard 2014-02-19 09:59:40 +01:00
Sebastian Huber
2cb95b5f0a score: Rename RTEMS_BSP_SMP_SHUTDOWN
Rename RTEMS_BSP_SMP_SHUTDOWN in SMP_MESSAGE_SHUTDOWN since SMP messages
have nothing to do with the BSP.  Use UINT32_C() instead of casts.
2014-02-19 09:59:40 +01:00
Sebastian Huber
9eec2f33e9 score: Add RTEMS_FATAL_SOURCE_SMP
Use rtems_fatal() instead of _CPU_Fatal_halt() to shutdown processors in
SMP configurations since this allows intervention of BSP or application
specific fatal extensions.
2014-02-19 09:59:40 +01:00
Sebastian Huber
46d7fa5cd3 bsp/leon3: Add and use fatal codes 2014-02-19 09:59:40 +01:00
Sebastian Huber
33cb8bf64d score: Add RTEMS_FATAL_SOURCE_BSP
Merge RTEMS_FATAL_SOURCE_BSP_GENERIC and RTEMS_FATAL_SOURCE_BSP_SPECIFIC
into new fatal source RTEMS_FATAL_SOURCE_BSP.  This makes it easier to
figure out the code position given a fatal source and code.
2014-02-19 09:59:39 +01:00
Sebastian Huber
b39e055a49 score: Delete INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP
This error case is no longer required since rtems_shutdown_executive()
can be called anytime, anywhere
2014-02-19 09:59:39 +01:00
Sebastian Huber
8a6de83fd8 score: Move _SMP_Request_other_cores_to_shutdown()
Move _SMP_Request_other_cores_to_shutdown() invocation from
rtems_shutdown_executive() to _Internal_error_Occurred() to allow a
proper shutdown on SMP configurations even in the error case.
2014-02-19 09:59:39 +01:00
Sebastian Huber
38ee75853f score: Disable ISR in _Internal_error_Occurred()
Disable interrupts as the first step in _Internal_error_Occurred() to
get a defined execution context for the fatal extensions.

Make _ISR_Disable_without_giant() available for non-SMP configurations.
2014-02-19 09:59:39 +01:00
Sebastian Huber
514705d2f1 score: Delete _Thread_BSP_context
Do not return to BSP context in the exit() shutdown path.  This makes it
possible to re-use the initialization stack.  It can be used for the
interrupt stack for example.  On targets with a small RAM this is a
considerable benefit.

This change eliminates also some special cases and simplifies the code.

Delete _Thread_Set_global_exit_status(),
_Thread_Get_global_exit_status() and _Thread_Stop_multitasking().
2014-02-19 09:59:39 +01:00
Sebastian Huber
92f50c3b29 score: Add SYSTEM_STATE_TERMINATED
Merge systems states SYSTEM_STATE_SHUTDOWN and SYSTEM_STATE_FAILED into
new system state SYSTEM_STATE_TERMINATED.  This reflects that all system
termination paths end up in _Internal_error_Occurred().
2014-02-19 09:59:38 +01:00
Sebastian Huber
801b5d8032 powerpc: Change interrupt disable implemetation
Instead of SPRG0 (= special purpose register 272) use the new global
symbol _PPC_INTERRUPT_DISABLE_MASK to store the interrupt disable mask.
The benefit is that it is now possible to disable interrupts without
further run-time initialization in boot_card().

At least on Freescale e500 cores this leads also to a faster execution
since the mfmsr and mfspr instruction require four cycles to complete.
The instructions to load the mask value can execute while the mfmsr is
in progress.
2014-02-19 09:59:38 +01:00
Sebastian Huber
c2934b96e8 score: Move SMP interrupt stack initialization
Move SMP interrupt stack initialization for secondary processors from
_SMP_Handler_initialize() to _ISR_Handler_initialization() to avoid code
duplication.  Apply _CPU_Interrupt_stack_setup() to all interrupt
stacks.
2014-02-19 09:59:38 +01:00
Jennifer Averett
2729c1c2a8 smptests: Add check for affinity support in newlib. 2014-02-17 12:19:06 -06:00
Jennifer Averett
f38060b6dd psxtests: Correct bug in check of affinity support in newlib. 2014-02-17 12:17:26 -06:00
Jennifer Averett
57997d8b45 cpukit: Correct bug in check of affinity support in newlib. 2014-02-17 12:15:19 -06:00
Sebastian Huber
ad7292f264 score: Add SMP barrier 2014-02-17 08:46:38 +01:00
Sebastian Huber
0344ce0385 score: Use atomic API for SMP lock
Use a ticket lock implementation based on atomic operations.  Delete CPU
port specific SMP lock implementations.
2014-02-17 08:46:38 +01:00
Sebastian Huber
7d066fc23f smptests/smplock01: Use atomic operations 2014-02-17 08:46:38 +01:00
Sebastian Huber
8a9568d2e7 Require presence of <stdatomic.h> for SMP support 2014-02-17 08:46:38 +01:00
Sebastian Huber
dcd97c77f0 sparc: Add atomic support for SPARC V8
Use SWAP instruction with one lock for the system in the SMP case.
2014-02-17 08:46:37 +01:00
Sebastian Huber
88ef740ea8 bsp/leon3: Declare amba_initialize() 2014-02-14 10:28:31 +01:00
Sebastian Huber
e644155afa bsp/leon3: Do not define RTEMS_DEBUG
Move vital code out of debug section.  Harmonize variable names with
other implementations.
2014-02-14 10:28:30 +01:00
Sebastian Huber
ad563618ca sparc: Add LEON3_ASR17_PROCESSOR_INDEX_SHIFT
Add _LEON3_Get_current_processor().
2014-02-14 10:28:30 +01:00
Sebastian Huber
945853b7cf score: Add Atomic_Uint 2014-02-14 10:28:30 +01:00
Sebastian Huber
cd2c655e6c score: Fix warnings, C++ compatibility, fix typos 2014-02-14 10:28:30 +01:00
Sebastian Huber
6f90ef752d score: Remove volatile from asm statements
The instructions to get the processor current index have no
side-effects.
2014-02-14 10:28:30 +01:00
Sebastian Huber
24bf11eca1 score: Add CPU counter support
Add a CPU counter interface to allow access to a free-running counter.
It is useful to measure short time intervals.  This can be used for
example to enable profiling of critical low-level functions.

Add two busy wait functions rtems_counter_delay_ticks() and
rtems_counter_delay_nanoseconds() implemented via the CPU counter.
2014-02-14 10:28:29 +01:00
Sebastian Huber
382ea27b6a bsps/arm: Fix Cortex-A9 MPCore nanoseconds handler 2014-02-13 10:05:14 +01:00
Sebastian Huber
ece9754225 sparc: Increase CPU_STRUCTURE_ALIGNMENT to 32
Recent LEON4 systems use a cache line size of 32 bytes.
2014-02-13 10:05:13 +01:00
Sebastian Huber
e11d9287cf testsuites: Add TESTS_USE_PRINTF
Make it possible to use normal printf() if requested to allow output of
floating point numbers.
2014-02-12 09:18:00 +01:00
Sebastian Huber
bab16de267 score: Change debug helper functions
Rename rtems_internal_error_description() to
rtems_internal_error_text().  Rename rtems_fatal_source_description() to
rtems_fatal_source_text().  Rename rtems_status_code_description() to
rtems_status_text().  Remove previous implementation of
rtems_status_text().
2014-02-12 09:18:00 +01:00
Sebastian Huber
97cf623d4a sparc: Save/restore only non-volatile context
The _CPU_Context_switch() is a normal function call.  The following
registers are volatile (the caller must assume that the register
contents are destroyed by the callee) according to "SYSTEM V APPLICATION
BINARY INTERFACE - SPARC Processor Supplement", Third Edition: g1, o0,
o1, o2, o3, o4, o5.  Drop these registers from the context.

Ensure that offset defines match the structure offsets.
2014-02-12 09:18:00 +01:00
Sebastian Huber
62c5c4a564 bsps/sparc: Fix ambapp_find_by_idx()
The expression "*pi++" post-increments the pointer (not the value).
2014-02-11 12:54:24 +01:00
Sebastian Huber
0df8d7f20d bsps/arm: Use Global Timer for Cortex-A9 MPCore
Use the Global Timer for the Cortex-A9 MPCore clock driver instead of
the Private Timer.  This enables a consistent nanoseconds since last
context switch value across all processors.
2014-02-10 16:58:03 +01:00
Sebastian Huber
069e10c392 bsps/arm: Include missing header file 2014-02-10 16:58:03 +01:00
Sebastian Huber
01794eb971 score: Format _Thread_Get_maximum_internal_threads 2014-02-10 09:16:47 +01:00
Sebastian Huber
847fc79da1 Revert "bsp/leon3: New BSP variant leon3_qemu"
This reverts commit 7579e25512.

Improve QEMU to support AMBA plug and play instead.
2014-02-07 09:32:31 +01:00
Sebastian Huber
7579e25512 bsp/leon3: New BSP variant leon3_qemu 2014-02-06 08:47:03 +01:00
Sebastian Huber
224b88805e bsp/leon3: Declare bsp_debug_uart_init() in header
Do not return a status.
2014-02-06 08:47:03 +01:00
Sebastian Huber
920a43e639 rtems: Add rtems_status_code_description() 2014-02-06 08:47:02 +01:00