From a9007d5c41b587d26634c633068f9ec0fbe2dc87 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 23 Oct 2016 22:15:44 -0400 Subject: driver: added initial error info vector and buffer allocation. --- src/driver/mdso_driver_ctx.c | 7 +++++++ src/internal/mdso_driver_impl.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c index a485320..d100c0a 100644 --- a/src/driver/mdso_driver_ctx.c +++ b/src/driver/mdso_driver_ctx.c @@ -78,6 +78,7 @@ static struct mdso_driver_ctx_impl * mdso_driver_ctx_alloc( size_t size; struct argv_entry * entry; const char ** units; + int elements; size = sizeof(struct mdso_driver_ctx_alloc); size += (nunits+1)*sizeof(const char *); @@ -92,9 +93,15 @@ static struct mdso_driver_ctx_impl * mdso_driver_ctx_alloc( if (!entry->fopt) *units++ = entry->arg; + elements = sizeof(ictx->ctx.erribuf) / sizeof(*ictx->ctx.erribuf); + + ictx->ctx.errinfp = &ictx->ctx.erriptr[0]; + ictx->ctx.erricap = &ictx->ctx.erriptr[--elements]; + ictx->meta = meta; ictx->ctx.fdtmpin = -1; ictx->ctx.ctx.units = ictx->units; + ictx->ctx.ctx.errv = ictx->ctx.errinfp; return &ictx->ctx; } diff --git a/src/internal/mdso_driver_impl.h b/src/internal/mdso_driver_impl.h index a697528..c6131b8 100644 --- a/src/internal/mdso_driver_impl.h +++ b/src/internal/mdso_driver_impl.h @@ -32,6 +32,10 @@ struct mdso_driver_ctx_impl { char * asmbase; int fddst; int fdtmpin; + struct mdso_error_info**errinfp; + struct mdso_error_info**erricap; + struct mdso_error_info *erriptr[64]; + struct mdso_error_info erribuf[64]; }; struct mdso_unit_ctx_impl { -- cgit v1.2.3