Commit | Line | Data |
---|---|---|
6280238c ORL |
1 | /* |
2 | * getsection.h | |
3 | * | |
4 | * DSP-BIOS Bridge driver support functions for TI OMAP processors. | |
5 | * | |
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 | |
8 | * modules. | |
9 | * | |
10 | * Notes: | |
11 | * Functions in this API assume that the supplied dynamic_loader_stream | |
12 | * object supports the set_file_posn method. | |
13 | * | |
14 | * Copyright (C) 2008 Texas Instruments, Inc. | |
15 | * | |
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. | |
19 | * | |
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. | |
23 | */ | |
24 | ||
25 | #ifndef _GETSECTION_H_ | |
26 | #define _GETSECTION_H_ | |
27 | ||
28 | #include "dynamic_loader.h" | |
29 | ||
30 | /* | |
31 | * Procedure dload_module_open | |
32 | * | |
33 | * Parameters: | |
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. | |
37 | * | |
38 | * Effect: | |
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. | |
43 | * | |
44 | * Returns: | |
45 | * NULL if an error is encountered, otherwise a module handle for use | |
46 | * in subsequent operations. | |
47 | */ | |
48 | extern void *dload_module_open(struct dynamic_loader_stream | |
49 | *module, struct dynamic_loader_sym | |
50 | *syms); | |
51 | ||
52 | /* | |
53 | * Procedure dload_get_section_info | |
54 | * | |
55 | * Parameters: | |
56 | * minfo Handle from dload_module_open for this module | |
318b5df9 RS |
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 | |
6280238c ORL |
59 | * |
60 | * Effect: | |
61 | * Finds the specified section in the module information, and fills in | |
62 | * the provided ldr_section_info structure. | |
63 | * | |
64 | * Returns: | |
65 | * TRUE for success, FALSE for section not found | |
66 | */ | |
67 | extern int dload_get_section_info(void *minfo, | |
318b5df9 | 68 | const char *section_name, |
6280238c | 69 | const struct ldr_section_info |
318b5df9 | 70 | **const section_info); |
6280238c ORL |
71 | |
72 | /* | |
73 | * Procedure dload_get_section | |
74 | * | |
75 | * Parameters: | |
76 | * minfo Handle from dload_module_open for this module | |
318b5df9 RS |
77 | * section_info Pointer to a section info structure for the desired section |
78 | * section_data Buffer to contain the section initialized data | |
6280238c ORL |
79 | * |
80 | * Effect: | |
81 | * Copies the initialized data for the specified section into the | |
82 | * supplied buffer. | |
83 | * | |
84 | * Returns: | |
85 | * TRUE for success, FALSE for section not found | |
86 | */ | |
87 | extern int dload_get_section(void *minfo, | |
318b5df9 RS |
88 | const struct ldr_section_info *section_info, |
89 | void *section_data); | |
6280238c ORL |
90 | |
91 | /* | |
92 | * Procedure dload_module_close | |
93 | * | |
94 | * Parameters: | |
95 | * minfo Handle from dload_module_open for this module | |
96 | * | |
97 | * Effect: | |
98 | * Releases any storage associated with the module handle. On return, | |
99 | * the module handle is invalid. | |
100 | * | |
101 | * Returns: | |
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 | |
105 | */ | |
106 | extern void dload_module_close(void *minfo); | |
107 | ||
108 | #endif /* _GETSECTION_H_ */ |