- Test m_pkthdr.fw_flags against DUMMYNET_MBUF_TAGGED before trying to locate
[dragonfly/netmp.git] / sys / sys / imgact_elf.h
blob56f0d57dc65a1d7cff4a9581216b2efce7777d55
1 /*-
2 * Copyright (c) 1995-1996 Søren Schmidt
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer
10 * in this position and unchanged.
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. The name of the author may not be used to endorse or promote products
15 * derived from this software withough specific prior written permission
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 * $FreeBSD: src/sys/sys/imgact_elf.h,v 1.17.2.1 2000/07/06 22:26:40 obrien Exp $
29 * $DragonFly: src/sys/sys/imgact_elf.h,v 1.9 2008/07/23 17:22:33 dillon Exp $
32 #ifndef _SYS_IMGACT_ELF_H_
33 #define _SYS_IMGACT_ELF_H_
35 #include <sys/elf_common.h>
36 #include <machine/elf.h>
38 #ifdef _KERNEL
40 #define AUXARGS_ENTRY(pos, id, val) {suword(pos++, id); suword(pos++, val);}
42 #if ELF_TARG_CLASS == ELFCLASS32
45 * Structure used to pass infomation from the loader to the
46 * stack fixup routine.
48 typedef struct {
49 Elf32_Sword execfd;
50 Elf32_Size phdr;
51 Elf32_Size phent;
52 Elf32_Size phnum;
53 Elf32_Size pagesz;
54 Elf32_Size base;
55 Elf32_Size flags;
56 Elf32_Size entry;
57 Elf32_Size trace;
58 } Elf32_Auxargs;
60 typedef struct {
61 int brand;
62 const char *compat_3_brand; /* pre Binutils 2.10 method (FBSD 3) */
63 int (*match_abi_note)(const Elf_Note *);
64 const char *emul_path;
65 const char *interp_path;
66 struct sysentvec *sysvec;
67 } Elf32_Brandinfo;
69 #define MAX_BRANDS 8
71 int elf_brand_inuse (Elf32_Brandinfo *entry);
72 int elf_insert_brand_entry (Elf32_Brandinfo *entry);
73 int elf_remove_brand_entry (Elf32_Brandinfo *entry);
75 #else /* !(ELF_TARG_CLASS == ELFCLASS32) */
78 * Structure used to pass infomation from the loader to the
79 * stack fixup routine.
81 typedef struct {
82 Elf64_Sxword execfd;
83 Elf64_Addr phdr;
84 Elf64_Word phent;
85 Elf64_Word phnum;
86 Elf64_Word pagesz;
87 Elf64_Addr base;
88 Elf64_Word flags;
89 Elf64_Addr entry;
90 Elf64_Word trace;
91 } Elf64_Auxargs;
93 typedef struct {
94 int brand;
95 const char *compat_3_brand; /* pre Binutils 2.10 method (FBSD 3) */
96 int (*match_abi_note)(const Elf_Note *);
97 const char *emul_path;
98 const char *interp_path;
99 struct sysentvec *sysvec;
100 } Elf64_Brandinfo;
102 #define MAX_BRANDS 8
104 int elf_brand_inuse (Elf64_Brandinfo *entry);
105 int elf_insert_brand_entry (Elf64_Brandinfo *entry);
106 int elf_remove_brand_entry (Elf64_Brandinfo *entry);
108 #endif /* ELF_TARG_CLASS == ELFCLASS32 */
110 struct lwp;
111 struct file;
112 struct vnode;
114 int elf_coredump (struct lwp *, int, struct vnode *, off_t);
115 int generic_elf_coredump(struct lwp *lp, int sig, struct file *fp, off_t limit);
116 #endif /* _KERNEL */
118 #endif /* !_SYS_IMGACT_ELF_H_ */