From 19d40f9eb7dc8efdbbd637b21ceb83b9af3389df Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 2 Nov 2008 03:43:01 +0000 Subject: [PATCH] Moved the rld_export structure from to , since it isn't a kernel <-> userland interface. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28456 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../private/runtime_loader/runtime_loader.h | 33 +++++++++++++++++++ headers/private/system/user_runtime.h | 23 ------------- src/system/libroot/Jamfile | 4 +-- src/system/libroot/libroot_init.c | 8 ++--- src/system/libroot/os/Jamfile | 2 +- src/system/libroot/os/image.cpp | 3 +- src/system/libroot/posix/Jamfile | 2 +- src/system/libroot/posix/dlfcn.c | 4 ++- src/system/libroot/posix/stdlib/Jamfile | 2 +- src/system/libroot/posix/stdlib/env.cpp | 1 + src/system/libroot/posix/stdlib/exit.c | 2 +- src/system/libroot/posix/unistd/Jamfile | 2 +- src/system/libroot/posix/unistd/fork.c | 2 +- 13 files changed, 51 insertions(+), 37 deletions(-) diff --git a/headers/private/runtime_loader/runtime_loader.h b/headers/private/runtime_loader/runtime_loader.h index 4366a889d3..789c243246 100644 --- a/headers/private/runtime_loader/runtime_loader.h +++ b/headers/private/runtime_loader/runtime_loader.h @@ -15,6 +15,39 @@ #include + +// #pragma mark - runtime loader libroot interface + + +struct user_space_program_args; + +struct rld_export { + // runtime loader API export + image_id (*load_add_on)(char const *path, uint32 flags); + status_t (*unload_add_on)(image_id imageID); + status_t (*get_image_symbol)(image_id imageID, char const *symbolName, + int32 symbolType, void **_location); + status_t (*get_nth_image_symbol)(image_id imageID, int32 num, char *symbolName, + int32 *nameLength, int32 *symbolType, void **_location); + status_t (*test_executable)(const char *path, char *interpreter); + status_t (*get_next_image_dependency)(image_id id, uint32 *cookie, + const char **_name); + + status_t (*reinit_after_fork)(); + + void (*call_atexit_hooks_for_range)(addr_t start, addr_t size); + + void (*call_termination_hooks)(); + + const struct user_space_program_args *program_args; +}; + +extern struct rld_export *__gRuntimeLoader; + + +// #pragma mark - runtime loader debugger interface + + typedef struct elf_region_t { area_id id; addr_t start; diff --git a/headers/private/system/user_runtime.h b/headers/private/system/user_runtime.h index e06229b538..4600836e22 100644 --- a/headers/private/system/user_runtime.h +++ b/headers/private/system/user_runtime.h @@ -30,27 +30,4 @@ struct user_space_program_args { char **env; }; -struct rld_export { - // runtime linker API export - image_id (*load_add_on)(char const *path, uint32 flags); - status_t (*unload_add_on)(image_id imageID); - status_t (*get_image_symbol)(image_id imageID, char const *symbolName, - int32 symbolType, void **_location); - status_t (*get_nth_image_symbol)(image_id imageID, int32 num, char *symbolName, - int32 *nameLength, int32 *symbolType, void **_location); - status_t (*test_executable)(const char *path, char *interpreter); - status_t (*get_next_image_dependency)(image_id id, uint32 *cookie, - const char **_name); - - status_t (*reinit_after_fork)(); - - void (*call_atexit_hooks_for_range)(addr_t start, addr_t size); - - void (*call_termination_hooks)(); - - const struct user_space_program_args *program_args; -}; - -extern struct rld_export *__gRuntimeLoader; - #endif /* KERNEL_USER_RUNTIME_H_ */ diff --git a/src/system/libroot/Jamfile b/src/system/libroot/Jamfile index 66a3ee4033..c6361aa4a5 100644 --- a/src/system/libroot/Jamfile +++ b/src/system/libroot/Jamfile @@ -1,13 +1,13 @@ SubDir HAIKU_TOP src system libroot ; -UsePrivateHeaders libroot ; +UsePrivateHeaders libroot runtime_loader ; UsePrivateSystemHeaders ; UnarchiveObjects $(TARGET_GCC_LIBGCC_OBJECTS) : $(TARGET_GCC_LIBGCC) ; # we need to link against libgcc.a objects and make # it available to other applications as in BeOS -local librootObjects = +local librootObjects = os_main.o os_arch_$(TARGET_ARCH).o diff --git a/src/system/libroot/libroot_init.c b/src/system/libroot/libroot_init.c index 146f8eeea8..20faa1fdd9 100644 --- a/src/system/libroot/libroot_init.c +++ b/src/system/libroot/libroot_init.c @@ -3,13 +3,13 @@ * Distributed under the terms of the MIT License. */ +#include -#include -#include #include #include - -#include +#include +#include +#include void initialize_before(image_id imageID); diff --git a/src/system/libroot/os/Jamfile b/src/system/libroot/os/Jamfile index 0ad2b7bfab..bb4c369f55 100644 --- a/src/system/libroot/os/Jamfile +++ b/src/system/libroot/os/Jamfile @@ -3,7 +3,7 @@ SubDir HAIKU_TOP src system libroot os ; UsePrivateSystemHeaders ; UsePrivateHeaders kernel ; # for util/KMessage.h -UsePrivateHeaders libroot ; +UsePrivateHeaders libroot runtime_loader ; MergeObject os_main.o : area.c diff --git a/src/system/libroot/os/image.cpp b/src/system/libroot/os/image.cpp index dc355bccab..e7837a5b72 100644 --- a/src/system/libroot/os/image.cpp +++ b/src/system/libroot/os/image.cpp @@ -5,8 +5,9 @@ #include -#include +#include #include +#include #include #include diff --git a/src/system/libroot/posix/Jamfile b/src/system/libroot/posix/Jamfile index a30fc4d0f6..dd2083229a 100644 --- a/src/system/libroot/posix/Jamfile +++ b/src/system/libroot/posix/Jamfile @@ -4,7 +4,7 @@ UsePrivateHeaders app shared [ FDirName syslog_daemon ] ; UsePrivateSystemHeaders ; UsePrivateHeaders kernel ; # For util/KMessage.h -UsePrivateHeaders libroot ; +UsePrivateHeaders libroot runtime_loader ; if $(HAIKU_MULTIUSER_QUERY) = 1 { PWD_BACKEND = pwd_query.c ; diff --git a/src/system/libroot/posix/dlfcn.c b/src/system/libroot/posix/dlfcn.c index c28fbf91cc..d0cb53f3d6 100644 --- a/src/system/libroot/posix/dlfcn.c +++ b/src/system/libroot/posix/dlfcn.c @@ -8,11 +8,13 @@ #include -#include #include #include +#include +#include + static status_t sStatus; // Note, this is not thread-safe diff --git a/src/system/libroot/posix/stdlib/Jamfile b/src/system/libroot/posix/stdlib/Jamfile index 149bbb2fa3..0e98d2911b 100644 --- a/src/system/libroot/posix/stdlib/Jamfile +++ b/src/system/libroot/posix/stdlib/Jamfile @@ -1,6 +1,6 @@ SubDir HAIKU_TOP src system libroot posix stdlib ; -UsePrivateHeaders drivers libroot ; +UsePrivateHeaders drivers libroot runtime_loader ; UsePrivateSystemHeaders ; MergeObject posix_stdlib.o : diff --git a/src/system/libroot/posix/stdlib/env.cpp b/src/system/libroot/posix/stdlib/env.cpp index ac6f4bdc80..e4cca9fac7 100644 --- a/src/system/libroot/posix/stdlib/env.cpp +++ b/src/system/libroot/posix/stdlib/env.cpp @@ -13,6 +13,7 @@ #include #include +#include #include diff --git a/src/system/libroot/posix/stdlib/exit.c b/src/system/libroot/posix/stdlib/exit.c index b9920d9d91..dbe699c522 100644 --- a/src/system/libroot/posix/stdlib/exit.c +++ b/src/system/libroot/posix/stdlib/exit.c @@ -15,8 +15,8 @@ #include #include +#include #include -#include extern void _IO_cleanup(void); diff --git a/src/system/libroot/posix/unistd/Jamfile b/src/system/libroot/posix/unistd/Jamfile index aa98b1f210..d615e54b64 100644 --- a/src/system/libroot/posix/unistd/Jamfile +++ b/src/system/libroot/posix/unistd/Jamfile @@ -1,7 +1,7 @@ SubDir HAIKU_TOP src system libroot posix unistd ; UsePrivateSystemHeaders ; -UsePrivateHeaders libroot ; +UsePrivateHeaders libroot runtime_loader ; MergeObject posix_unistd.o : access.c diff --git a/src/system/libroot/posix/unistd/fork.c b/src/system/libroot/posix/unistd/fork.c index 609dd0b1cb..375f3bb4e6 100644 --- a/src/system/libroot/posix/unistd/fork.c +++ b/src/system/libroot/posix/unistd/fork.c @@ -11,8 +11,8 @@ #include #include +#include #include -#include typedef struct fork_hook {