summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/exec.h16
-rw-r--r--sys/include/sys/proc.h5
2 files changed, 21 insertions, 0 deletions
diff --git a/sys/include/sys/exec.h b/sys/include/sys/exec.h
index 4910ff2..73eae01 100644
--- a/sys/include/sys/exec.h
+++ b/sys/include/sys/exec.h
@@ -34,7 +34,23 @@
#if defined(_KERNEL)
+/* Danger: Do not change these !! */
+#define AT_NULL 0
+#define AT_ENTRY 1
+#define AT_PHDR 2
+#define AT_PHENT 3
+#define AT_PHNUM 4
+#define AT_EXECPATH 5
+#define AT_SECURE 6
+#define AT_RANDOM 7
+#define AT_EXECFN 8
+#define AT_PAGESIZE 9
+
#define MAX_PHDRS 32
+#define STACK_PUSH(PTR, VAL) *(--(PTR)) = VAL
+#define AUXVAL(PTR, TAG, VAL) \
+ STACK_PUSH(PTR, VAL); \
+ STACK_PUSH(PTR, TAG);
struct exec_range {
uintptr_t start;
diff --git a/sys/include/sys/proc.h b/sys/include/sys/proc.h
index 5303072..0c3cd33 100644
--- a/sys/include/sys/proc.h
+++ b/sys/include/sys/proc.h
@@ -43,6 +43,8 @@
#define PROC_STACK_PAGES 8
#define PROC_STACK_SIZE (PROC_STACK_PAGES * DEFAULT_PAGESIZE)
+struct exec_prog;
+
struct proc {
pid_t pid;
struct trapframe tf;
@@ -57,6 +59,9 @@ struct proc {
struct proc *this_td(void);
int md_fork(struct proc *p, struct proc *parent, uintptr_t ip);
+
+void md_td_stackinit(struct proc *td, void *stack_top, struct exec_prog *prog);
+
int fork1(struct proc *cur, int flags, void(*ip)(void), struct proc **newprocp);
int exit1(struct proc *td);