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, write to the Free Software
24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27 The GNU General Public License is contained in the file COPYING.
30 #include "pub_core_basics_asm.h"
32 #if defined(VGP_amd64_darwin)
34 #include "vki/vki-scnums-darwin.h"
36 // mach_port_name_t task_self_trap(void)
39 .globl _task_self_trap
41 movq $__NR_task_self_trap, %rax
46 // DDD: doesn't get used...
47 // // mach_port_name_t host_self_trap(void)
50 // .globl _host_self_trap
52 // movq $__NR_host_self_trap, %rax
57 // mach_port_name_t thread_self_trap(void)
60 .globl _thread_self_trap
62 movq $__NR_thread_self_trap, %rax
67 // mach_msg_return_t mach_msg_trap(...)
72 movq $__NR_mach_msg_trap, %rax
77 // mach_port_t mach_reply_port(...)
80 .globl _mach_reply_port
82 movq $__NR_mach_reply_port, %rax
87 // boolean_t swtch_pri(int)
92 movq $__NR_swtch_pri, %rax
97 // kern_return_t semaphore_wait(semaphore_t)
100 .globl _semaphore_wait
102 movq $__NR_semaphore_wait_trap, %rax
107 // kern_return_t semaphore_signal(semaphore_t)
110 .globl _semaphore_signal
112 movq $__NR_semaphore_signal_trap, %rax
117 // kern_return_t semaphore_signal_thread(semaphore_t, thread_t)
120 .globl _semaphore_signal_thread
121 _semaphore_signal_thread:
122 movq $__NR_semaphore_signal_thread_trap, %rax
127 // kern_return_t semaphore_wait_signal(semaphore_t, semaphore_t)
130 .globl _semaphore_wait_signal
131 _semaphore_wait_signal:
132 movq $__NR_semaphore_wait_signal_trap, %rax
137 #endif // defined(VGP_amd64_darwin)
139 /* Let the linker know we don't need an executable stack */
142 /*--------------------------------------------------------------------*/
144 /*--------------------------------------------------------------------*/