#include <round.h>
#include <stdint.h>
Go to the source code of this file.
◆ TIMER_FREQ
◆ timer_calibrate()
| void timer_calibrate |
( |
void |
| ) |
|
51 {
52 unsigned high_bit, test_bit;
53
55 printf (
"Calibrating timer... ");
56
57
58
63 }
64
65
67 for (test_bit = high_bit >> 1; test_bit != high_bit >> 10; test_bit >>= 1)
70
72}
#define ASSERT(CONDITION)
Definition: debug.h:30
@ INTR_ON
Definition: interrupt.h:10
enum intr_level intr_get_level(void)
Definition: interrupt.c:115
#define PRIu64
Definition: inttypes.h:30
unsigned long long int uint64_t
Definition: stdint.h:29
int printf(const char *,...) PRINTF_FORMAT(1
static unsigned loops_per_tick
Definition: timer.c:26
static bool too_many_loops(unsigned loops)
Definition: timer.c:147
#define TIMER_FREQ
Definition: timer.h:8
◆ timer_elapsed()
87 {
89}
int64_t timer_ticks(void)
Definition: timer.c:76
◆ timer_init()
37 {
38
39
41
43 outb (0x40, count & 0xff);
44 outb (0x40, count >> 8);
45
47}
void intr_register_ext(uint8_t vec, intr_handler_func *, const char *name)
Definition: interrupt.c:228
static void outb(uint16_t port, uint8_t data)
Definition: io.h:109
unsigned short int uint16_t
Definition: stdint.h:23
static intr_handler_func timer_interrupt
Definition: timer.c:28
◆ timer_msleep()
| void timer_msleep |
( |
int64_t |
milliseconds | ) |
|
110 {
112}
static void real_time_sleep(int64_t num, int32_t denom)
Definition: timer.c:177
◆ timer_nsleep()
| void timer_nsleep |
( |
int64_t |
nanoseconds | ) |
|
◆ timer_print_stats()
| void timer_print_stats |
( |
void |
| ) |
|
128 {
130}
#define PRId64
Definition: inttypes.h:27
◆ timer_sleep()
95 {
97
99
100
101
102
105
106}
signed long long int int64_t
Definition: stdint.h:16
void thread_sleep(int64_t ticks)
Definition: thread.c:365
int64_t timer_elapsed(int64_t then)
Definition: timer.c:87
static int64_t ticks
Definition: timer.c:22
◆ timer_ticks()
76 {
81 return t;
82}
enum intr_level intr_set_level(enum intr_level)
Definition: interrupt.c:130
enum intr_level intr_disable(void)
Definition: interrupt.c:151
intr_level
Definition: interrupt.h:8
#define barrier()
Definition: synch.h:50
◆ timer_usleep()
| void timer_usleep |
( |
int64_t |
microseconds | ) |
|