Commit Graph

220 Commits

Author SHA1 Message Date
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
51f823c932 posix: Use interal mutex for once implementation
Enable pthread_once() for all configurations.  The pthread_once()
function is one means to initialize POSIX keys.  Another use case is the
C++ support.
2014-03-19 08:34:26 +01:00
Joel Sherrill
e6c87f7872 POSIX keys now enabled in all configurations.
Formerly POSIX keys were only enabled when POSIX threads
were enabled. Because they are a truly safe alternative
to per-task variables in an SMP system, they are being
enabled in all configurations.
2014-03-07 13:21:11 -06:00
Sebastian Huber
3c96bee3f9 JFFS2: Add RTEMS support 2013-09-19 13:16:06 +02:00
Chris Johns
6e4c01e3a2 posix: Update to the pthread_once changes.
Implement the reeview changes.
Add a POSIX Fatal error domain.
Fix confdefs.h to correctly handle the internal POSIX mutexes.
2013-08-23 14:56:36 +10:00
Sebastian Huber
99b35052ae smp: Add Deterministic Priority SMP Scheduler 2013-08-20 10:17:35 +02:00
Sebastian Huber
9d83f58ab8 smp: Replace Scheduler_simple_smp_Control
Replace Scheduler_simple_smp_Control with Scheduler_SMP_Control.  Rename
_Scheduler_simple_smp_Instance() to _Scheduler_SMP_Instance().
2013-08-20 10:14:04 +02:00
Chris Johns
03acc5915e posix: Change pthread_once to be SMP safe.
Change pthread_once from using disabled pre-emption to using a
pthread mutex making it SMP safe. GCC using a posix threading
model uses pthread_once.

The pthread mutex requires at least 1 mutex is configured so
confdefs.h has been updated to account for the internal
mutex.
2013-08-14 10:21:41 +10:00
Zhongwei Yao
b5c906429f Unlimited objects support for POSIX keys
This patch enables unlimited model in POSIX key manger and have a decent
runtime on POSIX key searching, adding and deleting operations.  Memory
overhead is lower than current implementation when the size of key and key
value becomes big.
2013-08-06 14:11:38 +02:00
Sebastian Huber
c236082873 smp: Provide cache optimized Per_CPU_Control
Delete _Per_CPU_Information_p.
2013-07-31 15:09:04 +02:00
Sebastian Huber
05e82bd76b score: Error for non-preemptible tasks on SMP
A common use case for disabled preemption was to ensure mutual exclusion
on single-processor configurations.  On SMP this does not work.

To abandon non-preemptible tasks simplifies the scheduler.
2013-07-22 16:46:01 +02:00
Sebastian Huber
f913c796ff sapi: Add rtems_configuration_is_smp_enabled()
Add a configuration field which indicates if the SMP mode of operation
is enabled.  This can be used to disable features unsupported on SMP,
e.g task variables.
2013-07-22 16:46:01 +02:00
Sebastian Huber
9c9b62d8dd score: Changes due to Newlib __DYNAMIC_REENT__
Delete _Thread_libc_reent and add __getreent() instead according to
__DYNAMIC_REENT__ define.

For SMP configurations __DYNAMIC_REENT__ must be defined.

A Newlib including the following patch is required:

2013-07-09  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libc/include/sys/config.h (__DYNAMIC_REENT__): Define for RTEMS.
2013-07-17 13:09:49 +02:00
Sebastian Huber
a936aa49b5 scheduler: New simple SMP scheduler implementation
The new Simple SMP Scheduler allocates a processor for the processor
count highest priority ready threads.  The thread priority and position
in the ready chain are the only information to determine the scheduling
decision.  Threads with an allocated processor are in the scheduled
chain.  After initialization the scheduled chain has exactly processor
count nodes.  Each processor has exactly one allocated thread after
initialization.  All enqueue and extract operations may exchange threads
with the scheduled chain.  One thread will be added and another will be
removed.  The scheduled and ready chain is ordered according to the
thread priority order.  The chain insert operations are O(count of ready
threads), thus this scheduler is unsuitable for most real-time
applications.

The thread preempt mode will be ignored.
2013-06-14 16:26:08 +02:00
Sebastian Huber
6c2eedc7dd smp: Add maximum_processors field to config
Delete rtems_configuration_get_smp_maximum_processors().  Delete
rtems_configuration_smp_maximum_processors variable.  Add
maximum_processors field to rtems_configuration_table if RTEMS_SMP is
defined.  Add rtems_configuration_get_maximum_processors().
2013-05-16 11:44:12 +02:00
Sebastian Huber
b7cf1ff717 libcsupport: Delete libc_wrapup()
Add and use rtems_libio_exit_helper.  Add rtems_libio_exit().

