glibc/sysdeps/unix/sysv/linux/mips/sys/ucontext.h

113 lines
3.0 KiB
C
Raw Normal View History

/* 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>
#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>
/* Type for general register. Even in o32 we assume 64-bit registers,
like the kernel. */
__extension__ typedef unsigned long long int greg_t;
1998-11-28 21:05:36 +00:00
/* Number of general registers. */
#define NGREG 32
#define NFPREG 32
1998-11-28 21:05:36 +00:00
/* Container for all general registers. */
typedef greg_t gregset_t[NGREG];
1998-11-28 21:05:36 +00:00
/* Container for all FPU registers. */
typedef struct fpregset {
union {
double fp_dregs[NFPREG];
1998-11-28 21:05:36 +00:00
struct {
float _fp_fregs;
unsigned int _fp_pad;
} fp_fregs[NFPREG];
1998-11-28 21:05:36 +00:00
} fp_r;
} fpregset_t;
1998-11-28 21:05:36 +00:00
/* Context to describe whole processor state. */
#if _MIPS_SIM == _ABIO32
/* Earlier versions of glibc for mips had an entirely different
definition of mcontext_t, that didn't even resemble the
corresponding kernel data structure. Fortunately, makecontext,
[gs]etcontext et all were not implemented back then, so this can
still be rectified. */
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;
unsigned int dsp;
greg_t mdhi;
greg_t mdlo;
unsigned long hi1;
unsigned long lo1;
unsigned long hi2;
unsigned long lo2;
unsigned long hi3;
unsigned long lo3;
} mcontext_t;
#else
1998-11-28 21:05:36 +00:00
typedef struct
{
gregset_t gregs;
fpregset_t fpregs;
greg_t mdhi;
greg_t hi1;
greg_t hi2;
greg_t hi3;
greg_t mdlo;
greg_t lo1;
greg_t lo2;
greg_t lo3;
greg_t pc;
unsigned int fpc_csr;
unsigned int used_math;
unsigned int dsp;
unsigned int reserved;
1998-11-28 21:05:36 +00:00
} mcontext_t;
#endif
1998-11-28 21:05:36 +00:00
/* Userlevel context. */
typedef struct ucontext
{
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 */