summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2021-03-07 11:27:24 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-03-07 11:27:24 +0100
commit6cae63b470876cc3c5bf9fbe2ff5287d6b2f72ca (patch)
tree146aef9e64ea9131c47b9c50000ec402063c8f1c
parent06ffcd932adfddf0e0dbd11c7a36e841ddfc9fa3 (diff)
libmachdev: pass shutdown handle to shutdown method
* libmachdev/machdev-device_emul.h (struct machdev_device_emulation_ops): Add shutdown method. * libmachdev/ds_routines.c (machdev_device_shutdown): Take dosync_handle handle and pass it to shutdown method. * libmachdev/machdev.h (machdev_device_shutdown): Update prototype. * libmachdev/trivfs_server.c (S_startup_dosync): Pass shutdown handle to machdev_device_shutdown call. * rumpdisk/block-rump.c (rumpdisk_device_shutdown): Take dosync_handle parameter.
-rw-r--r--libmachdev/ds_routines.c4
-rw-r--r--libmachdev/machdev-device_emul.h2
-rw-r--r--libmachdev/machdev.h2
-rw-r--r--libmachdev/trivfs_server.c2
-rw-r--r--rumpdisk/block-rump.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c
index d2b5352e..c2de4b26 100644
--- a/libmachdev/ds_routines.c
+++ b/libmachdev/ds_routines.c
@@ -315,13 +315,13 @@ void machdev_device_init()
}
}
-void machdev_device_shutdown()
+void machdev_device_shutdown(mach_port_t dosync_handle)
{
int i;
for (i = 0; i < num_emul; i++)
{
if (emulation_list[i]->shutdown)
- emulation_list[i]->shutdown();
+ emulation_list[i]->shutdown(dosync_handle);
}
}
diff --git a/libmachdev/machdev-device_emul.h b/libmachdev/machdev-device_emul.h
index edf79b96..7748f37f 100644
--- a/libmachdev/machdev-device_emul.h
+++ b/libmachdev/machdev-device_emul.h
@@ -64,7 +64,7 @@ struct machdev_device_emulation_ops
recnum_t, vm_offset_t, vm_size_t);
io_return_t (*writev_trap) (void *, dev_mode_t,
recnum_t, io_buf_vec_t *, vm_size_t);
- void (*shutdown) (void);
+ void (*shutdown) (mach_port_t);
};
#endif /* _MACHDEV_DEVICE_EMUL_H_ */
diff --git a/libmachdev/machdev.h b/libmachdev/machdev.h
index 41afe36d..8f613b35 100644
--- a/libmachdev/machdev.h
+++ b/libmachdev/machdev.h
@@ -30,7 +30,7 @@
void machdev_register (struct machdev_device_emulation_ops *ops);
void machdev_device_init(void);
-void machdev_device_shutdown(void);
+void machdev_device_shutdown(mach_port_t dosync_handle);
void * machdev_server(void *);
error_t machdev_create_device_port (size_t size, void *result);
int machdev_trivfs_init(mach_port_t bootstrap_resume_task, const char *name, const char *path, mach_port_t *bootstrap);
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c
index d1d3a71d..e3e4045d 100644
--- a/libmachdev/trivfs_server.c
+++ b/libmachdev/trivfs_server.c
@@ -429,7 +429,7 @@ S_startup_dosync (mach_port_t handle)
ports_port_deref (inpi);
/* Sync and close device(s) */
- machdev_device_shutdown ();
+ machdev_device_shutdown (handle);
return trivfs_goaway (NULL, FSYS_GOAWAY_FORCE);
}
diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c
index 3ee0773d..9c6fa10c 100644
--- a/rumpdisk/block-rump.c
+++ b/rumpdisk/block-rump.c
@@ -193,7 +193,7 @@ rumpdisk_device_dealloc (void *d)
}
static void
-rumpdisk_device_shutdown (void)
+rumpdisk_device_shutdown (mach_port_t dosync_handle)
{
struct block_data *bd = block_head;