diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-14 10:31:45 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-14 11:34:25 +0200 |
commit | 28a81d7e14c0e7fe2803dd721b66630eed91f0c9 (patch) | |
tree | 338a495c691cf391e702059affe23137251d27ec | |
parent | 971055e87a58493e8c9af71829b4c73067185de1 (diff) |
rtems: Move _Partition_Initialize()
It is only used by rtems_partition_create(). Fix integer types.
-rw-r--r-- | cpukit/include/rtems/rtems/partimpl.h | 25 | ||||
-rw-r--r-- | cpukit/rtems/src/partcreate.c | 25 |
2 files changed, 25 insertions, 25 deletions
diff --git a/cpukit/include/rtems/rtems/partimpl.h b/cpukit/include/rtems/rtems/partimpl.h index b7f3bf666f..e602963c22 100644 --- a/cpukit/include/rtems/rtems/partimpl.h +++ b/cpukit/include/rtems/rtems/partimpl.h @@ -19,7 +19,6 @@ #define _RTEMS_RTEMS_PARTIMPL_H #include <rtems/rtems/partdata.h> -#include <rtems/score/chainimpl.h> #include <rtems/score/objectimpl.h> #ifdef __cplusplus @@ -46,30 +45,6 @@ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); } -RTEMS_INLINE_ROUTINE void _Partition_Initialize( - Partition_Control *the_partition, - void *starting_address, - uint32_t length, - uint32_t buffer_size, - rtems_attribute attribute_set -) -{ - the_partition->starting_address = starting_address; - the_partition->length = length; - the_partition->buffer_size = buffer_size; - the_partition->attribute_set = attribute_set; - the_partition->number_of_used_blocks = 0; - - _Chain_Initialize( - &the_partition->Memory, - starting_address, - length / buffer_size, - buffer_size - ); - - _ISR_lock_Initialize( &the_partition->Lock, "Partition" ); -} - /** * @brief Calls _Objects_Get() using the Partition Manager information. * diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c index f2ec9676aa..c04aa09306 100644 --- a/cpukit/rtems/src/partcreate.c +++ b/cpukit/rtems/src/partcreate.c @@ -23,6 +23,7 @@ #include <rtems/rtems/partimpl.h> #include <rtems/rtems/attrimpl.h> #include <rtems/rtems/support.h> +#include <rtems/score/chainimpl.h> #include <rtems/score/sysstate.h> #include <rtems/sysinit.h> @@ -36,6 +37,30 @@ static bool _Partition_Is_buffer_area_aligned( const void *starting_address ) return ( ( (uintptr_t) starting_address ) % CPU_SIZEOF_POINTER ) == 0; } +static void _Partition_Initialize( + Partition_Control *the_partition, + void *starting_address, + uintptr_t length, + size_t buffer_size, + rtems_attribute attribute_set +) +{ + the_partition->starting_address = starting_address; + the_partition->length = length; + the_partition->buffer_size = buffer_size; + the_partition->attribute_set = attribute_set; + the_partition->number_of_used_blocks = 0; + + _Chain_Initialize( + &the_partition->Memory, + starting_address, + length / buffer_size, + buffer_size + ); + + _ISR_lock_Initialize( &the_partition->Lock, "Partition" ); +} + rtems_status_code rtems_partition_create( rtems_name name, void *starting_address, |