972
edits
[unchecked revision] | [unchecked revision] |
m (Bot: Replace deprecated source tag with syntaxhighlight) |
m (Bot: Replace deprecated source tag with syntaxhighlight) |
||
Line 324:
To enable one-shot mode:
<
// "time" is time in femtoseconds from now to interrupt
if (time < COUNTER_CLK_PERIOD)
Line 333:
write_register_64(timer_configuration(n), (ioapic_input << 9) | (1 << 2));
write_register_64(timer_comparator(n), read_register(main_counter) + time);
</syntaxhighlight>
I hope the above code is obvious. If it's not, please analyze the meaning of specific fields in registers used above.
Line 341:
To enable periodic mode:
<
// "time" is time in femtoseconds from now to interrupt
if (time < COUNTER_CLK_PERIOD)
Line 351:
write_register_64(timer_comparator(n), read_register(main_counter) + time);
write_register_64(timer_comparator(n), time);
</syntaxhighlight>
This snippet requires some more comments.
|