summaryrefslogtreecommitdiff
path: root/common_modules/module_manager/src/txm_module_manager_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'common_modules/module_manager/src/txm_module_manager_util.c')
-rw-r--r--common_modules/module_manager/src/txm_module_manager_util.c358
1 files changed, 179 insertions, 179 deletions
diff --git a/common_modules/module_manager/src/txm_module_manager_util.c b/common_modules/module_manager/src/txm_module_manager_util.c
index 8511fce6..bd6c79eb 100644
--- a/common_modules/module_manager/src/txm_module_manager_util.c
+++ b/common_modules/module_manager/src/txm_module_manager_util.c
@@ -10,15 +10,15 @@
/**************************************************************************/
-/**************************************************************************/
-/**************************************************************************/
-/** */
-/** ThreadX Component */
-/** */
-/** Module Manager */
-/** */
-/**************************************************************************/
-/**************************************************************************/
+/**************************************************************************/
+/**************************************************************************/
+/** */
+/** ThreadX Component */
+/** */
+/** Module Manager */
+/** */
+/**************************************************************************/
+/**************************************************************************/
/* Include necessary system files. */
@@ -29,115 +29,115 @@
#include "txm_module_manager_util.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _txm_module_manager_object_memory_check PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _txm_module_manager_object_memory_check PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
-/* DESCRIPTION */
-/* */
-/* This function checks if the object is inside a module's object pool */
-/* or, if it's a privileged module, inside the module's data area. */
-/* */
-/* INPUT */
-/* */
-/* module_instance Module instance that the object */
-/* belongs to */
-/* object_ptr Pointer to object to check */
-/* object_size Size of the object to check */
-/* */
-/* OUTPUT */
-/* */
-/* status Whether the object resides in a */
-/* valid location */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
-/* */
-/* RELEASE HISTORY */
-/* */
+/* DESCRIPTION */
+/* */
+/* This function checks if the object is inside a module's object pool */
+/* or, if it's a privileged module, inside the module's data area. */
+/* */
+/* INPUT */
+/* */
+/* module_instance Module instance that the object */
+/* belongs to */
+/* object_ptr Pointer to object to check */
+/* object_size Size of the object to check */
+/* */
+/* OUTPUT */
+/* */
+/* status Whether the object resides in a */
+/* valid location */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
+/* */
+/* RELEASE HISTORY */
+/* */
/* DATE NAME DESCRIPTION */
/* */
-/* 09-30-2020 Scott Larson Initial Version 6.1 */
+/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_memory_check(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE object_ptr, ULONG object_size)
{
-
+
/* Is the object pointer from the module manager's object pool? */
- if ((_txm_module_manager_object_pool_created == TX_TRUE) &&
- (object_ptr >= (ALIGN_TYPE) _txm_module_manager_object_pool.tx_byte_pool_start) &&
+ if ((_txm_module_manager_object_pool_created == TX_TRUE) &&
+ (object_ptr >= (ALIGN_TYPE) _txm_module_manager_object_pool.tx_byte_pool_start) &&
((object_ptr+object_size) <= (ALIGN_TYPE) (_txm_module_manager_object_pool.tx_byte_pool_start + _txm_module_manager_object_pool.tx_byte_pool_size)))
{
/* Object is from manager object pool. */
return(TX_SUCCESS);
}
-
+
/* If memory protection is not required, check if object is in module data. */
else if (!(module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION))
{
- if ((object_ptr >= (ALIGN_TYPE) module_instance -> txm_module_instance_data_start) &&
+ if ((object_ptr >= (ALIGN_TYPE) module_instance -> txm_module_instance_data_start) &&
((object_ptr+object_size) <= (ALIGN_TYPE) module_instance -> txm_module_instance_data_end))
{
/* Object is from the local module memory. */
return(TX_SUCCESS);
}
}
-
+
/* Object is from invalid memory. */
return(TXM_MODULE_INVALID_MEMORY);
-
+
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _txm_module_manager_created_object_check PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _txm_module_manager_created_object_check PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
-/* DESCRIPTION */
-/* */
+/* DESCRIPTION */
+/* */
/* This functions checks if the specified object was created by the */
-/* specified module */
-/* */
-/* INPUT */
-/* */
-/* module_instance The module instance to check */
-/* object_ptr The object to check */
-/* */
-/* OUTPUT */
-/* */
-/* status Whether the module created the */
-/* object */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* txm_module_manager*_stop Module manager stop functions */
-/* */
-/* RELEASE HISTORY */
-/* */
+/* specified module */
+/* */
+/* INPUT */
+/* */
+/* module_instance The module instance to check */
+/* object_ptr The object to check */
+/* */
+/* OUTPUT */
+/* */
+/* status Whether the module created the */
+/* object */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* txm_module_manager*_stop Module manager stop functions */
+/* */
+/* RELEASE HISTORY */
+/* */
/* DATE NAME DESCRIPTION */
/* */
-/* 09-30-2020 Scott Larson Initial Version 6.1 */
+/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UCHAR _txm_module_manager_created_object_check(TXM_MODULE_INSTANCE *module_instance, VOID *object_ptr)
@@ -179,51 +179,51 @@ TXM_MODULE_ALLOCATED_OBJECT *allocated_object_ptr;
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _txm_module_manager_object_size_check PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _txm_module_manager_object_size_check PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
-/* DESCRIPTION */
-/* */
-/* This function checks if the specified object's size matches what is */
-/* inside the object pool. */
-/* */
-/* INPUT */
-/* */
-/* object_ptr Pointer to object to check */
-/* object_size Size of the object to check */
-/* */
-/* OUTPUT */
-/* */
-/* status Whether the object's size matches */
-/* what's inside the object pool */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
-/* */
-/* RELEASE HISTORY */
-/* */
+/* DESCRIPTION */
+/* */
+/* This function checks if the specified object's size matches what is */
+/* inside the object pool. */
+/* */
+/* INPUT */
+/* */
+/* object_ptr Pointer to object to check */
+/* object_size Size of the object to check */
+/* */
+/* OUTPUT */
+/* */
+/* status Whether the object's size matches */
+/* what's inside the object pool */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
+/* */
+/* RELEASE HISTORY */
+/* */
/* DATE NAME DESCRIPTION */
/* */
-/* 09-30-2020 Scott Larson Initial Version 6.1 */
+/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_size_check(ALIGN_TYPE object_ptr, ULONG object_size)
{
TXM_MODULE_ALLOCATED_OBJECT *module_allocated_object_ptr;
UINT return_value;
-
+
/* Pickup the allocated object pointer. */
module_allocated_object_ptr = ((TXM_MODULE_ALLOCATED_OBJECT *) object_ptr) - 1;
@@ -232,50 +232,50 @@ UINT return_value;
return_value = TX_SUCCESS;
else
return_value = TXM_MODULE_INVALID_MEMORY;
-
+
return(return_value);
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _txm_module_manager_name_compare PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _txm_module_manager_name_compare PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
-/* DESCRIPTION */
-/* */
-/* This function compares the specified object names. */
-/* */
-/* INPUT */
-/* */
-/* search_name String pointer to the object's */
-/* name being searched for */
-/* search_name_length Length of search_name */
-/* object_name String pointer to an object's name*/
-/* to compare the search name to */
-/* */
-/* OUTPUT */
-/* */
-/* status Whether the names are equal */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* *_object_pointer_get Kernel dispatch function */
-/* */
-/* RELEASE HISTORY */
-/* */
+/* DESCRIPTION */
+/* */
+/* This function compares the specified object names. */
+/* */
+/* INPUT */
+/* */
+/* search_name String pointer to the object's */
+/* name being searched for */
+/* search_name_length Length of search_name */
+/* object_name String pointer to an object's name*/
+/* to compare the search name to */
+/* */
+/* OUTPUT */
+/* */
+/* status Whether the names are equal */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* *_object_pointer_get Kernel dispatch function */
+/* */
+/* RELEASE HISTORY */
+/* */
/* DATE NAME DESCRIPTION */
/* */
-/* 09-30-2020 Scott Larson Initial Version 6.1 */
+/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_name_compare(CHAR *search_name, UINT search_name_length, CHAR *object_name)
@@ -337,48 +337,48 @@ CHAR object_name_char;
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _txm_module_manager_util_code_allocation_size_and_alignment_get */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _txm_module_manager_util_code_allocation_size_and_alignment_get */
+/* PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
-/* DESCRIPTION */
-/* */
-/* This function returns the required alignment and allocation size */
-/* for a module's code area. */
-/* */
-/* INPUT */
-/* */
-/* module_preamble Preamble of module to return code */
-/* values for */
-/* code_alignment_dest Address to return code alignment */
-/* code_allocation_size_desk Address to return code allocation */
-/* size */
-/* */
-/* OUTPUT */
-/* */
-/* status Success if no math overflow */
-/* occurred during calculation */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* txm_module_manager_*_load Module load functions */
-/* */
-/* RELEASE HISTORY */
-/* */
+/* DESCRIPTION */
+/* */
+/* This function returns the required alignment and allocation size */
+/* for a module's code area. */
+/* */
+/* INPUT */
+/* */
+/* module_preamble Preamble of module to return code */
+/* values for */
+/* code_alignment_dest Address to return code alignment */
+/* code_allocation_size_desk Address to return code allocation */
+/* size */
+/* */
+/* OUTPUT */
+/* */
+/* status Success if no math overflow */
+/* occurred during calculation */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* txm_module_manager_*_load Module load functions */
+/* */
+/* RELEASE HISTORY */
+/* */
/* DATE NAME DESCRIPTION */
/* */
-/* 09-30-2020 Scott Larson Initial Version 6.1 */
+/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_util_code_allocation_size_and_alignment_get(TXM_MODULE_PREAMBLE *module_preamble,