pit_install_timer def and cleaner interface
This commit is contained in:
parent
98eb93bc71
commit
d4108d8b24
5
pit.c
5
pit.c
@ -1,9 +1,10 @@
|
|||||||
#include "pit.h"
|
#include "pit.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "interrupts.h"
|
#include "interrupts.h"
|
||||||
|
#include "serial.h"
|
||||||
#include "stlio.h"
|
#include "stlio.h"
|
||||||
|
|
||||||
timer_ticks = 0;
|
u32 timer_ticks = 0;
|
||||||
|
|
||||||
void inc_ticks(struct cpu_reg_state* cpu) {
|
void inc_ticks(struct cpu_reg_state* cpu) {
|
||||||
timer_ticks++;
|
timer_ticks++;
|
||||||
@ -12,8 +13,6 @@ void inc_ticks(struct cpu_reg_state* cpu) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tick_width(u32 width) {
|
|
||||||
}
|
|
||||||
void pit_install_timer(void) {
|
void pit_install_timer(void) {
|
||||||
init_irq_handler(0, inc_ticks); // timer interrupt request falls into int 0
|
init_irq_handler(0, inc_ticks); // timer interrupt request falls into int 0
|
||||||
}
|
}
|
7
pit.h
7
pit.h
@ -1,13 +1,12 @@
|
|||||||
|
#include "interrupts.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
u32 timer_ticks;
|
|
||||||
// 60hz timer for now
|
// 60hz timer for now
|
||||||
#define PIT_TIMER_INTERVAL 100
|
#define PIT_TIMER_INTERVAL 100
|
||||||
#define PIT_TIME_DATA0 0x40
|
#define PIT_TIME_DATA0 0x40
|
||||||
#define PIT_TIME_DATA1 0x41
|
#define PIT_TIME_DATA1 0x41
|
||||||
#define PIT_TIME_DATA2 0x42
|
#define PIT_TIME_DATA2 0x42
|
||||||
|
|
||||||
// Sets the tick rate 100hz
|
void inc_ticks(struct cpu_reg_state*);
|
||||||
void tick_width(u32);
|
|
||||||
|
|
||||||
void inc_ticks(struct cpu_reg_state* cpu);
|
void pit_install_timer(void);
|
Loading…
Reference in New Issue
Block a user