Commit Graph

3489 Commits

Author SHA1 Message Date
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
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
Sebastian Huber
314ff3c43f score: Fix resource count for self-contained mutex 2015-09-14 08:30:09 +02:00
Sebastian Huber
10c4636947 rbheap: Fix rtems_rbheap_free()
Remove unused descriptor of merged free chunks from the free chain and
add them to the spare descriptors.

Close #2417.
2015-09-11 11:28:13 +02:00
Sebastian Huber
5e4714b032 libtests/rbheap01: Simplify
Update #2417.
2015-09-11 11:27:33 +02:00
Sebastian Huber
808230add9 Upgrade to 4.11.99.0 2015-09-11 08:24:18 +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
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
3b3d1489e4 posix: glibc compatibility 2015-09-02 14:05:02 +02:00
Sebastian Huber
d9d0a84f85 psxtests/psxcancel: Check return status
Update #2402.
2015-09-01 14:07:51 +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
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
2d48456ef5 rbheap: Drop direction from _RBTree_Iterate() 2015-08-31 09:59:42 +02:00
Sebastian Huber
d7c93070cc sptests/sprbtree01: Avoid internal API 2015-08-31 09:56:55 +02:00
Sebastian Huber
d128b4f2ed sptests/sprbtree01: Fix random ops test case 2015-08-31 09:56:55 +02: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
Sebastian Huber
40188718f2 score: Add self-contained futex implementation 2015-07-30 09:11:18 +02:00
Sebastian Huber
7237b3e076 score: Add self-contained semaphore implementation 2015-07-30 09:11:18 +02:00
Sebastian Huber
214d8edd18 score: Add self-contained mutex implementation
This mutex implementation uses a thread priority queue with a simple
priority inheritance mechanism (similar to the object based mutexes).
The storage space must be supplied by the user (16 bytes on 32-bit
targets).
2015-07-30 09:11:18 +02:00
Sebastian Huber
08135c85d8 i2c: Fix return status of i2c dev read/write 2015-07-23 09:00:31 +02:00
Sebastian Huber
d7665823b2 score: Introduce Thread_queue_Heads
Move the storage for the thread queue heads to the threads.  Each thread
provides a set of thread queue heads allocated from a dedicated memory
pool.  In case a thread blocks on a queue, then it lends its heads to
the queue.  In case the thread unblocks, then it takes a free set of
threads from the queue.  Since a thread can block on at most one queue
this works.  This mechanism is used in FreeBSD.  The motivation for this
change is to reduce the memory demands of the synchronization objects.
On a 32-bit uni-processor configuration the Thread_queue_Control size is
now 8 bytes, compared to 64 bytes in RTEMS 4.10 (other changes reduced
the size as well).
2015-07-23 08:01:13 +02:00
Sebastian Huber
e273501233 score: Introduce Thread_queue_Queue
Separate the thread queue heads and lock from the operations.  This
enables the support for light weight objects which only support one
queuing discipline.
2015-07-23 08:00:19 +02:00
Sebastian Huber
9341773152 score: Typo 2015-07-13 08:56:57 +02:00
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
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
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
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
0562060f07 sptests/sptasknopreempt01: New test
Update #2365.
2015-06-12 13:59:47 +02:00
Sebastian Huber
2ccd150d28 sptests/sptimecounter03: New test 2015-06-09 14:56:02 +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
b276507552 sptests/spcontext01: Improve output 2015-06-03 10:07:23 +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
18d18e1c4b tmtests/tm26: Fix context switch to FP task
It is wrong to restore the floating point context here.  The
_Context_Switch() ends up in _Thread_Handler() which will call
_Thread_Restore_fp().  In _Thread_Do_dispatch() the FP restore is after
the context switch.
2015-05-29 21:20:31 +02:00
Sebastian Huber
b17fb17a56 Revert "tmtests/tm26: Avoid NULL pointer access"
There is no NULL pointer access.  Please note that
_Thread_Get_executing() != executing variable in Low_task().

This reverts commit 5611839a7e.
2015-05-29 17:51:38 +02:00
Sebastian Huber
5611839a7e tmtests/tm26: Avoid NULL pointer access 2015-05-29 15:06:53 +02:00
Sebastian Huber
9d0913d16c libtests/i2c01: Avoid stack overflow 2015-05-27 12:48:53 +02:00
Sebastian Huber
ec84273de4 score: Replace _API_Mutex_Is_locked()
Replace _API_Mutex_Is_locked() with _API_Mutex_Is_owner().
2015-05-27 12:24:24 +02:00
Sebastian Huber
ee4e7f09b4 jffs2: Move into separate library
In case the zlib compression was used, then the librtemscpu.a depended
on libz.a.  To avoid a GCC patch or complicated link flags move the
JFFS2 support into a separate library to use a simple "-ljffs2 -lz" to
link the executable.
2015-05-27 08:53:05 +02:00
Alexander Krutwig
cba07fcc7a sptests/spcontext01: Test deferred FP context 2015-05-26 10:29:38 +02:00
Alexander Krutwig
7cd2484c4c timecounter: Use in RTEMS
Replace timestamp implementation with FreeBSD bintime and timecounters.

New test sptests/sptimecounter02.

Update #2271.
2015-05-20 08:40:33 +02:00