diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-09-30 14:21:32 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-07 08:10:52 +0200 |
commit | 97e9728306a692ce7870db29c6b5d86dd9560692 (patch) | |
tree | 416d8536877fb0524e63967ea1bda111b901b402 | |
parent | 94b8d85b1612bdd52744afa977e05a612954926a (diff) |
rtems: Add RTEMS_PARTITION_ALIGNMENT
Update #4105.
-rw-r--r-- | cpukit/include/rtems/rtems/part.h | 9 | ||||
-rw-r--r-- | testsuites/psxtests/psxconfig01/init.c | 2 | ||||
-rw-r--r-- | testsuites/sptests/sppartition_err01/init.c | 17 |
3 files changed, 19 insertions, 9 deletions
diff --git a/cpukit/include/rtems/rtems/part.h b/cpukit/include/rtems/rtems/part.h index 5a6484329f..a3c3128a00 100644 --- a/cpukit/include/rtems/rtems/part.h +++ b/cpukit/include/rtems/rtems/part.h @@ -36,6 +36,15 @@ extern "C" { /**@{*/ /** + * @brief This constant defines the minimum alignment of a partition buffer in + * bytes. + * + * Use it with RTEMS_ALIGNED() to define the alignment of partition buffer + * types or statically allocated partition buffer areas. + */ +#define RTEMS_PARTITION_ALIGNMENT CPU_SIZEOF_POINTER + +/** * @brief RTEMS Partition Create * * Partition Manager diff --git a/testsuites/psxtests/psxconfig01/init.c b/testsuites/psxtests/psxconfig01/init.c index d2811b409a..6d7a227793 100644 --- a/testsuites/psxtests/psxconfig01/init.c +++ b/testsuites/psxtests/psxconfig01/init.c @@ -186,7 +186,7 @@ static rtems_task Init(rtems_task_argument argument); #include <rtems/confdefs.h> -typedef struct { +typedef struct RTEMS_ALIGNED(RTEMS_PARTITION_ALIGNMENT) { uint64_t data [16]; } area; diff --git a/testsuites/sptests/sppartition_err01/init.c b/testsuites/sptests/sppartition_err01/init.c index 39373852fb..a2297d53cc 100644 --- a/testsuites/sptests/sppartition_err01/init.c +++ b/testsuites/sptests/sppartition_err01/init.c @@ -16,17 +16,18 @@ const char rtems_test_name[] = "SPPARTITION_ERR 1"; -uint32_t Other_Memory; +static uint32_t Other_Memory; -TEST_EXTERN rtems_name Partition_name[ 2 ]; /* array of partition names */ -TEST_EXTERN rtems_id Partition_id[ 2 ]; /* array of partition ids */ +static rtems_name Partition_name[ 2 ]; /* array of partition names */ -TEST_EXTERN uint8_t Partition_good_area[256] CPU_STRUCTURE_ALIGNMENT; -#define Partition_bad_area (void *) 0x00000005 +static rtems_id Partition_id[ 2 ]; /* array of partition ids */ + +static RTEMS_ALIGNED( RTEMS_PARTITION_ALIGNMENT ) uint8_t + Partition_good_area[ 256 ]; -void test_partition_errors(void); +#define Partition_bad_area (void *) 0x00000005 -void test_partition_errors(void) +static void test_partition_errors(void) { void *buffer_address_1; void *buffer_address_2; @@ -152,7 +153,7 @@ void test_partition_errors(void) Partition_name[ 1 ], Partition_good_area, 128, - 35, + RTEMS_PARTITION_ALIGNMENT - 1, RTEMS_DEFAULT_ATTRIBUTES, &junk_id ); |