]> git.proxmox.com Git - mirror_qemu.git/blame - hw/spapr_vio.h
Add (virtual) interrupt to PAPR virtual tty device
[mirror_qemu.git] / hw / spapr_vio.h
CommitLineData
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 <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
24typedef struct VIOsPAPRDevice {
25 DeviceState qdev;
26 uint32_t reg;
00dc738d
DG
27 qemu_irq qirq;
28 uint32_t vio_irq_num;
29 target_ulong signal_state;
4040ab72
DG
30} VIOsPAPRDevice;
31
32typedef struct VIOsPAPRBus {
33 BusState bus;
34} VIOsPAPRBus;
35
36typedef struct {
37 DeviceInfo qdev;
38 const char *dt_name, *dt_type, *dt_compatible;
00dc738d 39 target_ulong signal_mask;
4040ab72
DG
40 int (*init)(VIOsPAPRDevice *dev);
41 void (*hcalls)(VIOsPAPRBus *bus);
42 int (*devnode)(VIOsPAPRDevice *dev, void *fdt, int node_off);
43} VIOsPAPRDeviceInfo;
44
45extern VIOsPAPRBus *spapr_vio_bus_init(void);
46extern VIOsPAPRDevice *spapr_vio_find_by_reg(VIOsPAPRBus *bus, uint32_t reg);
47extern void spapr_vio_bus_register_withprop(VIOsPAPRDeviceInfo *info);
48extern int spapr_populate_vdevice(VIOsPAPRBus *bus, void *fdt);
49
00dc738d
DG
50extern int spapr_vio_signal(VIOsPAPRDevice *dev, target_ulong mode);
51
4040ab72
DG
52void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len);
53void spapr_vty_create(VIOsPAPRBus *bus,
0201e2da
DG
54 uint32_t reg, CharDriverState *chardev,
55 qemu_irq qirq, uint32_t vio_irq_num);
4040ab72
DG
56
57#endif /* _HW_SPAPR_VIO_H */