PERFORCE change 124960 for review
Jesper Brix Rosenkilde
jbr at FreeBSD.org
Thu Aug 9 10:05:28 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=124960
Change 124960 by jbr at jbr_bob on 2007/08/09 17:05:23
The page allocation has been moved
Affected files ...
.. //depot/projects/soc2007/jbr-syscall/src/sys/kern/kern_exec.c#9 edit
.. //depot/projects/soc2007/jbr-syscall/src/sys/sys/exec.h#2 edit
.. //depot/projects/soc2007/jbr-syscall/src/sys/vm/vm_map.c#6 edit
Differences ...
==== //depot/projects/soc2007/jbr-syscall/src/sys/kern/kern_exec.c#9 (text+ko) ====
@@ -445,6 +445,8 @@
goto exec_fail_dealloc;
}
+ exec_map_sysshm(imgp);
+
/*
* Special interpreter operation, cleanup and loop up to try to
* activate the interpreter.
@@ -902,6 +904,18 @@
}
}
+int
+exec_map_sysshm(imgp)
+ struct image_params *imgp;
+{
+ vm_map_t map = &imgp->proc->p_vmspace->vm_map;
+ vm_offset_t *addr = &imgp->proc->p_sysent->sv_sysshm;
+
+ vm_map_sysshm(map, addr, 42);
+
+ return(0);
+}
+
/*
* Destroy old address space, and allocate a new stack
* The new stack is only SGROWSIZ large because it is grown
@@ -918,7 +932,7 @@
vm_offset_t stack_addr;
vm_map_t map;
u_long ssiz;
-
+
imgp->vmspace_destroyed = 1;
imgp->sysent = sv;
@@ -969,11 +983,6 @@
vmspace->vm_ssize = sgrowsiz >> PAGE_SHIFT;
vmspace->vm_maxsaddr = (char *)sv->sv_usrstack - ssiz;
- /* Allocate memory shared between process and kernel */
- error = vm_map_sysshm(map, &(sv->sv_sysshm), 42);
- if (error)
- return (error);
-
return (0);
}
==== //depot/projects/soc2007/jbr-syscall/src/sys/sys/exec.h#2 (text+ko) ====
@@ -74,6 +74,8 @@
int exec_map_first_page(struct image_params *);
void exec_unmap_first_page(struct image_params *);
+int exec_map_sysshm(struct image_params *);
+
int exec_register(const struct execsw *);
int exec_unregister(const struct execsw *);
==== //depot/projects/soc2007/jbr-syscall/src/sys/vm/vm_map.c#6 (text+ko) ====
@@ -2993,11 +2993,14 @@
size = round_page(size);
- *addr = round_page((vm_offset_t)
- curthread->td_proc->p_vmspace->vm_daddr);
-
-/* error = vm_map_find(map, NULL, 0, addr, size, TRUE, VM_PROT_NONE, */
-/* VM_PROT_ALL, 0); */
+ PROC_LOCK(curthread->td_proc);
+ *addr = round_page((vm_offset_t)
+ curthread->td_proc->p_vmspace->vm_daddr) +
+ lim_cur(curthread->td_proc, RLIMIT_DATA);
+ PROC_UNLOCK(curthread->td_proc);
+
+ error = vm_map_find(map, NULL, 0, addr, size, TRUE, VM_PROT_NONE,
+ VM_PROT_ALL, 0);
return (error);
}
More information about the p4-projects
mailing list