1 #ifndef _HW_SPAPR_VIO_H
2 #define _HW_SPAPR_VIO_H
4 * QEMU sPAPR VIO bus definitions
6 * Copyright (c) 2010 David Gibson, IBM Corporation <david@gibson.dropbear.id.au>
7 * Based on the s390 virtio bus definitions:
8 * Copyright (c) 2009 Alexander Graf <agraf@suse.de>
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
24 typedef struct VIOsPAPRDevice
{
29 target_ulong signal_state
;
32 typedef struct VIOsPAPRBus
{
38 const char *dt_name
, *dt_type
, *dt_compatible
;
39 target_ulong signal_mask
;
40 int (*init
)(VIOsPAPRDevice
*dev
);
41 void (*hcalls
)(VIOsPAPRBus
*bus
);
42 int (*devnode
)(VIOsPAPRDevice
*dev
, void *fdt
, int node_off
);
45 extern VIOsPAPRBus
*spapr_vio_bus_init(void);
46 extern VIOsPAPRDevice
*spapr_vio_find_by_reg(VIOsPAPRBus
*bus
, uint32_t reg
);
47 extern void spapr_vio_bus_register_withprop(VIOsPAPRDeviceInfo
*info
);
48 extern int spapr_populate_vdevice(VIOsPAPRBus
*bus
, void *fdt
);
50 extern int spapr_vio_signal(VIOsPAPRDevice
*dev
, target_ulong mode
);
52 void vty_putchars(VIOsPAPRDevice
*sdev
, uint8_t *buf
, int len
);
53 void spapr_vty_create(VIOsPAPRBus
*bus
,
54 uint32_t reg
, CharDriverState
*chardev
);
56 #endif /* _HW_SPAPR_VIO_H */