struct CPUContextX86

Defined at line 26 of file ../../third_party/crashpad/src/snapshot/cpu_context.h

A context structure carrying 32-bit x86 CPU state.

Public Members

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

Public Methods

void FxsaveToFsave (const Fxsave & fxsave, Fsave * fsave)

Converts an `fxsave` area to an `fsave` area.

`fsave` state is restricted to the x87 FPU, while `fxsave` state includes

state related to the x87 FPU as well as state specific to SSE.

As the `fxsave` format is a superset of the `fsave` format, this operation

fully populates the `fsave` area. `fsave` uses the full 16-bit form for

the x87 floating-point tag word, so FxsaveToFsaveTagWord() is used to

derive Fsave::ftw from the abridged 8-bit form used by `fxsave`. Reserved

fields in

are set to `0`.

Parameters

fxsave [in] The `fxsave` area to convert.
fsave [out] The `fsave` area to populate.
void FsaveToFxsave (const Fsave & fsave, Fxsave * fxsave)

Converts an `fsave` area to an `fxsave` area.

`fsave` state is restricted to the x87 FPU, while `fxsave` state includes

state related to the x87 FPU as well as state specific to SSE.

As the `fsave` format is a subset of the `fxsave` format, this operation

cannot fully populate the `fxsave` area. Fields in

that have no

equivalent in

are set to `0`, including Fxsave::mxcsr,

Fxsave::mxcsr_mask, Fxsave::xmm, and Fxsave::available.

FsaveToFxsaveTagWord() is used to derive Fxsave::ftw from the full 16-bit

form used by `fsave`. Reserved fields in

are set to `0`.

Parameters

fsave [in] The `fsave` area to convert.
fxsave [out] The `fxsave` area to populate.
uint16_t FxsaveToFsaveTagWord (uint16_t fsw, uint8_t fxsave_tag, const X87OrMMXRegister[8] st_mm)

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

CPUContextX86::Fsave::ftw, 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

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

Returns

The full FPU tag word.

uint8_t FsaveToFxsaveTagWord (uint16_t fsave_tag)

Converts x87 floating-point tag words from `fsave` (full, 16-bit)

to `fxsave` (abridged, 8-bit) form.

This function performs the inverse operation of FxsaveToFsaveTagWord().

Parameters

fsave_tag [in] The full FPU tag word.

Returns

The abridged FPU tag word.

Records