Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sys / i386 / boot / dosboot / exec.h
1 /*-\r
2  * Copyright (c) 1992, 1993\r
3  *      The Regents of the University of California.  All rights reserved.\r
4  * (c) UNIX System Laboratories, Inc.\r
5  * All or some portions of this file are derived from material licensed\r
6  * to the University of California by American Telephone and Telegraph\r
7  * Co. or Unix System Laboratories, Inc. and are reproduced herein with\r
8  * the permission of UNIX System Laboratories, Inc.\r
9  *\r
10  * Redistribution and use in source and binary forms, with or without\r
11  * modification, are permitted provided that the following conditions\r
12  * are met:\r
13  * 1. Redistributions of source code must retain the above copyright\r
14  *    notice, this list of conditions and the following disclaimer.\r
15  * 2. Redistributions in binary form must reproduce the above copyright\r
16  *    notice, this list of conditions and the following disclaimer in the\r
17  *    documentation and/or other materials provided with the distribution.\r
18  * 3. All advertising materials mentioning features or use of this software\r
19  *    must display the following acknowledgement:\r
20  *      This product includes software developed by the University of\r
21  *      California, Berkeley and its contributors.\r
22  * 4. Neither the name of the University nor the names of its contributors\r
23  *    may be used to endorse or promote products derived from this software\r
24  *    without specific prior written permission.\r
25  *\r
26  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
36  * SUCH DAMAGE.\r
37  *\r
38  *      @(#)exec.h      8.3 (Berkeley) 1/21/94\r
39  * $FreeBSD: src/sys/i386/boot/dosboot/exec.h,v 1.5 1999/08/28 00:43:23 peter Exp $\r
40  */\r
41 \r
42 #ifndef _SYS_EXEC_H_\r
43 #define _SYS_EXEC_H_\r
44 \r
45 /*\r
46  * The following structure is found at the top of the user stack of each\r
47  * user process. The ps program uses it to locate argv and environment\r
48  * strings. Programs that wish ps to display other information may modify\r
49  * it; normally ps_argvstr points to the text for argv[0], and ps_nargvstr\r
50  * is the same as the program's argc. The fields ps_envstr and ps_nenvstr\r
51  * are the equivalent for the environment.\r
52  */\r
53 struct ps_strings {\r
54         char    *ps_argvstr;    /* first of 0 or more argument strings */\r
55         long    ps_nargvstr;    /* the number of argument strings */\r
56         char    *ps_envstr;     /* first of 0 or more environment strings */\r
57         long    ps_nenvstr;     /* the number of environment strings */\r
58 };\r
59 \r
60 /*\r
61  * Address of ps_strings structure (in user space).\r
62  */\r
63 #define SPARE_USRSPACE  256\r
64 #define PS_STRINGS ((struct ps_strings *) \\r
65                 (USRSTACK - sizeof(struct ps_strings) - SPARE_USRSPACE))\r
66 \r
67 /*\r
68  * Arguments to the exec system call.\r
69  */\r
70 struct execve_args {\r
71         char    *fname;\r
72         char    **argv;\r
73         char    **envv;\r
74 };\r
75 \r
76 struct execsw {\r
77         int (*ex_imgact)(void * /* struct image_params * */);\r
78         const char *ex_name;\r
79 };\r
80 \r
81 #ifdef KERNEL\r
82 extern const struct execsw **execsw;\r
83 \r
84 #endif\r
85 \r
86 #include "mexec.h"\r
87 \r
88 #endif\r