Commit Graph

181 Commits

Author SHA1 Message Date
Sebastian Huber
8905201985 monitor: Replace puts() with proper fprintf() 2014-12-03 13:03:13 +01:00
Josh Oguin
d4ec0a2d75 monitor/mon-prmisc.c: Use puts() not fprintf()
CodeSonar flagged this as a case where the user could inject a format
string and cause issues. Since we were not printing anything but a
string, just switching to puts() rather than fprintf(stdout,...) was
sufficient to make this code safer.
2014-11-26 07:52:00 -06:00
Josh Oguin
90a8e42be4 monitor/mon-editor.c: Use puts() and snprintf() not fprintf() or sprintf()
CodeSonar flagged this as a case where the user could inject a format
string and cause issues. Since we were not printing anything but a
string, just switching to puts() rather than fprintf(stdout,...) was
sufficient to make this code safer.

snprintf() places a limit on the length of the output from sprintf()
and avoids similar buffer overrun issues.
2014-11-26 07:51:59 -06:00
Sebastian Huber
f39f667a69 score: Simplify _Thread_Change_priority()
The function to change a thread priority was too complex.  Simplify it
with a new scheduler operation.  This increases the average case
performance due to the simplified logic.  The interrupt disabled
critical section is a bit prolonged since now the extract, update and
enqueue steps are executed atomically.  This should however not impact
the worst-case interrupt latency since at least for the Deterministic
Priority Scheduler this sequence can be carried out with a wee bit of
instructions and no loops.

Add _Scheduler_Change_priority() to replace the sequence of
  - _Thread_Set_transient(),
  - _Scheduler_Extract(),
  - _Scheduler_Enqueue(), and
  - _Scheduler_Enqueue_first().

Delete STATES_TRANSIENT, _States_Is_transient() and
_Thread_Set_transient() since this state is now superfluous.

With this change it is possible to get rid of the
SCHEDULER_SMP_NODE_IN_THE_AIR state.  This considerably simplifies the
implementation of the new SMP locking protocols.
2014-05-15 12:18:44 +02:00
Sebastian Huber
c21c5912a8 score: Add STATES_RESTARTING
Use separate state for thread restart.
2014-05-14 16:49:27 +02:00
Sebastian Huber
0e8d55b0ca monitor: Support STATES_MIGRATING 2014-05-14 16:49:27 +02:00
Sebastian Huber
263f4becea score: Statically initialize IO manager
This simplifies the RTEMS initialization and helps to avoid a memory
overhead.  The workspace demands of the IO manager were not included in
the <rtems/confdefs.h> workspace size estimate.  This is also fixed as a
side-effect.

Update documentation and move "Specifying Application Defined Device
Driver Table" to the section end.  This sub-section is not that
important for the user.  Mentioning this at the beginning may lead to
confusion.
2014-04-10 12:37:40 +02:00
Sebastian Huber
03e8928753 score: Delete CORE_mutex_Control::lock
The holder field is enough to determine if a mutex is locked or not.

This leads also to better error status codes in case a
rtems_semaphore_release() is done for a mutex without having the
ownership.
2014-03-31 10:14:42 +02:00
Sebastian Huber
b1ce11614b score: Delete CORE_mutex_Control::holder_id
We can use the holder pointer to get the identifier if necessary.
2014-03-31 10:14:42 +02:00
Sebastian Huber
1b1be254e7 score: Thread life cycle re-implementation
The thread deletion is now supported on SMP.

This change fixes the following PRs:

PR1814: SMP race condition between stack free and dispatch

PR2035: psxcancel reveals NULL pointer access in _Thread_queue_Extract()

The POSIX cleanup handler are now called in the right context (should be
called in the context of the terminating thread).

http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html

