3.1.7 branch.
[minix.git] / kernel / system / do_memset.c
blobdd8a06a5101d153f8f0144dd036fcb49519e165b
1 /* The kernel call implemented in this file:
2 * m_type: SYS_MEMSET
4 * The parameters for this kernel call are:
5 * m2_p1: MEM_PTR (virtual address)
6 * m2_l1: MEM_COUNT (returns physical address)
7 * m2_l2: MEM_PATTERN (pattern byte to be written)
8 */
10 #include "kernel/system.h"
12 #if USE_MEMSET
14 /*===========================================================================*
15 * do_memset *
16 *===========================================================================*/
17 PUBLIC int do_memset(struct proc * caller, message * m_ptr)
19 /* Handle sys_memset(). This writes a pattern into the specified memory. */
20 unsigned char c = m_ptr->MEM_PATTERN;
21 vm_phys_memset((phys_bytes) m_ptr->MEM_PTR, c, (phys_bytes) m_ptr->MEM_COUNT);
22 return(OK);
25 #endif /* USE_MEMSET */