The fclose(stdin) etc. makes no sense during exit.  This would use the
_REENT structure of the thread calling _exit().
2013-04-26 10:57:08 +02:00
Sebastian Huber
5fa0e5c5ec libcsupport: Rename open_dev_console()
Rename open_dev_console() to rtems_libio_post_driver().  Rename
rtems_libio_supp_helper to rtems_libio_post_driver_helper.
2013-04-26 10:57:08 +02:00
Sebastian Huber
a290fbe946 libcsupport: Make LibIO helper const
Add and use rtems_libio_helper function type.  Add and use
rtems_libio_helper_null() instead of NULL pointer.
2013-04-26 10:57:08 +02:00
Sebastian Huber
dc76d98a53 sapi: Fix unified workspace option 2013-04-11 13:57:10 +02:00
Joel Sherrill
6784547afd confdefs.h: Only one clock or timer configuration parameter can be defined
Only one of the following can be defined.

+ CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+ CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+ CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER

Otherwise it is a configuration error which can be detected at
compilation time.
2013-04-09 13:15:40 -05:00
Joel Sherrill
92b33b8d09 confdefs.h: Eliminate BSP_DEFAULT_UNIFIED_WORK_AREAS
This was not used by any BSP and obsolete now that unified memory
is an option for all BSPs.
2013-04-09 13:15:39 -05:00
Sebastian Huber
7571a235c5 sapi: PR1911: Add CONFIGURE_DISABLE_BSP_SETTINGS 2013-02-12 09:31:27 +01:00
Alex Ivanov
27f071cd88 sapi: Doxygen Clean Up Task #1 2013-01-08 07:13:41 -06:00
Mathew Kallada
9ab091e1e4 Header File Doxygen Enhancement Task #2 2012-12-28 10:36:55 -06:00
Sebastian Huber
f9340ed7f4 posix: Add and use <rtems/posix/psignalimpl.h>
This file contains the parts of <rtems/posix/psignal.h> that are only
necessary for the POSIX API implementation.
2012-12-05 18:07:05 +01:00
Sebastian Huber
228df42204 sapi: Add BSP_INITIAL_EXTENSION to confdefs.h
A BSP can supply an initial extension via the new optional
BSP_INITIAL_EXTENSION define.  It will be the last in the initial
extension table.
2012-11-13 09:38:02 +01:00
Sebastian Huber
466cf31d81 score: Statically initialize user extensions
The initial extensions remain now in a read-only table and will not be
copied to work space memory.  The extension chains are statically
initialized.  This makes it possible to call _User_extensions_Iterate()
independent of the system state.  It is now guaranteed that the fatal
callout of the initial extensions will be called provided the stack
pointer, the read-only data, and code memory are valid.
2012-11-13 09:20:57 +01:00
Sebastian Huber
9ed2befb6b score: Add and use RTEMS_ARRAY_SIZE() 2012-11-13 09:20:57 +01:00
Sebastian Huber
2195fd27a7 sapi: Make initial user extensions table read-only 2012-11-07 15:19:21 +01:00
Sebastian Huber
b59675438e sapi: Fix user scheduler configuration
The comment in confdefs.h shows how to do it:

An application can define its own scheduling policy by defining
CONFIGURE_SCHEDULER_USER and the following:
   - CONFIGURE_SCHEDULER_ENTRY_POINTS
   - CONFIGURE_MEMORY_FOR_SCHEDULER - base memory
   - CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER - per task memory
2012-11-07 15:19:20 +01:00
Sebastian Huber
ae4f125e86 sapi: Make Configuration read-only
The Configuration is now read-only and must be statically initialized
via confdefs.h or similar.
2012-11-07 15:08:46 +01:00
Sebastian Huber
ef5f3598ad sapi: Delete duplicate declarations 2012-11-07 15:08:45 +01:00
Sebastian Huber
47a3cd8f73 score: Work area initialization API change
The work areas (RTEMS work space and C program heap) will be initialized
now in a separate step and are no longer part of
rtems_initialize_data_structures().  Initialization is performed with
tables of Heap_Area entries.  This allows usage of scattered memory
areas present on various small scale micro-controllers.

