For /dev/mem, map in memory to be copied to memory's own address space
[minix3.git] / kernel / system / do_memset.c
bloba6f88f606fa8cd613c946550b6518ac52188f81d
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 (size of datastructure)
8 */
10 #include "../system.h"
12 #if USE_MEMSET
14 /*===========================================================================*
15 * do_memset *
16 *===========================================================================*/
17 PUBLIC int do_memset(m_ptr)
18 register message *m_ptr;
20 /* Handle sys_memset(). This writes a pattern into the specified memory. */
21 unsigned long p;
22 unsigned char c = m_ptr->MEM_PATTERN;
23 p = c | (c << 8) | (c << 16) | (c << 24);
24 phys_memset((phys_bytes) m_ptr->MEM_PTR, p, (phys_bytes) m_ptr->MEM_COUNT);
25 return(OK);
28 #endif /* USE_MEMSET */