summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/internal/perk_driver_impl.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/internal/perk_driver_impl.h b/src/internal/perk_driver_impl.h
index 5063fa1..bbd5f44 100644
--- a/src/internal/perk_driver_impl.h
+++ b/src/internal/perk_driver_impl.h
@@ -44,4 +44,18 @@ struct pe_unit_ctx_impl {
struct pe_unit_ctx uctx;
};
+
+static inline struct pe_driver_ctx_impl * pe_get_driver_ictx(
+ const struct pe_driver_ctx * dctx)
+{
+ uintptr_t addr;
+
+ if (dctx) {
+ addr = (uintptr_t)dctx - offsetof(struct pe_driver_ctx_impl,ctx);
+ return (struct pe_driver_ctx_impl *)addr;
+ }
+
+ return 0;
+}
+
#endif