Add a user extension the reflects a thread termination event.  This is
used to reclaim the Newlib reentrancy structure (may use file
operations), the POSIX cleanup handlers and the POSIX key destructors.
2014-03-31 08:29:43 +02:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
17ba41982a monitor: Add support for BSD wakeup state 2013-11-14 15:58:03 +01:00
Sebastian Huber
ae75429ca1 PR766: Delete __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 2013-08-08 14:11:22 +02:00
Sebastian Huber
a2e3f33f39 score: Create object implementation header
Move implementation specific parts of object.h and object.inl into new
header file objectimpl.h.  The object.h contains now only the
application visible API.
2013-07-26 11:55:47 +02:00
Sebastian Huber
fe6c170cf5 score: Create states implementation header
Move implementation specific parts of states.h and states.inl into new
header file statesimpl.h.  The states.h contains now only the
application visible API.
2013-07-26 11:55:45 +02:00
Sebastian Huber
39046f766f score: Merge sysstate API into one file 2013-07-24 11:11:21 +02:00
Sebastian Huber
c40482815e rtems: Create tasks implementation header
Move implementation specific parts of tasks.h and tasks.inl into new
header file tasksimpl.h.  The tasks.h contains now only the application
visible API.
2013-07-23 15:12:55 +02:00
Sebastian Huber
f6c7c57d86 rtems: Create region implementation header
Move implementation specific parts of region.h and region.inl into new
header file regionimpl.h.  The region.h contains now only the
application visible API.
2013-07-23 15:12:55 +02:00
Sebastian Huber
8695cae269 rtems: Create part implementation header
Move implementation specific parts of part.h and part.inl into new
header file partimpl.h.  The part.h contains now only the application
visible API.
2013-07-23 15:12:55 +02:00
Sebastian Huber
7660e8b347 Include missing <string.h> 2013-07-23 15:12:54 +02:00
Sebastian Huber
e151eb1a36 rtems: Create event implementation header
Move implementation specific parts of event.h, event.inl, eventset.h and
eventset.inl into new header file eventimpl.h.  The event.h contains now
only the application visible API.
2013-07-23 15:12:53 +02:00
Sebastian Huber
63d229d655 rtems: Create attr implementation header
Move implementation specific parts of attr.h and attr.inl into new
header file attrimpl.h.  The attr.h contains now only the application
visible API.
2013-07-23 15:12:52 +02:00
Sebastian Huber
ac252bdce0 sapi: Create extension implementation header
Move implementation specific parts of extension.h and extension.inl into
new header file extensionimpl.h.  The extension.h contains now only the
application visible API.
2013-07-23 15:12:51 +02:00
Sebastian Huber
0c5317d16c posix: Create pthread implementation header
Move implementation specific parts of pthread.h and pthread.inl into new
header file pthreadimpl.h.  The pthread.h contains now only the
application visible API.
2013-07-22 16:57:23 +02:00
Sebastian Huber
993a888dfd rtems: Create message queue implementation header
Move implementation specific parts of message.h and message.inl into new
header file messageimpl.h.  The message.h contains now only the
application visible API.
2013-07-22 16:56:58 +02:00
Sebastian Huber
2bbea657ae rtems: Create semaphore implementation header
Move implementation specific parts of sem.h and sem.inl into new header
file semimpl.h.  The sem.h contains now only the application visible
API.
2013-07-18 09:58:56 +02:00
Mathew Kallada
f3255a6f22 Header File Doxygen Enhancement Task #11 2012-12-28 11:30:27 -06:00
Sebastian Huber
5adf02e575 monitor: Typo 2012-11-21 16:24:21 +01:00
Sebastian Huber
ed8be1aeea monitor: Add const qualifier 2012-11-07 15:08:46 +01:00
Sebastian Huber
682b819e96 monitor: Avoid unused function 2012-11-07 15:08:45 +01:00
Sebastian Huber
7a1e92a17a monitor: Support for system events 2012-11-02 16:06:40 +01:00
Sebastian Huber
990575c57f rtems: Reusable event implementation
Change event implementation to enable reuse for system events.
2012-10-30 18:00:33 +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
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
Ralf Corsepius
6425dc5033 2011-12-06 Ralf Corsépius <ralf.corsepius@rtems.org>
* libmisc/monitor/mon-network.c: Include <rtems/monitor.h>.
	* libmisc/monitor/mon-object.c:
	Make rtems_monitor_object_canonical_next_remote,
	rtems_monitor_object_dump_1, rtems_monitor_object_dump_all static.
	* libmisc/monitor/mon-prmisc.c:
	Make rtems_monitor_dump_assoc_bitfield static.
	* libmisc/monitor/mon-symbols.c:
	Make rtems_monitor_symbol_dump_all static.
