Commit Graph

28202 Commits

Author SHA1 Message Date
Sebastian Huber
f59f2fe93e score: Accept NULL pointer in _Freechain_Put()
With this a _Freechain_Put( _Freechain_Get() ) works always.
2015-07-01 08:24:45 +02:00
Sebastian Huber
fdb45d6b26 score: Freechain handler API changes
Replace the extend function with an allocator since this fits better
to the current use case.
2015-07-01 08:24:31 +02:00
Sebastian Huber
cb2b8f02dd doc: Fix interrupt level ARM documentation 2015-06-26 21:39:16 +02:00
Sebastian Huber
d84408a9aa doc: Update ARM documentation 2015-06-26 21:28:06 +02:00
Sebastian Huber
32005a7284 bsp/mpc55xxevb: Fix configure script
This was the only configure.ac file with bspopts.h present in
AC_CONFIG_FILES().  This somehow prevented the generation of this file
leading to build errors for this BSP.
2015-06-26 09:40:24 +02:00
Sebastian Huber
27f08f5b72 bsps/arm: Update due to API changes 2015-06-26 09:40:03 +02:00
Sebastian Huber
d811daca69 score: Hide SMP lock profiling impl if disabled
The problem is that empty structures have a different size in C and C++.
2015-06-26 09:22:41 +02:00
Sebastian Huber
5f31bbe105 libmisc: Simplify <rtems/stackchk.h>
Drop the <rtems/score/percpu.h> include since this file exposes a lot of
implementation details.
2015-06-26 09:16:29 +02:00
Sebastian Huber
96316d1b50 score: Simplify <rtems/score/scheduler.h>
Drop the <rtems/score/percpu.h> include since this file exposes a lot of
implementation details.
2015-06-26 09:16:29 +02:00
Sebastian Huber
48fed9a56e score: Simplify <rtems/system.h>
Drop the <rtems/score/percpu.h> include since this file exposes a lot of
implementation details.
2015-06-26 09:16:25 +02:00
Sebastian Huber
270ccc5907 score: Fix extern "C" in <rtems/score/heap.h> 2015-06-25 14:10:57 +02:00
Sebastian Huber
bd67d7d2f8 score: Simplify <rtems/score/thread.h>
Avoid Thread_Control typedef in <rtems/score/percpu.h>.  This helps to
get rid of the <rtems/score/percpu.h> include in <rtems/score/thread.h>
which exposes a lot of implementation details.
2015-06-25 13:55:34 +02:00
Sebastian Huber
0b268b8bdb score: Move default _ISR_Is_in_progress() 2015-06-25 13:55:32 +02:00
Sebastian Huber
8042107a6e score: Move SMP CPU_USE_DEFERRED_FP_SWITCH check 2015-06-25 11:28:59 +02:00
Sebastian Huber
a3fc33f8fa score: Assert proper node size 2015-06-24 14:24:27 +02:00
Sebastian Huber
df8341ae30 bsp/gen5200: Simplify interrupt write support 2015-06-24 08:46:32 +02:00
Sebastian Huber
cdf30f0550 rtems: Add rtems_interrupt_local_disable|enable()
Add rtems_interrupt_local_disable|enable() as suggested by Pavel Pisa to
emphasize that interrupts are only disabled on the current processor.
Do not define the rtems_interrupt_disable|enable|flash() macros and
functions on SMP configurations since they don't ensure system wide
mutual exclusion.
2015-06-22 08:40:26 +02:00
Sebastian Huber
f9090ac82d tmtests/tm27: Use scheduler lock 2015-06-19 21:38:52 +02:00
Sebastian Huber
f22af606d4 sptests/sp37: Fix type and simplify 2015-06-19 21:21:27 +02:00
Sebastian Huber
1cfe012543 nfsclient: Use an interrupt lock 2015-06-19 14:24:27 +02:00
Sebastian Huber
9d8389021c arm: Implement _CPU_ISR_Get_level() for ARMv7-M 2015-06-15 20:45:56 +02:00
Joel Sherrill
e0938c2754 user/conf.t: Fix names for CONFIGURE_UNLIMITED_OBJECTS and CONFIGURE_UNLIMITED_ALLOCATION_SIZE
closes #2368.
2015-06-15 13:22:31 -05:00
Joel Sherrill
e6b31b27fb Remove use ticks for statistics configure option.
This was obsolete and broken based upon recent time keeping changes.