The sbrk() support API changes also.  The bsp_sbrk_init() must now deal
with a minimum size for the first memory chunk to take the configured
work space size into account.
2012-10-25 14:54:06 +02:00
Sebastian Huber
50fc8f65a6 sapi: Add nanoseconds_per_tick to configuration
Add nanoseconds_per_tick to rtems_configuration_table.  This value will
be derived from the microseconds_per_tick value.  This avoids some
calculations at run-time.
2012-06-14 14:20:30 +02:00
Sebastian Huber
39ee704e75 libblock: Add read-ahead task
Read-ahead requests were previously executed in the context of the
reading task.  This blocks the reading task until the complete read
with read-ahead transfer is finished.  A read-ahead task is introduced
to off-load the read-ahead transfer.  This allows the reading task to
work with the requested block more quickly.  The read-ahead is triggered
after two misses of ascending consecutive blocks or a read hit of a
block read by the most-recent read-ahead transfer.  The read-ahead
feature is configurable and can be disabled.
2012-06-04 09:54:31 +02:00
Sebastian Huber
b6911069d4 libblock: Add task stack size bdbuf configuration
The task stack size for the swap-out and worker tasks is now
configurable.  The bdbuf task resources are now included in the work
space size estimate.
2012-05-31 11:05:48 +02:00
Joel Sherrill
9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Sebastian Huber
5a4bb758c0 Filesystem: Remove per file descriptor semaphore
The per file descriptor semaphore (field of rtems_libio_t) is unused in
RTEMS.  There is a considerable memory overhead due to that.  A
semaphore needs roughly 124 bytes which is huge compared to the
approximately 72 bytes for the file descriptor structure itself.  Device
drivers can create their own synchronization primitives in the open
handler on demand.
2012-05-04 10:53:51 +02:00
Sebastian Huber
5eb434e67e score: New macros and functions
New macros
  o _Objects_Maximum_per_allocation(),
  o rtems_resource_is_unlimited(), and
  o rtems_resource_maximum_per_allocation().

New function
  o _Objects_Is_unlimited().
2012-04-11 15:24:39 +02:00
Gedare Bloom
e53aae2676 confdefs: Add declaration for unlimited objects.
Adds to confdefs a way to specify rtems_resource_unlimited for classic and
posix objects using a new macro CONFIGURE_OBJECTS_UNLIMITED.
Use CONFIGURE_OBJECTS_ALLOCATION_SIZE to declare the allocation size for
extending the set of objects at runtime. Updates the unlimited sample
to demonstrate how to use the new macros. Also adds new documentation in
the C User's Manual regarding configuring with unlimited objects.
2012-03-27 19:51:31 -04:00
Sebastian Huber
3b7c123c8d Filesystem: Reference counting for locations
o A new data structure rtems_filesystem_global_location_t was
   introduced to be used for
    o the mount point location in the mount table entry,
    o the file system root location in the mount table entry,
    o the root directory location in the user environment, and
    o the current directory location in the user environment.
   During the path evaluation global start locations are obtained to
   ensure that the current file system instance will be not unmounted in
   the meantime.
 o The user environment uses now reference counting and is protected
   from concurrent access.
 o The path evaluation process was completely rewritten and simplified.
   The IMFS, RFS, NFS, and DOSFS use now a generic path evaluation
   method.  Recursive calls in the path evaluation have been replaced
   with iteration to avoid stack overflows.  Only the evaluation of
   symbolic links is recursive.  No dynamic memory allocations and
   intermediate buffers are used in the high level path evaluation.  No
   global locks are held during the file system instance specific path
   evaluation process.
 o Recursive symbolic link evaluation is now limited by
   RTEMS_FILESYSTEM_SYMLOOP_MAX.  Applications can retrieve this value
   via sysconf().
 o The device file system (devFS) uses now no global variables and
   allocation from the workspace.  Node names are allocated from the
   heap.
 o The upper layer lseek() performs now some parameter checks.
 o The upper layer ftruncate() performs now some parameter checks.
 o unmask() is now restricted to the RWX flags and protected from
   concurrent access.
 o The fchmod_h and rmnod_h file system node handlers are now a file
   system operation.
 o The unlink_h operation has been removed.  All nodes are now destroyed
   with the rmnod_h operation.
 o New lock_h, unlock_h, clonenod_h, and are_nodes_equal_h file system
   operations.
 o The path evaluation and file system operations are now protected by
   per file system instance lock and unlock operations.
 o Fix and test file descriptor duplicate in fcntl().
 o New test fstests/fsnofs01.
2012-03-13 12:23:37 +01:00
Ralf Corsépius
5693f2e69b 2012-02-22 Ralf Corsépius <ralf.corsepius@rtems.org>
* sapi/include/confdefs.h:
	Add decl of configuration_mount_table (Fix c++ mangling).
2012-02-22 10:02:42 +01:00
Sebastian Huber
9fa3cf0db8 2011-12-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1924/cpukit
	* sapi/include/rtems/config.h: Added stack_allocate_init_hook to
	rtems_configuration_table.
	* sapi/include/confdefs.h: Added CONFIGURE_TASK_STACK_FROM_ALLOCATOR
	and CONFIGURE_TASK_STACK_ALLOCATOR_INIT defines.  Set default stack
	allocator and free hook to _Workspace_Allocate() and _Workspace_Free()
	respectively.
	* score/src/thread.c, score/src/threadstackallocate.c,
	score/src/threadstackfree.c: Update due to API changes.
