|
Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
test static IDT APIs Ensures interrupt and exception stubs are installed correctly. More...
#include <zephyr/kernel.h>#include <zephyr/ztest.h>#include <zephyr/tc_util.h>#include <zephyr/arch/x86/ia32/segmentation.h>#include <kernel_internal.h>#include "test_asm_inline_other.h"Macros | |
| #define | TEST_SOFT_INT 60 |
| #define | TEST_SPUR_INT 61 |
| #define | MY_STACK_SIZE 2048 |
| #define | MY_PRIORITY 5 |
Functions | |
| K_THREAD_STACK_DEFINE (my_stack_area, 2048) | |
| NANO_CPU_INT_REGISTER (int_stub, -1, -1, 60, 0) | |
| void | k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *esf) |
| Fatal error policy handler. | |
| void | isr_handler (void) |
| Handler to perform various actions from within an ISR context. | |
| void | exc_divide_error_handler (struct arch_esf *p_esf) |
| This is the handler for the divide by zero exception. | |
| void | test_idt_stub (void) |
| Test the position of interrupt stubs in IDT. | |
| void | idt_spur_task (void *arg1, void *arg2, void *arg3) |
| void | test_static_idt (void) |
| Test entry point to static IDT. | |
| ZTEST_SUITE (static_idt, NULL, NULL, NULL, NULL, NULL) | |
Variables | |
| static struct k_thread | my_thread |
| void * | int_stub |
| static volatile int | exc_handler_executed |
| static volatile int | int_handler_executed |
| static volatile int | spur_handler_aborted_thread = 1 |
test static IDT APIs Ensures interrupt and exception stubs are installed correctly.
| #define MY_PRIORITY 5 |
| #define MY_STACK_SIZE 2048 |
| #define TEST_SOFT_INT 60 |
| #define TEST_SPUR_INT 61 |
| void exc_divide_error_handler | ( | struct arch_esf * | p_esf | ) |
This is the handler for the divide by zero exception.
The source of this divide-by-zero error comes from the following line in main() ... error = error / exc_handler_executed; Where exc_handler_executed is zero. The disassembled code for it looks something like .... f7 fb idiv ecx This handler is part of a test that is only interested in detecting the error so that we know the exception connect code is working. Therefore, a very quick and dirty approach is taken for dealing with the exception; we skip the offending instruction by adding 2 to the EIP. (If nothing is done, then control goes back to the offending instruction and an infinite loop of divide-by-zero errors would be created.)
| void idt_spur_task | ( | void * | arg1, |
| void * | arg2, | ||
| void * | arg3 ) |
| void isr_handler | ( | void | ) |
Handler to perform various actions from within an ISR context.
This routine is the ISR handler for _trigger_isr_handler().
| K_THREAD_STACK_DEFINE | ( | my_stack_area | , |
| 2048 | ) |
| NANO_CPU_INT_REGISTER | ( | int_stub | , |
| - | 1, | ||
| - | 1, | ||
| 60 | , | ||
| 0 | ) |
|
static |
|
static |
|
extern |
|
static |
|
static |