Add a moon_version function that returns the full version string
This commit is contained in:
parent
6967fa9117
commit
1c1aa96293
@ -3,3 +3,5 @@
|
|||||||
int __moon_version_major();
|
int __moon_version_major();
|
||||||
int __moon_version_minor();
|
int __moon_version_minor();
|
||||||
const char* __moon_version_suffix();
|
const char* __moon_version_suffix();
|
||||||
|
|
||||||
|
const char* moon_version();
|
@ -1,4 +1,5 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "std/stdio.h"
|
||||||
|
|
||||||
#define STRINGIZE(x) #x
|
#define STRINGIZE(x) #x
|
||||||
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
||||||
@ -29,3 +30,11 @@ const char* __moon_version_suffix()
|
|||||||
return STRINGIZE_VALUE_OF(_MOON_SUFFIX);
|
return STRINGIZE_VALUE_OF(_MOON_SUFFIX);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* moon_version()
|
||||||
|
{
|
||||||
|
static char version[64];
|
||||||
|
snprintf(version, sizeof(version), "%d.%d%s", __moon_version_major(), __moon_version_minor(),
|
||||||
|
__moon_version_suffix()); // FIXME: this string is constant each build and should only be calculated once
|
||||||
|
return version;
|
||||||
|
}
|
@ -32,7 +32,7 @@ extern "C" void _start()
|
|||||||
Init::disable_smp(); // Put all other cores except the bootstrap one in an infinite loop
|
Init::disable_smp(); // Put all other cores except the bootstrap one in an infinite loop
|
||||||
Init::early_init();
|
Init::early_init();
|
||||||
|
|
||||||
kinfoln("Starting Moon %d.%d%s", __moon_version_major(), __moon_version_minor(), __moon_version_suffix());
|
kinfoln("Starting Moon %s", moon_version());
|
||||||
|
|
||||||
CPU::log_cpu_information();
|
CPU::log_cpu_information();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user