[rtems commit] rtems: Parameter types in rtems_partition_create()

Sebastian Huber sebh at rtems.org
Fri Aug 10 05:17:53 UTC 2018


Module:    rtems
Branch:    master
Commit:    66cb14205416253df88a412f579956d8d6109794
Changeset: http://git.rtems.org/rtems/commit/?id=66cb14205416253df88a412f579956d8d6109794

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Aug  6 10:51:00 2018 +0200

rtems: Parameter types in rtems_partition_create()

Use uintptr_t to specify the length of the partition buffer area instead
of uint32_t.  This is in line with rtems_region_create().  On 64-bit
targets, the length may exceed 4GiB.  Use size_t for the buffer size,
since on some targets the single object size is less than the overall
address range, e.g. m32c sizeof(uintptr_t) > sizeof(size_t).

Update #3486.

---

 cpukit/include/rtems/rtems/part.h | 10 +++++-----
 cpukit/rtems/src/partcreate.c     |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cpukit/include/rtems/rtems/part.h b/cpukit/include/rtems/rtems/part.h
index 5b840cc..769f3c6 100644
--- a/cpukit/include/rtems/rtems/part.h
+++ b/cpukit/include/rtems/rtems/part.h
@@ -61,13 +61,13 @@ typedef struct {
   /** This field is the physical starting address of the Partition. */
   void               *starting_address;
   /** This field is the size of the Partition in bytes. */
-  intptr_t            length;
+  uintptr_t           length;
   /** This field is the size of each buffer in bytes */
-  uint32_t            buffer_size;
+  size_t              buffer_size;
   /** This field is the attribute set provided at create time. */
   rtems_attribute     attribute_set;
   /** This field is the of allocated buffers. */
-  uint32_t            number_of_used_blocks;
+  uintptr_t           number_of_used_blocks;
   /** This field is the chain used to manage unallocated buffers. */
   Chain_Control       Memory;
 }   Partition_Control;
@@ -88,8 +88,8 @@ typedef struct {
 rtems_status_code rtems_partition_create(
   rtems_name       name,
   void            *starting_address,
-  uint32_t         length,
-  uint32_t         buffer_size,
+  uintptr_t        length,
+  size_t           buffer_size,
   rtems_attribute  attribute_set,
   rtems_id        *id
 );
diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c
index 2134b99..1a7304e 100644
--- a/cpukit/rtems/src/partcreate.c
+++ b/cpukit/rtems/src/partcreate.c
@@ -47,8 +47,8 @@
 rtems_status_code rtems_partition_create(
   rtems_name       name,
   void            *starting_address,
-  uint32_t         length,
-  uint32_t         buffer_size,
+  uintptr_t        length,
+  size_t           buffer_size,
   rtems_attribute  attribute_set,
   rtems_id        *id
 )




More information about the vc mailing list