2012-05-15 21:26:09 +00:00
|
|
|
/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
|
2000-08-02 15:15:00 +00:00
|
|
|
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
|
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
2000-08-02 15:15:00 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
#ifndef _SYS_UCONTEXT_H
|
|
|
|
#define _SYS_UCONTEXT_H 1
|
2000-09-28 23:32:48 +00:00
|
|
|
/* Forward definition to avoid parse errors */
|
|
|
|
struct ucontext;
|
|
|
|
typedef struct ucontext ucontext_t;
|
2000-08-02 15:15:00 +00:00
|
|
|
#include <features.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
/* We need the signal context definitions even if they are not used
|
|
|
|
included in <signal.h>. */
|
|
|
|
#include <bits/sigcontext.h>
|
|
|
|
|
2001-08-16 05:39:18 +00:00
|
|
|
/* Type for a program status word. */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned long mask;
|
|
|
|
unsigned long addr;
|
2012-05-15 21:26:09 +00:00
|
|
|
} __attribute__ ((__aligned__(8))) __psw_t;
|
2000-08-02 15:15:00 +00:00
|
|
|
|
2000-09-28 23:32:48 +00:00
|
|
|
/* Type for a general-purpose register. */
|
|
|
|
typedef unsigned long greg_t;
|
2000-08-02 15:15:00 +00:00
|
|
|
|
2001-08-21 02:46:26 +00:00
|
|
|
/* And the whole bunch of them. We should have used `struct s390_regs',
|
|
|
|
but to avoid name space pollution and since the tradition says that
|
|
|
|
the register set is an array, we make gregset_t a simple array
|
|
|
|
that has the same size as s390_regs. This is needed for the
|
|
|
|
elf_prstatus structure. */
|
2002-07-11 21:44:15 +00:00
|
|
|
#if __WORDSIZE == 64
|
|
|
|
# define NGREG 27
|
|
|
|
#else
|
|
|
|
# define NGREG 36
|
|
|
|
#endif
|
2001-08-21 02:46:26 +00:00
|
|
|
/* Must match kernels psw_t alignment. */
|
2012-05-15 21:26:09 +00:00
|
|
|
typedef greg_t gregset_t[NGREG] __attribute__ ((__aligned__(8)));
|
2000-08-02 15:15:00 +00:00
|
|
|
|
2000-09-28 23:32:48 +00:00
|
|
|
typedef union
|
2001-08-21 02:46:26 +00:00
|
|
|
{
|
|
|
|
double d;
|
|
|
|
float f;
|
|
|
|
} fpreg_t;
|
2000-08-02 15:15:00 +00:00
|
|
|
|
2000-09-28 23:32:48 +00:00
|
|
|
/* Register set for the floating-point registers. */
|
2001-08-21 02:46:26 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned int fpc;
|
|
|
|
fpreg_t fprs[16];
|
|
|
|
} fpregset_t;
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
/* Context to describe whole processor state. */
|
|
|
|
typedef struct
|
|
|
|
{
|
2001-08-21 02:46:26 +00:00
|
|
|
__psw_t psw;
|
|
|
|
unsigned long gregs[16];
|
2001-08-16 05:39:18 +00:00
|
|
|
unsigned int aregs[16];
|
2001-08-21 02:46:26 +00:00
|
|
|
fpregset_t fpregs;
|
2000-08-02 15:15:00 +00:00
|
|
|
} mcontext_t;
|
|
|
|
|
|
|
|
/* Userlevel context. */
|
2000-09-28 23:32:48 +00:00
|
|
|
struct ucontext
|
2000-08-02 15:15:00 +00:00
|
|
|
{
|
|
|
|
unsigned long int uc_flags;
|
2001-03-28 17:28:41 +00:00
|
|
|
struct ucontext *uc_link;
|
2000-08-02 15:15:00 +00:00
|
|
|
stack_t uc_stack;
|
|
|
|
mcontext_t uc_mcontext;
|
2001-08-16 05:39:18 +00:00
|
|
|
__sigset_t uc_sigmask;
|
2000-09-28 23:32:48 +00:00
|
|
|
};
|
|
|
|
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
#endif /* sys/ucontext.h */
|