]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/tile/sys/ucontext.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / tile / sys / ucontext.h
CommitLineData
688903eb 1/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
63d143a2
CM
2 This file is part of the GNU C Library.
3 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
ab84e3ff
PE
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
63d143a2
CM
18
19#ifndef _SYS_UCONTEXT_H
20#define _SYS_UCONTEXT_H 1
21
22#include <features.h>
63d143a2 23
cfed8ece 24#include <bits/types/sigset_t.h>
0bcec532 25#include <bits/types/stack_t.h>
63d143a2 26
4fa9b3bf
JM
27#ifdef __USE_MISC
28# define __ctx(fld) fld
29#else
30# define __ctx(fld) __ ## fld
31#endif
32
5df4854e 33#ifdef __USE_MISC
63d143a2 34/* Get register type and register names. */
5df4854e 35# include <arch/abi.h>
63d143a2 36
c66b29f9 37
63d143a2
CM
38/* Type for general register. */
39typedef uint_reg_t greg_t;
40
41/* Number of general registers. Must agree with <asm/ptrace.h>. */
5df4854e 42# define NGREG 64
63d143a2
CM
43
44/* Container for all general registers. */
45typedef greg_t gregset_t[NGREG];
5df4854e 46#endif
63d143a2
CM
47
48#ifdef __USE_GNU
49/* Names for interesting registers in the `gregset_t' array. */
50enum
51{
52 /* ... r0 through r51 are just 0 through 51 ... */
53 REG_FP = TREG_FP,
54# define REG_FP REG_FP
55 REG_TP = TREG_TP,
56# define REG_TP REG_TP
57 REG_SP = TREG_SP,
58# define REG_SP REG_SP
59 REG_LR = TREG_LR,
60# define REG_LR REG_LR
61};
62#endif
63
4fa9b3bf
JM
64#define __need_int_reg_t
65#include <arch/abi.h>
63d143a2 66
4fa9b3bf
JM
67/* A machine context is exactly a sigcontext. */
68typedef struct
69 {
70 __extension__ union
71 {
72 __uint_reg_t __ctx(gregs)[56];
73 __extension__ struct
74 {
75 __uint_reg_t __ctx(__gregs)[53];
76 __uint_reg_t __ctx(tp);
77 __uint_reg_t __ctx(sp);
78 __uint_reg_t __ctx(lr);
79 };
80 };
81 __uint_reg_t __ctx(pc);
82 __uint_reg_t __ctx(ics);
83 __uint_reg_t __ctx(faultnum);
84 __uint_reg_t __glibc_reserved1[5];
85 } mcontext_t;
3d452dab 86
63d143a2 87/* Userlevel context. */
25128773 88typedef struct ucontext_t
63d143a2 89 {
3d452dab 90 unsigned long int __ctx(uc_flags);
25128773 91 struct ucontext_t *uc_link;
63d143a2
CM
92 stack_t uc_stack;
93 mcontext_t uc_mcontext;
cfed8ece 94 sigset_t uc_sigmask;
63d143a2
CM
95 } ucontext_t;
96
3d452dab
JM
97#undef __ctx
98
63d143a2 99#endif /* sys/ucontext.h */