custom message type for VM_UNMAP_PHYS

This commit is contained in:
Ben Gras 2014-07-26 13:53:59 +02:00 committed by Lionel Sambuc
parent 6af75e6660
commit c24f718bb4
4 changed files with 12 additions and 6 deletions

View file

@ -702,8 +702,6 @@
#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)

View 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;

View 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);
}

View 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;