Turnstone Operating System
Loading...
Searching...
No Matches
time_timer.64.c File Reference

Timer driver. More...

#include <time/timer.h>
#include <logging.h>
#include <ports.h>
#include <cpu/task.h>
#include <cpu.h>
#include <apic.h>
#include <device/rtc.h>
#include <device/hpet.h>
#include <time.h>
#include <random.h>
#include <hypervisor/hypervisor_vm.h>

Macros

#define TIME_TIMER_PIT_BASE_HZ   1193181
 
#define TIME_TIMER_PIT_COMMAND_PORT   0x43
 
#define TIME_TIMER_PIT_COMMAND_PERIODIC   0x36
 
#define TIME_TIMER_PIT_COMMAND_ONE_SHOT   0x32
 
#define TIME_TIMER_PIT_DATA_PORT   0x40
 

Functions

 MODULE ("turnstone.kernel.timer")
 
void time_timer_reset_tick_count (void)
 
void video_text_print (const char_t *string)
 
int8_t time_timer_pit_isr (interrupt_frame_ext_t *frame)
 
void time_timer_pit_set_hz (uint16_t hz)
 
void time_timer_pit_disable (void)
 
void time_timer_pit_sleep (uint64_t usecs)
 
int8_t time_timer_apic_isr (interrupt_frame_ext_t *frame)
 
uint64_t time_timer_get_tick_count (void)
 
void time_timer_configure_spinsleep (void)
 
void time_timer_spinsleep (uint64_t usecs)
 
void time_timer_sleep (uint64_t secs)
 

Variables

__volatile__ uint64_t time_timer_tick_count = 0
 
__volatile__ uint64_t time_timer_old_tick_count = 0
 
__volatile__ uint64_t time_timer_ap1_tick_count = 0
 
__volatile__ uint64_t time_timer_spinsleep_counter_value = 0
 
__volatile__ uint8_t time_timer_start_spinsleep_counter = 0
 
volatile uint64_t time_timer_rdtsc_delta = 0
 
boolean_t we_sended_nmi_to_bsp = false
 
volatile boolean_t task_tasking_initialized
 

Detailed Description

Timer driver.

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.