about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h
blob: 59f2ffb0bcff31471b823e038953b3b28ee64f2d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/* Copyright (C) 2000 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 Library General Public License as
   published by the Free Software Foundation; either version 2 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
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif

#include <bits/wordsize.h>

#define SUNOS_MAXWIN   31

/* A register window */
struct reg_window {
  unsigned long locals[8];
  unsigned long ins[8];
};

#if __WORDSIZE == 64

/* This is what SunOS doesn't, so we have to write this alone. */
struct sigcontext {
  int sigc_onstack;      /* state to restore */
  int sigc_mask;         /* sigmask to restore */
  unsigned long sigc_sp;   /* stack pointer */
  unsigned long sigc_pc;   /* program counter */
  unsigned long sigc_npc;  /* next program counter */
  unsigned long sigc_psr;  /* for condition codes etc */
  unsigned long sigc_g1;   /* User uses these two registers */
  unsigned long sigc_o0;   /* within the trampoline code. */

  /* Now comes information regarding the users window set
     at the time of the signal. */
  int sigc_oswins;       /* outstanding windows */

  /* stack ptrs for each regwin buf */
  char *sigc_spbuf[SUNOS_MAXWIN];

  /* Windows to restore after signal */
  struct reg_window sigc_wbuf[SUNOS_MAXWIN];
};

struct pt_regs {
        unsigned long u_regs[16]; /* globals and ins */
        unsigned long tstate;
        unsigned long tpc;
        unsigned long tnpc;
        unsigned int y;
        unsigned int fprs;
};

typedef struct {
        struct     pt_regs si_regs;
        long       si_mask;
} __siginfo_t;

typedef struct {
        unsigned   int si_float_regs [64];
        unsigned   long si_fsr;
        unsigned   long si_gsr;
        unsigned   long si_fprs;
} __siginfo_fpu_t;

#else

/* This is what SunOS does, so shall I. */
struct sigcontext {
  int sigc_onstack;      /* state to restore */
  int sigc_mask;         /* sigmask to restore */
  int sigc_sp;           /* stack pointer */
  int sigc_pc;           /* program counter */
  int sigc_npc;          /* next program counter */
  int sigc_psr;          /* for condition codes etc */
  int sigc_g1;           /* User uses these two registers */
  int sigc_o0;           /* within the trampoline code. */

  /* Now comes information regarding the users window set
     at the time of the signal. */
  int sigc_oswins;       /* outstanding windows */

  /* stack ptrs for each regwin buf */
  char *sigc_spbuf[SUNOS_MAXWIN];

  /* Windows to restore after signal */
  struct reg_window sigc_wbuf[SUNOS_MAXWIN];
};

struct pt_regs {
        unsigned long psr;
        unsigned long pc;
        unsigned long npc;
        unsigned long y;
        unsigned long u_regs[16]; /* globals and ins */
};

typedef struct {
  struct pt_regs  si_regs;
  int             si_mask;
} __siginfo_t;

typedef struct {
  unsigned   long si_float_regs [32];
  unsigned   long si_fsr;
  unsigned   long si_fpqdepth;
  struct {
    unsigned long *insn_addr;
    unsigned long insn;
  } si_fpqueue [16];
} __siginfo_fpu_t;

#endif