2011-12-06 07:34:48 +00:00
Joel Sherrill
ece175945c 2011-11-28 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1941/cpukit
	* libmisc/monitor/mon-server.c, score/include/rtems/system.h: Remove
	use of RTEMS_offset() in favor of standard offsetof(). This was
	undocumented and there was only one internal use. Change noted in
	4.11 release notes.
2011-11-28 17:51:47 +00:00
Ralf Corsepius
243b1ccb5c 2011-10-26 Ralf Corsépius <ralf.corsepius@rtems.org>
* libmisc/monitor/mon-monitor.c (rtems_monitor_wakeup):
	Remove unused var "status" (Avoid warning).
2011-10-26 14:05:32 +00:00
Ralf Corsepius
b0f6b6c7fb 2011-10-17 Ralf Corsépius <ralf.corsepius@rtems.org>
*  libmisc/monitor/mon-editor.c (rtems_monitor_task):
	Comment out unused vars "debugee", "rp", "fp".
2011-10-17 13:50:05 +00:00
Sebastian Huber
0690fb2803 2011-09-02 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libmisc/monitor/mon-monitor.c: Removed "exit" and "quit" commands to
	avoid confusion.  They were an alias to the "fatal" command.
2011-09-02 13:17:35 +00:00
Joel Sherrill
186fee26ef 2011-07-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/dosfs/fat_file.c, libmisc/monitor/monitor.h,
	score/cpu/m68k/rtems/score/cpu.h: Remove stray spaces from unsigned32
	to uint32_t conversion.
2011-07-21 13:18:30 +00:00
Sebastian Huber
babaedefa9 2011-03-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* include/rtems/irq-extension.h: Documentation.
	* libmisc/monitor/mon-prmisc.c: Fix for multiprocessing configuration.
2011-03-07 13:54:44 +00:00
Sebastian Huber
3ff9156f6b 2010-11-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libmisc/monitor/mon-monitor.c: Fixed broken monitor command list.
2010-11-19 09:44:21 +00:00
Joel Sherrill
c8b3806d1a 2010-11-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/monitor/mon-monitor.c: Move node code into multiprocessing
	ifdef.
2010-11-16 17:51:02 +00:00
Joel Sherrill
6b9886bbac 2010-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/monitor/mon-symbols.c: Fix length of buffer passed to
	strncpy() so there is room for a NULL terminator.
2010-08-26 21:41:41 +00:00
Joel Sherrill
0b95fb8057 2010-06-21 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1559/misc
	Coverity Id 16
	* libmisc/monitor/mon-editor.c: Fix buffer overflow.
2010-06-21 16:25:09 +00:00
Ralf Corsepius
76282d5cc9 Use rtems_monitor_dump_addr instead of rtems_monitor_dump_hex
to print addresses.
2010-04-12 15:25:43 +00:00
Ralf Corsepius
5b331cc570 Add rtems_monitor_dump_addr(). 2010-04-12 15:23:41 +00:00
Ralf Corsepius
f1eb9c6b72 16bit target fixes. 2010-04-12 15:21:42 +00:00
Joel Sherrill
7417f7b71c 2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/monitor/mon-monitor.c, libmisc/monitor/monitor.h: Add const
	to fix warning. Spacing.
2010-04-07 14:58:45 +00:00
Joel Sherrill
da9518a2f5 2010-04-05 Thomas Znidar <t.znidar@embed-it.com>
* libmisc/monitor/mon-monitor.c, libmisc/monitor/monitor.h: Add reset
	command.
2010-04-05 17:12:05 +00:00