Commit 567c6c76 authored by Andrew Boie's avatar Andrew Boie Committed by Anas Nashif
Browse files

misc: use K_THREAD_STACK_DEFINE macros

parent e87eacac
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ QUARK_SE_IPM_DEFINE(quark_se_ipm4, 4, QUARK_SE_IPM_INBOUND);
#define QUARK_SE_IPM_CONSOLE_LINE_BUF_SIZE	80

static u32_t ipm_console_ring_buf_data[CONFIG_QUARK_SE_IPM_CONSOLE_RING_BUF_SIZE32];
static char __stack ipm_console_thread_stack[CONFIG_IPM_CONSOLE_STACK_SIZE];
static K_STACK_DECLARE(ipm_console_thread_stack, CONFIG_IPM_CONSOLE_STACK_SIZE);
static char ipm_console_line_buf[QUARK_SE_IPM_CONSOLE_LINE_BUF_SIZE];

static struct ipm_console_receiver_config_info quark_se_ipm_receiver_config = {
+2 −2
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ struct net_stack_info {
	NET_STACK_INFO_ADDR(_pretty_name, _name, _orig, _size, _name, 0)

#define NET_STACK_DEFINE(pretty_name, name, orig, size)			\
	static char __noinit __stack name[size];			\
	K_THREAD_STACK_DEFINE(name, size);				\
	NET_STACK_INFO(pretty_name, name, orig, size)

#else /* CONFIG_NET_SHELL */
@@ -124,7 +124,7 @@ struct net_stack_info {
#define NET_STACK_INFO_ADDR(...)

#define NET_STACK_DEFINE(pretty_name, name, orig, size)			\
	static char __noinit __stack name[size]
	K_THREAD_STACK_DEFINE(name, size)

#endif /* CONFIG_NET_SHELL */

+2 −2
Original line number Diff line number Diff line
@@ -95,9 +95,9 @@ static inline __printf_like(1, 2) void _bt_log_dummy(const char *fmt, ...) {};
			}

#define BT_STACK(name, size) \
		char __stack name[(size) + BT_STACK_DEBUG_EXTRA]
		K_THREAD_STACK_MEMBER(name, (size) + BT_STACK_DEBUG_EXTRA)
#define BT_STACK_NOINIT(name, size) \
		char __noinit __stack name[(size) + BT_STACK_DEBUG_EXTRA]
		K_THREAD_STACK_DEFINE(name, (size) + BT_STACK_DEBUG_EXTRA)

/* This helper is only available when BLUETOOTH_DEBUG is enabled */
const char *bt_hex(const void *buf, size_t len);
+6 −7
Original line number Diff line number Diff line
@@ -99,9 +99,8 @@ static void prio_recv_thread(void *p1, void *p2, void *p3)

#if defined(CONFIG_INIT_STACKS)
		if (k_uptime_get_32() - prio_ts > K_SECONDS(5)) {
			stack_analyze("prio recv thread stack",
				      prio_recv_thread_stack,
				      sizeof(prio_recv_thread_stack));
			STACK_ANALYZE("prio recv thread stack",
				      prio_recv_thread_stack);
			prio_ts = k_uptime_get_32();
		}
#endif
@@ -327,8 +326,7 @@ static void recv_thread(void *p1, void *p2, void *p3)

#if defined(CONFIG_INIT_STACKS)
		if (k_uptime_get_32() - rx_ts > K_SECONDS(5)) {
			stack_analyze("recv thread stack", recv_thread_stack,
				      sizeof(recv_thread_stack));
			STACK_ANALYZE("recv thread stack", recv_thread_stack);
			rx_ts = k_uptime_get_32();
		}
#endif
@@ -403,11 +401,12 @@ static int hci_driver_open(void)
#endif

	k_thread_create(&prio_recv_thread_data, prio_recv_thread_stack,
			sizeof(prio_recv_thread_stack), prio_recv_thread,
			K_THREAD_STACK_SIZEOF(prio_recv_thread_stack),
			prio_recv_thread,
			NULL, NULL, NULL, K_PRIO_COOP(6), 0, K_NO_WAIT);

	k_thread_create(&recv_thread_data, recv_thread_stack,
			sizeof(recv_thread_stack), recv_thread,
			K_THREAD_STACK_SIZEOF(recv_thread_stack), recv_thread,
			NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);

	BT_DBG("Success.");
+5 −5
Original line number Diff line number Diff line
@@ -582,10 +582,9 @@ static void hci_disconn_complete(struct net_buf *buf)
	/* Check stacks usage (no-ops if not enabled) */
	k_call_stacks_analyze();
#if !defined(CONFIG_BLUETOOTH_RECV_IS_RX_THREAD)
	stack_analyze("rx stack", rx_thread_stack, sizeof(rx_thread_stack));
	STACK_ANALYZE("rx stack", rx_thread_stack);
#endif
	stack_analyze("tx stack", tx_thread_stack,
		      sizeof(tx_thread_stack));
	STACK_ANALYZE("tx stack", tx_thread_stack);

	bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
	conn->handle = 0;
@@ -4065,13 +4064,14 @@ int bt_enable(bt_ready_cb_t cb)

	/* TX thread */
	k_thread_create(&tx_thread_data, tx_thread_stack,
			sizeof(tx_thread_stack), hci_tx_thread, NULL, NULL,
			K_THREAD_STACK_SIZEOF(tx_thread_stack),
			hci_tx_thread, NULL, NULL,
			NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);

#if !defined(CONFIG_BLUETOOTH_RECV_IS_RX_THREAD)
	/* RX thread */
	k_thread_create(&rx_thread_data, rx_thread_stack,
			sizeof(rx_thread_stack),
			K_THREAD_STACK_SIZEOF(rx_thread_stack),
			(k_thread_entry_t)hci_rx_thread, NULL, NULL, NULL,
			K_PRIO_COOP(7), 0, K_NO_WAIT);
#endif
Loading