From 324fc1f604f544e90be4425ac1ed12dd1b20f6a0 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Sat, 26 Jul 2014 13:53:44 +0200 Subject: [PATCH] custom message type for VM_SHM_UNMAP --- include/minix/com.h | 2 -- include/minix/ipc.h | 8 ++++++++ lib/libc/sys-minix/mmap.c | 4 ++-- servers/vm/mmap.c | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/minix/com.h b/include/minix/com.h index 45dc520d8..f3affaeed 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -756,8 +756,6 @@ #define VM_REMAP (VM_RQ_BASE+33) #define VM_SHM_UNMAP (VM_RQ_BASE+34) -# define VMUN_ENDPT m_mmap.forwhom -# define VMUN_ADDR m_mmap.addr #define VM_GETPHYS (VM_RQ_BASE+35) # define VMPHYS_ENDPT m2_i1 diff --git a/include/minix/ipc.h b/include/minix/ipc.h index a2e79cdbe..8c84765cb 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -1711,6 +1711,13 @@ typedef struct { } mess_lsys_vm_vmremap; _ASSERT_MSG_SIZE(mess_lsys_vm_vmremap); +typedef struct { + endpoint_t forwhom; + void *addr; + uint8_t padding[48]; +} mess_lc_vm_shm_unmap; +_ASSERT_MSG_SIZE(mess_lc_vm_shm_unmap); + typedef struct { endpoint_t m_source; /* who sent the message */ int m_type; /* what kind of message is it */ @@ -1930,6 +1937,7 @@ typedef struct { mess_vfs_lc_lseek m_vfs_lc_lseek; mess_lsys_vm_vmremap m_lsys_vm_vmremap; + mess_lc_vm_shm_unmap m_lc_vm_shm_unmap; mess_vfs_lchardriver_cancel m_vfs_lchardriver_cancel; mess_vfs_lchardriver_openclose m_vfs_lchardriver_openclose; diff --git a/lib/libc/sys-minix/mmap.c b/lib/libc/sys-minix/mmap.c index 3dec2a4a8..ea073a063 100644 --- a/lib/libc/sys-minix/mmap.c +++ b/lib/libc/sys-minix/mmap.c @@ -134,8 +134,8 @@ int vm_unmap(endpoint_t endpt, void *addr) message m; memset(&m, 0, sizeof(m)); - m.VMUN_ENDPT = endpt; - m.VMUN_ADDR = addr; + m.m_lc_vm_shm_unmap.forwhom = endpt; + m.m_lc_vm_shm_unmap.addr = addr; return _syscall(VM_PROC_NR, VM_SHM_UNMAP, &m); } diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index 0526394d2..a3be376cc 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -498,7 +498,7 @@ int do_munmap(message *m) if(m->m_type == VM_UNMAP_PHYS) { target = m->VMUP_EP; } else if(m->m_type == VM_SHM_UNMAP) { - target = m->VMUN_ENDPT; + target = m->m_lc_vm_shm_unmap.forwhom; } if(target == SELF) @@ -513,7 +513,7 @@ int do_munmap(message *m) if(m->m_type == VM_UNMAP_PHYS) { addr = (vir_bytes) m->VMUP_VADDR; } else if(m->m_type == VM_SHM_UNMAP) { - addr = (vir_bytes) m->VMUN_ADDR; + addr = (vir_bytes) m->m_lc_vm_shm_unmap.addr; } else addr = (vir_bytes) m->VMUM_ADDR; if(addr % VM_PAGE_SIZE)