]> Zhao Yanbai Git Server - minix.git/commitdiff
custom message type for VM_UNMAP_PHYS
authorBen Gras <ben@minix3.org>
Sat, 26 Jul 2014 11:53:59 +0000 (13:53 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:06:23 +0000 (17:06 +0200)
include/minix/com.h
include/minix/ipc.h
lib/libsys/vm_map_phys.c
servers/vm/mmap.c

index d1c1ee3fc00a70004ebcdddcb7e3040476d30dc4..e1b4513db9b3ee1ca89b77932c3103f96b0f9875 100644 (file)
 #define VM_MAP_PHYS            (VM_RQ_BASE+15)
 
 #define VM_UNMAP_PHYS          (VM_RQ_BASE+16)
-#      define VMUP_EP                  m1_i1
-#      define VMUP_VADDR               m1_p1
 
 /* To VM: map in cache block by FS */
 #define VM_MAPCACHEPAGE                (VM_RQ_BASE+26)
index 15bc6203a2050bb022f29b2442b017aac0100e71..6b2e529058eda9d1a81c90a6769b6f1b331a53b0 100644 (file)
@@ -1856,6 +1856,13 @@ typedef struct {
 } mess_lsys_vm_map_phys;
 _ASSERT_MSG_SIZE(mess_lsys_vm_map_phys);
 
+typedef struct {
+       endpoint_t      ep;
+       void            *vaddr;
+       uint8_t         padding[48];
+} mess_lsys_vm_unmap_phys;
+_ASSERT_MSG_SIZE(mess_lsys_vm_unmap_phys);
+
 typedef struct {
        endpoint_t m_source;            /* who sent the message */
        int m_type;                     /* what kind of message is it */
@@ -2093,6 +2100,7 @@ typedef struct {
                mess_lc_ipc_semop       m_lc_ipc_semop;
                mess_lc_vm_brk          m_lc_vm_brk;
                mess_lsys_vm_map_phys   m_lsys_vm_map_phys;
+               mess_lsys_vm_unmap_phys m_lsys_vm_unmap_phys;
 
                mess_vfs_lchardriver_cancel     m_vfs_lchardriver_cancel;
                mess_vfs_lchardriver_openclose  m_vfs_lchardriver_openclose;
index bd1e183e17f3ff0797a25bdac6e9190b4f021417..1635c0e6e49bc85e0956fef7cb81fc6bcc6af2cd 100644 (file)
@@ -29,8 +29,8 @@ vm_unmap_phys(endpoint_t who, void *vaddr, size_t len)
        message m;
 
        memset(&m, 0, sizeof(m));
-       m.VMUP_EP = who;
-       m.VMUP_VADDR = vaddr;
+       m.m_lsys_vm_unmap_phys.ep = who;
+       m.m_lsys_vm_unmap_phys.vaddr = vaddr;
 
        return _taskcall(VM_PROC_NR, VM_UNMAP_PHYS, &m);
 }
index dcdbf44b27021f995af8f7e97ac6a7790c34de3c..d6cc1cda8f63bb04ed287a061a3d0797cfbaa2d7 100644 (file)
@@ -496,7 +496,7 @@ int do_munmap(message *m)
        endpoint_t target = SELF;
 
        if(m->m_type == VM_UNMAP_PHYS) {
-               target = m->VMUP_EP;
+               target = m->m_lsys_vm_unmap_phys.ep;
        } else if(m->m_type == VM_SHM_UNMAP) {
                target = m->m_lc_vm_shm_unmap.forwhom;
        }
@@ -511,7 +511,7 @@ int do_munmap(message *m)
         vmp = &vmproc[n];
 
        if(m->m_type == VM_UNMAP_PHYS) {
-               addr = (vir_bytes) m->VMUP_VADDR;
+               addr = (vir_bytes) m->m_lsys_vm_unmap_phys.vaddr;
        } else if(m->m_type == VM_SHM_UNMAP) {
                addr = (vir_bytes) m->m_lc_vm_shm_unmap.addr;
        } else  addr = (vir_bytes) m->VMUM_ADDR;