summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ntux_driver_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/ntux_driver_impl.h')
-rw-r--r--src/internal/ntux_driver_impl.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/internal/ntux_driver_impl.h b/src/internal/ntux_driver_impl.h
index 6c635de..38d10cc 100644
--- a/src/internal/ntux_driver_impl.h
+++ b/src/internal/ntux_driver_impl.h
@@ -26,11 +26,39 @@ struct ntux_driver_ctx_impl {
struct ntux_common_ctx cctx;
struct ntux_driver_ctx ctx;
struct __psx_context xctx;
+ const struct ntux_unit_ctx *euctx;
const char * eunit;
struct ntux_error_info ** errinfp;
struct ntux_error_info ** erricap;
struct ntux_error_info * erriptr[64];
struct ntux_error_info erribuf[64];
+ char errsbuf[28];
+ int errcode;
};
+
+static inline struct ntux_driver_ctx_impl * ntux_get_driver_ictx(const struct ntux_driver_ctx * dctx)
+{
+ uintptr_t addr;
+
+ if (dctx) {
+ addr = (uintptr_t)dctx - offsetof(struct ntux_driver_ctx_impl,ctx);
+ return (struct ntux_driver_ctx_impl *)addr;
+ }
+
+ return 0;
+}
+
+static inline void ntux_driver_set_ectx(
+ const struct ntux_driver_ctx * dctx,
+ const struct ntux_unit_ctx * uctx,
+ const char * unit)
+{
+ struct ntux_driver_ctx_impl * ictx;
+
+ ictx = ntux_get_driver_ictx(dctx);
+ ictx->euctx = uctx;
+ ictx->eunit = unit;
+}
+
#endif