Skip to content

Commit

Permalink
HotFix nasa#1221, OS_Impl_Loader on RTEMS
Browse files Browse the repository at this point in the history
- Add #define to handle renames from RTEMS 4.11 to RTEMS 5
- Cast to cpuaddress before assignment to `OS_module_address_t` elements

Try to fix RTEMS osal type casting for GetModuleInfo
  • Loading branch information
astrogeco committed Mar 9, 2022
1 parent 75fe674 commit 4c6e8ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/os/rtems/inc/os-rtems.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@
#define OSAL_UNRESOLV_REC_TYPE rtems_rtl_unresolv_rec
#define OSAL_UNRESOLVED_SYMBOL rtems_rtl_unresolved_symbol
#define OSAL_UNRESOLVED_ITERATE rtems_rtl_unresolved_iterate
#define OSAL_OBJ rtems_rtl_obj

#else
#define OSAL_HEAP_INFO_BLOCK region_information_block
#define OSAL_UNRESOLV_REC_TYPE rtems_rtl_unresolv_rec_t
#define OSAL_UNRESOLVED_SYMBOL rtems_rtl_unresolved_name
#define OSAL_UNRESOLVED_ITERATE rtems_rtl_unresolved_interate
#define OSAL_OBJ rtems_rtl_obj_t
#endif

/****************************************************************************************
Expand Down
14 changes: 7 additions & 7 deletions src/os/rtems/src/os-impl-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ int32 OS_ModuleUnload_Impl(const OS_object_token_t *token)
*-----------------------------------------------------------------*/
int32 OS_ModuleGetInfo_Impl(const OS_object_token_t *token, OS_module_prop_t *module_prop)
{
rtems_rtl_obj * obj;
OSAL_OBJ *obj;
OS_impl_module_internal_record_t *impl;
int32 status = OS_ERROR;

Expand All @@ -232,12 +232,12 @@ int32 OS_ModuleGetInfo_Impl(const OS_object_token_t *token, OS_module_prop_t *mo
if (obj != NULL)
{
module_prop->addr.valid = true;
module_prop->addr.code_address = obj->text_base;
module_prop->addr.code_size = rtems_rtl_obj_text_size(obj);
module_prop->addr.data_address = obj->data_base;
module_prop->addr.data_size = rtems_rtl_obj_data_size(obj);
module_prop->addr.bss_address = obj->bss_base;
module_prop->addr.bss_size = rtems_rtl_obj_bss_size(obj);
module_prop->addr.code_address = (cpuaddr) obj->text_base;
module_prop->addr.code_size = (cpuaddr) rtems_rtl_obj_text_size(obj);
module_prop->addr.data_address = (cpuaddr) obj->data_base;
module_prop->addr.data_size = (cpuaddr) rtems_rtl_obj_data_size(obj);
module_prop->addr.bss_address = (cpuaddr) obj->bss_base;
module_prop->addr.bss_size = (cpuaddr) rtems_rtl_obj_bss_size(obj);

status = OS_SUCCESS;
}
Expand Down

0 comments on commit 4c6e8ff

Please sign in to comment.