Commit Graph

26350 Commits

Author SHA1 Message Date
Jennifer Averett
6e5f2493a9 posix: Add pthread_getattr_np().
This is a useful POSIX thread API helper which is found in
`GNU/Linux and *BSD.
2014-03-07 09:12:41 -06:00
Jennifer Averett
dd0017c135 posix: Add dynamic pthread get and set affinity.
This patch adds the following methods:

  + pthread_get_affinity_np
  + pthread_set_affinity_np
2014-03-07 09:12:11 -06:00
Jennifer Averett
6e6adafaaa posix: Add pthread_attr_t methods to get/set affinity.
This patch adds the following methods:

  + pthread_attr_get_affinity_np
  + pthread_attr_set_affinity_np
2014-03-07 09:11:32 -06:00
Jennifer Averett
baa426a074 posix: Add support method to compare two pthread attribute structures. 2014-03-07 09:11:28 -06:00
Jennifer Averett
185e46f6a0 posix: Add POSIX thread affinity attribute support.
With the addition of pthread affinity information in pthread_attr_t,
the existing code for pthread_attr_t had to be adjusted.
2014-03-07 09:10:33 -06:00
Jennifer Averett
29cacfdbf3 rtems: Add Classic API get and set affinity methods.
Add the following methods:

  + rtems_task_get_affinity
  + rtems_task_set_affinity
2014-03-07 09:10:01 -06:00
Jennifer Averett
039a189de1 sapi: Moved smp initialization and added cpuset initilization.
SMP must be initialized in order to know the current set of
cores available. Without this, you cannot initialize the
default cpu_set_t associated with Classic API tasks and
POSIX threads.
2014-03-07 09:09:01 -06:00
Jennifer Averett
9db8705cc8 score: Add cpuset support to Score.
This new Score Handler provides a structure to manage a
cpu_set_t plus helper routines to validate the contents
against the current system configuration.
2014-03-07 09:07:59 -06:00
Jennifer Averett
13ab94be6c spcpuset01: Add check for sys/cpuset.h.
If <sys/cpuset.h> is not provided by the toolset, the test
cannot be compiled.
2014-03-07 09:07:17 -06:00
Sebastian Huber
e5bcb24bd0 smptests: Delete config.h.in 2014-03-06 11:16:57 +01:00
Sebastian Huber
3ca84d0cba score: Fix per-CPU state documentation 2014-03-06 11:12:57 +01:00
Sebastian Huber
825cb1f196 score: Delete _Thread_Dispatch_set_disable_level()
This function was only used in some tests and can be replaced with other
functions.
2014-03-06 09:43:59 +01:00
Sebastian Huber
b323e1fb41 tmtests/tm26: Fix deadlock for SMP configurations
Some _Context_Switch() invocations end up in _Thread_Handler().  Create
the right context for this function.
2014-03-06 09:43:59 +01:00
Sebastian Huber
718124e4e5 rtems: Add RTEMS_INTERRUPT_REPLACE
A new option RTEMS_INTERRUPT_REPLACE is introduced that permits updating
the first interrupt handler for the registered interrupt vector and
matching argument.  If no match is found, the install function fails
with RTEMS_UNSATISFIED.

The Interrupt Manager Extension offers interrupt handlers with an
argument pointer.  It is impossible to update two words (handler and
argument) atomically on most architectures.  In order to avoid an SMP
lock in bsp_interrupt_handler_dispatch() which would degrade the
interrupt response time an alternative must be provided that makes it
possible to tear-down interrupt sources without an SMP lock.

Add RTEMS_INTERRUPT_REPLACE option to Interrupt Manager Extension.  This
enables a clean tear-down of interrupt sources on SMP configurations.
Instead of an interrupt handler removal a replacement handler can be
installed to silence an interrupt source.  This can be used in contexts
that allow no sophisticated synchronization (e.g. in atexit() or fatal
handlers).
2014-03-06 09:43:59 +01:00
Sebastian Huber
e0609ac745 bsps: SMP support for generic interrupt support 2014-03-06 09:43:58 +01:00
Sebastian Huber
8b50a55001 score: Add _Atomic_Fence() 2014-03-06 09:43:58 +01:00
Sebastian Huber
a418b2f8b0 libnetworking: Typo 2014-03-06 09:43:58 +01:00
Sebastian Huber
ba25cc208c score: Add and use _Giant_Drop()
New test smptests/smpfatal03.
2014-03-06 09:43:58 +01:00
Sebastian Huber
7336be9d78 score: SMP initialization and shutdown changes
Rename _SMP_Request_other_cores_to_perform_first_context_switch() into
_SMP_Request_start_multitasking() since this requests now a multitasking
start on all configured and available processors.  The name corresponds
_Thread_Start_multitasking() and
_SMP_Start_multitasking_on_secondary_processor() actions issued in
response to this request.  Move in source file to right place.

Rename PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING into
PER_CPU_STATE_READY_TO_START_MULTITASKING.

Rename PER_CPU_STATE_BEGIN_MULTITASKING into
PER_CPU_STATE_REQUEST_START_MULTITASKING.

Rename _SMP_Request_other_cores_to_shutdown() into
_SMP_Request_shutdown().

Add a per-CPU state lock to protect all changes.  This was necessary to
offer a controlled shutdown of the system (atomic read/writes alone are
not sufficient for this kind of synchronization).

Add documentation for Per_CPU_State.

Delete debug output.

New tests smptests/smpfatal01 and smptests/smpfatal02.
2014-03-06 09:43:57 +01:00
Daniel Hellstrom
7fe0561526 bsp/leon3: Unmask IPI only on secondary processor 2014-03-06 09:43:57 +01:00
Joel Sherrill
6b998feeb2 taskmode: Formatting correction 2014-03-05 17:12:06 -06:00
Sebastian Huber
9abbb6ab97 tmtests/tmcontext01: New test 2014-02-28 09:06:20 +01:00
Sebastian Huber
9ec4a48dde bsp/leon3: Add L2 cache support 2014-02-28 09:06:19 +01:00
Sebastian Huber
c5b1e208c5 bsp/leon3: Add L2C registers 2014-02-28 09:06:19 +01:00
Sebastian Huber
64f4ac28a6 bsp/leon3: Add new cache manager implementation
The previous implementation used an instruction cache line size of 0,
this is a bogus value.  Use a instruction cache line size of 64 since
the L2 cache may have a line size of 32 or 64.  A greater value should
cause no harm.

Use a FLUSH operation for _CPU_cache_invalidate_instruction_range().

This is a preperation step to support the L2 cache.
2014-02-28 09:06:19 +01:00
Sebastian Huber
80186ca8f4 bsp/leon3: Add and use cache register functions 2014-02-28 09:06:19 +01:00
Sebastian Huber
e1d7bf002e rtems: Add cache size functions
Add rtems_cache_get_data_cache_size() and
rtems_cache_get_instruction_cache_size().
2014-02-28 09:06:16 +01:00
Sebastian Huber
e7549ff4a1 rtems: Use size_t for cache line size
A cache line cannot have a negative size.
2014-02-28 08:59:02 +01:00
Sebastian Huber
5e8301da86 rtems: Cache manager documentation
Move useful functions to the top of the file.
2014-02-28 08:59:02 +01:00
Sebastian Huber
31494ab264 sptests/spcache01: Detect write-through cache 2014-02-28 08:59:02 +01:00
Sebastian Huber
0a2096b7e3 bsp/leon3: Use ambapp_freq_get() for CPU counter 2014-02-28 08:59:01 +01:00
Sebastian Huber
dce7bba732 bsps: Delete LEON3_FATAL_CPU_COUNTER_INIT 2014-02-28 08:59:01 +01:00
Sebastian Huber
6faf789314 bsps: Fix empty interrupt handler entry
The vector number of spurious interrupts was wrong after the interrupt
handler removal on SMP configurations.
2014-02-28 08:59:01 +01:00
Sebastian Huber
3378be955a sptests/spcache01: New test 2014-02-24 16:12:03 +01:00
Sebastian Huber
a4bc90af4e sparc: Fix CPU counter support
The SPARC processors supported by RTEMS have no built-in CPU counter
support.  We have to use some hardware counter module for this purpose.
The BSP must provide a 32-bit register which contains the current CPU
counter value and a function for the difference calculation.  It can use
for example the GPTIMER instance used for the clock driver.
2014-02-24 16:12:02 +01:00
Sebastian Huber
95d0c98cac score: Fix thread TLS area initialization
Do not use _TLS_Size here since this will lead GCC to assume that this
symbol is not 0 and the later > 0 test will be optimized away.
2014-02-24 12:50:32 +01:00
Sebastian Huber
07dc9709a4 sptests/spcpucounter01: Adjust test
Adjust test to work with clock driver based CPU counters.  They have a
period equal to the clock tick interval.
2014-02-24 12:49:45 +01:00
Sebastian Huber
0b9fd991a7 bsps: Add empty cache manager
This is necessary to add tests that use the cache manager.  For example
to get better estimates of worst-case timings.
2014-02-24 12:49:45 +01:00
Sebastian Huber
0fe0718b72 bsps/powerpc: Use System V small-data area
The 32-bit ABIs for thread-local storage (TLS) and EABI read-only
small-data area have a conflicting register (r2) usage.  Use the System
V small-data instead (here r2 is system reserved).
2014-02-24 12:49:42 +01:00
Sebastian Huber
07713db65b bsp/leon3: Add bsp_reset() for SMP configuration 2014-02-21 09:38:56 +01:00
Sebastian Huber
7ec8d95a1e bsp/leon3: Add and use leon3_get_cpu_count() 2014-02-21 09:38:56 +01:00
Sebastian Huber
4fe6759e2a bsp/leon3: Add leon3_power_down_loop() 2014-02-21 09:38:56 +01:00
Sebastian Huber
c8c877f8cb bsps/sparc: Delete unused file 2014-02-21 09:38:56 +01:00
Sebastian Huber
1be15db1ff bsp/score603e: Remove unused BSP_fatal_return() 2014-02-21 09:38:55 +01:00
Sebastian Huber
47d6013417 score: _CPU_SMP_Get_current_processor()
Remove RTEMS_COMPILER_PURE_ATTRIBUTE from _SMP_Get_current_processor()
and all _CPU_SMP_Get_current_processor().  Make inline ASM statements
volatile again.  Test smptests/smpmigration01 showed that GCC optimizes
too much otherwise.
2014-02-21 09:38:54 +01:00
Sebastian Huber
7ee4e72e4b score: _Thread_Start_multitasking()
Fix serious race-condition.  Read the heir after the per-CPU lock
acquire.
2014-02-21 09:38:25 +01:00
Sebastian Huber
83bf105486 score: Rename _Internal_error_Occurred()
Rename _Internal_error_Occurred() into _Terminate().
2014-02-21 09:38:24 +01:00
Jennifer Averett
52eecbaa08 posix: Set pthread attribute values in detach and setschedparm methods. 2014-02-19 10:36:01 -06:00
Sebastian Huber
2cb0877f3a bsp/leon3: Add and use LEON3_IrqCtrl_Lock
Disabling of interrupts is not enough to ensure mutual exclusion on SMP
configurations.
2014-02-19 10:25:47 +01:00
Sebastian Huber
8a65a96007 score: _SMP_Inter_processor_interrupt_handler()
Inline _SMP_Inter_processor_interrupt_handler() to avoid function call
overhead.  Remove debug output.
2014-02-19 09:59:42 +01:00