]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / m68k / sys / ucontext.h
CommitLineData
04277e02 1/* Copyright (C) 1997-2019 Free Software Foundation, Inc.
b5f709a1
AS
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
ab84e3ff 15 License along with the GNU C Library. If not, see
5a82c748 16 <https://www.gnu.org/licenses/>. */
b5f709a1
AS
17
18/* System V/m68k ABI compliant context switching support. */
19
20#ifndef _SYS_UCONTEXT_H
21#define _SYS_UCONTEXT_H 1
22
23#include <features.h>
b5f709a1 24
cfed8ece 25#include <bits/types/sigset_t.h>
0bcec532 26#include <bits/types/stack_t.h>
c66b29f9
ZW
27
28
b5f709a1
AS
29/* Type for general register. */
30typedef int greg_t;
31
32/* Number of general registers. */
139904b7
JM
33#define __NGREG 18
34#ifdef __USE_MISC
35# define NGREG __NGREG
36#endif
b5f709a1
AS
37
38/* Container for all general registers. */
139904b7 39typedef greg_t gregset_t[__NGREG];
b5f709a1 40
5df4854e 41#ifdef __USE_MISC
b5f709a1
AS
42/* Number of each register is the `gregset_t' array. */
43enum
44{
45 R_D0 = 0,
5df4854e 46# define R_D0 R_D0
b5f709a1 47 R_D1 = 1,
5df4854e 48# define R_D1 R_D1
b5f709a1 49 R_D2 = 2,
5df4854e 50# define R_D2 R_D2
b5f709a1 51 R_D3 = 3,
5df4854e 52# define R_D3 R_D3
b5f709a1 53 R_D4 = 4,
5df4854e 54# define R_D4 R_D4
b5f709a1 55 R_D5 = 5,
5df4854e 56# define R_D5 R_D5
b5f709a1 57 R_D6 = 6,
5df4854e 58# define R_D6 R_D6
b5f709a1 59 R_D7 = 7,
5df4854e 60# define R_D7 R_D7
b5f709a1 61 R_A0 = 8,
5df4854e 62# define R_A0 R_A0
b5f709a1 63 R_A1 = 9,
5df4854e 64# define R_A1 R_A1
b5f709a1 65 R_A2 = 10,
5df4854e 66# define R_A2 R_A2
b5f709a1 67 R_A3 = 11,
5df4854e 68# define R_A3 R_A3
b5f709a1 69 R_A4 = 12,
5df4854e 70# define R_A4 R_A4
b5f709a1 71 R_A5 = 13,
5df4854e 72# define R_A5 R_A5
b5f709a1 73 R_A6 = 14,
5df4854e 74# define R_A6 R_A6
b5f709a1 75 R_A7 = 15,
5df4854e 76# define R_A7 R_A7
b5f709a1 77 R_SP = 15,
5df4854e 78# define R_SP R_SP
b5f709a1 79 R_PC = 16,
5df4854e 80# define R_PC R_PC
b5f709a1 81 R_PS = 17
5df4854e 82# define R_PS R_PS
b5f709a1 83};
5df4854e 84#endif
b5f709a1 85
139904b7
JM
86#ifdef __USE_MISC
87# define __ctx(fld) fld
88#else
89# define __ctx(fld) __ ## fld
90#endif
91
b5f709a1 92/* Structure to describe FPU registers. */
d57cb319 93typedef struct
b5f709a1 94{
139904b7
JM
95 int __ctx(f_pcr);
96 int __ctx(f_psr);
97 int __ctx(f_fpiaddr);
9c986f87 98#ifdef __mcoldfire__
139904b7 99 int __ctx(f_fpregs)[8][2];
9c986f87 100#else
139904b7 101 int __ctx(f_fpregs)[8][3];
9c986f87 102#endif
b5f709a1
AS
103} fpregset_t;
104
105/* Context to describe whole processor state. */
106typedef struct
107{
139904b7
JM
108 int __ctx(version);
109 gregset_t __ctx(gregs);
110 fpregset_t __ctx(fpregs);
b5f709a1
AS
111} mcontext_t;
112
5df4854e
JM
113#ifdef __USE_MISC
114# define MCONTEXT_VERSION 2
115#endif
b5f709a1
AS
116
117/* Userlevel context. */
25128773 118typedef struct ucontext_t
b5f709a1 119{
3d452dab 120 unsigned long __ctx(uc_flags);
25128773 121 struct ucontext_t *uc_link;
b5f709a1
AS
122 stack_t uc_stack;
123 mcontext_t uc_mcontext;
3d452dab 124 unsigned long __glibc_reserved1[80];
cfed8ece 125 sigset_t uc_sigmask;
b5f709a1
AS
126} ucontext_t;
127
3d452dab
JM
128#undef __ctx
129
b5f709a1 130#endif /* sys/ucontext.h */