diff options
author | Chris Johns <chrisj@rtems.org> | 2018-04-12 17:46:49 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2018-04-12 17:57:40 +1000 |
commit | f59d435d16261b04f97e293ab075e79624caf11d (patch) | |
tree | d37bc351bc95541388740069541f605af71203ff /cpukit/include/rtems | |
parent | testsuites/dl06: Add a test for RAP format. (diff) | |
download | rtems-f59d435d16261b04f97e293ab075e79624caf11d.tar.bz2 |
libdl: Remove _t from all structures as this is reserved for the standards
Diffstat (limited to '')
-rw-r--r-- | cpukit/include/rtems/rtl/rap.h | 6 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl-allocator.h | 40 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl-fwd.h | 6 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl-indirect-ptr.h | 54 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl-obj-cache.h | 32 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl-obj-comp.h | 46 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl-obj-fwd.h | 8 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl-obj.h | 226 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl-sym.h | 30 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl-unresolved.h | 86 | ||||
-rw-r--r-- | cpukit/include/rtems/rtl/rtl.h | 82 |
11 files changed, 308 insertions, 308 deletions
diff --git a/cpukit/include/rtems/rtl/rap.h b/cpukit/include/rtems/rtl/rap.h index 0b86553e2b..03cf096cb0 100644 --- a/cpukit/include/rtems/rtl/rap.h +++ b/cpukit/include/rtems/rtl/rap.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2013 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2013, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -42,7 +42,7 @@ extern "C" { /** * The module iterator handle. */ -typedef bool (*rtems_rap_iterator_t) (void* handle); +typedef bool (*rtems_rap_iterator) (void* handle); /** * Load an application. @@ -78,7 +78,7 @@ void* rtems_rap_find (const char* name); * @retval true The iterator function returned did not return false. * @retval false The iterator function returned false.. */ -bool rtems_rap_iterate (rtems_rap_iterator_t iterator); +bool rtems_rap_iterate (rtems_rap_iterator iterator); /** * Return the name of the module given a handle. diff --git a/cpukit/include/rtems/rtl/rtl-allocator.h b/cpukit/include/rtems/rtl/rtl-allocator.h index e8044ee1e8..c5b3d4ec72 100644 --- a/cpukit/include/rtems/rtl/rtl-allocator.h +++ b/cpukit/include/rtems/rtl/rtl-allocator.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -30,7 +30,7 @@ extern "C" { * @note It is best to use the object tag for general memory allocation and to * leave the tags with specific access properties to the module data */ -enum rtems_rtl_alloc_tags_e { +enum rtems_rtl_alloc_tags { RTEMS_RTL_ALLOC_OBJECT, /**< A generic memory object. */ RTEMS_RTL_ALLOC_SYMBOL, /**< Memory used for symbols. */ RTEMS_RTL_ALLOC_EXTERNAL, /**< Memory used for external symbols. */ @@ -42,7 +42,7 @@ enum rtems_rtl_alloc_tags_e { /** * The allocator tag type. */ -typedef enum rtems_rtl_alloc_tags_e rtems_rtl_alloc_tag_t; +typedef enum rtems_rtl_alloc_tags rtems_rtl_alloc_tag; /** * The number of tags. @@ -63,29 +63,29 @@ typedef enum rtems_rtl_alloc_tags_e rtems_rtl_alloc_tag_t; * @param size The size of the allocation if an allocation request and * not used if deleting or freeing a previous allocation. */ -typedef void (*rtems_rtl_allocator_t)(bool allocate, - rtems_rtl_alloc_tag_t tag, - void** address, - size_t size); +typedef void (*rtems_rtl_allocator)(bool allocate, + rtems_rtl_alloc_tag tag, + void** address, + size_t size); /** * The allocator data. */ -struct rtems_rtl_alloc_data_s { +struct rtems_rtl_alloc_data { /**< The memory allocator handler. */ - rtems_rtl_allocator_t allocator; + rtems_rtl_allocator allocator; /**< The indirect pointer chains. */ rtems_chain_control indirects[RTEMS_RTL_ALLOC_TAGS]; }; -typedef struct rtems_rtl_alloc_data_s rtems_rtl_alloc_data_t; +typedef struct rtems_rtl_alloc_data rtems_rtl_alloc_data; /** * Initialise the allocate data. * * @param data The data to initialise. */ -void rtems_rtl_alloc_initialise (rtems_rtl_alloc_data_t* data); +void rtems_rtl_alloc_initialise (rtems_rtl_alloc_data* data); /** * The Runtime Loader allocator new allocates new memory and optionally clear @@ -96,7 +96,7 @@ void rtems_rtl_alloc_initialise (rtems_rtl_alloc_data_t* data); * @param zero If true the memory is cleared. * @return void* The memory address or NULL is not memory available. */ -void* rtems_rtl_alloc_new (rtems_rtl_alloc_tag_t tag, size_t size, bool zero); +void* rtems_rtl_alloc_new (rtems_rtl_alloc_tag tag, size_t size, bool zero); /** * The Runtime Loader allocator delete deletes allocated memory. @@ -104,7 +104,7 @@ void* rtems_rtl_alloc_new (rtems_rtl_alloc_tag_t tag, size_t size, bool zero); * @param tag The type of allocation request. * @param address The memory address to delete. A NULL is ignored. */ -void rtems_rtl_alloc_del (rtems_rtl_alloc_tag_t tag, void* address); +void rtems_rtl_alloc_del (rtems_rtl_alloc_tag tag, void* address); /** * Hook the Runtime Loader allocatior. A handler can call the previous handler @@ -113,9 +113,9 @@ void rtems_rtl_alloc_del (rtems_rtl_alloc_tag_t tag, void* address); * returned. * * @param handler The handler to use as the allocator. - * @return rtems_rtl_alloc_handler_t The previous handler. + * @return rtems_rtl_alloc_handler The previous handler. */ -rtems_rtl_allocator_t rtems_rtl_alloc_hook (rtems_rtl_allocator_t handler); +rtems_rtl_allocator rtems_rtl_alloc_hook (rtems_rtl_allocator handler); /** * Allocate memory to an indirect handle. @@ -124,9 +124,9 @@ rtems_rtl_allocator_t rtems_rtl_alloc_hook (rtems_rtl_allocator_t handler); * @param handle The handle to allocate the memory to. * @param size The size of the allocation. */ -void rtems_rtl_alloc_indirect_new (rtems_rtl_alloc_tag_t tag, - rtems_rtl_ptr_t* handle, - size_t size); +void rtems_rtl_alloc_indirect_new (rtems_rtl_alloc_tag tag, + rtems_rtl_ptr* handle, + size_t size); /** * Free memory from an indirect handle. @@ -134,8 +134,8 @@ void rtems_rtl_alloc_indirect_new (rtems_rtl_alloc_tag_t tag, * @param tag The type of allocation request. * @param handle The handle to free the memory from. */ -void rtems_rtl_alloc_indirect_del (rtems_rtl_alloc_tag_t tag, - rtems_rtl_ptr_t* handle); +void rtems_rtl_alloc_indirect_del (rtems_rtl_alloc_tag tag, + rtems_rtl_ptr* handle); /** * Allocate the memory for a module given the size of the text, const, data and diff --git a/cpukit/include/rtems/rtl/rtl-fwd.h b/cpukit/include/rtems/rtl/rtl-fwd.h index 4641ad5d5e..b5b4eae495 100644 --- a/cpukit/include/rtems/rtl/rtl-fwd.h +++ b/cpukit/include/rtems/rtl/rtl-fwd.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -23,8 +23,8 @@ extern "C" { /** * The forward declaration of the obj structure. */ -struct rtems_rtl_data_s; -typedef struct rtems_rtl_data_s rtems_rtl_data_t; +struct rtems_rtl_data; +typedef struct rtems_rtl_data rtems_rtl_data; #ifdef __cplusplus } diff --git a/cpukit/include/rtems/rtl/rtl-indirect-ptr.h b/cpukit/include/rtems/rtl/rtl-indirect-ptr.h index 81503a3b45..dbfa70679c 100644 --- a/cpukit/include/rtems/rtl/rtl-indirect-ptr.h +++ b/cpukit/include/rtems/rtl/rtl-indirect-ptr.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -11,7 +11,7 @@ * @ingroup rtems_rtl * * @brief RTEMS Run-Time Linker Indirect Pointer Management allows memory - * compaction in the allocator. + * compaction in the allocator. */ #if !defined (_RTEMS_RTL_INDIRECT_PTR_H_) @@ -26,22 +26,22 @@ extern "C" { /** * The RTL Indirect pointer. */ -struct rtems_rtl_ptr_s { +struct rtems_rtl_ptr { rtems_chain_node node; /**< Indirect pointers are held on lists. */ void* pointer; /**< The actual pointer. */ }; -typedef struct rtems_rtl_ptr_s rtems_rtl_ptr_t; +typedef struct rtems_rtl_ptr rtems_rtl_ptr; /** * The RTL Indirect size and pointer. */ -struct rtems_rtl_sptr_s { - rtems_rtl_ptr_t ptr; /**< The indirect pointer. */ - size_t size; /**< The size of the memory block. */ +struct rtems_rtl_sptr { + rtems_rtl_ptr ptr; /**< The indirect pointer. */ + size_t size; /**< The size of the memory block. */ }; -typedef struct rtems_rtl_sptr_s rtems_rtl_sptr_t; +typedef struct rtems_rtl_sptr rtems_rtl_sptr; /** * A chain of indirect pointers for users to chain in applications. @@ -49,12 +49,12 @@ typedef struct rtems_rtl_sptr_s rtems_rtl_sptr_t; * @note The chain the pointer is on is internal to the allocator and cannot be * used by applications. */ -struct rtems_rtl_ptr_chain_s { +struct rtems_rtl_ptr_chain { rtems_chain_node node; /**< Chain of indirect pointers. */ - rtems_rtl_ptr_t ptr; /**< The indirect pointer. */ + rtems_rtl_ptr ptr; /**< The indirect pointer. */ }; -typedef struct rtems_rtl_ptr_chain_s rtems_rtl_ptr_chain_t; +typedef struct rtems_rtl_ptr_chain rtems_rtl_ptr_chain; /** * A chain of indirect sized pointers for users to chain in applications. @@ -62,12 +62,12 @@ typedef struct rtems_rtl_ptr_chain_s rtems_rtl_ptr_chain_t; * @note The chain the pointer is on is internal to the allocator and cannot be * used by applications. */ -struct rtems_rtl_sptr_chain_s { - rtems_chain_node node; /**< Chain of indirect pointers. */ - rtems_rtl_sptr_t ptr; /**< The indirect pointer. */ +struct rtems_rtl_sptr_chain { + rtems_chain_node node; /**< Chain of indirect pointers. */ + rtems_rtl_sptr ptr; /**< The indirect pointer. */ }; -typedef struct rtems_rtl_sptr_chain_s rtems_rtl_sptr_chain_t; +typedef struct rtems_rtl_sptr_chain rtems_rtl_sptr_chain; /** * Get the pointer given an indirect handle. @@ -75,7 +75,7 @@ typedef struct rtems_rtl_sptr_chain_s rtems_rtl_sptr_chain_t; * @param handle The handle the pointer is returned from. * @return void* The pointer held in the handle. */ -static inline void* rtems_rtl_ptr_get (rtems_rtl_ptr_t* handle) +static inline void* rtems_rtl_ptr_get (rtems_rtl_ptr* handle) { return handle->pointer; } @@ -86,7 +86,7 @@ static inline void* rtems_rtl_ptr_get (rtems_rtl_ptr_t* handle) * @param handle The handle the pointer is returned from. * @param pointer The pointer to set in the handle. */ -static inline void rtems_rtl_ptr_set (rtems_rtl_ptr_t* handle, void* pointer) +static inline void rtems_rtl_ptr_set (rtems_rtl_ptr* handle, void* pointer) { handle->pointer = pointer; } @@ -96,7 +96,7 @@ static inline void rtems_rtl_ptr_set (rtems_rtl_ptr_t* handle, void* pointer) * * @param handle The handle to initialise. */ -static inline void rtems_rtl_ptr_init (rtems_rtl_ptr_t* handle) +static inline void rtems_rtl_ptr_init (rtems_rtl_ptr* handle) { rtems_chain_set_off_chain (&handle->node); handle->pointer = NULL; @@ -108,7 +108,7 @@ static inline void rtems_rtl_ptr_init (rtems_rtl_ptr_t* handle) * @param handle The handle to test. * @return bool True if the pointer is NULL. */ -static inline bool rtems_rtl_ptr_null (rtems_rtl_ptr_t* handle) +static inline bool rtems_rtl_ptr_null (rtems_rtl_ptr* handle) { return handle->pointer == NULL; } @@ -120,7 +120,7 @@ static inline bool rtems_rtl_ptr_null (rtems_rtl_ptr_t* handle) * @param src The source handle to move the pointer from. * @param dst The destination handle to receive the pointer. */ -static inline void rtems_rtl_ptr_move (rtems_rtl_ptr_t* dst, rtems_rtl_ptr_t* src) +static inline void rtems_rtl_ptr_move (rtems_rtl_ptr* dst, rtems_rtl_ptr* src) { /* * We do not know which chain the src handle resides on so insert the dst @@ -146,7 +146,7 @@ static inline void rtems_rtl_ptr_move (rtems_rtl_ptr_t* dst, rtems_rtl_ptr_t* sr * @param handle The handle the pointer is returned from. * @return void* The pointer held in the handle. */ -static inline void* rtems_rtl_sptr_get (rtems_rtl_sptr_t* handle) +static inline void* rtems_rtl_sptr_get (rtems_rtl_sptr* handle) { return rtems_rtl_ptr_get (&handle->ptr); } @@ -157,7 +157,7 @@ static inline void* rtems_rtl_sptr_get (rtems_rtl_sptr_t* handle) * @param handle The handle the pointer is returned from. * @param pointer The pointer to set in the handle. */ -static inline void rtems_rtl_sptr_set (rtems_rtl_sptr_t* handle, void* pointer) +static inline void rtems_rtl_sptr_set (rtems_rtl_sptr* handle, void* pointer) { rtems_rtl_ptr_set (&handle->ptr, pointer); } @@ -167,7 +167,7 @@ static inline void rtems_rtl_sptr_set (rtems_rtl_sptr_t* handle, void* pointer) * * @param handle The handle to initialise. */ -static inline void rtems_rtl_sptr_init (rtems_rtl_sptr_t* handle) +static inline void rtems_rtl_sptr_init (rtems_rtl_sptr* handle) { rtems_rtl_ptr_init (&handle->ptr); handle->size = 0; @@ -179,7 +179,7 @@ static inline void rtems_rtl_sptr_init (rtems_rtl_sptr_t* handle) * @param handle The handle to test. * @return bool True if the pointer is NULL. */ -static inline bool rtems_rtl_sptr_null (rtems_rtl_sptr_t* handle) +static inline bool rtems_rtl_sptr_null (rtems_rtl_sptr* handle) { return rtems_rtl_ptr_null (&handle->ptr); } @@ -191,7 +191,7 @@ static inline bool rtems_rtl_sptr_null (rtems_rtl_sptr_t* handle) * @param src The source handle to move the pointer from. * @param dst The destination handle to receive the pointer. */ -static inline void rtems_rtl_sptr_move (rtems_rtl_sptr_t* dst, rtems_rtl_sptr_t* src) +static inline void rtems_rtl_sptr_move (rtems_rtl_sptr* dst, rtems_rtl_sptr* src) { rtems_rtl_ptr_move (&dst->ptr, &src->ptr); dst->size = src->size; @@ -204,7 +204,7 @@ static inline void rtems_rtl_sptr_move (rtems_rtl_sptr_t* dst, rtems_rtl_sptr_t* * @param handle The handle to get the size from. * @return size_t The size_t. */ -static inline size_t rtems_rtl_sptr_get_size (rtems_rtl_sptr_t* handle) +static inline size_t rtems_rtl_sptr_get_size (rtems_rtl_sptr* handle) { return handle->size; } @@ -215,7 +215,7 @@ static inline size_t rtems_rtl_sptr_get_size (rtems_rtl_sptr_t* handle) * @param handle The handle to set the size. * @param size The size to set.. */ -static inline void rtems_rtl_sptr_set_size (rtems_rtl_sptr_t* handle, size_t size) +static inline void rtems_rtl_sptr_set_size (rtems_rtl_sptr* handle, size_t size) { handle->size = size; } diff --git a/cpukit/include/rtems/rtl/rtl-obj-cache.h b/cpukit/include/rtems/rtl/rtl-obj-cache.h index 8eacdd316b..3613e88246 100644 --- a/cpukit/include/rtems/rtl/rtl-obj-cache.h +++ b/cpukit/include/rtems/rtl/rtl-obj-cache.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -50,7 +50,7 @@ extern "C" { /** * The buffer cache. */ -typedef struct rtems_rtl_obj_cache_s +typedef struct rtems_rtl_obj_cache { int fd; /**< The file descriptor of the data in the cache. */ size_t file_size; /**< The size of the file. */ @@ -59,7 +59,7 @@ typedef struct rtems_rtl_obj_cache_s size_t level; /**< The amount of data in the cache. A file can be * smaller than the cache file. */ uint8_t* buffer; /**< The buffer */ -} rtems_rtl_obj_cache_t; +} rtems_rtl_obj_cache; /** * Open a cache allocating a single buffer of the size passed. The default @@ -70,21 +70,21 @@ typedef struct rtems_rtl_obj_cache_s * @retval true The cache is open. * @retval false The cache is not open. The RTL error is set. */ -bool rtems_rtl_obj_cache_open (rtems_rtl_obj_cache_t* cache, size_t size); +bool rtems_rtl_obj_cache_open (rtems_rtl_obj_cache* cache, size_t size); /** * Close a cache. * * @param cache The cache to close. */ -void rtems_rtl_obj_cache_close (rtems_rtl_obj_cache_t* cache); +void rtems_rtl_obj_cache_close (rtems_rtl_obj_cache* cache); /** * Flush the cache. Any further read will read the data from the file. * * @param cache The cache to flush. */ -void rtems_rtl_obj_cache_flush (rtems_rtl_obj_cache_t* cache); +void rtems_rtl_obj_cache_flush (rtems_rtl_obj_cache* cache); /** * Read data by reference. The length contains the amount of data that should @@ -102,11 +102,11 @@ void rtems_rtl_obj_cache_flush (rtems_rtl_obj_cache_t* cache); * @retval true The data referenced is in the cache. * @retval false The read failed and the RTL error has been set. */ -bool rtems_rtl_obj_cache_read (rtems_rtl_obj_cache_t* cache, - int fd, - off_t offset, - void** buffer, - size_t* length); +bool rtems_rtl_obj_cache_read (rtems_rtl_obj_cache* cache, + int fd, + off_t offset, + void** buffer, + size_t* length); /** * Read data by value. The data is copied to the user supplied buffer. @@ -119,11 +119,11 @@ bool rtems_rtl_obj_cache_read (rtems_rtl_obj_cache_t* cache, * @retval true The data has been read from the cache. * @retval false The read failed and the RTL error has been set. */ -bool rtems_rtl_obj_cache_read_byval (rtems_rtl_obj_cache_t* cache, - int fd, - off_t offset, - void* buffer, - size_t length); +bool rtems_rtl_obj_cache_read_byval (rtems_rtl_obj_cache* cache, + int fd, + off_t offset, + void* buffer, + size_t length); #ifdef __cplusplus } diff --git a/cpukit/include/rtems/rtl/rtl-obj-comp.h b/cpukit/include/rtems/rtl/rtl-obj-comp.h index 34bfa6ffa1..963824b277 100644 --- a/cpukit/include/rtems/rtl/rtl-obj-comp.h +++ b/cpukit/include/rtems/rtl/rtl-obj-comp.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -43,23 +43,23 @@ extern "C" { /** * The compressed file. */ -typedef struct rtems_rtl_obj_cpmp_s +typedef struct rtems_rtl_obj_cpmp { - rtems_rtl_obj_cache_t* cache; /**< The cache provides the input + rtems_rtl_obj_cache* cache; /**< The cache provides the input * buffer. */ - int fd; /**< The file descriptor. */ - int compression; /**< The type of compression. */ - off_t offset; /**< The base offset of the buffer. */ - size_t size; /**< The size of the output buffer. */ - size_t level; /**< The amount of data in the buffer. */ - uint8_t* buffer; /**< The buffer */ - uint32_t read; /**< The amount of data read. */ -} rtems_rtl_obj_comp_t; + int fd; /**< The file descriptor. */ + int compression; /**< The type of compression. */ + off_t offset; /**< The base offset of the buffer. */ + size_t size; /**< The size of the output buffer. */ + size_t level; /**< The amount of data in the buffer. */ + uint8_t* buffer; /**< The buffer */ + uint32_t read; /**< The amount of data read. */ +} rtems_rtl_obj_comp; /** * Return the input level. */ -static inline uint32_t rtems_rtl_obj_comp_input (rtems_rtl_obj_comp_t* comp) +static inline uint32_t rtems_rtl_obj_comp_input (rtems_rtl_obj_comp* comp) { return comp->read; } @@ -72,15 +72,15 @@ static inline uint32_t rtems_rtl_obj_comp_input (rtems_rtl_obj_comp_t* comp) * @retval true The compressor is open. * @retval false The compressor is not open. The RTL error is set. */ -bool rtems_rtl_obj_comp_open (rtems_rtl_obj_comp_t* comp, - size_t size); +bool rtems_rtl_obj_comp_open (rtems_rtl_obj_comp* comp, + size_t size); /** * Close a compressor. * * @param comp The compressor to close. */ -void rtems_rtl_obj_comp_close (rtems_rtl_obj_comp_t* comp); +void rtems_rtl_obj_comp_close (rtems_rtl_obj_comp* comp); /** * Set the cache and offset in the file the compressed stream starts. @@ -91,11 +91,11 @@ void rtems_rtl_obj_comp_close (rtems_rtl_obj_comp_t* comp); * @param compression The type of compression being streamed. * @param offset The offset in the file the compressed stream starts. */ -void rtems_rtl_obj_comp_set (rtems_rtl_obj_comp_t* comp, - rtems_rtl_obj_cache_t* cache, - int fd, - int compression, - off_t offset); +void rtems_rtl_obj_comp_set (rtems_rtl_obj_comp* comp, + rtems_rtl_obj_cache* cache, + int fd, + int compression, + off_t offset); /** * Read decompressed data. The length contains the amount of data that should @@ -111,9 +111,9 @@ void rtems_rtl_obj_comp_set (rtems_rtl_obj_comp_t* comp, * @retval true The data referenced is in the cache. * @retval false The read failed and the RTL error has been set. */ -bool rtems_rtl_obj_comp_read (rtems_rtl_obj_comp_t* comp, - void* buffer, - size_t length); +bool rtems_rtl_obj_comp_read (rtems_rtl_obj_comp* comp, + void* buffer, + size_t length); #ifdef __cplusplus } diff --git a/cpukit/include/rtems/rtl/rtl-obj-fwd.h b/cpukit/include/rtems/rtl/rtl-obj-fwd.h index 2c53244316..39e28c58e1 100644 --- a/cpukit/include/rtems/rtl/rtl-obj-fwd.h +++ b/cpukit/include/rtems/rtl/rtl-obj-fwd.h @@ -23,14 +23,14 @@ extern "C" { /** * The forward declaration of the obj section structure. */ -struct rtems_rtl_obj_sect_s; -typedef struct rtems_rtl_obj_sect_s rtems_rtl_obj_sect_t; +struct rtems_rtl_obj_sect; +typedef struct rtems_rtl_obj_sect rtems_rtl_obj_sect; /** * The forward declaration of the obj structure. */ -struct rtems_rtl_obj_s; -typedef struct rtems_rtl_obj_s rtems_rtl_obj_t; +struct rtems_rtl_obj; +typedef struct rtems_rtl_obj rtems_rtl_obj; #ifdef __cplusplus } diff --git a/cpukit/include/rtems/rtl/rtl-obj.h b/cpukit/include/rtems/rtl/rtl-obj.h index 6a35a72822..ff7b2a197d 100644 --- a/cpukit/include/rtems/rtl/rtl-obj.h +++ b/cpukit/include/rtems/rtl/rtl-obj.h @@ -35,7 +35,7 @@ extern "C" { /** * Loader format definition. */ -typedef struct rtems_rtl_loader_format_s +typedef struct rtems_rtl_loader_format { /** * The format label. This can be used to determine and manage @@ -47,42 +47,42 @@ typedef struct rtems_rtl_loader_format_s * The format flags. */ uint32_t flags; -} rtems_rtl_loader_format_t; +} rtems_rtl_loader_format; /** * The type of the format loader check handler. This handler checks the format * and if it is detected as suitable it returns true. */ -typedef bool (*rtems_rtl_loader_check) (rtems_rtl_obj_t* obj, int fd); +typedef bool (*rtems_rtl_loader_check) (rtems_rtl_obj* obj, int fd); /** * The type of the format loader load handler. This handler loads the specific * format. */ -typedef bool (*rtems_rtl_loader_load) (rtems_rtl_obj_t* obj, int fd); +typedef bool (*rtems_rtl_loader_load) (rtems_rtl_obj* obj, int fd); /** * The type of the format loader unload handler. This handler unloads the * specific format. */ -typedef bool (*rtems_rtl_loader_unload) (rtems_rtl_obj_t* obj); +typedef bool (*rtems_rtl_loader_unload) (rtems_rtl_obj* obj); /** * The type of the format loader signature handler. This handler checks the * format signature. */ -typedef rtems_rtl_loader_format_t* (*rtems_rtl_loader_sig) (void); +typedef rtems_rtl_loader_format* (*rtems_rtl_loader_sig) (void); /** * Table for supported loadable formats. */ -typedef struct rtems_rtl_loader_table_s +typedef struct rtems_rtl_loader_table { rtems_rtl_loader_check check; /**< The check handler. */ rtems_rtl_loader_load load; /**< The loader. */ rtems_rtl_loader_unload unload; /**< The unloader. */ rtems_rtl_loader_sig signature; /**< The loader's signature. */ -} rtems_rtl_loader_table_t; +} rtems_rtl_loader_table; /** * Flags for the various section types. @@ -121,7 +121,7 @@ typedef struct rtems_rtl_loader_table_s * one of a specific type of sections. All sections and grouped * together in memory. */ -struct rtems_rtl_obj_sect_s +struct rtems_rtl_obj_sect { rtems_chain_node node; /**< The node's link in the chain. */ int section; /**< The section number. */ @@ -150,51 +150,51 @@ struct rtems_rtl_obj_sect_s * RTL Object. There is one for each object module loaded plus one for the base * kernel image. */ -struct rtems_rtl_obj_s +struct rtems_rtl_obj { - rtems_chain_node link; /**< The node's link in the chain. */ - uint32_t flags; /**< The status of the object file. */ - uint32_t users; /**< References to the object file. */ - int format; /**< The format of the object file. */ - const char* fname; /**< The file name for the object. */ - const char* oname; /**< The object file name. Can be - * relative. */ - const char* aname; /**< The archive name containing the - * object. NULL means the object is not - * in a lib */ - off_t ooffset; /**< The object offset in the archive. */ - size_t fsize; /**< Size of the object file. */ - rtems_chain_control sections; /**< The sections of interest in the - * object file. */ - rtems_rtl_obj_sym_t* local_table; /**< Local symbol table. */ - size_t local_syms; /**< Local symbol count. */ - size_t local_size; /**< Local symbol memory usage. */ - rtems_rtl_obj_sym_t* global_table; /**< Global symbol table. */ - size_t global_syms; /**< Global symbol count. */ - size_t global_size; /**< Global symbol memory usage. */ - uint32_t unresolved; /**< The number of unresolved relocations. */ - void* text_base; /**< The base address of the text section - * in memory. */ - size_t text_size; /**< The size of the text section. */ - void* const_base; /**< The base address of the const section - * in memory. */ - void* eh_base; /**< The base address of the eh section - * in memory. */ - size_t eh_size; /**< The size of the eh section. */ - void* data_base; /**< The base address of the data section - * in memory. */ - void* bss_base; /**< The base address of the bss section - * in memory. */ - size_t bss_size; /**< The size of the bss section. */ - size_t exec_size; /**< The amount of executable memory - * allocated */ - void* entry; /**< The entry point of the module. */ - uint32_t checksum; /**< The checksum of the text sections. A - * zero means do not checksum. */ - uint32_t* sec_num; /**< The sec nums of each obj. */ - uint32_t obj_num; /**< The count of elf files in an rtl obj. */ - struct link_map* linkmap; /**< For GDB. */ - void* loader; /**< The file details specific to a loader. */ + rtems_chain_node link; /**< The node's link in the chain. */ + uint32_t flags; /**< The status of the object file. */ + uint32_t users; /**< References to the object file. */ + int format; /**< The format of the object file. */ + const char* fname; /**< The file name for the object. */ + const char* oname; /**< The object file name. Can be + * relative. */ + const char* aname; /**< The archive name containing the + * object. NULL means the object is not + * in a lib */ + off_t ooffset; /**< The object offset in the archive. */ + size_t fsize; /**< Size of the object file. */ + rtems_chain_control sections; /**< The sections of interest in the + * object file. */ + rtems_rtl_obj_sym* local_table; /**< Local symbol table. */ + size_t local_syms; /**< Local symbol count. */ + size_t local_size; /**< Local symbol memory usage. */ + rtems_rtl_obj_sym* global_table; /**< Global symbol table. */ + size_t global_syms; /**< Global symbol count. */ + size_t global_size; /**< Global symbol memory usage. */ + uint32_t unresolved; /**< The number of unresolved relocations. */ + void* text_base; /**< The base address of the text section + * in memory. */ + size_t text_size; /**< The size of the text section. */ + void* const_base; /**< The base address of the const section + * in memory. */ + void* eh_base; /**< The base address of the eh section + * in memory. */ + size_t eh_size; /**< The size of the eh section. */ + void* data_base; /**< The base address of the data section + * in memory. */ + void* bss_base; /**< The base address of the bss section + * in memory. */ + size_t bss_size; /**< The size of the bss section. */ + size_t exec_size; /**< The amount of executable memory + * allocated */ + void* entry; /**< The entry point of the module. */ + uint32_t checksum; /**< The checksum of the text sections. A + * zero means do not checksum. */ + uint32_t* sec_num; /**< The sec nums of each obj. */ + uint32_t obj_num; /**< The count of elf files in an rtl obj. */ + struct link_map* linkmap; /**< For GDB. */ + void* loader; /**< The file details specific to a loader. */ }; /** @@ -208,10 +208,10 @@ struct rtems_rtl_obj_s * @retval true The operation was successful. * @retval false The operation failed and the RTL has been set. */ -typedef bool (*rtems_rtl_obj_sect_handler_t)(rtems_rtl_obj_t* obj, - int fd, - rtems_rtl_obj_sect_t* sect, - void* data); +typedef bool (*rtems_rtl_obj_sect_handler)(rtems_rtl_obj* obj, + int fd, + rtems_rtl_obj_sect* sect, + void* data); /** * Get the file name. @@ -219,7 +219,7 @@ typedef bool (*rtems_rtl_obj_sect_handler_t)(rtems_rtl_obj_t* obj, * @param obj The object file. * @return const char* The string. */ -static inline const char* rtems_rtl_obj_fname (const rtems_rtl_obj_t* obj) +static inline const char* rtems_rtl_obj_fname (const rtems_rtl_obj* obj) { return obj->fname; } @@ -230,7 +230,7 @@ static inline const char* rtems_rtl_obj_fname (const rtems_rtl_obj_t* obj) * @param obj The object file. * @return bool There is a file name */ -static inline bool rtems_rtl_obj_fname_valid (const rtems_rtl_obj_t* obj) +static inline bool rtems_rtl_obj_fname_valid (const rtems_rtl_obj* obj) { return obj->fname; } @@ -241,7 +241,7 @@ static inline bool rtems_rtl_obj_fname_valid (const rtems_rtl_obj_t* obj) * @param obj The object file. * @return const char* The string. */ -static inline const char* rtems_rtl_obj_oname (const rtems_rtl_obj_t* obj) +static inline const char* rtems_rtl_obj_oname (const rtems_rtl_obj* obj) { return obj->oname; } @@ -252,7 +252,7 @@ static inline const char* rtems_rtl_obj_oname (const rtems_rtl_obj_t* obj) * @param obj The object file. * @return bool There is an object name */ -static inline bool rtems_rtl_obj_oname_valid (const rtems_rtl_obj_t* obj) +static inline bool rtems_rtl_obj_oname_valid (const rtems_rtl_obj* obj) { return obj->oname; } @@ -263,7 +263,7 @@ static inline bool rtems_rtl_obj_oname_valid (const rtems_rtl_obj_t* obj) * @param obj The object file. * @return const char* The string. */ -static inline const char* rtems_rtl_obj_aname (const rtems_rtl_obj_t* obj) +static inline const char* rtems_rtl_obj_aname (const rtems_rtl_obj* obj) { return obj->aname; } @@ -274,7 +274,7 @@ static inline const char* rtems_rtl_obj_aname (const rtems_rtl_obj_t* obj) * @param obj The object file. * @return bool There is an archive name */ -static inline bool rtems_rtl_obj_aname_valid (const rtems_rtl_obj_t* obj) +static inline bool rtems_rtl_obj_aname_valid (const rtems_rtl_obj* obj) { return obj->aname; } @@ -285,8 +285,8 @@ static inline bool rtems_rtl_obj_aname_valid (const rtems_rtl_obj_t* obj) * @param obj The object file. * @return bool There is an archive name */ -static inline bool rtems_rtl_obj_text_inside (const rtems_rtl_obj_t* obj, - const void* address) +static inline bool rtems_rtl_obj_text_inside (const rtems_rtl_obj* obj, + const void* address) { return (address >= obj->text_base) && @@ -298,7 +298,7 @@ static inline bool rtems_rtl_obj_text_inside (const rtems_rtl_obj_t* obj, * * @retval NULL No memory for the object. */ -rtems_rtl_obj_t* rtems_rtl_obj_alloc (void); +rtems_rtl_obj* rtems_rtl_obj_alloc (void); /** * Free the object structure and related resources. @@ -307,7 +307,7 @@ rtems_rtl_obj_t* rtems_rtl_obj_alloc (void); * @retval false The object has dependences. * @retval true The object has been freed. */ -bool rtems_rtl_obj_free (rtems_rtl_obj_t* obj); +bool rtems_rtl_obj_free (rtems_rtl_obj* obj); /** * Does the object file have unresolved external references ? If it does the @@ -317,7 +317,7 @@ bool rtems_rtl_obj_free (rtems_rtl_obj_t* obj); * @retval true The object file has unresolved externals. * @retval false The object file has all external references resolved. */ -bool rtems_rtl_obj_unresolved (rtems_rtl_obj_t* obj); +bool rtems_rtl_obj_unresolved (rtems_rtl_obj* obj); /** * Parses a filename and returns newly allocated strings with the archive name, @@ -341,7 +341,7 @@ bool rtems_rtl_parse_name (const char* name, * @param obj The object file's descriptor. * @param name The name to match. */ -bool rtems_rtl_match_name (rtems_rtl_obj_t* obj, const char* name); +bool rtems_rtl_match_name (rtems_rtl_obj* obj, const char* name); /** * Find an object file on disk that matches the name. The object descriptor is @@ -353,7 +353,7 @@ bool rtems_rtl_match_name (rtems_rtl_obj_t* obj, const char* name); * @retval true The file has been found. * @retval false The file could not be located. The RTL error has been set. */ -bool rtems_rtl_obj_find_file (rtems_rtl_obj_t* obj, const char* name); +bool rtems_rtl_obj_find_file (rtems_rtl_obj* obj, const char* name); /** * Add a section to the object descriptor. @@ -370,22 +370,22 @@ bool rtems_rtl_obj_find_file (rtems_rtl_obj_t* obj, const char* name); * @retval true The section has been added. * @retval false The section has not been added. See the RTL error. */ -bool rtems_rtl_obj_add_section (rtems_rtl_obj_t* obj, - int section, - const char* name, - size_t size, - off_t offset, - uint32_t alignment, - int link, - int info, - uint32_t flags); +bool rtems_rtl_obj_add_section (rtems_rtl_obj* obj, + int section, + const char* name, + size_t size, + off_t offset, + uint32_t alignment, + int link, + int info, + uint32_t flags); /** * Erase the object file descriptor's sections. * * @param obj The object file's descriptor. */ -void rtems_rtl_obj_erase_sections (rtems_rtl_obj_t* obj); +void rtems_rtl_obj_erase_sections (rtems_rtl_obj* obj); /** * Find the section given a name. @@ -395,8 +395,8 @@ void rtems_rtl_obj_erase_sections (rtems_rtl_obj_t* obj); * @retval NULL The section was not found. * @return rtems_rtl_obj_sect_t* The named section. */ -rtems_rtl_obj_sect_t* rtems_rtl_obj_find_section (const rtems_rtl_obj_t* obj, - const char* name); +rtems_rtl_obj_sect* rtems_rtl_obj_find_section (const rtems_rtl_obj* obj, + const char* name); /** * Find a section given a section's index number. @@ -406,8 +406,8 @@ rtems_rtl_obj_sect_t* rtems_rtl_obj_find_section (const rtems_rtl_obj_t* obj, * @retval NULL The section was not found. * @return rtems_rtl_obj_sect_t* The found section. */ -rtems_rtl_obj_sect_t* rtems_rtl_obj_find_section_by_index (const rtems_rtl_obj_t* obj, - int index); +rtems_rtl_obj_sect* rtems_rtl_obj_find_section_by_index (const rtems_rtl_obj* obj, + int index); /** * The text section size. Only use once all the sections has been added. It @@ -417,7 +417,7 @@ rtems_rtl_obj_sect_t* rtems_rtl_obj_find_section_by_index (const rtems_rtl_obj_t * @param obj The object file's descriptor. * @return size_t The size of the text area of the object file. */ -size_t rtems_rtl_obj_text_size (const rtems_rtl_obj_t* obj); +size_t rtems_rtl_obj_text_size (const rtems_rtl_obj* obj); /** * The text section alignment for the object file. Only use once all the @@ -430,7 +430,7 @@ size_t rtems_rtl_obj_text_size (const rtems_rtl_obj_t* obj); * @param obj The object file's descriptor. * @return uint32_t The alignment. Can be 0 or 1 for not aligned or the alignment. */ -uint32_t rtems_rtl_obj_text_alignment (const rtems_rtl_obj_t* obj); +uint32_t rtems_rtl_obj_text_alignment (const rtems_rtl_obj* obj); /** * The const section size. Only use once all the sections has been added. It @@ -440,7 +440,7 @@ uint32_t rtems_rtl_obj_text_alignment (const rtems_rtl_obj_t* obj); * @param obj The object file's descriptor. * @return size_t The size of the const area of the object file. */ -size_t rtems_rtl_obj_const_size (const rtems_rtl_obj_t* obj); +size_t rtems_rtl_obj_const_size (const rtems_rtl_obj* obj); /** * The const section alignment for the object file. Only use once all the @@ -453,7 +453,7 @@ size_t rtems_rtl_obj_const_size (const rtems_rtl_obj_t* obj); * @param obj The object file's descriptor. * @return uint32_t The alignment. Can be 0 or 1 for not aligned or the alignment. */ -uint32_t rtems_rtl_obj_const_alignment (const rtems_rtl_obj_t* obj); +uint32_t rtems_rtl_obj_const_alignment (const rtems_rtl_obj* obj); /** * The eh section size. Only use once all the sections has been added. It @@ -462,7 +462,7 @@ uint32_t rtems_rtl_obj_const_alignment (const rtems_rtl_obj_t* obj); * @param obj The object file's descriptor. * @return size_t The size of the bss area of the object file. */ -size_t rtems_rtl_obj_eh_size (const rtems_rtl_obj_t* obj); +size_t rtems_rtl_obj_eh_size (const rtems_rtl_obj* obj); /** * The eh section alignment for the object file. Only use once all the sections @@ -475,7 +475,7 @@ size_t rtems_rtl_obj_eh_size (const rtems_rtl_obj_t* obj); * @param obj The object file's descriptor. * @return uint32_t The alignment. Can be 0 or 1 for not aligned or the alignment. */ -uint32_t rtems_rtl_obj_eh_alignment (const rtems_rtl_obj_t* obj); +uint32_t rtems_rtl_obj_eh_alignment (const rtems_rtl_obj* obj); /** * The data section size. Only use once all the sections has been added. It @@ -485,7 +485,7 @@ uint32_t rtems_rtl_obj_eh_alignment (const rtems_rtl_obj_t* obj); * @param obj The object file's descriptor. * @return size_t The size of the data area of the object file. */ -size_t rtems_rtl_obj_data_size (const rtems_rtl_obj_t* obj); +size_t rtems_rtl_obj_data_size (const rtems_rtl_obj* obj); /** * The data section alignment for the object file. Only use once all the @@ -498,7 +498,7 @@ size_t rtems_rtl_obj_data_size (const rtems_rtl_obj_t* obj); * @param obj The object file's descriptor. * @return uint32_t The alignment. Can be 0 or 1 for not aligned or the alignment. */ -uint32_t rtems_rtl_obj_data_alignment (const rtems_rtl_obj_t* obj); +uint32_t rtems_rtl_obj_data_alignment (const rtems_rtl_obj* obj); /** * The bss section size. Only use once all the sections has been added. It @@ -507,7 +507,7 @@ uint32_t rtems_rtl_obj_data_alignment (const rtems_rtl_obj_t* obj); * @param obj The object file's descriptor. * @return size_t The size of the bss area of the object file. */ -size_t rtems_rtl_obj_bss_size (const rtems_rtl_obj_t* obj); +size_t rtems_rtl_obj_bss_size (const rtems_rtl_obj* obj); /** * The bss section alignment for the object file. Only use once all the @@ -520,7 +520,7 @@ size_t rtems_rtl_obj_bss_size (const rtems_rtl_obj_t* obj); * @param obj The object file's descriptor. * @return uint32_t The alignment. Can be 0 or 1 for not aligned or the alignment. */ -uint32_t rtems_rtl_obj_bss_alignment (const rtems_rtl_obj_t* obj); +uint32_t rtems_rtl_obj_bss_alignment (const rtems_rtl_obj* obj); /** * Relocate the object file. The object file's section are parsed for any @@ -533,17 +533,17 @@ uint32_t rtems_rtl_obj_bss_alignment (const rtems_rtl_obj_t* obj); * @retval true The object file was relocated. * @retval false The relocation failed. The RTL error is set. */ -bool rtems_rtl_obj_relocate (rtems_rtl_obj_t* obj, - int fd, - rtems_rtl_obj_sect_handler_t handler, - void* data); +bool rtems_rtl_obj_relocate (rtems_rtl_obj* obj, + int fd, + rtems_rtl_obj_sect_handler handler, + void* data); /** * Synchronize caches to make code visible to CPU(s) * * @param obj The object file's descriptor. */ -void rtems_rtl_obj_synchronize_cache (rtems_rtl_obj_t* obj); +void rtems_rtl_obj_synchronize_cache (rtems_rtl_obj* obj); /** * Relocate an object file's unresolved reference. @@ -553,8 +553,8 @@ void rtems_rtl_obj_synchronize_cache (rtems_rtl_obj_t* obj); * @retval true The object file record was relocated. * @retval false The relocation failed. The RTL error is set. */ -bool rtems_rtl_obj_relocate_unresolved (rtems_rtl_unresolv_reloc_t* reloc, - rtems_rtl_obj_sym_t* sym); +bool rtems_rtl_obj_relocate_unresolved (rtems_rtl_unresolv_reloc* reloc, + rtems_rtl_obj_sym* sym); /** * Load the symbols from the object file. Only the exported or public symbols @@ -567,10 +567,10 @@ bool rtems_rtl_obj_relocate_unresolved (rtems_rtl_unresolv_reloc_t* reloc, * @retval true The object file's symbol where loaded. * @retval false The symbol loading failed. The RTL error is set. */ -bool rtems_rtl_obj_load_symbols (rtems_rtl_obj_t* obj, - int fd, - rtems_rtl_obj_sect_handler_t handler, - void* data); +bool rtems_rtl_obj_load_symbols (rtems_rtl_obj* obj, + int fd, + rtems_rtl_obj_sect_handler handler, + void* data); /** * Load the sections that have been allocated memory in the target. The bss @@ -584,10 +584,10 @@ bool rtems_rtl_obj_load_symbols (rtems_rtl_obj_t* obj, * @retval true The object has been sucessfully loaded. * @retval false The load failed. The RTL error has been set. */ -bool rtems_rtl_obj_load_sections (rtems_rtl_obj_t* obj, - int fd, - rtems_rtl_obj_sect_handler_t handler, - void* data); +bool rtems_rtl_obj_load_sections (rtems_rtl_obj* obj, + int fd, + rtems_rtl_obj_sect_handler handler, + void* data); /** * Invoke the constructors the object has. Constructors are a table of pointers @@ -597,7 +597,7 @@ bool rtems_rtl_obj_load_sections (rtems_rtl_obj_t* obj, * * @param obj The object file's descriptor. */ -void rtems_rtl_obj_run_ctors (rtems_rtl_obj_t* obj); +void rtems_rtl_obj_run_ctors (rtems_rtl_obj* obj); /** * Invoke the destructors the object has. Destructors are a table of pointers @@ -607,7 +607,7 @@ void rtems_rtl_obj_run_ctors (rtems_rtl_obj_t* obj); * * @param obj The object file's descriptor. */ -void rtems_rtl_obj_run_dtors (rtems_rtl_obj_t* obj); +void rtems_rtl_obj_run_dtors (rtems_rtl_obj* obj); /** * Load the object file, reading all sections into memory, symbols and @@ -617,7 +617,7 @@ void rtems_rtl_obj_run_dtors (rtems_rtl_obj_t* obj); * @retval true The object file has been loaded. * @retval false The load failed. The RTL error has been set. */ -bool rtems_rtl_obj_load (rtems_rtl_obj_t* obj); +bool rtems_rtl_obj_load (rtems_rtl_obj* obj); /** * Unload the object file, erasing all symbols and releasing all memory. @@ -626,7 +626,7 @@ bool rtems_rtl_obj_load (rtems_rtl_obj_t* obj); * @retval true The object file has been unloaded. * @retval false The unload failed. The RTL error has been set. */ -bool rtems_rtl_obj_unload (rtems_rtl_obj_t* obj); +bool rtems_rtl_obj_unload (rtems_rtl_obj* obj); #ifdef __cplusplus } diff --git a/cpukit/include/rtems/rtl/rtl-sym.h b/cpukit/include/rtems/rtl/rtl-sym.h index fe00da89d7..be246a908d 100644 --- a/cpukit/include/rtems/rtl/rtl-sym.h +++ b/cpukit/include/rtems/rtl/rtl-sym.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2012-2014 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2012-2014, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -26,22 +26,22 @@ extern "C" { /** * An object file symbol. */ -typedef struct rtems_rtl_obj_sym_s +typedef struct rtems_rtl_obj_sym { rtems_chain_node node; /**< The node's link in the chain. */ const char* name; /**< The symbol's name. */ void* value; /**< The value of the symbol. */ uint32_t data; /**< Format specific data. */ -} rtems_rtl_obj_sym_t; +} rtems_rtl_obj_sym; /** * Table of symbols stored in a hash table. */ -typedef struct rtems_rtl_symbols_s +typedef struct rtems_rtl_symbols { rtems_chain_control* buckets; size_t nbuckets; -} rtems_rtl_symbols_t; +} rtems_rtl_symbols; /** * Open a symbol table with the specified number of buckets. @@ -52,15 +52,15 @@ typedef struct rtems_rtl_symbols_s * @retval false The symbol table could not created. The RTL * error has the error. */ -bool rtems_rtl_symbol_table_open (rtems_rtl_symbols_t* symbols, - size_t buckets); +bool rtems_rtl_symbol_table_open (rtems_rtl_symbols* symbols, + size_t buckets); /** * Close the table and erase the hash table. * * @param symbols Close the symbol table. */ -void rtems_rtl_symbol_table_close (rtems_rtl_symbols_t* symbols); +void rtems_rtl_symbol_table_close (rtems_rtl_symbols* symbols); /** * Add a table of exported symbols to the symbol table. @@ -83,7 +83,7 @@ void rtems_rtl_symbol_table_close (rtems_rtl_symbols_t* symbols); * @param esyms The exported symbol table. * @param size The size of the table in bytes. */ -bool rtems_rtl_symbol_global_add (rtems_rtl_obj_t* obj, +bool rtems_rtl_symbol_global_add (rtems_rtl_obj* obj, const unsigned char* esyms, unsigned int size); @@ -94,7 +94,7 @@ bool rtems_rtl_symbol_global_add (rtems_rtl_obj_t* obj, * @retval NULL No symbol found. * @return rtems_rtl_obj_sym_t* Reference to the symbol. */ -rtems_rtl_obj_sym_t* rtems_rtl_symbol_global_find (const char* name); +rtems_rtl_obj_sym* rtems_rtl_symbol_global_find (const char* name); /** * Find a symbol given the symbol label in the local object file. @@ -104,29 +104,29 @@ rtems_rtl_obj_sym_t* rtems_rtl_symbol_global_find (const char* name); * @retval NULL No symbol found. * @return rtems_rtl_obj_sym_t* Reference to the symbol. */ -rtems_rtl_obj_sym_t* rtems_rtl_symbol_obj_find (rtems_rtl_obj_t* obj, - const char* name); +rtems_rtl_obj_sym* rtems_rtl_symbol_obj_find (rtems_rtl_obj* obj, + const char* name); /** * Add the object file's symbols to the global table. * * @param obj The object file the symbols are to be added. */ -void rtems_rtl_symbol_obj_add (rtems_rtl_obj_t* obj); +void rtems_rtl_symbol_obj_add (rtems_rtl_obj* obj); /** * Erase the object file's local symbols. * * @param obj The object file the local symbols are to be erased from. */ -void rtems_rtl_symbol_obj_erase_local (rtems_rtl_obj_t* obj); +void rtems_rtl_symbol_obj_erase_local (rtems_rtl_obj* obj); /** * Erase the object file's symbols. * * @param obj The object file the symbols are to be erased from. */ -void rtems_rtl_symbol_obj_erase (rtems_rtl_obj_t* obj); +void rtems_rtl_symbol_obj_erase (rtems_rtl_obj* obj); #ifdef __cplusplus } diff --git a/cpukit/include/rtems/rtl/rtl-unresolved.h b/cpukit/include/rtems/rtl/rtl-unresolved.h index bd4ce2a215..884d909fa6 100644 --- a/cpukit/include/rtems/rtl/rtl-unresolved.h +++ b/cpukit/include/rtems/rtl/rtl-unresolved.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -63,75 +63,75 @@ extern "C" { * Hack to work around machine size. This needs to be cleaned up * to better support 64bit targets. */ -typedef uint32_t rtems_rtl_word_t; +typedef uint32_t rtems_rtl_word; /** * The types of records in the blocks. */ -typedef enum rtems_rtl_unresolved_rtype_e +typedef enum rtems_rtl_unresolved_rtype { rtems_rtl_unresolved_empty = 0, /**< The records is empty. Must always be 0 */ rtems_rtl_unresolved_name = 1, /**< The record is a name. */ rtems_rtl_unresolved_reloc = 2 /**< The record is a relocation record. */ -} rtems_rtl_unresolved_rtype_t; +} rtems_rtl_unresolved_rtype; /** * Unresolved externals symbol names. The names are reference counted and * separate from the relocation records because a number of records could * reference the same symbol name. */ -typedef struct rtems_rtl_unresolv_name_s +typedef struct rtems_rtl_unresolv_name { - uint16_t refs; /**< The number of references to this name. */ - uint16_t length; /**< The length of this name. */ + uint16_t refs; /**< The number of references to this name. */ + uint16_t length; /**< The length of this name. */ const char name[12]; /**< The symbol name. */ -} rtems_rtl_unresolv_name_t; +} rtems_rtl_unresolv_name; /** * Unresolved externals symbols require the relocation records to be held * and references. */ -typedef struct rtems_rtl_unresolv_reloc_s +typedef struct rtems_rtl_unresolv_reloc { - rtems_rtl_obj_t* obj; /**< The relocation's object file. */ - uint16_t flags; /**< Format specific flags. */ - uint16_t name; /**< The symbol's name. */ - uint16_t sect; /**< The target section. */ - rtems_rtl_word_t rel[3]; /**< Relocation record. */ -} rtems_rtl_unresolv_reloc_t; + rtems_rtl_obj* obj; /**< The relocation's object file. */ + uint16_t flags; /**< Format specific flags. */ + uint16_t name; /**< The symbol's name. */ + uint16_t sect; /**< The target section. */ + rtems_rtl_word rel[3]; /**< Relocation record. */ +} rtems_rtl_unresolv_reloc; /** * Unresolved externals records. */ -typedef struct rtems_rtl_unresolv_rec_s +typedef struct rtems_rtl_unresolv_rec { - rtems_rtl_unresolved_rtype_t type; + rtems_rtl_unresolved_rtype type; union { - rtems_rtl_unresolv_name_t name; /**< The name, or */ - rtems_rtl_unresolv_reloc_t reloc; /**< the relocation record. */ + rtems_rtl_unresolv_name name; /**< The name, or */ + rtems_rtl_unresolv_reloc reloc; /**< the relocation record. */ } rec; -} rtems_rtl_unresolv_rec_t; +} rtems_rtl_unresolv_rec; /** * Unresolved blocks. */ -typedef struct rtems_rtl_unresolv_block_s +typedef struct rtems_rtl_unresolv_block { - rtems_chain_node link; /**< Blocks are chained. */ - uint32_t recs; /**< The number of records in the block. */ - rtems_rtl_unresolv_rec_t rec; /**< The records. More follow. */ -} rtems_rtl_unresolv_block_t; + rtems_chain_node link; /**< Blocks are chained. */ + uint32_t recs; /**< The number of records in the block. */ + rtems_rtl_unresolv_rec rec; /**< The records. More follow. */ +} rtems_rtl_unresolv_block; /** * Unresolved table holds the names and relocations. */ -typedef struct rtems_rtl_unresolved_s +typedef struct rtems_rtl_unresolved { uint32_t marker; size_t block_recs; /**< The records per blocks allocated. */ rtems_chain_control blocks; /**< List of blocks. */ -} rtems_rtl_unresolved_t; +} rtems_rtl_unresolved; /** * The iterator function used to iterate over the unresolved table. @@ -141,8 +141,8 @@ typedef struct rtems_rtl_unresolved_s * @retval true The iterator has finished. * @retval false The iterator has not finished. Keep iterating. */ -typedef bool rtems_rtl_unresolved_iterator_t (rtems_rtl_unresolv_rec_t* rec, - void* data); +typedef bool rtems_rtl_unresolved_iterator (rtems_rtl_unresolv_rec* rec, + void* data); /** * Open an unresolved relocation table. @@ -153,21 +153,21 @@ typedef bool rtems_rtl_unresolved_iterator_t (rtems_rtl_unresolv_rec_t* rec, * @retval false The unresolved relocation table could not created. The RTL * error has the error. */ -bool rtems_rtl_unresolved_table_open (rtems_rtl_unresolved_t* unresolved, - size_t block_records); +bool rtems_rtl_unresolved_table_open (rtems_rtl_unresolved* unresolved, + size_t block_records); /** * Close the table and erase the blocks. * * @param unreolved Close the unresolved table. */ -void rtems_rtl_unresolved_table_close (rtems_rtl_unresolved_t* unresolved); +void rtems_rtl_unresolved_table_close (rtems_rtl_unresolved* unresolved); /** * Iterate over the table of unresolved entries. */ -bool rtems_rtl_unresolved_interate (rtems_rtl_unresolved_iterator_t iterator, - void* data); +bool rtems_rtl_unresolved_interate (rtems_rtl_unresolved_iterator iterator, + void* data); /** * Add a relocation to the list of unresolved relocations. @@ -181,11 +181,11 @@ bool rtems_rtl_unresolved_interate (rtems_rtl_unresolved_iterator_t iterator, * @retval true The relocation has been added. * @retval false The relocation could not be added. */ -bool rtems_rtl_unresolved_add (rtems_rtl_obj_t* obj, - const uint16_t flags, - const char* name, - const uint16_t sect, - const rtems_rtl_word_t* rel); +bool rtems_rtl_unresolved_add (rtems_rtl_obj* obj, + const uint16_t flags, + const char* name, + const uint16_t sect, + const rtems_rtl_word* rel); /** * Resolve the unresolved symbols. @@ -200,10 +200,10 @@ void rtems_rtl_unresolved_resolve (void); * @param esyms The exported symbol table. * @param size The size of the table in bytes. */ -bool rtems_rtl_unresolved_remove (rtems_rtl_obj_t* obj, - const char* name, - const uint16_t sect, - const rtems_rtl_word_t* rel); +bool rtems_rtl_unresolved_remove (rtems_rtl_obj* obj, + const char* name, + const uint16_t sect, + const rtems_rtl_word* rel); #ifdef __cplusplus } diff --git a/cpukit/include/rtems/rtl/rtl.h b/cpukit/include/rtems/rtl/rtl.h index 513a6741aa..e30dba90ef 100644 --- a/cpukit/include/rtems/rtl/rtl.h +++ b/cpukit/include/rtems/rtl/rtl.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -84,7 +84,7 @@ extern void _rtld_debug_state (void); /** * The type of constructor/destructor function. */ -typedef void (*rtems_rtl_cdtor_t)(void); +typedef void (*rtems_rtl_cdtor)(void); /** * The global RTL data. This structure is allocated on the heap when the first @@ -94,48 +94,48 @@ typedef void (*rtems_rtl_cdtor_t)(void); * actual symbols are part of the object's structure. If this is a problem we * could look at a hash table per object file. */ -struct rtems_rtl_data_s +struct rtems_rtl_data { - rtems_recursive_mutex lock; /**< The RTL lock */ - rtems_rtl_alloc_data_t allocator; /**< The allocator data. */ - rtems_chain_control objects; /**< List if loaded object files. */ - const char* paths; /**< Search paths for archives. */ - rtems_rtl_symbols_t globals; /**< Global symbol table. */ - rtems_rtl_unresolved_t unresolved; /**< Unresolved symbols. */ - rtems_rtl_obj_t* base; /**< Base object file. */ - rtems_rtl_obj_cache_t symbols; /**< Symbols object file cache. */ - rtems_rtl_obj_cache_t strings; /**< Strings object file cache. */ - rtems_rtl_obj_cache_t relocs; /**< Relocations object file cache. */ - rtems_rtl_obj_comp_t decomp; /**< The decompression compressor. */ - int last_errno; /**< Last error number. */ - char last_error[64]; /**< Last error string. */ + rtems_recursive_mutex lock; /**< The RTL lock */ + rtems_rtl_alloc_data allocator; /**< The allocator data. */ + rtems_chain_control objects; /**< List if loaded object files. */ + const char* paths; /**< Search paths for archives. */ + rtems_rtl_symbols globals; /**< Global symbol table. */ + rtems_rtl_unresolved unresolved; /**< Unresolved symbols. */ + rtems_rtl_obj* base; /**< Base object file. */ + rtems_rtl_obj_cache symbols; /**< Symbols object file cache. */ + rtems_rtl_obj_cache strings; /**< Strings object file cache. */ + rtems_rtl_obj_cache relocs; /**< Relocations object file cache. */ + rtems_rtl_obj_comp decomp; /**< The decompression compressor. */ + int last_errno; /**< Last error number. */ + char last_error[64]; /**< Last error string. */ }; /** * Get the RTL data with out locking. This call assumes the RTL is locked. * - * @return rtems_rtl_data_t* The RTL data after being locked. + * @return rtems_rtl_data* The RTL data after being locked. * @retval NULL The RTL data is not initialised. */ -rtems_rtl_data_t* rtems_rtl_data (void); +rtems_rtl_data* rtems_rtl_data_unprotected (void); /** * Get the RTL global symbol table with out locking. This call assmes the RTL * is locked. * - * @return rtems_rtl_symbols_t* The RTL global symbols after being locked. + * @return rtems_rtl_symbols* The RTL global symbols after being locked. * @retval NULL The RTL data is not initialised. */ -rtems_rtl_symbols_t* rtems_rtl_global_symbols (void); +rtems_rtl_symbols* rtems_rtl_global_symbols (void); /** * Get the RTL resolved table with out locking. This call assmes the RTL * is locked. * - * @return rtems_rtl_unresolv_t* The RTL unresolved symbols and reloc records. + * @return rtems_rtl_unresolv* The RTL unresolved symbols and reloc records. * @retval NULL The RTL data is not initialised. */ -rtems_rtl_unresolved_t* rtems_rtl_unresolved (void); +rtems_rtl_unresolved* rtems_rtl_unresolved_unprotected (void); /** * Get the RTL symbols, strings, or relocations object file caches. This call @@ -148,9 +148,9 @@ rtems_rtl_unresolved_t* rtems_rtl_unresolved (void); * @param relocs Pointer to the location to set the cache into. Returns NULL * is rtl is not initialised. If NULL is passed in no value set. */ -void rtems_rtl_obj_caches (rtems_rtl_obj_cache_t** symbols, - rtems_rtl_obj_cache_t** strings, - rtems_rtl_obj_cache_t** relocs); +void rtems_rtl_obj_caches (rtems_rtl_obj_cache** symbols, + rtems_rtl_obj_cache** strings, + rtems_rtl_obj_cache** relocs); /** * Flush all the object file caches. @@ -158,28 +158,28 @@ void rtems_rtl_obj_caches (rtems_rtl_obj_cache_t** symbols, void rtems_rtl_obj_caches_flush (void); /** - * Get the RTL decompressor setting the cache and the offset in the file the - * compressed stream starts. This call assmes the RTL is locked. + * Get the RTL decompressor setting for the cache and the offset in the file + * the compressed stream starts. This call assumes the RTL is locked. * * @param decomp Pointer to the location to set the compressor into. Returns * NULL is rtl is not initialised. * @param cache The cache to read the file with. Saves needing an extrs buffer. * @param offset The offset in the file the compressed stream starts. */ -void rtems_rtl_obj_comp (rtems_rtl_obj_comp_t** decomp, - rtems_rtl_obj_cache_t* cache, - int fd, - int compression, - off_t offset); +void rtems_rtl_obj_decompress (rtems_rtl_obj_comp** decomp, + rtems_rtl_obj_cache* cache, + int fd, + int compression, + off_t offset); /** * Lock the Run-time Linker. * - * @return rtems_rtl_data_t* The RTL data after being locked. + * @return rtems_rtl_data* The RTL data after being locked. * @retval NULL The RTL data could not be initialised or locked. Typically this * means the lock could not be created. */ -rtems_rtl_data_t* rtems_rtl_lock (void); +rtems_rtl_data* rtems_rtl_lock (void); /** * Unlock the Run-time Linker. @@ -195,16 +195,16 @@ void rtems_rtl_unlock (void); * @param handle Pointer to the object file to be validated. * @return rtl_obj* The object file descriptor. NULL is returned if invalid. */ -rtems_rtl_obj_t* rtems_rtl_check_handle (void* handle); +rtems_rtl_obj* rtems_rtl_check_handle (void* handle); /** * Find the object given a file name. * * @param name The name of the object file. * @retval NULL No object file with that name found. - * @return rtems_rtl_obj_t* The object file descriptor. + * @return rtems_rtl_obj* The object file descriptor. */ -rtems_rtl_obj_t* rtems_rtl_find_obj (const char* name); +rtems_rtl_obj* rtems_rtl_find_obj (const char* name); /** * Load an object file into memory relocating it. It will not be resolved @@ -237,7 +237,7 @@ rtems_rtl_obj_t* rtems_rtl_find_obj (const char* name); * @param mode The mode of the load as defined by the dlopen call. * @return rtl_obj* The object file descriptor. NULL is returned if the load fails. */ -rtems_rtl_obj_t* rtems_rtl_load_object (const char* name, int mode); +rtems_rtl_obj* rtems_rtl_load_object (const char* name, int mode); /** * Unload an object file. This only happens when the user count is 0. @@ -248,7 +248,7 @@ rtems_rtl_obj_t* rtems_rtl_load_object (const char* name, int mode); * @retval true The object file has been unloaded. * @retval false The object file could not be unloaded. */ -bool rtems_rtl_unload_object (rtems_rtl_obj_t* obj); +bool rtems_rtl_unload_object (rtems_rtl_obj* obj); /** * Run any constructor functions the object file may contain. This call @@ -256,7 +256,7 @@ bool rtems_rtl_unload_object (rtems_rtl_obj_t* obj); * * @param obj The object file. */ -void rtems_rtl_run_ctors (rtems_rtl_obj_t* obj); +void rtems_rtl_run_ctors (rtems_rtl_obj* obj); /** * Get the last error message clearing it. This operation locks the run time @@ -309,7 +309,7 @@ void rtems_rtl_base_sym_global_add (const unsigned char* esyms, * @return rtl_obj* The object file descriptor for the base image. NULL is * returned if the load fails. */ -rtems_rtl_obj_t* rtems_rtl_baseimage (void); +rtems_rtl_obj* rtems_rtl_baseimage (void); #ifdef __cplusplus } |