2014-01-01 11:03:15 +00:00
|
|
|
/* Copyright (C) 1997-2014 Free Software Foundation, Inc. This file is part of the GNU C Library.
|
1998-11-28 21:05:36 +00:00
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:56:23 +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.
|
1998-11-28 21:05:36 +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:56:23 +00:00
|
|
|
Lesser General Public License for more details.
|
1998-11-28 21:05:36 +00:00
|
|
|
|
2001-07-06 04:56:23 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-03-09 23:56:38 +00:00
|
|
|
License along with the GNU C Library. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1998-11-28 21:05:36 +00:00
|
|
|
|
|
|
|
/* Don't rely on this, the interface is currently messed up and may need to
|
|
|
|
be broken to be fixed. */
|
|
|
|
#ifndef _SYS_UCONTEXT_H
|
|
|
|
#define _SYS_UCONTEXT_H 1
|
|
|
|
|
|
|
|
#include <features.h>
|
2004-11-24 04:36:11 +00:00
|
|
|
#include <sgidefs.h>
|
1998-11-28 21:05:36 +00:00
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
/* We need the signal context definitions even if they are not used
|
|
|
|
included in <signal.h>. */
|
|
|
|
#include <bits/sigcontext.h>
|
|
|
|
|
2003-04-13 11:36:32 +00:00
|
|
|
/* Type for general register. Even in o32 we assume 64-bit registers,
|
|
|
|
like the kernel. */
|
2003-03-17 15:47:13 +00:00
|
|
|
__extension__ typedef unsigned long long int greg_t;
|
1998-11-28 21:05:36 +00:00
|
|
|
|
|
|
|
/* Number of general registers. */
|
2003-04-13 11:36:32 +00:00
|
|
|
#define NGREG 32
|
|
|
|
#define NFPREG 32
|
1998-11-28 21:05:36 +00:00
|
|
|
|
|
|
|
/* Container for all general registers. */
|
2000-06-02 13:10:38 +00:00
|
|
|
typedef greg_t gregset_t[NGREG];
|
|
|
|
|
1998-11-28 21:05:36 +00:00
|
|
|
/* Container for all FPU registers. */
|
|
|
|
typedef struct fpregset {
|
|
|
|
union {
|
2003-04-13 11:36:32 +00:00
|
|
|
double fp_dregs[NFPREG];
|
1998-11-28 21:05:36 +00:00
|
|
|
struct {
|
|
|
|
float _fp_fregs;
|
|
|
|
unsigned int _fp_pad;
|
2003-04-13 11:36:32 +00:00
|
|
|
} fp_fregs[NFPREG];
|
1998-11-28 21:05:36 +00:00
|
|
|
} fp_r;
|
|
|
|
} fpregset_t;
|
|
|
|
|
2000-05-31 12:03:35 +00:00
|
|
|
|
1998-11-28 21:05:36 +00:00
|
|
|
/* Context to describe whole processor state. */
|
2004-11-24 04:36:11 +00:00
|
|
|
#if _MIPS_SIM == _ABIO32
|
2003-04-13 11:36:32 +00:00
|
|
|
/* Earlier versions of glibc for mips had an entirely different
|
|
|
|
definition of mcontext_t, that didn't even resemble the
|
2009-04-18 17:32:04 +00:00
|
|
|
corresponding kernel data structure. Fortunately, makecontext,
|
|
|
|
[gs]etcontext et all were not implemented back then, so this can
|
|
|
|
still be rectified. */
|
2003-04-13 11:36:32 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned int regmask;
|
|
|
|
unsigned int status;
|
|
|
|
greg_t pc;
|
|
|
|
gregset_t gregs;
|
|
|
|
fpregset_t fpregs;
|
|
|
|
unsigned int fp_owned;
|
|
|
|
unsigned int fpc_csr;
|
|
|
|
unsigned int fpc_eir;
|
|
|
|
unsigned int used_math;
|
2006-05-10 18:57:03 +00:00
|
|
|
unsigned int dsp;
|
2003-04-13 11:36:32 +00:00
|
|
|
greg_t mdhi;
|
|
|
|
greg_t mdlo;
|
2006-05-10 18:57:03 +00:00
|
|
|
unsigned long hi1;
|
|
|
|
unsigned long lo1;
|
|
|
|
unsigned long hi2;
|
|
|
|
unsigned long lo2;
|
|
|
|
unsigned long hi3;
|
|
|
|
unsigned long lo3;
|
2003-04-13 11:36:32 +00:00
|
|
|
} mcontext_t;
|
|
|
|
#else
|
1998-11-28 21:05:36 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
gregset_t gregs;
|
|
|
|
fpregset_t fpregs;
|
2003-04-13 11:36:32 +00:00
|
|
|
greg_t mdhi;
|
2006-05-10 18:57:03 +00:00
|
|
|
greg_t hi1;
|
|
|
|
greg_t hi2;
|
|
|
|
greg_t hi3;
|
2003-04-13 11:36:32 +00:00
|
|
|
greg_t mdlo;
|
2006-05-10 18:57:03 +00:00
|
|
|
greg_t lo1;
|
|
|
|
greg_t lo2;
|
|
|
|
greg_t lo3;
|
2003-04-13 11:36:32 +00:00
|
|
|
greg_t pc;
|
|
|
|
unsigned int fpc_csr;
|
|
|
|
unsigned int used_math;
|
2006-05-10 18:57:03 +00:00
|
|
|
unsigned int dsp;
|
|
|
|
unsigned int reserved;
|
1998-11-28 21:05:36 +00:00
|
|
|
} mcontext_t;
|
2003-04-13 11:36:32 +00:00
|
|
|
#endif
|
1998-11-28 21:05:36 +00:00
|
|
|
|
|
|
|
/* Userlevel context. */
|
|
|
|
typedef struct ucontext
|
|
|
|
{
|
2000-02-01 11:20:19 +00:00
|
|
|
unsigned long int uc_flags;
|
1998-11-28 21:05:36 +00:00
|
|
|
struct ucontext *uc_link;
|
|
|
|
stack_t uc_stack;
|
|
|
|
mcontext_t uc_mcontext;
|
|
|
|
__sigset_t uc_sigmask;
|
|
|
|
} ucontext_t;
|
|
|
|
|
|
|
|
#endif /* sys/ucontext.h */
|