From 8772da081639a48c22d47f68a269ae0038aa2100 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 3 Aug 2020 12:58:47 +0200 Subject: validation: Add tests for Event Manager --- spec/build/testsuites/validation/validation-0.yml | 4 + testsuites/validation/tc-event-send-receive.c | 203 ++ testsuites/validation/tc-events.c | 184 ++ testsuites/validation/tr-event-constant.c | 720 ++++++ testsuites/validation/tr-event-constant.h | 81 + testsuites/validation/tr-event-send-receive.c | 2686 +++++++++++++++++++++ testsuites/validation/tr-event-send-receive.h | 152 ++ 7 files changed, 4030 insertions(+) create mode 100644 testsuites/validation/tc-event-send-receive.c create mode 100644 testsuites/validation/tc-events.c create mode 100644 testsuites/validation/tr-event-constant.c create mode 100644 testsuites/validation/tr-event-constant.h create mode 100644 testsuites/validation/tr-event-send-receive.c create mode 100644 testsuites/validation/tr-event-send-receive.h diff --git a/spec/build/testsuites/validation/validation-0.yml b/spec/build/testsuites/validation/validation-0.yml index 7805078779..29a9dc6c3f 100644 --- a/spec/build/testsuites/validation/validation-0.yml +++ b/spec/build/testsuites/validation/validation-0.yml @@ -16,6 +16,8 @@ source: - testsuites/validation/tc-barrier-ident.c - testsuites/validation/tc-barrier-release.c - testsuites/validation/tc-barrier-wait.c +- testsuites/validation/tc-events.c +- testsuites/validation/tc-event-send-receive.c - testsuites/validation/tc-message-construct-errors.c - testsuites/validation/tc-message-ident.c - testsuites/validation/tc-object.c @@ -29,6 +31,8 @@ source: - testsuites/validation/tc-task-ident.c - testsuites/validation/tc-timer-ident.c - testsuites/validation/tc-userext-ident.c +- testsuites/validation/tr-event-constant.c +- testsuites/validation/tr-event-send-receive.c - testsuites/validation/tr-object-ident.c - testsuites/validation/tr-object-ident-local.c - testsuites/validation/ts-validation-0.c diff --git a/testsuites/validation/tc-event-send-receive.c b/testsuites/validation/tc-event-send-receive.c new file mode 100644 index 0000000000..7db58bedcd --- /dev/null +++ b/testsuites/validation/tc-event-send-receive.c @@ -0,0 +1,203 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestCaseRtemsEventValSendReceive + * @ingroup RTEMSTestCaseRtemsEventValSystemSendReceive + */ + +/* + * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include "tr-event-send-receive.h" + +#include + +/** + * @defgroup RTEMSTestCaseRtemsEventValSendReceive \ + * spec:/rtems/event/val/send-receive + * + * @ingroup RTEMSTestSuiteTestsuitesValidation0 + * + * @brief Tests the rtems_event_send() and rtems_event_receive() directives. + * + * This test case performs the following actions: + * + * - Run the event send and receive tests for the application event set defined + * by /rtems/event/req/send-receive. + * + * @{ + */ + +static rtems_status_code EventSend( + rtems_id id, + rtems_event_set event_in +) +{ + return rtems_event_send( id, event_in ); +} + +static rtems_status_code EventReceive( + rtems_id event_in, + rtems_option option_set, + rtems_interval ticks, + rtems_event_set *event_out +) +{ + return rtems_event_receive( event_in, option_set, ticks, event_out ); +} + +static rtems_event_set GetPendingEvents( Thread_Control *thread ) +{ + RTEMS_API_Control *api; + + api = thread->API_Extensions[ THREAD_API_RTEMS ]; + return api->Event.pending_events; +} + +/** + * @brief Run the event send and receive tests for the application event set + * defined by /rtems/event/req/send-receive. + */ +static void RtemsEventValSendReceive_Action_0( void ) +{ + RtemsEventReqSendReceive_Run( + EventSend, + EventReceive, + GetPendingEvents, + THREAD_WAIT_CLASS_EVENT, + STATES_WAITING_FOR_EVENT + ); +} + +/** + * @fn void T_case_body_RtemsEventValSendReceive( void ) + */ +T_TEST_CASE( RtemsEventValSendReceive ) +{ + RtemsEventValSendReceive_Action_0(); +} + +/** @} */ + +/** + * @defgroup RTEMSTestCaseRtemsEventValSystemSendReceive \ + * spec:/rtems/event/val/system-send-receive + * + * @ingroup RTEMSTestSuiteTestsuitesValidation0 + * + * @brief Tests the rtems_event_system_send() and rtems_event_system_receive() + * directives. + * + * This test case performs the following actions: + * + * - Run the event send and receive tests for the system event set defined by + * /rtems/event/req/send-receive. + * + * @{ + */ + +static rtems_status_code EventSystemSend( + rtems_id id, + rtems_event_set event_in +) +{ + return rtems_event_system_send( id, event_in ); +} + +static rtems_status_code EventSystemReceive( + rtems_id event_in, + rtems_option option_set, + rtems_interval ticks, + rtems_event_set *event_out +) +{ + return rtems_event_system_receive( + event_in, + option_set, + ticks, + event_out + ); +} + +static rtems_event_set GetPendingSystemEvents( Thread_Control *thread ) +{ + RTEMS_API_Control *api; + + api = thread->API_Extensions[ THREAD_API_RTEMS ]; + return api->System_event.pending_events; +} + +/** + * @brief Run the event send and receive tests for the system event set defined + * by /rtems/event/req/send-receive. + */ +static void RtemsEventValSystemSendReceive_Action_0( void ) +{ + RtemsEventReqSendReceive_Run( + EventSystemSend, + EventSystemReceive, + GetPendingSystemEvents, + THREAD_WAIT_CLASS_SYSTEM_EVENT, + STATES_WAITING_FOR_SYSTEM_EVENT + ); +} + +/** + * @fn void T_case_body_RtemsEventValSystemSendReceive( void ) + */ +T_TEST_CASE( RtemsEventValSystemSendReceive ) +{ + RtemsEventValSystemSendReceive_Action_0(); +} + +/** @} */ diff --git a/testsuites/validation/tc-events.c b/testsuites/validation/tc-events.c new file mode 100644 index 0000000000..2a5f18dc9b --- /dev/null +++ b/testsuites/validation/tc-events.c @@ -0,0 +1,184 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestCaseRtemsEventValEvents + */ + +/* + * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "tr-event-constant.h" + +#include + +/** + * @defgroup RTEMSTestCaseRtemsEventValEvents spec:/rtems/event/val/events + * + * @ingroup RTEMSTestSuiteTestsuitesValidation0 + * + * @brief Tests the Event Manager API. + * + * This test case performs the following actions: + * + * - Run the event constant and number test for all 32 event constants. + * + * - Calculate the value of a bitwise or of all 32 event constants. + * + * - Check that the value is equal to RTEMS_ALL_EVENTS. + * + * - Validate the Event Manager directive options. + * + * - Check that RTEMS_EVENT_ALL is equal to zero. + * + * - Check that RTEMS_EVENT_ANY is a power of two. + * + * @{ + */ + +static const rtems_event_set events[] = { + RTEMS_EVENT_0, + RTEMS_EVENT_1, + RTEMS_EVENT_2, + RTEMS_EVENT_3, + RTEMS_EVENT_4, + RTEMS_EVENT_5, + RTEMS_EVENT_6, + RTEMS_EVENT_7, + RTEMS_EVENT_8, + RTEMS_EVENT_9, + RTEMS_EVENT_10, + RTEMS_EVENT_11, + RTEMS_EVENT_12, + RTEMS_EVENT_13, + RTEMS_EVENT_14, + RTEMS_EVENT_15, + RTEMS_EVENT_16, + RTEMS_EVENT_17, + RTEMS_EVENT_18, + RTEMS_EVENT_19, + RTEMS_EVENT_20, + RTEMS_EVENT_21, + RTEMS_EVENT_22, + RTEMS_EVENT_23, + RTEMS_EVENT_24, + RTEMS_EVENT_25, + RTEMS_EVENT_26, + RTEMS_EVENT_27, + RTEMS_EVENT_28, + RTEMS_EVENT_29, + RTEMS_EVENT_30, + RTEMS_EVENT_31, +}; + +/** + * @brief Run the event constant and number test for all 32 event constants. + */ +static void RtemsEventValEvents_Action_0( void ) +{ + int i; + + for ( i = 0; i < 32; ++i ) { + RtemsEventValEventConstant_Run( events[ i ], i ); + T_step( (unsigned int) i ); /* Accounts for 32 test plan steps */ + } +} + +/** + * @brief Calculate the value of a bitwise or of all 32 event constants. + */ +static void RtemsEventValEvents_Action_1( void ) +{ + rtems_event_set all; + int i; + + all = 0; + + for ( i = 0; i < 32; ++i ) { + all |= events[ i ]; + } + + /* + * Check that the value is equal to RTEMS_ALL_EVENTS. + */ + T_step_eq_u32( 32, all, RTEMS_ALL_EVENTS ); +} + +/** + * @brief Validate the Event Manager directive options. + */ +static void RtemsEventValEvents_Action_2( void ) +{ + /* No action */ + + /* + * Check that RTEMS_EVENT_ALL is equal to zero. + */ + T_step_eq_u32( 33, RTEMS_EVENT_ALL, 0 ); + + /* + * Check that RTEMS_EVENT_ANY is a power of two. + */ + T_step_ne_u32( 34, RTEMS_EVENT_ANY, 0 ); + T_step_eq_u32( 35, RTEMS_EVENT_ANY & ( RTEMS_EVENT_ANY - 1 ), 0 ); +} + +/** + * @fn void T_case_body_RtemsEventValEvents( void ) + */ +T_TEST_CASE( RtemsEventValEvents ) +{ + T_plan( 36 ); + + RtemsEventValEvents_Action_0(); + RtemsEventValEvents_Action_1(); + RtemsEventValEvents_Action_2(); +} + +/** @} */ diff --git a/testsuites/validation/tr-event-constant.c b/testsuites/validation/tr-event-constant.c new file mode 100644 index 0000000000..fdf5ed6b8c --- /dev/null +++ b/testsuites/validation/tr-event-constant.c @@ -0,0 +1,720 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestCaseRtemsEventValEventConstant + */ + +/* + * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "tr-event-constant.h" + +#include + +/** + * @defgroup RTEMSTestCaseRtemsEventValEventConstant \ + * spec:/rtems/event/val/event-constant + * + * @ingroup RTEMSTestSuiteTestsuitesValidation0 + * + * @brief Tests an event constant and number of the Event Manager using the + * Classic and system event sets of the executing task. + * + * This test case performs the following actions: + * + * - Validate the event constant. + * + * - Check that the event constant is equal to the event number bit in the + * event set. + * + * - Check that the event number bit of the event constant is not set in + * RTEMS_PENDING_EVENTS. + * + * - Get all pending events of the Classic event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that there were no pending events. + * + * - Get all pending events of the system event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that there were no pending events. + * + * - Receive all pending events of the Classic event set of the executing task. + * + * - Check that the directive call was unsatisfied. + * + * - Check that there were no events received. + * + * - Receive all pending events of the system event set of the executing task. + * + * - Check that the directive call was unsatisfied. + * + * - Check that there were no events received. + * + * - Send the event to the Classic event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Get all pending events of the Classic event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that the pending event is equal to the event sent by a previous + * action. + * + * - Get all pending events of the system event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that there were no pending events. + * + * - Receive any event of the Classic event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that the received event is equal to the event sent by a previous + * action. + * + * - Receive any event of the system event set of the executing task. + * + * - Check that the directive call was unsatisfied. + * + * - Check that the no events were received. + * + * - Send the event to the Classic event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Get all pending events of the Classic event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that there were no pending events. + * + * - Get all pending events of the system event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that the pending event is equal to the event sent by a previous + * action. + * + * - Receive any event of the Classic event set of the executing task. + * + * - Check that the directive call was unsatisfied. + * + * - Check that the no events were received. + * + * - Receive any event of the system event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that the received event is equal to the event sent by a previous + * action. + * + * - Get all pending events of the Classic event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that there were no pending events. + * + * - Get all pending events of the system event set of the executing task. + * + * - Check that the directive call was successful. + * + * - Check that there were no pending events. + * + * @{ + */ + +/** + * @brief Test context for spec:/rtems/event/val/event-constant test case. + */ +typedef struct { + /** + * @brief This member contains a copy of the corresponding + * RtemsEventValEventConstant_Run() parameter. + */ + rtems_event_set event; + + /** + * @brief This member contains a copy of the corresponding + * RtemsEventValEventConstant_Run() parameter. + */ + int number; +} RtemsEventValEventConstant_Context; + +static RtemsEventValEventConstant_Context + RtemsEventValEventConstant_Instance; + +static T_fixture RtemsEventValEventConstant_Fixture = { + .setup = NULL, + .stop = NULL, + .teardown = NULL, + .scope = NULL, + .initial_context = &RtemsEventValEventConstant_Instance +}; + +/** + * @brief Validate the event constant. + */ +static void RtemsEventValEventConstant_Action_0( + RtemsEventValEventConstant_Context *ctx +) +{ + /* No action */ + + /* + * Check that the event constant is equal to the event number bit in the + * event set. + */ + T_step_eq_u32( + 0, + ctx->event, + ( (rtems_event_set) 1 ) << ctx->number + ); + + /* + * Check that the event number bit of the event constant is not set in + * RTEMS_PENDING_EVENTS. + */ + T_step_eq_u32( 1, ctx->event & RTEMS_PENDING_EVENTS, 0 ); +} + +/** + * @brief Get all pending events of the Classic event set of the executing + * task. + */ +static void RtemsEventValEventConstant_Action_1( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_receive( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 2, sc ); + + /* + * Check that there were no pending events. + */ + T_step_eq_u32( 3, out, 0 ); +} + +/** + * @brief Get all pending events of the system event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_2( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_system_receive( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 4, sc ); + + /* + * Check that there were no pending events. + */ + T_step_eq_u32( 5, out, 0 ); +} + +/** + * @brief Receive all pending events of the Classic event set of the executing + * task. + */ +static void RtemsEventValEventConstant_Action_3( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_receive( + RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT | RTEMS_EVENT_ANY, + 0, + &out + ); + + /* + * Check that the directive call was unsatisfied. + */ + T_step_rsc( 6, sc, RTEMS_UNSATISFIED ); + + /* + * Check that there were no events received. + */ + T_step_eq_u32( 7, out, 0 ); +} + +/** + * @brief Receive all pending events of the system event set of the executing + * task. + */ +static void RtemsEventValEventConstant_Action_4( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_system_receive( + RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT | RTEMS_EVENT_ANY, + 0, + &out + ); + + /* + * Check that the directive call was unsatisfied. + */ + T_step_rsc( 8, sc, RTEMS_UNSATISFIED ); + + /* + * Check that there were no events received. + */ + T_step_eq_u32( 9, out, 0 ); +} + +/** + * @brief Send the event to the Classic event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_5( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + + sc = rtems_event_send( RTEMS_SELF, ctx->event ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 10, sc ); +} + +/** + * @brief Get all pending events of the Classic event set of the executing + * task. + */ +static void RtemsEventValEventConstant_Action_6( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_receive( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 11, sc ); + + /* + * Check that the pending event is equal to the event sent by a previous + * action. + */ + T_step_eq_u32( 12, out, ctx->event ); +} + +/** + * @brief Get all pending events of the system event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_7( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_system_receive( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 13, sc ); + + /* + * Check that there were no pending events. + */ + T_step_eq_u32( 14, out, 0 ); +} + +/** + * @brief Receive any event of the Classic event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_8( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = 0; + sc = rtems_event_receive( + RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT | RTEMS_EVENT_ANY, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 15, sc ); + + /* + * Check that the received event is equal to the event sent by a previous + * action. + */ + T_step_eq_u32( 16, out, ctx->event ); +} + +/** + * @brief Receive any event of the system event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_9( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_system_receive( + RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT | RTEMS_EVENT_ANY, + 0, + &out + ); + + /* + * Check that the directive call was unsatisfied. + */ + T_step_rsc( 17, sc, RTEMS_UNSATISFIED ); + + /* + * Check that the no events were received. + */ + T_step_eq_u32( 18, out, 0 ); +} + +/** + * @brief Send the event to the Classic event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_10( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + + sc = rtems_event_system_send( RTEMS_SELF, ctx->event ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 19, sc ); +} + +/** + * @brief Get all pending events of the Classic event set of the executing + * task. + */ +static void RtemsEventValEventConstant_Action_11( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_receive( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 20, sc ); + + /* + * Check that there were no pending events. + */ + T_step_eq_u32( 21, out, 0 ); +} + +/** + * @brief Get all pending events of the system event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_12( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_system_receive( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 22, sc ); + + /* + * Check that the pending event is equal to the event sent by a previous + * action. + */ + T_step_eq_u32( 23, out, ctx->event ); +} + +/** + * @brief Receive any event of the Classic event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_13( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_receive( + RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT | RTEMS_EVENT_ANY, + 0, + &out + ); + + /* + * Check that the directive call was unsatisfied. + */ + T_step_rsc( 24, sc, RTEMS_UNSATISFIED ); + + /* + * Check that the no events were received. + */ + T_step_eq_u32( 25, out, 0 ); +} + +/** + * @brief Receive any event of the system event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_14( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = 0; + sc = rtems_event_system_receive( + RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT | RTEMS_EVENT_ANY, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 26, sc ); + + /* + * Check that the received event is equal to the event sent by a previous + * action. + */ + T_step_eq_u32( 27, out, ctx->event ); +} + +/** + * @brief Get all pending events of the Classic event set of the executing + * task. + */ +static void RtemsEventValEventConstant_Action_15( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_receive( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 28, sc ); + + /* + * Check that there were no pending events. + */ + T_step_eq_u32( 29, out, 0 ); +} + +/** + * @brief Get all pending events of the system event set of the executing task. + */ +static void RtemsEventValEventConstant_Action_16( + RtemsEventValEventConstant_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set out; + + out = RTEMS_ALL_EVENTS; + sc = rtems_event_system_receive( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + 0, + &out + ); + + /* + * Check that the directive call was successful. + */ + T_step_rsc_success( 30, sc ); + + /* + * Check that there were no pending events. + */ + T_step_eq_u32( 31, out, 0 ); +} + +static T_fixture_node RtemsEventValEventConstant_Node; + +void RtemsEventValEventConstant_Run( rtems_event_set event, int number ) +{ + RtemsEventValEventConstant_Context *ctx; + + ctx = T_push_fixture( + &RtemsEventValEventConstant_Node, + &RtemsEventValEventConstant_Fixture + ); + + ctx->event = event; + ctx->number = number; + + T_plan( 32 ); + + RtemsEventValEventConstant_Action_0( ctx ); + RtemsEventValEventConstant_Action_1( ctx ); + RtemsEventValEventConstant_Action_2( ctx ); + RtemsEventValEventConstant_Action_3( ctx ); + RtemsEventValEventConstant_Action_4( ctx ); + RtemsEventValEventConstant_Action_5( ctx ); + RtemsEventValEventConstant_Action_6( ctx ); + RtemsEventValEventConstant_Action_7( ctx ); + RtemsEventValEventConstant_Action_8( ctx ); + RtemsEventValEventConstant_Action_9( ctx ); + RtemsEventValEventConstant_Action_10( ctx ); + RtemsEventValEventConstant_Action_11( ctx ); + RtemsEventValEventConstant_Action_12( ctx ); + RtemsEventValEventConstant_Action_13( ctx ); + RtemsEventValEventConstant_Action_14( ctx ); + RtemsEventValEventConstant_Action_15( ctx ); + RtemsEventValEventConstant_Action_16( ctx ); + + T_pop_fixture(); +} + +/** @} */ diff --git a/testsuites/validation/tr-event-constant.h b/testsuites/validation/tr-event-constant.h new file mode 100644 index 0000000000..b6484874d5 --- /dev/null +++ b/testsuites/validation/tr-event-constant.h @@ -0,0 +1,81 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestCaseRtemsEventValEventConstant + */ + +/* + * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifndef _TR_EVENT_CONSTANT_H +#define _TR_EVENT_CONSTANT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup RTEMSTestCaseRtemsEventValEventConstant + * + * @{ + */ + +/** + * @brief Runs the parameterized test case. + * + * @param event is the event constant. + * + * @param number is the event number. + */ +void RtemsEventValEventConstant_Run( rtems_event_set event, int number ); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* _TR_EVENT_CONSTANT_H */ diff --git a/testsuites/validation/tr-event-send-receive.c b/testsuites/validation/tr-event-send-receive.c new file mode 100644 index 0000000000..935be6b62e --- /dev/null +++ b/testsuites/validation/tr-event-send-receive.c @@ -0,0 +1,2686 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestCaseRtemsEventReqSendReceive + */ + +/* + * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "tr-event-send-receive.h" + +#include + +/** + * @defgroup RTEMSTestCaseRtemsEventReqSendReceive \ + * spec:/rtems/event/req/send-receive + * + * @ingroup RTEMSTestSuiteTestsuitesValidation0 + * + * @{ + */ + +typedef enum { + PRIO_HIGH = 1, + PRIO_NORMAL, + PRIO_LOW, + PRIO_OTHER +} Priorities; + +typedef enum { + SENDER_NONE, + SENDER_SELF, + SENDER_SELF_2, + SENDER_WORKER, + SENDER_INTERRUPT +} SenderTypes; + +typedef enum { + RECEIVE_SKIP, + RECEIVE_NORMAL, + RECEIVE_INTERRUPT +} ReceiveTypes; + +typedef enum { + RECEIVE_COND_UNKNOWN, + RECEIVE_COND_SATSIFIED, + RECEIVE_COND_UNSATISFIED +} ReceiveConditionStates; + +/** + * @brief Test context for spec:/rtems/event/req/send-receive test case. + */ +typedef struct { + /** + * @brief This member defines the sender type to perform the event send + * action. + */ + SenderTypes sender_type; + + /** + * @brief This member defines the sender task priority. + */ + Priorities sender_prio; + + /** + * @brief This member defines the receiver ID used for the event send action. + */ + rtems_id receiver_id; + + /** + * @brief This member defines the events to send for the event send action. + */ + rtems_event_set events_to_send; + + /** + * @brief This member contains the status of the event send action. + */ + rtems_status_code send_status; + + /** + * @brief This member contains the scheduler ID of the runner task. + */ + ReceiveTypes receive_type; + + /** + * @brief This member defines the option set used for the event receive + * action. + */ + rtems_option receive_option_set; + + /** + * @brief This member defines the timeout used for the event receive action. + */ + rtems_interval receive_timeout; + + /** + * @brief This member contains the events received by the event receive + * action. + */ + rtems_event_set received_events; + + /** + * @brief This member references the event set received by the event receive + * action or is NULL. + */ + rtems_event_set *received_events_parameter; + + /** + * @brief This member contains the status of the event receive action. + */ + rtems_status_code receive_status; + + /** + * @brief This member contains the event condition state of the receiver task + * after the event send action. + */ + ReceiveConditionStates receive_condition_state; + + /** + * @brief This member contains the pending events after an event send action + * which did not satisify the event condition of the receiver. + */ + rtems_event_set unsatisfied_pending; + + /** + * @brief This member contains the TCB of the runner task. + */ + Thread_Control *runner_thread; + + /** + * @brief This member contains the ID of the runner task. + */ + rtems_id runner_id; + + /** + * @brief This member contains the task ID of the worker task. + */ + rtems_id worker_id; + + /** + * @brief This member contains the ID of the semaphore used to wake up the + * worker task. + */ + rtems_id worker_wakeup; + + /** + * @brief This member contains the ID of the semaphore used to wake up the + * runner task. + */ + rtems_id runner_wakeup; + + /** + * @brief This member contains the scheduler ID of scheduler used by the + * runner task. + */ + rtems_id runner_sched; + + /** + * @brief This member contains the scheduler ID of another scheduler which is + * not used by the runner task. + */ + rtems_id other_sched; + + /** + * @brief This member contains the thread switch log. + */ + T_thread_switch_log_4 thread_switch_log; + + /** + * @brief This member contains a copy of the corresponding + * RtemsEventReqSendReceive_Run() parameter. + */ + rtems_status_code ( *send )( rtems_id, rtems_event_set ); + + /** + * @brief This member contains a copy of the corresponding + * RtemsEventReqSendReceive_Run() parameter. + */ + rtems_status_code ( *receive )( rtems_event_set, rtems_option, rtems_interval, rtems_event_set * ); + + /** + * @brief This member contains a copy of the corresponding + * RtemsEventReqSendReceive_Run() parameter. + */ + rtems_event_set ( *get_pending_events )( Thread_Control * ); + + /** + * @brief This member contains a copy of the corresponding + * RtemsEventReqSendReceive_Run() parameter. + */ + unsigned int wait_class; + + /** + * @brief This member contains a copy of the corresponding + * RtemsEventReqSendReceive_Run() parameter. + */ + int waiting_for_event; + + /** + * @brief This member defines the pre-condition states for the next action. + */ + size_t pcs[ 4 ]; + + /** + * @brief This member indicates if the test action loop is currently + * executed. + */ + bool in_action_loop; +} RtemsEventReqSendReceive_Context; + +static RtemsEventReqSendReceive_Context + RtemsEventReqSendReceive_Instance; + +static const char * const RtemsEventReqSendReceive_PreDesc_Id[] = { + "InvId", + "Task", + "NA" +}; + +static const char * const RtemsEventReqSendReceive_PreDesc_Send[] = { + "Zero", + "Unrelated", + "Any", + "All", + "MixedAny", + "MixedAll", + "NA" +}; + +static const char * const RtemsEventReqSendReceive_PreDesc_ReceiverState[] = { + "InvAddr", + "NotWaiting", + "Poll", + "Timeout", + "Lower", + "Equal", + "Higher", + "Other", + "Intend", + "NA" +}; + +static const char * const RtemsEventReqSendReceive_PreDesc_Satisfy[] = { + "All", + "Any", + "NA" +}; + +static const char * const * const RtemsEventReqSendReceive_PreDesc[] = { + RtemsEventReqSendReceive_PreDesc_Id, + RtemsEventReqSendReceive_PreDesc_Send, + RtemsEventReqSendReceive_PreDesc_ReceiverState, + RtemsEventReqSendReceive_PreDesc_Satisfy, + NULL +}; + +#define INPUT_EVENTS ( RTEMS_EVENT_5 | RTEMS_EVENT_23 ) + +#define WORKER_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES + +#define MAX_TLS_SIZE RTEMS_ALIGN_UP( 64, RTEMS_TASK_STORAGE_ALIGNMENT ) + +typedef RtemsEventReqSendReceive_Context Context; + +RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT ) static char WorkerStorage[ + RTEMS_TASK_STORAGE_SIZE( + MAX_TLS_SIZE + RTEMS_MINIMUM_STACK_SIZE, + WORKER_ATTRIBUTES + ) +]; + +static const rtems_task_config WorkerConfig = { + .name = rtems_build_name( 'W', 'O', 'R', 'K' ), + .initial_priority = PRIO_LOW, + .storage_area = WorkerStorage, + .storage_size = sizeof( WorkerStorage ), + .maximum_thread_local_storage_size = MAX_TLS_SIZE, + .initial_modes = RTEMS_DEFAULT_MODES, + .attributes = WORKER_ATTRIBUTES +}; + +static rtems_id CreateWakeupSema( void ) +{ + rtems_status_code sc; + rtems_id id; + + sc = rtems_semaphore_create( + rtems_build_name( 'W', 'K', 'U', 'P' ), + 0, + RTEMS_SIMPLE_BINARY_SEMAPHORE, + 0, + &id + ); + T_assert_rsc_success( sc ); + + return id; +} + +static void DeleteWakeupSema( rtems_id id ) +{ + if ( id != 0 ) { + rtems_status_code sc; + + sc = rtems_semaphore_delete( id ); + T_rsc_success( sc ); + } +} + +static void Wait( rtems_id id ) +{ + rtems_status_code sc; + + sc = rtems_semaphore_obtain( id, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); + T_quiet_rsc_success( sc ); +} + +static void Wakeup( rtems_id id ) +{ + rtems_status_code sc; + + sc = rtems_semaphore_release( id ); + T_quiet_rsc_success( sc ); +} + +static bool BlockedForEvent( Context *ctx, Thread_Wait_flags flags ) +{ + return flags == ( ctx->wait_class | THREAD_WAIT_STATE_BLOCKED ); +} + +static bool IntendsToBlockForEvent( Context *ctx, Thread_Wait_flags flags ) +{ + return flags == ( ctx->wait_class | THREAD_WAIT_STATE_INTEND_TO_BLOCK ); +} + +static bool EventReadyAgain( Context *ctx, Thread_Wait_flags flags ) +{ + return flags == ( ctx->wait_class | THREAD_WAIT_STATE_READY_AGAIN ); +} + +static bool IsSatisfiedFlags( Context *ctx ) +{ + return EventReadyAgain( + ctx, + _Thread_Wait_flags_get( ctx->runner_thread ) + ); +} + +static bool IsSatisfiedState( Context *ctx ) +{ + return ctx->runner_thread->current_state != ctx->waiting_for_event; +} + +static void SendAction( Context *ctx ) +{ + T_thread_switch_log *log; + + log = T_thread_switch_record_4( &ctx->thread_switch_log ); + T_quiet_null( log ); + ctx->send_status = ( *ctx->send )( ctx->receiver_id, ctx->events_to_send ); + log = T_thread_switch_record( NULL ); + T_quiet_eq_ptr( log, &ctx->thread_switch_log.log ); +} + +static void Send( + Context *ctx, + bool ( *is_satsified )( Context * ) +) +{ + SendAction( ctx ); + + if ( ( *is_satsified )( ctx ) ) { + ctx->receive_condition_state = RECEIVE_COND_SATSIFIED; + } else { + rtems_status_code sc; + rtems_event_set pending; + rtems_event_set missing; + + ctx->receive_condition_state = RECEIVE_COND_UNSATISFIED; + pending = ( *ctx->get_pending_events )( ctx->runner_thread ); + ctx->unsatisfied_pending = pending; + + missing = INPUT_EVENTS & ~ctx->events_to_send; + T_ne_u32( missing, 0 ); + sc = ( *ctx->send )( ctx->runner_id, missing ); + T_rsc_success( sc ); + + pending = ( *ctx->get_pending_events )( ctx->runner_thread ); + T_eq_u32( pending, ctx->events_to_send & ~INPUT_EVENTS ); + } +} + +static void Worker( rtems_task_argument arg ) +{ + Context *ctx; + + ctx = (Context *) arg; + + while ( true ) { + rtems_status_code sc; + rtems_task_priority prio; + T_thread_switch_log *log; + + Wait( ctx->worker_wakeup ); + + switch ( ctx->sender_prio ) { + case PRIO_NORMAL: + case PRIO_HIGH: + prio = 0; + sc = rtems_task_set_priority( RTEMS_SELF, ctx->sender_prio, &prio ); + T_rsc_success( sc ); + T_eq_u32( prio, PRIO_LOW ); + break; + case PRIO_OTHER: + log = T_thread_switch_record_4( &ctx->thread_switch_log ); + T_null( log ); + sc = rtems_task_set_scheduler( + RTEMS_SELF, + ctx->other_sched, + PRIO_LOW + ); + T_rsc_success( sc ); + + /* + * Make sure the context switch to the IDLE thread on the previous + * CPU is recorded, otherwise the preemption check may sporadically + * fail on some targets. + */ + while (ctx->thread_switch_log.log.recorded < 2) { + RTEMS_COMPILER_MEMORY_BARRIER(); + } + + log = T_thread_switch_record( NULL ); + T_eq_ptr( log, &ctx->thread_switch_log.log ); + break; + case PRIO_LOW: + break; + } + + Send( ctx, IsSatisfiedState ); + + sc = rtems_task_set_scheduler( + RTEMS_SELF, + ctx->runner_sched, + PRIO_HIGH + ); + T_rsc_success( sc ); + + Wakeup( ctx->runner_wakeup ); + } +} + +static rtems_event_set GetPendingEvents( Context *ctx ) +{ + rtems_event_set pending; + rtems_status_code sc; + + sc = ( *ctx->receive )( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + 0, + &pending + ); + T_quiet_rsc_success( sc ); + + return pending; +} + +static void RtemsEventReqSendReceive_Cleanup( Context *ctx ); + +static void InterruptPrepare( void *arg ) +{ + RtemsEventReqSendReceive_Cleanup( arg ); +} + +static void InterruptAction( void *arg ) +{ + Context *ctx; + + ctx = arg; + ctx->receive_status = ( *ctx->receive )( + INPUT_EVENTS, + ctx->receive_option_set, + ctx->receive_timeout, + &ctx->received_events + ); + T_quiet_rsc_success( ctx->receive_status ); +} + +static void InterruptContinue( Context *ctx ) +{ + rtems_status_code sc; + + sc = ( *ctx->send )( ctx->receiver_id, INPUT_EVENTS ); + T_quiet_rsc_success( sc ); +} + +static T_interrupt_test_state Interrupt( void *arg ) +{ + Context *ctx; + Thread_Wait_flags flags; + T_interrupt_test_state next_state; + T_interrupt_test_state previous_state; + + ctx = arg; + flags = _Thread_Wait_flags_get( ctx->runner_thread ); + + if ( IntendsToBlockForEvent( ctx, flags ) ) { + next_state = T_INTERRUPT_TEST_DONE; + } else if ( BlockedForEvent( ctx, flags ) ) { + next_state = T_INTERRUPT_TEST_LATE; + } else { + next_state = T_INTERRUPT_TEST_EARLY; + } + + previous_state = T_interrupt_test_change_state( + T_INTERRUPT_TEST_ACTION, + next_state + ); + + if ( previous_state == T_INTERRUPT_TEST_ACTION ) { + if ( next_state == T_INTERRUPT_TEST_DONE ) { + Send( ctx, IsSatisfiedFlags ); + } else { + InterruptContinue( ctx ); + } + } + + return next_state; +} + +static const T_interrupt_test_config InterruptConfig = { + .prepare = InterruptPrepare, + .action = InterruptAction, + .interrupt = Interrupt, + .max_iteration_count = 10000 +}; + +static void RtemsEventReqSendReceive_Pre_Id_Prepare( + RtemsEventReqSendReceive_Context *ctx, + RtemsEventReqSendReceive_Pre_Id state +) +{ + switch ( state ) { + case RtemsEventReqSendReceive_Pre_Id_InvId: { + /* + * The id parameter of the send directive shall be an invalid task object + * identifier. + */ + ctx->receiver_id = 0xffffffff; + ctx->sender_type = SENDER_SELF; + break; + } + + case RtemsEventReqSendReceive_Pre_Id_Task: { + /* + * The id parameter of the send directive shall be a valid task object + * identifier. + */ + ctx->receiver_id = ctx->runner_id; + break; + } + + case RtemsEventReqSendReceive_Pre_Id_NA: + break; + } +} + +static void RtemsEventReqSendReceive_Pre_Send_Prepare( + RtemsEventReqSendReceive_Context *ctx, + RtemsEventReqSendReceive_Pre_Send state +) +{ + switch ( state ) { + case RtemsEventReqSendReceive_Pre_Send_Zero: { + /* + * The event set sent shall be the empty. + */ + ctx->events_to_send = 0; + break; + } + + case RtemsEventReqSendReceive_Pre_Send_Unrelated: { + /* + * The event set sent shall be unrelated to the event receive condition. + */ + ctx->events_to_send = RTEMS_EVENT_7; + break; + } + + case RtemsEventReqSendReceive_Pre_Send_Any: { + /* + * The event set sent shall be contain at least one but not all events of + * the event receive condition. + */ + ctx->events_to_send = RTEMS_EVENT_5; + break; + } + + case RtemsEventReqSendReceive_Pre_Send_All: { + /* + * The event set sent shall be contain all events of the event receive + * condition. + */ + ctx->events_to_send = RTEMS_EVENT_5 | RTEMS_EVENT_23; + break; + } + + case RtemsEventReqSendReceive_Pre_Send_MixedAny: { + /* + * The event set sent shall be contain at least one but not all events of + * the event receive condition and at least one unrelated event. + */ + ctx->events_to_send = RTEMS_EVENT_5 | RTEMS_EVENT_7; + break; + } + + case RtemsEventReqSendReceive_Pre_Send_MixedAll: { + /* + * The event set sent shall be contain all events of the event receive + * condition and at least one unrelated event. + */ + ctx->events_to_send = RTEMS_EVENT_5 | RTEMS_EVENT_7 | RTEMS_EVENT_23; + break; + } + + case RtemsEventReqSendReceive_Pre_Send_NA: + break; + } +} + +static void RtemsEventReqSendReceive_Pre_ReceiverState_Prepare( + RtemsEventReqSendReceive_Context *ctx, + RtemsEventReqSendReceive_Pre_ReceiverState state +) +{ + switch ( state ) { + case RtemsEventReqSendReceive_Pre_ReceiverState_InvAddr: { + /* + * The receiver task shall use the NULL pointer for the event set to + * receive. + */ + ctx->sender_type = SENDER_SELF; + ctx->receive_type = RECEIVE_NORMAL; + ctx->received_events_parameter = NULL; + break; + } + + case RtemsEventReqSendReceive_Pre_ReceiverState_NotWaiting: { + /* + * The receiver task shall not be waiting for events. + */ + ctx->sender_type = SENDER_SELF; + ctx->receive_type = RECEIVE_SKIP; + break; + } + + case RtemsEventReqSendReceive_Pre_ReceiverState_Poll: { + /* + * The receiver task shall poll for events. + */ + ctx->sender_type = SENDER_SELF; + ctx->receive_type = RECEIVE_NORMAL; + ctx->receive_option_set |= RTEMS_NO_WAIT; + break; + } + + case RtemsEventReqSendReceive_Pre_ReceiverState_Timeout: { + /* + * The receiver task shall have waited for events with a timeout which + * occurred. + */ + ctx->sender_type = SENDER_SELF_2; + ctx->receive_type = RECEIVE_NORMAL; + ctx->receive_timeout = 1; + break; + } + + case RtemsEventReqSendReceive_Pre_ReceiverState_Lower: { + /* + * The receiver task shall be blocked waiting for events and the receiver + * task shall have a lower priority than the sender task. + */ + ctx->sender_type = SENDER_WORKER; + ctx->sender_prio = PRIO_HIGH; + ctx->receive_type = RECEIVE_NORMAL; + break; + } + + case RtemsEventReqSendReceive_Pre_ReceiverState_Equal: { + /* + * The receiver task shall be blocked waiting for events and the receiver + * task shall have a priority equal to the sender task. + */ + ctx->sender_type = SENDER_WORKER; + ctx->sender_prio = PRIO_NORMAL; + ctx->receive_type = RECEIVE_NORMAL; + break; + } + + case RtemsEventReqSendReceive_Pre_ReceiverState_Higher: { + /* + * The receiver task shall be blocked waiting for events and the receiver + * task shall have a higher priority than the sender task. + */ + ctx->sender_type = SENDER_WORKER; + ctx->sender_prio = PRIO_LOW; + ctx->receive_type = RECEIVE_NORMAL; + break; + } + + case RtemsEventReqSendReceive_Pre_ReceiverState_Other: { + /* + * The receiver task shall be blocked waiting for events and the receiver + * task shall be on another scheduler instance than the sender task. + */ + ctx->sender_type = SENDER_WORKER; + ctx->sender_prio = PRIO_OTHER; + ctx->receive_type = RECEIVE_NORMAL; + break; + } + + case RtemsEventReqSendReceive_Pre_ReceiverState_Intend: { + /* + * The receiver task shall intend to block for waiting for events. + */ + ctx->sender_type = SENDER_INTERRUPT; + ctx->receive_type = RECEIVE_INTERRUPT; + break; + } + + case RtemsEventReqSendReceive_Pre_ReceiverState_NA: + break; + } +} + +static void RtemsEventReqSendReceive_Pre_Satisfy_Prepare( + RtemsEventReqSendReceive_Context *ctx, + RtemsEventReqSendReceive_Pre_Satisfy state +) +{ + switch ( state ) { + case RtemsEventReqSendReceive_Pre_Satisfy_All: { + /* + * The receiver task shall be interested in all input events. + */ + ctx->receive_option_set |= RTEMS_EVENT_ALL; + break; + } + + case RtemsEventReqSendReceive_Pre_Satisfy_Any: { + /* + * The receiver task shall be interested in any input event. + */ + ctx->receive_option_set |= RTEMS_EVENT_ANY; + break; + } + + case RtemsEventReqSendReceive_Pre_Satisfy_NA: + break; + } +} + +static void RtemsEventReqSendReceive_Post_SendStatus_Check( + RtemsEventReqSendReceive_Context *ctx, + RtemsEventReqSendReceive_Post_SendStatus state +) +{ + switch ( state ) { + case RtemsEventReqSendReceive_Post_SendStatus_Ok: { + /* + * The send event status shall be RTEMS_SUCCESSFUL. + */ + T_rsc_success( ctx->send_status ); + break; + } + + case RtemsEventReqSendReceive_Post_SendStatus_InvId: { + /* + * The send event status shall be RTEMS_INVALID_ID. + */ + T_rsc( ctx->send_status, RTEMS_INVALID_ID ); + break; + } + + case RtemsEventReqSendReceive_Post_SendStatus_NA: + break; + } +} + +static void RtemsEventReqSendReceive_Post_ReceiveStatus_Check( + RtemsEventReqSendReceive_Context *ctx, + RtemsEventReqSendReceive_Post_ReceiveStatus state +) +{ + switch ( state ) { + case RtemsEventReqSendReceive_Post_ReceiveStatus_None: { + /* + * The receiver task shall have no pending events. + */ + T_eq_int( ctx->receive_condition_state, RECEIVE_COND_UNKNOWN ); + T_eq_u32( GetPendingEvents( ctx ), 0 ); + break; + } + + case RtemsEventReqSendReceive_Post_ReceiveStatus_Pending: { + /* + * The receiver task shall have all events sent pending. + */ + T_eq_int( ctx->receive_condition_state, RECEIVE_COND_UNKNOWN ); + T_eq_u32( GetPendingEvents( ctx ), ctx->events_to_send ); + break; + } + + case RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout: { + /* + * The receive event status shall be RTEMS_TIMEOUT. The receiver task + * shall have all events sent after the timeout pending. + */ + T_rsc( ctx->receive_status, RTEMS_TIMEOUT ); + T_eq_int( ctx->receive_condition_state, RECEIVE_COND_UNKNOWN ); + T_eq_u32( GetPendingEvents( ctx ), ctx->events_to_send ); + break; + } + + case RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied: { + /* + * The receive event status shall be RTEMS_SUCCESSFUL. The receiver task + * shall receive all events sent which are an element of the input + * events. The receiver task shall have all events sent which are not an + * element of the input events pending. + */ + T_rsc( ctx->receive_status, RTEMS_SUCCESSFUL ); + + if ( ctx->receive_type != RECEIVE_NORMAL ) { + T_eq_int( ctx->receive_condition_state, RECEIVE_COND_SATSIFIED ); + } + + T_eq_u32( ctx->received_events, ctx->events_to_send & INPUT_EVENTS ); + T_eq_u32( GetPendingEvents( ctx ), ctx->events_to_send & ~INPUT_EVENTS ); + break; + } + + case RtemsEventReqSendReceive_Post_ReceiveStatus_Unsatisfied: { + /* + * The receive event status shall be RTEMS_UNSATISFIED. The receiver task + * shall have all events sent pending. + */ + T_rsc( ctx->receive_status, RTEMS_UNSATISFIED ); + T_eq_int( ctx->receive_condition_state, RECEIVE_COND_UNKNOWN ); + T_eq_u32( GetPendingEvents( ctx ), ctx->events_to_send ); + break; + } + + case RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked: { + /* + * The receiver task shall remain blocked waiting for events after the + * directive call. The receiver task shall have all events sent pending. + */ + T_eq_int( ctx->receive_condition_state, RECEIVE_COND_UNSATISFIED ); + T_eq_u32( ctx->unsatisfied_pending, ctx->events_to_send ); + break; + } + + case RtemsEventReqSendReceive_Post_ReceiveStatus_InvAddr: { + /* + * The receive event status shall be RTEMS_INVALID_ADDRESS. The receiver + * task shall have all events sent pending. + */ + T_rsc( ctx->receive_status, RTEMS_INVALID_ADDRESS ); + T_eq_int( ctx->receive_condition_state, RECEIVE_COND_UNKNOWN ); + T_eq_u32( GetPendingEvents( ctx ), ctx->events_to_send ); + break; + } + + case RtemsEventReqSendReceive_Post_ReceiveStatus_NA: + break; + } +} + +static void RtemsEventReqSendReceive_Post_SenderPreemption_Check( + RtemsEventReqSendReceive_Context *ctx, + RtemsEventReqSendReceive_Post_SenderPreemption state +) +{ + T_thread_switch_log *log; + size_t i; + + log = &ctx->thread_switch_log.log; + + switch ( state ) { + case RtemsEventReqSendReceive_Post_SenderPreemption_No: { + /* + * When the sender task calls the directive to send the events, the + * sender task shall not be preempted as a result of the call. + */ + /* + * There may be a thread switch to the runner thread if the sender thread + * was on another scheduler instance. + */ + + T_le_sz( log->recorded, 1 ); + + for ( i = 0; i < log->recorded; ++i ) { + T_ne_u32( log->events[ i ].executing, ctx->worker_id ); + T_eq_u32( log->events[ i ].heir, ctx->runner_id ); + } + break; + } + + case RtemsEventReqSendReceive_Post_SenderPreemption_Yes: { + /* + * When the sender task calls the directive to send the events, the + * sender task shall be preempted as a result of the call. + */ + T_eq_sz( log->recorded, 2 ); + T_eq_u32( log->events[ 0 ].heir, ctx->runner_id ); + T_eq_u32( log->events[ 1 ].heir, ctx->worker_id ); + break; + } + + case RtemsEventReqSendReceive_Post_SenderPreemption_NA: + break; + } +} + +static void RtemsEventReqSendReceive_Setup( + RtemsEventReqSendReceive_Context *ctx +) +{ + rtems_status_code sc; + rtems_task_priority prio; + + memset( ctx, 0, sizeof( *ctx ) ); + ctx->runner_thread = _Thread_Get_executing(); + ctx->runner_id = ctx->runner_thread->Object.id; + ctx->worker_wakeup = CreateWakeupSema(); + ctx->runner_wakeup = CreateWakeupSema(); + + sc = rtems_task_get_scheduler( RTEMS_SELF, &ctx->runner_sched ); + T_rsc_success( sc ); + + #if defined(RTEMS_SMP) + sc = rtems_scheduler_ident_by_processor( 1, &ctx->other_sched ); + T_rsc_success( sc ); + T_ne_u32( ctx->runner_sched, ctx->other_sched ); + #endif + + prio = 0; + sc = rtems_task_set_priority( RTEMS_SELF, PRIO_NORMAL, &prio ); + T_rsc_success( sc ); + T_eq_u32( prio, PRIO_HIGH ); + + sc = rtems_task_construct( &WorkerConfig, &ctx->worker_id ); + T_assert_rsc_success( sc ); + + sc = rtems_task_start( ctx->worker_id, Worker, (rtems_task_argument) ctx ); + T_assert_rsc_success( sc ); +} + +static void RtemsEventReqSendReceive_Setup_Wrap( void *arg ) +{ + RtemsEventReqSendReceive_Context *ctx; + + ctx = arg; + ctx->in_action_loop = false; + RtemsEventReqSendReceive_Setup( ctx ); +} + +static void RtemsEventReqSendReceive_Teardown( + RtemsEventReqSendReceive_Context *ctx +) +{ + rtems_status_code sc; + rtems_task_priority prio; + + prio = 0; + sc = rtems_task_set_priority( RTEMS_SELF, PRIO_HIGH, &prio ); + T_rsc_success( sc ); + T_eq_u32( prio, PRIO_NORMAL ); + + if ( ctx->worker_id != 0 ) { + sc = rtems_task_delete( ctx->worker_id ); + T_rsc_success( sc ); + } + + DeleteWakeupSema( ctx->worker_wakeup ); + DeleteWakeupSema( ctx->runner_wakeup ); +} + +static void RtemsEventReqSendReceive_Teardown_Wrap( void *arg ) +{ + RtemsEventReqSendReceive_Context *ctx; + + ctx = arg; + ctx->in_action_loop = false; + RtemsEventReqSendReceive_Teardown( ctx ); +} + +static size_t RtemsEventReqSendReceive_Scope( void *arg, char *buf, size_t n ) +{ + RtemsEventReqSendReceive_Context *ctx; + + ctx = arg; + + if ( ctx->in_action_loop ) { + return T_get_scope( RtemsEventReqSendReceive_PreDesc, buf, n, ctx->pcs ); + } + + return 0; +} + +static T_fixture RtemsEventReqSendReceive_Fixture = { + .setup = RtemsEventReqSendReceive_Setup_Wrap, + .stop = NULL, + .teardown = RtemsEventReqSendReceive_Teardown_Wrap, + .scope = RtemsEventReqSendReceive_Scope, + .initial_context = &RtemsEventReqSendReceive_Instance +}; + +static const uint8_t RtemsEventReqSendReceive_TransitionMap[][ 3 ] = { + { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Unsatisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Unsatisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Unsatisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Unsatisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Unsatisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_Yes + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_Yes + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_Yes + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Unsatisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_Yes + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_Yes + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_Yes + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { +#if defined(RTEMS_SMP) + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No +#else + RtemsEventReqSendReceive_Post_SendStatus_NA, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +#endif + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + }, { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_SenderPreemption_No + } +}; + +static const struct { + uint8_t Skip : 1; + uint8_t Pre_Id_NA : 1; + uint8_t Pre_Send_NA : 1; + uint8_t Pre_ReceiverState_NA : 1; + uint8_t Pre_Satisfy_NA : 1; +} RtemsEventReqSendReceive_TransitionInfo[] = { + { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 1, 1, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 1 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { +#if defined(RTEMS_SMP) + 0, 0, 0, 0, 0 +#else + 1, 0, 0, 0, 0 +#endif + }, { + 0, 0, 0, 0, 0 + }, { + 0, 0, 0, 0, 0 + } +}; + +static void RtemsEventReqSendReceive_Prepare( + RtemsEventReqSendReceive_Context *ctx +) +{ + ctx->events_to_send = 0; + ctx->send_status = RTEMS_INCORRECT_STATE; + ctx->received_events = 0xffffffff; + ctx->received_events_parameter = &ctx->received_events; + ctx->receive_option_set = 0; + ctx->receive_timeout = RTEMS_NO_TIMEOUT; + ctx->sender_type = SENDER_NONE; + ctx->sender_prio = PRIO_NORMAL; + ctx->receive_type = RECEIVE_SKIP; + ctx->receive_condition_state = RECEIVE_COND_UNKNOWN; + ctx->unsatisfied_pending = 0xffffffff; + memset( &ctx->thread_switch_log, 0, sizeof( ctx->thread_switch_log ) ); + T_eq_u32( GetPendingEvents( ctx ), 0 ); + _Thread_Wait_flags_set( ctx->runner_thread, THREAD_WAIT_FLAGS_INITIAL ); +} + +static void RtemsEventReqSendReceive_Action( + RtemsEventReqSendReceive_Context *ctx +) +{ + if ( ctx->sender_type == SENDER_SELF ) { + SendAction( ctx ); + } else if ( ctx->sender_type == SENDER_WORKER ) { + Wakeup( ctx->worker_wakeup ); + } + + if ( ctx->receive_type == RECEIVE_NORMAL ) { + ctx->receive_status = ( *ctx->receive )( + INPUT_EVENTS, + ctx->receive_option_set, + ctx->receive_timeout, + ctx->received_events_parameter + ); + } else if ( ctx->receive_type == RECEIVE_INTERRUPT ) { + T_interrupt_test_state state; + + state = T_interrupt_test( &InterruptConfig, ctx ); + T_eq_int( state, T_INTERRUPT_TEST_DONE ); + } + + if ( ctx->sender_type == SENDER_SELF_2 ) { + SendAction( ctx ); + } else if ( ctx->sender_type == SENDER_WORKER ) { + rtems_status_code sc; + rtems_task_priority prio; + + Wait( ctx->runner_wakeup ); + + prio = 0; + sc = rtems_task_set_priority( ctx->worker_id, PRIO_LOW, &prio ); + T_rsc_success( sc ); + T_eq_u32( prio, PRIO_HIGH ); + } +} + +static void RtemsEventReqSendReceive_Cleanup( + RtemsEventReqSendReceive_Context *ctx +) +{ + rtems_status_code sc; + rtems_event_set events; + + events = 0; + sc = ( *ctx->receive )( + RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT | RTEMS_EVENT_ANY, + 0, + &events + ); + if ( sc == RTEMS_SUCCESSFUL ) { + T_quiet_ne_u32( events, 0 ); + } else { + T_quiet_rsc( sc, RTEMS_UNSATISFIED ); + T_quiet_eq_u32( events, 0 ); + } +} + +static T_fixture_node RtemsEventReqSendReceive_Node; + +void RtemsEventReqSendReceive_Run( + rtems_status_code ( *send )( rtems_id, rtems_event_set ), + rtems_status_code ( *receive )( rtems_event_set, rtems_option, rtems_interval, rtems_event_set * ), + rtems_event_set ( *get_pending_events )( Thread_Control * ), + unsigned int wait_class, + int waiting_for_event +) +{ + RtemsEventReqSendReceive_Context *ctx; + size_t index; + + ctx = T_push_fixture( + &RtemsEventReqSendReceive_Node, + &RtemsEventReqSendReceive_Fixture + ); + + ctx->send = send; + ctx->receive = receive; + ctx->get_pending_events = get_pending_events; + ctx->wait_class = wait_class; + ctx->waiting_for_event = waiting_for_event; + ctx->in_action_loop = true; + index = 0; + + for ( + ctx->pcs[ 0 ] = RtemsEventReqSendReceive_Pre_Id_InvId; + ctx->pcs[ 0 ] < RtemsEventReqSendReceive_Pre_Id_NA; + ++ctx->pcs[ 0 ] + ) { + if ( RtemsEventReqSendReceive_TransitionInfo[ index ].Pre_Id_NA ) { + ctx->pcs[ 0 ] = RtemsEventReqSendReceive_Pre_Id_NA; + index += ( RtemsEventReqSendReceive_Pre_Id_NA - 1 ) + * RtemsEventReqSendReceive_Pre_Send_NA + * RtemsEventReqSendReceive_Pre_ReceiverState_NA + * RtemsEventReqSendReceive_Pre_Satisfy_NA; + } + + for ( + ctx->pcs[ 1 ] = RtemsEventReqSendReceive_Pre_Send_Zero; + ctx->pcs[ 1 ] < RtemsEventReqSendReceive_Pre_Send_NA; + ++ctx->pcs[ 1 ] + ) { + if ( RtemsEventReqSendReceive_TransitionInfo[ index ].Pre_Send_NA ) { + ctx->pcs[ 1 ] = RtemsEventReqSendReceive_Pre_Send_NA; + index += ( RtemsEventReqSendReceive_Pre_Send_NA - 1 ) + * RtemsEventReqSendReceive_Pre_ReceiverState_NA + * RtemsEventReqSendReceive_Pre_Satisfy_NA; + } + + for ( + ctx->pcs[ 2 ] = RtemsEventReqSendReceive_Pre_ReceiverState_InvAddr; + ctx->pcs[ 2 ] < RtemsEventReqSendReceive_Pre_ReceiverState_NA; + ++ctx->pcs[ 2 ] + ) { + if ( RtemsEventReqSendReceive_TransitionInfo[ index ].Pre_ReceiverState_NA ) { + ctx->pcs[ 2 ] = RtemsEventReqSendReceive_Pre_ReceiverState_NA; + index += ( RtemsEventReqSendReceive_Pre_ReceiverState_NA - 1 ) + * RtemsEventReqSendReceive_Pre_Satisfy_NA; + } + + for ( + ctx->pcs[ 3 ] = RtemsEventReqSendReceive_Pre_Satisfy_All; + ctx->pcs[ 3 ] < RtemsEventReqSendReceive_Pre_Satisfy_NA; + ++ctx->pcs[ 3 ] + ) { + if ( RtemsEventReqSendReceive_TransitionInfo[ index ].Pre_Satisfy_NA ) { + ctx->pcs[ 3 ] = RtemsEventReqSendReceive_Pre_Satisfy_NA; + index += ( RtemsEventReqSendReceive_Pre_Satisfy_NA - 1 ); + } + + if ( RtemsEventReqSendReceive_TransitionInfo[ index ].Skip ) { + ++index; + continue; + } + + RtemsEventReqSendReceive_Prepare( ctx ); + RtemsEventReqSendReceive_Pre_Id_Prepare( ctx, ctx->pcs[ 0 ] ); + RtemsEventReqSendReceive_Pre_Send_Prepare( ctx, ctx->pcs[ 1 ] ); + RtemsEventReqSendReceive_Pre_ReceiverState_Prepare( + ctx, + ctx->pcs[ 2 ] + ); + RtemsEventReqSendReceive_Pre_Satisfy_Prepare( ctx, ctx->pcs[ 3 ] ); + RtemsEventReqSendReceive_Action( ctx ); + RtemsEventReqSendReceive_Post_SendStatus_Check( + ctx, + RtemsEventReqSendReceive_TransitionMap[ index ][ 0 ] + ); + RtemsEventReqSendReceive_Post_ReceiveStatus_Check( + ctx, + RtemsEventReqSendReceive_TransitionMap[ index ][ 1 ] + ); + RtemsEventReqSendReceive_Post_SenderPreemption_Check( + ctx, + RtemsEventReqSendReceive_TransitionMap[ index ][ 2 ] + ); + RtemsEventReqSendReceive_Cleanup( ctx ); + ++index; + } + } + } + } + + T_pop_fixture(); +} + +/** @} */ diff --git a/testsuites/validation/tr-event-send-receive.h b/testsuites/validation/tr-event-send-receive.h new file mode 100644 index 0000000000..b246a815ed --- /dev/null +++ b/testsuites/validation/tr-event-send-receive.h @@ -0,0 +1,152 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestCaseRtemsEventReqSendReceive + */ + +/* + * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifndef _TR_EVENT_SEND_RECEIVE_H +#define _TR_EVENT_SEND_RECEIVE_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup RTEMSTestCaseRtemsEventReqSendReceive + * + * @{ + */ + +typedef enum { + RtemsEventReqSendReceive_Pre_Id_InvId, + RtemsEventReqSendReceive_Pre_Id_Task, + RtemsEventReqSendReceive_Pre_Id_NA +} RtemsEventReqSendReceive_Pre_Id; + +typedef enum { + RtemsEventReqSendReceive_Pre_Send_Zero, + RtemsEventReqSendReceive_Pre_Send_Unrelated, + RtemsEventReqSendReceive_Pre_Send_Any, + RtemsEventReqSendReceive_Pre_Send_All, + RtemsEventReqSendReceive_Pre_Send_MixedAny, + RtemsEventReqSendReceive_Pre_Send_MixedAll, + RtemsEventReqSendReceive_Pre_Send_NA +} RtemsEventReqSendReceive_Pre_Send; + +typedef enum { + RtemsEventReqSendReceive_Pre_ReceiverState_InvAddr, + RtemsEventReqSendReceive_Pre_ReceiverState_NotWaiting, + RtemsEventReqSendReceive_Pre_ReceiverState_Poll, + RtemsEventReqSendReceive_Pre_ReceiverState_Timeout, + RtemsEventReqSendReceive_Pre_ReceiverState_Lower, + RtemsEventReqSendReceive_Pre_ReceiverState_Equal, + RtemsEventReqSendReceive_Pre_ReceiverState_Higher, + RtemsEventReqSendReceive_Pre_ReceiverState_Other, + RtemsEventReqSendReceive_Pre_ReceiverState_Intend, + RtemsEventReqSendReceive_Pre_ReceiverState_NA +} RtemsEventReqSendReceive_Pre_ReceiverState; + +typedef enum { + RtemsEventReqSendReceive_Pre_Satisfy_All, + RtemsEventReqSendReceive_Pre_Satisfy_Any, + RtemsEventReqSendReceive_Pre_Satisfy_NA +} RtemsEventReqSendReceive_Pre_Satisfy; + +typedef enum { + RtemsEventReqSendReceive_Post_SendStatus_Ok, + RtemsEventReqSendReceive_Post_SendStatus_InvId, + RtemsEventReqSendReceive_Post_SendStatus_NA +} RtemsEventReqSendReceive_Post_SendStatus; + +typedef enum { + RtemsEventReqSendReceive_Post_ReceiveStatus_None, + RtemsEventReqSendReceive_Post_ReceiveStatus_Pending, + RtemsEventReqSendReceive_Post_ReceiveStatus_Timeout, + RtemsEventReqSendReceive_Post_ReceiveStatus_Satisfied, + RtemsEventReqSendReceive_Post_ReceiveStatus_Unsatisfied, + RtemsEventReqSendReceive_Post_ReceiveStatus_Blocked, + RtemsEventReqSendReceive_Post_ReceiveStatus_InvAddr, + RtemsEventReqSendReceive_Post_ReceiveStatus_NA +} RtemsEventReqSendReceive_Post_ReceiveStatus; + +typedef enum { + RtemsEventReqSendReceive_Post_SenderPreemption_No, + RtemsEventReqSendReceive_Post_SenderPreemption_Yes, + RtemsEventReqSendReceive_Post_SenderPreemption_NA +} RtemsEventReqSendReceive_Post_SenderPreemption; + +/** + * @brief Runs the parameterized test case. + * + * @param send is the event send handler. + * + * @param receive is the event receive handler. + * + * @param get_pending_events is the get pending events handler. + * + * @param wait_class is the thread wait class. + * + * @param waiting_for_event is the thread waiting for event state. + */ +void RtemsEventReqSendReceive_Run( + rtems_status_code ( *send )( rtems_id, rtems_event_set ), + rtems_status_code ( *receive )( rtems_event_set, rtems_option, rtems_interval, rtems_event_set * ), + rtems_event_set ( *get_pending_events )( Thread_Control * ), + unsigned int wait_class, + int waiting_for_event +); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* _TR_EVENT_SEND_RECEIVE_H */ -- cgit v1.2.3