root / hw / spapr_vio.h @ 0201e2da
History | View | Annotate | Download (2 kB)
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 <david@gibson.dropbear.id.au>
|
7 |
* Based on the s390 virtio bus definitions:
|
8 |
* Copyright (c) 2009 Alexander Graf <agraf@suse.de>
|
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 |
qemu_irq qirq; |
28 |
uint32_t vio_irq_num; |
29 |
target_ulong signal_state; |
30 |
} VIOsPAPRDevice; |
31 |
|
32 |
typedef struct VIOsPAPRBus { |
33 |
BusState bus; |
34 |
} VIOsPAPRBus; |
35 |
|
36 |
typedef struct { |
37 |
DeviceInfo qdev; |
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); |
43 |
} VIOsPAPRDeviceInfo; |
44 |
|
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); |
49 |
|
50 |
extern int spapr_vio_signal(VIOsPAPRDevice *dev, target_ulong mode); |
51 |
|
52 |
void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len); |
53 |
void spapr_vty_create(VIOsPAPRBus *bus,
|
54 |
uint32_t reg, CharDriverState *chardev, |
55 |
qemu_irq qirq, uint32_t vio_irq_num); |
56 |
|
57 |
#endif /* _HW_SPAPR_VIO_H */ |