From 6d653b3c0f2fd89dcd8a54699315e880c9939b3c Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 6 Jul 2020 10:35:24 +0200 Subject: [PATCH] qemu-usb: use Mutex Issue #3801 --- repos/libports/src/lib/qemu-usb/host.cc | 10 +++++----- repos/libports/src/lib/qemu-usb/qemu_emul.cc | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/repos/libports/src/lib/qemu-usb/host.cc b/repos/libports/src/lib/qemu-usb/host.cc index 887ccb05c..fd0c302bc 100644 --- a/repos/libports/src/lib/qemu-usb/host.cc +++ b/repos/libports/src/lib/qemu-usb/host.cc @@ -24,7 +24,7 @@ using namespace Genode; static bool const verbose_devices = false; static bool const verbose_host = false; static bool const verbose_warnings = false; -Lock _lock; +Mutex _mutex; static void update_ep(USBDevice *); static bool claim_interfaces(USBDevice *dev); @@ -302,7 +302,7 @@ struct Usb_host_device : List::Element void ack_avail() { - Lock::Guard g(_lock); + Mutex::Guard guard(_mutex); /* we are already dead, do nothing */ if (deleted == true) return; @@ -463,7 +463,7 @@ struct Usb_host_device : List::Element void state_change() { - Lock::Guard g(_lock); + Mutex::Guard guard(_mutex); if (usb_raw.plugged()) return; @@ -472,7 +472,7 @@ struct Usb_host_device : List::Element void destroy() { - Lock::Guard g(_lock); + Mutex::Guard guard(_mutex); _release_interfaces(); @@ -905,7 +905,7 @@ struct Usb_devices : List void _devices_update() { - Lock::Guard g(_lock); + Mutex::Guard guard(_mutex); _garbage_collect(); diff --git a/repos/libports/src/lib/qemu-usb/qemu_emul.cc b/repos/libports/src/lib/qemu-usb/qemu_emul.cc index dd5c01b23..09d13ed99 100644 --- a/repos/libports/src/lib/qemu-usb/qemu_emul.cc +++ b/repos/libports/src/lib/qemu-usb/qemu_emul.cc @@ -40,7 +40,7 @@ extern "C" void _type_init_usb_host_register_types(Genode::Entrypoint*, Genode::Env *); extern "C" void _type_init_xhci_register_types(); -extern Genode::Lock _lock; +extern Genode::Mutex _mutex; Qemu::Controller *qemu_controller(); @@ -81,7 +81,7 @@ void Qemu::usb_update_devices() { void Qemu::usb_timer_callback(void (*cb)(void*), void *data) { - Genode::Lock::Guard g(_lock); + Genode::Mutex::Guard guard(_mutex); cb(data); } @@ -545,7 +545,7 @@ struct Controller : public Qemu::Controller int mmio_read(Genode::off_t offset, void *buf, Genode::size_t size) { - Genode::Lock::Guard g(_lock); + Genode::Mutex::Guard guard(_mutex); Mmio &mmio = find_region(offset); Genode::off_t reg = offset - mmio.offset; @@ -571,7 +571,7 @@ struct Controller : public Qemu::Controller int mmio_write(Genode::off_t offset, void const *buf, Genode::size_t size) { - Genode::Lock::Guard g(_lock); + Genode::Mutex::Guard guard(_mutex); Mmio &mmio = find_region(offset); Genode::off_t reg = offset - mmio.offset; void *ptr = Object_pool::p()->xhci_state();