|
Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
#include <zephyr/ztest.h>#include <zephyr/arch/cpu.h>#include <cmsis_core.h>#include <zephyr/sys/barrier.h>#include <zephyr/internal/syscall_handler.h>#include "test_syscalls.h"#include <zephyr/syscalls/test_arm_user_interrupt_syscall_mrsh.c>Macros | |
| #define | MAIN_PRIORITY 7 |
| #define | PRIORITY 5 |
Functions | |
| static | K_THREAD_STACK_DEFINE (esf_collection_stack, 2048) |
| static int | check_esf_matches_expectations (const struct arch_esf *pEsf) |
| Validates that pEsf matches state from set_regs_with_known_pattern() | |
| void | k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *pEsf) |
| Fatal error policy handler. | |
| void | set_regs_with_known_pattern (void *p1, void *p2, void *p3) |
| Set ARM registers with a known pattern: r0-r12 are set to 0...12, respectively r13 (sp) is left untouched r14 (pc) will point to the faulting instruction (udf #90) r15 (lr) is set to 15 (since a fault takes place, we never use the value) | |
| void | test_arm_esf_collection (void) |
| Test to verify code fault handling in ISR execution context. | |
| void | arm_isr_handler (const void *args) |
| void | test_arm_interrupt (void) |
| Test ARM Interrupt handling. | |
| void | test_arm_user_interrupt (void) |
| Test ARM Interrupt handling in user mode. | |
| void | test_arm_null_pointer_exception (void) |
| Test ARM Null Pointer Exception handling. | |
Variables | |
| static volatile int | test_flag |
| static volatile int | expected_reason = -1 |
| static volatile int | run_esf_validation |
| static volatile int | esf_validation_rv |
| static volatile uint32_t | expected_msp |
| static struct k_thread | esf_collection_thread |
| #define MAIN_PRIORITY 7 |
| #define PRIORITY 5 |
| void arm_isr_handler | ( | const void * | args | ) |
|
static |
Validates that pEsf matches state from set_regs_with_known_pattern()
|
static |
| void set_regs_with_known_pattern | ( | void * | p1, |
| void * | p2, | ||
| void * | p3 ) |
Set ARM registers with a known pattern: r0-r12 are set to 0...12, respectively r13 (sp) is left untouched r14 (pc) will point to the faulting instruction (udf #90) r15 (lr) is set to 15 (since a fault takes place, we never use the value)
Note: Routine was written to be ARMV6M compatible
In k_sys_fatal_error_handler above we will check that the ESF provided as a parameter matches these expectations.
| void test_arm_interrupt | ( | void | ) |
Test ARM Interrupt handling.
| void test_arm_user_interrupt | ( | void | ) |
Test ARM Interrupt handling in user mode.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |