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
hotfix: a better hinting on non-returning spin function
[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 4e8fa0a90b6bb14c56d2355b1897488822858239..2407ecf1c2709348ee8283ececc18d53a5abea7f 100644
(file)
--- a/
lunaix-os/kernel/process/process.c
+++ b/
lunaix-os/kernel/process/process.c
@@
-1,4
+1,3
@@
-#include <arch/abi.h>
#include <klibc/string.h>
#include <lunaix/clock.h>
#include <lunaix/common.h>
#include <klibc/string.h>
#include <lunaix/clock.h>
#include <lunaix/common.h>
@@
-13,6
+12,9
@@
#include <lunaix/syscall.h>
#include <lunaix/syslog.h>
#include <lunaix/syscall.h>
#include <lunaix/syslog.h>
+#include <sys/abi.h>
+#include <sys/mm/mempart.h>
+
LOG_MODULE("PROC")
ptr_t
LOG_MODULE("PROC")
ptr_t
@@
-24,7
+26,7
@@
__dup_pagetable(pid_t pid, ptr_t mount_point)
x86_page_table* ptd = (x86_page_table*)PG_MOUNT_1;
x86_page_table* pptd = (x86_page_table*)(mount_point | (0x3FF << 12));
x86_page_table* ptd = (x86_page_table*)PG_MOUNT_1;
x86_page_table* pptd = (x86_page_table*)(mount_point | (0x3FF << 12));
- size_t kspace_l1inx = L1_INDEX(KERNEL_
MM_BASE
);
+ size_t kspace_l1inx = L1_INDEX(KERNEL_
EXEC
);
for (size_t i = 0; i < PG_MAX_ENTRIES - 1; i++) {
for (size_t i = 0; i < PG_MAX_ENTRIES - 1; i++) {
@@
-63,7
+65,7
@@
__del_pagetable(pid_t pid, ptr_t mount_point)
x86_page_table* pptd = (x86_page_table*)(mount_point | (0x3FF << 12));
// only remove user address space
x86_page_table* pptd = (x86_page_table*)(mount_point | (0x3FF << 12));
// only remove user address space
- for (size_t i = 0; i < L1_INDEX(KERNEL_
MM_BASE
); i++) {
+ for (size_t i = 0; i < L1_INDEX(KERNEL_
EXEC
); i++) {
x86_pte_t ptde = pptd->entry[i];
if (!ptde || !(ptde & PG_PRESENT)) {
continue;
x86_pte_t ptde = pptd->entry[i];
if (!ptde || !(ptde & PG_PRESENT)) {
continue;
@@
-177,12
+179,12
@@
__mark_region(ptr_t start_vpn, ptr_t end_vpn, int attr)
x86_pte_t* curproc = &PTE_MOUNTED(VMS_SELF, i);
x86_pte_t* newproc = &PTE_MOUNTED(VMS_MOUNT_1, i);
x86_pte_t* curproc = &PTE_MOUNTED(VMS_SELF, i);
x86_pte_t* newproc = &PTE_MOUNTED(VMS_MOUNT_1, i);
- cpu_
invplg
((ptr_t)newproc);
+ cpu_
flush_page
((ptr_t)newproc);
if ((attr & REGION_MODE_MASK) == REGION_RSHARED) {
// 如果读共享,则将两者的都标注为只读,那么任何写入都将会应用COW策略。
if ((attr & REGION_MODE_MASK) == REGION_RSHARED) {
// 如果读共享,则将两者的都标注为只读,那么任何写入都将会应用COW策略。
- cpu_
invplg
((ptr_t)curproc);
- cpu_
invplg
((ptr_t)(i << 12));
+ cpu_
flush_page
((ptr_t)curproc);
+ cpu_
flush_page
((ptr_t)(i << 12));
*curproc = *curproc & ~PG_WRITE;
*newproc = *newproc & ~PG_WRITE;
*curproc = *curproc & ~PG_WRITE;
*newproc = *newproc & ~PG_WRITE;
@@
-211,8
+213,6
@@
dup_proc()
pcb->intr_ctx = __current->intr_ctx;
pcb->parent = __current;
pcb->intr_ctx = __current->intr_ctx;
pcb->parent = __current;
- memcpy(pcb->fxstate, __current->fxstate, 512);
-
if (__current->cwd) {
pcb->cwd = __current->cwd;
vfs_ref_dnode(pcb->cwd);
if (__current->cwd) {
pcb->cwd = __current->cwd;
vfs_ref_dnode(pcb->cwd);
@@
-251,7
+251,7
@@
dup_proc()
return pcb->pid;
}
return pcb->pid;
}
-extern void __ke
rnel
_end;
+extern void __ke
xec
_end;
void
copy_kernel_stack(struct proc_info* proc, ptr_t usedMnt)
void
copy_kernel_stack(struct proc_info* proc, ptr_t usedMnt)
@@
-274,7
+274,7
@@
copy_kernel_stack(struct proc_info* proc, ptr_t usedMnt)
In the name of Celestia our glorious goddess, I will fucking HATE
the TLB for the rest of my LIFE!
*/
In the name of Celestia our glorious goddess, I will fucking HATE
the TLB for the rest of my LIFE!
*/
- cpu_
invplg
((ptr_t)ppte);
+ cpu_
flush_page
((ptr_t)ppte);
x86_pte_t p = *ppte;
ptr_t ppa = vmm_dup_page(pid, PG_ENTRY_ADDR(p));
x86_pte_t p = *ppte;
ptr_t ppa = vmm_dup_page(pid, PG_ENTRY_ADDR(p));