Commit Graph

26457 Commits

Author SHA1 Message Date
Ralf Kirchner
dda78f43d5 bsp/altera-vyclone-v: Broadcast cache maintenances 2014-05-28 14:59:01 +02:00
Ralf Kirchner
5fd4e35f9b bsp/arm: Broadcast cache maintenances 2014-05-28 14:59:01 +02:00
Sebastian Huber
8fcafdd553 score: Multiprocessor Resource Sharing Protocol
Add basic support for the Multiprocessor Resource Sharing Protocol
(MrsP).

The Multiprocessor Resource Sharing Protocol (MrsP) is defined in A.
Burns and A.J.  Wellings, A Schedulability Compatible Multiprocessor
Resource Sharing Protocol - MrsP, Proceedings of the 25th Euromicro
Conference on Real-Time Systems (ECRTS 2013), July 2013.  It is a
generalization of the Priority Ceiling Protocol to SMP systems.  Each
MrsP semaphore uses a ceiling priority per scheduler instance.  These
ceiling priorities can be specified with rtems_semaphore_set_priority().
A task obtaining or owning a MrsP semaphore will execute with the
ceiling priority for its scheduler instance as specified by the MrsP
semaphore object.  Tasks waiting to get ownership of a MrsP semaphore
will not relinquish the processor voluntarily.  In case the owner of a
MrsP semaphore gets preempted it can ask all tasks waiting for this
semaphore to help out and temporarily borrow the right to execute on one
of their assigned processors.

The help out feature is not implemented with this patch.
2014-05-28 10:50:41 +02:00
Daniel Cederman
9f058fb1c2 bsps/sparc: Change tabs to spaces. 2014-05-27 09:46:30 +02:00
Daniel Cederman
c903fc28a9 bsps/sparc: Add copyright and license information 2014-05-27 09:46:22 +02:00
Daniel Cederman
363b1f7f02 bsps/sparc: Make lines in SPARC BSPs adhere to 80 character limit. 2014-05-27 09:46:13 +02:00
Chris Johns
97d0b9bb6a bsp/gdbarmsim: Switch to the standard arm/shared/startup.
Switch to the standard ARM startup code. This requires adding the
standard interrupt code. The interrupt code does nothing at this
point in time. I do not know if the ARM simulator in GDB supports
interrupts.
2014-05-26 22:02:00 +10:00
Sebastian Huber
d134adeba3 score: Fix race condition in SMP startup
Do not use the Per_CPU_Control::started in
_SMP_Start_multitasking_on_secondary_processor() since this field may be
not up to date when a secondary processor reads it.  Use the read-only
scheduler assignment instead.

Add a new fatal error SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR.
This prevents out-of-bounds access.

It is currently not possible to test these fatal errors.  One option
would be to fake values of the _CPU_SMP_Get_current_processor(), but
unfortunately this function is inline on some architectures.
2014-05-26 08:56:44 +02:00
Chris Johns
b3fb2fff42 bsp/gdbarmsim: Change syscall functions to not clash with RTEMS functions.
The syscall functions overlapped with RTEMS, for example _write, _read, etc.
Change these to be internal to the BSP and avoid any clash with names in
RTEMS. Add support for SWI_Write0.

Change the console driver to use SWI_Write0. This outputs the character
to the host's stdout. Writing to file name 0 is not captured and managed
by GDB's simulation code while the SWI_Write0 is. The managed stdout
data is encapulated in the MI protocol while writes to file handle 0 are
dropped by GDB when in MI mode.
2014-05-26 11:52:02 +10:00
Chris Johns
5c123985a1 tools: Add rtems-bsp to list BSPs in the source tree.
This is a shell script that lists the BSPs in the source tree by
architecture. The BSP name is given plus the relative path to
BSP source files.

The script uses the same hack, ie looking for *.cfg files, as the
build system so it sees what the build system sees.
2014-05-24 11:04:45 +10:00
Daniel Hellstrom
6a740c2e70 SPARC: add syscall 1 (exit) function entry point
The exit SPARC system call doesn't have a function entry
point like the others do. This is probably why people use
TA 0x0 instruction directly for shutting down the system.
2014-05-23 09:14:15 -05:00
Daniel Hellstrom
434e7f7bee SPARC: syscall code clean-up and minor optimizations 2014-05-23 09:14:08 -05:00
Sebastian Huber
b3049a1d90 score: Use _SMP_Fatal() 2014-05-23 15:51:51 +02:00
Daniel Hellstrom
0af322c51e SMP: make IPI fatal code unique
The same smp fatal code is used in percpu
_Per_CPU_State_change(). In order to determine which CPU
requested a fatal shutdown and which CPU responds to it a
unique code should be used.

A unique code makes it also possible to handle the CPUs
differently in the fatal exception handler.
2014-05-23 15:49:37 +02:00
Sebastian Huber
4edf348c33 score: PR2179: Fix initially locked PCP mutexes
Elevate the priority of the creating task to the ceiling priority in
case a semaphore is created as initially locked.
2014-05-23 08:57:32 +02:00
Joel Sherrill
decff88836 c/src/aclocal/check-smp.m4: Use HAS_SMP not HAS_POSIX_API 2014-05-22 18:05:46 -05:00
Joel Sherrill
40741c44ac cpuset.c: Fix formatting 2014-05-22 17:58:57 -05:00
Chris Johns
3cbedb1ba8 testsuite: Add a user keypress to start pppd.
Allow the test to run and pass when automatic testing.
2014-05-22 19:56:50 +10:00
Chris Johns
e9d980713c bsp/zynq: Add BSP_ZYNQ_RAM_LENGTH to allow a user to override the RAM length.
The Zynq BSPs can be used with varations of hardware such as memory size.
This option lets you set a length.
2014-05-22 16:53:25 +10:00
Chris Johns
18bd35bcb3 bsps/zynq: Add BSP_ARM_A9MPCORE_UARTCLK to set the UART clock rate.
This value can be found the xparameters.h file generated by the
Xilinx tools.
2014-05-22 16:53:24 +10:00
Chris Johns
eae0863a1c rtems: Fix sp2038 test.
Avoid using newlib's gmtime_r call which fails with a max signed int.
Add an RTEMS specific version for 1/1/1988 to 31/12/2100.

Update sp2038 to test every day from 1/1/1988 to 31/12/2100. Only days
need be tested as the code splits the seconds based on days.
2014-05-22 16:38:01 +10:00
Sebastian Huber
a070c8bb81 rtems: Simplify rtems_semaphore_obtain() 2014-05-22 07:59:34 +02:00
Joel Sherrill
1bf0666448 schedulersmpimpl.h: Fix spacing 2014-05-21 15:08:23 -05:00
Sebastian Huber
82f9074308 score: _Thread_Set_life_protection()
Enable usage of _Thread_Set_life_protection() in thread dispatch
critical sections.  This can be used to enable the thread
life-protection with thread dispatching disabled and then enable thread
dispatching.
2014-05-21 11:48:25 +02:00
Sebastian Huber
c8e832886a score: Add and use _Scheduler_Get_index_by_id() 2014-05-21 11:48:25 +02:00
Sebastian Huber
4ddc3b53c6 score: Add const qualifier 2014-05-21 11:48:24 +02:00
Sebastian Huber
884a6c59ba score: Add comment regarding TLS workspace size 2014-05-21 09:41:01 +02:00
Sebastian Huber
40f2eafefd score: Simplify _Scheduler_Set() 2014-05-21 08:30:25 +02:00
Sebastian Huber
e5274df1d9 rtems: Clarify task set/get scheduler parameters 2014-05-20 10:03:35 +02:00
Sebastian Huber
2d96533299 score: SMP scheduler support documentation 2014-05-20 08:06:43 +02:00
Sebastian Huber
39840438bb dosfs: Fix read from invalid memory area 2014-05-16 15:34:33 +02:00
Sebastian Huber
1ac0b083f8 score: Simplify SMP scheduler support 2014-05-16 10:56:49 +02:00
Sebastian Huber
b532bb2c1e score: Fix state diagram 2014-05-16 10:56:49 +02:00
Sebastian Huber
c0bff5e936 score: Split SMP scheduler enqueue function
Extract code from _Scheduler_SMP_Enqueue_ordered() and move it to the
new function _Scheduler_SMP_Enqueue_scheduled_ordered() to avoid
untestable execution paths.

