#include <klibc/string.h>
#include <lunaix/clock.h>
-#include <lunaix/common.h>
#include <lunaix/mm/mmap.h>
#include <lunaix/mm/pmm.h>
#include <lunaix/mm/region.h>
struct mm_region* mapped;
struct mmap_param param = { .vms_mnt = VMS_MOUNT_1,
.pvms = &pcb->mm,
- .mlen = USTACK_SIZE,
+ .mlen = USR_STACK_SIZE,
.proct = PROT_READ | PROT_WRITE,
.flags = MAP_ANON | MAP_PRIVATE | MAP_FIXED,
.type = REGION_TYPE_STACK };
int status = 0;
- if ((status = mem_map(NULL, &mapped, USTACK_END, NULL, ¶m))) {
- kprint_panic("fail to alloc user stack: %d", status);
+ if ((status = mem_map(NULL, &mapped, USR_STACK, NULL, ¶m))) {
+ kprintf(KFATAL "fail to alloc user stack: %d", status);
}
mapped->region_copied = __stack_copied;
}
__copy_fdtable(pcb);
- region_copy(&__current->mm, &pcb->mm);
+ region_copy_mm(&__current->mm, &pcb->mm);
/*
* store the return value for forked process.
vmm_mount_pd(VMS_MOUNT_1, pt_copy); // 将新进程的页表挂载到挂载点#2
// copy the kernel stack
- for (size_t i = KSTACK_START >> 12; i <= KSTACK_TOP >> 12; i++) {
+ for (size_t i = KERNEL_STACK >> 12; i <= KERNEL_STACK_END >> 12; i++) {
volatile x86_pte_t* ppte = &PTE_MOUNTED(VMS_MOUNT_1, i);
/*