ucontext.h revision 114349
1161754Sru/*- 288276Smarkm * Copyright (c) 1999 Marcel Moolenaar 388276Smarkm * All rights reserved. 47527Sjkh * 57527Sjkh * Redistribution and use in source and binary forms, with or without 67527Sjkh * modification, are permitted provided that the following conditions 77527Sjkh * are met: 87527Sjkh * 1. Redistributions of source code must retain the above copyright 97527Sjkh * notice, this list of conditions and the following disclaimer 107527Sjkh * in this position and unchanged. 117527Sjkh * 2. Redistributions in binary form must reproduce the above copyright 127527Sjkh * notice, this list of conditions and the following disclaimer in the 137527Sjkh * documentation and/or other materials provided with the distribution. 147527Sjkh * 3. The name of the author may not be used to endorse or promote products 157527Sjkh * derived from this software without specific prior written permission. 16161754Sru * 177527Sjkh * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 187527Sjkh * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 197527Sjkh * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 207527Sjkh * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 217527Sjkh * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 227527Sjkh * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 237527Sjkh * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 247527Sjkh * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 257527Sjkh * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 267527Sjkh * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 277527Sjkh * 287527Sjkh * $FreeBSD: head/sys/amd64/include/ucontext.h 114349 2003-05-01 01:05:25Z peter $ 297527Sjkh */ 307527Sjkh 317527Sjkh#ifndef _MACHINE_UCONTEXT_H_ 327527Sjkh#define _MACHINE_UCONTEXT_H_ 3388276Smarkm 3488276Smarkmtypedef struct __mcontext { 3588276Smarkm /* 367527Sjkh * The first 20 fields must match the definition of 3788276Smarkm * sigcontext. So that we can support sigcontext 3888276Smarkm * and ucontext_t at the same time. 39161754Sru */ 4080381Ssheldonh register_t mc_onstack; /* XXX - sigcontext compat. */ 4188276Smarkm register_t mc_r15; /* machine state (struct trapframe) */ 427527Sjkh register_t mc_r14; 437527Sjkh register_t mc_r13; 447527Sjkh register_t mc_r12; 457527Sjkh register_t mc_r11; 467527Sjkh register_t mc_r10; 477527Sjkh register_t mc_r9; 4888276Smarkm register_t mc_r8; 4988276Smarkm register_t mc_rdi; 507527Sjkh register_t mc_rsi; 517527Sjkh register_t mc_rbp; 527527Sjkh register_t mc_rbx; 537527Sjkh register_t mc_rdx; 54161754Sru register_t mc_rcx; 557527Sjkh register_t mc_rax; 56161754Sru register_t mc_trapno; 577527Sjkh register_t mc_err; 58161754Sru register_t mc_rip; 59161754Sru register_t mc_cs; 60161754Sru register_t mc_rflags; 61161754Sru register_t mc_rsp; 62161754Sru register_t mc_ss; 63161754Sru 64161754Sru long mc_len; /* sizeof(mcontext_t) */ 65161754Sru#define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */ 66161754Sru#define _MC_FPFMT_XMM 0x10002 67161754Sru long mc_fpformat; 6888276Smarkm#define _MC_FPOWNED_NONE 0x20000 /* FP state not used */ 69161754Sru#define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */ 707527Sjkh#define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */ 7188276Smarkm long mc_ownedfp; 7288276Smarkm long mc_spare1[1]; /* align next field to 16 bytes */ 7388276Smarkm /* 747527Sjkh * See <machine/npx.h> for the internals of mc_fpstate[]. 757527Sjkh */ 767527Sjkh long mc_fpstate[128] __aligned(16); 777527Sjkh long mc_spare2[8]; 787527Sjkh} mcontext_t; 797527Sjkh 8088276Smarkm#endif /* !_MACHINE_UCONTEXT_H_ */ 8188276Smarkm