diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-12 07:41:11 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-12 08:30:04 +0200 |
commit | bb77a82f619752ba147c317d982ac47f56f4afec (patch) | |
tree | 1559d7fa853b777bd70eccb02fa0834004a748f6 | |
parent | 11b5826b3900a82d4f2b4c85f83706940f36fda2 (diff) |
testsuites/validation/tc-intr-get-affinity.c
-rw-r--r-- | testsuites/validation/tc-intr-get-affinity.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/testsuites/validation/tc-intr-get-affinity.c b/testsuites/validation/tc-intr-get-affinity.c index e0de9e37ec..7c268ac57e 100644 --- a/testsuites/validation/tc-intr-get-affinity.c +++ b/testsuites/validation/tc-intr-get-affinity.c @@ -129,7 +129,7 @@ typedef struct { * @brief This member provides the object referenced by the ``affinity`` * parameter. */ - cpu_set_t cpuset_obj; + cpu_set_t cpuset_obj[ 2 ];; /** * @brief This member contains the return value of the @@ -209,12 +209,12 @@ static void CheckGetAffinity( ) { rtems_status_code sc; - cpu_set_t set; + cpu_set_t set[ 2 ]; if ( attr->can_get_affinity ) { - CPU_ZERO( &ctx->cpuset_obj ); + CPU_ZERO_S( sizeof( ctx->cpuset_obj ), ctx->cpuset_obj ); } else { - CPU_FILL( &ctx->cpuset_obj ); + CPU_FILL_S( sizeof( ctx->cpuset_obj ), ctx->cpuset_obj ); } sc = rtems_interrupt_get_affinity( @@ -223,14 +223,14 @@ static void CheckGetAffinity( ctx->cpuset ); - CPU_ZERO( &set ); + CPU_ZERO_S( sizeof( set ), set ); if ( attr->can_get_affinity ) { T_rsc_success( sc ); - T_ne_int( CPU_CMP( &ctx->cpuset_obj, &set ), 0 ); + T_false( CPU_EQUAL_S( sizeof( set ), ctx->cpuset_obj, set ) ); } else { T_rsc( sc, RTEMS_UNSATISFIED ); - T_eq_int( CPU_CMP( &ctx->cpuset_obj, &set ), 0 ); + T_true( CPU_EQUAL_S( sizeof( set ), ctx->cpuset_obj, set ) ); } } @@ -271,7 +271,7 @@ static void RtemsIntrReqGetAffinity_Pre_CPUSetSize_Prepare( case RtemsIntrReqGetAffinity_Pre_CPUSetSize_Valid: { /* * While the ``affinity_size`` parameter is an integral multiple of the - * size of long, while the ``affinity_size`` parameter specifies a + * size of ``long``, while the ``affinity_size`` parameter specifies a * processor set which is large enough to contain the processor affinity * set of the interrupt specified by ``vector``. */ @@ -282,7 +282,7 @@ static void RtemsIntrReqGetAffinity_Pre_CPUSetSize_Prepare( case RtemsIntrReqGetAffinity_Pre_CPUSetSize_TooSmall: { /* * While the ``affinity_size`` parameter is an integral multiple of the - * size of long, while the ``affinity_size`` parameter specifies a + * size of ``long``, while the ``affinity_size`` parameter specifies a * processor set which is not large enough to contain the processor * affinity set of the interrupt specified by ``vector``. */ @@ -293,7 +293,7 @@ static void RtemsIntrReqGetAffinity_Pre_CPUSetSize_Prepare( case RtemsIntrReqGetAffinity_Pre_CPUSetSize_Askew: { /* * While the ``affinity_size`` parameter is not an integral multiple of - * the size of long. + * the size of ``long``. */ ctx->cpusetsize = SIZE_MAX; break; @@ -315,7 +315,7 @@ static void RtemsIntrReqGetAffinity_Pre_CPUSet_Prepare( * While the ``affinity`` parameter references an object of type * cpu_set_t. */ - ctx->cpuset = &ctx->cpuset_obj; + ctx->cpuset = ctx->cpuset_obj; break; } @@ -502,7 +502,7 @@ static void RtemsIntrReqGetAffinity_Action( { if ( ctx->valid_vector && ctx->cpusetsize == sizeof( ctx->cpuset_obj ) && - ctx->cpuset == &ctx->cpuset_obj + ctx->cpuset == ctx->cpuset_obj ) { for ( ctx->vector = 0; @@ -524,7 +524,7 @@ static void RtemsIntrReqGetAffinity_Action( CheckGetAffinity( ctx, &attr ); } } else { - cpu_set_t set; + cpu_set_t set[ 2 ]; if ( ctx->valid_vector ) { ctx->vector = ctx->some_vector; @@ -532,7 +532,7 @@ static void RtemsIntrReqGetAffinity_Action( ctx->vector = BSP_INTERRUPT_VECTOR_COUNT; } - CPU_FILL( &ctx->cpuset_obj ); + CPU_FILL_S( sizeof( ctx->cpuset_obj ), ctx->cpuset_obj ); ctx->status = rtems_interrupt_get_affinity( ctx->vector, @@ -540,13 +540,16 @@ static void RtemsIntrReqGetAffinity_Action( ctx->cpuset ); - if ( ctx->cpuset == NULL || ctx->cpusetsize != sizeof( ctx->cpuset ) ) { - CPU_FILL( &set ); + if ( + ctx->cpuset == NULL || + ctx->cpusetsize != sizeof( ctx->cpuset_obj ) + ) { + CPU_FILL_S( sizeof( set ), set ); } else { - CPU_ZERO( &set ); + CPU_ZERO_S( sizeof( set ), set ); } - T_eq_int( CPU_CMP( &ctx->cpuset_obj, &set ), 0 ); + T_true( CPU_EQUAL_S( sizeof( set ), ctx->cpuset_obj, set ) ); } } |