Commit Graph

8207 Commits

Author SHA1 Message Date
Sebastian Huber
0c551f76e5 score: Add _Scheduler_priority_Get_scheduler_info
Add and use _Scheduler_priority_Get_scheduler_info().
2013-08-20 10:14:02 +02:00
Sebastian Huber
e5ca54c996 score: PR2136: Fix _Thread_Change_priority()
Add call to _Scheduler_Schedule() in missing path after
_Thread_Set_transient() in _Thread_Change_priority().  See also
sptests/spintrcritical19.

Add thread parameter to _Scheduler_Schedule().  This parameter is
currently unused but may be used in future SMP schedulers.

Do heir selection in _Scheduler_Schedule().  Use
_Scheduler_Update_heir() for this in the particular scheduler
implementation.

Add and use _Scheduler_Generic_block().
2013-08-20 10:14:02 +02:00
Nick Withers
01b0755035 Expose rtems_verror() 2013-08-15 04:57:56 +10:00
Sebastian Huber
66c00789ef libblock: Add missing initializer 2013-08-14 12:14:31 +02:00
Sebastian Huber
ec98c997e8 posix: Typo 2013-08-14 11:55:51 +02:00
Sebastian Huber
6ccdc5ce8b rtems: Include missing header file 2013-08-14 11:10:45 +02:00
Sebastian Huber
9de9b7d237 libblock: Add SMP support 2013-08-14 11:10:45 +02:00
Sebastian Huber
4180a9bb04 filesystem: Add SMP support 2013-08-14 11:10:44 +02:00
Chris Johns
03acc5915e posix: Change pthread_once to be SMP safe.
Change pthread_once from using disabled pre-emption to using a
pthread mutex making it SMP safe. GCC using a posix threading
model uses pthread_once.

The pthread mutex requires at least 1 mutex is configured so
confdefs.h has been updated to account for the internal
mutex.
2013-08-14 10:21:41 +10:00
Chris Johns
40398c45dc posix: Handle recursive attributes correctly.
The recursive field in the pthread_mutexattr_t is now not used. The
code in pthread_mutexattr_settype only sets the type field and not
the recursive field.
2013-08-14 09:29:56 +10:00
Sebastian Huber
2606fee394 powerpc: Fix _CPU_Context_validate() 2013-08-13 14:48:42 +02:00
Sebastian Huber
f8ad6c6f7f sparc: Make _CPU_ISR_Dispatch_disable per-CPU
This variable must be available for each processor in the system.
2013-08-09 23:02:45 +02:00
Sebastian Huber
88f6c4fc5a sparc: Move _CPU_Context_switch(), etc.
Move the _CPU_Context_switch(), _CPU_Context_restore() and
_CPU_Context_switch_to_first_task_smp() code since the method to obtain
the processor index is BSP specific.
2013-08-09 23:02:44 +02:00
Sebastian Huber
07567903d2 arm: Per-CPU thread dispatch disable
Interrupt support for per-CPU thread dispatch disable level.
2013-08-09 23:02:44 +02:00
Sebastian Huber
d19cce29dc score: Per-CPU thread dispatch disable level
Use a per-CPU thread dispatch disable level.  So instead of one global
thread dispatch disable level we have now one instance per processor.
This is a major performance improvement for SMP.  On non-SMP
configurations this may simplifiy the interrupt entry/exit code.

The giant lock is still present, but it is now decoupled from the thread
dispatching in _Thread_Dispatch(), _Thread_Handler(),
_Thread_Restart_self() and the interrupt entry/exit.   Access to the
giant lock is now available via _Giant_Acquire() and _Giant_Release().
The giant lock is still implicitly acquired via
_Thread_Dispatch_decrement_disable_level().

The giant lock is only acquired for high-level operations in interrupt
handlers (e.g. release of a semaphore, sending of an event).

As a side-effect this change fixes the lost thread dispatch necessary
indication bug in _Thread_Dispatch().

