Commit Graph

9219 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
2858939a2c bsps: Delete superfluous bsp_pretasking_hook()
Use the bsp_predriver_hook() instead.

Update #2408.
2015-12-10 08:32:37 +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
a06201439a Delete _Region_Debug_Walk()
The expensive heap walks are superfluous due to the heap protection
enabled via RTEMS_DEBUG.

Update #2477.
2015-12-07 13:10:50 +01:00
Sebastian Huber
50552818d7 Delete unused declarations and define 2015-11-27 07:25:01 +01:00
Sebastian Huber
443c61ec94 Delete empty libc_init() 2015-11-27 07:24:51 +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
Sebastian Huber
f6a1ef9fdb posix: Require struct _pthread_cleanup_context
This structure is available in Newlib since 2013-11-29 (Git commit
a534dfd26e765047621acd0eda656ded886e7108).
2015-11-24 16:00:14 +01:00
Pavel Pisa
9394aa5ed7 untar: do not exit with error when created directory already exists.
The problem exists for both RTEMS untar implementations and their
variants: Untar_FromMemory(), Untar_FromFile() and rtems_tarfs_load().

If filesystem object already exists at extracted directory path
then if it is directory, creation is ignored. Attempt
to delete/unlink object and make directory is tried for other cases.

This simple approach problem reported in ticket fixes #2413.
Behavior follows GNU tar and BSD tar practice for directories
but much more work is required to achieve full semantics
of the full featured tar implementation still.
2015-11-23 10:40:15 -05:00
Sebastian Huber
8708900e53 Provide dummy <sys/priority.h>
Required by new network stack.
2015-11-18 09:22:48 +01:00
Sebastian Huber
8f3ec7c0d9 Import latest <sys/ttycom.h> from FreeBSD
Required by new network stack.
2015-11-17 15:22:18 +01:00
Sebastian Huber
f757bb7c4b Merge with latest <sys/sockio.h> from FreeBSD
Required by new network stack.
2015-11-17 15:12:34 +01:00
Sebastian Huber
836803f72a Import latest <sys/filio.h> from FreeBSD
Required by new network stack.
2015-11-17 14:57:47 +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
4fee1296e9 Introduce general purpose system server event
Use this event for the interrupt server to avoid conflicts with
application events used by interrupt handlers.
2015-11-12 08:21:44 +01:00
Sebastian Huber
aa473025f7 sapi: Add rtems_chain_get_first_unprotected()
Close #2459.
2015-11-05 11:30:09 +01:00
Sebastian Huber
eab538cf9e score: Fix warning
Close #2454.
2015-11-04 07:39:45 +01:00
Sebastian Huber
08a807b0ad libblock: Print block sizes and count 2015-11-02 08:21:49 +01:00
Sebastian Huber
09d4f629b2 libblock: Avoid NULL pointer access 2015-11-02 08:21:49 +01:00
Jan Sommer
65243416f9 ada: Add missing include
Include stackimpl.h otherwise PTHREAD_MINIMUM_STACK_SIZE cannot be
evaluated.
2015-10-30 07:44:45 +01:00
Sebastian Huber
e96feebdd1 powerpc: Add FSL cache defines 2015-10-28 13:04:19 +01:00
Joel Sherrill
69be1a222a CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK was undocumented and not error checked
closes #2431.
2015-10-27 07:31:29 -05: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
7d59bb6229 RFS: Fix resource leak
Close #2433.
2015-10-26 07:29:47 +01:00
Sebastian Huber
c03c71b170 libfdt: Merge into librtemscpu
This allows BSPs to use this library.
2015-10-19 09:51:28 +02:00
Sebastian Huber
175263ec91 libfdt: Initial import
Import from:

git://git.kernel.org/pub/scm/utils/dtc/dtc.git

Commit:

604e61e081e3c6c8fa1a8189c71cb3908a5bbc1e

Date:

2015-09-29T09:09:08Z
2015-10-16 07:46:56 +02:00
Sebastian Huber
cff773f580 libstdthreads: Add C11 threads 2015-10-14 07:47:12 +02:00
Sebastian Huber
e3330899f3 libstdthreads: Import from FreeBSD 2015-10-14 07:47:12 +02: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