Commit Graph

2981 Commits

Author SHA1 Message Date
Sebastian Huber
df55d07f2e score: Untangle thread actions
Remove the thread action handler parameter from
_Thread_Action_initialize() and instead set it later in
_Thread_Add_post_switch_action().  This avoids a dependency on the
thread action handler via the thread initialization.
2015-12-11 08:20:48 +01:00
Sebastian Huber
d0c3983814 Use linker set for system initialization
Make rtems_initialize_data_structures(),
rtems_initialize_before_drivers() and rtems_initialize_device_drivers()
static.  Rename rtems_initialize_start_multitasking() to
rtems_initialize_executive() and call the registered system
initialization handlers in this function.  Add system initialization API
available via #include <rtems/sysinit.h>.  Update the documentation
accordingly.

This is no functional change, only the method to call the existing
initialization routines changes.  Instead of direct function calls a
table of function pointers contained in the new RTEMS system
initialization linker set is used.  This table looks like this (the
actual addresses depend on the target).

nm *.exe | grep _Linker | sort
0201a2d0 D _Linker_set__Sysinit_begin
0201a2d0 D _Linker_set__Sysinit_bsp_work_area_initialize
0201a2d4 D _Linker_set__Sysinit_bsp_start
0201a2d8 D _Linker_set__Sysinit_rtems_initialize_data_structures
0201a2dc D _Linker_set__Sysinit_bsp_libc_init
0201a2e0 D _Linker_set__Sysinit_rtems_initialize_before_drivers
0201a2e4 D _Linker_set__Sysinit_bsp_predriver_hook
0201a2e8 D _Linker_set__Sysinit_rtems_initialize_device_drivers
0201a2ec D _Linker_set__Sysinit_bsp_postdriver_hook
0201a2f0 D _Linker_set__Sysinit_end

Add test sptests/spsysinit01.

Update #2408.
2015-12-11 08:17:16 +01:00
Sebastian Huber
b318cb138f sparc: Simplify _CPU_Get_current_per_CPU_control()
Drop the superfluous parenthesis since this confuses the C++ compiler of
some GCC versions.  See also

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67064
2015-12-10 08:32:36 +01:00
Sebastian Huber
b618d8cfc5 Add RTEMS linker sets
Update #2408.
2015-12-08 09:25:22 +01:00
Sebastian Huber
9736283857 score: Statically initialize system state
Update #2408.
2015-12-08 08:43:41 +01:00
Sebastian Huber
bd91f446f2 score: Delete unused API extensions
Update #2408.
2015-12-08 08:38:10 +01:00
Sebastian Huber
60c5461547 score: Statically initialize API extensions
Update #2408.
2015-12-08 08:38:06 +01:00
Sebastian Huber
8054b1c718 Remove <rtems/debug.h>
Close #2477.
2015-12-07 13:11:07 +01:00
Sebastian Huber
ac5f2442e3 Require __getreent()
This function is used by Newlib since 2013-07-09 (Git commit
9b51cd8c6b9cdd067d9648a7ab952884019c56a5).
2015-11-25 08:33:31 +01:00
Sebastian Huber
8ce0b0cb19 Fix _Assert() statement 2015-11-25 07:55:00 +01:00
Daniel Cederman
78cac9b092 sparc: Fix context switch on SMP
We must not load registers (e.g. PSR) from the heir context area before
the heir stopped execution.

With this patch the write to PSR is divided into two steps. We first update
the current window pointer and then we restore the status registers and
enable traps. This allows us to move the first write to PSR to be before
the write to WIM, as there is now no risk that we get an interrupt where
the CWP and WIM would be inconsistent. We only need to make sure that we
do not use any of the non-global registers or instructions that affects
CWP for three instructions after the write.

