1.1 --- a/libnotifier/lib/src/notifier.cc Wed Mar 22 17:31:05 2023 +0100
1.2 +++ b/libnotifier/lib/src/notifier.cc Wed Mar 22 18:05:48 2023 +0100
1.3 @@ -22,6 +22,8 @@
1.4 #include <map>
1.5 #include <mutex>
1.6
1.7 +#include <l4/sys/irq.h>
1.8 +
1.9 #include <ipc/cap_alloc.h>
1.10 #include <ipc/server.h>
1.11 #include <resource/resource_server.h>
1.12 @@ -81,12 +83,19 @@
1.13
1.14 ObjectNotifier::~ObjectNotifier()
1.15 {
1.16 + stop();
1.17 +
1.18 ServerConfigs::iterator it;
1.19
1.20 for (it = _configs.begin(); it != _configs.end(); it++)
1.21 delete *it;
1.22
1.23 _configs.clear();
1.24 +
1.25 + /* Handle deletion of the special task notifier. */
1.26 +
1.27 + if (this == _notifier)
1.28 + _notifier = NULL;
1.29 }
1.30
1.31
1.32 @@ -111,11 +120,28 @@
1.33 _configs.push_back(server.config());
1.34 _started = true;
1.35
1.36 + /* Retain the IRQ created for the server for control purposes. */
1.37 +
1.38 + _irq = server.config()->irq;
1.39 +
1.40 return L4_EOK;
1.41 }
1.42
1.43
1.44
1.45 +/* Stop the notifier. */
1.46 +
1.47 +void ObjectNotifier::stop()
1.48 +{
1.49 + if (l4_is_valid_cap(_irq))
1.50 + {
1.51 + l4_irq_trigger(_irq);
1.52 + _irq = L4_INVALID_CAP;
1.53 + }
1.54 +}
1.55 +
1.56 +
1.57 +
1.58 /* Return notification state for the given object or null state if no record
1.59 existed for the object. */
1.60