summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/internal/mdso_driver_impl.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/internal/mdso_driver_impl.h b/src/internal/mdso_driver_impl.h
index c6131b8..f43b790 100644
--- a/src/internal/mdso_driver_impl.h
+++ b/src/internal/mdso_driver_impl.h
@@ -46,4 +46,17 @@ struct mdso_unit_ctx_impl {
struct mdso_unit_ctx uctx;
};
+static inline struct mdso_driver_ctx_impl * mdso_get_driver_ictx(
+ const struct mdso_driver_ctx * dctx)
+{
+ uintptr_t addr;
+
+ if (dctx) {
+ addr = (uintptr_t)dctx - offsetof(struct mdso_driver_ctx_impl,ctx);
+ return (struct mdso_driver_ctx_impl *)addr;
+ }
+
+ return 0;
+}
+
#endif