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
fix: ensure inlining
[lunaix-os.git]
/
lunaix-os
/
kernel
/
process
/
sched.c
diff --git
a/lunaix-os/kernel/process/sched.c
b/lunaix-os/kernel/process/sched.c
index f58710ee347387eee1629214b8b3c270c25b1a62..4e3f290c4ca61e36699988c9f77f899d567c3bf7 100644
(file)
--- a/
lunaix-os/kernel/process/sched.c
+++ b/
lunaix-os/kernel/process/sched.c
@@
-4,6
+4,7
@@
#include <hal/apic.h>
#include <hal/cpu.h>
#include <hal/apic.h>
#include <hal/cpu.h>
+#include <lunaix/fs/taskfs.h>
#include <lunaix/mm/cake.h>
#include <lunaix/mm/kalloc.h>
#include <lunaix/mm/pmm.h>
#include <lunaix/mm/cake.h>
#include <lunaix/mm/kalloc.h>
#include <lunaix/mm/pmm.h>
@@
-281,6
+282,8
@@
alloc_process()
proc->created = clock_systime();
proc->pgid = proc->pid;
proc->fdtable = vzalloc(sizeof(struct v_fdtable));
proc->created = clock_systime();
proc->pgid = proc->pid;
proc->fdtable = vzalloc(sizeof(struct v_fdtable));
+ proc->fxstate =
+ vzalloc_dma(512); // FXSAVE需要十六位对齐地址,使用DMA块(128位对齐)
llist_init_head(&proc->mm.regions.head);
llist_init_head(&proc->tasks);
llist_init_head(&proc->mm.regions.head);
llist_init_head(&proc->tasks);
@@
-331,14
+334,24
@@
destroy_process(pid_t pid)
sched_ctx._procs[index] = 0;
llist_delete(&proc->siblings);
sched_ctx._procs[index] = 0;
llist_delete(&proc->siblings);
+ llist_delete(&proc->grp_member);
+ llist_delete(&proc->tasks);
+ llist_delete(&proc->sleep.sleepers);
+
+ taskfs_invalidate(pid);
+
+ if (proc->cwd) {
+ vfs_unref_dnode(proc->cwd);
+ }
for (size_t i = 0; i < VFS_MAX_FD; i++) {
struct v_fd* fd = proc->fdtable->fds[i];
if (fd)
for (size_t i = 0; i < VFS_MAX_FD; i++) {
struct v_fd* fd = proc->fdtable->fds[i];
if (fd)
- vfs_
close(fd->file
);
+ vfs_
pclose(fd->file, pid
);
}
vfree(proc->fdtable);
}
vfree(proc->fdtable);
+ vfree_dma(proc->fxstate);
struct mm_region *pos, *n;
llist_for_each(pos, n, &proc->mm.regions.head, head)
struct mm_region *pos, *n;
llist_for_each(pos, n, &proc->mm.regions.head, head)