59 asm volatile(
"fninit");
66 asm volatile(
"fxsave (%0)" : :
"r"(initCtx));
150 asm volatile(
"fxsave (%0)" : :
"r"(ctx->
buffer));
165 asm volatile(
"fxrstor (%0)" : :
"r"(ctx->
buffer));
void simd_ctx_save(simd_ctx_t *ctx)
void simd_ctx_load(simd_ctx_t *ctx)
uint64_t simd_ctx_init(simd_ctx_t *ctx)
void simd_ctx_deinit(simd_ctx_t *ctx)
static cpu_t * cpu_get_unsafe(void)
Gets the current CPU structure without disabling interrupts.
#define CPU_ID_BOOTSTRAP
ID of the bootstrap CPU.
#define ALIGNED(alignment)
GCC aligned attribute.
#define LOG_INFO(format,...)
void pmm_free(void *address)
Frees a single physical page.
void * pmm_alloc(void)
Allocates a single physical page.
static cpuid_instruction_sets_t cpuid_detect_instruction_sets(void)
Helper to detect supported instruction sets.
static void cpuid_feature_info(cpuid_feature_info_t *info)
Wrapper to get CPU feature information.
cpuid_instruction_sets_t
Supported CPU instruction sets.
static void cpuid_extended_feature_info(cpuid_extended_feature_info_t *info)
Wrapper to get CPU extended feature information.
@ CPUID_INSTRUCTION_SET_SSSE3
@ CPUID_INSTRUCTION_SET_SSE2
@ CPUID_INSTRUCTION_SET_SSE4_2
@ CPUID_INSTRUCTION_SET_SSE3
@ CPUID_INSTRUCTION_SET_AVX512
@ CPUID_INSTRUCTION_SET_AVX
@ CPUID_INSTRUCTION_SET_SSE4_1
@ CPUID_INSTRUCTION_SET_SSE
@ CPUID_INSTRUCTION_SET_AVX2
#define PAGE_SIZE
The size of a memory page in bytes.
#define NULL
Pointer error value.
#define ERR
Integer error value.
#define XCR0_AVX512_ENABLE
#define CR0_NUMERIC_ERROR_ENABLE
#define XCR0_ZMM16_32_ENABLE
#define XCR0_XSAVE_SAVE_SSE
#define XCR0_ZMM0_15_ENABLE
#define CR4_SIMD_EXCEPTION
static void cr4_write(uint64_t value)
#define CR0_MONITOR_CO_PROCESSOR
static void cr0_write(uint64_t value)
static void xcr0_write(uint32_t xcr, uint64_t value)
static uint64_t cr0_read()
static uint64_t cr4_read()
#define XCR0_XSAVE_SAVE_X87
static void simd_xsave_init(void)
_PUBLIC void * memcpy(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
CPU extended feature information structure.
cpuid_ebx_features_t featuresEbx
CPU feature information structure.