summaryrefslogtreecommitdiff
path: root/ext/nomali/lib/nomali_api.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ext/nomali/lib/nomali_api.cc')
-rw-r--r--ext/nomali/lib/nomali_api.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/nomali/lib/nomali_api.cc b/ext/nomali/lib/nomali_api.cc
index 46f0e7fce..bd556f3c9 100644
--- a/ext/nomali/lib/nomali_api.cc
+++ b/ext/nomali/lib/nomali_api.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2015 ARM Limited
+ * Copyright (c) 2014-2016 ARM Limited
* All rights reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -59,6 +59,7 @@ class NoMaliApi
public:
void callbackInt(nomali_int_t intno, int set);
+ void callbackReset();
private:
nomali_callback_t callbacks[NOMALI_CALLBACK_NUM_CALLBACKS];
@@ -76,7 +77,12 @@ class NoMaliApiGpu
: BaseGpu(std::forward<Args>(args)...),
api(_api)
{
+ reset();
+ }
+
+ void reset() override {
BaseGpu::reset();
+ api.callbackReset();
}
public:
@@ -205,6 +211,15 @@ NoMaliApi::callbackInt(nomali_int_t intno, int set)
c.func.interrupt(static_cast<nomali_handle_t>(this), c.usr, intno, set);
}
+void
+NoMaliApi::callbackReset()
+{
+ const nomali_callback_t &c(callbacks[NOMALI_CALLBACK_RESET]);
+
+ if (c.func.reset)
+ c.func.reset(static_cast<nomali_handle_t>(this), c.usr);
+}
+
static NoMaliApi *