1b2b3ffcdSSimon Schubert/*- 2b2b3ffcdSSimon Schubert * Copyright (c) 1990 The Regents of the University of California. 3b2b3ffcdSSimon Schubert * All rights reserved. 4b2b3ffcdSSimon Schubert * 5b2b3ffcdSSimon Schubert * This code is derived from software contributed to Berkeley by 6b2b3ffcdSSimon Schubert * William Jolitz. 7b2b3ffcdSSimon Schubert * 8b2b3ffcdSSimon Schubert * Redistribution and use in source and binary forms, with or without 9b2b3ffcdSSimon Schubert * modification, are permitted provided that the following conditions 10b2b3ffcdSSimon Schubert * are met: 11b2b3ffcdSSimon Schubert * 1. Redistributions of source code must retain the above copyright 12b2b3ffcdSSimon Schubert * notice, this list of conditions and the following disclaimer. 13b2b3ffcdSSimon Schubert * 2. Redistributions in binary form must reproduce the above copyright 14b2b3ffcdSSimon Schubert * notice, this list of conditions and the following disclaimer in the 15b2b3ffcdSSimon Schubert * documentation and/or other materials provided with the distribution. 16*c66c7e2fSzrj * 3. Neither the name of the University nor the names of its contributors 17b2b3ffcdSSimon Schubert * may be used to endorse or promote products derived from this software 18b2b3ffcdSSimon Schubert * without specific prior written permission. 19b2b3ffcdSSimon Schubert * 20b2b3ffcdSSimon Schubert * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21b2b3ffcdSSimon Schubert * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22b2b3ffcdSSimon Schubert * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23b2b3ffcdSSimon Schubert * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24b2b3ffcdSSimon Schubert * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25b2b3ffcdSSimon Schubert * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26b2b3ffcdSSimon Schubert * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27b2b3ffcdSSimon Schubert * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28b2b3ffcdSSimon Schubert * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29b2b3ffcdSSimon Schubert * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30b2b3ffcdSSimon Schubert * SUCH DAMAGE. 31b2b3ffcdSSimon Schubert * 32b2b3ffcdSSimon Schubert * @(#)exect.s 5.1 (Berkeley) 4/23/90 33b2b3ffcdSSimon Schubert * $FreeBSD: src/lib/libc/amd64/sys/exect.S,v 1.13 2008/11/02 01:10:54 peter Exp $ 34b2b3ffcdSSimon Schubert */ 35b2b3ffcdSSimon Schubert 36b2b3ffcdSSimon Schubert#include <machine/asm.h> 37b2b3ffcdSSimon Schubert#include "SYS.h" 38b2b3ffcdSSimon Schubert#include <machine/psl.h> 39b2b3ffcdSSimon Schubert 40b2b3ffcdSSimon SchubertENTRY(exect) 41b2b3ffcdSSimon Schubert movq $SYS_execve,%rax 42b2b3ffcdSSimon Schubert pushfq 43b2b3ffcdSSimon Schubert popq %r8 44b2b3ffcdSSimon Schubert orq $PSL_T,%r8 45b2b3ffcdSSimon Schubert pushq %r8 46b2b3ffcdSSimon Schubert popfq 47b2b3ffcdSSimon Schubert KERNCALL 48b2b3ffcdSSimon Schubert#ifdef PIC 49b2b3ffcdSSimon Schubert movq PIC_GOT(HIDENAME(cerror)),%rdx 50b2b3ffcdSSimon Schubert jmp *%rdx 51b2b3ffcdSSimon Schubert#else 52b2b3ffcdSSimon Schubert jmp HIDENAME(cerror) 53b2b3ffcdSSimon Schubert#endif 54b2b3ffcdSSimon SchubertEND(exect) 553084cca3SJohn Marino 563084cca3SJohn Marino .section .note.GNU-stack,"",%progbits 57