1 /*--------------------------------------------------------------------*/
2 /*--- Basic Mach traps. mach_traps-amd64-darwin.S ---*/
3 /*--------------------------------------------------------------------*/
6 This file is part of Valgrind, a dynamic binary instrumentation
9 Copyright (C) 2007-2017 Apple Inc.
10 Greg Parker gparker@apple.com
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version.
17 This program is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, see <http://www.gnu.org/licenses/>.
25 The GNU General Public License is contained in the file COPYING.
28 #include "pub_core_basics_asm.h"
30 #if defined(VGP_amd64_darwin)
32 #include "vki/vki-scnums-darwin.h"
34 // mach_port_name_t task_self_trap(void)
37 .globl _task_self_trap
39 movq $__NR_task_self_trap, %rax
44 // DDD: doesn't get used...
45 // // mach_port_name_t host_self_trap(void)
48 // .globl _host_self_trap
50 // movq $__NR_host_self_trap, %rax
55 // mach_port_name_t thread_self_trap(void)
58 .globl _thread_self_trap
60 movq $__NR_thread_self_trap, %rax
65 // mach_msg_return_t mach_msg_trap(...)
70 movq $__NR_mach_msg_trap, %rax
75 // mach_port_t mach_reply_port(...)
78 .globl _mach_reply_port
80 movq $__NR_mach_reply_port, %rax
85 // boolean_t swtch_pri(int)
90 movq $__NR_swtch_pri, %rax
95 // kern_return_t semaphore_wait(semaphore_t)
98 .globl _semaphore_wait
100 movq $__NR_semaphore_wait_trap, %rax
105 // kern_return_t semaphore_signal(semaphore_t)
108 .globl _semaphore_signal
110 movq $__NR_semaphore_signal_trap, %rax
115 // kern_return_t semaphore_signal_thread(semaphore_t, thread_t)
118 .globl _semaphore_signal_thread
119 _semaphore_signal_thread:
120 movq $__NR_semaphore_signal_thread_trap, %rax
125 // kern_return_t semaphore_wait_signal(semaphore_t, semaphore_t)
128 .globl _semaphore_wait_signal
129 _semaphore_wait_signal:
130 movq $__NR_semaphore_wait_signal_trap, %rax
135 #endif // defined(VGP_amd64_darwin)
137 /* Let the linker know we don't need an executable stack */
140 /*--------------------------------------------------------------------*/
142 /*--------------------------------------------------------------------*/