exect.S revision 217106
11556Srgrimes/*- 21556Srgrimes * Copyright (c) 1990 The Regents of the University of California. 31556Srgrimes * All rights reserved. 41556Srgrimes * 51556Srgrimes * This code is derived from software contributed to Berkeley by 61556Srgrimes * William Jolitz. 71556Srgrimes * 81556Srgrimes * Redistribution and use in source and binary forms, with or without 91556Srgrimes * modification, are permitted provided that the following conditions 101556Srgrimes * are met: 111556Srgrimes * 1. Redistributions of source code must retain the above copyright 121556Srgrimes * notice, this list of conditions and the following disclaimer. 131556Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 141556Srgrimes * notice, this list of conditions and the following disclaimer in the 151556Srgrimes * documentation and/or other materials provided with the distribution. 161556Srgrimes * 4. Neither the name of the University nor the names of its contributors 171556Srgrimes * may be used to endorse or promote products derived from this software 181556Srgrimes * without specific prior written permission. 191556Srgrimes * 201556Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 211556Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 221556Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 231556Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 241556Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 251556Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 261556Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 271556Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 281556Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 291556Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 301556Srgrimes * SUCH DAMAGE. 311556Srgrimes */ 321556Srgrimes 331556Srgrimes#if defined(SYSLIBC_SCCS) && !defined(lint) 341556Srgrimes .asciz "@(#)exect.s 5.1 (Berkeley) 4/23/90" 351556Srgrimes#endif /* SYSLIBC_SCCS and not lint */ 361556Srgrimes#include <machine/asm.h> 371556Srgrimes__FBSDID("$FreeBSD: head/lib/libc/amd64/sys/exect.S 217106 2011-01-07 16:08:40Z kib $"); 381556Srgrimes 3936049Scharnier#include "SYS.h" 4036049Scharnier#include <machine/psl.h> 4136049Scharnier 4236049ScharnierENTRY(exect) 4336049Scharnier movq $SYS_execve,%rax 441556Srgrimes pushfq 451556Srgrimes popq %r8 461556Srgrimes orq $PSL_T,%r8 471556Srgrimes pushq %r8 481556Srgrimes popfq 491556Srgrimes KERNCALL 501556Srgrimes#ifdef PIC 511556Srgrimes movq PIC_GOT(HIDENAME(cerror)),%rdx 521556Srgrimes jmp *%rdx 531556Srgrimes#else 541556Srgrimes jmp HIDENAME(cerror) 551556Srgrimes#endif 561556SrgrimesEND(exect) 571556Srgrimes 581556Srgrimes .section .note.GNU-stack,"",%progbits 591556Srgrimes