4 /* =================================================================
8 * =================================================================
9 * ####ECOSGPLCOPYRIGHTBEGIN####
10 * -------------------------------------------
11 * This file is part of eCos, the Embedded Configurable Operating
13 * Copyright (C) 2005 eCosCentric Ltd.
15 * eCos is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 or (at your option)
20 * eCos is distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with eCos; if not, write to the Free Software Foundation,
27 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
29 * As a special exception, if other files instantiate templates or
30 * use macros or inline functions from this file, or you compile this
31 * file and link it with other works to produce a work based on this
32 * file, this file does not by itself cause the resulting work to be
33 * covered by the GNU General Public License. However the source code
34 * for this file must still be made available in accordance with
35 * section (3) of the GNU General Public License.
37 * This exception does not invalidate any other reasons why a work
38 * based on this file might be covered by the GNU General Public
41 * -------------------------------------------
42 * ####ECOSGPLCOPYRIGHTEND####
43 * =================================================================
44 * #####DESCRIPTIONBEGIN####
46 * Author(s): atonizzo@lycos.com
47 * Contributors: nickg@ecoscentric.com
52 * ####DESCRIPTIONEND####
54 * =================================================================
57 //==============================================================================
59 #include <pkgconf/system.h>
60 #include <pkgconf/objloader.h>
61 #include <cyg/hal/hal_tables.h>
63 //==============================================================================
65 extern cyg_uint8 *cyg_ldr_last_error;
67 //==============================================================================
69 #define CYG_LDR_MODE_FILESYSTEM 0
70 #define CYG_LDR_MODE_FTP 1
71 #define CYG_LDR_MODE_TFTP 2
72 #define CYG_LDR_MODE_MEMORY 3
73 #define CYG_LDR_MODE_HTTP 4
75 //==============================================================================
77 typedef struct ELF_OBJECT
82 size_t (*read)( struct ELF_OBJECT*, size_t, size_t, void* );
83 cyg_int32 (*seek)( struct ELF_OBJECT*, cyg_uint32 );
84 cyg_int32 (*close)( struct ELF_OBJECT* );
86 // This is the absolute address in memory where the library resides.
89 // Start of the section header.
92 cyg_int32 hdrndx_symtab;
93 cyg_int32 hdrndx_strtab;
95 cyg_uint32 **sections;
97 } ELF_OBJECT, *PELF_OBJECT;
100 //==============================================================================
103 #if CYGPKG_SERVICES_OBJLOADER_DEBUG_LEVEL != 0
104 #define ELFDEBUG(a) diag_printf(a)
109 #if CYGPKG_SERVICES_OBJLOADER_DEBUG_LEVEL > 0
110 void cyg_ldr_print_section_data( PELF_OBJECT );
111 void cyg_ldr_print_symbol_names( PELF_OBJECT );
112 void cyg_ldr_print_rel_names( PELF_OBJECT );
115 //==============================================================================
116 // Internal functions
118 cyg_int32 *cyg_ldr_load_elf_section( PELF_OBJECT, cyg_uint32 );
119 void cyg_ldr_delete_elf_section( PELF_OBJECT, cyg_uint32 );
120 cyg_int32 *cyg_ldr_section_address( PELF_OBJECT, cyg_uint32 );
121 void* cyg_ldr_scan_file( PELF_OBJECT );
122 cyg_int32 cyg_ldr_relocate_section( PELF_OBJECT, cyg_uint32 );
123 void* cyg_ldr_find_symbol( void*, cyg_uint8* );
124 void* cyg_ldr_symbol_address( PELF_OBJECT, cyg_uint32 );
125 void* cyg_ldr_external_address( PELF_OBJECT, cyg_uint32 );
127 //==============================================================================
130 PELF_OBJECT cyg_ldr_open_library( CYG_ADDRWORD, cyg_int32 );
131 void cyg_ldr_close_library( void* );
132 cyg_uint8* cyg_ldr_error( void );
133 void* cyg_ldr_get_symbol( void*, char* );
135 PELF_OBJECT cyg_ldr_open_library_fs( cyg_uint8* );
136 void cyg_ldr_close_library_fs( PELF_OBJECT );
138 //==============================================================================
140 void *cyg_ldr_malloc( size_t ) CYGBLD_ATTRIB_WEAK;
141 void cyg_ldr_free( void * ) CYGBLD_ATTRIB_WEAK;
143 //==============================================================================
145 struct cyg_ldr_table_entry
149 } CYG_HAL_TABLE_TYPE;
151 typedef struct cyg_ldr_table_entry cyg_ldr_table_entry;
153 #define CYG_LDR_TABLE_ENTRY( __name, __symbol_name, __handler ) \
154 cyg_ldr_table_entry __name CYG_HAL_TABLE_ENTRY( ldr_table ) = \
155 { __symbol_name, __handler }
157 //==============================================================================
159 #define CYG_LDR_TABLE_KAPI_ALARM() \
160 CYG_LDR_TABLE_ENTRY( cyg_alarm_create_entry, \
161 "cyg_alarm_create", cyg_alarm_create ); \
162 CYG_LDR_TABLE_ENTRY( cyg_alarm_delete_entry, \
163 "cyg_alarm_delete", cyg_alarm_delete ); \
164 CYG_LDR_TABLE_ENTRY( cyg_alarm_initialize_entry, \
165 "cyg_alarm_initialize", cyg_alarm_initialize ); \
166 CYG_LDR_TABLE_ENTRY( cyg_alarm_get_times_entry, \
167 "cyg_alarm_get_times", cyg_alarm_get_times ); \
168 CYG_LDR_TABLE_ENTRY( cyg_alarm_enable_entry, \
169 "cyg_alarm_enable", cyg_alarm_enable ); \
170 CYG_LDR_TABLE_ENTRY( cyg_alarm_disable_entry, \
171 "cyg_alarm_disable", cyg_alarm_disable );
173 #define CYG_LDR_TABLE_KAPI_CLOCK() \
174 CYG_LDR_TABLE_ENTRY( cyg_clock_create_entry, \
175 "cyg_clock_create", cyg_clock_create ); \
176 CYG_LDR_TABLE_ENTRY( cyg_clock_delete_entry, \
177 "cyg_clock_delete", cyg_clock_delete ); \
178 CYG_LDR_TABLE_ENTRY( cyg_clock_to_counter_entry, \
179 "cyg_clock_to_counter", cyg_clock_to_counter ); \
180 CYG_LDR_TABLE_ENTRY( cyg_clock_set_resolution_entry, \
181 "cyg_clock_set_resolution", cyg_clock_set_resolution ); \
182 CYG_LDR_TABLE_ENTRY( cyg_clock_get_resolution_entry, \
183 "cyg_clock_get_resolution",cyg_clock_get_resolution ); \
184 CYG_LDR_TABLE_ENTRY( cyg_real_time_clock_entry, \
185 "cyg_real_time_clock", cyg_real_time_clock ); \
186 CYG_LDR_TABLE_ENTRY( cyg_current_time_entry, \
187 "cyg_current_time", cyg_current_time );
189 #define CYG_LDR_TABLE_KAPI_COND() \
190 CYG_LDR_TABLE_ENTRY( cyg_cond_init_entry, \
191 "cyg_cond_init", cyg_cond_init ); \
192 CYG_LDR_TABLE_ENTRY( cyg_cond_destroy_entry, \
193 "cyg_cond_destroy", cyg_cond_destroy ); \
194 CYG_LDR_TABLE_ENTRY( cyg_cond_wait_entry, \
195 "cyg_cond_wait", cyg_cond_wait ); \
196 CYG_LDR_TABLE_ENTRY( cyg_cond_signal_entry, \
197 "cyg_cond_signal", cyg_cond_signal ); \
198 CYG_LDR_TABLE_ENTRY( cyg_cond_broadcast_entry, \
199 "cyg_cond_broadcast", cyg_cond_broadcast ); \
200 CYG_LDR_TABLE_ENTRY( cyg_cond_timed_wait_entry, \
201 "cyg_cond_timed_wait", cyg_cond_timed_wait );
203 #define CYG_LDR_TABLE_KAPI_COUNTER() \
204 CYG_LDR_TABLE_ENTRY( cyg_counter_create_entry, \
205 "cyg_counter_create", cyg_counter_create ); \
206 CYG_LDR_TABLE_ENTRY( cyg_counter_delete_entry, \
207 "cyg_counter_delete", cyg_counter_delete ); \
208 CYG_LDR_TABLE_ENTRY( cyg_counter_current_value_entry, \
209 "cyg_counter_current_value", cyg_counter_current_value ); \
210 CYG_LDR_TABLE_ENTRY( cyg_counter_set_value_entry, \
211 "cyg_counter_set_value", cyg_counter_set_value ); \
212 CYG_LDR_TABLE_ENTRY( cyg_counter_tick_entry, \
213 "cyg_counter_tick", cyg_counter_tick ); \
214 CYG_LDR_TABLE_ENTRY( cyg_counter_multi_tick_entry, \
215 "cyg_counter_multi_tick", cyg_counter_multi_tick );
217 #define CYG_LDR_TABLE_KAPI_EXCEPTIONS() \
218 CYG_LDR_TABLE_ENTRY( cyg_exception_set_handler_entry, \
219 "cyg_exception_set_handler", cyg_exception_set_handler ); \
220 CYG_LDR_TABLE_ENTRY( cyg_exception_clear_handler_entry, \
221 "cyg_exception_clear_handler", \
222 cyg_exception_clear_handler ); \
223 CYG_LDR_TABLE_ENTRY( cyg_exception_call_handler_entry, \
224 "cyg_exception_call_handler", \
225 cyg_exception_call_handler );
227 #define CYG_LDR_TABLE_KAPI_FLAG() \
228 CYG_LDR_TABLE_ENTRY( cyg_flag_init_entry, \
229 "cyg_flag_init", cyg_flag_init ); \
230 CYG_LDR_TABLE_ENTRY( cyg_flag_destroy_entry, \
231 "cyg_flag_destroy", cyg_flag_destroy ); \
232 CYG_LDR_TABLE_ENTRY( cyg_flag_setbits_entry, \
233 "cyg_flag_setbits", cyg_flag_setbits ); \
234 CYG_LDR_TABLE_ENTRY( cyg_flag_maskbits_entry, \
235 "cyg_flag_maskbits", cyg_flag_maskbits ); \
236 CYG_LDR_TABLE_ENTRY( cyg_flag_wait_entry, \
237 "cyg_flag_wait", cyg_flag_wait ); \
238 CYG_LDR_TABLE_ENTRY( cyg_flag_timed_wait_entry, \
239 "cyg_flag_timed_wait", cyg_flag_timed_wait ); \
240 CYG_LDR_TABLE_ENTRY( cyg_flag_poll_entry, \
241 "cyg_flag_poll", cyg_flag_poll ); \
242 CYG_LDR_TABLE_ENTRY( cyg_flag_peek_entry, \
243 "cyg_flag_peek", cyg_flag_peek ); \
244 CYG_LDR_TABLE_ENTRY( cyg_flag_waiting_entry, \
245 "cyg_flag_waiting", cyg_flag_waiting );
247 #define CYG_LDR_TABLE_KAPI_INTERRUPTS() \
248 CYG_LDR_TABLE_ENTRY( cyg_interrupt_create_entry, \
249 "cyg_interrupt_create", cyg_interrupt_create ); \
250 CYG_LDR_TABLE_ENTRY( cyg_interrupt_delete_entry, \
251 "cyg_interrupt_delete", cyg_interrupt_delete ); \
252 CYG_LDR_TABLE_ENTRY( cyg_interrupt_attach_entry, \
253 "cyg_interrupt_attach", cyg_interrupt_attach ); \
254 CYG_LDR_TABLE_ENTRY( cyg_interrupt_detach_entry, \
255 "cyg_interrupt_detach", cyg_interrupt_detach ); \
256 CYG_LDR_TABLE_ENTRY( cyg_interrupt_get_vsr_entry, \
257 "cyg_interrupt_get_vsr", cyg_interrupt_get_vsr ); \
258 CYG_LDR_TABLE_ENTRY( cyg_interrupt_set_vsr_entry, \
259 "cyg_interrupt_set_vsr", cyg_interrupt_set_vsr ); \
260 CYG_LDR_TABLE_ENTRY( cyg_interrupt_disable_entry, \
261 "cyg_interrupt_disable", cyg_interrupt_disable ); \
262 CYG_LDR_TABLE_ENTRY( cyg_interrupt_enable_entry, \
263 "cyg_interrupt_enable", cyg_interrupt_enable ); \
264 CYG_LDR_TABLE_ENTRY( cyg_interrupt_mask_entry, \
265 "cyg_interrupt_mask", cyg_interrupt_mask ); \
266 CYG_LDR_TABLE_ENTRY( cyg_interrupt_mask_intunsafe_entry, \
267 "cyg_interrupt_mask_intunsafe", \
268 cyg_interrupt_mask_intunsafe ); \
269 CYG_LDR_TABLE_ENTRY( cyg_interrupt_unmask_entry, \
270 "cyg_interrupt_unmask", cyg_interrupt_unmask ); \
271 CYG_LDR_TABLE_ENTRY( cyg_interrupt_unmask_intunsafe_entry, \
272 "cyg_interrupt_unmask_intunsafe", \
273 cyg_interrupt_unmask_intunsafe ); \
274 CYG_LDR_TABLE_ENTRY( cyg_interrupt_acknowledge_entry, \
275 "cyg_interrupt_acknowledge", \
276 cyg_interrupt_acknowledge ); \
277 CYG_LDR_TABLE_ENTRY( cyg_interrupt_configure_entry, \
278 "cyg_interrupt_configure", cyg_interrupt_configure ); \
279 CYG_LDR_TABLE_ENTRY( cyg_interrupt_set_cpu_entry, \
280 "cyg_interrupt_set_cpu", cyg_interrupt_set_cpu ); \
281 CYG_LDR_TABLE_ENTRY( cyg_interrupt_get_cpu_entry, \
282 "cyg_interrupt_get_cpu", cyg_interrupt_get_cpu );
284 #define CYG_LDR_TABLE_KAPI_MBOX() \
285 CYG_LDR_TABLE_ENTRY( cyg_mbox_create_entry, \
286 "cyg_mbox_create", cyg_mbox_create ); \
287 CYG_LDR_TABLE_ENTRY( cyg_mbox_delete_entry, \
288 "cyg_mbox_delete", cyg_mbox_delete ); \
289 CYG_LDR_TABLE_ENTRY( cyg_mbox_get_entry, \
290 "cyg_mbox_get", cyg_mbox_get ); \
291 CYG_LDR_TABLE_ENTRY( cyg_mbox_timed_get_entry, \
292 "cyg_mbox_timed_get", cyg_mbox_timed_get ); \
293 CYG_LDR_TABLE_ENTRY( cyg_mbox_tryget_entry, \
294 "cyg_mbox_tryget", cyg_mbox_tryget ); \
295 CYG_LDR_TABLE_ENTRY( cyg_mbox_peek_item_entry, \
296 "cyg_mbox_peek_item", cyg_mbox_peek_item ); \
297 CYG_LDR_TABLE_ENTRY( cyg_mbox_put_entry, \
298 "cyg_mbox_put", cyg_mbox_put ); \
299 CYG_LDR_TABLE_ENTRY( cyg_mbox_timed_put_entry, \
300 "cyg_mbox_timed_put", cyg_mbox_timed_put ); \
301 CYG_LDR_TABLE_ENTRY( cyg_mbox_tryput_entry, \
302 "cyg_mbox_tryput", cyg_mbox_tryput ); \
303 CYG_LDR_TABLE_ENTRY( cyg_mbox_peek_entry, \
304 "cyg_mbox_peek", cyg_mbox_peek ); \
305 CYG_LDR_TABLE_ENTRY( cyg_mbox_waiting_to_get_entry, \
306 "cyg_mbox_waiting_to_get", \
307 cyg_mbox_waiting_to_get ); \
308 CYG_LDR_TABLE_ENTRY( cyg_mbox_waiting_to_put_entry, \
309 "cyg_mbox_waiting_to_put", \
310 cyg_mbox_waiting_to_put );
312 #define CYG_LDR_TABLE_KAPI_MEMPOOL_FIX() \
313 CYG_LDR_TABLE_ENTRY( cyg_mempool_fix_create_entry, \
314 "cyg_mempool_fix_create", cyg_mempool_fix_create ); \
315 CYG_LDR_TABLE_ENTRY( cyg_mempool_fix_delete_entry, \
316 "cyg_mempool_fix_delete", cyg_mempool_fix_delete ); \
317 CYG_LDR_TABLE_ENTRY( cyg_mempool_fix_alloc_entry, \
318 "cyg_mempool_fix_alloc", cyg_mempool_fix_alloc ); \
319 CYG_LDR_TABLE_ENTRY( cyg_mempool_fix_timed_alloc_entry, \
320 "cyg_mempool_fix_timed_alloc", \
321 cyg_mempool_fix_timed_alloc ); \
322 CYG_LDR_TABLE_ENTRY( cyg_mempool_fix_try_alloc_entry, \
323 "cyg_mempool_fix_try_alloc", \
324 cyg_mempool_fix_try_alloc ); \
325 CYG_LDR_TABLE_ENTRY( cyg_mempool_fix_free_entry, \
326 "cyg_mempool_fix_free", cyg_mempool_fix_free ); \
327 CYG_LDR_TABLE_ENTRY( cyg_mempool_fix_waiting_entry, \
328 "cyg_mempool_fix_waiting", cyg_mempool_fix_waiting ); \
329 CYG_LDR_TABLE_ENTRY( cyg_mempool_fix_get_info_entry, \
330 "cyg_mempool_fix_get_info", cyg_mempool_fix_get_info );
332 #define CYG_LDR_TABLE_KAPI_MEMPOOL_VAR() \
333 CYG_LDR_TABLE_ENTRY( cyg_mempool_var_create_entry, \
334 "cyg_mempool_var_create", cyg_mempool_var_create ); \
335 CYG_LDR_TABLE_ENTRY( cyg_mempool_var_delete_entry, \
336 "cyg_mempool_var_delete", cyg_mempool_var_delete ); \
337 CYG_LDR_TABLE_ENTRY( cyg_mempool_var_alloc_entry, \
338 "cyg_mempool_var_alloc", cyg_mempool_var_alloc ); \
339 CYG_LDR_TABLE_ENTRY( cyg_mempool_var_timed_alloc_entry, \
340 "cyg_mempool_var_timed_alloc", \
341 cyg_mempool_var_timed_alloc ); \
342 CYG_LDR_TABLE_ENTRY( cyg_mempool_var_try_alloc_entry, \
343 "cyg_mempool_var_try_alloc", \
344 cyg_mempool_var_try_alloc ); \
345 CYG_LDR_TABLE_ENTRY( cyg_mempool_var_free_entry, \
346 "cyg_mempool_var_free", cyg_mempool_var_free ); \
347 CYG_LDR_TABLE_ENTRY( cyg_mempool_var_waiting_entry, \
348 "cyg_mempool_var_waiting", cyg_mempool_var_waiting ); \
349 CYG_LDR_TABLE_ENTRY( cyg_mempool_var_get_info_entry, \
350 "cyg_mempool_var_get_info", cyg_mempool_var_get_info );
352 #define CYG_LDR_TABLE_KAPI_MUTEX() \
353 CYG_LDR_TABLE_ENTRY( cyg_mutex_init_entry, \
354 "cyg_mutex_init", cyg_mutex_init ); \
355 CYG_LDR_TABLE_ENTRY( cyg_mutex_destroy_entry, \
356 "cyg_mutex_destroy", cyg_mutex_destroy ); \
357 CYG_LDR_TABLE_ENTRY( cyg_mutex_trylock_entry, \
358 "cyg_mutex_trylock", cyg_mutex_trylock ); \
359 CYG_LDR_TABLE_ENTRY( cyg_mutex_unlock_entry, \
360 "cyg_mutex_unlock", cyg_mutex_unlock ); \
361 CYG_LDR_TABLE_ENTRY( cyg_mutex_release_entry, \
362 "cyg_mutex_release", cyg_mutex_release ); \
363 CYG_LDR_TABLE_ENTRY( cyg_mutex_set_ceiling_entry, \
364 "cyg_mutex_set_ceiling", cyg_mutex_set_ceiling ); \
365 CYG_LDR_TABLE_ENTRY( cyg_mutex_set_protocol_entry, \
366 "cyg_mutex_set_protocol", cyg_mutex_set_protocol );
368 #define CYG_LDR_TABLE_KAPI_SCHEDULER() \
369 CYG_LDR_TABLE_ENTRY( cyg_scheduler_start_entry, \
370 "cyg_scheduler_start", cyg_scheduler_start ); \
371 CYG_LDR_TABLE_ENTRY( cyg_scheduler_lock_entry, \
372 "cyg_scheduler_lock", cyg_scheduler_lock ); \
373 CYG_LDR_TABLE_ENTRY( cyg_scheduler_safe_lock_entry, \
374 "cyg_scheduler_safe_lock", cyg_scheduler_safe_lock ); \
375 CYG_LDR_TABLE_ENTRY( cyg_scheduler_unlock_entry, \
376 "cyg_scheduler_unlock", cyg_scheduler_unlock ); \
377 CYG_LDR_TABLE_ENTRY( cyg_scheduler_read_lock_entry, \
378 "cyg_scheduler_read_lock", cyg_scheduler_read_lock ); \
380 #define CYG_LDR_TABLE_KAPI_SEMAPHORE() \
381 CYG_LDR_TABLE_ENTRY( cyg_semaphore_init_entry, \
382 "cyg_semaphore_init", cyg_semaphore_init ); \
383 CYG_LDR_TABLE_ENTRY( cyg_semaphore_destroy_entry, \
384 "cyg_semaphore_destroy", cyg_semaphore_destroy ); \
385 CYG_LDR_TABLE_ENTRY( cyg_semaphore_wait_entry, \
386 "cyg_semaphore_wait", cyg_semaphore_wait ); \
387 CYG_LDR_TABLE_ENTRY( cyg_semaphore_timed_wait_entry, \
388 "cyg_semaphore_timed_wait", cyg_semaphore_timed_wait ); \
389 CYG_LDR_TABLE_ENTRY( cyg_semaphore_try_wait_entry, \
390 "cyg_semaphore_trywait", cyg_semaphore_trywait ); \
391 CYG_LDR_TABLE_ENTRY( cyg_semaphore_post_entry, \
392 "cyg_semaphore_post", cyg_semaphore_post ); \
393 CYG_LDR_TABLE_ENTRY( cyg_semaphore_peek_entry, \
394 "cyg_semaphore_peek", cyg_semaphore_peek );
396 #define CYG_LDR_TABLE_KAPI_THREAD() \
397 CYG_LDR_TABLE_ENTRY( cyg_thread_create_entry, \
398 "cyg_thread_create", cyg_thread_create ); \
399 CYG_LDR_TABLE_ENTRY( cyg_thread_exit_entry, \
400 "cyg_thread_exit", cyg_thread_exit ); \
401 CYG_LDR_TABLE_ENTRY( cyg_thread_delete_entry, \
402 "cyg_thread_delete", cyg_thread_delete ); \
403 CYG_LDR_TABLE_ENTRY( cyg_thread_suspend_entry, \
404 "cyg_thread_suspend", cyg_thread_suspend ); \
405 CYG_LDR_TABLE_ENTRY( cyg_thread_resume_entry, \
406 "cyg_thread_resume", cyg_thread_resume ); \
407 CYG_LDR_TABLE_ENTRY( cyg_thread_kill_entry, \
408 "cyg_thread_kill", cyg_thread_kill ); \
409 CYG_LDR_TABLE_ENTRY( cyg_thread_release_entry, \
410 "cyg_thread_release", cyg_thread_release ); \
411 CYG_LDR_TABLE_ENTRY( cyg_thread_yield_entry, \
412 "cyg_thread_yield", cyg_thread_yield ); \
413 CYG_LDR_TABLE_ENTRY( cyg_thread_self_entry, \
414 "cyg_thread_self", cyg_thread_self ); \
415 CYG_LDR_TABLE_ENTRY( cyg_thread_idle_thread_entry, \
416 "cyg_thread_idle_thread", cyg_thread_idle_thread ); \
417 CYG_LDR_TABLE_ENTRY( cyg_thread_set_priority_entry, \
418 "cyg_thread_set_priority", cyg_thread_set_priority ); \
419 CYG_LDR_TABLE_ENTRY( cyg_thread_get_priority_entry, \
420 "cyg_thread_get_priority", cyg_thread_get_priority ); \
421 CYG_LDR_TABLE_ENTRY( cyg_thread_get_current_priority_entry, \
422 "cyg_thread_get_current_priority", \
423 cyg_thread_get_current_priority ); \
424 CYG_LDR_TABLE_ENTRY( cyg_thread_delay_entry, \
425 "cyg_thread_delay", cyg_thread_delay ); \
426 CYG_LDR_TABLE_ENTRY( cyg_thread_get_stack_base_entry, \
427 "cyg_thread_get_stack_base", cyg_thread_get_stack_base ); \
428 CYG_LDR_TABLE_ENTRY( cyg_thread_get_stack_size_entry, \
429 "cyg_thread_get_stack_size", cyg_thread_get_stack_size ); \
430 CYG_LDR_TABLE_ENTRY( cyg_thread_new_data_index_entry, \
431 "cyg_thread_new_data_index", cyg_thread_new_data_index ); \
432 CYG_LDR_TABLE_ENTRY( cyg_thread_free_data_index_entry, \
433 "cyg_thread_free_data_index", \
434 cyg_thread_free_data_index ); \
435 CYG_LDR_TABLE_ENTRY( cyg_thread_get_data_entry, \
436 "cyg_thread_get_data", cyg_thread_get_data ); \
437 CYG_LDR_TABLE_ENTRY( cyg_thread_get_data_ptr_entry, \
438 "cyg_thread_get_data_ptr", cyg_thread_get_data_ptr ); \
439 CYG_LDR_TABLE_ENTRY( cyg_thread_set_data_entry, \
440 "cyg_thread_set_data", cyg_thread_set_data );
442 #define CYG_LDR_TABLE_STRING() \
443 CYG_LDR_TABLE_ENTRY( memchr_entry, "memchr", memchr ); \
444 CYG_LDR_TABLE_ENTRY( memcmp_entry, "memcmp", memcmp ); \
445 CYG_LDR_TABLE_ENTRY( memcpy_entry, "memcpy", memcpy ); \
446 CYG_LDR_TABLE_ENTRY( memmove_entry, "memmove", memmove ); \
447 CYG_LDR_TABLE_ENTRY( memset_entry, "memset", memset ); \
448 CYG_LDR_TABLE_ENTRY( strcpy_entry, "strcpy", strcpy ); \
449 CYG_LDR_TABLE_ENTRY( strncpy_entry, "strncpy", strncpy ); \
450 CYG_LDR_TABLE_ENTRY( strcat_entry, "strcat", strcat ); \
451 CYG_LDR_TABLE_ENTRY( strncat_entry, "strncat", strncat ); \
452 CYG_LDR_TABLE_ENTRY( strchr_entry, "strchr", strchr ); \
453 CYG_LDR_TABLE_ENTRY( strrchr_entry, "strrchr", strrchr ); \
454 CYG_LDR_TABLE_ENTRY( strcoll_entry, "strcoll", strcoll ); \
455 CYG_LDR_TABLE_ENTRY( strlen_entry, "strlen", strlen ); \
456 CYG_LDR_TABLE_ENTRY( strcmp_entry, "strcmp", strcmp ); \
457 CYG_LDR_TABLE_ENTRY( strncmp_entry, "strncmp", strncmp ); \
458 CYG_LDR_TABLE_ENTRY( strcspn_entry, "strcspn", strcspn ); \
459 CYG_LDR_TABLE_ENTRY( strerror_entry, "strerror", strerror ); \
460 CYG_LDR_TABLE_ENTRY( strpbrk_entry, "strpbrk", strpbrk ); \
461 CYG_LDR_TABLE_ENTRY( strspn_entry, "strspn", strspn ); \
462 CYG_LDR_TABLE_ENTRY( strstr_entry, "strstr", strstr ); \
463 CYG_LDR_TABLE_ENTRY( strtok_entry, "strtok", strtok ); \
464 CYG_LDR_TABLE_ENTRY( strxfrm_entry, "strxfrm", strxfrm );
466 #define CYG_LDR_TABLE_STDIO() \
467 CYG_LDR_TABLE_ENTRY( clearerr_entry, "clearerr", clearerr ); \
468 CYG_LDR_TABLE_ENTRY( fclose_entry, "fclose", fclose ); \
469 CYG_LDR_TABLE_ENTRY( feof_entry, "feof", feof ); \
470 CYG_LDR_TABLE_ENTRY( ferror_entry, "ferror", ferror ); \
471 CYG_LDR_TABLE_ENTRY( fflush_entry, "fflush", fflush ); \
472 CYG_LDR_TABLE_ENTRY( fgetc_entry, "fgetc", fgetc ); \
473 CYG_LDR_TABLE_ENTRY( fgetpos_entry, "fgetpos", fgetpos ); \
474 CYG_LDR_TABLE_ENTRY( fgets_entry, "fgets", fgets ); \
475 CYG_LDR_TABLE_ENTRY( fopen_entry, "fopen", fopen ); \
476 CYG_LDR_TABLE_ENTRY( fprintf_entry, "fprintf", fprintf ); \
477 CYG_LDR_TABLE_ENTRY( fputc_entry, "fputc", fputc ); \
478 CYG_LDR_TABLE_ENTRY( fputs_entry, "fputs", fputs ); \
479 CYG_LDR_TABLE_ENTRY( fread_entry, "fread", fread ); \
480 CYG_LDR_TABLE_ENTRY( freopen_entry, "freopen", freopen ); \
481 CYG_LDR_TABLE_ENTRY( fscanf_entry, "fscanf", fscanf ); \
482 CYG_LDR_TABLE_ENTRY( fseek_entry, "fseek", fseek ); \
483 CYG_LDR_TABLE_ENTRY( fsetpos_entry, "fsetpos", fsetpos ); \
484 CYG_LDR_TABLE_ENTRY( ftell_entry, "ftell", ftell ); \
485 CYG_LDR_TABLE_ENTRY( fwrite_entry, "fwrite", fwrite ); \
486 CYG_LDR_TABLE_ENTRY( perror_entry, "perror", perror ); \
487 CYG_LDR_TABLE_ENTRY( printf_entry, "printf", printf ); \
488 CYG_LDR_TABLE_ENTRY( putc_entry, "putc", putc ); \
489 CYG_LDR_TABLE_ENTRY( putchar_entry, "putchar", putchar ); \
490 CYG_LDR_TABLE_ENTRY( puts_entry, "puts", puts ); \
491 CYG_LDR_TABLE_ENTRY( remove_entry, "remove", remove ); \
492 CYG_LDR_TABLE_ENTRY( rename_entry, "rename", rename ); \
493 CYG_LDR_TABLE_ENTRY( rewind_entry, "rewind", rewind ); \
494 CYG_LDR_TABLE_ENTRY( scanf_entry, "scanf", scanf ); \
495 CYG_LDR_TABLE_ENTRY( setbuf_entry, "setbuf", setbuf ); \
496 CYG_LDR_TABLE_ENTRY( setvbuf_entry, "setvbuf", setvbuf ); \
497 CYG_LDR_TABLE_ENTRY( sprintf_entry, "sprintf", sprintf ); \
498 CYG_LDR_TABLE_ENTRY( sscanf_entry, "sscanf", sscanf ); \
499 CYG_LDR_TABLE_ENTRY( tmpfile_entry, "tmpfile", tmpfile ); \
500 CYG_LDR_TABLE_ENTRY( tmpnam_entry, "tmpnam", tmpnam ); \
501 CYG_LDR_TABLE_ENTRY( ungetc_entry, "ungetc", ungetc );
503 #define CYG_LDR_TABLE_INFRA_DIAG() \
504 CYG_LDR_TABLE_ENTRY( diag_init_entry, "diag_init", diag_init ); \
505 CYG_LDR_TABLE_ENTRY( diag_write_char_entry, \
506 "diag_write_char", diag_write_char ); \
507 CYG_LDR_TABLE_ENTRY( diag_write_string_entry, \
508 "diag_write_string", diag_write_string ); \
509 CYG_LDR_TABLE_ENTRY( diag_write_dec_entry, \
510 "diag_write_dec", diag_write_dec ); \
511 CYG_LDR_TABLE_ENTRY( diag_write_hex_entry, \
512 "diag_write_hex", diag_write_hex ); \
513 CYG_LDR_TABLE_ENTRY( diag_dump_buf_entry, \
514 "diag_dump_buf", diag_dump_buf ); \
515 CYG_LDR_TABLE_ENTRY( diag_dump_buf_32bit_entry, \
516 "diag_dump_buf_32bit", diag_dump_buf_32bit ); \
517 CYG_LDR_TABLE_ENTRY( diag_dump_buf_16bit_entry, \
518 "diag_dump_buf_16bit", diag_dump_buf_16bit ); \
519 CYG_LDR_TABLE_ENTRY( diag_vdump_buf_with_offset_entry, \
520 "diag_vdump_buf_with_offset", \
521 diag_vdump_buf_with_offset ); \
522 CYG_LDR_TABLE_ENTRY( diag_dump_buf_with_offset_entry, \
523 "diag_dump_buf_with_offset", \
524 diag_dump_buf_with_offset ); \
525 CYG_LDR_TABLE_ENTRY( diag_dump_buf_with_offset_32bit_entry, \
526 "diag_dump_buf_with_offset_32bit", \
527 diag_dump_buf_with_offset_32bit ); \
528 CYG_LDR_TABLE_ENTRY( diag_dump_buf_with_offset_16bit_entry, \
529 "diag_dump_buf_with_offset_16bit", \
530 diag_dump_buf_with_offset_16bit ); \
531 CYG_LDR_TABLE_ENTRY( diag_printf_entry, "diag_printf", diag_printf ); \
532 CYG_LDR_TABLE_ENTRY( diag_init_putc_entry, "diag_init_putc", diag_init_putc ); \
533 CYG_LDR_TABLE_ENTRY( diag_sprintf_entry, "diag_sprintf", diag_sprintf ); \
534 CYG_LDR_TABLE_ENTRY( diag_snprintf_entry, "diag_snprintf", diag_snprintf ); \
535 CYG_LDR_TABLE_ENTRY( diag_vsprintf_entry, "diag_vsprintf", diag_vsprintf ); \
536 CYG_LDR_TABLE_ENTRY( diag_vprintf_entry, "diag_vprintf", diag_vprintf );
538 //==============================================================================