2002-07-09 16:24:59 +04:00
|
|
|
/*
|
2005-01-20 20:52:06 +03:00
|
|
|
* Copyright 2005, Haiku Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT license.
|
2008-09-03 18:47:26 +04:00
|
|
|
*
|
2005-01-20 20:52:06 +03:00
|
|
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _KERNEL_ELF_H
|
|
|
|
#define _KERNEL_ELF_H
|
|
|
|
|
2003-10-17 18:42:45 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <thread.h>
|
2003-01-13 19:36:25 +03:00
|
|
|
#include <image.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-09-24 18:40:24 +04:00
|
|
|
|
2005-01-20 20:52:06 +03:00
|
|
|
struct kernel_args;
|
|
|
|
|
2003-10-17 18:42:45 +04:00
|
|
|
|
2011-06-12 04:00:23 +04:00
|
|
|
struct elf_symbol_info {
|
|
|
|
addr_t address;
|
|
|
|
size_t size;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-10-17 18:42:45 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-01-11 00:54:38 +03:00
|
|
|
status_t elf_load_user_image(const char *path, Team *team, int flags,
|
|
|
|
addr_t *_entry);
|
2004-05-11 23:54:10 +04:00
|
|
|
|
|
|
|
// these two might get public one day:
|
|
|
|
image_id load_kernel_add_on(const char *path);
|
|
|
|
status_t unload_kernel_add_on(image_id id);
|
|
|
|
|
2005-08-23 00:35:42 +04:00
|
|
|
status_t elf_debug_lookup_symbol_address(addr_t address, addr_t *_baseAddress,
|
2008-01-19 19:33:03 +03:00
|
|
|
const char **_symbolName, const char **_imageName,
|
|
|
|
bool *_exactMatch);
|
2011-01-11 00:54:38 +03:00
|
|
|
status_t elf_debug_lookup_user_symbol_address(Team* team, addr_t address,
|
2008-01-19 19:33:03 +03:00
|
|
|
addr_t *_baseAddress, const char **_symbolName,
|
|
|
|
const char **_imageName, bool *_exactMatch);
|
2009-10-22 15:44:29 +04:00
|
|
|
addr_t elf_debug_lookup_symbol(const char* searchName);
|
2011-06-12 04:00:23 +04:00
|
|
|
status_t elf_lookup_kernel_symbol(const char* name, elf_symbol_info* info);
|
2009-04-08 20:47:45 +04:00
|
|
|
struct elf_image_info* elf_get_kernel_image();
|
2008-09-03 18:47:26 +04:00
|
|
|
status_t elf_get_image_info_for_address(addr_t address, image_info* info);
|
2008-09-24 18:40:24 +04:00
|
|
|
image_id elf_create_memory_image(const char* imageName, addr_t text,
|
|
|
|
size_t textSize, addr_t data, size_t dataSize);
|
|
|
|
status_t elf_add_memory_image_symbol(image_id id, const char* name,
|
|
|
|
addr_t address, size_t size, int32 type);
|
2005-01-20 20:52:06 +03:00
|
|
|
status_t elf_init(struct kernel_args *args);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-09-22 15:13:38 +04:00
|
|
|
status_t _user_read_kernel_image_symbols(image_id id,
|
|
|
|
struct Elf32_Sym* symbolTable, int32* _symbolCount,
|
|
|
|
char* stringTable, size_t* _stringTableSize, addr_t* _imageDelta);
|
|
|
|
|
2003-10-17 18:42:45 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-08-14 01:42:53 +04:00
|
|
|
#endif /* _KERNEL_ELF_H */
|