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 <[email protected]>
  • Loading branch information
alpsayin committed Feb 20, 2023
1 parent 98d06a3 commit 6f89a31
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
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 @@ -84,7 +84,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 @@ -442,6 +443,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
2 changes: 1 addition & 1 deletion tests/kernel/mem_protect/stackprot/testcase.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests:
kernel.memory_protection.stackprot:
arch_exclude: nios2 xtensa posix sparc
arch_exclude: nios2 xtensa posix sparc microblaze
tags: kernel userspace
ignore_faults: true
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 6f89a31

Please sign in to comment.