Zephyr Project API 3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
SMP Integration Tests

Functions

void k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *esf)
 Test interprocessor interrupt.
 

Detailed Description

Function Documentation

◆ k_sys_fatal_error_handler()

void k_sys_fatal_error_handler ( unsigned int  reason,
const struct arch_esf esf 
)

#include <tests/kernel/smp/src/main.c>

Test interprocessor interrupt.

Fatal error policy handler.

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_broadcast_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:

  • N/A

Test Procedure:

  1. In main thread, given a global variable sched_ipi_has_called equaled zero.
  2. Call arch_sched_broadcast_ipi() then sleep for 100ms.
  3. In z_sched_ipi() handler, increment the sched_ipi_has_called.
  4. In main thread, check the sched_ipi_has_called is not equaled to zero.
  5. 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_broadcast_ipi()