Commit Graph

750 Commits

Author SHA1 Message Date
Sebastian Huber
c847451b56 sapi: Fix warnings 2017-02-15 13:22:56 +01:00
Sebastian Huber
54835ae9b3 Rename CONFIGURE_SMP_MAXIMUM_PROCESSORS
Rename CONFIGURE_SMP_MAXIMUM_PROCESSORS to CONFIGURE_MAXIMUM_PROCESSORS
since the SMP part is superfluous.

Update #2894.
2017-02-14 09:52:05 +01:00
Sebastian Huber
07d71279b4 Prefix confdefs.h internal def with an underscore
Close #2895.
2017-02-03 11:14:58 +01:00
Sebastian Huber
d4ff66e423 confdefs.h: Simplify 2017-02-03 08:44:27 +01:00
Kevin Kirspel
f9db6fd63d confdefs.h: Only define _CONFIGURE_SMP_APPLICATION if RTEMS_SMP defined 2017-02-02 16:44:31 -06:00
Sebastian Huber
f95fa38764 Remove CONFIGURE_SMP_APPLICATION
Enable the SMP support if CONFIGURE_SMP_MAXIMUM_PROCESSORS > 1.

Update #2893.
2017-02-02 09:07:08 +01:00
Sebastian Huber
d1505a19c7 sapi: Add rtems_task_terminate_extension 2017-01-26 11:05:00 +01:00
Gedare Bloom
ba77628250 posix: shared memory support
Add POSIX shared memory manager (Shm). Includes a hook-based
approach for the backing memory storage that defaults to the
Workspace, and a test is provided using the heap. A test is
also provided for the basic use of mmap'ing a shared memory
object. This test currently fails at the mmap stage due to
no support for mmap.
2017-01-13 11:17:30 -05:00
Sebastian Huber
da6ad56a68 score: Add _Thread_Set_name()
Add configuration option CONFIGURE_MAXIMUM_THREAD_NAME_SIZE.

Update #2858.
2017-01-13 08:10:28 +01:00
Sebastian Huber
eae4541d7b Clarify simple timecounter documentation 2016-12-21 09:27:19 +01:00
Sebastian Huber
e203b65e51 Add INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED
Update #2825.
2016-12-12 08:03:30 +01:00
Sebastian Huber
a5ba08eb4f Add INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED
Update #2825.
2016-12-12 08:03:30 +01:00
Sebastian Huber
9622f7796f Add INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED
Update #2825.
2016-12-12 08:03:30 +01:00
Sebastian Huber
8252968812 INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED
Update #2825.
2016-12-12 08:03:29 +01:00
Sebastian Huber
0a81a58254 Add INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED
Update #2825.
2016-12-12 08:03:29 +01:00
Sebastian Huber
279d5260c3 Add INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED
Update #2825.
2016-12-12 08:03:29 +01:00
Sebastian Huber
b6606e8d99 score: Remove fatal is internal indicator
The fatal is internal indicator is redundant since the fatal source and
error code uniquely identify a fatal error.  Keep the fatal user
extension is internal parameter for backward compatibility and set it to
false always.

Update #2825.
2016-12-09 08:47:51 +01:00
Sebastian Huber
4b579c5f51 score: Simplify linker set API
Resurrect RTEMS_LINKER_SET_BEGIN() and RTEMS_LINKER_SET_END().

Add new macros RTEMS_LINKER_SET_ITEM_COUNT(),
RTEMS_LINKER_SET_IS_EMPTY(), and
RTEMS_LINKER_SET_FOREACH().

Remove confusing RTEMS_LINKER_SET_ASSIGN_BEGIN() and
RTEMS_LINKER_SET_ASSIGN_END().

Fix RTEMS_LINKER_SET_SIZE() to return the size in characters as
specified by the documentation.

Update #2408.
Update #2790.
2016-12-06 11:37:20 +01:00
Sebastian Huber
bee0323279 score: Uncomment unused internal error codes
Update #2825.
2016-11-23 12:52:07 +01:00
Sebastian Huber
c42be504c9 posix: Add self-contained pthread spinlock
Turn pthread_spinlock_t into a self-contained object.  On uni-processor
configurations, interrupts are disabled in the lock/trylock operations
and the previous interrupt status is restored in the corresponding
unlock operations.  On SMP configurations, a ticket lock is a acquired
and released in addition.

