[PATCH 37/57][Arm][OBJDUMP] Add framework for MVE instructions
[binutils-gdb.git] / sim / ppc / hw_trace.c
blob9490bfb97f4a8762631c2e5902527611fafd3813
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/>.
21 #ifndef _HW_TRACE_C_
22 #define _HW_TRACE_C_
24 #include "device_table.h"
25 #include <stdarg.h>
27 /* DEVICE
29 trace - the properties of this dummy device specify trace options
31 DESCRIPTION
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.
43 EXAMPLE
45 The trace option dump-device-tree can be enabled by specifying the
46 option:
48 | -o '/openprom/trace/dump-device-tree 0x1'
50 Alternativly the shorthand version:
52 | -t dump-device-tree
54 can be used. */
57 /* Hook to allow the initialization of the trace options at any time */
59 static int
60 hw_trace_ioctl(device *me,
61 cpu *processor,
62 unsigned_word cia,
63 device_ioctl_request request,
64 va_list ap)
66 switch (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);
77 break;
78 default:
79 device_error(me, "insupported ioctl request");
80 break;
82 return 0;
86 static device_callbacks const hw_trace_callbacks = {
87 { NULL, }, /* init */
88 { NULL, }, /* address */
89 { NULL, }, /* IO */
90 { NULL, }, /* DMA */
91 { NULL, }, /* interrupt */
92 { NULL, }, /* unit */
93 NULL, /* instance-create */
94 hw_trace_ioctl,
97 const device_descriptor hw_trace_device_descriptor[] = {
98 { "trace", NULL, &hw_trace_callbacks },
99 { NULL },
102 #endif /* _HW_TRACE_C_ */