1 /* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
18 #ifndef _SYS_UCONTEXT_H
19 #define _SYS_UCONTEXT_H 1
24 * Location of the users' stored registers relative to R0.
25 * Usage is as an index into a gregset_t array or as u.u_ar0[XX].
30 #define REG_WVALID (3)
46 #define REG_GLOBALS (19)
49 * A gregset_t is defined as an array type for compatibility with the reference
50 * source. This is important due to differences in the way the C language
51 * treats arrays and structures as parameters.
53 * Note that NGREG is really (sizeof (struct regs) / sizeof (greg_t)),
54 * but that the ABI defines it absolutely to be 21 (resp. 19).
60 typedef greg_t gregset_t[NGREG];
63 * The following structures define how a register window can appear on the
64 * stack. This structure is available (when required) through the `gwins'
65 * field of an mcontext (nested within ucontext). NIOS_MAXWINDOW is the
66 * maximum number of outstanding register windows defined in the NIOS
67 * architecture (*not* implementation).
69 #define NIOS_MAXREGWINDOW 31 /* max windows in NIOS arch. */
72 greg_t rw_local[8]; /* locals */
73 greg_t rw_in[8]; /* ins */
76 #define rw_fp rw_in[6] /* frame pointer */
77 #define rw_rtn rw_in[7] /* return address */
79 typedef struct gwindows
82 int *spbuf[NIOS_MAXREGWINDOW];
83 struct rwindow wbuf[NIOS_MAXREGWINDOW];
88 gregset_t gregs; /* general register set */
89 gwindows_t *gwins; /* POSSIBLE pointer to register windows */
93 /* Userlevel context. */
94 typedef struct ucontext
96 unsigned long uc_flags;
97 struct ucontext *uc_link;
98 __sigset_t uc_sigmask;
100 mcontext_t uc_mcontext;
103 #endif /* sys/ucontext.h */