Skip to content

Commit 15c24c4

Browse files
committed
tests: microblaze: test specific configuration additions for MicroBlaze
Internal references: FWRIVERHD-5201 Signed-off-by: Alp Sayin <[email protected]>
1 parent c916e3a commit 15c24c4

File tree

6 files changed

+17
-4
lines changed

6 files changed

+17
-4
lines changed

subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ extern "C" {
126126
#define PROCESSOR_NAME "riscv"
127127
#elif defined(CONFIG_XTENSA)
128128
#define PROCESSOR_NAME "xtensa"
129+
#elif defined(CONFIG_MICROBLAZE)
130+
#define PROCESSOR_NAME "microblaze"
129131
#endif
130132

131133
#ifndef PROCESSOR_NAME

tests/kernel/context/src/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,19 @@
6565
* unless TICK_IRQ is defined here for them
6666
*/
6767
#endif /* defined(CONFIG_ARCH_POSIX) */
68+
#elif defined(CONFIG_MICROBLAZE) && defined(CONFIG_XLNX_TMRCTR)
69+
#define TICK_IRQ DT_IRQN(DT_INST(CONFIG_XLNX_TMRCTR_TIMER_INDEX, xlnx_tmrctr))
6870
#else
6971

7072
extern const int32_t z_sys_timer_irq_for_test;
7173
#define TICK_IRQ (z_sys_timer_irq_for_test)
7274

7375
#endif
7476

75-
/* Cortex-M1, Nios II, and RISCV without CONFIG_RISCV_HAS_CPU_IDLE
77+
/* Cortex-M1, Nios II, MicroBlaze, and RISCV without CONFIG_RISCV_HAS_CPU_IDLE
7678
* do have a power saving instruction, so k_cpu_idle() returns immediately
7779
*/
78-
#if !defined(CONFIG_CPU_CORTEX_M1) && !defined(CONFIG_NIOS2) && \
80+
#if !defined(CONFIG_CPU_CORTEX_M1) && !defined(CONFIG_NIOS2) && !defined(CONFIG_MICROBLAZE) && \
7981
(!defined(CONFIG_RISCV) || defined(CONFIG_RISCV_HAS_CPU_IDLE))
8082
#define HAS_POWERSAVE_INSTRUCTION
8183
#endif

tests/kernel/fatal/exception/src/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ void entry_cpu_exception(void *p1, void *p2, void *p3)
8787
__asm__ volatile (".word 0x77777777");
8888
#else
8989
/* Triggers usage fault on ARM, illegal instruction on
90-
* xtensa, TLB exception (instruction fetch) on MIPS.
90+
* xtensa, TLB exception (instruction fetch) on MIPS,
91+
* illegal op-code instruction on microblaze
9192
*/
9293
{
9394
volatile long illegal = 0;
@@ -445,6 +446,11 @@ ZTEST(fatal_exception, test_fatal)
445446

446447
static void *fatal_setup(void)
447448
{
449+
450+
#if defined(CONFIG_MICROBLAZE)
451+
microblaze_enable_exceptions();
452+
#endif
453+
448454
#if defined(CONFIG_DEMAND_PAGING) && \
449455
!defined(CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT)
450456
uintptr_t pin_addr;

tests/kernel/interrupt/src/interrupt_offload.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ void isr_handler(const void *param)
9191
#elif defined(CONFIG_ARCH_POSIX)
9292
#define TEST_IRQ_DYN_LINE 5
9393

94+
#elif defined(CONFIG_MICROBLAZE)
95+
#define TEST_IRQ_DYN_LINE 1
9496
#else
9597
#define TEST_IRQ_DYN_LINE 0
9698
#endif

tests/kernel/mem_protect/stackprot/testcase.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ tests:
55
- xtensa
66
- posix
77
- sparc
8+
- microblaze
89
tags:
910
- kernel
1011
- userspace

tests/lib/cpp/libcxx/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ ZTEST(libcxx_tests, test_make_unique)
6767
zassert_equal(make_unique_data::dtors, 1, "dtor count not incremented");
6868
}
6969

70-
#if defined(CONFIG_CPP_EXCEPTIONS) && !defined(CONFIG_BOARD_M2GL025_MIV)
70+
#if defined(CONFIG_CPP_EXCEPTIONS) && !defined(CONFIG_BOARD_M2GL025_MIV) && !defined(CONFIG_MICROBLAZE)
7171
static void throw_exception(void)
7272
{
7373
throw 42;

0 commit comments

Comments
 (0)