mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-25 04:01:10 +00:00
5df4854ed2
Continuing the fixes for namespace issues arising from sys/ucontext.h, this patch conditions various definitions, that are not needed for defining mcontext_t / ucontext_t, on __USE_MISC, so they do not appear in strict POSIX modes. This patch is non-exhaustive; that is, it only conditions straightforward cases and there may be more such definitions that can be conditioned for these and other architectures, to be dealt with later in separate patches. Also, using __USE_MISC is the minimum change for these definitions where they conflict with POSIX; some headers already have __USE_GNU conditionals on similar definitions of names for registers. The patch specifically does not do anything with definitions in bits/sigcontext.h, and nor does it condition any inclusions of bits/sigcontext.h even where in fact that is not needed on some architectures for the definitions of mcontext_t / ucontext_t. As other namespace issues in these headers remain, this patch does not fix bug 21457, nor allow any XFAILs to be removed. Tested with build-many-glibcs.py. [BZ #21457] * sysdeps/arm/sys/ucontext.h (R0): Condition on [__USE_MISC]. (R1): Likewise. (R2): Likewise. (R3): Likewise. (R4): Likewise. (R5): Likewise. (R6): Likewise. (R7): Likewise. (R8): Likewise. (R9): Likewise. (R10): Likewise. (R11): Likewise. (R12): Likewise. (R13): Likewise. (R14): Likewise. (R15): Likewise. * sysdeps/i386/sys/ucontext.h (REG_GS): Likewise. (REG_FS): Likewise. (REG_ES): Likewise. (REG_DS): Likewise. (REG_EDI): Likewise. (REG_ESI): Likewise. (REG_EBP): Likewise. (REG_ESP): Likewise. (REG_EBX): Likewise. (REG_EDX): Likewise. (REG_ECX): Likewise. (REG_EAX): Likewise. (REG_TRAPNO): Likewise. (REG_ERR): Likewise. (REG_EIP): Likewise. (REG_CS): Likewise. (REG_EFL): Likewise. (REG_UESP): Likewise. (REG_SS): Likewise. * sysdeps/m68k/sys/ucontext.h (R_D0): Likewise. (R_D1): Likewise. (R_D2): Likewise. (R_D3): Likewise. (R_D4): Likewise. (R_D5): Likewise. (R_D6): Likewise. (R_D7): Likewise. (R_A0): Likewise. (R_A1): Likewise. (R_A2): Likewise. (R_A3): Likewise. (R_A4): Likewise. (R_A5): Likewise. (R_A6): Likewise. (R_A7): Likewise. (R_SP): Likewise. (R_PC): Likewise. (R_PS): Likewise. (fpregset_t): Likewise. (MCONTEXT_VERSION): Likewise. * sysdeps/mips/sys/ucontext.h (CTX_R0): Likewise. (CTX_AT): Likewise. (CTX_V0): Likewise. (CTX_V1): Likewise. (CTX_A0): Likewise. (CTX_A1): Likewise. (CTX_A2): Likewise. (CTX_A3): Likewise. (CTX_T0): Likewise. (CTX_T1): Likewise. (CTX_T2): Likewise. (CTX_T3): Likewise. (CTX_T4): Likewise. (CTX_T5): Likewise. (CTX_T6): Likewise. (CTX_T7): Likewise. (CTX_S0): Likewise. (CTX_S1): Likewise. (CTX_S2): Likewise. (CTX_S3): Likewise. (CTX_S4): Likewise. (CTX_S5): Likewise. (CTX_S6): Likewise. (CTX_S7): Likewise. (CTX_T8): Likewise. (CTX_T9): Likewise. (CTX_K0): Likewise. (CTX_K1): Likewise. (CTX_GP): Likewise. (CTX_SP): Likewise. (CTX_S8): Likewise. (CTX_RA): Likewise. (CTX_MDLO): Likewise. (CTX_MDHI): Likewise. (CTX_CAUSE): Likewise. (CTX_EPC): Likewise. * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Condition inclusion of <sys/procfs.h> on [__USE_MISC]. (greg_t): Condition on [__USE_MISC]. (gregset_t): Likewise. (fpregset_t): Likewise. * sysdeps/unix/sysv/linux/arm/sys/ucontext.h (greg_t): Likewise. (NGREG): Likewise. (gregset_t): Likewise. (REG_R0): Likewise. (REG_R1): Likewise. (REG_R2): Likewise. (REG_R3): Likewise. (REG_R4): Likewise. (REG_R5): Likewise. (REG_R6): Likewise. (REG_R7): Likewise. (REG_R8): Likewise. (REG_R9): Likewise. (REG_R10): Likewise. (REG_R11): Likewise. (REG_R12): Likewise. (REG_R13): Likewise. (REG_R14): Likewise. (REG_R15): Likewise. (struct _libc_fpstate): Likewise. (fpregset_t): Likewise. * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h (NGREG): Likewise. (NFPREG): Likewise. (gregset_t): Likewise. (fpregset_t): Likewise. * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h (R_D0): Likewise. (R_D1): Likewise. (R_D2): Likewise. (R_D3): Likewise. (R_D4): Likewise. (R_D5): Likewise. (R_D6): Likewise. (R_D7): Likewise. (R_A0): Likewise. (R_A1): Likewise. (R_A2): Likewise. (R_A3): Likewise. (R_A4): Likewise. (R_A5): Likewise. (R_A6): Likewise. (R_A7): Likewise. (R_SP): Likewise. (R_PC): Likewise. (R_PS): Likewise. (fpregset_t): Likewise. (MCONTEXT_VERSION): Likewise. * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h (MCONTEXT_VERSION): Likewise. * sysdeps/unix/sysv/linux/sh/sys/ucontext.h (REG_R0): Likewise. (REG_R1): Likewise. (REG_R2): Likewise. (REG_R3): Likewise. (REG_R4): Likewise. (REG_R5): Likewise. (REG_R6): Likewise. (REG_R7): Likewise. (REG_R8): Likewise. (REG_R9): Likewise. (REG_R10): Likewise. (REG_R11): Likewise. (REG_R12): Likewise. (REG_R13): Likewise. (REG_R14): Likewise. (REG_R15): Likewise. * sysdeps/unix/sysv/linux/tile/sys/ucontext.h: Condition inclusion of <arch/abi.h> on [__USE_MISC]. (greg_t): Condition on [__USE_MISC]. (NGREG): Likewise. (gregset_t): Likewise.
168 lines
3.6 KiB
C
168 lines
3.6 KiB
C
/* Copyright (C) 1998-2017 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
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.
|
|
|
|
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
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with the GNU C Library. If not, see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
/* System V/mips ABI compliant context switching support. */
|
|
|
|
#ifndef _SYS_UCONTEXT_H
|
|
#define _SYS_UCONTEXT_H 1
|
|
|
|
#include <features.h>
|
|
#include <signal.h>
|
|
|
|
/* We need the signal context definitions even if they are not exposed
|
|
by <signal.h>. */
|
|
#include <bits/sigcontext.h>
|
|
#include <bits/sigstack.h>
|
|
|
|
#include <sgidefs.h>
|
|
|
|
|
|
/* Type for general register. */
|
|
#if _MIPS_SIM == _ABIO32
|
|
typedef __uint32_t greg_t;
|
|
#else
|
|
typedef __uint64_t greg_t;
|
|
#endif
|
|
|
|
/* Number of general registers. */
|
|
#define NGREG 36
|
|
|
|
/* Container for all general registers. */
|
|
typedef greg_t gregset_t[NGREG];
|
|
|
|
#ifdef __USE_MISC
|
|
/* Number of each register is the `gregset_t' array. */
|
|
enum
|
|
{
|
|
CTX_R0 = 0,
|
|
# define CTX_R0 CTX_R0
|
|
CTX_AT = 1,
|
|
# define CTX_AT CTX_AT
|
|
CTX_V0 = 2,
|
|
# define CTX_V0 CTX_V0
|
|
CTX_V1 = 3,
|
|
# define CTX_V1 CTX_V1
|
|
CTX_A0 = 4,
|
|
# define CTX_A0 CTX_A0
|
|
CTX_A1 = 5,
|
|
# define CTX_A1 CTX_A1
|
|
CTX_A2 = 6,
|
|
# define CTX_A2 CTX_A2
|
|
CTX_A3 = 7,
|
|
# define CTX_A3 CTX_A3
|
|
CTX_T0 = 8,
|
|
# define CTX_T0 CTX_T0
|
|
CTX_T1 = 9,
|
|
# define CTX_T1 CTX_T1
|
|
CTX_T2 = 10,
|
|
# define CTX_T2 CTX_T2
|
|
CTX_T3 = 11,
|
|
# define CTX_T3 CTX_T3
|
|
CTX_T4 = 12,
|
|
# define CTX_T4 CTX_T4
|
|
CTX_T5 = 13,
|
|
# define CTX_T5 CTX_T5
|
|
CTX_T6 = 14,
|
|
# define CTX_T6 CTX_T6
|
|
CTX_T7 = 15,
|
|
# define CTX_T7 CTX_T7
|
|
CTX_S0 = 16,
|
|
# define CTX_S0 CTX_S0
|
|
CTX_S1 = 17,
|
|
# define CTX_S1 CTX_S1
|
|
CTX_S2 = 18,
|
|
# define CTX_S2 CTX_S2
|
|
CTX_S3 = 19,
|
|
# define CTX_S3 CTX_S3
|
|
CTX_S4 = 20,
|
|
# define CTX_S4 CTX_S4
|
|
CTX_S5 = 21,
|
|
# define CTX_S5 CTX_S5
|
|
CTX_S6 = 22,
|
|
# define CTX_S6 CTX_S6
|
|
CTX_S7 = 23,
|
|
# define CTX_S7 CTX_S7
|
|
CTX_T8 = 24,
|
|
# define CTX_T8 CTX_T8
|
|
CTX_T9 = 25,
|
|
# define CTX_T9 CTX_T9
|
|
CTX_K0 = 26,
|
|
# define CTX_K0 CTX_K0
|
|
CTX_K1 = 27,
|
|
# define CTX_K1 CTX_K1
|
|
CTX_GP = 28,
|
|
# define CTX_GP CTX_GP
|
|
CTX_SP = 29,
|
|
# define CTX_SP CTX_SP
|
|
CTX_S8 = 30,
|
|
# define CTX_S8 CTX_S8
|
|
CTX_RA = 31,
|
|
# define CTX_RA CTX_RA
|
|
CTX_MDLO = 32,
|
|
# define CTX_MDLO CTX_MDLO
|
|
CTX_MDHI = 33,
|
|
# define CTX_MDHI CTX_MDHI
|
|
CTX_CAUSE = 34,
|
|
# define CTX_CAUSE CTX_CAUSE
|
|
CTX_EPC = 35,
|
|
# define CTX_EPC CTX_EPC
|
|
};
|
|
#endif
|
|
|
|
/* Structure to describe FPU registers. */
|
|
typedef struct fpregset
|
|
{
|
|
union
|
|
{
|
|
#if _MIPS_SIM == _ABIO32
|
|
double fp_dregs[16];
|
|
float fp_fregs[32];
|
|
unsigned int fp_regs[32];
|
|
#else
|
|
double fp_dregs[32];
|
|
/* float fp_fregs[32]; */
|
|
__uint64_t fp_regs[32];
|
|
#endif
|
|
} fp_r;
|
|
unsigned int fp_csr;
|
|
unsigned int fp_pad;
|
|
} fpregset_t;
|
|
|
|
/* Context to describe whole processor state. */
|
|
typedef struct
|
|
{
|
|
gregset_t gpregs;
|
|
fpregset_t fpregs;
|
|
} mcontext_t;
|
|
|
|
/* Userlevel context. */
|
|
typedef struct ucontext
|
|
{
|
|
#if _MIPS_SIM == _ABIO32
|
|
unsigned long int uc_flags;
|
|
#else
|
|
__uint64_t uc_flags;
|
|
#endif
|
|
struct ucontext *uc_link;
|
|
__sigset_t uc_sigmask;
|
|
stack_t uc_stack;
|
|
mcontext_t uc_mcontext;
|
|
int uc_filler[48];
|
|
} ucontext_t;
|
|
|
|
#endif /* sys/ucontext.h */
|