aboutsummaryrefslogtreecommitdiff
path: root/hw/cuda.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-23 23:04:05 +0000
committerAlexander Graf <agraf@suse.de>2013-01-25 22:02:55 +0100
commit293c867d8c7399d17e6b593053411a6515171f38 (patch)
tree77ac79d1c0525ac72aff7053bd204a7bdc793d04 /hw/cuda.c
parent2e4a7c9c5df442d4223e738f7e8f73192b8b2a65 (diff)
downloadqemu-293c867d8c7399d17e6b593053411a6515171f38.zip
qemu-293c867d8c7399d17e6b593053411a6515171f38.tar.gz
qemu-293c867d8c7399d17e6b593053411a6515171f38.tar.bz2
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>
Diffstat (limited to 'hw/cuda.c')
-rw-r--r--hw/cuda.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/cuda.c b/hw/cuda.c
index b3a875c..b36c535 100644
--- a/hw/cuda.c
+++ b/hw/cuda.c
@@ -108,8 +108,6 @@
/* CUDA returns time_t's offset from Jan 1, 1904, not 1970 */
#define RTC_OFFSET 2082844800
-ADBBusState adb_bus;
-
static void cuda_update(CUDAState *s);
static void cuda_receive_packet_from_host(CUDAState *s,
const uint8_t *data, int len);
@@ -459,7 +457,7 @@ static void cuda_adb_poll(void *opaque)
uint8_t obuf[ADB_MAX_OUT_LEN + 2];
int olen;
- olen = adb_poll(&adb_bus, obuf + 2);
+ olen = adb_poll(&s->adb_bus, obuf + 2);
if (olen > 0) {
obuf[0] = ADB_PACKET;
obuf[1] = 0x40; /* polled data */
@@ -555,7 +553,7 @@ static void cuda_receive_packet_from_host(CUDAState *s,
{
uint8_t obuf[ADB_MAX_OUT_LEN + 2];
int olen;
- olen = adb_request(&adb_bus, obuf + 2, data + 1, len - 1);
+ olen = adb_request(&s->adb_bus, obuf + 2, data + 1, len - 1);
if (olen > 0) {
obuf[0] = ADB_PACKET;
obuf[1] = 0x00;
@@ -713,7 +711,7 @@ static void cuda_initfn(Object *obj)
s->timers[i].index = i;
}
- qbus_create_inplace((BusState *)&adb_bus, TYPE_ADB_BUS, DEVICE(obj),
+ qbus_create_inplace((BusState *)&s->adb_bus, TYPE_ADB_BUS, DEVICE(obj),
"adb.0");
}