Commit Graph

37 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
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
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
Sebastian Huber
17ba41982a monitor: Add support for BSD wakeup state 2013-11-14 15:58:03 +01: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
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
7a1e92a17a monitor: Support for system events 2012-11-02 16:06:40 +01: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
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
Ralf Corsepius
5b331cc570 Add rtems_monitor_dump_addr(). 2010-04-12 15:23:41 +00:00
Ralf Corsepius
0893220b2a Whitespace removal. 2009-11-29 12:12:39 +00:00
Ralf Corsepius
aac23ec795 2009-10-02 Ralf Corsépius <ralf.corsepius@rtems.org>
* libmisc/monitor/mon-prmisc.c: Fix warning if
	defined(RTEMS_USE_16_BIT_OBJECT).
2009-10-02 13:33:00 +00:00
Joel Sherrill
e41eaa881a 2008-12-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libmisc/serdbg/termios_printk.c, libmisc/serdbg/termios_printk.h:
	Fixed incompatible return value.

	* libmisc/cpuuse/cpuusagereport.c: Changed output format.

	* libmisc/Makefile.am, libmisc/monitor/mon-editor.c: New file.

	* libmisc/capture/capture-cli.c, libmisc/monitor/mon-command.c,
	libmisc/monitor/mon-monitor.c, libmisc/monitor/mon-object.c,
	libmisc/monitor/mon-prmisc.c, libmisc/monitor/mon-symbols.c,
	libmisc/monitor/monitor.h, libmisc/shell/cat_file.c,
	libmisc/shell/cmds.c, libmisc/shell/internal.h,
	libmisc/shell/main_help.c, libmisc/shell/shell.c,
	libmisc/shell/shell.h, libmisc/shell/shell_cmdset.c,
	libmisc/shell/shell_getchar.c, libmisc/shell/str2int.c: Various global
	data is now read only.  Added 'const' qualifier to many pointer
	parameters.  It is no longer possible to remove monitor commands.
	Moved monitor line editor into a separate file to avoid unnecessary
	dependencies.
2008-12-18 15:25:27 +00:00
Ralf Corsepius
bd5b34e564 Add missing initializers. 2008-09-07 07:02:47 +00:00
Joel Sherrill
bd5762ddfc 2008-07-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/monitor/mon-extension.c, libmisc/monitor/mon-itask.c,
	libmisc/monitor/mon-part.c, libmisc/monitor/mon-prmisc.c,
	libmisc/monitor/mon-queue.c, libmisc/monitor/mon-region.c,
	libmisc/monitor/mon-sema.c, libmisc/monitor/mon-task.c,
	libmisc/monitor/monitor.h: Use rtems_object_get_name() instead of
	internal routine. This makes it possible to also print string names
	of POSIX objects. Adjust task report to realign since we can have
	longer names.
2008-07-23 19:51:08 +00:00
Joel Sherrill
17049c39d0 2008-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/monitor/mon-prmisc.c, rtems/include/rtems/rtems/attr.h:
	Review association tables in monitor.
2008-07-01 18:44:12 +00:00
Eric Norum
03f246fb58 Eliminate undesired sign-extension. 2006-03-27 15:14:07 +00:00
Ralf Corsepius
cbd849c0de 2004-11-01 Ralf Corsepius <ralf_corsepius@rtems.org>
* monitor/monitor.h: Let rtems_monitor_config_dump return int.
	* monitor/mon-config.c: Ditto. Use PRI*N macros.
	* monitor/mon-itask.c, monitor/mon-prmisc.c: Use PRI*N macros.
2004-11-01 13:14:33 +00:00
Ralf Corsepius
c182e2dcab 2004-10-27 Ralf Corsepius <ralf_corsepius@rtems.org>
* monitor/mon-prmisc.c, monitor/monitor.h: Let rtems_monitor_dump
	return int's not uint32_t (They are printf return values).
2004-10-27 08:24:10 +00:00
Ralf Corsepius
f0d1c947a6 2004-10-21 Ralf Corsepius <ralf_corsepius@rtems.org>
* libmisc/monitor/mon-prmisc.c, libmisc/monitor/monitor.h:
	rtems_monitor_dump_char(char ch).
2004-10-21 09:16:44 +00:00
Ralf Corsepius
714f06c7fa 2004-04-17 Ralf Corsepius <ralf_corsepius@rtems.org>
* libmisc/capture/capture-cli.c, libmisc/cpuuse/cpuuse.c,
	libmisc/dumpbuf/dumpbuf.c, libmisc/fsmount/fsmount.c,
	libmisc/monitor/mon-command.c, libmisc/monitor/mon-config.c,
	libmisc/monitor/mon-dname.c, libmisc/monitor/mon-driver.c,
	libmisc/monitor/mon-extension.c, libmisc/monitor/mon-itask.c,
	libmisc/monitor/mon-monitor.c, libmisc/monitor/mon-mpci.c,
	libmisc/monitor/mon-object.c, libmisc/monitor/mon-prmisc.c,
	libmisc/monitor/mon-queue.c, libmisc/monitor/mon-symbols.c,
	libmisc/monitor/mon-task.c, libmisc/rtmonuse/rtmonuse.c,
	libmisc/shell/cmds.c, libmisc/shell/shell.c, libmisc/shell/shell.h,
	libmisc/stackchk/check.c, libmisc/untar/untar.c: Use
	fprintf(stdout,...) instead of printf.
