Cleanup system-revision stuff.

* move system_revision.h to headers/private/libroot
* unify libroot's get_system_revision() (the one I introduced recently) with kernel's
  get_haiku_revision(), the function is now called get_haiku_revision() in the kernel
  and __get_haiku_revision() in libroot
* system_revision.c is now being built as part of libroot and as part of the kernel
* adjusted all callers of get_system_revision() accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41516 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2011-05-15 16:33:30 +00:00
parent cfd233613f
commit 22a7fe9695
7 changed files with 19 additions and 22 deletions
@@ -2,8 +2,8 @@
* Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYSTEM_SYSTEM_REVISION_H
#define _SYSTEM_SYSTEM_REVISION_H
#ifndef _LIBROOT_SYSTEM_REVISION_H
#define _LIBROOT_SYSTEM_REVISION_H
/** The length of the system revision character array symbol living in libroot
@@ -17,7 +17,11 @@ extern "C" {
/** returns the system revision */
const char* get_system_revision();
#ifdef _KERNEL_MODE
const char* get_haiku_revision(void);
#else
const char* __get_haiku_revision(void);
#endif
#ifdef __cplusplus
@@ -25,4 +29,4 @@ const char* get_system_revision();
#endif
#endif /* _SYSTEM_SYSTEM_REVISION_H */
#endif /* _LIBROOT_SYSTEM_REVISION_H */
+1 -1
View File
@@ -542,7 +542,7 @@ AboutView::AboutView()
}
// Add system revision
const char* haikuRevision = get_system_revision();
const char* haikuRevision = __get_haiku_revision();
if (haikuRevision != NULL) {
strlcat(string, " (", sizeof(string));
strlcat(string, B_TRANSLATE("Revision"), sizeof(string));
+1 -1
View File
@@ -1,6 +1,6 @@
SubDir HAIKU_TOP src apps aboutsystem ;
UsePrivateHeaders app shared system ;
UsePrivateHeaders app libroot shared ;
Application AboutSystem :
AboutSystem.cpp
+2
View File
@@ -9,6 +9,7 @@ KernelMergeObject kernel_os_main.o :
driver_settings.cpp
find_directory.cpp
fs_info.c
system_revision.c
wait_for_objects.cpp
: $(TARGET_KERNEL_PIC_CCFLAGS)
;
@@ -17,6 +18,7 @@ SEARCH on [ FGristFiles
driver_settings.cpp
find_directory.cpp
fs_info.c
system_revision.c
wait_for_objects.cpp
] = [ FDirName $(HAIKU_TOP) src system libroot os ] ;
+1 -14
View File
@@ -43,18 +43,12 @@ const static int64 kKernelVersion = 0x1;
const static char *kKernelName = "kernel_" HAIKU_ARCH;
// Haiku SVN revision. Will be set when copying the kernel to the image.
// Lives in a separate section so that it can easily be found.
static char sHaikuRevision[SYSTEM_REVISION_LENGTH]
__attribute__((section("_haiku_revision")));
static int
dump_info(int argc, char **argv)
{
kprintf("kernel build: %s %s (gcc%d %s)\n", __DATE__, __TIME__, __GNUC__,
__VERSION__);
kprintf("revision: %s\n\n", sHaikuRevision);
kprintf("revision: %s\n\n", get_haiku_revision());
kprintf("cpu count: %ld, active times:\n", smp_get_num_cpus());
@@ -468,13 +462,6 @@ system_notifications_init()
}
const char*
get_haiku_revision(void)
{
return sHaikuRevision;
}
// #pragma mark -
+5 -1
View File
@@ -14,7 +14,11 @@ static char sHaikuRevision[SYSTEM_REVISION_LENGTH]
const char*
get_system_revision()
#ifdef _KERNEL_MODE
get_haiku_revision(void)
#else
__get_haiku_revision(void)
#endif
{
return sHaikuRevision;
}
+1 -1
View File
@@ -32,7 +32,7 @@ uname(struct utsname *info)
strlcpy(info->sysname, "Haiku", sizeof(info->sysname));
haikuRevision = get_system_revision();
haikuRevision = __get_haiku_revision();
if (haikuRevision[0] != '\0')
snprintf(info->version, sizeof(info->version), "%s ", haikuRevision);
else