arch/x86/include/asm/fpu/types.h
Source file repositories/reference/linux-study-clean/arch/x86/include/asm/fpu/types.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/include/asm/fpu/types.h- Extension
.h- Size
- 15811 bytes
- Lines
- 648
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/page_types.h
Detected Declarations
struct fregs_statestruct fxregs_statestruct swregs_statestruct reg_128_bitstruct reg_256_bitstruct reg_512_bitstruct reg_1024_bytestruct ymmh_structstruct mpx_bndregstruct mpx_bndreg_statestruct mpx_bndcsrstruct mpx_bndcsr_statestruct avx_512_opmask_statestruct avx_512_zmm_uppers_statestruct avx_512_hi16_statestruct pkru_statestruct cet_user_statestruct cet_supervisor_statestruct lbr_entrystruct arch_lbr_statestruct xtile_cfgstruct xtile_datastruct apx_statestruct ia32_pasid_statestruct xstate_headerstruct xregs_statestruct fpstatestruct fpu_state_permstruct fpustruct fpu_gueststruct vcpu_fpu_configstruct fpu_state_configenum xfeature
Annotated Snippet
struct fregs_state {
u32 cwd; /* FPU Control Word */
u32 swd; /* FPU Status Word */
u32 twd; /* FPU Tag Word */
u32 fip; /* FPU IP Offset */
u32 fcs; /* FPU IP Selector */
u32 foo; /* FPU Operand Pointer Offset */
u32 fos; /* FPU Operand Pointer Selector */
/* 8*10 bytes for each FP-reg = 80 bytes: */
u32 st_space[20];
/* Software status information [not touched by FSAVE]: */
u32 status;
};
/*
* The legacy fx SSE/MMX FPU state format, as saved by FXSAVE and
* restored by the FXRSTOR instructions. It's similar to the FSAVE
* format, but differs in some areas, plus has extensions at
* the end for the XMM registers.
*/
struct fxregs_state {
u16 cwd; /* Control Word */
u16 swd; /* Status Word */
u16 twd; /* Tag Word */
u16 fop; /* Last Instruction Opcode */
union {
struct {
u64 rip; /* Instruction Pointer */
u64 rdp; /* Data Pointer */
};
struct {
u32 fip; /* FPU IP Offset */
u32 fcs; /* FPU IP Selector */
u32 foo; /* FPU Operand Offset */
u32 fos; /* FPU Operand Selector */
};
};
u32 mxcsr; /* MXCSR Register State */
u32 mxcsr_mask; /* MXCSR Mask */
/* 8*16 bytes for each FP-reg = 128 bytes: */
u32 st_space[32];
/* 16*16 bytes for each XMM-reg = 256 bytes: */
u32 xmm_space[64];
u32 padding[12];
union {
u32 padding1[12];
u32 sw_reserved[12];
};
} __attribute__((aligned(16)));
/* Default value for fxregs_state.mxcsr: */
#define MXCSR_DEFAULT 0x1f80
/* Copy both mxcsr & mxcsr_flags with a single u64 memcpy: */
#define MXCSR_AND_FLAGS_SIZE sizeof(u64)
/*
* Software based FPU emulation state. This is arbitrary really,
* it matches the x87 format to make it easier to understand:
*/
struct swregs_state {
u32 cwd;
u32 swd;
u32 twd;
u32 fip;
u32 fcs;
u32 foo;
u32 fos;
/* 8*10 bytes for each FP-reg = 80 bytes: */
u32 st_space[20];
u8 ftop;
u8 changed;
u8 lookahead;
u8 no_update;
u8 rm;
u8 alimit;
struct math_emu_info *info;
u32 entry_eip;
};
/*
* List of XSAVE features Linux knows about:
*/
Annotation
- Immediate include surface: `asm/page_types.h`.
- Detected declarations: `struct fregs_state`, `struct fxregs_state`, `struct swregs_state`, `struct reg_128_bit`, `struct reg_256_bit`, `struct reg_512_bit`, `struct reg_1024_byte`, `struct ymmh_struct`, `struct mpx_bndreg`, `struct mpx_bndreg_state`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.