]> gitweb.factorcode.org Git - factor.git/blob - vm/os-windows.32.hpp
vm: better organize atomics and sample counter
[factor.git] / vm / os-windows.32.hpp
1 #include "atomic-cl-32.hpp"
2
3 namespace factor
4 {
5
6 #define ESP Esp
7 #define EIP Eip
8
9 typedef struct DECLSPEC_ALIGN(16) _M128A {
10         ULONGLONG Low;
11         LONGLONG High;
12 } M128A, *PM128A;
13
14 /* The ExtendedRegisters field of the x86.32 CONTEXT structure uses this layout; however,
15  * this structure is only made available from winnt.h on x86.64 */
16 typedef struct _XMM_SAVE_AREA32 {
17         WORD ControlWord;        /* 000 */
18         WORD StatusWord;         /* 002 */
19         BYTE TagWord;            /* 004 */
20         BYTE Reserved1;          /* 005 */
21         WORD ErrorOpcode;        /* 006 */
22         DWORD ErrorOffset;       /* 008 */
23         WORD ErrorSelector;      /* 00c */
24         WORD Reserved2;          /* 00e */
25         DWORD DataOffset;        /* 010 */
26         WORD DataSelector;       /* 014 */
27         WORD Reserved3;          /* 016 */
28         DWORD MxCsr;             /* 018 */
29         DWORD MxCsr_Mask;        /* 01c */
30         M128A FloatRegisters[8]; /* 020 */
31         M128A XmmRegisters[16];  /* 0a0 */
32         BYTE Reserved4[96];      /* 1a0 */
33 } XMM_SAVE_AREA32, *PXMM_SAVE_AREA32;
34
35 #define X87SW(ctx) (ctx)->FloatSave.StatusWord
36 #define MXCSR(ctx) ((XMM_SAVE_AREA32*)((ctx)->ExtendedRegisters))->MxCsr
37
38 }