tests: use K_THREAD_STACK_DEFINE macros

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-06-02 14:08:22 -07:00 committed by Anas Nashif
parent dc5d935d12
commit 15ed8ec7ea
59 changed files with 104 additions and 92 deletions

View file

@ -27,8 +27,8 @@
#endif
/* stack used by the fibers */
static char __stack thread_one_stack[STACKSIZE];
static char __stack thread_two_stack[STACKSIZE];
static K_THREAD_STACK_DEFINE(thread_one_stack, STACKSIZE);
static K_THREAD_STACK_DEFINE(thread_two_stack, STACKSIZE);
static struct k_thread thread_one_data;
static struct k_thread thread_two_data;

View file

@ -29,7 +29,7 @@ static u32_t helper_thread_iterations;
#define Y_STACK_SIZE 512
#define Y_PRIORITY 10
char __noinit __stack y_stack_area[Y_STACK_SIZE];
K_THREAD_STACK_DEFINE(y_stack_area, Y_STACK_SIZE);
static struct k_thread y_thread;
/**

View file

@ -30,7 +30,7 @@ typedef void * (*pfunc) (void *);
/* stack used by thread */
#ifdef CONFIG_OBJECTS_THREAD
static char __stack pStack[THREAD_STACK_SIZE];
static K_THREAD_STACK_DEFINE(pStack, THREAD_STACK_SIZE);
static struct k_thread objects_thread;
#endif

View file

@ -13,8 +13,8 @@
#include <string.h>
char __stack thread_stack1[STACK_SIZE];
char __stack thread_stack2[STACK_SIZE];
K_THREAD_STACK_DEFINE(thread_stack1, STACK_SIZE);
K_THREAD_STACK_DEFINE(thread_stack2, STACK_SIZE);
struct k_thread thread_data1;
struct k_thread thread_data2;

View file

@ -71,8 +71,8 @@ k_tid_t thread_mbox_async_put_receive_tid;
/* To time thread creation*/
#define STACK_SIZE 500
extern char __noinit __stack my_stack_area[STACK_SIZE];
extern char __noinit __stack my_stack_area_0[STACK_SIZE];
extern char my_stack_area[];
extern char my_stack_area_0[];
extern struct k_thread my_thread;
extern struct k_thread my_thread_0;

View file

@ -18,8 +18,8 @@ K_SEM_DEFINE(sem_bench_1, 0, 1);
/* To time thread creation*/
#define STACK_SIZE 500
extern char __noinit __stack my_stack_area[STACK_SIZE];
extern char __noinit __stack my_stack_area_0[STACK_SIZE];
extern char my_stack_area[];
extern char my_stack_area_0[];
extern struct k_thread my_thread;
extern struct k_thread my_thread_0;

View file

@ -44,8 +44,8 @@ k_tid_t consumer_tid;
/* To time thread creation*/
#define STACK_SIZE 500
char __noinit __stack my_stack_area[STACK_SIZE];
char __noinit __stack my_stack_area_0[STACK_SIZE];
K_THREAD_STACK_DEFINE(my_stack_area, STACK_SIZE);
K_THREAD_STACK_DEFINE(my_stack_area_0, STACK_SIZE);
struct k_thread my_thread;
struct k_thread my_thread_0;

View file

@ -14,8 +14,8 @@ K_SEM_DEFINE(yield_sem, 0, 1);
/* To time thread creation*/
#define STACK_SIZE 500
extern char __noinit __stack my_stack_area[STACK_SIZE];
extern char __noinit __stack my_stack_area_0[STACK_SIZE];
extern char my_stack_area[];
extern char my_stack_area_0[];
extern struct k_thread my_thread;
extern struct k_thread my_thread_0;

View file

@ -19,7 +19,7 @@
#include "bttester.h"
#define STACKSIZE 2048
static char __stack stack[STACKSIZE];
static K_THREAD_STACK_DEFINE(stack, STACKSIZE);
static struct k_thread cmd_thread;
#define CMD_QUEUED 2

View file

@ -24,7 +24,7 @@ static int alert_handler1(struct k_alert *);
K_ALERT_DEFINE(kalert_pending, alert_handler1, PENDING_MAX);
K_ALERT_DEFINE(kalert_consumed, alert_handler0, PENDING_MAX);
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_alert *palert;
static volatile int handler_executed;

View file

@ -33,7 +33,7 @@ static void thread(void *p1, void *p2, void *p3)
#define STACKSIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
static __noinit __stack char stacks[NUM_TIMEOUTS][STACKSIZE];
static K_THREAD_STACK_ARRAY_DEFINE(stacks, NUM_TIMEOUTS, STACKSIZE);
static struct k_thread threads[NUM_TIMEOUTS];
void timeout_order_test(void)

View file

@ -105,8 +105,8 @@ struct k_fifo timeout_order_fifo;
static int thread_detected_error;
static int thread_evidence;
static char __stack thread_stack1[THREAD_STACKSIZE];
static char __stack thread_stack2[THREAD_STACKSIZE];
static K_THREAD_STACK_DEFINE(thread_stack1, THREAD_STACKSIZE);
static K_THREAD_STACK_DEFINE(thread_stack2, THREAD_STACKSIZE);
static struct k_thread thread_data1;
static struct k_thread thread_data2;
@ -646,7 +646,8 @@ struct timeout_order timeouts[] = {
};
#define NUM_TIMEOUT_THREADS ARRAY_SIZE(timeouts)
static char __stack timeout_stacks[NUM_TIMEOUT_THREADS][THREAD_STACKSIZE];
static K_THREAD_STACK_ARRAY_DEFINE(timeout_stacks, NUM_TIMEOUT_THREADS,
THREAD_STACKSIZE);
static struct k_thread timeout_threads[NUM_TIMEOUT_THREADS];
/* a thread busy waits, then reports through a fifo */

View file

@ -22,11 +22,12 @@ static u32_t criticalVar;
static u32_t altTaskIterations;
static struct k_work_q offload_work_q;
static char __stack offload_work_q_stack[CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE];
static K_THREAD_STACK_DEFINE(offload_work_q_stack,
CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE);
#define STACK_SIZE 1024
static char __stack stack1[STACK_SIZE];
static char __stack stack2[STACK_SIZE];
static K_THREAD_STACK_DEFINE(stack1, STACK_SIZE);
static K_THREAD_STACK_DEFINE(stack2, STACK_SIZE);
static struct k_thread thread1;
static struct k_thread thread2;
@ -161,7 +162,7 @@ static void init_objects(void)
altTaskIterations = 0;
k_work_q_start(&offload_work_q,
offload_work_q_stack,
sizeof(offload_work_q_stack),
K_THREAD_STACK_SIZEOF(offload_work_q_stack),
CONFIG_OFFLOAD_WORKQUEUE_PRIORITY);
}

View file

