2 /*--------------------------------------------------------------------*/
3 /*--- Solaris-specific syscalls stuff. priv_syswrap-solaris.h ---*/
4 /*--------------------------------------------------------------------*/
7 This file is part of Valgrind, a dynamic binary instrumentation
10 Copyright (C) 2011-2017 Petr Pavlu
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, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
28 The GNU General Public License is contained in the file COPYING.
31 #ifndef __PRIV_SYSWRAP_SOLARIS_H
32 #define __PRIV_SYSWRAP_SOLARIS_H
34 #include "pub_core_basics.h" // VG_ macro
35 #include "priv_types_n_macros.h" // DECL_TEMPLATE
36 #include "pub_core_tooliface.h" // CorePart
38 /* Macro to join a syscall name with a syscall variant. */
39 #define SC2(name, subname) \
42 /* Macro to join a syscall name with its variant and sub-variant. */
43 #define SC3(name, subname, subsubname) \
44 name "_" subname "_" subsubname
46 extern void ML_(call_on_new_stack_0_1
)(Addr stack
, Addr retaddr
,
47 void (*f
)(Word
), Word arg1
);
48 extern Word
ML_(start_thread_NORETURN
)(void *arg
);
49 extern Addr
ML_(allocstack
) (ThreadId tid
);
50 extern void ML_(setup_start_thread_context
)(ThreadId tid
, vki_ucontext_t
*uc
);
52 extern UInt
ML_(fletcher32
)(UShort
*buf
, SizeT blocks
);
53 extern ULong
ML_(fletcher64
)(UInt
*buf
, SizeT blocks
);
54 extern void ML_(save_machine_context
)(ThreadId tid
, vki_ucontext_t
*uc
,
56 extern void ML_(restore_machine_context
)(ThreadId tid
, vki_ucontext_t
*uc
,
57 CorePart part
, Bool esp_is_thrptr
);
59 #if defined(VGP_x86_solaris)
61 extern void ML_(setup_gdt
)(VexGuestX86State
*vex
);
62 extern void ML_(cleanup_gdt
)(VexGuestX86State
*vex
);
63 extern void ML_(update_gdt_lwpgs
)(ThreadId tid
);
66 DECL_TEMPLATE(x86_solaris
, sys_fstatat64
);
67 DECL_TEMPLATE(x86_solaris
, sys_openat64
);
68 DECL_TEMPLATE(x86_solaris
, sys_llseek32
);
69 DECL_TEMPLATE(x86_solaris
, sys_mmap64
);
70 DECL_TEMPLATE(x86_solaris
, sys_stat64
);
71 DECL_TEMPLATE(x86_solaris
, sys_lstat64
);
72 DECL_TEMPLATE(x86_solaris
, sys_fstat64
);
73 DECL_TEMPLATE(x86_solaris
, sys_statvfs64
);
74 DECL_TEMPLATE(x86_solaris
, sys_fstatvfs64
);
75 DECL_TEMPLATE(x86_solaris
, sys_setrlimit64
);
76 DECL_TEMPLATE(x86_solaris
, sys_getrlimit64
);
77 DECL_TEMPLATE(x86_solaris
, sys_pread64
);
78 DECL_TEMPLATE(x86_solaris
, sys_pwrite64
);
79 DECL_TEMPLATE(x86_solaris
, sys_open64
);
81 #elif defined(VGP_amd64_solaris)
85 # error "Unknown platform"
88 #endif // __PRIV_SYSWRAP_SOLARIS_H
90 /*--------------------------------------------------------------------*/
92 /*--------------------------------------------------------------------*/