custom message type for VM_SHM_UNMAP
This commit is contained in:
parent
e3a0e6c3c3
commit
324fc1f604
4 changed files with 12 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue