Commit Graph

8207 Commits

Author SHA1 Message Date
Christian Mauderer
a5385b1f72 score: Unify pthread and gxx_wrapper once and move to score. 2014-03-21 11:21:49 +01:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Christian Mauderer
6cd4a5ca2e cpukit/shell: Replace task variables with posix keys.
Use posix keys for current shell environment instead of task variables. With
this patch the shell needs one posix-key and one posix-key-value-pair
configured.

Update documentation for the shell.

Adapt samples/fileio:
- Add necessary objects.
- Add login function and custom device name for better testing of the shell.
2014-03-20 09:10:26 +01:00
Sebastian Huber
f31311aa67 score: Add _Assert_Not_reached() 2014-03-19 08:34:27 +01:00
Sebastian Huber
72f4b98be7 score: Add _Debug_Is_owner_of_allocator() 2014-03-19 08:34:27 +01:00
Sebastian Huber
a3dd225b88 score: Delete _Assert_Owner_of_giant()
Add _Debug_Is_owner_of_giant().  This makes it possible to assert the
opposite.
2014-03-19 08:34:27 +01:00
Sebastian Huber
ff25926701 score: Delete _Assert_Thread_dispatching_repressed
Add _Debug_Is_thread_dispatching_allowed().  This makes it possible to
assert the opposite.

Use _ISR_Disable_without_giant()/_ISR_Enable_without_giant() to avoid
misleading secondary assertion failures.
2014-03-19 08:34:26 +01:00
Sebastian Huber
51f823c932 posix: Use interal mutex for once implementation
Enable pthread_once() for all configurations.  The pthread_once()
function is one means to initialize POSIX keys.  Another use case is the
C++ support.
2014-03-19 08:34:26 +01:00
Sebastian Huber
fa3993d92d score: Make _ISR_Enable_without_giant() available
Make _ISR_Enable_without_giant() available for non-SMP configurations.
2014-03-18 13:10:47 +01:00
Sebastian Huber
614cd7a468 rtems: Include missing header file 2014-03-18 10:07:06 +01:00
Sebastian Huber
d6da1b1ef4 score: Use only next field for chain on/off
It is sufficient to use one field for the chain on/off indication.  The
chain API functions are highly performance critical.
2014-03-17 09:17:37 +01:00
Sebastian Huber
840ae715a9 sapi: Add <rtems/test.h>
Provide support functions to print the begin/end of test message.
Provide a test fatal extension to print out profiling reports in the
future.
2014-03-17 09:17:36 +01:00
Daniel Cederman
2a37016b89 score: Add include for uintptr_t definition. 2014-03-17 08:36:18 +01:00
Sebastian Huber
148d6e9a15 arm: Add support for interrupt profiling 2014-03-14 08:46:50 +01:00
Sebastian Huber
53ad908a64 score: Add SMP lock profiling support 2014-03-14 08:46:49 +01:00
Sebastian Huber
f980561ee0 score: Add per-CPU profiling
Add per-CPU profiling stats API.  Implement the thread dispatch disable
level profiling.  The interrupt profiling must be implemented in CPU
port specific parts (mostly assembler code).  Add a support function
_Profiling_Outer_most_interrupt_entry_and_exit() for this purpose.
2014-03-14 08:46:49 +01:00
Sebastian Huber
350f88dc6e sapi: Add SMP lock profiling app. level data 2014-03-14 08:46:49 +01:00
Sebastian Huber
29c9eb601e sapi: Add per-CPU profiling application level data 2014-03-14 08:46:49 +01:00
Sebastian Huber
4dad4b8411 sapi: Add profiling application level support 2014-03-14 08:46:49 +01:00
Sebastian Huber
eafb040d91 score: Add --enable-profiling configure option 2014-03-14 08:46:48 +01:00
Ralf Kirchner
27545fcac8 network: Add help text for ifconfig 2014-03-13 16:10:52 +01:00
Sebastian Huber
4d3e933466 sapi: Typos 2014-03-13 16:03:55 +01: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
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
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
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
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
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
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
Joel Sherrill
6b998feeb2 taskmode: Formatting correction 2014-03-05 17:12:06 -06: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