1 | /* $NetBSD: linux_exec.h,v 1.5 2013/11/18 01:32:22 chs Exp $ */ |
2 | |
3 | /*- |
4 | * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. |
5 | * |
6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions |
8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
14 | * 3. All advertising materials mentioning features or use of this software |
15 | * must display the following acknowledgement: |
16 | * This product includes software developed by Emmanuel Dreyfus |
17 | * 4. The name of the author may not be used to endorse or promote |
18 | * products derived from this software without specific prior written |
19 | * permission. |
20 | * |
21 | * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS'' |
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
23 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS |
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
31 | * POSSIBILITY OF SUCH DAMAGE. |
32 | */ |
33 | |
34 | #ifndef _AMD64_LINUX_EXEC_H |
35 | #define _AMD64_LINUX_EXEC_H |
36 | |
37 | #ifndef ELFSIZE |
38 | #define ELFSIZE 64 |
39 | #endif |
40 | #include <sys/exec_elf.h> |
41 | |
42 | /* This is only for a.out, and a.out does not support amd64 */ |
43 | #define LINUX_M_I386 100 |
44 | #define LINUX_MID_MACHINE LINUX_M_I386 |
45 | |
46 | #define LINUX_USRSTACK 0x800000000000 |
47 | #define LINUX_USRSTACK32 0xc0000000 |
48 | |
49 | /* Counted from linux_exec_machdep.c */ |
50 | #define LINUX_ELF_AUX_ENTRIES 17 |
51 | |
52 | /* Hardware platform identifier string */ |
53 | #define LINUX_PLATFORM "x86_64" |
54 | |
55 | /* The extra data (ELF auxiliary table and platform name) on stack */ |
56 | struct { |
57 | Aux64Info [LINUX_ELF_AUX_ENTRIES]; |
58 | uint32_t randbytes[4]; |
59 | char [1]; /*sizeof(long) - (sizeof(LINUX_PLATFORM) % sizeof(long))*/ |
60 | char [sizeof(LINUX_PLATFORM)]; |
61 | }; |
62 | #define LINUX_ELF_AUX_ARGSIZ sizeof(struct linux_extra_stack_data64) |
63 | |
64 | /* we have special powerpc ELF copyargs */ |
65 | #define LINUX_MACHDEP_ELF_COPYARGS |
66 | |
67 | #define LINUX_DEBUGLINK_SIGNATURE |
68 | |
69 | int linux_exec_setup_stack(struct lwp *, struct exec_package *); |
70 | |
71 | #endif /* !_AMD64_LINUX_EXEC_H */ |
72 | |