8 /* This was taken from Mingw32's w32api/winnt.h */
10 #define SIZE_OF_80387_REGISTERS 80
11 #define CONTEXT_i386 0x10000
12 #define CONTEXT_i486 0x10000
13 #define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L)
14 #define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L)
15 #define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L)
16 #define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
17 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L)
18 #define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
19 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
20 #define MAXIMUM_SUPPORTED_EXTENSION 512
21 typedef struct _FLOATING_SAVE_AREA
{
29 BYTE RegisterArea
[80];
32 typedef struct _CONTEXT
{
40 FLOATING_SAVE_AREA FloatSave
;
57 BYTE ExtendedRegisters
[MAXIMUM_SUPPORTED_EXTENSION
];
60 #define CONTEXT_CONTROL 1L
61 #define CONTEXT_FLOATING_POINT 2L
62 #define CONTEXT_INTEGER 4L
63 #define CONTEXT_DEBUG_REGISTERS 8L
64 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
148 #elif defined(_ALPHA_)
149 #define CONTEXT_ALPHA 0x20000
150 #define CONTEXT_CONTROL (CONTEXT_ALPHA|1L)
151 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA|2L)
152 #define CONTEXT_INTEGER (CONTEXT_ALPHA|4L)
153 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
154 typedef struct _CONTEXT
{
228 /* These are the debug or break registers on the SH3 */
229 typedef struct _DEBUG_REGISTERS
{
242 } DEBUG_REGISTERS
, *PDEBUG_REGISTERS
;
244 /* The following flags control the contents of the CONTEXT structure. */
246 #define CONTEXT_SH3 0x00000040
247 #define CONTEXT_SH4 0x000000c0 /* CONTEXT_SH3 | 0x80 - must contain the SH3 bits */
250 #define CONTEXT_CONTROL (CONTEXT_SH3 | 0x00000001L)
251 #define CONTEXT_INTEGER (CONTEXT_SH3 | 0x00000002L)
252 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH3 | 0x00000008L)
253 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS)
255 #define CONTEXT_CONTROL (CONTEXT_SH4 | 0x00000001L)
256 #define CONTEXT_INTEGER (CONTEXT_SH4 | 0x00000002L)
257 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH4 | 0x00000008L)
258 #define CONTEXT_FLOATING_POINT (CONTEXT_SH4 | 0x00000004L)
259 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS | CONTEXT_FLOATING_POINT)
264 /* This frame is used to store a limited processor context into the */
265 /* Thread structure for CPUs which have no floating point support. */
267 typedef struct _CONTEXT
{
268 /* The flags values within this flag control the contents of */
269 /* a CONTEXT record. */
271 /* If the context record is used as an input parameter, then */
272 /* for each portion of the context record controlled by a flag */
273 /* whose value is set, it is assumed that that portion of the */
274 /* context record contains valid context. If the context record */
275 /* is being used to modify a thread's context, then only that */
276 /* portion of the threads context will be modified. */
278 /* If the context record is used as an IN OUT parameter to capture */
279 /* the context of a thread, then only those portions of the thread's */
280 /* context corresponding to set flags will be returned. */
282 /* The context record is never used as an OUT only parameter. */
287 /* This section is specified/returned if the ContextFlags word contains */
288 /* the flag CONTEXT_INTEGER. */
290 /* N.B. The registers RA and R15 are defined in this section, but are */
291 /* considered part of the control context rather than part of the integer */
315 /* This section is specified/returned if the ContextFlags word contains */
316 /* the flag CONTEXT_CONTROL. */
318 /* N.B. The registers r15 and ra are defined in the integer section, */
319 /* but are considered part of the control context rather than part of */
320 /* the integer context. */
325 #if !defined(SH3e) && !defined(SH4)
327 DEBUG_REGISTERS DebugRegisters
;
340 /* The following flags control the contents of the CONTEXT structure. */
342 #define CONTEXT_R4000 0x00010000 /* r4000 context */
344 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001L)
345 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002L)
346 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004L)
348 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
352 /* N.B. This frame must be exactly a multiple of 16 bytes in length. */
354 /* This frame has a several purposes: 1) it is used as an argument to */
355 /* NtContinue, 2) it is used to constuct a call frame for APC delivery, */
356 /* 3) it is used to construct a call frame for exception dispatching */
357 /* in user mode, and 4) it is used in the user level thread creation */
360 /* The layout of the record conforms to a standard call frame. */
363 typedef struct _CONTEXT
{
365 /* This section is always present and is used as an argument build */
370 /* This section is specified/returned if the ContextFlags word contains */
371 /* the flag CONTEXT_FLOATING_POINT. */
406 /* This section is specified/returned if the ContextFlags word contains */
407 /* the flag CONTEXT_INTEGER. */
409 /* N.B. The registers gp, sp, and ra are defined in this section, but are */
410 /* considered part of the control context rather than part of the integer */
413 /* N.B. Register zero is not stored in the frame. */
450 /* This section is specified/returned if the ContextFlags word contains */
451 /* the flag CONTEXT_FLOATING_POINT. */
455 /* This section is specified/returned if the ContextFlags word contains */
456 /* the flag CONTEXT_CONTROL. */
458 /* N.B. The registers gp, sp, and ra are defined in the integer section, */
459 /* but are considered part of the control context rather than part of */
460 /* the integer context. */
465 /* The flags values within this flag control the contents of */
466 /* a CONTEXT record. */
468 /* If the context record is used as an input parameter, then */
469 /* for each portion of the context record controlled by a flag */
470 /* whose value is set, it is assumed that that portion of the */
471 /* context record contains valid context. If the context record */
472 /* is being used to modify a thread's context, then only that */
473 /* portion of the threads context will be modified. */
475 /* If the context record is used as an IN OUT parameter to capture */
476 /* the context of a thread, then only those portions of the thread's */
477 /* context corresponding to set flags will be returned. */
479 /* The context record is never used as an OUT only parameter. */
488 /* The following flags control the contents of the CONTEXT structure. */
490 #define CONTEXT_ARM 0x0000040
491 #define CONTEXT_CONTROL (CONTEXT_ARM | 0x00000001L)
492 #define CONTEXT_INTEGER (CONTEXT_ARM | 0x00000002L)
494 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
496 typedef struct _CONTEXT
{
497 /* The flags values within this flag control the contents of
500 If the context record is used as an input parameter, then
501 for each portion of the context record controlled by a flag
502 whose value is set, it is assumed that that portion of the
503 context record contains valid context. If the context record
504 is being used to modify a thread's context, then only that
505 portion of the threads context will be modified.
507 If the context record is used as an IN OUT parameter to capture
508 the context of a thread, then only those portions of the thread's
509 context corresponding to set flags will be returned.
511 The context record is never used as an OUT only parameter. */
515 /* This section is specified/returned if the ContextFlags word contains
516 the flag CONTEXT_INTEGER. */
538 #error "undefined processor type"