]> git.corax.cc Git - corax/commitdiff
Move process.h definitions into a kernel-wide header file; add entry argument to...
authorMatthias Kruk <m@m10k.eu>
Fri, 27 Sep 2019 06:06:12 +0000 (15:06 +0900)
committerMatthias Kruk <m@m10k.eu>
Fri, 27 Sep 2019 06:06:12 +0000 (15:06 +0900)
include/corax/process.h [new file with mode: 0644]
kernel/arch/process.c
kernel/include/arch.h

diff --git a/include/corax/process.h b/include/corax/process.h
new file mode 100644 (file)
index 0000000..1f5bdad
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __CORAX_PROCESS_H
+#define __CORAX_PROCESS_H
+
+struct process {
+
+};
+
+#endif /* __CORAX_PROCESS_H */
index f3716a17160c673609726f10c48d946bcd2f9ca5..6b53f48455643bac80f00f2a586674baec433007 100644 (file)
@@ -3,6 +3,7 @@
 #include <corax/heap.h>
 #include <arch.h>
 #include <debug.h>
+#include <process.h>
 #include "paging.h"
 #include "cpu.h"
 
@@ -12,16 +13,7 @@ struct process {
        u32_t          p_privl;
 };
 
-void foo(void)
-{
-       for(;;);
-
-       return;
-}
-
-extern int _pg_dir_vpxlate(pg_dir_t*, u32_t, u32_t*);
-
-int process_create(process_t **dst, u32_t ppl)
+int process_create(process_t **dst, u32_t ppl, void *entry)
 {
        int ret_val;
        process_t *proc;
@@ -53,7 +45,7 @@ int process_create(process_t **dst, u32_t ppl)
 
                proc->p_privl = ppl;
 
-               task_prepare(proc->p_tasks, (u32_t)pdbr, (u32_t)foo,
+               task_prepare(proc->p_tasks, (u32_t)pdbr, (u32_t)entry,
                                         (u32_t)kstack, (u32_t)ustack + PAGE_SIZE, ppl);
 
                proc->p_tasks->t_sp = (u32_t)(CONFIG_KERNEL_STACK_BASE +
index 7503a2b5f873366a8e2e82555b1b638c95a05cab..dacad3c0fa7c8106a277c08ea91e025f85b74029 100644 (file)
@@ -21,8 +21,6 @@
 
 #include <corax/types.h>
 
-typedef struct process process_t;
-
 struct task {
        u32_t t_sp;
        u32_t t_pgdir;
@@ -36,8 +34,6 @@ u64_t   cpu_timestamp(void);
 
 u32_t   cpu_set_pstate(int pstate);
 
-int     process_create(process_t**, u32_t);
-
 int     task_prepare(struct task*, u32_t cr3, u32_t eip, u32_t esp0, u32_t esp, u32_t priv);
 int     task_switch(struct task*);