2004-04-17 08:12:02 +00:00
Ralf Corsepius
aed742c9a0 Remove stray white spaces. 2004-04-16 12:06:28 +00:00
Ralf Corsepius
3e08d4ee62 2004-03-26 Ralf Corsepius <ralf_corsepius@rtems.org>
* libmisc/capture/capture-cli.c, libmisc/capture/capture.c,
	libmisc/capture/capture.h, libmisc/cpuuse/cpuuse.c,
	libmisc/devnull/devnull.c, libmisc/fsmount/fsmount.h,
	libmisc/monitor/mon-config.c, libmisc/monitor/mon-dname.c,
	libmisc/monitor/mon-driver.c, libmisc/monitor/mon-extension.c,
	libmisc/monitor/mon-itask.c, libmisc/monitor/mon-monitor.c,
	libmisc/monitor/mon-mpci.c, libmisc/monitor/mon-object.c,
	libmisc/monitor/mon-prmisc.c, libmisc/monitor/mon-queue.c,
	libmisc/monitor/mon-server.c, libmisc/monitor/mon-symbols.c,
	libmisc/monitor/monitor.h, libmisc/monitor/symbols.h,
	libmisc/mw-fb/mw_uid.c, libmisc/rtmonuse/rtmonuse.c,
	libmisc/serdbg/serdbg.h, libmisc/serdbg/serdbgio.c,
	libmisc/serdbg/termios_printk.c, libmisc/serdbg/termios_printk.h,
	libmisc/shell/shell.c, libmisc/shell/shell.h, libmisc/stackchk/check.c,
	libmisc/stackchk/internal.h: Convert to using c99 fixed size types.
2004-03-26 06:59:18 +00:00
Ralf Corsepius
550c3df787 2003-07-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* capture/capture-cli.c: Add config-header support.
	* capture/capture.c: Add config-header support.
	* cpuuse/cpuuse.c: Add config-header support.
	* devnull/devnull.c: Add config-header support.
	* dummy/dummy.c: Add config-header support.
	* dumpbuf/dumpbuf.c: Add config-header support.
	* monitor/mon-command.c: Add config-header support.
	* monitor/mon-config.c: Add config-header support.
	* monitor/mon-dname.c: Add config-header support.
	* monitor/mon-driver.c: Add config-header support.
	* monitor/mon-extension.c: Add config-header support.
	* monitor/mon-itask.c: Add config-header support.
	* monitor/mon-manager.c: Add config-header support.
	* monitor/mon-monitor.c: Add config-header support.
	* monitor/mon-mpci.c: Add config-header support.
	* monitor/mon-object.c: Add config-header support.
	* monitor/mon-prmisc.c: Add config-header support.
	* monitor/mon-queue.c: Add config-header support.
	* monitor/mon-server.c: Add config-header support.
	* monitor/mon-symbols.c: Add config-header support.
	* monitor/mon-task.c: Add config-header support.
	* mw-fb/mw_fb.c: Add config-header support.
	* mw-fb/mw_uid.c: Add config-header support.
	* rtmonuse/rtmonuse.c: Add config-header support.
	* serdbg/serdbg.c: Add config-header support.
	* serdbg/serdbgio.c: Add config-header support.
	* serdbg/termios_printk.c: Add config-header support.
	* shell/cmds.c: Add config-header support.
	* stackchk/check.c: Add config-header support.
	* untar/untar.c: Add config-header support.
2003-07-08 08:39:16 +00:00
Joel Sherrill
ab09d08366 2002-03-20 Chris Johns <ccj@acm.org>
* PR148.
	* monitor/mon-prmisc.c: Fixed to print task states correctly.
2002-03-20 14:33:00 +00:00
Joel Sherrill
b2712e35b9 2000-05-24 Fernando Ruiz Casas <fernando.ruiz@ctv.es>
* monitor/mon-prmisc.c: Correct print line.
	* shell/Makefile.am: Added new file telnetd.c.
	* shell/telnetd.c, shell/telnetd.h, shell/pty.c: New files.
	* shell/shell.c, shell/cmds.c, shell/shell.h: Numerous improvments:
	   - The shell_init has a new parameter 'forever' because in
	     /dev/console you need that this process runs forever but in
	     tcp/ip not. (respawn?)
	   - A new task for every session opened trought tcp/ip telnet client.
	     (the chargen,daytime and more are possible of implementation but
	     I ask me if they are necesary)
	   - Exit from the session delete the task and when the client fails too.
	   - More cmds have been implemented. (very reduced version of these)
	     umask, chmod, id, whoami, rm, cat, ...
	   - A reduced line edit has been implemented.
	       Ctrl-C abort the input,
	       Ctrl-d in the first position gives EOF (logout).
	       '\b' and DEL makes the rubout operation.
	       I think that readline() for every session spents a lot of resources.
2001-05-24 21:58:39 +00:00
Joel Sherrill
c436b5b84d Fixed indexing bug reported by Phil Wilshire. 1997-12-07 16:58:13 +00:00
Joel Sherrill
48220699fd Fixed endian problem in printing object names. 1997-10-21 18:39:27 +00:00
Joel Sherrill
5beb562450 Cleaned up as part of adding the Monitor test. 1997-09-21 16:58:57 +00:00
Joel Sherrill
9ffcaa4a8a changed signed int to unsigned int to eliminate a warning. 1997-04-07 21:30:58 +00:00
Joel Sherrill
8389628c1b updates from Tony Bennett 1996-04-22 16:53:46 +00:00
Joel Sherrill
c64e4ed482 updates from Tony Bennett for PA and UNIX ports 1996-01-15 21:50:28 +00:00
Joel Sherrill
b06e68ef1f Numerous miscellaneous features incorporated from Tony Bennett
(tbennett@divnc.com) including the following major additions:

  + variable length messages
  + named devices
  + debug monitor
  + association tables/variables
1995-08-17 19:51:51 +00:00