custom message type for VM_BRK

This commit is contained in:
Ben Gras 2014-07-26 13:53:57 +02:00 committed by Lionel Sambuc
parent 7cb7ac5b42
commit 8c2ac80abd
4 changed files with 9 additions and 3 deletions

View file

@ -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

View file

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

View file

@ -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;
}

View file

@ -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);
}
/*===========================================================================*