summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-18 16:47:20 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-19 08:44:24 +0100
commit85de9416083525791bf7c116b6d5f30cf15305a1 (patch)
tree3d8a94c9a1472f9347b31b45bd7389b44b6b9423
parent936dc89c4cbea21ae4b2751a4746527f4443e0bf (diff)
testsuites/validation/tc-intr-smp-only.c
-rw-r--r--testsuites/validation/tc-intr-smp-only.c90
1 files changed, 86 insertions, 4 deletions
diff --git a/testsuites/validation/tc-intr-smp-only.c b/testsuites/validation/tc-intr-smp-only.c
index 4448af7e5d..5cb83c3e4b 100644
--- a/testsuites/validation/tc-intr-smp-only.c
+++ b/testsuites/validation/tc-intr-smp-only.c
@@ -78,15 +78,37 @@
* - Check that maskable interrupts are disabled before the call to
* rtems_interrupt_local_disable() and disabled afterwards.
*
- * - Check that maskable interrupt status is restored by the call to
+ * - Check that the maskable interrupt status is restored by the call to
* rtems_interrupt_local_enable() according to the ``_isr_cookie``
* parameter. In this case maskable interrupts are still disabled
* afterwards.
*
- * - Check that maskable interrupt status is restored by the call to
+ * - Check that the maskable interrupt status is restored by the call to
* rtems_interrupt_local_enable() according to the ``_isr_cookie``
* parameter. In this case maskable interrupts are enabled afterwards.
*
+ * - Validate the interrupt lock directives.
+ *
+ * - Check that maskable interrupts are disabled before the call to
+ * rtems_interrupt_lock_interrupt_disable() and disabled afterwards.
+ *
+ * - Check that the maskable interrupt status is not changed by the
+ * rtems_interrupt_lock_acquire_isr() call.
+ *
+ * - Check that the maskable interrupt status is restored by the call to
+ * rtems_interrupt_lock_release() according to the ``_lock_context``
+ * parameter.
+ *
+ * - Check that maskable interrupts are disabled before the call to
+ * rtems_interrupt_lock_acquire() and disabled afterwards.
+ *
+ * - Check that the maskable interrupt status is restored by the call to
+ * rtems_interrupt_lock_release() according to the ``_lock_context``
+ * parameter.
+ *
+ * - Check that the maskable interrupt status is not changed by the
+ * rtems_interrupt_lock_destroy() call.
+ *
* @{
*/
@@ -116,7 +138,7 @@ static void RtemsIntrValIntrSmpOnly_Action_0( void )
T_false( AreInterruptsEnabled() );
/*
- * Check that maskable interrupt status is restored by the call to
+ * Check that the maskable interrupt status is restored by the call to
* rtems_interrupt_local_enable() according to the ``_isr_cookie`` parameter.
* In this case maskable interrupts are still disabled afterwards.
*/
@@ -125,7 +147,7 @@ static void RtemsIntrValIntrSmpOnly_Action_0( void )
T_false( AreInterruptsEnabled() );
/*
- * Check that maskable interrupt status is restored by the call to
+ * Check that the maskable interrupt status is restored by the call to
* rtems_interrupt_local_enable() according to the ``_isr_cookie`` parameter.
* In this case maskable interrupts are enabled afterwards.
*/
@@ -135,11 +157,71 @@ static void RtemsIntrValIntrSmpOnly_Action_0( void )
}
/**
+ * @brief Validate the interrupt lock directives.
+ */
+static void RtemsIntrValIntrSmpOnly_Action_1( void )
+{
+ RTEMS_INTERRUPT_LOCK_DEFINE( , lock, "name" );
+ rtems_interrupt_lock_context lock_context;
+
+ /*
+ * Check that maskable interrupts are disabled before the call to
+ * rtems_interrupt_lock_interrupt_disable() and disabled afterwards.
+ */
+ T_true( AreInterruptsEnabled() );
+ rtems_interrupt_lock_interrupt_disable( &lock_context );
+ T_false( AreInterruptsEnabled() );
+
+ /*
+ * Check that the maskable interrupt status is not changed by the
+ * rtems_interrupt_lock_acquire_isr() call.
+ */
+ T_false( AreInterruptsEnabled() );
+ rtems_interrupt_lock_acquire_isr( &lock, &lock_context );
+ T_false( AreInterruptsEnabled() );
+
+ /*
+ * Check that the maskable interrupt status is restored by the call to
+ * rtems_interrupt_lock_release() according to the ``_lock_context``
+ * parameter.
+ */
+ T_false( AreInterruptsEnabled() );
+ rtems_interrupt_lock_release( &lock, &lock_context );
+ T_true( AreInterruptsEnabled() );
+
+ /*
+ * Check that maskable interrupts are disabled before the call to
+ * rtems_interrupt_lock_acquire() and disabled afterwards.
+ */
+ T_true( AreInterruptsEnabled() );
+ rtems_interrupt_lock_acquire( &lock, &lock_context );
+ T_false( AreInterruptsEnabled() );
+
+ /*
+ * Check that the maskable interrupt status is restored by the call to
+ * rtems_interrupt_lock_release() according to the ``_lock_context``
+ * parameter.
+ */
+ T_false( AreInterruptsEnabled() );
+ rtems_interrupt_lock_release( &lock, &lock_context );
+ T_true( AreInterruptsEnabled() );
+
+ /*
+ * Check that the maskable interrupt status is not changed by the
+ * rtems_interrupt_lock_destroy() call.
+ */
+ T_true( AreInterruptsEnabled() );
+ rtems_interrupt_lock_destroy( &lock );
+ T_true( AreInterruptsEnabled() );
+}
+
+/**
* @fn void T_case_body_RtemsIntrValIntrSmpOnly( void )
*/
T_TEST_CASE( RtemsIntrValIntrSmpOnly )
{
RtemsIntrValIntrSmpOnly_Action_0();
+ RtemsIntrValIntrSmpOnly_Action_1();
}
/** @} */