]>
Commit | Line | Data |
---|---|---|
4040ab72 DG |
1 | #ifndef _HW_SPAPR_VIO_H |
2 | #define _HW_SPAPR_VIO_H | |
3 | /* | |
4 | * QEMU sPAPR VIO bus definitions | |
5 | * | |
6 | * Copyright (c) 2010 David Gibson, IBM Corporation <[email protected]> | |
7 | * Based on the s390 virtio bus definitions: | |
8 | * Copyright (c) 2009 Alexander Graf <[email protected]> | |
9 | * | |
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. | |
14 | * | |
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. | |
19 | * | |
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/>. | |
22 | */ | |
23 | ||
24 | typedef struct VIOsPAPRDevice { | |
25 | DeviceState qdev; | |
26 | uint32_t reg; | |
27 | } VIOsPAPRDevice; | |
28 | ||
29 | typedef struct VIOsPAPRBus { | |
30 | BusState bus; | |
31 | } VIOsPAPRBus; | |
32 | ||
33 | typedef struct { | |
34 | DeviceInfo qdev; | |
35 | const char *dt_name, *dt_type, *dt_compatible; | |
36 | int (*init)(VIOsPAPRDevice *dev); | |
37 | void (*hcalls)(VIOsPAPRBus *bus); | |
38 | int (*devnode)(VIOsPAPRDevice *dev, void *fdt, int node_off); | |
39 | } VIOsPAPRDeviceInfo; | |
40 | ||
41 | extern VIOsPAPRBus *spapr_vio_bus_init(void); | |
42 | extern VIOsPAPRDevice *spapr_vio_find_by_reg(VIOsPAPRBus *bus, uint32_t reg); | |
43 | extern void spapr_vio_bus_register_withprop(VIOsPAPRDeviceInfo *info); | |
44 | extern int spapr_populate_vdevice(VIOsPAPRBus *bus, void *fdt); | |
45 | ||
46 | void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len); | |
47 | void spapr_vty_create(VIOsPAPRBus *bus, | |
48 | uint32_t reg, CharDriverState *chardev); | |
49 | ||
50 | #endif /* _HW_SPAPR_VIO_H */ |