|
PatchworkOS
|
#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | XCR0_XSAVE_SAVE_X87 (1 << 0) |
| #define | XCR0_XSAVE_SAVE_SSE (1 << 1) |
| #define | XCR0_AVX_ENABLE (1 << 2) |
| #define | XCR0_AVX512_ENABLE (1 << 5) |
| #define | XCR0_ZMM0_15_ENABLE (1 << 6) |
| #define | XCR0_ZMM16_32_ENABLE (1 << 7) |
| #define | MSR_LAPIC 0x1B |
| #define | MSR_CPU_ID 0xC0000103 |
| #define | MSR_EFER 0xC0000080 |
| #define | MSR_STAR 0xC0000081 |
| #define | MSR_LSTAR 0xC0000082 |
| #define | MSR_SYSCALL_FLAG_MASK 0xC0000084 |
| #define | MSR_GS_BASE 0xC0000101 |
| #define | MSR_KERNEL_GS_BASE 0xc0000102 |
| #define | EFER_SYSCALL_ENABLE 1 |
| #define | RFLAGS_CARRY (1 << 0) |
| #define | RFLAGS_ALWAYS_SET (1 << 1) |
| #define | RFLAGS_PARITY (1 << 2) |
| #define | RFLAGS_RESERVED1 (1 << 3) |
| #define | RFLAGS_AUX_CARRY (1 << 4) |
| #define | RFLAGS_RESERVED2 (1 << 5) |
| #define | RFLAGS_ZERO (1 << 6) |
| #define | RFLAGS_SIGN (1 << 7) |
| #define | RFLAGS_TRAP (1 << 8) |
| #define | RFLAGS_INTERRUPT_ENABLE (1 << 9) |
| #define | RFLAGS_DIRECTION (1 << 10) |
| #define | RFLAGS_OVERFLOW (1 << 11) |
| #define | RFLAGS_IOPL (1 << 12 | 1 << 13) |
| #define | RFLAGS_NESTED_TASK (1 << 14) |
| #define | RFLAGS_MODE (1 << 15) |
| #define | CR0_PROTECTED_MODE_ENABLE (1 << 0) |
| #define | CR0_MONITOR_CO_PROCESSOR (1 << 1) |
| #define | CR0_EMULATION (1 << 2) |
| #define | CR0_TASK_SWITCHED (1 << 3) |
| #define | CR0_EXTENSION_TYPE (1 << 4) |
| #define | CR0_NUMERIC_ERROR_ENABLE (1 << 5) |
| #define | CR0_WRITE_PROTECT (1 << 16) |
| #define | CR0_ALIGNMENT_MASK (1 << 18) |
| #define | CR0_NOT_WRITE_THROUGH (1 << 29) |
| #define | CR0_CACHE_DISABLE (1 << 30) |
| #define | CR0_PAGING_ENABLE (1 << 31) |
| #define | CR4_PAGE_GLOBAL_ENABLE (1 << 7) |
| #define | CR4_FXSR_ENABLE (1 << 9) |
| #define | CR4_SIMD_EXCEPTION (1 << 10) |
| #define | CR4_XSAVE_ENABLE (1 << 18) |
Functions | |
| static void | xcr0_write (uint32_t xcr, uint64_t value) |
| static uint64_t | msr_read (uint32_t msr) |
| static void | msr_write (uint32_t msr, uint64_t value) |
| static uint64_t | rflags_read () |
| static void | rflags_write (uint64_t value) |
| static uint64_t | cr4_read () |
| static void | cr4_write (uint64_t value) |
| static uint64_t | cr3_read () |
| static void | cr3_write (uint64_t value) |
| static uint64_t | cr2_read () |
| static void | cr2_write (uint64_t value) |
| static uint64_t | cr0_read () |
| static void | cr0_write (uint64_t value) |
| static uint64_t | rsp_read () |
| static void | rsp_write (uint64_t value) |
| static uint64_t | rbp_read () |
| static void | rbp_write (uint64_t value) |
|
inlinestatic |
Definition at line 126 of file regs.h.
Referenced by panic(), and simd_cpu_init().
|
inlinestatic |
Definition at line 133 of file regs.h.
Referenced by simd_cpu_init().
|
inlinestatic |
Definition at line 114 of file regs.h.
Referenced by exception_handler(), panic(), and thread_handle_page_fault().
|
inlinestatic |
Definition at line 102 of file regs.h.
Referenced by page_table_load(), panic(), tlb_invalidate(), and vmm_cpu_ctx_init_common().
|
inlinestatic |
Definition at line 109 of file regs.h.
Referenced by page_table_load(), tlb_invalidate(), and vmm_init().
|
inlinestatic |
Definition at line 90 of file regs.h.
Referenced by panic(), simd_cpu_init(), simd_xsave_init(), and vmm_cpu_ctx_init_common().
|
inlinestatic |
Definition at line 97 of file regs.h.
Referenced by simd_cpu_init(), simd_xsave_init(), and vmm_cpu_ctx_init_common().
Definition at line 63 of file regs.h.
Referenced by lapic_cpu_init(), smp_self(), smp_self_id_unsafe(), smp_self_unsafe(), and syscalls_cpu_init().
Definition at line 71 of file regs.h.
Referenced by cpu_init(), lapic_cpu_init(), smp_bootstrap_init_early(), syscall_ctx_load(), and syscalls_cpu_init().
|
inlinestatic |
Definition at line 78 of file regs.h.
Referenced by inode_truncate(), interrupt_disable(), interrupt_enable(), space_load(), vfs_create(), vfs_get_or_lookup_dentry(), vfs_getdents(), vfs_ioctl(), vfs_link(), vfs_mmap(), vfs_open(), vfs_open2(), vfs_read(), vfs_remove(), vfs_seek(), vfs_write(), wait_block_cancel(), and wait_block_commit().
|
inlinestatic |
Definition at line 56 of file regs.h.
Referenced by simd_xsave_init().