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
regression: mmap for fd
[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 74c93807f57115ac85f582d60c5acdd58996d313..9cef1f87ac40a70a7b9502607187a4d2fba1de57 100644
(file)
--- a/
lunaix-os/kernel/process/process.c
+++ b/
lunaix-os/kernel/process/process.c
@@
-142,9
+142,12
@@
init_proc_user_space(struct proc_info* pcb)
/*--- 分配用户栈 ---*/
/*--- 分配用户栈 ---*/
+ struct mm_region* stack_vm;
+
+ stack_vm = region_create(
+ USTACK_END, USTACK_TOP, REGION_RW | REGION_RSHARED | REGION_ANON);
// 注册用户栈区域
// 注册用户栈区域
- region_add(
- &pcb->mm.regions, USTACK_END, USTACK_TOP, REGION_RW | REGION_RSHARED);
+ region_add(&pcb->mm.regions, stack_vm);
// 预留地址空间,具体物理页将由Page Fault Handler按需分配。
for (uintptr_t i = PG_ALIGN(USTACK_END); i < USTACK_TOP; i += PG_SIZE) {
// 预留地址空间,具体物理页将由Page Fault Handler按需分配。
for (uintptr_t i = PG_ALIGN(USTACK_END); i < USTACK_TOP; i += PG_SIZE) {
@@
-211,7
+214,7
@@
dup_proc()
// 根据 mm_region 进一步配置页表
struct mm_region *pos, *n;
// 根据 mm_region 进一步配置页表
struct mm_region *pos, *n;
- llist_for_each(pos, n, &pcb->mm.regions
.head
, head)
+ llist_for_each(pos, n, &pcb->mm.regions, head)
{
// 如果写共享,则不作处理。
if ((pos->attr & REGION_WSHARED)) {
{
// 如果写共享,则不作处理。
if ((pos->attr & REGION_WSHARED)) {