lib, eshi: add evl_get_version()
Returns version information about the running EVL interface including the API and kernel ABI levels. A negative ABI level denotes the EVL shim layer (eshi).
This commit is contained in:
parent
cba6a9958b
commit
154e577193
|
@ -43,3 +43,11 @@ bool eshi_is_initialized(void)
|
||||||
{
|
{
|
||||||
return init_status == 0;
|
return init_status == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct evl_version evl_get_version(void)
|
||||||
|
{
|
||||||
|
return (struct evl_version){
|
||||||
|
.api_level = __EVL__,
|
||||||
|
.abi_level = -1,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -9,7 +9,12 @@
|
||||||
|
|
||||||
#include <evl/syscall.h>
|
#include <evl/syscall.h>
|
||||||
|
|
||||||
#define __EVL__ 5 /* API revision */
|
#define __EVL__ 6 /* API version */
|
||||||
|
|
||||||
|
struct evl_version {
|
||||||
|
int api_level; /* libevl.so: __EVL__ */
|
||||||
|
int abi_level; /* core: EVL_ABI_LEVEL, -1 for ESHI */
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -17,6 +22,8 @@ extern "C" {
|
||||||
|
|
||||||
int evl_init(void);
|
int evl_init(void);
|
||||||
|
|
||||||
|
struct evl_version evl_get_version(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,7 +20,12 @@
|
||||||
#include <evl/poll.h>
|
#include <evl/poll.h>
|
||||||
#include <evl/proxy.h>
|
#include <evl/proxy.h>
|
||||||
|
|
||||||
#define __EVL__ 6 /* API revision */
|
#define __EVL__ 7 /* API version */
|
||||||
|
|
||||||
|
struct evl_version {
|
||||||
|
int api_level; /* libevl.so: __EVL__ */
|
||||||
|
int abi_level; /* core: EVL_ABI_LEVEL, -1 for ESHI */
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -36,6 +41,8 @@ unsigned int evl_detect_fpu(void);
|
||||||
|
|
||||||
extern const char *libevl_version_string;
|
extern const char *libevl_version_string;
|
||||||
|
|
||||||
|
struct evl_version evl_get_version(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -251,3 +251,11 @@ unsigned int evl_detect_fpu(void)
|
||||||
|
|
||||||
return core_info.fpu_features;
|
return core_info.fpu_features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct evl_version evl_get_version(void)
|
||||||
|
{
|
||||||
|
return (struct evl_version){
|
||||||
|
.api_level = __EVL__,
|
||||||
|
.abi_level = EVL_ABI_LEVEL,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ static void usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: evl [options] <command> [<args>]\n");
|
fprintf(stderr, "usage: evl [options] <command> [<args>]\n");
|
||||||
fprintf(stderr, "-P --prefix=<path> set command path prefix\n");
|
fprintf(stderr, "-P --prefix=<path> set command path prefix\n");
|
||||||
fprintf(stderr, "-V --version print version and required ABI revision\n");
|
fprintf(stderr, "-V --version print library and required ABI versions\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#define short_optlist "+P:V"
|
#define short_optlist "+P:V"
|
||||||
|
|
Loading…
Reference in New Issue