Initial commit
This commit is contained in:
commit
cbc51f523e
125 changed files with 34817 additions and 0 deletions
24
src/hal/timer.c
Normal file
24
src/hal/timer.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include "../sys/acpi.h"
|
||||
#include "../hal/ioapic.h"
|
||||
#include "../hal/apic.h"
|
||||
#include "../drivers/pmt.h"
|
||||
#include "timer.h"
|
||||
#include <stdio.h>
|
||||
#include <SFB25.h>
|
||||
|
||||
/* Determines which timer will be used for calibration */
|
||||
int calibration_timer = -1;
|
||||
|
||||
void timer_init(void){
|
||||
if(pmt_init() == -1){
|
||||
klog(LOG_INFO, __func__, "PMT Timer not found, falling back");
|
||||
/* Fall back to PIT */
|
||||
}else{
|
||||
calibration_timer = PMT;
|
||||
}
|
||||
}
|
||||
|
||||
void sleep(int ms){
|
||||
/* Eventually fix this */
|
||||
apic_sleep(ms);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue