Skip to content

Commit

Permalink
KVM: PIT: support mode 3
Browse files Browse the repository at this point in the history
The in-kernel PIT emulation ignores pending timers if operating
under mode 3, which for example Hurd uses.

This mode should output a square wave, high for (N+1)/2 counts and low
for (N-1)/2 counts. As we only care about the resulting interrupts, the
period is N, and mode 3 is the same as mode 2 with regard to
interrupts.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Aurelien Jarno authored and Avi Kivity committed Jul 20, 2008
1 parent 2e2e373 commit f697554
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kvm/i8254.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ static void pit_load_count(struct kvm *kvm, int channel, u32 val)
create_pit_timer(&ps->pit_timer, val, 0);
break;
case 2:
case 3:
create_pit_timer(&ps->pit_timer, val, 1);
break;
default:
Expand Down

0 comments on commit f697554

Please sign in to comment.