Commit Graph

26020 Commits

Author SHA1 Message Date
Joel Sherrill
48198f1b35 cpright.texi: Update to 2014. 2014-03-11 16:27:56 -05:00
Joel Sherrill
653ed5e151 gen_section: Update for use with new SMP chapters. 2014-03-11 13:21:47 -05:00
Sebastian Huber
b4b86b825a posix: Fix NULL pointer access in pthread_create() 2014-03-11 14:21:42 +01:00
Sebastian Huber
28779c70ff score: Add function to destroy SMP locks 2014-03-11 10:58:09 +01:00
Sebastian Huber
d50acdbb6c score: Add local context to SMP lock API
Add a local context structure to the SMP lock API for acquire and
release pairs.  This context can be used to store the ISR level and
profiling information.  It may be later used to enable more
sophisticated lock algorithms, e.g. MCS locks.

There is only one lock that cannot be used with a local context.  This
is the per-CPU lock since here we would have to transfer the local
context through a context switch which is very complicated.
2014-03-11 10:58:09 +01:00
Sebastian Huber
ae88aa7927 sapi: Use one SMP lock for all chains
This partially reverts commit 1215fd4d94.

In order to support profiling of SMP locks and provide a future
compatible SMP locks API it is necessary to add an SMP lock destroy
function.  Since the commit above adds an SMP lock to each chain control
we would have to add a rtems_chain_destroy() function as well.  This
complicates the chain usage dramatically.  Thus revert the patch above.
A global SMP lock for all chains is used to implement the protected
chain operations.

Advantages:

* The SAPI chain API is now identical on SMP and non-SMP
  configurations.

* The size of the chain control is reduced and is then equal to the
  Score chains.

* The protected chain operations work correctly on SMP.

Disadvantage:

* Applications using many different chains and the protected operations
  may notice lock contention.

The chain control size drop is a huge benefit (SAPI chain controls are
66% larger than the Score chain controls).  The only disadvantage is not
really a problem since these applications can use specific interrupt
locks and unprotected chain operations to avoid this issue.
2014-03-11 10:58:09 +01:00
Sebastian Huber
b1196e3268 printk: Add support for long long 2014-03-11 10:58:05 +01:00
Sebastian Huber
96c4112d45 posix: Regenerate 2014-03-11 08:06:06 +01:00
Sebastian Huber
0c25ba681f posix: Fix NULL pointer access in pthread_create() 2014-03-10 13:29:23 +01:00
Sebastian Huber
909f61b14a smptests/smppsxaffinity02: Fix end of test message 2014-03-10 13:28:53 +01:00
Sebastian Huber
e7d3967eb1 arm: Fix stack alignment in interrupt handler
According to AAPCS, section 5.2.1.2, "Stack constraints at a public
interface" the stack must be 8 byte aligned.  This was not the case
during interrupt processing.
2014-03-10 08:03:46 +01:00
Sebastian Huber
6b115b3008 bsp/leon3: Use interrupt timestamping counter
Use the interrupt controller timestamping counter for the CPU counter if
available since it runs with a high frequency.
2014-03-10 08:03:46 +01:00
Sebastian Huber
ba15b92370 bsps/sparc: Add missing IRQMP registers 2014-03-10 08:03:46 +01:00
Sebastian Huber
f4accfd466 bsps/sparc: Remove fix for ERC32 with FPU rev. B/C 2014-03-10 08:03:45 +01:00
Joel Sherrill
e6c87f7872 POSIX keys now enabled in all configurations.
Formerly POSIX keys were only enabled when POSIX threads
were enabled. Because they are a truly safe alternative
to per-task variables in an SMP system, they are being
enabled in all configurations.
2014-03-07 13:21:11 -06:00
Jennifer Averett
5c3323492e Remove trailing whitespace in previous patches 2014-03-07 09:15:15 -06:00
Jennifer Averett
2ef0328958 smptests: Add smppsxaffinity02.
This method exercises the ability to dynamically get and set
the affinity of POSIX threads.

NOTE: There is no scheduler support for affinity. This is
simply a data integrity test.
2014-03-07 09:14:33 -06:00
Jennifer Averett
f3e6b18a4a smptests: Add smppsxaffinity01.
This test exercises the ability to obtain and modify
the affinity field of the POSIX thread attributes.
2014-03-07 09:13:35 -06:00
Jennifer Averett
a3e055fe8a smptests: Add smpaffinity01
This test exercises the new Classic API task affinity methods.
2014-03-07 09:13:14 -06:00
Jennifer Averett
c315dbf2f7 psxtests: Added test for pthread_getattr_np(). 2014-03-07 09:13:08 -06:00
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