OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [libmisc/] [monitor/] [mon-itask.c] - Blame information for rev 552

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 * RTEMS Monitor init task support
3
 *
4
 *  $Id: mon-itask.c,v 1.2 2001-09-27 12:01:43 chris Exp $
5
 */
6
 
7
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
8
#include <rtems.h>
9
#include <rtems/monitor.h>
10
 
11
#include <stdio.h>
12
 
13
/*
14
 * As above, but just for init tasks
15
 */
16
void
17
rtems_monitor_init_task_canonical(
18
    rtems_monitor_init_task_t *canonical_itask,
19
    void                  *itask_void
20
)
21
{
22
    rtems_initialization_tasks_table *rtems_itask = itask_void;
23
 
24
    rtems_monitor_symbol_canonical_by_value(&canonical_itask->entry,
25
                                            (void *) rtems_itask->entry_point);
26
 
27
    canonical_itask->argument = rtems_itask->argument;
28
    canonical_itask->stack_size = rtems_itask->stack_size;
29
    canonical_itask->priority = rtems_itask->initial_priority;
30
    canonical_itask->modes = rtems_itask->mode_set;
31
    canonical_itask->attributes = rtems_itask->attribute_set;
32
}
33
 
34
void *
35
rtems_monitor_init_task_next(
36
    void                  *object_info,
37
    rtems_monitor_init_task_t *canonical_init_task,
38
    rtems_id              *next_id
39
)
40
{
41
    rtems_configuration_table *c = _Configuration_Table;
42
    rtems_initialization_tasks_table *itask;
43
    rtems_unsigned32 n = rtems_get_index(*next_id);
44
 
45
    if (n >= c->RTEMS_api_configuration->number_of_initialization_tasks)
46
        goto failed;
47
 
48
    _Thread_Disable_dispatch();
49
 
50
    itask = c->RTEMS_api_configuration->User_initialization_tasks_table + n;
51
 
52
    /*
53
     * dummy up a fake id and name for this item
54
     */
55
 
56
    canonical_init_task->id = n;
57
    canonical_init_task->name = itask->name;
58
 
59
    *next_id += 1;
60
    return (void *) itask;
61
 
62
failed:
63
    *next_id = RTEMS_OBJECT_ID_FINAL;
64
    return 0;
65
}
66
 
67
 
68
void
69
rtems_monitor_init_task_dump_header(
70
    boolean verbose
71
)
72
{
73
    printf("\
74
  #    NAME   ENTRY        ARGUMENT    PRIO   MODES  ATTRIBUTES   STACK SIZE\n");
75
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
76
 
77
    rtems_monitor_separator();
78
}
79
 
80
/*
81
 */
82
 
83
void
84
rtems_monitor_init_task_dump(
85
    rtems_monitor_init_task_t *monitor_itask,
86
    boolean  verbose
87
)
88
{
89
    int length = 0;
90
 
91
    length += rtems_monitor_dump_decimal(monitor_itask->id);
92
 
93
    length += rtems_monitor_pad(7, length);
94
    length += rtems_monitor_dump_name(monitor_itask->name);
95
 
96
    length += rtems_monitor_pad(14, length);
97
    length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose);
98
 
99
    length += rtems_monitor_pad(25, length);
100
    length += printf("%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
101
 
102
    length += rtems_monitor_pad(39, length);
103
    length += rtems_monitor_dump_priority(monitor_itask->priority);
104
 
105
    length += rtems_monitor_pad(46, length);
106
    length += rtems_monitor_dump_modes(monitor_itask->modes);
107
 
108
    length += rtems_monitor_pad(54, length);
109
    length += rtems_monitor_dump_attributes(monitor_itask->attributes);
110
 
111
    length += rtems_monitor_pad(66, length);
112
    length += printf("%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
113
 
114
    printf("\n");
115
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.