Skip to content

Commit

Permalink
tests: microblaze: test specific configuration additions for MicroBlaze
Browse files Browse the repository at this point in the history
Internal references: FWRIVERHD-5201

Signed-off-by: Alp Sayin <alpsayin@gmail.com>
  • Loading branch information
alpsayin committed Jun 23, 2023
1 parent a13badd commit af41347
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ extern "C" {
#define PROCESSOR_NAME "riscv"
#elif defined(CONFIG_XTENSA)
#define PROCESSOR_NAME "xtensa"
#elif defined(CONFIG_MICROBLAZE)
#define PROCESSOR_NAME "microblaze"
#endif

#ifndef PROCESSOR_NAME
Expand Down
6 changes: 4 additions & 2 deletions tests/kernel/context/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,19 @@
* unless TICK_IRQ is defined here for them
*/
#endif /* defined(CONFIG_ARCH_POSIX) */
#elif defined(CONFIG_MICROBLAZE) && defined(CONFIG_XLNX_TMRCTR)
#define TICK_IRQ DT_IRQN(DT_INST(CONFIG_XLNX_TMRCTR_TIMER_INDEX, xlnx_tmrctr))
#else

extern const int32_t z_sys_timer_irq_for_test;
#define TICK_IRQ (z_sys_timer_irq_for_test)

#endif

/* Cortex-M1, Nios II, and RISCV without CONFIG_RISCV_HAS_CPU_IDLE
/* Cortex-M1, Nios II, MicroBlaze, and RISCV without CONFIG_RISCV_HAS_CPU_IDLE
* do have a power saving instruction, so k_cpu_idle() returns immediately
*/
#if !defined(CONFIG_CPU_CORTEX_M1) && !defined(CONFIG_NIOS2) && \
#if !defined(CONFIG_CPU_CORTEX_M1) && !defined(CONFIG_NIOS2) && !defined(CONFIG_MICROBLAZE) && \
(!defined(CONFIG_RISCV) || defined(CONFIG_RISCV_HAS_CPU_IDLE))
#define HAS_POWERSAVE_INSTRUCTION
#endif
Expand Down
8 changes: 7 additions & 1 deletion tests/kernel/fatal/exception/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ void entry_cpu_exception(void *p1, void *p2, void *p3)
__asm__ volatile (".word 0x77777777");
#else
/* Triggers usage fault on ARM, illegal instruction on
* xtensa, TLB exception (instruction fetch) on MIPS.
* xtensa, TLB exception (instruction fetch) on MIPS,
* illegal op-code instruction on microblaze
*/
{
volatile long illegal = 0;
Expand Down Expand Up @@ -445,6 +446,11 @@ ZTEST(fatal_exception, test_fatal)

static void *fatal_setup(void)
{

#if defined(CONFIG_MICROBLAZE)
microblaze_enable_exceptions();
#endif

#if defined(CONFIG_DEMAND_PAGING) && \
!defined(CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT)
uintptr_t pin_addr;
Expand Down
2 changes: 2 additions & 0 deletions tests/kernel/interrupt/src/interrupt_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ void isr_handler(const void *param)
#elif defined(CONFIG_ARCH_POSIX)
#define TEST_IRQ_DYN_LINE 5

#elif defined(CONFIG_MICROBLAZE)
#define TEST_IRQ_DYN_LINE 1
#else
#define TEST_IRQ_DYN_LINE 0
#endif
Expand Down
1 change: 1 addition & 0 deletions tests/kernel/mem_protect/stackprot/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tests:
- xtensa
- posix
- sparc
- microblaze
tags:
- kernel
- userspace
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/cpp/libcxx/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ZTEST(libcxx_tests, test_make_unique)
zassert_equal(make_unique_data::dtors, 1, "dtor count not incremented");
}

#if defined(CONFIG_CPP_EXCEPTIONS) && !defined(CONFIG_BOARD_M2GL025_MIV)
#if defined(CONFIG_CPP_EXCEPTIONS) && !defined(CONFIG_BOARD_M2GL025_MIV) && !defined(CONFIG_MICROBLAZE)
static void throw_exception(void)
{
throw 42;
Expand Down

0 comments on commit af41347

Please sign in to comment.