net: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit. Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
This commit is contained in:
parent
aa25e212d1
commit
d7f0da1c78
@ -193,8 +193,12 @@ static void conn_mgr_mon_init_cb(struct net_if *iface, void *user_data)
|
||||
conn_mgr_mon_initial_state(iface);
|
||||
}
|
||||
|
||||
static void conn_mgr_mon_thread_fn(void)
|
||||
static void conn_mgr_mon_thread_fn(void *p1, void *p2, void *p3)
|
||||
{
|
||||
ARG_UNUSED(p1);
|
||||
ARG_UNUSED(p2);
|
||||
ARG_UNUSED(p3);
|
||||
|
||||
k_mutex_lock(&conn_mgr_mon_lock, K_FOREVER);
|
||||
|
||||
conn_mgr_conn_init();
|
||||
@ -332,7 +336,7 @@ static int conn_mgr_mon_init(void)
|
||||
|
||||
k_thread_create(&conn_mgr_mon_thread, conn_mgr_mon_stack,
|
||||
CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE,
|
||||
(k_thread_entry_t)conn_mgr_mon_thread_fn,
|
||||
conn_mgr_mon_thread_fn,
|
||||
NULL, NULL, NULL, THREAD_PRIORITY, 0, K_NO_WAIT);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -4618,8 +4618,12 @@ bool net_if_is_suspended(struct net_if *iface)
|
||||
#endif /* CONFIG_NET_POWER_MANAGEMENT */
|
||||
|
||||
#if defined(CONFIG_NET_PKT_TIMESTAMP_THREAD)
|
||||
static void net_tx_ts_thread(void)
|
||||
static void net_tx_ts_thread(void *p1, void *p2, void *p3)
|
||||
{
|
||||
ARG_UNUSED(p1);
|
||||
ARG_UNUSED(p2);
|
||||
ARG_UNUSED(p3);
|
||||
|
||||
struct net_pkt *pkt;
|
||||
|
||||
NET_DBG("Starting TX timestamp callback thread");
|
||||
@ -4880,7 +4884,7 @@ void net_if_init(void)
|
||||
#if defined(CONFIG_NET_PKT_TIMESTAMP_THREAD)
|
||||
k_thread_create(&tx_thread_ts, tx_ts_stack,
|
||||
K_KERNEL_STACK_SIZEOF(tx_ts_stack),
|
||||
(k_thread_entry_t)net_tx_ts_thread,
|
||||
net_tx_ts_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(1), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&tx_thread_ts, "tx_tstamp");
|
||||
#endif /* CONFIG_NET_PKT_TIMESTAMP_THREAD */
|
||||
|
||||
@ -189,8 +189,12 @@ static inline void mgmt_run_callbacks(const struct mgmt_event_entry * const mgmt
|
||||
#endif
|
||||
}
|
||||
|
||||
static void mgmt_thread(void)
|
||||
static void mgmt_thread(void *p1, void *p2, void *p3)
|
||||
{
|
||||
ARG_UNUSED(p1);
|
||||
ARG_UNUSED(p2);
|
||||
ARG_UNUSED(p3);
|
||||
|
||||
struct mgmt_event_entry mgmt_event;
|
||||
|
||||
while (1) {
|
||||
@ -343,7 +347,7 @@ void net_mgmt_event_init(void)
|
||||
|
||||
k_thread_create(&mgmt_thread_data, mgmt_stack,
|
||||
K_KERNEL_STACK_SIZEOF(mgmt_stack),
|
||||
(k_thread_entry_t)mgmt_thread, NULL, NULL, NULL,
|
||||
mgmt_thread, NULL, NULL, NULL,
|
||||
THREAD_PRIORITY, 0, K_NO_WAIT);
|
||||
k_thread_name_set(&mgmt_thread_data, "net_mgmt");
|
||||
|
||||
|
||||
@ -237,8 +237,12 @@ static void net_tc_rx_stats_priority_setup(struct net_if *iface,
|
||||
#endif
|
||||
|
||||
#if NET_TC_RX_COUNT > 0
|
||||
static void tc_rx_handler(struct k_fifo *fifo)
|
||||
static void tc_rx_handler(void *p1, void *p2, void *p3)
|
||||
{
|
||||
ARG_UNUSED(p2);
|
||||
ARG_UNUSED(p3);
|
||||
|
||||
struct k_fifo *fifo = p1;
|
||||
struct net_pkt *pkt;
|
||||
|
||||
while (1) {
|
||||
@ -253,8 +257,12 @@ static void tc_rx_handler(struct k_fifo *fifo)
|
||||
#endif
|
||||
|
||||
#if NET_TC_TX_COUNT > 0
|
||||
static void tc_tx_handler(struct k_fifo *fifo)
|
||||
static void tc_tx_handler(void *p1, void *p2, void *p3)
|
||||
{
|
||||
ARG_UNUSED(p2);
|
||||
ARG_UNUSED(p3);
|
||||
|
||||
struct k_fifo *fifo = p1;
|
||||
struct net_pkt *pkt;
|
||||
|
||||
while (1) {
|
||||
@ -309,7 +317,7 @@ void net_tc_tx_init(void)
|
||||
|
||||
tid = k_thread_create(&tx_classes[i].handler, tx_stack[i],
|
||||
K_KERNEL_STACK_SIZEOF(tx_stack[i]),
|
||||
(k_thread_entry_t)tc_tx_handler,
|
||||
tc_tx_handler,
|
||||
&tx_classes[i].fifo, NULL, NULL,
|
||||
priority, 0, K_FOREVER);
|
||||
if (!tid) {
|
||||
@ -367,7 +375,7 @@ void net_tc_rx_init(void)
|
||||
|
||||
tid = k_thread_create(&rx_classes[i].handler, rx_stack[i],
|
||||
K_KERNEL_STACK_SIZEOF(rx_stack[i]),
|
||||
(k_thread_entry_t)tc_rx_handler,
|
||||
tc_rx_handler,
|
||||
&rx_classes[i].fifo, NULL, NULL,
|
||||
priority, 0, K_FOREVER);
|
||||
if (!tid) {
|
||||
|
||||
@ -540,8 +540,12 @@ static void gptp_state_machine(void)
|
||||
gptp_mi_state_machines();
|
||||
}
|
||||
|
||||
static void gptp_thread(void)
|
||||
static void gptp_thread(void *p1, void *p2, void *p3)
|
||||
{
|
||||
ARG_UNUSED(p1);
|
||||
ARG_UNUSED(p2);
|
||||
ARG_UNUSED(p3);
|
||||
|
||||
int port;
|
||||
|
||||
NET_DBG("Starting PTP thread");
|
||||
@ -917,7 +921,7 @@ static void init_ports(void)
|
||||
|
||||
tid = k_thread_create(&gptp_thread_data, gptp_stack,
|
||||
K_KERNEL_STACK_SIZEOF(gptp_stack),
|
||||
(k_thread_entry_t)gptp_thread,
|
||||
gptp_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(5), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&gptp_thread_data, "gptp");
|
||||
}
|
||||
|
||||
@ -30,10 +30,10 @@ static K_FIFO_DEFINE(tx_queue);
|
||||
#define THREAD_PRIORITY K_PRIO_PREEMPT(CONFIG_NET_L2_PPP_THREAD_PRIO)
|
||||
#endif
|
||||
|
||||
static void tx_handler(void);
|
||||
static void tx_handler(void *p1, void *p2, void *p3);
|
||||
|
||||
static K_THREAD_DEFINE(tx_handler_thread, CONFIG_NET_L2_PPP_TX_STACK_SIZE,
|
||||
(k_thread_entry_t)tx_handler, NULL, NULL, NULL,
|
||||
tx_handler, NULL, NULL, NULL,
|
||||
THREAD_PRIORITY, 0, 0);
|
||||
|
||||
static const struct ppp_protocol_handler *ppp_lcp;
|
||||
@ -344,8 +344,12 @@ void ppp_queue_pkt(struct net_pkt *pkt)
|
||||
k_fifo_put(&tx_queue, pkt);
|
||||
}
|
||||
|
||||
static void tx_handler(void)
|
||||
static void tx_handler(void *p1, void *p2, void *p3)
|
||||
{
|
||||
ARG_UNUSED(p1);
|
||||
ARG_UNUSED(p2);
|
||||
ARG_UNUSED(p3);
|
||||
|
||||
struct net_pkt *pkt;
|
||||
int ret;
|
||||
|
||||
|
||||
@ -696,8 +696,12 @@ static void socket_reset_pollfd_events(void)
|
||||
}
|
||||
|
||||
/* LwM2M main work loop */
|
||||
static void socket_loop(void)
|
||||
static void socket_loop(void *p1, void *p2, void *p3)
|
||||
{
|
||||
ARG_UNUSED(p1);
|
||||
ARG_UNUSED(p2);
|
||||
ARG_UNUSED(p3);
|
||||
|
||||
int i, rc;
|
||||
int64_t now, next;
|
||||
int64_t timeout, next_retransmit;
|
||||
@ -1245,7 +1249,7 @@ static int lwm2m_engine_init(void)
|
||||
|
||||
/* start sock receive thread */
|
||||
engine_thread_id = k_thread_create(&engine_thread_data, &engine_thread_stack[0],
|
||||
K_KERNEL_STACK_SIZEOF(engine_thread_stack), (k_thread_entry_t)socket_loop,
|
||||
K_KERNEL_STACK_SIZEOF(engine_thread_stack), socket_loop,
|
||||
NULL, NULL, NULL, THREAD_PRIORITY, 0, K_NO_WAIT);
|
||||
k_thread_name_set(&engine_thread_data, "lwm2m-sock-recv");
|
||||
LOG_DBG("LWM2M engine socket receive thread started");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user