@ -11,7 +11,7 @@
#define N_THREADS 2
#define STACK_SIZE 384
static __stack char stacks[N_THREADS][STACK_SIZE];
static K_THREAD_STACK_ARRAY_DEFINE(stacks, N_THREADS, STACK_SIZE);
static struct k_thread threads[N_THREADS];
static int errno_values[N_THREADS + 1] = {

View file

@ -13,7 +13,7 @@
#define MAIN_PRIORITY 7
#define PRIORITY 5
static char __noinit __stack alt_stack[STACKSIZE];
static K_THREAD_STACK_DEFINE(alt_stack, STACKSIZE);
#ifdef CONFIG_STACK_SENTINEL
#define OVERFLOW_STACKSIZE 1024
@ -130,7 +130,8 @@ void main(void)
k_thread_priority_set(_current, K_PRIO_PREEMPT(MAIN_PRIORITY));
TC_PRINT("test alt thread 1: generic CPU exception\n");
k_thread_create(&alt_thread, alt_stack, sizeof(alt_stack),
k_thread_create(&alt_thread, alt_stack,
K_THREAD_STACK_SIZEOF(alt_stack),
(k_thread_entry_t)alt_thread1,
NULL, NULL, NULL, K_PRIO_COOP(PRIORITY), 0,
K_NO_WAIT);
@ -142,7 +143,8 @@ void main(void)
}
TC_PRINT("test alt thread 2: initiate kernel oops\n");
k_thread_create(&alt_thread, alt_stack, sizeof(alt_stack),
k_thread_create(&alt_thread, alt_stack,
K_THREAD_STACK_SIZEOF(alt_stack),
(k_thread_entry_t)alt_thread2,
NULL, NULL, NULL, K_PRIO_COOP(PRIORITY), 0,
K_NO_WAIT);
@ -186,7 +188,8 @@ void main(void)
*/
k_thread_create(&alt_thread, overflow_stack, OVERFLOW_STACKSIZE,
#else
k_thread_create(&alt_thread, alt_stack, sizeof(alt_stack),
k_thread_create(&alt_thread, alt_stack,
K_THREAD_STACK_SIZEOF(alt_stack),
#endif
(k_thread_entry_t)stack_thread1,
NULL, NULL, NULL, K_PRIO_PREEMPT(PRIORITY), 0,
@ -207,7 +210,8 @@ void main(void)
#ifdef CONFIG_STACK_SENTINEL
k_thread_create(&alt_thread, overflow_stack, OVERFLOW_STACKSIZE,
#else
k_thread_create(&alt_thread, alt_stack, sizeof(alt_stack),
k_thread_create(&alt_thread, alt_stack,
K_THREAD_STACK_SIZEOF(alt_stack),
#endif
(k_thread_entry_t)stack_thread2,
NULL, NULL, NULL, K_PRIO_PREEMPT(PRIORITY), 0,

View file

@ -13,7 +13,7 @@ K_FIFO_DEFINE(kfifo_c);
struct k_fifo fifo_c;
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread thread;
static void t_cancel_wait_entry(void *p1, void *p2, void *p3)

View file

@ -28,7 +28,7 @@ static fdata_t data[LIST_LEN];
static fdata_t data_l[LIST_LEN];
static fdata_t data_sl[LIST_LEN];
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_sem end_sema;

View file

@ -34,7 +34,7 @@
static fdata_t data[LIST_LEN];
static struct k_fifo fifo;
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_sem end_sema;

View file

@ -50,7 +50,7 @@ DEVICE_INIT(ipm_console_send0, "ipm_send0", ipm_console_sender_init,
#define RING_BUF_SIZE32 8
static u32_t ring_buf_data[RING_BUF_SIZE32];
static char __stack thread_stack[IPM_CONSOLE_STACK_SIZE];
static K_THREAD_STACK_DEFINE(thread_stack, IPM_CONSOLE_STACK_SIZE);
static char line_buf[LINE_BUF_SIZE];
/* Dump incoming messages to printk() */

View file

@ -27,7 +27,7 @@ K_LIFO_DEFINE(klifo);
struct k_lifo lifo;
static ldata_t data[LIST_LEN];
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_sem end_sema;

View file

@ -34,7 +34,7 @@
static ldata_t data[LIST_LEN];
static struct k_lifo lifo;
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_sem end_sema;

View file

@ -36,7 +36,7 @@ static struct k_mbox mbox;
static k_tid_t sender_tid, receiver_tid;
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_sem end_sema, sync_sema;

View file

@ -42,7 +42,7 @@
#define THREAD_NUM 3
K_MEM_POOL_DEFINE(mpool1, BLK_SIZE_MIN, BLK_SIZE_MAX, BLK_NUM_MAX, BLK_ALIGN);
static char __noinit __stack tstack[THREAD_NUM][STACK_SIZE];
static K_THREAD_STACK_ARRAY_DEFINE(tstack, THREAD_NUM, STACK_SIZE);
static struct k_thread tdata[THREAD_NUM];
static struct k_sem sync_sema;
static struct k_mem_block block_ok;

View file

@ -46,7 +46,7 @@
K_MEM_POOL_DEFINE(mpool1, BLK_SIZE_MIN, BLK_SIZE_MAX, BLK_NUM_MAX, BLK_ALIGN);
K_MEM_POOL_DEFINE(mpool2, BLK_SIZE_MIN, BLK_SIZE_MAX, BLK_NUM_MAX, BLK_ALIGN);
static char __noinit __stack tstack[THREAD_NUM][STACK_SIZE];
static K_THREAD_STACK_ARRAY_DEFINE(tstack, THREAD_NUM, STACK_SIZE);
static struct k_thread tdata[THREAD_NUM];
static struct k_mem_pool *pools[POOL_NUM] = {&mpool1, &mpool2};
static struct k_sem sync_sema;

View file

@ -34,7 +34,7 @@
K_MEM_SLAB_DEFINE(mslab1, BLK_SIZE, BLK_NUM, BLK_ALIGN);
static char __noinit __stack tstack[THREAD_NUM][STACK_SIZE];
static K_THREAD_STACK_ARRAY_DEFINE(tstack, THREAD_NUM, STACK_SIZE);
static struct k_thread tdata[THREAD_NUM];
static struct k_sem sync_sema;
static void *block_ok;

View file

@ -26,7 +26,7 @@
K_MEM_SLAB_DEFINE(mslab1, BLK_SIZE1, BLK_NUM, BLK_ALIGN);
static struct k_mem_slab mslab2, *slabs[SLAB_NUM] = {&mslab1, &mslab2};
static char __noinit __stack tstack[THREAD_NUM][STACK_SIZE];
static K_THREAD_STACK_ARRAY_DEFINE(tstack, THREAD_NUM, STACK_SIZE);
static struct k_thread tdata[THREAD_NUM];
static char __aligned(BLK_ALIGN) tslab[BLK_SIZE2 * BLK_NUM];
static struct k_sem sync_sema;

View file

@ -17,7 +17,7 @@
/**TESTPOINT: init via K_MSGQ_DEFINE*/
K_MSGQ_DEFINE(kmsgq, MSG_SIZE, MSGQ_LEN, 4);
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static char __aligned(4) tbuffer[MSG_SIZE * MSGQ_LEN];
static u32_t data[MSGQ_LEN] = { MSG0, MSG1 };

View file

@ -15,7 +15,7 @@
#include "test_msgq.h"
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static char __aligned(4) tbuffer[MSG_SIZE * MSGQ_LEN];
static u32_t data[MSGQ_LEN] = { MSG0, MSG1 };

View file

@ -226,7 +226,7 @@ void Task11(void)
k_mutex_unlock(&Mutex3);
}
char __noinit __stack task12_stack_area[STACKSIZE];
K_THREAD_STACK_DEFINE(task12_stack_area, STACKSIZE);
struct k_thread task12_thread_data;
extern void Task12(void);

View file

@ -26,7 +26,7 @@
K_MUTEX_DEFINE(kmutex);
static struct k_mutex mutex;
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static void tThread_entry_lock_forever(void *p1, void *p2, void *p3)

View file

@ -14,9 +14,9 @@
extern void phil_entry(void);
extern void object_monitor(void);
char __stack phil_stack[N_PHILOSOPHERS][STSIZE];
K_THREAD_STACK_ARRAY_DEFINE(phil_stack, N_PHILOSOPHERS, STSIZE);
static struct k_thread phil_data[N_PHILOSOPHERS];
char __stack mon_stack[STSIZE];
K_THREAD_STACK_DEFINE(mon_stack, STSIZE);
static struct k_thread mon_data;
struct k_sem forks[N_PHILOSOPHERS];

View file

@ -30,7 +30,8 @@
#define NON_NULL_PTR ((void *)0x12345678)
static struct k_work_q offload_work_q;
static char __stack offload_work_q_stack[CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE];
static K_THREAD_STACK_DEFINE(offload_work_q_stack,
CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE);
struct fifo_data {
u32_t reserved;
@ -47,7 +48,7 @@ struct offload_work {
struct k_sem *sem;
};
static char __stack coop_stack[2][COOP_STACKSIZE];
static K_THREAD_STACK_ARRAY_DEFINE(coop_stack, 2, COOP_STACKSIZE);
static struct k_thread coop_thread[2];
static struct k_fifo fifo;
@ -243,7 +244,7 @@ void task_high(void)
k_work_q_start(&offload_work_q,
offload_work_q_stack,
sizeof(offload_work_q_stack),
K_THREAD_STACK_SIZEOF(offload_work_q_stack),
CONFIG_OFFLOAD_WORKQUEUE_PRIORITY);
counter = SEM_TEST_START;

View file

@ -29,7 +29,7 @@ static unsigned char __aligned(4) data[] = "abcd1234$%^&PIPE";
K_PIPE_DEFINE(kpipe, PIPE_LEN, 4);
static struct k_pipe pipe;
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_sem end_sema;

View file

@ -96,7 +96,7 @@ static struct k_poll_signal wait_signal = K_POLL_SIGNAL_INITIALIZER();
struct fifo_msg wait_msg = { NULL, FIFO_MSG_VALUE };
static struct k_thread poll_wait_helper_thread;
static __stack __noinit char poll_wait_helper_stack[KB(1)];
static K_THREAD_STACK_DEFINE(poll_wait_helper_stack, KB(1));
#define TAG_0 10
#define TAG_1 11
@ -145,8 +145,9 @@ void test_poll_wait(void)
k_thread_priority_set(k_current_get(), main_low_prio);
k_thread_create(&poll_wait_helper_thread, poll_wait_helper_stack,
sizeof(poll_wait_helper_stack), poll_wait_helper,
(void *)1, 0, 0, main_low_prio - 1, 0, 0);
K_THREAD_STACK_SIZEOF(poll_wait_helper_stack),
poll_wait_helper, (void *)1, 0, 0,
main_low_prio - 1, 0, 0);
rc = k_poll(wait_events, ARRAY_SIZE(wait_events), K_SECONDS(1));
@ -196,7 +197,8 @@ void test_poll_wait(void)
k_thread_priority_set(k_current_get(), main_low_prio);
k_thread_create(&poll_wait_helper_thread, poll_wait_helper_stack,
sizeof(poll_wait_helper_stack), poll_wait_helper,
K_THREAD_STACK_SIZEOF(poll_wait_helper_stack),
poll_wait_helper,
0, 0, 0, main_low_prio - 1, 0, 0);
rc = k_poll(wait_events, ARRAY_SIZE(wait_events), K_SECONDS(1));
@ -230,7 +232,8 @@ void test_poll_wait(void)
wait_signal.signaled = 0;
k_thread_create(&poll_wait_helper_thread, poll_wait_helper_stack,
sizeof(poll_wait_helper_stack), poll_wait_helper,
K_THREAD_STACK_SIZEOF(poll_wait_helper_stack),
poll_wait_helper,
(void *)1, 0, 0, old_prio + 1, 0, 0);
/* semaphore */
@ -301,7 +304,7 @@ static struct k_sem eaddrinuse_reply =
K_SEM_INITIALIZER(eaddrinuse_reply, 0, 1);
static struct k_thread eaddrinuse_hogger_thread;
static __stack __noinit char eaddrinuse_hogger_stack[KB(1)];
static K_THREAD_STACK_DEFINE(eaddrinuse_hogger_stack, KB(1));
static void eaddrinuse_hogger(void *p1, void *p2, void *p3)
{
@ -338,8 +341,8 @@ void test_poll_eaddrinuse(void)
k_thread_priority_set(k_current_get(), main_low_prio);
k_thread_create(&eaddrinuse_hogger_thread, eaddrinuse_hogger_stack,
sizeof(eaddrinuse_hogger_stack), eaddrinuse_hogger,
0, 0, 0, main_low_prio - 1, 0, 0);
K_THREAD_STACK_SIZEOF(eaddrinuse_hogger_stack),
eaddrinuse_hogger, 0, 0, 0, main_low_prio - 1, 0, 0);
rc = k_poll(events, ARRAY_SIZE(events), K_SECONDS(1));

View file

@ -29,7 +29,7 @@ static qdata_t data_p[LIST_LEN];
static qdata_t data_l[LIST_LEN];
static qdata_t data_sl[LIST_LEN];
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_sem end_sema;

View file

@ -36,7 +36,7 @@
static qdata_t data[LIST_LEN];
static qdata_t data_p[LIST_LEN];
static struct k_queue queue;
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_sem end_sema;

View file

@ -26,7 +26,7 @@
/**TESTPOINT: init via K_SEM_DEFINE*/
K_SEM_DEFINE(ksema, SEM_INITIAL, SEM_LIMIT);
static struct k_sem sema;
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
/*entry of contexts*/

View file

@ -26,7 +26,7 @@
K_STACK_DEFINE(kstack, STACK_LEN);
static struct k_stack stack;
static char __noinit __stack threadstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(threadstack, STACK_SIZE);
static struct k_thread thread_data;
static u32_t data[STACK_LEN] = { 0xABCD, 0x1234 };
static struct k_sem end_sema;

View file

@ -101,7 +101,7 @@ void alternate_thread(void)
char __noinit __stack alt_thread_stack_area[STACKSIZE];
K_THREAD_STACK_DEFINE(alt_thread_stack_area, STACKSIZE);
static struct k_thread alt_thread_data;
/**

View file

@ -30,7 +30,7 @@
#define MY_STACK_SIZE 2048
#define MY_PRIORITY 5
char __noinit __stack my_stack_area[MY_STACK_SIZE];
K_THREAD_STACK_DEFINE(my_stack_area, MY_STACK_SIZE);
static struct k_thread my_thread;
/* externs */

View file

@ -40,8 +40,8 @@ static struct k_sem test_thread_sem;
static struct k_sem helper_thread_sem;
static struct k_sem task_sem;
static char __stack test_thread_stack[THREAD_STACK];
static char __stack helper_thread_stack[THREAD_STACK];
static K_THREAD_STACK_DEFINE(test_thread_stack, THREAD_STACK);
static K_THREAD_STACK_DEFINE(helper_thread_stack, THREAD_STACK);
static k_tid_t test_thread_id;
static k_tid_t helper_thread_id;

View file

@ -15,7 +15,7 @@
#endif
/*local variables*/
static char __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static void customdata_entry(void *p1, void *p2, void *p3)

View file

@ -13,7 +13,7 @@
#include <ztest.h>
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static int execute_flag;

View file

@ -15,7 +15,7 @@
#include <ztest.h>
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static char tp1[8];

View file

@ -13,7 +13,7 @@
#include <ztest.h>
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static int last_prio;

View file

@ -54,8 +54,8 @@ K_SEM_DEFINE(start_sema, 0, 1);
K_SEM_DEFINE(end_sema, 0, 1);
/*local variables*/
static char __noinit __stack stack_coop[INIT_COOP_STACK_SIZE];
static char __noinit __stack stack_preempt[INIT_PREEMPT_STACK_SIZE];
static K_THREAD_STACK_DEFINE(stack_coop, INIT_COOP_STACK_SIZE);
static K_THREAD_STACK_DEFINE(stack_preempt, INIT_PREEMPT_STACK_SIZE);
static struct k_thread thread_coop;
static struct k_thread thread_preempt;
static u64_t t_create;

View file

@ -21,7 +21,7 @@
#define STACK_SIZE 512
/*local variables*/
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static struct k_sem end_sema;

View file

@ -14,7 +14,7 @@
#include "test_sched.h"
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_thread tdata;
static int last_prio;

View file

@ -14,7 +14,7 @@
#include "test_sched.h"
#define THREADS_NUM 3
static char __noinit __stack tstack[THREADS_NUM][STACK_SIZE];
static K_THREAD_STACK_ARRAY_DEFINE(tstack, THREADS_NUM, STACK_SIZE);
static struct thread_data tdata[THREADS_NUM];
static struct k_thread tthread[THREADS_NUM];

View file

@ -8,7 +8,7 @@
#define STACK_SIZE 512
#define NUM_THREAD 3
static char __noinit __stack tstack[NUM_THREAD][STACK_SIZE];
static K_THREAD_STACK_ARRAY_DEFINE(tstack, NUM_THREAD, STACK_SIZE);
/* slice size in millisecond*/
#define SLICE_SIZE 200
/* busy for more than one slice*/

View file

@ -19,7 +19,7 @@ https://www.zephyrproject.org/doc/subsystems/power_management.html#tickless-idle
#define STACK_SIZE 512
#define NUM_THREAD 4
static char __noinit __stack tstack[NUM_THREAD][STACK_SIZE];
static K_THREAD_STACK_ARRAY_DEFINE(tstack, NUM_THREAD, STACK_SIZE);
static struct k_thread tdata[NUM_THREAD];
/*for those not supporting tickless idle*/
#ifndef CONFIG_TICKLESS_IDLE

View file

@ -28,7 +28,7 @@ struct test_item {
struct k_delayed_work work;
};
static char __stack co_op_stack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(co_op_stack, STACK_SIZE);
static struct k_thread co_op_data;
static struct test_item tests[NUM_TEST_ITEMS];

View file

@ -31,7 +31,7 @@
#define STACK_SIZE 512
#define NUM_OF_WORK 2
static char __noinit __stack tstack[STACK_SIZE];
static K_THREAD_STACK_DEFINE(tstack, STACK_SIZE);
static struct k_work_q workq;
static struct k_work work[NUM_OF_WORK];
static struct k_delayed_work delayed_work[NUM_OF_WORK], delayed_work_sleepy;

View file

@ -167,9 +167,10 @@ static void test_3_thread(void *arg1, void *arg2, void *arg3)
k_sem_give(sema);
}
static K_THREAD_STACK_DEFINE(test_3_thread_stack, 1024);
static void net_buf_test_3(void)
{
static char __stack test_3_thread_stack[1024];
static struct k_thread test_3_thread_data;
struct net_buf *frag, *head;
struct k_fifo fifo;
@ -190,7 +191,7 @@ static void net_buf_test_3(void)
k_sem_init(&sema, 0, UINT_MAX);
k_thread_create(&test_3_thread_data, test_3_thread_stack,
sizeof(test_3_thread_stack),
K_THREAD_STACK_SIZEOF(test_3_thread_stack),
(k_thread_entry_t) test_3_thread, &fifo, &sema, NULL,
K_PRIO_COOP(7), 0, 0);

View file

@ -904,7 +904,7 @@ static bool net_ctx_recv_v4_reconfig(void)
}
#define STACKSIZE 1024
char __noinit __stack thread_stack[STACKSIZE];
K_THREAD_STACK_DEFINE(thread_stack, STACKSIZE);
static struct k_thread thread_data;
static void recv_cb_timeout(struct net_context *context,

View file

@ -21,7 +21,7 @@
static u32_t event2throw;
static u32_t throw_times;
static int throw_sleep;
static char __noinit __stack thrower_stack[512];
static K_THREAD_STACK_DEFINE(thrower_stack, 512);
static struct k_thread thrower_thread_data;
static struct k_sem thrower_lock;
@ -207,7 +207,7 @@ static void initialize_event_tests(void)
net_mgmt_init_event_callback(&rx_cb, receiver_cb, TEST_MGMT_EVENT);
k_thread_create(&thrower_thread_data, thrower_stack,
sizeof(thrower_stack),
K_THREAD_STACK_SIZEOF(thrower_stack),
(k_thread_entry_t)thrower_thread,
NULL, NULL, NULL, K_PRIO_COOP(7), 0, 0);
}

View file

@ -7,7 +7,7 @@
#include "soc_watch_logger.h"
#define STSIZE 512
static char __stack __noinit soc_watch_event_logger_stack[STSIZE];
static K_THREAD_STACK_DEFINE(soc_watch_event_logger_stack, STSIZE);
static struct k_thread soc_watch_event_logger_data;
/**

View file

@ -62,7 +62,7 @@ void threadB(void *dummy1, void *dummy2, void *dummy3)
helloLoop(__func__, &threadB_sem, &threadA_sem);
}
char __noinit __stack threadB_stack_area[STACKSIZE];
K_THREAD_STACK_DEFINE(threadB_stack_area, STACKSIZE);
static struct k_thread threadB_data;
/* threadA is a static thread that is spawned automatically */

View file

@ -129,8 +129,8 @@ out:
#error "CONFIG_ZTEST_STACKSIZE must be a multiple of the stack alignment"
#endif
static struct k_thread ztest_thread;
static char __stack __noinit thread_stack[CONFIG_ZTEST_STACKSIZE +
CONFIG_TEST_EXTRA_STACKSIZE];
static K_THREAD_STACK_DEFINE(thread_stack, CONFIG_ZTEST_STACKSIZE +
CONFIG_TEST_EXTRA_STACKSIZE);
static int test_result;
static struct k_sem test_end_signal;
@ -166,9 +166,10 @@ static int run_test(struct unit_test *test)
int ret = TC_PASS;
TC_START(test->name);
k_thread_create(&ztest_thread, thread_stack, sizeof(thread_stack),
(k_thread_entry_t) test_cb, (struct unit_test *)test,
NULL, NULL, -1, 0, 0);
k_thread_create(&ztest_thread, thread_stack,
K_THREAD_STACK_SIZEOF(thread_stack),
(k_thread_entry_t) test_cb, (struct unit_test *)test,
NULL, NULL, -1, 0, 0);
/*
* There is an implicit expectation here that the thread that was