[haiku-commits] haiku: hrev53477 - src/system/runtime_loader src/system/libroot headers/private/libroot

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 13 Sep 2019 09:38:12 -0400 (EDT)

hrev53477 adds 1 changeset to branch 'master'
old head: b05def659e187261d984c6e65b503baf812ae3a9
new head: be06cb25e905e1a130746668018fdde58e3305f3
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=be06cb25e905+%5Eb05def659e18

----------------------------------------------------------------------------

be06cb25e905: libroot: make API version available.
  
  Change-Id: I370d5c8e9b4f076e7f115ca6c87bc7f943d36c17
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/1850
  Reviewed-by: Rene Gollent <rene@xxxxxxxxxxx>

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53477
Commit:      be06cb25e905e1a130746668018fdde58e3305f3
URL:         https://git.haiku-os.org/haiku/commit/?id=be06cb25e905
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Wed Sep 11 18:49:32 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Fri Sep 13 13:38:08 2019 UTC

----------------------------------------------------------------------------

6 files changed, 13 insertions(+), 4 deletions(-)
headers/private/libroot/libroot_private.h          | 1 +
headers/private/runtime_loader/runtime_loader.h    | 1 +
src/system/libroot/libroot_init.c                  | 2 ++
src/system/runtime_loader/elf_load_image.cpp       | 2 +-
src/system/runtime_loader/export.cpp               | 9 +++++++--
src/system/runtime_loader/runtime_loader_private.h | 2 +-

----------------------------------------------------------------------------

diff --git a/headers/private/libroot/libroot_private.h 
b/headers/private/libroot/libroot_private.h
index 1126704be6..a54e7d2b30 100644
--- a/headers/private/libroot/libroot_private.h
+++ b/headers/private/libroot/libroot_private.h
@@ -19,6 +19,7 @@ extern "C" {
 #endif
 
 extern int __gABIVersion;
+extern int __gAPIVersion;
 
 extern char _single_threaded;
        /* This determines if a process runs single threaded or not */
diff --git a/headers/private/runtime_loader/runtime_loader.h 
b/headers/private/runtime_loader/runtime_loader.h
index 94be94cbf4..96f91dec0a 100644
--- a/headers/private/runtime_loader/runtime_loader.h
+++ b/headers/private/runtime_loader/runtime_loader.h
@@ -57,6 +57,7 @@ struct rld_export {
        const struct user_space_program_args *program_args;
        const void* commpage_address;
        int abi_version;
+       int api_version;
 };
 
 extern struct rld_export *__gRuntimeLoader;
diff --git a/src/system/libroot/libroot_init.c 
b/src/system/libroot/libroot_init.c
index 6da22d4bbd..3dfe64ee6a 100644
--- a/src/system/libroot/libroot_init.c
+++ b/src/system/libroot/libroot_init.c
@@ -30,6 +30,7 @@ int __libc_argc;
 char **__libc_argv;
 
 int __gABIVersion;
+int __gAPIVersion;
 int32 __gCPUCount;
 
 char _single_threaded = true;
@@ -51,6 +52,7 @@ initialize_before(image_id imageID)
        char *programPath = __gRuntimeLoader->program_args->args[0];
        __gCommPageAddress = __gRuntimeLoader->commpage_address;
        __gABIVersion = __gRuntimeLoader->abi_version;
+       __gAPIVersion = __gRuntimeLoader->api_version;
 
        if (programPath) {
                if ((__progname = strrchr(programPath, '/')) == NULL)
diff --git a/src/system/runtime_loader/elf_load_image.cpp 
b/src/system/runtime_loader/elf_load_image.cpp
index fc0267ed26..2e90e15ef2 100644
--- a/src/system/runtime_loader/elf_load_image.cpp
+++ b/src/system/runtime_loader/elf_load_image.cpp
@@ -641,7 +641,7 @@ load_image(char const* name, image_type type, const char* 
rpath,
                #endif
        }
 
-       set_abi_version(image->abi);
+       set_abi_api_version(image->abi, image->api_version);
 
        // init gcc version dependent image flags
        // symbol resolution strategy
diff --git a/src/system/runtime_loader/export.cpp 
b/src/system/runtime_loader/export.cpp
index 2922b7d77d..493ef5d5c5 100644
--- a/src/system/runtime_loader/export.cpp
+++ b/src/system/runtime_loader/export.cpp
@@ -93,13 +93,18 @@ rldexport_init(void)
 
 
 /*!    Is called for all images, and sets the minimum ABI version found to the
-       gRuntimeLoader.abi_version field.
+       gRuntimeLoader.abi_version field and the minimum API version found to 
the
+       gRuntimeLoader.api_version field.
 */
 void
-set_abi_version(int abi_version)
+set_abi_api_version(int abi_version, int api_version)
 {
        if (gRuntimeLoader.abi_version == 0
                || gRuntimeLoader.abi_version > abi_version) {
                gRuntimeLoader.abi_version = abi_version;
        }
+       if (gRuntimeLoader.api_version == 0
+               || gRuntimeLoader.api_version > api_version) {
+               gRuntimeLoader.api_version = api_version;
+       }
 }
diff --git a/src/system/runtime_loader/runtime_loader_private.h 
b/src/system/runtime_loader/runtime_loader_private.h
index e2886285e0..816fc39006 100644
--- a/src/system/runtime_loader/runtime_loader_private.h
+++ b/src/system/runtime_loader/runtime_loader_private.h
@@ -99,7 +99,7 @@ status_t elf64_verify_header(void *header, size_t length);
 #endif // _COMPAT_MODE
 void rldelf_init(void);
 void rldexport_init(void);
-void set_abi_version(int abi_version);
+void set_abi_api_version(int abi_version, int api_version);
 status_t elf_reinit_after_fork();
 
 status_t heap_init();


Other related posts:

  • » [haiku-commits] haiku: hrev53477 - src/system/runtime_loader src/system/libroot headers/private/libroot - waddlesplash