Thie build option was previously enabled by adding
USE_TICKS_FOR_STATISTICS=1 to the configure command line.

This propagated into the code as preprocessor conditionals
using the __RTEMS_USE_TICKS_FOR_STATISTICS__ conditional.
2015-06-15 13:20:17 -05:00
Sebastian Huber
80fca28198 score: Add _Watchdog_Preinitialize()
Add an assert to ensure that the watchdog is the proper state for a
_Watchdog_Initialize().  This helps to detect invalid initializations
which may lead to a corrupt watchdog chain.
2015-06-13 15:51:21 +02:00
Sebastian Huber
258d580c42 score: Delete unused state WATCHDOG_REMOVE_IT 2015-06-13 14:49:23 +02:00
Sebastian Huber
0562060f07 sptests/sptasknopreempt01: New test
Update #2365.
2015-06-12 13:59:47 +02:00
Joel Sherrill
becbedac78 pc386/console/fb*.c: Use atomics to avoid dependency on pthreads
closes #2364.
2015-06-11 08:06:33 -07:00
Sebastian Huber
aa2a62ce34 rtems: Do not switch off the FP attribute
This is necessary after commit 335e5caa9a.
2015-06-11 10:47:38 +02:00
Sebastian Huber
f718e790e1 Revert "timecounter: No _Timecounter_Tick_simple() for SMP"
This reverts commit 46ae1d7a2b.

The _Timecounter_Tick_simple() function actually doesn't switch to the
next timehand, so it is all right to use the simple timecounter approach
even on SMP configurations.  The use of simple timecounters is not
recommended however since they impose a performance penalty.
2015-06-11 09:56:18 +02:00
Sebastian Huber
46ae1d7a2b timecounter: No _Timecounter_Tick_simple() for SMP 2015-06-09 21:31:27 +02:00
Gedare Bloom
6f55315ff2 cpukit/rtems: Fix doc for rtems_clock_get_ticks_per_second
closes #2357.
2015-06-09 13:54:26 -04:00
Gedare Bloom
fecc911b41 doc: fix typo. closes #2361. 2015-06-09 11:46:23 -04:00
kib
e1d61fe2aa timecounter: Synchronize with FreeBSD
When updating/accessing the timehands, barriers are needed to ensure
that:
- th_generation update is visible after the parameters update is
  visible;
- the read of parameters is not reordered before initial read of
  th_generation.

On UP kernels, compiler barriers are enough.  For SMP machines, CPU
barriers must be used too, as was confirmed by submitter by testing on
the Freescale T4240 platform with 24 PowerPC processors.

Submitted by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	1 week
2015-06-09 14:56:02 +02:00
ian
7e1a9ac5b5 timecounter: Synchronize with FreeBSD
Implement a mechanism for making changes in the kernel<->driver PPS
interface without breaking ABI or API compatibility with existing drivers.

The existing data structures used to communicate between the kernel and
driver portions of PPS processing contain no spare/padding fields and no
flags field or other straightforward mechanism for communicating changes
in the structures or behaviors of the code.  This makes it difficult to
MFC new features added to the PPS facility.  ABI compatibility is
important; out-of-tree drivers in module form are known to exist.  (Note
that the existing api_version field in the pps_params structure must
contain the value mandated by RFC 2783 and any RFCs that come along after.)

These changes introduce a pair of abi-version fields which are filled in
by the driver and the kernel respectively to indicate the interface
version.  The driver sets its version field before calling the new
pps_init_abi() function.  That lets the kernel know how much of the
pps_state structure is understood by the driver and it can avoid using
newer fields at the end of the structure that it knows about if the driver
is a lower version.  The kernel fills in its version field during the init
call, letting the driver know what features and data the kernel supports.

To implement the new version information in a way that is backwards
compatible with code from before these changes, the high bit of the
lightly-used 'kcmode' field is repurposed as a flag bit that indicates the
driver is aware of the abi versioning scheme.  Basically if this bit is
clear that indicates a "version 0" driver and if it is set the driver_abi
field indicates the version.

These changes also move the recently-added 'mtx' field of pps_state from
the middle to the end of the structure, and make the kernel code that uses
this field conditional on the driver being abi version 1 or higher.  It
changes the only driver currently supplying the mtx field, usb_serial, to
use pps_init_abi().

Reviewed by:	hselasky@
2015-06-09 14:56:02 +02:00
ian
cb6fde65c1 timecounter: Synchronize with FreeBSD
Use sbuf_printf() for sysctl strings instead of stack buffers and snprintf().
2015-06-09 14:56:02 +02:00
hselasky
b5b8116d20 timecounter: Synchronize with FreeBSD
Add mutex support to the pps_ioctl() API in the kernel.
Bump kernel version to reflect structure change.

PR:		196897
MFC after:	1 week
2015-06-09 14:56:02 +02:00
Sebastian Huber
2ccd150d28 sptests/sptimecounter03: New test 2015-06-09 14:56:02 +02:00
Sebastian Huber
7919f70e8f score: Fix compiler memory barriers for atomic ops 2015-06-09 14:56:02 +02:00
Sebastian Huber
30f8412ab3 bsps/sparc: tlib clock driver timecounter support 2015-06-09 10:01:50 +02:00
Sebastian Huber
b88d346fbd sptests/spcontext01: Add second volatile clobber
Do a volatile clobber in the context switch extension to cover the path
through _Thread_Do_dispatch() invoked after interrupt processing.
2015-06-09 09:28:36 +02:00
Sebastian Huber
a51b3526ea sparc: Add SPARC_USE_SAFE_FP_SUPPORT
The SPARC ABI is a bit special with respect to the floating point context.
The complete floating point context is volatile.  Thus from an ABI point
of view nothing needs to be saved and restored during a context switch.
Instead the floating point context must be saved and restored during
interrupt processing.  Historically the deferred floating point switch is
used for SPARC and the complete floating point context is saved and
restored during a context switch to the new floating point unit owner.
This is a bit dangerous since post-switch actions (e.g. signal handlers)
and context switch extensions may silently corrupt the floating point
context.  The floating point unit is disabled for interrupt handlers.
Thus in case an interrupt handler uses the floating point unit then this
will result in a trap.

On SMP configurations the deferred floating point switch is not
supported in principle.  So use here a safe floating point support.  Safe
means that the volatile floating point context is saved and restored
around a thread dispatch issued during interrupt processing.  Thus
post-switch actions and context switch extensions may safely use the
floating point unit.

Update #2270.
2015-06-09 09:05:50 +02:00
Sebastian Huber
335e5caa9a score: Add Thread_Control::is_fp
Store the floating-point unit property in the thread control block
regardless of the CPU_HARDWARE_FP and CPU_SOFTWARE_FP settings.  Make
sure the floating-point unit is only enabled for the corresponding
multilibs.  This helps targets which have a volatile only floating point
context like SPARC for example.
2015-06-09 09:05:50 +02:00
Sebastian Huber
b276507552 sptests/spcontext01: Improve output 2015-06-03 10:07:23 +02:00
Sebastian Huber
f455cdeabe rtems: Change CONTEXT_FP_SIZE define
Define CONTEXT_FP_SIZE to zero in case hardware and software floating
point support is disabled.  The problem is that empty structures have a
different size in C and C++.  In C++ they have a non-zero size leading
to an overestimate of the workspace size.
2015-06-03 09:20:51 +02:00
Sebastian Huber
43d7005829 smptests/smpscheduler02: Reduce required CPU count 2015-06-03 09:19:34 +02:00
Sebastian Huber
2c14e67342 smptests/smpmrsp01: Reduce required CPU count 2015-06-03 09:19:34 +02:00
Sebastian Huber
f48b73deb6 smptests/smpscheduler03: Use proper lock 2015-06-03 09:19:34 +02:00
Sebastian Huber
863dcf458b score: Remove assert
With the introduction of fine grained locking there is no longer a
one-to-one connection between the Giant lock nest level and the thread
dispatch disable level.
2015-06-03 09:19:34 +02:00
Sebastian Huber
f9a2d36455 posix: Fix _POSIX_Timer_Insert_helper() locking
Close #2358.
2015-06-03 09:18:52 +02:00
Alexander Krutwig
2764bd43d0 sparc: Disable FPU in interrupt context
Update #2270.
2015-05-30 16:46:36 +02:00