4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 * This file contains all the type definitions necessary to
31 * define the equivalent of SVR4 struct ucontext.
34 /* Definition for alternate stack */
35 typedef struct sigaltstack
{
43 int rw_local
[8]; /* locals */
44 int rw_in
[8]; /* ins */
47 #define SPARC_MAXREGWINDOW 31 /* max windows in SPARC arch. */
51 int *spbuf
[SPARC_MAXREGWINDOW
];
52 struct rwindow wbuf
[SPARC_MAXREGWINDOW
];
55 typedef struct gwindows gwindows_t
;
57 /* Floating point registers */
59 unsigned long *fpq_addr
; /* address */
60 unsigned long fpq_instr
; /* instruction */
64 union { /* FPU inst/addr queue */
71 union { /* FPU floating point regs */
72 unsigned fpu_regs
[32]; /* 32 singles */
73 double fpu_dregs
[16]; /* 16 doubles */
75 struct fq
*fpu_q
; /* ptr to array of FQ entries */
76 unsigned fpu_fsr
; /* FPU status register */
77 unsigned char fpu_qcnt
; /* # of entries in saved FQ */
78 unsigned char fpu_q_entrysize
; /* # of bytes per FQ entry */
79 unsigned char fpu_en
; /* flag signifying fpu in use */
82 typedef struct fpu fpregset_t
;
87 typedef int gregset_t
[NGREG
];
89 typedef struct mcontext
{
90 gregset_t gregs
; /* general register set */
91 gwindows_t
*gwins
; /* POSSIBLE pointer to register windows */
92 fpregset_t fpregs
; /* floating point register set */
97 typedef struct ucontext
{
98 unsigned long uc_flags
;
99 struct ucontext
*uc_link
;
100 unsigned long uc_sigmask
[4];
102 mcontext_t uc_mcontext
;
108 /* The following is needed by the setjmp/longjmp routines */
110 #define _ABI_JBLEN 12 /* _JBLEN from base */
113 * The following structure MUST match the ABI size specifier _SIGJBLEN.
114 * This is 19 (words). The ABI value for _JBLEN is 12 (words).
115 * A sigset_t is 16 bytes and a stack_t is 12 bytes. The layout must
116 * match sigjmp_struct_t, defined in usr/src/lib/libc/inc/sigjmp_struct.h
118 typedef struct setjmp_struct_t
{
119 int sjs_flags
; /* JBUF[ 0] */
120 int sjs_sp
; /* JBUF[ 1] */
121 int sjs_pc
; /* JBUF[ 2] */
122 int sjs_fp
; /* JBUF[ 3] */
123 int sjs_i7
; /* JBUF[ 4] */
125 unsigned long sjs_pad
[_ABI_JBLEN
- 6];
126 unsigned long sjs_sigmask
[4];
130 typedef struct o_setjmp_struct_t
{
131 int sjs_flags
; /* JBUF[ 0] */
132 int sjs_sp
; /* JBUF[ 1] */
133 int sjs_pc
; /* JBUF[ 2] */
134 unsigned long sjs_sigmask
[3];
138 #define JB_SAVEMASK 0x1
139 #define UC_SIGMASK 001