Skip to content

Commit 9a96a78

Browse files
tests/kernel/fifo/fifo_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 d04b192 commit 9a96a78

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/kernel/fifo/fifo_api/src/test_fifo_cancel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ K_FIFO_DEFINE(kfifo_c);
1313

1414
struct k_fifo fifo_c;
1515

16-
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
16+
static K_THREAD_STACK_DEFINE(tstack_cancel, STACK_SIZE);
1717
static struct k_thread thread;
1818

1919
static void t_cancel_wait_entry(void *p1, void *p2, void *p3)
@@ -24,7 +24,7 @@ static void t_cancel_wait_entry(void *p1, void *p2, void *p3)
2424

2525
static void tfifo_thread_thread(struct k_fifo *pfifo)
2626
{
27-
k_tid_t tid = k_thread_create(&thread, tstack, STACK_SIZE,
27+
k_tid_t tid = k_thread_create(&thread, tstack_cancel, STACK_SIZE,
2828
t_cancel_wait_entry, pfifo, NULL, NULL,
2929
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
3030
uint32_t start_t = k_uptime_get_32();

tests/kernel/fifo/fifo_api/src/test_fifo_contexts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static fdata_t data[LIST_LEN];
1616
static fdata_t data_l[LIST_LEN];
1717
static fdata_t data_sl[LIST_LEN];
1818

19-
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
19+
static K_THREAD_STACK_DEFINE(tstack_contexts, STACK_SIZE);
2020
static struct k_thread tdata;
2121
static struct k_sem end_sema;
2222

@@ -88,7 +88,7 @@ static void tfifo_thread_thread(struct k_fifo *pfifo)
8888
{
8989
k_sem_init(&end_sema, 0, 1);
9090
/**TESTPOINT: thread-thread data passing via fifo*/
91-
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
91+
k_tid_t tid = k_thread_create(&tdata, tstack_contexts, STACK_SIZE,
9292
tThread_entry, pfifo, NULL, NULL,
9393
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
9494
tfifo_put(pfifo);

tests/kernel/fifo/fifo_api/src/test_fifo_loop.c

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

1313
static fdata_t data[LIST_LEN];
1414
static struct k_fifo fifo;
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 tfifo_read_write(struct k_fifo *pfifo)
6060
{
6161
k_sem_init(&end_sema, 0, 1);
6262
/**TESTPOINT: thread-isr-thread data passing via fifo*/
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, pfifo, NULL, NULL,
6565
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
6666

0 commit comments

Comments
 (0)