drivers: use K_THREAD_STACK_DEFINE macros
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
15ed8ec7ea
commit
2d4a36fc1c
27 changed files with 38 additions and 30 deletions
|
@ -440,7 +440,7 @@ static int h4_open(void)
|
|||
uart_irq_callback_set(h4_dev, bt_uart_isr);
|
||||
|
||||
k_thread_create(&rx_thread_data, rx_thread_stack,
|
||||
sizeof(rx_thread_stack), rx_thread,
|
||||
K_THREAD_STACK_SIZEOF(rx_thread_stack), rx_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -364,8 +364,8 @@ static void ack_timeout(struct k_work *work)
|
|||
h5_send(NULL, HCI_3WIRE_ACK_PKT, 0);
|
||||
|
||||
/* Analyze stacks */
|
||||
stack_analyze("tx_stack", tx_stack, sizeof(tx_stack));
|
||||
stack_analyze("rx_stack", rx_stack, sizeof(rx_stack));
|
||||
STACK_ANALYZE("tx_stack", tx_stack);
|
||||
STACK_ANALYZE("rx_stack", rx_stack);
|
||||
}
|
||||
|
||||
static void h5_process_complete_packet(u8_t *hdr)
|
||||
|
@ -717,12 +717,14 @@ static void h5_init(void)
|
|||
|
||||
/* TX thread */
|
||||
k_fifo_init(&h5.tx_queue);
|
||||
k_thread_create(&tx_thread_data, tx_stack, sizeof(tx_stack),
|
||||
k_thread_create(&tx_thread_data, tx_stack,
|
||||
K_THREAD_STACK_SIZEOF(tx_stack),
|
||||
(k_thread_entry_t)tx_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
|
||||
k_fifo_init(&h5.rx_queue);
|
||||
k_thread_create(&rx_thread_data, rx_stack, sizeof(rx_stack),
|
||||
k_thread_create(&rx_thread_data, rx_stack,
|
||||
K_THREAD_STACK_SIZEOF(rx_stack),
|
||||
(k_thread_entry_t)rx_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
|
||||
|
|
|
@ -325,7 +325,8 @@ static int bt_spi_open(void)
|
|||
}
|
||||
|
||||
/* Start RX thread */
|
||||
k_thread_create(&rx_thread_data, rx_stack, sizeof(rx_stack),
|
||||
k_thread_create(&rx_thread_data, rx_stack,
|
||||
K_THREAD_STACK_SIZEOF(rx_stack),
|
||||
(k_thread_entry_t)bt_spi_rx_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ struct line_buf_rb {
|
|||
|
||||
static struct line_buf_rb telnet_rb;
|
||||
|
||||
static char __noinit __stack telnet_stack[TELNET_STACK_SIZE];
|
||||
static K_THREAD_STACK_DEFINE(telnet_stack, TELNET_STACK_SIZE);
|
||||
static struct k_thread telnet_thread_data;
|
||||
static K_SEM_DEFINE(send_lock, 0, UINT_MAX);
|
||||
|
||||
|
|
|
@ -225,7 +225,8 @@ struct eth_enc28j60_config {
|
|||
|
||||
struct eth_enc28j60_runtime {
|
||||
struct net_if *iface;
|
||||
char __stack thread_stack[CONFIG_ETH_ENC28J60_RX_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack,
|
||||
CONFIG_ETH_ENC28J60_RX_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct device *gpio;
|
||||
struct device *spi;
|
||||
|
|
|
@ -33,7 +33,7 @@ struct gpio_sch_config {
|
|||
#define GPIO_SCH_POLLING_MSEC 200
|
||||
|
||||
struct gpio_sch_data {
|
||||
char __stack polling_stack[GPIO_SCH_POLLING_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(polling_stack, GPIO_SCH_POLLING_STACK_SIZE);
|
||||
struct k_thread polling_thread;
|
||||
sys_slist_t callbacks;
|
||||
struct k_timer poll_timer;
|
||||
|
|
|
@ -40,7 +40,8 @@ struct cc2520_context {
|
|||
struct k_sem tx_sync;
|
||||
atomic_t tx;
|
||||
/************RX************/
|
||||
char __stack cc2520_rx_stack[CONFIG_IEEE802154_CC2520_RX_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(cc2520_rx_stack,
|
||||
CONFIG_IEEE802154_CC2520_RX_STACK_SIZE);
|
||||
struct k_thread cc2520_rx_thread;
|
||||
struct k_sem rx_lock;
|
||||
#ifdef CONFIG_IEEE802154_CC2520_CRYPTO
|
||||
|
|
|
@ -42,7 +42,8 @@ struct mcr20a_context {
|
|||
struct k_sem seq_sync;
|
||||
atomic_t seq_retval;
|
||||
/************RX************/
|
||||
char __stack mcr20a_rx_stack[CONFIG_IEEE802154_MCR20A_RX_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(mcr20a_rx_stack,
|
||||
CONFIG_IEEE802154_MCR20A_RX_STACK_SIZE);
|
||||
struct k_thread mcr20a_rx_thread;
|
||||
u8_t lqi;
|
||||
};
|
||||
|
|
|
@ -27,7 +27,7 @@ struct nrf5_802154_data {
|
|||
/* 802.15.4 HW address. */
|
||||
u8_t mac[8];
|
||||
/* RX thread stack. */
|
||||
char __stack rx_stack[CONFIG_IEEE802154_NRF5_RX_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(rx_stack, CONFIG_IEEE802154_NRF5_RX_STACK_SIZE);
|
||||
/* RX thread control block */
|
||||
struct k_thread rx_thread;
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ struct bma280_data {
|
|||
sensor_trigger_handler_t any_motion_handler;
|
||||
|
||||
#if defined(CONFIG_BMA280_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_BMA280_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_BMA280_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct k_sem gpio_sem;
|
||||
#elif defined(CONFIG_BMA280_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
|
@ -117,7 +117,8 @@ struct bmc150_magn_data {
|
|||
struct k_sem sem;
|
||||
|
||||
#if defined(CONFIG_BMC150_MAGN_TRIGGER)
|
||||
char __stack thread_stack[CONFIG_BMC150_MAGN_TRIGGER_THREAD_STACK];
|
||||
K_THREAD_STACK_MEMBER(thread_stack,
|
||||
CONFIG_BMC150_MAGN_TRIGGER_THREAD_STACK);
|
||||
struct k_thread thread;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ static void bmg160_handle_int(void *arg)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_BMG160_TRIGGER_OWN_THREAD
|
||||
static char __stack bmg160_thread_stack[CONFIG_BMG160_THREAD_STACK_SIZE];
|
||||
static K_THREAD_STACK_DEFINE(bmg160_thread_stack, CONFIG_BMG160_THREAD_STACK_SIZE);
|
||||
static struct k_thread bmg160_thread;
|
||||
|
||||
static void bmg160_thread_main(void *arg1, void *arg2, void *arg3)
|
||||
|
|
|
@ -77,7 +77,7 @@ static void bmi160_handle_interrupts(void *arg)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_BMI160_TRIGGER_OWN_THREAD
|
||||
static char __stack bmi160_thread_stack[CONFIG_BMI160_THREAD_STACK_SIZE];
|
||||
static K_THREAD_STACK_DEFINE(bmi160_thread_stack, CONFIG_BMI160_THREAD_STACK_SIZE);
|
||||
static struct k_thread bmi160_thread;
|
||||
|
||||
static void bmi160_thread_main(void *arg1, void *unused1, void *unused2)
|
||||
|
|
|
@ -82,7 +82,7 @@ struct fxas21002_data {
|
|||
sensor_trigger_handler_t drdy_handler;
|
||||
#endif
|
||||
#ifdef CONFIG_FXAS21002_TRIGGER_OWN_THREAD
|
||||
char __stack thread_stack[CONFIG_FXAS21002_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_FXAS21002_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct k_sem trig_sem;
|
||||
#endif
|
||||
|
|
|
@ -124,7 +124,7 @@ struct fxos8700_data {
|
|||
sensor_trigger_handler_t double_tap_handler;
|
||||
#endif
|
||||
#ifdef CONFIG_FXOS8700_TRIGGER_OWN_THREAD
|
||||
char __stack thread_stack[CONFIG_FXOS8700_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_FXOS8700_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct k_sem trig_sem;
|
||||
#endif
|
||||
|
|
|
@ -61,7 +61,7 @@ struct hmc5883l_data {
|
|||
sensor_trigger_handler_t data_ready_handler;
|
||||
|
||||
#if defined(CONFIG_HMC5883L_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_HMC5883L_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_HMC5883L_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct k_sem gpio_sem;
|
||||
#elif defined(CONFIG_HMC5883L_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
|
@ -59,7 +59,7 @@ struct hts221_data {
|
|||
sensor_trigger_handler_t data_ready_handler;
|
||||
|
||||
#if defined(CONFIG_HTS221_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_HTS221_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_HTS221_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct k_sem gpio_sem;
|
||||
#elif defined(CONFIG_HTS221_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
|
@ -122,7 +122,7 @@ struct isl29035_driver_data {
|
|||
sensor_trigger_handler_t th_handler;
|
||||
|
||||
#if defined(CONFIG_ISL29035_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_ISL29035_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_ISL29035_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct k_sem gpio_sem;
|
||||
#elif defined(CONFIG_ISL29035_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
|
@ -201,7 +201,7 @@ struct lis2dh_data {
|
|||
enum sensor_channel chan_drdy;
|
||||
|
||||
#if defined(CONFIG_LIS2DH_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_LIS2DH_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_LIS2DH_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct k_sem gpio_sem;
|
||||
#elif defined(CONFIG_LIS2DH_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
|
@ -93,7 +93,7 @@ struct lis3dh_data {
|
|||
sensor_trigger_handler_t data_ready_handler;
|
||||
|
||||
#if defined(CONFIG_LIS3DH_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_LIS3DH_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_LIS3DH_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct k_sem gpio_sem;
|
||||
#elif defined(CONFIG_LIS3DH_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
|
@ -134,7 +134,7 @@ struct lis3mdl_data {
|
|||
sensor_trigger_handler_t data_ready_handler;
|
||||
|
||||
#if defined(CONFIG_LIS3MDL_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_LIS3MDL_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_LIS3MDL_THREAD_STACK_SIZE);
|
||||
struct k_sem gpio_sem;
|
||||
struct k_thread thread;
|
||||
#elif defined(CONFIG_LIS3MDL_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
|
@ -229,7 +229,8 @@ struct lsm9ds0_gyro_data {
|
|||
#endif
|
||||
|
||||
#if defined(CONFIG_LSM9DS0_GYRO_TRIGGER_DRDY)
|
||||
char __stack thread_stack[CONFIG_LSM9DS0_GYRO_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack,
|
||||
CONFIG_LSM9DS0_GYRO_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct device *dev;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ static void mcp9808_thread_main(int arg1, int arg2)
|
|||
}
|
||||
}
|
||||
|
||||
static char __stack mcp9808_thread_stack[CONFIG_MCP9808_THREAD_STACK_SIZE];
|
||||
static K_THREAD_STACK_DEFINE(mcp9808_thread_stack, CONFIG_MCP9808_THREAD_STACK_SIZE);
|
||||
static struct k_thread mcp9808_thread;
|
||||
#else /* CONFIG_MCP9808_TRIGGER_GLOBAL_THREAD */
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ struct mpu6050_data {
|
|||
sensor_trigger_handler_t data_ready_handler;
|
||||
|
||||
#if defined(CONFIG_MPU6050_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_MPU6050_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_MPU6050_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
struct k_sem gpio_sem;
|
||||
#elif defined(CONFIG_MPU6050_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
|
@ -75,7 +75,7 @@ struct sht3xd_data {
|
|||
struct sensor_trigger trigger;
|
||||
|
||||
#if defined(CONFIG_SHT3XD_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_SHT3XD_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_SHT3XD_THREAD_STACK_SIZE);
|
||||
struct k_sem gpio_sem;
|
||||
struct k_thread thread;
|
||||
#elif defined(CONFIG_SHT3XD_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "sx9500.h"
|
||||
|
||||
#ifdef CONFIG_SX9500_TRIGGER_OWN_THREAD
|
||||
static char __stack sx9500_thread_stack[CONFIG_SX9500_THREAD_STACK_SIZE];
|
||||
static K_THREAD_STACK_DEFINE(sx9500_thread_stack, CONFIG_SX9500_THREAD_STACK_SIZE);
|
||||
static struct k_thread sx9500_thread;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ struct tmp007_data {
|
|||
struct sensor_trigger th_trigger;
|
||||
|
||||
#if defined(CONFIG_TMP007_TRIGGER_OWN_THREAD)
|
||||
char __stack thread_stack[CONFIG_TMP007_THREAD_STACK_SIZE];
|
||||
K_THREAD_STACK_MEMBER(thread_stack, CONFIG_TMP007_THREAD_STACK_SIZE);
|
||||
struct k_sem gpio_sem;
|
||||
struct k_thread thread;
|
||||
#elif defined(CONFIG_TMP007_TRIGGER_GLOBAL_THREAD)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue