89eb4e3c2fdb82577b753a3dfe5503531a644986
[external/binutils.git] / gdb / nat / aarch64-linux.h
1 /* Copyright (C) 2009-2015 Free Software Foundation, Inc.
2    Contributed by ARM Ltd.
3
4    This file is part of GDB.
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18
19 #ifndef AARCH64_LINUX_H
20 #define AARCH64_LINUX_H 1
21
22 #include <signal.h>
23
24 typedef int compat_int_t;
25 typedef unsigned int compat_uptr_t;
26
27 typedef int compat_time_t;
28 typedef int compat_timer_t;
29 typedef int compat_clock_t;
30
31 struct compat_timeval
32 {
33   compat_time_t tv_sec;
34   int tv_usec;
35 };
36
37 typedef union compat_sigval
38 {
39   compat_int_t sival_int;
40   compat_uptr_t sival_ptr;
41 } compat_sigval_t;
42
43 typedef struct compat_siginfo
44 {
45   int si_signo;
46   int si_errno;
47   int si_code;
48
49   union
50   {
51     int _pad[((128 / sizeof (int)) - 3)];
52
53     /* kill() */
54     struct
55     {
56       unsigned int _pid;
57       unsigned int _uid;
58     } _kill;
59
60     /* POSIX.1b timers */
61     struct
62     {
63       compat_timer_t _tid;
64       int _overrun;
65       compat_sigval_t _sigval;
66     } _timer;
67
68     /* POSIX.1b signals */
69     struct
70     {
71       unsigned int _pid;
72       unsigned int _uid;
73       compat_sigval_t _sigval;
74     } _rt;
75
76     /* SIGCHLD */
77     struct
78     {
79       unsigned int _pid;
80       unsigned int _uid;
81       int _status;
82       compat_clock_t _utime;
83       compat_clock_t _stime;
84     } _sigchld;
85
86     /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
87     struct
88     {
89       unsigned int _addr;
90     } _sigfault;
91
92     /* SIGPOLL */
93     struct
94     {
95       int _band;
96       int _fd;
97     } _sigpoll;
98   } _sifields;
99 } compat_siginfo_t;
100
101 #define cpt_si_pid _sifields._kill._pid
102 #define cpt_si_uid _sifields._kill._uid
103 #define cpt_si_timerid _sifields._timer._tid
104 #define cpt_si_overrun _sifields._timer._overrun
105 #define cpt_si_status _sifields._sigchld._status
106 #define cpt_si_utime _sifields._sigchld._utime
107 #define cpt_si_stime _sifields._sigchld._stime
108 #define cpt_si_ptr _sifields._rt._sigval.sival_ptr
109 #define cpt_si_addr _sifields._sigfault._addr
110 #define cpt_si_band _sifields._sigpoll._band
111 #define cpt_si_fd _sifields._sigpoll._fd
112
113 void aarch64_siginfo_from_compat_siginfo (siginfo_t *to,
114                                             compat_siginfo_t *from);
115 void aarch64_compat_siginfo_from_siginfo (compat_siginfo_t *to,
116                                             siginfo_t *from);
117
118 void aarch64_linux_prepare_to_resume (struct lwp_info *lwp);
119
120 void aarch64_linux_new_thread (struct lwp_info *lwp);
121
122 #endif /* AARCH64_LINUX_H */