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 2 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, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #ifndef STATIC_INLINE_HW_IOBUS
26 #define STATIC_INLINE_HW_IOBUS STATIC_INLINE
29 #include "device_table.h"
34 iobus@<address> - bus for attaching devices
39 IOBUS provides a simple `local' bus for attaching (hanging)
40 programmed IO devices from. All child devices are mapped into this
41 devices parent address space (after adjusting for the iobus's base
52 hw_iobus_attach_address_callback(device
*me
,
59 device
*who
) /*callback/default*/
61 unsigned_word hw_iobus_addr
;
64 error("hw_iobus_attach_address_callback() no space for %s/%s\n",
65 device_name(me
), name
);
66 /* get the bus address */
67 if (device_unit_address(me
)->nr_cells
!= 1)
68 error("hw_iobus_attach_address_callback() invalid address for %s\n",
70 hw_iobus_addr
= device_unit_address(me
)->cells
[0];
71 device_attach_address(device_parent(me
),
82 static device_callbacks
const hw_iobus_callbacks
= {
84 { hw_iobus_attach_address_callback
, },
87 { NULL
, }, /* interrupt */
88 { generic_device_unit_decode
,
89 generic_device_unit_encode
, }
93 const device_descriptor hw_iobus_device_descriptor
[] = {
94 { "iobus", NULL
, &hw_iobus_callbacks
},
98 #endif /* _HW_IOBUS_ */