. new mode for sys_memset: include process so memset can be done in physical or virtual address space. . add a mode to mmap() that lets a process allocate uninitialized memory. . this allows an exec()er (RS, VFS, etc.) to request uninitialized memory from VM and selectively clear the ranges that don't come from a file, leaving no uninitialized memory left for the process to see. . use callbacks for clearing the process, clearing memory in the process, and copying into the process; so that the libexec code can be used from rs, vfs, and in the future, kernel (to load vm) and vm (to load boot-time processes)
18 lines
354 B
C
18 lines
354 B
C
#include "syslib.h"
|
|
|
|
int sys_memset(endpoint_t who, unsigned long pattern,
|
|
phys_bytes base, phys_bytes bytes)
|
|
{
|
|
/* Zero a block of data. */
|
|
message mess;
|
|
|
|
if (bytes == 0L) return(OK);
|
|
|
|
mess.MEM_PTR = (char *) base;
|
|
mess.MEM_COUNT = bytes;
|
|
mess.MEM_PATTERN = pattern;
|
|
mess.MEM_PROCESS = who;
|
|
|
|
return(_kernel_call(SYS_MEMSET, &mess));
|
|
}
|
|
|