PatchworkOS
966e257
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
simd.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
stdbool.h
>
4
#include <
stdint.h
>
5
6
/**
7
* @brief SIMD context management
8
* @defgroup kernel_cpu_simd SIMD
9
* @ingroup kernel_cpu
10
*
11
* SIMD (Single Instruction, Multiple Data) context management allows saving and restoring the state of SIMD registers,
12
* the fact that SIMD uses its own registers is the reason that we cant use SIMD in the kernel normally.
13
*
14
* @see [XSAVE Instruction](https://www.felixcloutier.com/x86/xsave)
15
* @see [FXSAVE Instruction](https://www.felixcloutier.com/x86/fxsave)
16
* @see [FNINIT Instruction](https://www.felixcloutier.com/x86/fninit)
17
*
18
* @{
19
*/
20
21
typedef
struct
22
{
23
uint8_t
*
buffer
;
24
}
simd_ctx_t
;
25
26
void
simd_cpu_init
(
void
);
27
28
uint64_t
simd_ctx_init
(
simd_ctx_t
* ctx);
29
30
void
simd_ctx_deinit
(
simd_ctx_t
* ctx);
31
32
void
simd_ctx_save
(
simd_ctx_t
* ctx);
33
34
void
simd_ctx_load
(
simd_ctx_t
* ctx);
35
36
/** @} */
simd_ctx_save
void simd_ctx_save(simd_ctx_t *ctx)
Definition
simd.c:139
simd_ctx_load
void simd_ctx_load(simd_ctx_t *ctx)
Definition
simd.c:154
simd_ctx_init
uint64_t simd_ctx_init(simd_ctx_t *ctx)
Definition
simd.c:121
simd_cpu_init
void simd_cpu_init(void)
Definition
simd.c:41
simd_ctx_deinit
void simd_ctx_deinit(simd_ctx_t *ctx)
Definition
simd.c:134
stdbool.h
stdint.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:11
simd_ctx_t
Definition
simd.h:22
simd_ctx_t::buffer
uint8_t * buffer
Definition
simd.h:23
include
kernel
cpu
simd.h
Generated on Mon Dec 15 2025 21:55:53 for PatchworkOS by
1.9.8