bluetooth: use kernel stacks
These threads don't run in user mode, save some memory if userspace is enabled. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
41da0769c1
commit
d0e4b24453
6 changed files with 14 additions and 14 deletions
|
@ -96,7 +96,7 @@ struct bt_rfcomm_dlc {
|
|||
|
||||
/* Stack & kernel data for TX thread */
|
||||
struct k_thread tx_thread;
|
||||
K_THREAD_STACK_MEMBER(stack, 256);
|
||||
K_KERNEL_STACK_MEMBER(stack, 256);
|
||||
};
|
||||
|
||||
struct bt_rfcomm_server {
|
||||
|
|
|
@ -53,10 +53,10 @@ static K_SEM_DEFINE(sem_prio_recv, 0, UINT_MAX);
|
|||
static K_FIFO_DEFINE(recv_fifo);
|
||||
|
||||
struct k_thread prio_recv_thread_data;
|
||||
static K_THREAD_STACK_DEFINE(prio_recv_thread_stack,
|
||||
static K_KERNEL_STACK_DEFINE(prio_recv_thread_stack,
|
||||
CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE);
|
||||
struct k_thread recv_thread_data;
|
||||
static K_THREAD_STACK_DEFINE(recv_thread_stack, CONFIG_BT_RX_STACK_SIZE);
|
||||
static K_KERNEL_STACK_DEFINE(recv_thread_stack, CONFIG_BT_RX_STACK_SIZE);
|
||||
|
||||
#if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL)
|
||||
static struct k_poll_signal hbuf_signal =
|
||||
|
@ -499,13 +499,13 @@ static int hci_driver_open(void)
|
|||
#endif
|
||||
|
||||
k_thread_create(&prio_recv_thread_data, prio_recv_thread_stack,
|
||||
K_THREAD_STACK_SIZEOF(prio_recv_thread_stack),
|
||||
K_KERNEL_STACK_SIZEOF(prio_recv_thread_stack),
|
||||
prio_recv_thread, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(CONFIG_BT_CTLR_RX_PRIO), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&prio_recv_thread_data, "BT RX pri");
|
||||
|
||||
k_thread_create(&recv_thread_data, recv_thread_stack,
|
||||
K_THREAD_STACK_SIZEOF(recv_thread_stack),
|
||||
K_KERNEL_STACK_SIZEOF(recv_thread_stack),
|
||||
recv_thread, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(CONFIG_BT_RX_PRIO), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&recv_thread_data, "BT RX");
|
||||
|
|
|
@ -61,10 +61,10 @@
|
|||
/* Stacks for the threads */
|
||||
#if !defined(CONFIG_BT_RECV_IS_RX_THREAD)
|
||||
static struct k_thread rx_thread_data;
|
||||
static K_THREAD_STACK_DEFINE(rx_thread_stack, CONFIG_BT_RX_STACK_SIZE);
|
||||
static K_KERNEL_STACK_DEFINE(rx_thread_stack, CONFIG_BT_RX_STACK_SIZE);
|
||||
#endif
|
||||
static struct k_thread tx_thread_data;
|
||||
static K_THREAD_STACK_DEFINE(tx_thread_stack, CONFIG_BT_HCI_TX_STACK_SIZE);
|
||||
static K_KERNEL_STACK_DEFINE(tx_thread_stack, CONFIG_BT_HCI_TX_STACK_SIZE);
|
||||
|
||||
static void init_work(struct k_work *work);
|
||||
|
||||
|
@ -6610,7 +6610,7 @@ int bt_enable(bt_ready_cb_t cb)
|
|||
|
||||
/* TX thread */
|
||||
k_thread_create(&tx_thread_data, tx_thread_stack,
|
||||
K_THREAD_STACK_SIZEOF(tx_thread_stack),
|
||||
K_KERNEL_STACK_SIZEOF(tx_thread_stack),
|
||||
hci_tx_thread, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(CONFIG_BT_HCI_TX_PRIO),
|
||||
0, K_NO_WAIT);
|
||||
|
@ -6619,7 +6619,7 @@ int bt_enable(bt_ready_cb_t cb)
|
|||
#if !defined(CONFIG_BT_RECV_IS_RX_THREAD)
|
||||
/* RX thread */
|
||||
k_thread_create(&rx_thread_data, rx_thread_stack,
|
||||
K_THREAD_STACK_SIZEOF(rx_thread_stack),
|
||||
K_KERNEL_STACK_SIZEOF(rx_thread_stack),
|
||||
(k_thread_entry_t)hci_rx_thread, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(CONFIG_BT_RX_PRIO),
|
||||
0, K_NO_WAIT);
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#endif
|
||||
|
||||
static struct k_thread ecc_thread_data;
|
||||
static K_THREAD_STACK_DEFINE(ecc_thread_stack, CONFIG_BT_HCI_ECC_STACK_SIZE);
|
||||
static K_KERNEL_STACK_DEFINE(ecc_thread_stack, CONFIG_BT_HCI_ECC_STACK_SIZE);
|
||||
|
||||
/* based on Core Specification 4.2 Vol 3. Part H 2.3.5.6.1 */
|
||||
static const uint32_t debug_private_key[8] = {
|
||||
|
@ -322,7 +322,7 @@ int default_CSPRNG(uint8_t *dst, unsigned int len)
|
|||
void bt_hci_ecc_init(void)
|
||||
{
|
||||
k_thread_create(&ecc_thread_data, ecc_thread_stack,
|
||||
K_THREAD_STACK_SIZEOF(ecc_thread_stack), ecc_thread,
|
||||
K_KERNEL_STACK_SIZEOF(ecc_thread_stack), ecc_thread,
|
||||
NULL, NULL, NULL, K_PRIO_PREEMPT(10), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&ecc_thread_data, "BT ECC");
|
||||
}
|
||||
|
|
|
@ -752,7 +752,7 @@ static void rfcomm_dlc_connected(struct bt_rfcomm_dlc *dlc)
|
|||
|
||||
k_fifo_init(&dlc->tx_queue);
|
||||
k_thread_create(&dlc->tx_thread, dlc->stack,
|
||||
K_THREAD_STACK_SIZEOF(dlc->stack),
|
||||
K_KERNEL_STACK_SIZEOF(dlc->stack),
|
||||
rfcomm_dlc_tx_thread, dlc, NULL, NULL, K_PRIO_COOP(7),
|
||||
0, K_NO_WAIT);
|
||||
k_thread_name_set(&dlc->tx_thread, "BT DLC");
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
static K_FIFO_DEFINE(adv_queue);
|
||||
static struct k_thread adv_thread_data;
|
||||
static K_THREAD_STACK_DEFINE(adv_thread_stack, CONFIG_BT_MESH_ADV_STACK_SIZE);
|
||||
static K_KERNEL_STACK_DEFINE(adv_thread_stack, CONFIG_BT_MESH_ADV_STACK_SIZE);
|
||||
|
||||
NET_BUF_POOL_DEFINE(adv_buf_pool, CONFIG_BT_MESH_ADV_BUF_COUNT,
|
||||
BT_MESH_ADV_DATA_SIZE, BT_MESH_ADV_USER_DATA_SIZE, NULL);
|
||||
|
@ -290,7 +290,7 @@ static void bt_mesh_scan_cb(const bt_addr_le_t *addr, int8_t rssi,
|
|||
void bt_mesh_adv_init(void)
|
||||
{
|
||||
k_thread_create(&adv_thread_data, adv_thread_stack,
|
||||
K_THREAD_STACK_SIZEOF(adv_thread_stack), adv_thread,
|
||||
K_KERNEL_STACK_SIZEOF(adv_thread_stack), adv_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&adv_thread_data, "BT Mesh adv");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue