Crashpad
Classes | Public Types | Static Public Member Functions | Public Attributes | List of all members
crashpad::CPUContextX86 Struct Reference

A context structure carrying 32-bit x86 CPU state. More...

#include "snapshot/cpu_context.h"

Classes

struct  Fxsave
 
union  X87OrMMXRegister
 

Public Types

using X87Register = uint8_t[10]
 
using XMMRegister = uint8_t[16]
 

Static Public Member Functions

static uint16_t FxsaveToFsaveTagWord (uint16_t fsw, uint8_t fxsave_tag, const X87OrMMXRegister st_mm[8])
 Converts x87 floating-point tag words from fxsave (abridged, 8-bit) to fsave (full, 16-bit) form. More...
 

Public Attributes

uint32_t eax
 
uint32_t ebx
 
uint32_t ecx
 
uint32_t edx
 
uint32_t edi
 
uint32_t esi
 
uint32_t ebp
 
uint32_t esp
 
uint32_t eip
 
uint32_t eflags
 
uint16_t cs
 
uint16_t ds
 
uint16_t es
 
uint16_t fs
 
uint16_t gs
 
uint16_t ss
 
Fxsave fxsave
 
uint32_t dr0
 
uint32_t dr1
 
uint32_t dr2
 
uint32_t dr3
 
uint32_t dr4
 
uint32_t dr5
 
uint32_t dr6
 
uint32_t dr7
 

Detailed Description

A context structure carrying 32-bit x86 CPU state.

Member Function Documentation

§ FxsaveToFsaveTagWord()

uint16_t crashpad::CPUContextX86::FxsaveToFsaveTagWord ( uint16_t  fsw,
uint8_t  fxsave_tag,
const X87OrMMXRegister  st_mm[8] 
)
static

Converts x87 floating-point tag words from fxsave (abridged, 8-bit) to fsave (full, 16-bit) form.

fxsave stores the x87 floating-point tag word in abridged 8-bit form, and fsave stores it in full 16-bit form. Some users, notably MinidumpContextX86::float_save::tag_word, require the full 16-bit form, where most other contemporary code uses fxsave and thus the abridged 8-bit form found in CPUContextX86::Fxsave::ftw.

This function converts an abridged tag word to the full version by using the abridged tag word and the contents of the registers it describes. See Intel Software Developer’s Manual, Volume 2A: Instruction Set Reference A-M (253666-052), 3.2 “FXSAVE”, specifically, the notes on the abridged FTW and recreating the FSAVE format, and AMD Architecture Programmer’s Manual, Volume 2: System Programming (24593-3.24), “FXSAVE Format for x87 Tag Word”.

Parameters
[in]fswThe FPU status word, used to map logical st_mm registers to their physical counterparts. This can be taken from CPUContextX86::Fxsave::fsw.
[in]fxsave_tagThe abridged FPU tag word. This can be taken from CPUContextX86::Fxsave::ftw.
[in]st_mmThe floating-point registers in logical order. This can be taken from CPUContextX86::Fxsave::st_mm.
Returns
The full FPU tag word.

The documentation for this struct was generated from the following files: