From 26498daf70041bc96f4dd1817f82d8bee3a30067 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 25 Apr 2016 09:13:24 -0400 Subject: driver: added struct mdso_source_version, mdso_source_version(). --- Makefile.in | 4 ++-- include/mdso/mdso.h | 10 ++++++++++ src/driver/mdso_driver_ctx.c | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 0957e32..d8ae066 100644 --- a/Makefile.in +++ b/Makefile.in @@ -86,10 +86,10 @@ include $(PROJECT_DIR)/project/overrides.mk $(APP_SRCS:%.c=%.o): version.tag $(APP_SRCS:%.c=%.o): CFLAGS_STATIC = $(CFLAGS_APP) -src/%.lo: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag +src/%.lo: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag version.tag $(CC) -c -o $@ $< $(CFLAGS_SHARED) -src/%.o: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag +src/%.o: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag version.tag $(CC) -c -o $@ $< $(CFLAGS_STATIC) lib/%$(OS_LIB_SUFFIX)$(VER_XYZ): diff --git a/include/mdso/mdso.h b/include/mdso/mdso.h index 6dea3dc..52a5e21 100644 --- a/include/mdso/mdso.h +++ b/include/mdso/mdso.h @@ -39,6 +39,13 @@ extern "C" { /* unit action flags */ +struct mdso_source_version { + int major; + int minor; + int revision; + const char * commit; +}; + struct mdso_input { void * addr; size_t size; @@ -74,6 +81,9 @@ struct mdso_unit_ctx { int nerrors; }; +/* package info */ +mdso_api const struct mdso_source_version * mdso_source_version(void); + /* driver api */ mdso_api int mdso_get_driver_ctx (char ** argv, char ** envp, uint32_t flags, struct mdso_driver_ctx **); mdso_api int mdso_create_driver_ctx (const struct mdso_common_ctx *, struct mdso_driver_ctx **); diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c index d3b00cf..65d4ba2 100644 --- a/src/driver/mdso_driver_ctx.c +++ b/src/driver/mdso_driver_ctx.c @@ -16,9 +16,18 @@ #include #include #include +#include "mdso_version.h" #include "mdso_driver_impl.h" #include "argv/argv.h" +/* package info */ +static const struct mdso_source_version mdso_src_version = { + MDSO_TAG_VER_MAJOR, + MDSO_TAG_VER_MINOR, + MDSO_TAG_VER_PATCH, + MDSO_GIT_VERSION +}; + struct mdso_driver_ctx_alloc { struct argv_meta * meta; struct mdso_driver_ctx_impl ctx; @@ -289,3 +298,8 @@ void mdso_free_driver_ctx(struct mdso_driver_ctx * ctx) mdso_free_driver_ctx_impl(ictx); } } + +const struct mdso_source_version * mdso_source_version(void) +{ + return &mdso_src_version; +} -- cgit v1.2.3