From: Ben Gras Date: Sat, 26 Jul 2014 11:53:57 +0000 (+0200) Subject: custom message type for VM_BRK X-Git-Tag: v3.3.0~115 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=8c2ac80abda57de8b31e93b56170ce445385c4f6;p=minix.git custom message type for VM_BRK --- diff --git a/include/minix/com.h b/include/minix/com.h index 3cedfe728..e0edf54e8 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -659,7 +659,6 @@ # define VMF_SLOTNO m1_i2 # define VMF_CHILD_ENDPOINT m1_i3 /* result */ #define VM_BRK (VM_RQ_BASE+2) -# define VMB_ADDR m1_p1 #define VM_EXEC_NEWMEM (VM_RQ_BASE+3) # define VMEN_ENDPOINT m1_i1 # define VMEN_ARGSPTR m1_p1 diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 6de1d08b8..c1fcc78e8 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -1735,6 +1735,12 @@ typedef struct { } mess_lc_vm_shm_unmap; _ASSERT_MSG_SIZE(mess_lc_vm_shm_unmap); +typedef struct { + void *addr; + uint8_t padding[52]; +} mess_lc_vm_brk; +_ASSERT_MSG_SIZE(mess_lc_vm_brk); + typedef struct { endpoint_t endpt; void *addr; @@ -2076,6 +2082,7 @@ typedef struct { mess_lc_ipc_semget m_lc_ipc_semget; mess_lc_ipc_semctl m_lc_ipc_semctl; mess_lc_ipc_semop m_lc_ipc_semop; + mess_lc_vm_brk m_lc_vm_brk; mess_vfs_lchardriver_cancel m_vfs_lchardriver_cancel; mess_vfs_lchardriver_openclose m_vfs_lchardriver_openclose; diff --git a/lib/libc/sys-minix/brk.c b/lib/libc/sys-minix/brk.c index 8b63978d9..a236196ad 100644 --- a/lib/libc/sys-minix/brk.c +++ b/lib/libc/sys-minix/brk.c @@ -26,7 +26,7 @@ void *addr; if (addr != _brksize) { memset(&m, 0, sizeof(m)); - m.VMB_ADDR = addr; + m.m_lc_vm_brk.addr = addr; if (_syscall(VM_PROC_NR, VM_BRK, &m) < 0) return(-1); _brksize = addr; } diff --git a/servers/vm/break.c b/servers/vm/break.c index cc5cb7d8c..92c0eee7d 100644 --- a/servers/vm/break.c +++ b/servers/vm/break.c @@ -54,7 +54,7 @@ int do_brk(message *msg) return EINVAL; } - return real_brk(&vmproc[proc], (vir_bytes) msg->VMB_ADDR); + return real_brk(&vmproc[proc], (vir_bytes) msg->m_lc_vm_brk.addr); } /*===========================================================================*