s390x: Fix PC calculations with EX/EXRL
[valgrind.git] / include / vki / vki-scnums-solaris.h
blob25bde39d84aebbd649163866da03d007d9483664
2 /*--------------------------------------------------------------------*/
3 /*--- System call numbers for Solaris. vki-scnums-solaris.h ---*/
4 /*--------------------------------------------------------------------*/
6 /*
7 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
10 Copyright (C) 2011-2017 Petr Pavlu
11 setup@dagobah.cz
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, see <http://www.gnu.org/licenses/>.
26 The GNU General Public License is contained in the file COPYING.
29 /* Copyright 2013-2017, Ivo Raisr <ivosh@ivosh.net>. */
31 /* Copyright 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
33 #ifndef __VKI_SCNUMS_SOLARIS_H
34 #define __VKI_SCNUMS_SOLARIS_H
36 #include "config.h"
38 /* Note: Basic information about Solaris syscalls can be found in the kernel
39 source file uts/common/os/sysent.c.
42 /* Include sys/syscall.h to get SYS_* constants (and sys/trap.h to get T_*) to
43 avoid any copyright issues connected with their potential copying out of
44 the header file.
46 #include <sys/syscall.h>
47 #include <sys/trap.h>
49 /* normal syscall (int $0x91) */
50 #define VG_SOLARIS_SYSCALL_CLASS_CLASSIC 0
51 /* fasttrap syscall (int $0xD2) */
52 #define VG_SOLARIS_SYSCALL_CLASS_FASTTRAP 1
54 #define VG_SOLARIS_SYSCALL_CLASS_SHIFT 24
55 #define VG_SOLARIS_SYSCALL_NUMBER_MASK 0x00FFFFFF
57 #define VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(sysno) \
58 ((VG_SOLARIS_SYSCALL_CLASS_FASTTRAP << VG_SOLARIS_SYSCALL_CLASS_SHIFT) \
59 | (sysno))
60 #define VG_SOLARIS_SYSNO_CLASS(sysno) \
61 ((sysno) >> VG_SOLARIS_SYSCALL_CLASS_SHIFT)
62 #define VG_SOLARIS_SYSNO_INDEX(sysno) \
63 ((sysno) & VG_SOLARIS_SYSCALL_NUMBER_MASK)
65 #define __NR_exit SYS_exit
66 #if defined(SOLARIS_SPAWN_SYSCALL)
67 #define __NR_spawn SYS_spawn
68 #endif /* SOLARIS_SPAWN_SYSCALL */
69 #define __NR_read SYS_read
70 #define __NR_write SYS_write
71 #define __NR_close SYS_close
72 #define __NR_linkat SYS_linkat
73 #define __NR_symlinkat SYS_symlinkat
74 #define __NR_chdir SYS_chdir
75 #define __NR_time SYS_time
76 #define __NR_brk SYS_brk
77 #define __NR_lseek SYS_lseek
78 #define __NR_getpid SYS_getpid
79 #define __NR_mount SYS_mount
80 #define __NR_readlinkat SYS_readlinkat
81 #define __NR_setuid SYS_setuid
82 #define __NR_getuid SYS_getuid
83 #define __NR_stime SYS_stime
84 //#define __NR_pcsample SYS_pcsample
85 #define __NR_alarm SYS_alarm
86 #define __NR_pause SYS_pause
87 #if defined(SOLARIS_FREALPATHAT_SYSCALL)
88 #define __NR_frealpathat SYS_frealpathat
89 #endif /* SOLARIS_FREALPATHAT_SYSCALL */
90 #define __NR_stty SYS_stty
91 #define __NR_gtty SYS_gtty
92 //#define __NR_nice SYS_nice
93 //#define __NR_statfs SYS_statfs
94 //#define __NR_sync SYS_sync
95 #define __NR_kill SYS_kill
96 //#define __NR_fstatfs SYS_fstatfs
97 #define __NR_pgrpsys SYS_pgrpsys
98 //#define __NR_uucopystr SYS_uucopystr
99 #define __NR_pipe SYS_pipe
100 #define __NR_times SYS_times
101 //#define __NR_profil SYS_profil
102 #define __NR_faccessat SYS_faccessat
103 #define __NR_setgid SYS_setgid
104 #define __NR_getgid SYS_getgid
105 #define __NR_mknodat SYS_mknodat
106 //#define __NR_msgsys SYS_msgsys
107 #define __NR_sysi86 SYS_sysi86
108 //#define __NR_acct SYS_acct
109 #define __NR_shmsys SYS_shmsys
110 #define __NR_semsys SYS_semsys
111 #define __NR_ioctl SYS_ioctl
112 //#define __NR_uadmin SYS_uadmin
113 #define __NR_fchownat SYS_fchownat
114 //#define __NR_utssys SYS_utssys
115 #define __NR_fdsync SYS_fdsync
116 #define __NR_execve SYS_execve
117 #define __NR_umask SYS_umask
118 #define __NR_chroot SYS_chroot
119 #define __NR_fcntl SYS_fcntl
120 //#define __NR_ulimit SYS_ulimit
121 #define __NR_renameat SYS_renameat
122 #define __NR_unlinkat SYS_unlinkat
123 #define __NR_fstatat SYS_fstatat
124 #define __NR_fstatat64 SYS_fstatat64
125 #define __NR_openat SYS_openat
126 #define __NR_openat64 SYS_openat64
127 #define __NR_tasksys SYS_tasksys
128 //#define __NR_acctctl SYS_acctctl
129 //#define __NR_exacctsys SYS_exacctsys
130 #define __NR_getpagesizes SYS_getpagesizes
131 //#define __NR_rctlsys SYS_rctlsys
132 //#define __NR_sidsys SYS_sidsys
133 #define __NR_lwp_park SYS_lwp_park
134 #define __NR_sendfilev SYS_sendfilev
135 #if defined(SOLARIS_LWP_NAME_SYSCALL)
136 #define __NR_lwp_name SYS_lwp_name
137 #endif /* SOLARIS_LWP_NAME_SYSCALL */
138 #define __NR_getdents SYS_getdents
139 #define __NR_privsys SYS_privsys
140 #define __NR_ucredsys SYS_ucredsys
141 #define __NR_sysfs SYS_sysfs
142 #define __NR_getmsg SYS_getmsg
143 #define __NR_putmsg SYS_putmsg
144 #define __NR_setgroups SYS_setgroups
145 #define __NR_getgroups SYS_getgroups
146 #define __NR_sigprocmask SYS_sigprocmask
147 #define __NR_sigsuspend SYS_sigsuspend
148 #define __NR_sigaltstack SYS_sigaltstack
149 #define __NR_sigaction SYS_sigaction
150 #define __NR_sigpending SYS_sigpending
151 #define __NR_context SYS_context
152 #define __NR_fchmodat SYS_fchmodat
153 #define __NR_mkdirat SYS_mkdirat
154 #define __NR_statvfs SYS_statvfs
155 #define __NR_fstatvfs SYS_fstatvfs
156 //#define __NR_getloadavg SYS_getloadavg
157 #define __NR_nfssys SYS_nfssys
158 #define __NR_waitid SYS_waitid
159 #define __NR_waitsys SYS_waitsys /* = SYS_waitid (historical) */
160 #define __NR_sigsendsys SYS_sigsendsys
161 //#define __NR_hrtsys SYS_hrtsys
162 #if defined(SOLARIS_UTIMESYS_SYSCALL)
163 #define __NR_utimesys SYS_utimesys
164 #endif /* SOLARIS_UTIMESYS_SYSCALL */
165 #if defined(SOLARIS_UTIMENSAT_SYSCALL)
166 #define __NR_utimensat SYS_utimensat
167 #endif /* SOLARIS_UTIMENSAT_SYSCALL */
168 #define __NR_sigresend SYS_sigresend
169 #define __NR_priocntlsys SYS_priocntlsys
170 #define __NR_pathconf SYS_pathconf
171 //#define __NR_mincore SYS_mincore
172 #define __NR_mmap SYS_mmap
173 #define __NR_mprotect SYS_mprotect
174 #define __NR_munmap SYS_munmap
175 //#define __NR_fpathconf SYS_fpathconf
176 //#define __NR_vfork SYS_vfork
177 #define __NR_fchdir SYS_fchdir
178 #define __NR_readv SYS_readv
179 #define __NR_writev SYS_writev
180 #if defined(SOLARIS_UUIDSYS_SYSCALL)
181 #define __NR_uuidsys SYS_uuidsys
182 #endif /* SOLARIS_UUIDSYS_SYSCALL */
183 #if defined(HAVE_MREMAP)
184 #define __NR_mremap SYS_mremap
185 #endif /* HAVE_MREMAP */
186 #define __NR_mmapobj SYS_mmapobj
187 #define __NR_setrlimit SYS_setrlimit
188 #define __NR_getrlimit SYS_getrlimit
189 #define __NR_memcntl SYS_memcntl
190 #define __NR_getpmsg SYS_getpmsg
191 #define __NR_putpmsg SYS_putpmsg
192 #define __NR_uname SYS_uname
193 #define __NR_setegid SYS_setegid
194 #define __NR_sysconfig SYS_sysconfig
195 //#define __NR_adjtime SYS_adjtime
196 #define __NR_systeminfo SYS_systeminfo
197 //#define __NR_sharefs SYS_sharefs
198 #define __NR_seteuid SYS_seteuid
199 #define __NR_forksys SYS_forksys
200 #if defined(SOLARIS_GETRANDOM_SYSCALL)
201 #define __NR_getrandom SYS_getrandom
202 #endif /* SOLARIS_GETRANDOM_SYSCALL */
203 #define __NR_sigtimedwait SYS_sigtimedwait
204 //#define __NR_lwp_info SYS_lwp_info
205 #define __NR_yield SYS_yield
206 #define __NR_lwp_sema_post SYS_lwp_sema_post
207 #define __NR_lwp_sema_trywait SYS_lwp_sema_trywait
208 #define __NR_lwp_detach SYS_lwp_detach
209 //#define __NR_corectl SYS_corectl
210 #define __NR_modctl SYS_modctl
211 #define __NR_fchroot SYS_fchroot
212 #if defined(SOLARIS_SYSTEM_STATS_SYSCALL)
213 #define __NR_system_stats SYS_system_stats
214 #endif /* SOLARIS_SYSTEM_STATS_SYSCALL */
215 //#define __NR_vhangup SYS_vhangup
216 #define __NR_gettimeofday SYS_gettimeofday
217 #define __NR_getitimer SYS_getitimer
218 #define __NR_setitimer SYS_setitimer
219 #define __NR_lwp_create SYS_lwp_create
220 #define __NR_lwp_exit SYS_lwp_exit
221 #define __NR_lwp_suspend SYS_lwp_suspend
222 #define __NR_lwp_continue SYS_lwp_continue
223 #if defined(SOLARIS_LWP_SIGQUEUE_SYSCALL)
224 #define __NR_lwp_sigqueue SYS_lwp_sigqueue
225 #else
226 #define __NR_lwp_kill SYS_lwp_kill
227 #endif /* SOLARIS_LWP_SIGQUEUE_SYSCALL */
228 #define __NR_lwp_self SYS_lwp_self
229 #define __NR_lwp_sigmask SYS_lwp_sigmask
230 #define __NR_lwp_private SYS_lwp_private
231 #define __NR_lwp_wait SYS_lwp_wait
232 #define __NR_lwp_mutex_wakeup SYS_lwp_mutex_wakeup
233 #define __NR_lwp_cond_wait SYS_lwp_cond_wait
234 #define __NR_lwp_cond_signal SYS_lwp_cond_signal
235 #define __NR_lwp_cond_broadcast SYS_lwp_cond_broadcast
236 #define __NR_pread SYS_pread
237 #define __NR_pwrite SYS_pwrite
238 #define __NR_llseek SYS_llseek
239 //#define __NR_inst_sync SYS_inst_sync
240 //#define __NR_brand SYS_brand
241 //#define __NR_kaio SYS_kaio
242 //#define __NR_cpc SYS_cpc
243 #define __NR_lgrpsys SYS_lgrpsys
244 #define __NR_rusagesys SYS_rusagesys
245 #define __NR_port SYS_port
246 #define __NR_pollsys SYS_pollsys
247 #define __NR_labelsys SYS_labelsys
248 #define __NR_acl SYS_acl
249 #define __NR_auditsys SYS_auditsys
250 //#define __NR_processor_bind SYS_processor_bind
251 //#define __NR_processor_info SYS_processor_info
252 #define __NR_p_online SYS_p_online
253 #define __NR_sigqueue SYS_sigqueue
254 #define __NR_clock_gettime SYS_clock_gettime
255 #define __NR_clock_settime SYS_clock_settime
256 #define __NR_clock_getres SYS_clock_getres
257 #define __NR_timer_create SYS_timer_create
258 #define __NR_timer_delete SYS_timer_delete
259 #define __NR_timer_settime SYS_timer_settime
260 #define __NR_timer_gettime SYS_timer_gettime
261 #define __NR_timer_getoverrun SYS_timer_getoverrun
262 #define __NR_nanosleep SYS_nanosleep
263 #define __NR_facl SYS_facl
264 #define __NR_door SYS_door
265 #define __NR_setreuid SYS_setreuid
266 #define __NR_setregid SYS_setregid
267 //#define __NR_install_utrap SYS_install_utrap
268 //#define __NR_signotify SYS_signotify
269 #define __NR_schedctl SYS_schedctl
270 #define __NR_pset SYS_pset
271 //#define SYS_sparc_utrap_install
272 #define __NR_resolvepath SYS_resolvepath
273 #define __NR_lwp_mutex_timedlock SYS_lwp_mutex_timedlock
274 #define __NR_lwp_sema_timedwait SYS_lwp_sema_timedwait
275 #define __NR_lwp_rwlock_sys SYS_lwp_rwlock_sys
276 #define __NR_getdents64 SYS_getdents64
277 #define __NR_mmap64 SYS_mmap64
278 #define __NR_statvfs64 SYS_statvfs64
279 #define __NR_fstatvfs64 SYS_fstatvfs64
280 #define __NR_setrlimit64 SYS_setrlimit64
281 #define __NR_getrlimit64 SYS_getrlimit64
282 #define __NR_pread64 SYS_pread64
283 #define __NR_pwrite64 SYS_pwrite64
284 //#define __NR_rpcsys SYS_rpcsys
285 #define __NR_zone SYS_zone
286 //#define __NR_autofssys SYS_autofssys
287 #define __NR_getcwd SYS_getcwd
288 #define __NR_so_socket SYS_so_socket
289 #define __NR_so_socketpair SYS_so_socketpair
290 #define __NR_bind SYS_bind
291 #define __NR_listen SYS_listen
292 #define __NR_accept SYS_accept
293 #define __NR_connect SYS_connect
294 #define __NR_shutdown SYS_shutdown
295 #define __NR_recv SYS_recv
296 #define __NR_recvfrom SYS_recvfrom
297 #define __NR_recvmsg SYS_recvmsg
298 #define __NR_send SYS_send
299 #define __NR_sendmsg SYS_sendmsg
300 #define __NR_sendto SYS_sendto
301 #define __NR_getpeername SYS_getpeername
302 #define __NR_getsockname SYS_getsockname
303 #define __NR_getsockopt SYS_getsockopt
304 #define __NR_setsockopt SYS_setsockopt
305 //#define __NR_sockconfig SYS_sockconfig
306 //#define __NR_ntp_gettime SYS_ntp_gettime
307 //#define __NR_ntp_adjtime SYS_ntp_adjtime
308 #define __NR_lwp_mutex_unlock SYS_lwp_mutex_unlock
309 //#define __NR_lwp_mutex_trylock SYS_lwp_mutex_trylock
310 #define __NR_lwp_mutex_register SYS_lwp_mutex_register
311 //#define __NR_cladm SYS_cladm
312 #define __NR_uucopy SYS_uucopy
313 #define __NR_umount2 SYS_umount2
315 /* The following syscalls were removed in Solaris 11 (see
316 https://wikis.oracle.com/display/DTrace/syscall+Provider). Valgrind's core
317 cannot use these syscalls but wrappers have to be provided for them because
318 they are still in use on illumos.
320 #if defined(SOLARIS_OLD_SYSCALLS)
321 #define __NR_open SYS_open
322 #define __NR_link SYS_link
323 #define __NR_unlink SYS_unlink
324 #define __NR_mknod SYS_mknod
325 #define __NR_chmod SYS_chmod
326 #define __NR_chown SYS_chown
327 #define __NR_stat SYS_stat
328 #define __NR_fstat SYS_fstat
329 #define __NR_access SYS_access
330 #define __NR_rmdir SYS_rmdir
331 #define __NR_mkdir SYS_mkdir
332 #define __NR_lstat SYS_lstat
333 #define __NR_symlink SYS_symlink
334 #define __NR_readlink SYS_readlink
335 #define __NR_fchmod SYS_fchmod
336 #define __NR_fchown SYS_fchown
337 #define __NR_lchown SYS_lchown
338 #define __NR_rename SYS_rename
339 #define __NR_stat64 SYS_stat64
340 #define __NR_lstat64 SYS_lstat64
341 #define __NR_fstat64 SYS_fstat64
342 #define __NR_open64 SYS_open64
343 #endif /* SOLARIS_OLD_SYSCALLS */
346 #define __NR_null \
347 VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_FNULL)
348 #define __NR_fgetfp \
349 VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_FGETFP)
350 #define __NR_fsetfp \
351 VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_FSETFP)
353 #define __NR_gethrtime \
354 VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRTIME)
355 #define __NR_gethrvtime \
356 VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRVTIME)
357 #define __NR_gethrestime \
358 VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRESTIME)
359 #define __NR_getlgrp \
360 VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETLGRP)
361 #if defined(SOLARIS_GETHRT_FASTTRAP)
362 #define __NR_gethrt \
363 VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRT)
364 #endif /* SOLARIS_GETHRT_FASTTRAP */
365 #if defined(SOLARIS_GETZONEOFFSET_FASTTRAP)
366 #define __NR_getzoneoffset \
367 VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETZONEOFFSET)
368 #endif /* SOLARIS_GETZONEOFFSET_FASTTRAP */
370 #endif /* __VKI_SCNUMS_SOLARIS_H */
372 /*--------------------------------------------------------------------*/
373 /*--- end ---*/
374 /*--------------------------------------------------------------------*/