|
AquilaOS documentation
How it works, and its code
|
#include <cpu/cpu.h>Go to the source code of this file.
Data Structures | |
| struct | x86_thread |
| A thread's x86 state: its kernel stack, and where it resumes. More... | |
Macros | |
| #define | X86_SS (0x20 | 3) |
| #define | X86_EFLAGS (0x200) |
| #define | X86_CS (0x18 | 3) |
| #define | USER_STACK (0x0000800000000000UL) |
| #define | USER_STACK_BASE (USER_STACK - USER_STACK_SIZE) |
| #define | SIGCODE_ADDR (USER_STACK_BASE - 0x1000) |
| #define | KERN_STACK_SIZE (16384U) |
Functions | |
| void | arch_syscall (struct x86_regs *r) |
| Runs a system call that user mode made: the trap handler calls it. | |
| static void | arch_interrupts_enable (void) |
| static void | arch_interrupts_disable (void) |
| 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) |
| #define SIGCODE_ADDR (USER_STACK_BASE - 0x1000) |
| #define USER_STACK_BASE (USER_STACK - USER_STACK_SIZE) |
| #define X86_CS (0x18 | 3) |
Definition at line 13 of file arch.h.
Referenced by arch_sigreturn(), and thread_spawn().
| #define X86_EFLAGS (0x200) |
Definition at line 12 of file arch.h.
Referenced by arch_exec_start(), arch_kthread_create(), arch_proc_init(), arch_sigreturn(), arch_thread_create(), and deliver().
| #define X86_SS (0x20 | 3) |
Definition at line 11 of file arch.h.
Referenced by arch_sigreturn(), and thread_spawn().
|
inlinestatic |
Definition at line 77 of file arch.h.
References arch_interrupts_disable().
|
inlinestatic |
Definition at line 72 of file arch.h.
References arch_interrupts_enable().
| void arch_syscall | ( | struct x86_regs * | r | ) |
Runs a system call that user mode made: the trap handler calls it.
It returns to user mode when the call is done, delivering the signals that came meanwhile. Each architecture has its own, with its own saved registers (sys/syscall.c).
| r | the registers user mode had, saved on the kernel stack |
Definition at line 22 of file syscall.c.
References arch_syscall(), curthread, x86_regs::r10, x86_regs::r8, x86_regs::rax, x86_regs::rdi, x86_regs::rdx, x86_regs::rsi, sched_urgent, syscall_dispatch(), and x86_return_to_user().
References x86_goto().
Referenced by arch_cur_thread_kill(), arch_idle(), arch_thread_spawn(), arch_thread_switch(), and x86_goto().
| 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().
Referenced by thread_spawn(), and x86_jump_user().