Revision afcea8cb kvm-all.c
b/kvm-all.c | ||
---|---|---|
517 | 517 |
return ret; |
518 | 518 |
} |
519 | 519 |
|
520 |
static int kvm_handle_io(CPUState *env, uint16_t port, void *data,
|
|
521 |
int direction, int size, uint32_t count)
|
|
520 |
static int kvm_handle_io(uint16_t port, void *data, int direction, int size,
|
|
521 |
uint32_t count) |
|
522 | 522 |
{ |
523 | 523 |
int i; |
524 | 524 |
uint8_t *ptr = data; |
... | ... | |
527 | 527 |
if (direction == KVM_EXIT_IO_IN) { |
528 | 528 |
switch (size) { |
529 | 529 |
case 1: |
530 |
stb_p(ptr, cpu_inb(env, port));
|
|
530 |
stb_p(ptr, cpu_inb(port)); |
|
531 | 531 |
break; |
532 | 532 |
case 2: |
533 |
stw_p(ptr, cpu_inw(env, port));
|
|
533 |
stw_p(ptr, cpu_inw(port)); |
|
534 | 534 |
break; |
535 | 535 |
case 4: |
536 |
stl_p(ptr, cpu_inl(env, port));
|
|
536 |
stl_p(ptr, cpu_inl(port)); |
|
537 | 537 |
break; |
538 | 538 |
} |
539 | 539 |
} else { |
540 | 540 |
switch (size) { |
541 | 541 |
case 1: |
542 |
cpu_outb(env, port, ldub_p(ptr));
|
|
542 |
cpu_outb(port, ldub_p(ptr)); |
|
543 | 543 |
break; |
544 | 544 |
case 2: |
545 |
cpu_outw(env, port, lduw_p(ptr));
|
|
545 |
cpu_outw(port, lduw_p(ptr)); |
|
546 | 546 |
break; |
547 | 547 |
case 4: |
548 |
cpu_outl(env, port, ldl_p(ptr));
|
|
548 |
cpu_outl(port, ldl_p(ptr)); |
|
549 | 549 |
break; |
550 | 550 |
} |
551 | 551 |
} |
... | ... | |
625 | 625 |
switch (run->exit_reason) { |
626 | 626 |
case KVM_EXIT_IO: |
627 | 627 |
dprintf("handle_io\n"); |
628 |
ret = kvm_handle_io(env, run->io.port,
|
|
628 |
ret = kvm_handle_io(run->io.port, |
|
629 | 629 |
(uint8_t *)run + run->io.data_offset, |
630 | 630 |
run->io.direction, |
631 | 631 |
run->io.size, |
Also available in: Unified diff