source: rtems/c/src/lib/libmisc/monitor/mon-task.c @ 3a4ae6c

4.104.114.84.95
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*
2 *      @(#)task.c      1.9 - 95/08/01
3 *     
4 *
5 * RTEMS Monitor task support
6 *
7 *  $Id$
8 */
9
10#include <rtems.h>
11#include "monitor.h"
12
13#include <stdio.h>
14
15void
16rtems_monitor_task_canonical(
17    rtems_monitor_task_t  *canonical_task,
18    void                  *thread_void
19)
20{
21    Thread_Control       *rtems_thread = (Thread_Control *) thread_void;
22    RTEMS_API_Control    *api;
23
24    api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ];
25   
26    canonical_task->entry = rtems_thread->Start.entry_point;
27    canonical_task->argument = rtems_thread->Start.numeric_argument;
28    canonical_task->stack = rtems_thread->Start.Initial_stack.area;
29    canonical_task->stack_size = rtems_thread->Start.Initial_stack.size;
30    canonical_task->priority = rtems_thread->current_priority;
31    canonical_task->state = rtems_thread->current_state;
32    canonical_task->wait_id = rtems_thread->Wait.id;
33    canonical_task->events = api->pending_events;
34
35/* XXX modes and attributes only exist in the RTEMS API .. */
36/* XXX not directly in the core thread.. they will have to be derived */
37/* XXX if they are important enough to include anymore.   */
38    canonical_task->modes = 0; /* XXX FIX ME.... rtems_thread->current_modes; */
39    canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->API_Extensions[ THREAD_API_RTEMS ]->attribute_set */;
40    (void) memcpy(canonical_task->notepad, api ->Notepads, sizeof(canonical_task->notepad));
41/* XXX more to fix */
42/*
43    (void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args));
44*/
45}
46
47
48void
49rtems_monitor_task_dump_header(
50    boolean verbose
51)
52{
53    printf("\
54  ID       NAME   PRIO   STAT   MODES  EVENTS   WAITID  WAITARG  NOTES\n");
55/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
560         1         2         3         4         5         6         7       */
57           
58    rtems_monitor_separator();
59}
60
61/*
62 */
63
64void
65rtems_monitor_task_dump(
66    rtems_monitor_task_t *monitor_task,
67    boolean  verbose
68)
69{
70    int length = 0;
71
72    length += rtems_monitor_dump_id(monitor_task->id);
73    length += rtems_monitor_pad(11, length);
74    length += rtems_monitor_dump_name(monitor_task->name);
75    length += rtems_monitor_pad(18, length);
76    length += rtems_monitor_dump_priority(monitor_task->priority);
77    length += rtems_monitor_pad(24, length);
78    length += rtems_monitor_dump_state(monitor_task->state);
79    length += rtems_monitor_pad(31, length);
80    length += rtems_monitor_dump_modes(monitor_task->modes);
81    length += rtems_monitor_pad(39, length);
82    length += rtems_monitor_dump_events(monitor_task->events);
83    if (monitor_task->wait_id)
84    {
85        length += rtems_monitor_pad(47, length);
86        length += rtems_monitor_dump_id(monitor_task->wait_id);
87        length += rtems_monitor_pad(57, length);
88        length += rtems_monitor_dump_hex(monitor_task->wait_args);
89    }
90
91    length += rtems_monitor_pad(65, length);
92    length += rtems_monitor_dump_notepad(monitor_task->notepad);
93    printf("\n");
94}
95
Note: See TracBrowser for help on using the repository browser.