The self-contained pthread_spinlock_t object is defined by Newlib in
<sys/_pthreadtypes.h>.

typedef struct {
  struct _Ticket_lock_Control _lock;
  __uint32_t                  _interrupt_state;
} pthread_spinlock_t;

This implementation is simple and efficient.  However, this test case of
the Linux Test Project would fail due to call of printf() and sleep()
during spin lock ownership:

https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c

There is only limited support for profiling on SMP configurations.

Delete CORE spinlock implementation.

Update #2674.
2016-11-23 12:52:06 +01:00
Sebastian Huber
125f248231 score: Add thread queue enqueue callout
Replace the expected thread dispatch disable level with a thread queue
enqueue callout.  This enables the use of _Thread_Dispatch_direct() in
the thread queue enqueue procedure.  This avoids impossible exection
paths, e.g. Per_CPU_Control::dispatch_necessary is always true.
2016-11-23 12:52:06 +01:00
Sebastian Huber
84e6f15c82 score: Robust thread dispatch
On SMP configurations, it is a fatal error to call blocking operating
system with interrupts disabled, since this prevents delivery of
inter-processor interrupts. This could lead to executing threads which
are not allowed to execute resulting in undefined behaviour.

The ARM Cortex-M port has a similar problem, since the interrupt state
is not a part of the thread context.

Update #2811.
2016-11-23 12:52:06 +01:00
Sebastian Huber
d78d5294cd score: Add and use _Thread_Dispatch_direct()
This function is useful for operations which synchronously block, e.g.
self restart, self deletion, yield, sleep.  It helps to detect if these
operations are called in the wrong context.  Since the thread dispatch
necessary indicator is not used, this is more robust in some SMP
situations.

Update #2751.
2016-11-18 07:30:31 +01:00
Sebastian Huber
e6107854b2 score: Rename _Scheduler_Assignments
Rename _Scheduler_Assignments into _Scheduler_Initial_assignments to
make it clear that they may not reflect the run-time scheduler
assignment.

Update #2797.
2016-11-09 15:27:29 +01:00
Sebastian Huber
3a27248054 score: First part of new MrsP implementation
Update #2556.
2016-11-02 10:05:43 +01:00
Sebastian Huber
be573185e6 score: More robust linker sets
Update #2408.
Update #2790.
2016-10-12 11:12:40 +02:00
Sebastian Huber
5d6b211981 score: Add scheduler node table for each thread
Update #2556.
2016-09-21 08:59:32 +02:00
Sebastian Huber
796f12a85a score: Add missing const qualifiers 2016-09-06 10:52:19 +02:00
Sebastian Huber
aaaf9610db score: Add debug support to red-black trees
This helps to detect double insert and extract errors.
2016-08-08 09:34:29 +02:00
Sebastian Huber
d79df38c2b score: Add deadlock detection
The mutex objects use the owner field of the thread queues for the mutex
owner.  Use this and add a deadlock detection to
_Thread_queue_Enqueue_critical() for thread queues with an owner.

Update #2412.
Update #2556.
Close #2765.
2016-07-27 10:55:30 +02:00
Sebastian Huber
059529e685 score: Add debug support to chains
This helps to detect

 * double insert, append, prepend errors, and
 * get from empty chain errors.
2016-07-22 09:13:07 +02:00
Sebastian Huber
69a6802bfa score: Move _RBTree_Find()
The _RBTree_Find() is no longer used in the score.  Move it to sapi and
make it rtems_rbtree_find().  Move corresponding types and support
functions to sapi.
2016-06-22 14:37:11 +02:00
Sebastian Huber
768c483b70 score: Move _RBTree_Insert()
The _RBTree_Insert() is no longer used in the score.  Move it to sapi
and make it rtems_rbtree_insert().
2016-06-22 14:37:11 +02:00
Sebastian Huber
251c94d3d3 confdefs.h: Do not hide network file systems
Do not hide network file systems if RTEMS_NETWORKING is not defined,
since they may be provided by the LibBSD.
2016-06-09 11:17:13 +02:00
Sebastian Huber
93306058c0 score: _CORE_mutex_Check_dispatch_for_seize()
Move the safety check performed by
_CORE_mutex_Check_dispatch_for_seize() out of the performance critical
path and generalize it.  Blocking on a thread queue with an unexpected
thread dispatch disabled level is illegal in all system states.

Add the expected thread dispatch disable level (which may be 1 or 2
depending on the operation) to Thread_queue_Context and use it in
_Thread_queue_Enqueue_critical().
2016-05-30 16:16:21 +02:00
Sebastian Huber
25e28d84d7 confdefs.h: Fix heap alloc size estimate
Account for the heap minimum block size.
2016-05-25 12:43:53 +02:00
Chris Johns
24d0ee57a4 cpukit, testsuite: Add rtems_printf and rtems_printer support.
This change adds rtems_printf and related functions and wraps the
RTEMS print plugin support into a user API. All references to the
plugin are removed and replaced with the rtems_printer interface.

Printk and related functions are made to return a valid number of
characters formatted and output.

The function attribute to check printf functions has been added
to rtems_printf and printk. No changes to remove warrnings are part
of this patch set.

The testsuite has been moved over to the rtems_printer. The testsuite
has a mix of rtems_printer access and direct print control via the
tmacros.h header file. The support for begink/endk has been removed
as it served no purpose and only confused the code base. The testsuite
has not been refactored to use rtems_printf. This is future work.
2016-05-25 15:47:34 +10:00
Sebastian Huber
7dfb4b970c score: Add per scheduler instance maximum priority
The priority values are only valid within a scheduler instance.  Thus,
the maximum priority value must be defined per scheduler instance.  The
first scheduler instance defines PRIORITY_MAXIMUM.  This implies that
RTEMS_MAXIMUM_PRIORITY and POSIX_SCHEDULER_MAXIMUM_PRIORITY are only
valid for threads of the first scheduler instance.  Further
API/implementation changes are necessary to fix this.

Update #2556.
2016-05-20 16:11:02 +02:00
Sebastian Huber
876dde7a7d score: Make _Objects_Information_table const
The _Objects_Information_table is statically initialized.  So, we can
make it read-only.
2016-05-04 07:24:30 +02:00
Sebastian Huber
1d40d81b4b rtems: Remove task variables
Update #2494.
Update #2555.
2016-05-04 07:24:30 +02:00
Sebastian Huber
b1b6f3b0e0 confdefs.h: Fix message queue size estimate
Account for maximum message size alignment.  Simplify
_CORE_message_queue_Initialize().
2016-05-04 07:24:29 +02:00
Sebastian Huber
e4fd35ddcb confdefs.h: Fix named object size estimate
Account for the terminating null character.  Use _POSIX_PATH_MAX instead
of NAME_MAX according to _POSIX_Semaphore_Manager_initialization() and
_POSIX_Message_queue_Manager_initialization().
2016-05-04 07:24:29 +02:00
Sebastian Huber
981eed2176 score: Add dummy Strong APA scheduler
Start with a copy of the Priority SMP scheduler implementation.

Update #2510.
2016-05-02 07:46:17 +02:00
Sebastian Huber
c8982e5f6a posix: Simplify message queues
The mq_open() function returns a descriptor to a POSIX message queue
object identified by a name.  This is similar to sem_open().  In
contrast to the POSIX semaphore the POSIX message queues use a separate
object for the descriptor.  This extra object is superfluous, since the
object identifier can be used directly for this purpose, just like for
the semaphores.

Update #2702.
Update #2555.
2016-05-02 07:46:15 +02:00
Sebastian Huber
d7a12be9c3 score: Optimize _Objects_Get_no_protection()
Make the id the first parameter since usual callers get the object
identifier as the first parameter themself.
2016-04-21 07:29:40 +02:00
Sebastian Huber
f05eeb2091 score: Simplify _Objects_Initialize_information()
Remove unused supports_global parameter.  Convert
_Objects_Initialize_information() to a macro to avoid use of
RTEMS_MULTIPROCESSING define for each caller.
2016-04-21 07:29:39 +02:00
Sebastian Huber
362722795a sapi: Avoid Giant lock for extensions
Extension create and delete is protected by the object allocator lock.

Update #2555.
2016-04-18 08:20:12 +02:00
Sebastian Huber
d995a263b5 score: Delete _Chain_Append()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:24 +02:00
Sebastian Huber
3bf2bcc8c6 score: Delete _Chain_Get()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:24 +02:00
Sebastian Huber
223fff46b8 score: Delete _Chain_Extract()
This function is not used in the score.

Update #2555.
2016-04-06 09:08:23 +02:00