exposing timer ticks for use as time stamp later on

This commit is contained in:
shockrah 2019-12-01 02:28:02 -08:00
parent 92c24db1e6
commit 9be7091faa
2 changed files with 3 additions and 2 deletions

3
pit.c
View File

@ -4,8 +4,6 @@
#include "serial.h"
#include "stlio.h"
volatile u32 pit_timer_ticks = 0;
void pit_inc_ticks(struct cpu_reg_state* cpu) {
pit_timer_ticks++;
}
@ -17,4 +15,5 @@ void pit_timer_wait(u32 time) {
void pit_install_timer(void) {
init_irq_handler(0, pit_inc_ticks); // timer interrupt request falls into irq 0
pit_timer_ticks = 0;
}

2
pit.h
View File

@ -9,6 +9,8 @@
#define PIT_TIME_DATA1 0x41
#define PIT_TIME_DATA2 0x42
volatile u32 pit_timer_ticks;
void pit_inc_ticks(struct cpu_reg_state*);
void pit_timer_wait(u32);