Revision db45c29a vl.c

b/vl.c
147 147
uint32_t default_ioport_readw(void *opaque, uint32_t address)
148 148
{
149 149
    uint32_t data;
150
    data = ioport_read_table[0][address & (MAX_IOPORTS - 1)](opaque, address);
151
    data |= ioport_read_table[0][(address + 1) & (MAX_IOPORTS - 1)](opaque, address + 1) << 8;
150
    data = ioport_read_table[0][address](ioport_opaque[address], address);
151
    address = (address + 1) & (MAX_IOPORTS - 1);
152
    data |= ioport_read_table[0][address](ioport_opaque[address], address) << 8;
152 153
    return data;
153 154
}
154 155

  
155 156
void default_ioport_writew(void *opaque, uint32_t address, uint32_t data)
156 157
{
157
    ioport_write_table[0][address & (MAX_IOPORTS - 1)](opaque, address, data & 0xff);
158
    ioport_write_table[0][(address + 1) & (MAX_IOPORTS - 1)](opaque, address + 1, (data >> 8) & 0xff);
158
    ioport_write_table[0][address](ioport_opaque[address], address, data & 0xff);
159
    address = (address + 1) & (MAX_IOPORTS - 1);
160
    ioport_write_table[0][address](ioport_opaque[address], address, (data >> 8) & 0xff);
159 161
}
160 162

  
161 163
uint32_t default_ioport_readl(void *opaque, uint32_t address)
......
283 285

  
284 286
void cpu_outb(CPUState *env, int addr, int val)
285 287
{
286
    addr &= (MAX_IOPORTS - 1);
287 288
#ifdef DEBUG_IOPORT
288 289
    if (loglevel & CPU_LOG_IOPORT)
289 290
        fprintf(logfile, "outb: %04x %02x\n", addr, val);
......
293 294

  
294 295
void cpu_outw(CPUState *env, int addr, int val)
295 296
{
296
    addr &= (MAX_IOPORTS - 1);
297 297
#ifdef DEBUG_IOPORT
298 298
    if (loglevel & CPU_LOG_IOPORT)
299 299
        fprintf(logfile, "outw: %04x %04x\n", addr, val);
......
303 303

  
304 304
void cpu_outl(CPUState *env, int addr, int val)
305 305
{
306
    addr &= (MAX_IOPORTS - 1);
307 306
#ifdef DEBUG_IOPORT
308 307
    if (loglevel & CPU_LOG_IOPORT)
309 308
        fprintf(logfile, "outl: %04x %08x\n", addr, val);
......
314 313
int cpu_inb(CPUState *env, int addr)
315 314
{
316 315
    int val;
317
    addr &= (MAX_IOPORTS - 1);
318 316
    val = ioport_read_table[0][addr](ioport_opaque[addr], addr);
319 317
#ifdef DEBUG_IOPORT
320 318
    if (loglevel & CPU_LOG_IOPORT)
......
326 324
int cpu_inw(CPUState *env, int addr)
327 325
{
328 326
    int val;
329
    addr &= (MAX_IOPORTS - 1);
330 327
    val = ioport_read_table[1][addr](ioport_opaque[addr], addr);
331 328
#ifdef DEBUG_IOPORT
332 329
    if (loglevel & CPU_LOG_IOPORT)
......
338 335
int cpu_inl(CPUState *env, int addr)
339 336
{
340 337
    int val;
341
    addr &= (MAX_IOPORTS - 1);
342 338
    val = ioport_read_table[2][addr](ioport_opaque[addr], addr);
343 339
#ifdef DEBUG_IOPORT
344 340
    if (loglevel & CPU_LOG_IOPORT)

Also available in: Unified diff