minix/kernel/system/do_memset.c

28 lines
810 B
C
Raw Normal View History

/* The kernel call implemented in this file:
* m_type: SYS_MEMSET
*
* The parameters for this kernel call are:
* m2_p1: MEM_PTR (virtual address)
* m2_l1: MEM_COUNT (returns physical address)
* m2_l2: MEM_PATTERN (pattern byte to be written)
*/
2010-04-02 00:22:33 +02:00
#include "kernel/system.h"
#if USE_MEMSET
/*===========================================================================*
* do_memset *
*===========================================================================*/
2012-03-25 20:25:53 +02:00
int do_memset(struct proc * caller, message * m_ptr)
{
/* Handle sys_memset(). This writes a pattern into the specified memory. */
unsigned char c = m_ptr->MEM_PATTERN;
vm_memset(m_ptr->MEM_PROCESS, (phys_bytes) m_ptr->MEM_PTR,
c, (phys_bytes) m_ptr->MEM_COUNT);
return(OK);
}
#endif /* USE_MEMSET */