#include <tests/kernel/smp/src/main.c>
Test interprocessor interrupt.
Test Objective:
- To verify architecture layer provides a mechanism to issue an interprocessor interrupt to all other CPUs in the system that calls the scheduler IPI. We simply add a hook in z_sched_ipi(), in order to check if it has been called once in another CPU except the caller, when arch_sched_ipi() is called.
Testing techniques:
- Interface testing, function and block box testing, dynamic analysis and testing
Prerequisite Conditions:
- CONFIG_SMP=y, and the HW platform must support SMP.
- CONFIG_TRACE_SCHED_IPI=y was set.
Input Specifications:
Test Procedure:
- In main thread, given a global variable sched_ipi_has_called equaled zero.
- Call arch_sched_ipi() then sleep for 100ms.
- In z_sched_ipi() handler, increment the sched_ipi_has_called.
- In main thread, check the sched_ipi_has_called is not equaled to zero.
- Repeat step 1 to 4 for 3 times.
Expected Test Result:
- The pointer of current cpu data that we got from function call is correct.
Pass/Fail Criteria:
- Successful if the check of step 4 are all passed.
- Failure if one of the check of step 4 is failed.
Assumptions and Constraints:
- This test using for the platform that support SMP, in our current scenario , only x86_64 and arc supported.
- See also
- arch_sched_ipi()
TESTPOINT: check if enter our IPI interrupt handler