aboutsummaryrefslogtreecommitdiff
path: root/hw/mc146818rtc.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-14 21:46:48 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-14 21:46:48 +0000
commitb41a2cd1e4228c765e3b82ec6c89096528b4d7d9 (patch)
tree7f2180a4dbb0ca207e8c47ab07d03bcb00960730 /hw/mc146818rtc.c
parentc4b1fcc0f9594cae64d5bf172548a522db0c2545 (diff)
io port API change
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@664 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mc146818rtc.c')
-rw-r--r--hw/mc146818rtc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index cab76cfab2..7d94b25f56 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -69,9 +69,9 @@
RTCState rtc_state;
-static void cmos_ioport_write(CPUState *env, uint32_t addr, uint32_t data)
+static void cmos_ioport_write(void *opaque, uint32_t addr, uint32_t data)
{
- RTCState *s = &rtc_state;
+ RTCState *s = opaque;
if ((addr & 1) == 0) {
s->cmos_index = data & 0x7f;
@@ -134,9 +134,9 @@ static void cmos_update_time(RTCState *s)
s->cmos_data[REG_IBM_PS2_CENTURY_BYTE] = s->cmos_data[REG_IBM_CENTURY_BYTE];
}
-static uint32_t cmos_ioport_read(CPUState *env, uint32_t addr)
+static uint32_t cmos_ioport_read(void *opaque, uint32_t addr)
{
- RTCState *s = &rtc_state;
+ RTCState *s = opaque;
int ret;
if ((addr & 1) == 0) {
return 0xff;
@@ -197,7 +197,7 @@ void rtc_init(int base, int irq)
s->cmos_data[RTC_REG_C] = 0x00;
s->cmos_data[RTC_REG_D] = 0x80;
- register_ioport_write(base, 2, cmos_ioport_write, 1);
- register_ioport_read(base, 2, cmos_ioport_read, 1);
+ register_ioport_write(base, 2, 1, cmos_ioport_write, s);
+ register_ioport_read(base, 2, 1, cmos_ioport_read, s);
}