PIT: add alternative faster PIT
This is enabled by default on 486+ CPUs and can be forced disabled/enabled with pit_mode=0/1
This commit is contained in:
@@ -161,6 +161,16 @@ machine_available(int m)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pit_irq0_timer(int new_out, int old_out)
|
||||
{
|
||||
if (new_out && !old_out)
|
||||
picint(1);
|
||||
|
||||
if (!new_out)
|
||||
picintc(1);
|
||||
}
|
||||
|
||||
void
|
||||
machine_common_init(const machine_t *model)
|
||||
{
|
||||
@@ -168,5 +178,10 @@ machine_common_init(const machine_t *model)
|
||||
pic_init();
|
||||
dma_init();
|
||||
|
||||
pit_common_init(!!IS_AT(machine), pit_irq0_timer, NULL);
|
||||
int pit_type = IS_AT(machine) ? PIT_8254 : PIT_8253;
|
||||
/* Select fast PIT if needed */
|
||||
if ((pit_mode == -1 && is486) || pit_mode == 1)
|
||||
pit_type += 2;
|
||||
|
||||
pit_common_init(pit_type, pit_irq0_timer, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user