1*ef9871c6SBrooks Davis/*- 2*ef9871c6SBrooks Davis * Copyright (C) 2008 David Xu <davidxu@freebsd.org> 3*ef9871c6SBrooks Davis * All rights reserved. 4*ef9871c6SBrooks Davis * 5*ef9871c6SBrooks Davis * Redistribution and use in source and binary forms, with or without 6*ef9871c6SBrooks Davis * modification, are permitted provided that the following conditions 7*ef9871c6SBrooks Davis * are met: 8*ef9871c6SBrooks Davis * 1. Redistributions of source code must retain the above copyright 9*ef9871c6SBrooks Davis * notice, this list of conditions and the following disclaimer. 10*ef9871c6SBrooks Davis * 2. Neither the name of the author nor the names of its contributors 11*ef9871c6SBrooks Davis * may be used to endorse or promote products derived from this software 12*ef9871c6SBrooks Davis * without specific prior written permission. 13*ef9871c6SBrooks Davis * 14*ef9871c6SBrooks Davis * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15*ef9871c6SBrooks Davis * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16*ef9871c6SBrooks Davis * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17*ef9871c6SBrooks Davis * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18*ef9871c6SBrooks Davis * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19*ef9871c6SBrooks Davis * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20*ef9871c6SBrooks Davis * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21*ef9871c6SBrooks Davis * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22*ef9871c6SBrooks Davis * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23*ef9871c6SBrooks Davis * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24*ef9871c6SBrooks Davis * SUCH DAMAGE. 25*ef9871c6SBrooks Davis */ 26*ef9871c6SBrooks Davis 27*ef9871c6SBrooks Davis#include <sys/syscall.h> 28*ef9871c6SBrooks Davis#include <machine/asm.h> 29*ef9871c6SBrooks Davis 30*ef9871c6SBrooks Davis#define RSYSCALL_ERR(x) ENTRY(__CONCAT(x, _err)); \ 31*ef9871c6SBrooks Davis mov __CONCAT($SYS_,x),%rax; \ 32*ef9871c6SBrooks Davis KERNCALL; \ 33*ef9871c6SBrooks Davis ret; \ 34*ef9871c6SBrooks Davis END(__CONCAT(x, _err)); 35*ef9871c6SBrooks Davis 36*ef9871c6SBrooks Davis#define KERNCALL movq %rcx, %r10; syscall 37*ef9871c6SBrooks Davis 38*ef9871c6SBrooks DavisRSYSCALL_ERR(_umtx_op) 39*ef9871c6SBrooks Davis 40*ef9871c6SBrooks Davis .section .note.GNU-stack,"",%progbits 41