AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
sys.h File Reference
#include <core/system.h>
#include <cpu/cpu.h>
#include <mm/mm.h>
#include <sys/proc.h>

Go to the source code of this file.

Macros

#define PUSH(stack, type, value)

Functions

void x86_jump_user (uintptr_t eax, uintptr_t eip, uintptr_t cs, uintptr_t eflags, uintptr_t esp, uintptr_t ss)
void x86_goto (uintptr_t eip, uintptr_t ebp, uintptr_t esp)
void x86_clock_init (void)
 Chooses the clock's counter and calibrates it, at boot, before the timer ticks.
void x86_clock_ticks (uint32_t period_ns)
 Says how often the timer ticks, from now on: with neither TSC nor HPET, the ticks are the clock.
void x86_clock_tick (void)
 Counts a tick of the timer, and moves the clock's base on to now.
const char * x86_clock_source (void)
 Returns the name of the clock's counter.

Macro Definition Documentation

◆ PUSH

#define PUSH ( stack,
type,
value )
Value:
do {\
(stack) -= sizeof(type);\
*((type *) (stack)) = (type) (value);\
} while (0)

Definition at line 20 of file sys.h.

Referenced by arch_kthread_create(), and arch_thread_create().

Function Documentation

◆ x86_clock_init()

void x86_clock_init ( void )

Chooses the clock's counter and calibrates it, at boot, before the timer ticks.

Definition at line 200 of file clock.c.

References base_count, base_ns, counter(), kargs_get(), last_ns, mult, NULL, printk(), source, SOURCE_HPET, SOURCE_PIT, SOURCE_TSC, tsc_calibrate(), tsc_invariant(), x86_clock_init(), x86_hpet_init(), and x86_hpet_period_fs().

Referenced by arch_sched_init(), x86_clock_init(), and x86_goto().

◆ x86_clock_source()

const char * x86_clock_source ( void )

Returns the name of the clock's counter.

Returns
"tsc", "hpet" or "pit"

Definition at line 257 of file clock.c.

References names, source, and x86_clock_source().

Referenced by x86_clock_source(), and x86_goto().

◆ x86_clock_tick()

void x86_clock_tick ( void )

Counts a tick of the timer, and moves the clock's base on to now.

Definition at line 130 of file clock.c.

References base_count, base_ns, counter(), mul_shift32(), mult, since(), source, SOURCE_PIT, ticks, and x86_clock_tick().

Referenced by x86_clock_tick(), x86_goto(), and x86_sched_handler().

◆ x86_clock_ticks()

void x86_clock_ticks ( uint32_t period_ns)

Says how often the timer ticks, from now on: with neither TSC nor HPET, the ticks are the clock.

Parameters
period_nsthe tick's period, in ns

Definition at line 180 of file clock.c.

References printk(), source, SOURCE_PIT, tick_period, and x86_clock_ticks().

Referenced by arch_sched_init(), x86_clock_ticks(), and x86_goto().

◆ x86_goto()

◆ x86_jump_user()

void x86_jump_user ( uintptr_t eax,
uintptr_t eip,
uintptr_t cs,
uintptr_t eflags,
uintptr_t esp,
uintptr_t ss )

References x86_jump_user().