A per-CPU thread dispatch disable level greatly simplifies the SMP
support for the interrupt entry/exit code since no spin locks have to be
acquired in this area.  It is only necessary to get the current
processor index and use this to calculate the address of the own per-CPU
control.  This reduces the interrupt latency considerably.

All elements for the interrupt entry/exit code are now part of the
Per_CPU_Control structure: thread dispatch disable level, ISR nest level
and thread dispatch necessary.  Nothing else is required (except CPU
port specific stuff like on SPARC).
2013-08-09 23:02:38 +02:00
Sebastian Huber
8581725434 score: Add and use _Per_CPU_Acquire_all().
Add and use _Per_CPU_Release_all().

The context switch user extensions are invoked in _Thread_Dispatch().
This change is necessary to avoid the giant lock in _Thread_Dispatch().
2013-08-09 21:58:39 +02:00
Sebastian Huber
7045dc425d smp: Use ISR lock in per-CPU control
Rename _Per_CPU_Lock_acquire() to _Per_CPU_ISR_disable_and_acquire().
Rename _Per_CPU_Lock_release() to _Per_CPU_Release_and_ISR_enable().

Add _Per_CPU_Acquire() and _Per_CPU_Release().
2013-08-09 21:58:39 +02:00
Sebastian Huber
10fd4aacc7 score/cpu: Add CPU_Per_CPU_control
Add CPU port specific per-CPU control.
2013-08-09 21:58:39 +02:00
Nick Withers
712c62d8a5 Add "const void* data" parameter to rtems_rfs_rtems_initialize()'s declaration, matching its definition
See https://www.rtems.org/bugzilla/show_bug.cgi?id=2137
2013-08-09 18:24:31 +10:00
Sebastian Huber
3346106b4c score: Rename _Scheduler_simple_Update()
Rename _Scheduler_simple_Update() in _Scheduler_default_Update().
2013-08-08 14:11:23 +02:00
Sebastian Huber
62d947d368 score: Rename _Scheduler_simple_Allocate(), etc.
Rename _Scheduler_simple_Allocate() in _Scheduler_default_Allocate().
Rename _Scheduler_simple_Free() in _Scheduler_default_Free().
2013-08-08 14:11:22 +02:00
Sebastian Huber
037cfd17b9 score: Rename _Scheduler_priority_Release_job()
Rename _Scheduler_priority_Release_job() into
_Scheduler_default_Release_job().
2013-08-08 14:11:22 +02:00
Sebastian Huber
ae75429ca1 PR766: Delete __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 2013-08-08 14:11:22 +02:00
Sebastian Huber
6b4e448ebe PR766: Delete __RTEMS_INSIDE__ 2013-08-08 14:11:22 +02:00
Sebastian Huber
006304112a PR766: Delete __RTEMS_APPLICATION__
This define is no longer used.
2013-08-08 14:11:21 +02:00
Sebastian Huber
c9b784f3e7 posix: Delete POSIX_Keys_Freechain type
Use the POSIX configuration value directly.  Use right type early and
avoid casts.  Use proper unlimited objects API.  Check workspace
allocation.  Make functions static.
2013-08-08 14:11:21 +02:00
Chris Johns
f65e8e66d0 posix: Add missing header. 2013-08-08 10:21:54 +10:00
Sebastian Huber
b45b0ff783 posix: Use _Objects_Put() for POSIX keys 2013-08-06 15:49:34 +02:00
Sebastian Huber
2ad250e92d posix: Create key implementation header
Move implementation specific parts of key.h and key.inl into new header
file keyimpl.h.  The key.h contains now only the application visible
API.
2013-08-06 15:47:57 +02:00
Zhongwei Yao
b5c906429f Unlimited objects support for POSIX keys
This patch enables unlimited model in POSIX key manger and have a decent
runtime on POSIX key searching, adding and deleting operations.  Memory
overhead is lower than current implementation when the size of key and key
value becomes big.
2013-08-06 14:11:38 +02:00
R. Diez
ffa2defc78 Fix compiler warnings 2013-08-06 11:02:56 +02:00
WeiY
3d68be1854 correct comments about atomic api 2013-08-06 11:02:56 +02:00
Sebastian Huber
71336bf445 arm: Fix ISR level context initialization 2013-08-05 17:31:45 +02:00
Sebastian Huber
bfed5d5d15 smp: Support ASR path in rtems_task_mode() 2013-08-05 15:52:32 +02:00
Sebastian Huber
007bdc4f59 arm: Fix CPU_MODES_INTERRUPT_MASK
The set of interrupt levels must be a continuous range of non-negative
integers starting at zero.
2013-08-05 13:45:37 +02:00
Sebastian Huber
b4b309c559 smp: Generalize _Thread_Start_multitasking()
Add context parameter to _Thread_Start_multitasking() and use this
function in rtems_smp_secondary_cpu_initialize().  This avoids
duplication of code.

