git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A Total Overhaul on the Lunaix's Virtual Memory Model (#26)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
process
/
process.c
diff --git
a/lunaix-os/kernel/process/process.c
b/lunaix-os/kernel/process/process.c
index 91fe240860211153d3b6b8d3d31e86803b8ee46f..cdaa12ac01f546e5761c1daa9a5ce4ac8c211c54 100644
(file)
--- a/
lunaix-os/kernel/process/process.c
+++ b/
lunaix-os/kernel/process/process.c
@@
-61,23
+61,22
@@
int
spawn_process(struct thread** created, ptr_t entry, bool with_ustack)
{
struct proc_info* kproc = alloc_process();
spawn_process(struct thread** created, ptr_t entry, bool with_ustack)
{
struct proc_info* kproc = alloc_process();
+ struct proc_mm* mm = vmspace(kproc);
- procvm_init_clean(kproc);
-
- vmm_mount_pd(VMS_MOUNT_1, vmroot(kproc));
+ procvm_initvms_mount(mm);
- struct thread* kthread = create_thread(kproc,
VMS_MOUNT_1,
with_ustack);
+ struct thread* kthread = create_thread(kproc, with_ustack);
if (!kthread) {
if (!kthread) {
-
vmm_unmount_pd(VMS_MOUNT_1
);
+
procvm_unmount(mm
);
delete_process(kproc);
return -1;
}
commit_process(kproc);
delete_process(kproc);
return -1;
}
commit_process(kproc);
- start_thread(kthread,
VMS_MOUNT_1,
entry);
+ start_thread(kthread, entry);
-
vmm_unmount_pd(VMS_MOUNT_1
);
+
procvm_unmount(mm
);
if (created) {
*created = kthread;
if (created) {
*created = kthread;
@@
-92,17
+91,16
@@
spawn_process_usr(struct thread** created, char* path,
{
// FIXME remote injection of user stack not yet implemented
{
// FIXME remote injection of user stack not yet implemented
- struct proc_info* proc = alloc_process();
+ struct proc_info* proc = alloc_process();
+ struct proc_mm* mm = vmspace(proc);
assert(!kernel_process(proc));
assert(!kernel_process(proc));
- procvm_init_clean(proc);
-
- vmm_mount_pd(VMS_MOUNT_1, vmroot(proc));
+ procvm_initvms_mount(mm);
int errno = 0;
struct thread* main_thread;
int errno = 0;
struct thread* main_thread;
- if (!(main_thread = create_thread(proc,
VMS_MOUNT_1,
true))) {
+ if (!(main_thread = create_thread(proc, true))) {
errno = ENOMEM;
goto fail;
}
errno = ENOMEM;
goto fail;
}
@@
-114,17
+112,17
@@
spawn_process_usr(struct thread** created, char* path,
}
commit_process(proc);
}
commit_process(proc);
- start_thread(main_thread,
VMS_MOUNT_1,
container.exe.entry);
+ start_thread(main_thread, container.exe.entry);
if (created) {
*created = main_thread;
}
if (created) {
*created = main_thread;
}
-
vmm_unmount_pd(VMS_MOUNT_1
);
+
procvm_unmount(mm
);
return 0;
fail:
return 0;
fail:
-
vmm_unmount_pd(VMS_MOUNT_1
);
+
procvm_unmount(mm
);
delete_process(proc);
return errno;
}
delete_process(proc);
return errno;
}