AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
sys.h
Go to the documentation of this file.
1#include <core/system.h>
2#include <cpu/cpu.h>
3#include <mm/mm.h>
4#include <sys/proc.h>
5
6/* x86: what arch/i386/sys/ shares. */
7
8/* Start running in user mode, and jump to an address with a frame pointer
9 * and a stack (cpu.S). */
10void x86_jump_user(uintptr_t eax, uintptr_t eip, uintptr_t cs, uintptr_t eflags, uintptr_t esp, uintptr_t ss) __attribute__((noreturn));
11void x86_goto(uintptr_t eip, uintptr_t ebp, uintptr_t esp) __attribute__((noreturn));
12
13/* clock.c */
14void x86_clock_init(void);
15void x86_clock_ticks(uint32_t period_ns);
16void x86_clock_tick(void);
17const char *x86_clock_source(void);
18
19/* Pushes `value`, of `type`, on the stack at `stack`. */
20#define PUSH(stack, type, value)\
21 do {\
22 (stack) -= sizeof(type);\
23 *((type *) (stack)) = (type) (value);\
24 } while (0)
void x86_goto(uintptr_t eip, uintptr_t ebp, uintptr_t esp)
void x86_jump_user(uintptr_t eax, uintptr_t eip, uintptr_t cs, uintptr_t eflags, uintptr_t esp, uintptr_t ss)
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.
Definition clock.c:180
const char * x86_clock_source(void)
Returns the name of the clock's counter.
Definition clock.c:257
void x86_clock_init(void)
Chooses the clock's counter and calibrates it, at boot, before the timer ticks.
Definition clock.c:200
void x86_clock_tick(void)
Counts a tick of the timer, and moves the clock's base on to now.
Definition clock.c:130
__SIZE_TYPE__ uintptr_t
Definition stddef.h:12
unsigned int uint32_t
Definition stddef.h:22