summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/internal/sofort_driver_impl.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/internal/sofort_driver_impl.h b/src/internal/sofort_driver_impl.h
index 0808b55..4fdcf96 100644
--- a/src/internal/sofort_driver_impl.h
+++ b/src/internal/sofort_driver_impl.h
@@ -35,4 +35,17 @@ struct sfrt_unit_ctx_impl {
struct sfrt_unit_ctx uctx;
};
+static inline struct sfrt_driver_ctx_impl * sfrt_get_driver_ictx(
+ const struct sfrt_driver_ctx * dctx)
+{
+ uintptr_t addr;
+
+ if (dctx) {
+ addr = (uintptr_t)dctx - offsetof(struct sfrt_driver_ctx_impl,ctx);
+ return (struct sfrt_driver_ctx_impl *)addr;
+ }
+
+ return 0;
+}
+
#endif