mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
Implement the bus structure for PAPR virtual IO
This extends the "pseries" (PAPR) machine to include a virtual IO bus supporting the PAPR defined hypercall based virtual IO mechanisms. So far only one VIO device is provided, the vty / vterm, providing a full console (polled only, for now). Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
9fdf0c2995
commit
4040ab7237
6 changed files with 450 additions and 20 deletions
50
hw/spapr_vio.h
Normal file
50
hw/spapr_vio.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
#ifndef _HW_SPAPR_VIO_H
|
||||
#define _HW_SPAPR_VIO_H
|
||||
/*
|
||||
* QEMU sPAPR VIO bus definitions
|
||||
*
|
||||
* Copyright (c) 2010 David Gibson, IBM Corporation <david@gibson.dropbear.id.au>
|
||||
* Based on the s390 virtio bus definitions:
|
||||
* Copyright (c) 2009 Alexander Graf <agraf@suse.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
typedef struct VIOsPAPRDevice {
|
||||
DeviceState qdev;
|
||||
uint32_t reg;
|
||||
} VIOsPAPRDevice;
|
||||
|
||||
typedef struct VIOsPAPRBus {
|
||||
BusState bus;
|
||||
} VIOsPAPRBus;
|
||||
|
||||
typedef struct {
|
||||
DeviceInfo qdev;
|
||||
const char *dt_name, *dt_type, *dt_compatible;
|
||||
int (*init)(VIOsPAPRDevice *dev);
|
||||
void (*hcalls)(VIOsPAPRBus *bus);
|
||||
int (*devnode)(VIOsPAPRDevice *dev, void *fdt, int node_off);
|
||||
} VIOsPAPRDeviceInfo;
|
||||
|
||||
extern VIOsPAPRBus *spapr_vio_bus_init(void);
|
||||
extern VIOsPAPRDevice *spapr_vio_find_by_reg(VIOsPAPRBus *bus, uint32_t reg);
|
||||
extern void spapr_vio_bus_register_withprop(VIOsPAPRDeviceInfo *info);
|
||||
extern int spapr_populate_vdevice(VIOsPAPRBus *bus, void *fdt);
|
||||
|
||||
void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len);
|
||||
void spapr_vty_create(VIOsPAPRBus *bus,
|
||||
uint32_t reg, CharDriverState *chardev);
|
||||
|
||||
#endif /* _HW_SPAPR_VIO_H */
|
Loading…
Add table
Add a link
Reference in a new issue