1 /* This file is part of the program psim.
3 Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, see <http://www.gnu.org/licenses/>.
24 #include "device_table.h"
29 trace - the properties of this dummy device specify trace options
33 The properties of this device are used, during initialization, to
34 specify the value various simulation trace options. The
35 initialization can occure implicitly (during device tree init) or
36 explicitly using this devices ioctl method.
38 The actual options and their default values (for a given target)
39 are defined in the file debug.
41 This device is normally a child of the /openprom node.
45 The trace option dump-device-tree can be enabled by specifying the
48 | -o '/openprom/trace/dump-device-tree 0x1'
50 Alternativly the shorthand version:
57 /* Hook to allow the initialization of the trace options at any time */
60 hw_trace_ioctl(device
*me
,
63 device_ioctl_request request
,
67 case device_ioctl_set_trace
:
69 const device_property
*prop
= device_find_property(me
, NULL
);
70 while (prop
!= NULL
) {
71 const char *name
= prop
->name
;
72 unsigned32 value
= device_find_integer_property(me
, name
);
73 trace_option(name
, value
);
74 prop
= device_next_property(prop
);
79 device_error(me
, "insupported ioctl request");
86 static device_callbacks
const hw_trace_callbacks
= {
88 { NULL
, }, /* address */
91 { NULL
, }, /* interrupt */
93 NULL
, /* instance-create */
97 const device_descriptor hw_trace_device_descriptor
[] = {
98 { "trace", NULL
, &hw_trace_callbacks
},
102 #endif /* _HW_TRACE_C_ */