4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6 * This file provides an API add-on to the dynamic loader that allows the user
7 * to query section information and extract section data from dynamic load
11 * Functions in this API assume that the supplied dynamic_loader_stream
12 * object supports the set_file_posn method.
14 * Copyright (C) 2008 Texas Instruments, Inc.
16 * This package is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation.
20 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
22 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25 #ifndef _GETSECTION_H_
26 #define _GETSECTION_H_
28 #include "dynamic_loader.h"
31 * Procedure dload_module_open
34 * module The input stream that supplies the module image
35 * syms Host-side malloc/free and error reporting functions.
36 * Other methods are unused.
39 * Reads header information from a dynamic loader module using the specified
40 * stream object, and returns a handle for the module information. This
41 * handle may be used in subsequent query calls to obtain information
42 * contained in the module.
45 * NULL if an error is encountered, otherwise a module handle for use
46 * in subsequent operations.
48 extern void *dload_module_open(struct dynamic_loader_stream
49 *module, struct dynamic_loader_sym
53 * Procedure dload_get_section_info
56 * minfo Handle from dload_module_open for this module
57 * section_name Pointer to the string name of the section desired
58 * section_info Address of a section info structure pointer to be initialized
61 * Finds the specified section in the module information, and fills in
62 * the provided ldr_section_info structure.
65 * TRUE for success, FALSE for section not found
67 extern int dload_get_section_info(void *minfo,
68 const char *section_name,
69 const struct ldr_section_info
70 **const section_info);
73 * Procedure dload_get_section
76 * minfo Handle from dload_module_open for this module
77 * section_info Pointer to a section info structure for the desired section
78 * section_data Buffer to contain the section initialized data
81 * Copies the initialized data for the specified section into the
85 * TRUE for success, FALSE for section not found
87 extern int dload_get_section(void *minfo,
88 const struct ldr_section_info *section_info,
92 * Procedure dload_module_close
95 * minfo Handle from dload_module_open for this module
98 * Releases any storage associated with the module handle. On return,
99 * the module handle is invalid.
102 * Zero for success. On error, the number of errors detected is returned.
103 * Individual errors are reported using syms->error_report(), where syms was
104 * an argument to dload_module_open
106 extern void dload_module_close(void *minfo);
108 #endif /* _GETSECTION_H_ */