2011-12-14 13:17:19 +00:00
Sebastian Huber
3df4d7424a 2011-12-13 Sebastian Huber <sebastian.huber@embedded-brains.de>
* sapi/include/confdefs.h: Fixed workspace size estimate of tasks.
2011-12-13 14:37:03 +00:00
Sebastian Huber
517bf089dc 2011-12-13 Sebastian Huber <sebastian.huber@embedded-brains.de>
* sapi/include/confdefs.h: Fixed workspace size estimate of POSIX keys
	and message queues.
2011-12-13 10:52:21 +00:00
Ralf Corsepius
b929b39e01 2011-12-05 Ralf Corsépius <ralf.corsepius@rtems.org>
* posix/include/rtems/posix/pthread.h:
	Add _POSIX_Threads_Initialize_user_threads_body.
	* rtems/include/rtems/rtems/tasks.h:
	Add _RTEMS_tasks_Initialize_user_tasks_body.
	* sapi/include/confdefs.h: Remove conditional, nested redeclaration of
	_POSIX_Threads_Initialize_user_threads_body,
	_RTEMS_tasks_Initialize_user_tasks_body.
2011-12-05 13:51:06 +00:00
Jennifer Averett
84e1742810 2011-11-18 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* sapi/include/confdefs.h: Added a bsp override option for
	MAXIMUM_DEVICES.
2011-11-18 20:04:49 +00:00
Sebastian Huber
b4f635e9d0 2011-11-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1924/cpukit
	* sapi/include/rtems/config.h: New fields stack_space_size,
	unified_work_area, and stack_allocator_avoids_work_space in
	rtems_configuration_table.
	* sapi/include/confdefs.h: Removed rtems_unified_work_area (this is
	now part of the Configuration).  Separate work space and stack space
	estimate.  Added CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
	configuration option.
	* libmisc/shell/main_wkspaceinfo.c, score/src/wkspace.c,
	libcsupport/src/malloc_initialize.c: Update due to API changes.
2011-11-10 14:40:13 +00:00
Joel Sherrill
82db8e5675 2011-09-15 Petr Benes <benesp16@fel.cvut.cz>
PR 1906/cpukit
	* sapi/Makefile.am, sapi/preinstall.am, sapi/include/confdefs.h,
	score/Makefile.am, score/preinstall.am: Add the CBS (Constant
	Bandwidth Server) scheduler. This is a complex scheduling policy
	built atop of the EDF scheduler. Unlike other schedulers, this one
	provides a user API and handles not only deadlines of tasks but also
	claimed budget per period. The main aim of the scheduler is isolation
	of tasks so that each task is guaranteed to meet all deadlines
	regardless of how other tasks behave.
	* sapi/include/rtems/cbs.h, sapi/inline/rtems/cbs.inl,
	score/include/rtems/score/schedulercbs.h, score/src/schedulercbs.c,
	score/src/schedulercbsattachthread.c,
	score/src/schedulercbscleanup.c,
	score/src/schedulercbscreateserver.c,
	score/src/schedulercbsdestroyserver.c,
	score/src/schedulercbsdetachthread.c,
	score/src/schedulercbsgetapprovedbudget.c,
	score/src/schedulercbsgetexecutiontime.c,
	score/src/schedulercbsgetparameters.c,
	score/src/schedulercbsgetremainingbudget.c,
	score/src/schedulercbsgetserverid.c,
	score/src/schedulercbsreleasejob.c,
	score/src/schedulercbssetparameters.c,
	score/src/schedulercbsunblock.c: New files.
2011-09-15 15:49:32 +00:00
Joel Sherrill
5472ad414f 2011-09-11 Petr Benes <benesp16@fel.cvut.cz>
PR 1896/cpukit
	* sapi/include/confdefs.h, score/Makefile.am, score/preinstall.am: Add
	Earliest Deadline First (EDF) Scheduling Algorithm implementation.
	* score/include/rtems/score/scheduleredf.h, score/src/scheduleredf.c,
	score/src/scheduleredfallocate.c, score/src/scheduleredfblock.c,
	score/src/scheduleredfenqueue.c,
	score/src/scheduleredfenqueuefirst.c,
	score/src/scheduleredfextract.c, score/src/scheduleredffree.c,
	score/src/scheduleredfprioritycompare.c,
	score/src/scheduleredfreleasejob.c, score/src/scheduleredfschedule.c,
	score/src/scheduleredfunblock.c, score/src/scheduleredfupdate.c,
	score/src/scheduleredfyield.c: New files.
2011-09-11 20:52:37 +00:00