2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2007 Konstantin Belousov
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #include "linux_assym.h" /* system definitions */
32 #include <machine/asmacros.h> /* miscellaneous asm macros */
37 movq $0,PCB_ONFAULT(%r8)
41 ENTRY(futex_xchgl_nosmap)
43 movq $futex_fault,PCB_ONFAULT(%r8)
44 movq $VM_MAXUSER_ADDRESS-4,%rax
50 movq %rax,PCB_ONFAULT(%r8)
52 END(futex_xchgl_nosmap)
54 ENTRY(futex_xchgl_smap)
56 movq $futex_fault,PCB_ONFAULT(%r8)
57 movq $VM_MAXUSER_ADDRESS-4,%rax
65 movq %rax,PCB_ONFAULT(%r8)
69 ENTRY(futex_addl_nosmap)
71 movq $futex_fault,PCB_ONFAULT(%r8)
72 movq $VM_MAXUSER_ADDRESS-4,%rax
81 movq %rax,PCB_ONFAULT(%r8)
83 END(futex_addl_nosmap)
85 ENTRY(futex_addl_smap)
87 movq $futex_fault,PCB_ONFAULT(%r8)
88 movq $VM_MAXUSER_ADDRESS-4,%rax
99 movq %rax,PCB_ONFAULT(%r8)
103 ENTRY(futex_orl_nosmap)
104 movq PCPU(CURPCB),%r8
105 movq $futex_fault,PCB_ONFAULT(%r8)
106 movq $VM_MAXUSER_ADDRESS-4,%rax
119 movq %rax,PCB_ONFAULT(%r8)
121 END(futex_orl_nosmap)
123 ENTRY(futex_orl_smap)
124 movq PCPU(CURPCB),%r8
125 movq $futex_fault,PCB_ONFAULT(%r8)
126 movq $VM_MAXUSER_ADDRESS-4,%rax
141 movq %rax,PCB_ONFAULT(%r8)
145 ENTRY(futex_andl_nosmap)
146 movq PCPU(CURPCB),%r8
147 movq $futex_fault,PCB_ONFAULT(%r8)
148 movq $VM_MAXUSER_ADDRESS-4,%rax
161 movq %rax,PCB_ONFAULT(%r8)
163 END(futex_andl_nosmap)
165 ENTRY(futex_andl_smap)
166 movq PCPU(CURPCB),%r8
167 movq $futex_fault,PCB_ONFAULT(%r8)
168 movq $VM_MAXUSER_ADDRESS-4,%rax
183 movq %rax,PCB_ONFAULT(%r8)
187 ENTRY(futex_xorl_nosmap)
188 movq PCPU(CURPCB),%r8
189 movq $futex_fault,PCB_ONFAULT(%r8)
190 movq $VM_MAXUSER_ADDRESS-4,%rax
203 movq %rax,PCB_ONFAULT(%r8)
205 END(futex_xorl_nosmap)
207 ENTRY(futex_xorl_smap)
208 movq PCPU(CURPCB),%r8
209 movq $futex_fault,PCB_ONFAULT(%r8)
210 movq $VM_MAXUSER_ADDRESS-4,%rax
225 movq %rax,PCB_ONFAULT(%r8)