[PATCH 37/57][Arm][OBJDUMP] Add framework for MVE instructions
[binutils-gdb.git] / sim / ppc / hw_iobus.c
blob81ca074ab1158b9bad60817225e880cdfb3aca6d
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_IOBUS_C_
22 #define _HW_IOBUS_C_
24 #ifndef STATIC_INLINE_HW_IOBUS
25 #define STATIC_INLINE_HW_IOBUS STATIC_INLINE
26 #endif
28 #include "device_table.h"
31 /* DEVICE
33 iobus - simple bus for attaching devices
35 DESCRIPTION
37 IOBUS provides a simple `local' bus for attaching (hanging)
38 programmed IO devices from. All child devices are directly mapped
39 into this devices parent address space (after checking that the
40 attach address lies within the <<iobus>> address range. address).
42 PROPERTIES
44 None.
48 static void
49 hw_iobus_attach_address_callback(device *me,
50 attach_type type,
51 int space,
52 unsigned_word addr,
53 unsigned nr_bytes,
54 access_type access,
55 device *client) /*callback/default*/
57 int attach_space;
58 unsigned_word attach_address;
59 /* sanity check */
60 if (space != 0)
61 device_error(me, "invalid space (%d) specified by %s",
62 space, device_path(client));
63 /* get the bus address */
64 device_address_to_attach_address(device_parent(me),
65 device_unit_address(me),
66 &attach_space,
67 &attach_address,
68 me);
69 if (addr < attach_address)
70 device_error(me, "Invalid attach address 0x%lx", (unsigned long)addr);
71 device_attach_address(device_parent(me),
72 type,
73 attach_space,
74 addr,
75 nr_bytes,
76 access,
77 client);
81 static device_callbacks const hw_iobus_callbacks = {
82 { NULL, },
83 { hw_iobus_attach_address_callback, },
84 { NULL, }, /* IO */
85 { NULL, }, /* DMA */
86 { NULL, }, /* interrupt */
87 { generic_device_unit_decode,
88 generic_device_unit_encode,
89 generic_device_address_to_attach_address,
90 generic_device_size_to_attach_size }
94 const device_descriptor hw_iobus_device_descriptor[] = {
95 { "iobus", NULL, &hw_iobus_callbacks },
96 { NULL, },
99 #endif /* _HW_IOBUS_ */