Unmap drivers upon exit

This commit is contained in:
Thomas Veerman 2011-09-13 13:02:47 +00:00
parent 203937456e
commit 200b9d7339
3 changed files with 8 additions and 7 deletions

View file

@ -565,8 +565,8 @@ PUBLIC int do_ioctl()
/*===========================================================================*
* gen_io *
*===========================================================================*/
PUBLIC int gen_io(task_nr, mess_ptr)
endpoint_t task_nr; /* which task to call */
PUBLIC int gen_io(driver_e, mess_ptr)
endpoint_t driver_e; /* which endpoint to call */
message *mess_ptr; /* pointer to message for task */
{
/* All file system I/O ultimately comes down to I/O on major/minor device
@ -577,15 +577,15 @@ message *mess_ptr; /* pointer to message for task */
proc_e = mess_ptr->USER_ENDPT;
r = sendrec(task_nr, mess_ptr);
r = sendrec(driver_e, mess_ptr);
if (r == OK && mess_ptr->REP_STATUS == ERESTART) r = EDEADEPT;
if (r != OK) {
if (r == EDEADSRCDST || r == EDEADEPT) {
printf("VFS: dead driver %d\n", task_nr);
dmap_unmap_by_endpt(task_nr);
printf("VFS: dead driver %d\n", driver_e);
dmap_unmap_by_endpt(driver_e);
return(r);
} else if (r == ELOCKED) {
printf("VFS: ELOCKED talking to %d\n", task_nr);
printf("VFS: ELOCKED talking to %d\n", driver_e);
return(r);
}
panic("call_task: can't send/receive: %d", r);

View file

@ -456,6 +456,7 @@ PRIVATE void free_proc(struct fproc *exiter, int flags)
* dmap table is used in the first step.)
*/
unsuspend_by_endpt(exiter->fp_endpoint);
dmap_unmap_by_endpt(exiter->fp_endpoint);
/* Release root and working directories. */
if (exiter->fp_rd) { put_vnode(exiter->fp_rd); exiter->fp_rd = NULL; }

View file

@ -32,7 +32,7 @@ _PROTOTYPE( int dev_close, (dev_t dev, int filp_no) );
_PROTOTYPE( int dev_io, (int op, dev_t dev, endpoint_t proc_e, void *buf,
u64_t pos, size_t bytes, int flags, int suspend_reopen) );
_PROTOTYPE( int gen_opcl, (int op, dev_t dev, endpoint_t task_nr, int flags));
_PROTOTYPE( int gen_io, (int task_nr, message *mess_ptr) );
_PROTOTYPE( int gen_io, (endpoint_t driver_e, message *mess_ptr) );
_PROTOTYPE( int asyn_io, (int task_nr, message *mess_ptr) );
_PROTOTYPE( int no_dev, (int op, dev_t dev, int proc, int flags) );
_PROTOTYPE( int no_dev_io, (int, message *) );