2003-01-12 18:59:12 +03:00
|
|
|
/*
|
2005-11-04 20:25:58 +03:00
|
|
|
* Copyright 2003-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2003-01-12 18:59:12 +03:00
|
|
|
#ifndef _KERNEL_IMAGE_H
|
|
|
|
#define _KERNEL_IMAGE_H
|
|
|
|
|
|
|
|
#include <image.h>
|
|
|
|
|
|
|
|
|
2009-04-12 01:45:25 +04:00
|
|
|
struct image;
|
2003-01-12 18:59:12 +03:00
|
|
|
struct team;
|
|
|
|
|
2009-04-12 01:45:25 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
|
|
#include <util/OpenHashTable.h>
|
|
|
|
|
|
|
|
struct image {
|
|
|
|
struct image* next;
|
|
|
|
struct image* prev;
|
2009-07-27 04:39:12 +04:00
|
|
|
struct image* hash_link;
|
2009-04-12 01:45:25 +04:00
|
|
|
image_info info;
|
|
|
|
team_id team;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __cplusplus
|
|
|
|
|
|
|
|
// image notifications
|
|
|
|
#define IMAGE_MONITOR '_Im_'
|
|
|
|
#define IMAGE_ADDED 0x01
|
|
|
|
#define IMAGE_REMOVED 0x02
|
|
|
|
|
|
|
|
|
2005-11-04 20:25:58 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-05-11 19:04:36 +04:00
|
|
|
extern image_id register_image(struct team *team, image_info *info, size_t size);
|
|
|
|
extern status_t unregister_image(struct team *team, image_id id);
|
2003-01-12 18:59:12 +03:00
|
|
|
extern int32 count_images(struct team *team);
|
|
|
|
extern status_t remove_images(struct team *team);
|
2005-11-04 20:25:58 +03:00
|
|
|
|
2009-04-12 01:45:25 +04:00
|
|
|
typedef bool (*image_iterator_callback)(struct image* image, void* cookie);
|
|
|
|
struct image* image_iterate_through_images(image_iterator_callback callback,
|
|
|
|
void* cookie);
|
|
|
|
|
2005-11-04 20:25:58 +03:00
|
|
|
extern status_t image_debug_lookup_user_symbol_address(struct team *team,
|
|
|
|
addr_t address, addr_t *_baseAddress, const char **_symbolName,
|
|
|
|
const char **_imageName, bool *_exactMatch);
|
2004-05-11 19:04:36 +04:00
|
|
|
extern status_t image_init(void);
|
2003-01-12 18:59:12 +03:00
|
|
|
|
|
|
|
// user-space exported calls
|
2004-05-11 19:04:36 +04:00
|
|
|
extern status_t _user_unregister_image(image_id id);
|
|
|
|
extern image_id _user_register_image(image_info *userInfo, size_t size);
|
2005-03-12 18:05:12 +03:00
|
|
|
extern void _user_image_relocated(image_id id);
|
|
|
|
extern void _user_loading_app_failed(status_t error);
|
2004-05-11 19:04:36 +04:00
|
|
|
extern status_t _user_get_next_image_info(team_id team, int32 *_cookie,
|
|
|
|
image_info *userInfo, size_t size);
|
|
|
|
extern status_t _user_get_image_info(image_id id, image_info *userInfo, size_t size);
|
2003-01-12 18:59:12 +03:00
|
|
|
|
2005-11-04 20:25:58 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-01-12 18:59:12 +03:00
|
|
|
#endif /* _KRENEL_IMAGE_H */
|