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 #ifndef STATIC_INLINE_HW_IOBUS
25 #define STATIC_INLINE_HW_IOBUS STATIC_INLINE
28 #include "device_table.h"
33 iobus - simple bus for attaching devices
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).
49 hw_iobus_attach_address_callback(device
*me
,
55 device
*client
) /*callback/default*/
58 unsigned_word attach_address
;
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
),
69 if (addr
< attach_address
)
70 device_error(me
, "Invalid attach address 0x%lx", (unsigned long)addr
);
71 device_attach_address(device_parent(me
),
81 static device_callbacks
const hw_iobus_callbacks
= {
83 { hw_iobus_attach_address_callback
, },
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
},
99 #endif /* _HW_IOBUS_ */