From: Lionel Sambuc Date: Tue, 20 May 2014 11:18:39 +0000 (+0200) Subject: Message type for SYS_MEMSET X-Git-Tag: v3.3.0~231 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/named-checkconf.html?a=commitdiff_plain;h=3ed35f395888b69a762e57f09009f1a20747b55f;p=minix.git Message type for SYS_MEMSET Change-Id: Icebd04e0c53d9653301550bb598df8719aa66ada --- diff --git a/include/minix/com.h b/include/minix/com.h index 488baea8e..0c6f18da9 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -274,12 +274,6 @@ SYS_TIMES, SYS_SETALARM, SYS_SETGRANT, \ SYS_PROFBUF, SYS_DIAGCTL, SYS_STATECTL, SYS_SAFEMEMSET -/* Field names for SYS_MEMSET. */ -#define MEM_PTR m2_p1 /* base */ -#define MEM_COUNT m2_l1 /* count */ -#define MEM_PATTERN m2_l2 /* pattern to write */ -#define MEM_PROCESS m2_i1 /* NONE (phys) or process id (vir) */ - /* Field names for SYS_DEVIO, SYS_VDEVIO, SYS_SDEVIO. */ #define DIO_REQUEST m2_i3 /* device in or output */ # define _DIO_INPUT 0x001 diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 666507ddc..b10d8a931 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -700,6 +700,16 @@ typedef struct { } mess_lsys_krn_schedctl; _ASSERT_MSG_SIZE(mess_lsys_krn_schedctl); +typedef struct { + phys_bytes base; + phys_bytes count; + unsigned long pattern; + endpoint_t process; + + uint8_t padding[40]; +} mess_lsys_krn_sys_memset; +_ASSERT_MSG_SIZE(mess_lsys_krn_sys_memset); + typedef struct { int devind; int port; @@ -1423,6 +1433,7 @@ typedef struct { mess_lsys_krn_schedctl m_lsys_krn_schedctl; mess_lsys_krn_schedule m_lsys_krn_schedule; + mess_lsys_krn_sys_memset m_lsys_krn_sys_memset; mess_lsys_pci_busc_get_bar m_lsys_pci_busc_get_bar; diff --git a/kernel/system/do_memset.c b/kernel/system/do_memset.c index cea520f43..f919b2644 100644 --- a/kernel/system/do_memset.c +++ b/kernel/system/do_memset.c @@ -2,9 +2,9 @@ * 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) + * m_lsys_krn_sys_memset.base (virtual address) + * m_lsys_krn_sys_memset.count (returns physical address) + * m_lsys_krn_sys_memset.pattern (pattern byte to be written) */ #include "kernel/system.h" @@ -17,8 +17,10 @@ int do_memset(struct proc * caller, message * m_ptr) { /* Handle sys_memset(). This writes a pattern into the specified memory. */ - vm_memset(caller, m_ptr->MEM_PROCESS, (phys_bytes) m_ptr->MEM_PTR, - m_ptr->MEM_PATTERN, (phys_bytes) m_ptr->MEM_COUNT); + vm_memset(caller, m_ptr->m_lsys_krn_sys_memset.process, + m_ptr->m_lsys_krn_sys_memset.base, + m_ptr->m_lsys_krn_sys_memset.pattern, + m_ptr->m_lsys_krn_sys_memset.count); return(OK); } diff --git a/lib/libsys/sys_memset.c b/lib/libsys/sys_memset.c index 65e6590ab..0ecfff9a4 100644 --- a/lib/libsys/sys_memset.c +++ b/lib/libsys/sys_memset.c @@ -8,10 +8,10 @@ int sys_memset(endpoint_t who, unsigned long pattern, if (bytes == 0L) return(OK); - mess.MEM_PTR = (char *) base; - mess.MEM_COUNT = bytes; - mess.MEM_PATTERN = pattern; - mess.MEM_PROCESS = who; + mess.m_lsys_krn_sys_memset.base = base; + mess.m_lsys_krn_sys_memset.count = bytes; + mess.m_lsys_krn_sys_memset.pattern = pattern; + mess.m_lsys_krn_sys_memset.process = who; return(_kernel_call(SYS_MEMSET, &mess)); }