In the earlier code the non-global %o1 register was used right after the
write to PSR, which required the use of three nop:s.
2015-11-16 14:48:54 +01:00
Sebastian Huber
b84a51c8a4 score: Fix race condition on SMP
We must ensure that the Thread_Control::Wait information update is
visible to the target thread before we update its wait flags, otherwise
we may return out of date events or a wrong status.
2015-11-12 08:21:45 +01:00
Sebastian Huber
5c7bfcf82e Fix interrupt epilogue for ARMv7-AR and PowerPC 2015-11-12 08:21:45 +01:00
Sebastian Huber
eab538cf9e score: Fix warning
Close #2454.
2015-11-04 07:39:45 +01:00
Sebastian Huber
e96feebdd1 powerpc: Add FSL cache defines 2015-10-28 13:04:19 +01:00
Sebastian Huber
bc792bb3bd basdefs.h: Add and use RTEMS_PACKED 2015-10-26 09:13:19 +01:00
Sebastian Huber
f97536dcd3 basdefs.h: Add and use RTEMS_UNUSED 2015-10-26 09:13:19 +01:00
Sebastian Huber
c52568dcdb basdefs.h: Add and use RTEMS_DEPRECATED 2015-10-26 09:13:19 +01:00
Sebastian Huber
a3ba5b3798 basdefs.h: Add RTEMS_PURE 2015-10-26 09:13:19 +01:00
Sebastian Huber
143696acbd basedefs.h: Add and use RTEMS_NO_RETURN 2015-10-26 09:13:19 +01:00
Sebastian Huber
2423857f38 basedefs.h: Add compiler attributes 2015-10-26 09:13:19 +01:00
Sebastian Huber
6959e663e4 epiphany: Delete CPU_UNROLL_ENQUEUE_PRIORITY 2015-10-07 09:13:23 +02:00
Sebastian Huber
ba1ed5240b SMP: Optimize ticket lock implementation
This reverts the relevant part of commit
da06fe948c.  The acquire/release order is
superfluous for the next ticket increment.  The mutual exclusion is
guaranteed by the acquire load from and release store to the next
serving atomic variable.
2015-10-02 08:05:21 +02:00
Sebastian Huber
08317ef3ff powerpc: Use wrtee for e6500 multilib
This reduces the code size.
2015-10-02 07:30:13 +02:00
Sebastian Huber
258ad71e96 SMP: Fix and optimize thread dispatching
According to the C11 and C++11 memory models only a read-modify-write
operation guarantees that we read the last value written in modification
order.  Avoid the sequential consistent thread fence and instead use the
inter-processor interrupt to set the thread dispatch necessary
indicator.
2015-09-28 13:56:57 +02:00
Sebastian Huber
aee6a1d05f SMP: Simplify thread lock operations 2015-09-28 07:45:54 +02:00
Sebastian Huber
8d296cd54e score: Use uintptr_t for atomic pointer operations
Do not obfuscate the standard API.
2015-09-26 21:23:53 +02:00
Sebastian Huber
1f7c5c88ca score: Fix atomic compare exchange 2015-09-25 21:48:24 +02:00
Martin Galvan
f52885b6bc ARMv7M: Improve exception handler routine and add comments on SP selection
This patch adds a brief description of how context state is saved into the
SP on exception entry, and makes a few changes to _ARMV7M_Exception_default
in order to make it a bit more efficient. I also removed the unused 'v7mfsz'
input parameter.

This should apply over Sudarshan's patch.
2015-09-23 14:53:25 +02:00
Sudarshan Rajagopalan
7263a50d6c Fix exception handler for supporting FPU 2015-09-23 14:52:55 +02:00
Sebastian Huber
314ff3c43f score: Fix resource count for self-contained mutex 2015-09-14 08:30:09 +02:00
Sebastian Huber
dafa5d8843 score: Implement priority boosting 2015-09-04 13:26:17 +02:00
Sebastian Huber
3995e6d9c2 score: Implement SMP-specific priority queue 2015-09-04 13:25:03 +02:00
Sebastian Huber
c4db18a0bb score: Documentation 2015-09-04 13:14:54 +02:00
Sebastian Huber
edf640f8cf rbtree: Add _RBTree_Replace_node() 2015-09-03 13:58:24 +02:00
Sebastian Huber
e9fbaa3b48 rbtree: Replace implementation
Use the BSD <sys/tree.h> implementation since it is faster, more
flexible and uses less storage.  See https://github.com/sebhub/rb-bench.
2015-09-03 13:58:16 +02:00
Sebastian Huber
8c25e04606 score: Optimize thread queue first operation
In case the thread queue heads exist, then the queue is not empty.  See
_Thread_queue_First_locked().
2015-09-02 15:02:27 +02:00
Sebastian Huber
44f3ea917f score: Fix return status of mutex try acquire
This fixes a copy and paste error (from libbsd).
2015-09-01 12:50:56 +02:00
Sebastian Huber
95b43d0dde arm: Replace __sync_synchronize() implementation 2015-09-01 09:59:26 +02:00
Sebastian Huber
39e3e20140 arm: Use compiler memory barrier by default 2015-09-01 09:59:18 +02:00
Sebastian Huber
509e8d7f4d rbtree: Delete rtems_rbtree_find_control()
This function is hard to support in alternative implementations.  It has
no internal use case.
2015-09-01 09:07:08 +02:00
Sebastian Huber
f71e67dc56 rbtree: Delete unused RBTREE_NODE_*() macros 2015-08-31 09:59:42 +02:00
Sebastian Huber
ddb6a49bdf rbtree: Delete _RBTree_Initialize()
This function has no internal use case.
2015-08-31 09:59:42 +02:00
Sebastian Huber
b9877ee03d rbtree: Delete _RBTree_Get()
This function has no internal use case.
2015-08-31 09:59:42 +02:00
Sebastian Huber
2d48456ef5 rbheap: Drop direction from _RBTree_Iterate() 2015-08-31 09:59:42 +02:00
Sebastian Huber
3f49446e54 rbtree: Delete _RBTree_Is_first() 2015-08-31 09:59:41 +02:00
Sebastian Huber
341f629614 rbtree: Add _RBTree_Minimum(), _RBTree_Maximum() 2015-08-31 09:59:41 +02:00
Jan Sommer
7e798b4758 Add __synch_synchronize function for arm
Fixes link failure when linking Ada programs on the raspberry pi
2015-08-01 10:19:40 -07:00
Sebastian Huber
9e9e61d27d score: Add self-contained condition implementation 2015-07-30 09:11:18 +02:00
Sebastian Huber
a1b4af4bba score: Add scheduler <sys/lock.h> support 2015-07-30 09:11:18 +02:00