Blame sysdeps/unix/sysv/linux/arm/sys/ucontext.h

Packit 6c4009
/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library.  If not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
/* System V/ARM ABI compliant context switching support.  */
Packit 6c4009
Packit 6c4009
#ifndef _SYS_UCONTEXT_H
Packit 6c4009
#define _SYS_UCONTEXT_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
#include <bits/types/sigset_t.h>
Packit 6c4009
#include <bits/types/stack_t.h>
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
# define __ctx(fld) fld
Packit 6c4009
#else
Packit 6c4009
# define __ctx(fld) __ ## fld
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
typedef int greg_t;
Packit 6c4009
Packit 6c4009
/* Number of general registers.  */
Packit 6c4009
# define NGREG	18
Packit 6c4009
Packit 6c4009
/* Container for all general registers.  */
Packit 6c4009
typedef greg_t gregset_t[NGREG];
Packit 6c4009
Packit 6c4009
/* Number of each register is the `gregset_t' array.  */
Packit 6c4009
enum
Packit 6c4009
{
Packit 6c4009
  REG_R0 = 0,
Packit 6c4009
# define REG_R0	REG_R0
Packit 6c4009
  REG_R1 = 1,
Packit 6c4009
# define REG_R1	REG_R1
Packit 6c4009
  REG_R2 = 2,
Packit 6c4009
# define REG_R2	REG_R2
Packit 6c4009
  REG_R3 = 3,
Packit 6c4009
# define REG_R3	REG_R3
Packit 6c4009
  REG_R4 = 4,
Packit 6c4009
# define REG_R4	REG_R4
Packit 6c4009
  REG_R5 = 5,
Packit 6c4009
# define REG_R5	REG_R5
Packit 6c4009
  REG_R6 = 6,
Packit 6c4009
# define REG_R6	REG_R6
Packit 6c4009
  REG_R7 = 7,
Packit 6c4009
# define REG_R7	REG_R7
Packit 6c4009
  REG_R8 = 8,
Packit 6c4009
# define REG_R8	REG_R8
Packit 6c4009
  REG_R9 = 9,
Packit 6c4009
# define REG_R9	REG_R9
Packit 6c4009
  REG_R10 = 10,
Packit 6c4009
# define REG_R10	REG_R10
Packit 6c4009
  REG_R11 = 11,
Packit 6c4009
# define REG_R11	REG_R11
Packit 6c4009
  REG_R12 = 12,
Packit 6c4009
# define REG_R12	REG_R12
Packit 6c4009
  REG_R13 = 13,
Packit 6c4009
# define REG_R13	REG_R13
Packit 6c4009
  REG_R14 = 14,
Packit 6c4009
# define REG_R14	REG_R14
Packit 6c4009
  REG_R15 = 15
Packit 6c4009
# define REG_R15	REG_R15
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct _libc_fpstate
Packit 6c4009
{
Packit 6c4009
  struct
Packit 6c4009
  {
Packit 6c4009
    unsigned int sign1:1;
Packit 6c4009
    unsigned int unused:15;
Packit 6c4009
    unsigned int sign2:1;
Packit 6c4009
    unsigned int exponent:14;
Packit 6c4009
    unsigned int j:1;
Packit 6c4009
    unsigned int mantissa1:31;
Packit 6c4009
    unsigned int mantissa0:32;
Packit 6c4009
  } fpregs[8];
Packit 6c4009
  unsigned int fpsr:32;
Packit 6c4009
  unsigned int fpcr:32;
Packit 6c4009
  unsigned char ftype[8];
Packit 6c4009
  unsigned int init_flag;
Packit 6c4009
};
Packit 6c4009
/* Structure to describe FPU registers.  */
Packit 6c4009
typedef struct _libc_fpstate fpregset_t;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Context to describe whole processor state.  This only describes
Packit 6c4009
   the core registers; coprocessor registers get saved elsewhere
Packit 6c4009
   (e.g. in uc_regspace, or somewhere unspecified on the stack
Packit 6c4009
   during non-RT signal handlers).  */
Packit 6c4009
typedef struct
Packit 6c4009
  {
Packit 6c4009
    unsigned long int __ctx(trap_no);
Packit 6c4009
    unsigned long int __ctx(error_code);
Packit 6c4009
    unsigned long int __ctx(oldmask);
Packit 6c4009
    unsigned long int __ctx(arm_r0);
Packit 6c4009
    unsigned long int __ctx(arm_r1);
Packit 6c4009
    unsigned long int __ctx(arm_r2);
Packit 6c4009
    unsigned long int __ctx(arm_r3);
Packit 6c4009
    unsigned long int __ctx(arm_r4);
Packit 6c4009
    unsigned long int __ctx(arm_r5);
Packit 6c4009
    unsigned long int __ctx(arm_r6);
Packit 6c4009
    unsigned long int __ctx(arm_r7);
Packit 6c4009
    unsigned long int __ctx(arm_r8);
Packit 6c4009
    unsigned long int __ctx(arm_r9);
Packit 6c4009
    unsigned long int __ctx(arm_r10);
Packit 6c4009
    unsigned long int __ctx(arm_fp);
Packit 6c4009
    unsigned long int __ctx(arm_ip);
Packit 6c4009
    unsigned long int __ctx(arm_sp);
Packit 6c4009
    unsigned long int __ctx(arm_lr);
Packit 6c4009
    unsigned long int __ctx(arm_pc);
Packit 6c4009
    unsigned long int __ctx(arm_cpsr);
Packit 6c4009
    unsigned long int __ctx(fault_address);
Packit 6c4009
  } mcontext_t;
Packit 6c4009
Packit 6c4009
/* Userlevel context.  */
Packit 6c4009
typedef struct ucontext_t
Packit 6c4009
  {
Packit 6c4009
    unsigned long __ctx(uc_flags);
Packit 6c4009
    struct ucontext_t *uc_link;
Packit 6c4009
    stack_t uc_stack;
Packit 6c4009
    mcontext_t uc_mcontext;
Packit 6c4009
    sigset_t uc_sigmask;
Packit 6c4009
    unsigned long __ctx(uc_regspace)[128] __attribute__((__aligned__(8)));
Packit 6c4009
  } ucontext_t;
Packit 6c4009
Packit 6c4009
#undef __ctx
Packit 6c4009
Packit 6c4009
#endif /* sys/ucontext.h */