root / hw / spapr_vio.h @ 4040ab72
History | View | Annotate | Download (1.8 kB)
1 | 4040ab72 | David Gibson | #ifndef _HW_SPAPR_VIO_H
|
---|---|---|---|
2 | 4040ab72 | David Gibson | #define _HW_SPAPR_VIO_H
|
3 | 4040ab72 | David Gibson | /*
|
4 | 4040ab72 | David Gibson | * QEMU sPAPR VIO bus definitions
|
5 | 4040ab72 | David Gibson | *
|
6 | 4040ab72 | David Gibson | * Copyright (c) 2010 David Gibson, IBM Corporation <david@gibson.dropbear.id.au>
|
7 | 4040ab72 | David Gibson | * Based on the s390 virtio bus definitions:
|
8 | 4040ab72 | David Gibson | * Copyright (c) 2009 Alexander Graf <agraf@suse.de>
|
9 | 4040ab72 | David Gibson | *
|
10 | 4040ab72 | David Gibson | * This library is free software; you can redistribute it and/or
|
11 | 4040ab72 | David Gibson | * modify it under the terms of the GNU Lesser General Public
|
12 | 4040ab72 | David Gibson | * License as published by the Free Software Foundation; either
|
13 | 4040ab72 | David Gibson | * version 2 of the License, or (at your option) any later version.
|
14 | 4040ab72 | David Gibson | *
|
15 | 4040ab72 | David Gibson | * This library is distributed in the hope that it will be useful,
|
16 | 4040ab72 | David Gibson | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 | 4040ab72 | David Gibson | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
18 | 4040ab72 | David Gibson | * Lesser General Public License for more details.
|
19 | 4040ab72 | David Gibson | *
|
20 | 4040ab72 | David Gibson | * You should have received a copy of the GNU Lesser General Public
|
21 | 4040ab72 | David Gibson | * License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
22 | 4040ab72 | David Gibson | */
|
23 | 4040ab72 | David Gibson | |
24 | 4040ab72 | David Gibson | typedef struct VIOsPAPRDevice { |
25 | 4040ab72 | David Gibson | DeviceState qdev; |
26 | 4040ab72 | David Gibson | uint32_t reg; |
27 | 4040ab72 | David Gibson | } VIOsPAPRDevice; |
28 | 4040ab72 | David Gibson | |
29 | 4040ab72 | David Gibson | typedef struct VIOsPAPRBus { |
30 | 4040ab72 | David Gibson | BusState bus; |
31 | 4040ab72 | David Gibson | } VIOsPAPRBus; |
32 | 4040ab72 | David Gibson | |
33 | 4040ab72 | David Gibson | typedef struct { |
34 | 4040ab72 | David Gibson | DeviceInfo qdev; |
35 | 4040ab72 | David Gibson | const char *dt_name, *dt_type, *dt_compatible; |
36 | 4040ab72 | David Gibson | int (*init)(VIOsPAPRDevice *dev);
|
37 | 4040ab72 | David Gibson | void (*hcalls)(VIOsPAPRBus *bus);
|
38 | 4040ab72 | David Gibson | int (*devnode)(VIOsPAPRDevice *dev, void *fdt, int node_off); |
39 | 4040ab72 | David Gibson | } VIOsPAPRDeviceInfo; |
40 | 4040ab72 | David Gibson | |
41 | 4040ab72 | David Gibson | extern VIOsPAPRBus *spapr_vio_bus_init(void); |
42 | 4040ab72 | David Gibson | extern VIOsPAPRDevice *spapr_vio_find_by_reg(VIOsPAPRBus *bus, uint32_t reg);
|
43 | 4040ab72 | David Gibson | extern void spapr_vio_bus_register_withprop(VIOsPAPRDeviceInfo *info); |
44 | 4040ab72 | David Gibson | extern int spapr_populate_vdevice(VIOsPAPRBus *bus, void *fdt); |
45 | 4040ab72 | David Gibson | |
46 | 4040ab72 | David Gibson | void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len); |
47 | 4040ab72 | David Gibson | void spapr_vty_create(VIOsPAPRBus *bus,
|
48 | 4040ab72 | David Gibson | uint32_t reg, CharDriverState *chardev); |
49 | 4040ab72 | David Gibson | |
50 | 4040ab72 | David Gibson | #endif /* _HW_SPAPR_VIO_H */ |