1 /* Machine-dependent processor state structure for FreeBSD.
2 Copyright (C) 2002 Free Software Foundation, Inc.
3 This file is part of the GNU C Library. x86_64 version.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 #if !defined _SYS_UCONTEXT_H
21 # error "Never use <bits/mcontext.h> directly; include <sys/ucontext.h> instead."
25 * Copyright (c) 2003 Peter Wemm
26 * Copyright (c) 1999 Marcel Moolenaar
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
32 * 1. Redistributions of source code must retain the above copyright
33 * notice, this list of conditions and the following disclaimer
34 * in this position and unchanged.
35 * 2. Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in the
37 * documentation and/or other materials provided with the distribution.
38 * 3. The name of the author may not be used to endorse or promote products
39 * derived from this software without specific prior written permission.
41 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
42 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
43 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
44 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
45 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
50 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 * based on $FreeBSD: src/sys/amd64/include/ucontext.h,v 1.18 2003/11/08 04:39:22 peter Exp $
57 /* Whole processor state. */
61 * The first 20 fields must match the definition of
62 * sigcontext. So that we can support sigcontext
63 * and ucontext_t at the same time.
66 int mc_onstack
; /* Nonzero if running on sigstack. */
68 /* Segment registers. */
74 /* "General" registers. These members are in the order that the i386
75 `pusha' and `popa' instructions use (`popa' ignores %esp). */
79 int mc_isp
; /* Not used; sc_esp is used instead. */
88 int mc_eip
; /* Instruction pointer. */
89 int mc_cs
; /* Code segment register. */
91 int mc_efl
; /* Processor flags. */
93 int mc_esp
; /* This stack pointer is used. */
94 int mc_ss
; /* Stack segment register. */
96 int mc_len
; /* sizeof(mcontext_t) */
97 #define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */
98 #define _MC_FPFMT_387 0x10001
99 #define _MC_FPFMT_XMM 0x10002
101 #define _MC_FPOWNED_NONE 0x20000 /* FP state not used */
102 #define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */
103 #define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */
105 int mc_spare1
[1]; /* align next field to 16 bytes */
107 * See <machine/npx.h> for the internals of mc_fpstate[].
109 int mc_fpstate
[128] __attribute__((aligned(16)));
115 /* Whole processor state. */
119 * The first 20 fields must match the definition of
120 * sigcontext. So that we can support sigcontext
121 * and ucontext_t at the same time.
123 long mc_onstack
; /* XXX - sigcontext compat. */
124 long mc_rdi
; /* machine state (struct trapframe) */
149 long mc_len
; /* sizeof(mcontext_t) */
150 #define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */
151 #define _MC_FPFMT_XMM 0x10002
153 #define _MC_FPOWNED_NONE 0x20000 /* FP state not used */
154 #define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */
155 #define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */
158 * See <machine/fpu.h> for the internals of mc_fpstate[].
160 long mc_fpstate
[64] __attribute__((aligned(16)));
166 /* Traditional BSD names for some members. */
167 #define mc_eflags mc_efl