Changeset 3e828ea in mainline for kernel/arch/ia32/src/drivers/i8254.c


Ignore:
Timestamp:
2019-09-23T12:49:29Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9be2358
Parents:
9259d20 (diff), 1a4ec93f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiri Svoboda <jiri@…> (2019-09-22 12:49:07)
git-committer:
Jiri Svoboda <jiri@…> (2019-09-23 12:49:29)
Message:

Merge changes from master, especially Meson build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/drivers/i8254.c

    r9259d20 r3e828ea  
    9696{
    9797        pio_write_8(CLK_PORT4, 0x36);
    98         pic_disable_irqs(1 << IRQ_CLK);
     98        i8259_disable_irqs(1 << IRQ_CLK);
    9999        pio_write_8(CLK_PORT1, (CLK_CONST / HZ) & 0xf);
    100100        pio_write_8(CLK_PORT1, (CLK_CONST / HZ) >> 8);
    101         pic_enable_irqs(1 << IRQ_CLK);
     101        i8259_enable_irqs(1 << IRQ_CLK);
    102102}
    103103
     
    143143        o2 |= pio_read_8(CLK_PORT1) << 8;
    144144
     145        uint32_t delta = (t1 - t2) - (o1 - o2);
     146        if (!delta)
     147                delta = 1;
     148
    145149        CPU->delay_loop_const =
    146             ((MAGIC_NUMBER * LOOPS) / 1000) / ((t1 - t2) - (o1 - o2)) +
    147             (((MAGIC_NUMBER * LOOPS) / 1000) % ((t1 - t2) - (o1 - o2)) ? 1 : 0);
     150            ((MAGIC_NUMBER * LOOPS) / 1000) / delta +
     151            (((MAGIC_NUMBER * LOOPS) / 1000) % delta ? 1 : 0);
    148152
    149153        uint64_t clk1 = get_cycle();
Note: See TracChangeset for help on using the changeset viewer.