-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llext: add movt/movw relocation test
Arch arm relocatate test covers: R_ARM_ABS32: all tests decode_thm_jumps -> relative jmp extension decode_thm_movs -> movwmovt extension Signed-off-by: Cedric Lescop <cedric.lescop@se.com>
- Loading branch information
Showing
2 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2024 Schneider Electric. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* | ||
* This test is designed to test MOV.W and MOV.T instructions on ARM architectures. | ||
* (except M0 & M0+, not supported) | ||
*/ | ||
|
||
#include <stdint.h> | ||
#include <zephyr/llext/symbol.h> | ||
#include <zephyr/sys/printk.h> | ||
|
||
|
||
static void test_func(void) | ||
{ | ||
printk("%s\n", __func__); | ||
} | ||
|
||
void test_entry(void) | ||
{ | ||
test_func(); | ||
|
||
printk("test movwmovt\n"); | ||
__asm volatile ("movw r0, #:lower16:test_func"); | ||
__asm volatile ("movt r0, #:upper16:test_func"); | ||
__asm volatile ("blx r0"); | ||
} | ||
LL_EXTENSION_SYMBOL(test_entry); |