Skip to content

Commit 064987f

Browse files
tests/kernel/lifo/lifo_api: Don't reuse name for different thread stacks
A limitation on current HW shadow stack implementation for x86 is that more than one thread stack can't share the same variable name, even if they are static. To avoid skipping useful tests, for now, while this limitation holds, change the name of the stack variable. Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
1 parent 9a96a78 commit 064987f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/kernel/lifo/lifo_api/src/test_lifo_contexts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ K_LIFO_DEFINE(klifo);
1414
struct k_lifo lifo;
1515
static ldata_t data[LIST_LEN];
1616

17-
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
17+
static K_THREAD_STACK_DEFINE(tstack_contexts, STACK_SIZE);
1818
static struct k_thread tdata;
1919
static struct k_sem end_sema;
2020

@@ -59,7 +59,7 @@ static void tlifo_thread_thread(struct k_lifo *plifo)
5959
{
6060
k_sem_init(&end_sema, 0, 1);
6161
/**TESTPOINT: thread-thread data passing via lifo*/
62-
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
62+
k_tid_t tid = k_thread_create(&tdata, tstack_contexts, STACK_SIZE,
6363
tThread_entry, plifo, NULL, NULL,
6464
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
6565
tlifo_put(plifo);

tests/kernel/lifo/lifo_api/src/test_lifo_loop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
static ldata_t data[LIST_LEN];
1414
static struct k_lifo lifo;
15-
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
15+
static K_THREAD_STACK_DEFINE(tstack_loop, STACK_SIZE);
1616
static struct k_thread tdata;
1717
static struct k_sem end_sema;
1818

@@ -60,7 +60,7 @@ static void tlifo_read_write(struct k_lifo *plifo)
6060
{
6161
k_sem_init(&end_sema, 0, 1);
6262
/**TESTPOINT: thread-isr-thread data passing via lifo*/
63-
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
63+
k_tid_t tid = k_thread_create(&tdata, tstack_loop, STACK_SIZE,
6464
tThread_entry, plifo, NULL, NULL,
6565
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
6666

0 commit comments

Comments
 (0)