PatchworkOS
Loading...
Searching...
No Matches
SIMD

SIMD context management. More...

Data Structures

struct  simd_ctx_t
 

Functions

void simd_cpu_init (void)
 
uint64_t simd_ctx_init (simd_ctx_t *ctx)
 
void simd_ctx_deinit (simd_ctx_t *ctx)
 
void simd_ctx_save (simd_ctx_t *ctx)
 
void simd_ctx_load (simd_ctx_t *ctx)
 

Detailed Description

SIMD context management.

SIMD (Single Instruction, Multiple Data) context management allows saving and restoring the state of SIMD registers, the fact that SIMD uses its own registers is the reason that we cant use SIMD in the kernel normally.

See also
XSAVE Instruction
FXSAVE Instruction
FNINIT Instruction

Function Documentation

◆ simd_cpu_init()

◆ simd_ctx_deinit()

void simd_ctx_deinit ( simd_ctx_t ctx)

Definition at line 99 of file simd.c.

References simd_ctx_t::buffer, and pmm_free().

Referenced by thread_free().

◆ simd_ctx_init()

uint64_t simd_ctx_init ( simd_ctx_t ctx)

Definition at line 86 of file simd.c.

References simd_ctx_t::buffer, ERR, memcpy(), NULL, PAGE_SIZE, and pmm_alloc().

Referenced by thread_init().

◆ simd_ctx_load()

void simd_ctx_load ( simd_ctx_t ctx)

Definition at line 119 of file simd.c.

References simd_ctx_t::buffer, CPUID_ECX_OSXSAVE, cpuid_feature_info(), info, and UINT64_MAX.

Referenced by thread_load().

◆ simd_ctx_save()

void simd_ctx_save ( simd_ctx_t ctx)

Definition at line 104 of file simd.c.

References simd_ctx_t::buffer, CPUID_ECX_OSXSAVE, cpuid_feature_info(), info, and UINT64_MAX.

Referenced by thread_save().