Fix missing floating point context initialization in
rtems_smp_secondary_cpu_initialize().  Now performed via
_Thread_Start_multitasking().
2013-08-05 13:45:36 +02:00
Sebastian Huber
2bca05f7d7 score: Delete SYSTEM_STATE_BEGIN_MULTITASKING
Nothing happened between the SYSTEM_STATE_BEGIN_MULTITASKING to
SYSTEM_STATE_UP transition.
2013-08-05 13:45:36 +02:00
Joel Sherrill
26bdc9fc27 bfin/cpu.h: Remove duplicate definition of CPU_SIMPLE_VECTORED_INTERRUPTS 2013-08-01 10:04:18 -05:00
Sebastian Huber
9bf74673f9 score: Use an ISR lock for TOD
Two issues are addressed.

1. On single processor configurations the set/get of the now/uptime
timestamps is now consistently protected by ISR disable/enable
sequences.  Previously nested interrupts could observe partially written
values since 64-bit writes are not atomic on 32-bit architectures in
general.  This could lead to non-monotonic uptime timestamps.

2. The TOD now/uptime maintanence is now independent of the giant lock.
This is the first step to remove the giant lock in _Thread_Dispatch().
2013-08-01 16:45:46 +02:00
Sebastian Huber
965a442a4e score: Move nanoseconds since last tick support
Move the nanoseconds since last tick support from the Watchdog to the
TOD handler.  Now the TOD managment is encapsulated in the TOD_Control
structure.
2013-08-01 16:45:46 +02:00
Sebastian Huber
b915762a68 score: Add and use _TOD_Is_set() 2013-08-01 16:45:45 +02:00
Sebastian Huber
dd8815a0c4 score: Delete _TOD_Activate and _TOD_Deactivate 2013-08-01 16:45:45 +02:00
Sebastian Huber
f031df0e63 score: Rename tod.h to todimpl.h 2013-08-01 16:45:45 +02:00
Sebastian Huber
8d640134ba score: ISR lock API changes 2013-08-01 16:45:45 +02:00
Sebastian Huber
1e51fa5f4d score: Add and use _Thread_Update_cpu_time_used()
Fix _times().
2013-08-01 16:45:44 +02:00
Sebastian Huber
2d915cf389 score: Add and use ISR locks
ISR locks are low-level locks to protect critical sections accessed by
threads and interrupt service routines.

On single processor configurations the ISR locks degrade to simple ISR
disable/enable sequences.  No additional storage or objects are
required.

This synchronization primitive is supported on SMP configurations.  Here
SMP locks are used.
2013-07-31 15:09:04 +02:00
Sebastian Huber
c236082873 smp: Provide cache optimized Per_CPU_Control
Delete _Per_CPU_Information_p.
2013-07-31 15:09:04 +02:00
Sebastian Huber
ac72e3b91e score: Format <rtems/score/percpu.h> 2013-07-31 15:09:04 +02:00
Sebastian Huber
9e6df6adf3 score/cpu: Fix _CPU_SMP_lock_Acquire()
Avoid infinite loops due to compiler optimization.
2013-07-30 17:22:25 +02:00
Sebastian Huber
f346bcf705 score/i386: Fix _CPU_Fatal_halt() 2013-07-30 17:22:24 +02:00