mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
cuda: Move ADB bus into CUDA state
Replace the global adb_bus with a CUDA-internal one, accessed using regular qdev child bus accessor. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
2e4a7c9c5d
commit
293c867d8c
5 changed files with 15 additions and 10 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "exec/memory.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/ide/internal.h"
|
||||
#include "hw/adb.h"
|
||||
|
||||
/* SMP is not enabled, for now */
|
||||
#define MAX_CPUS 1
|
||||
|
@ -93,6 +94,7 @@ typedef struct CUDAState {
|
|||
uint8_t ier;
|
||||
uint8_t anh;
|
||||
|
||||
ADBBusState adb_bus;
|
||||
CUDATimer timers[2];
|
||||
|
||||
uint32_t tick_offset;
|
||||
|
|
|
@ -149,6 +149,7 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
|
|||
PCIBus *pci_bus;
|
||||
PCIDevice *macio;
|
||||
MACIOIDEState *macio_ide;
|
||||
BusState *adb_bus;
|
||||
MacIONVRAMState *nvr;
|
||||
int bios_size;
|
||||
MemoryRegion *pic_mem, *escc_mem;
|
||||
|
@ -381,9 +382,11 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
|
|||
"ide[1]"));
|
||||
macio_ide_init_drives(macio_ide, &hd[MAX_IDE_DEVS]);
|
||||
|
||||
dev = qdev_create(BUS(&adb_bus), TYPE_ADB_KEYBOARD);
|
||||
dev = DEVICE(object_resolve_path_component(OBJECT(macio), "cuda"));
|
||||
adb_bus = qdev_get_child_bus(dev, "adb.0");
|
||||
dev = qdev_create(adb_bus, TYPE_ADB_KEYBOARD);
|
||||
qdev_init_nofail(dev);
|
||||
dev = qdev_create(BUS(&adb_bus), TYPE_ADB_MOUSE);
|
||||
dev = qdev_create(adb_bus, TYPE_ADB_MOUSE);
|
||||
qdev_init_nofail(dev);
|
||||
|
||||
if (usb_enabled(machine_arch == ARCH_MAC99_U3)) {
|
||||
|
|
|
@ -92,6 +92,7 @@ static void ppc_heathrow_init(QEMUMachineInitArgs *args)
|
|||
PCIDevice *macio;
|
||||
MACIOIDEState *macio_ide;
|
||||
DeviceState *dev;
|
||||
BusState *adb_bus;
|
||||
int bios_size;
|
||||
MemoryRegion *pic_mem;
|
||||
MemoryRegion *escc_mem, *escc_bar = g_new(MemoryRegion, 1);
|
||||
|
@ -281,9 +282,11 @@ static void ppc_heathrow_init(QEMUMachineInitArgs *args)
|
|||
hd[3] = hd[2] = NULL;
|
||||
pci_cmd646_ide_init(pci_bus, hd, 0);
|
||||
|
||||
dev = qdev_create(BUS(&adb_bus), TYPE_ADB_KEYBOARD);
|
||||
dev = DEVICE(object_resolve_path_component(OBJECT(macio), "cuda"));
|
||||
adb_bus = qdev_get_child_bus(dev, "adb.0");
|
||||
dev = qdev_create(adb_bus, TYPE_ADB_KEYBOARD);
|
||||
qdev_init_nofail(dev);
|
||||
dev = qdev_create(BUS(&adb_bus), TYPE_ADB_MOUSE);
|
||||
dev = qdev_create(adb_bus, TYPE_ADB_MOUSE);
|
||||
qdev_init_nofail(dev);
|
||||
|
||||
if (usb_enabled(false)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue