1 /* 2 * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT License. 4 * 5 * Copyright 2002, Manuel J. Petit. All rights reserved. 6 * Distributed under the terms of the NewOS License. 7 */ 8 #ifndef RUNTIME_LOADER_H 9 #define RUNTIME_LOADER_H 10 11 12 #include <user_runtime.h> 13 #include <runtime_loader.h> 14 15 16 extern struct uspace_program_args *gProgramArgs; 17 extern struct rld_export gRuntimeLoader; 18 extern char *(*gGetEnv)(const char *name); 19 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 int runtime_loader(void *arg); 26 int open_executable(char *name, image_type type, const char *rpath); 27 status_t test_executable(const char *path, uid_t user, gid_t group, char *starter); 28 29 void terminate_program(void); 30 image_id load_program(char const *path, void **entry); 31 status_t unload_library(image_id imageID, bool addOn); 32 image_id load_library(char const *path, uint32 flags, bool addOn); 33 status_t get_nth_symbol(image_id imageID, int32 num, char *nameBuffer, int32 *_nameLength, 34 int32 *_type, void **_location); 35 status_t get_symbol(image_id imageID, char const *symbolName, int32 symbolType, 36 void **_location); 37 int resolve_symbol(image_t *image, struct Elf32_Sym *sym, addr_t *sym_addr); 38 39 40 status_t elf_verify_header(void *header, int32 length); 41 void rldelf_init(void); 42 void rldexport_init(void); 43 44 // RLD heap 45 void rldheap_init(void); 46 void *rldalloc(size_t); 47 void rldfree(void *p); 48 49 // arch dependent prototypes 50 status_t arch_relocate_image(image_t *image); 51 void arch_call_init(image_t *image); 52 void arch_call_term(image_t *image); 53 54 #ifdef __cplusplus 55 } 56 #endif 57 58 #endif /* RUNTIME_LOADER_H */ 59