Add and use function _Scheduler_SMP_Unblock().
2014-05-15 12:18:49 +02:00
Sebastian Huber
b4bdbcfe27 score: Make _Thread_queue_Requeue() static
This function is only used by _Thread_Change_priority().  Make it static
to avoid the function call overhead in the performance critical function
_Thread_Change_priority().
2014-05-15 12:18:49 +02:00
Sebastian Huber
6359b68afe score: Add and use _Scheduler_SMP_Start_idle() 2014-05-15 12:18:49 +02:00
Sebastian Huber
3733b22410 score: Add and use _Scheduler_default_Schedule() 2014-05-15 12:18:48 +02:00
Sebastian Huber
f39f667a69 score: Simplify _Thread_Change_priority()
The function to change a thread priority was too complex.  Simplify it
with a new scheduler operation.  This increases the average case
performance due to the simplified logic.  The interrupt disabled
critical section is a bit prolonged since now the extract, update and
enqueue steps are executed atomically.  This should however not impact
the worst-case interrupt latency since at least for the Deterministic
Priority Scheduler this sequence can be carried out with a wee bit of
instructions and no loops.

Add _Scheduler_Change_priority() to replace the sequence of
  - _Thread_Set_transient(),
  - _Scheduler_Extract(),
  - _Scheduler_Enqueue(), and
  - _Scheduler_Enqueue_first().

Delete STATES_TRANSIENT, _States_Is_transient() and
_Thread_Set_transient() since this state is now superfluous.

With this change it is possible to get rid of the
SCHEDULER_SMP_NODE_IN_THE_AIR state.  This considerably simplifies the
implementation of the new SMP locking protocols.
2014-05-15 12:18:44 +02:00
Sebastian Huber
2369b10a71 score: Add and use _Scheduler_Get_context() 2014-05-14 17:01:22 +02:00
Sebastian Huber
0f41cc3f4b score: _Scheduler_priority_Ready_queue_requeue()
Delete unused function _Scheduler_priority_Ready_queue_requeue().
2014-05-14 16:49:27 +02:00
Sebastian Huber
c21c5912a8 score: Add STATES_RESTARTING
Use separate state for thread restart.
2014-05-14 16:49:27 +02:00
Sebastian Huber
01f302bd55 score: Typo 2014-05-14 16:49:27 +02:00
Sebastian Huber
0e8d55b0ca monitor: Support STATES_MIGRATING 2014-05-14 16:49:27 +02:00
Sebastian Huber
249eaf9991 bsps/sparc: Fix BSS initialization
Use __bss_start available via %g2 to clear the BSS section.  The usage
of _edata resulted in a copy of [_edata, __bss_start) from ROM to RAM
and then a clear to zero of this area.

Clear now only [__bss_start, _end).
2014-05-14 14:46:20 +02:00
Sebastian Huber
b2d191e833 bsps/sparc: Fix data copy in start procedure
Use the register %g4 for the data content since it must be an even
numbered register due to the std/ldd.  Use the register %g2 for the BSS
start address, so that it can be later re-used for the BSS zero loop.
2014-05-14 14:46:20 +02:00
Sebastian Huber
3730a07fac score: Use Scheduler_Context for SMP scheduler
Use the basic Scheduler_Context for the general SMP scheduler operations
to avoid usage of structure offsets to get the specialized context
variants.
2014-05-14 14:46:20 +02:00
Sebastian Huber
e9ee2f034d score: Capitalize SMP acronym 2014-05-14 14:46:20 +02:00
Sebastian Huber
c6522a6564 score: SMP scheduler documentation 2014-05-14 14:46:20 +02:00
Sebastian Huber
beab7329fc score: Introduce scheduler nodes
Rename scheduler per-thread information into scheduler nodes using
Scheduler_Node as the base type.  Use inheritance for specialized
schedulers.

Move the scheduler specific states from the thread control block into
the scheduler node structure.

Validate the SMP scheduler node state transitions in case RTEMS_DEBUG is
defined.
2014-05-14 14:46:19 +02:00
Sebastian Huber
5b1ff71ab7 score: Scheduler documentation 2014-05-14 14:46:19 +02:00