-#include <arch/abi.h>
#include <klibc/string.h>
#include <lunaix/clock.h>
#include <lunaix/common.h>
#include <lunaix/syscall.h>
#include <lunaix/syslog.h>
+#include <sys/abi.h>
+#include <sys/mm/mempart.h>
+
LOG_MODULE("PROC")
ptr_t
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++) {
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* 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策略。
- 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;
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);
return pcb->pid;
}
-extern void __kernel_end;
+extern void __kexec_end;
void
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!
*/
- 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));