rptun: remove rptun work queue related unused code
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
This commit is contained in:
parent
5eef09b4a1
commit
976aa5552f
@ -12,26 +12,12 @@ menuconfig RPTUN
|
|||||||
|
|
||||||
if RPTUN
|
if RPTUN
|
||||||
|
|
||||||
choice
|
|
||||||
prompt "rptun dispatch method"
|
|
||||||
|
|
||||||
config RPTUN_THREAD
|
|
||||||
bool "rptun thread"
|
|
||||||
|
|
||||||
config RPTUN_WORKQUEUE
|
|
||||||
bool "rptun workqueue"
|
|
||||||
depends on SCHED_WORKQUEUE
|
|
||||||
|
|
||||||
endchoice
|
|
||||||
|
|
||||||
config RPTUN_PRIORITY
|
config RPTUN_PRIORITY
|
||||||
int "rptun thread priority"
|
int "rptun thread priority"
|
||||||
depends on RPTUN_THREAD
|
|
||||||
default 224
|
default 224
|
||||||
|
|
||||||
config RPTUN_STACKSIZE
|
config RPTUN_STACKSIZE
|
||||||
int "rptun stack size"
|
int "rptun stack size"
|
||||||
depends on RPTUN_THREAD
|
|
||||||
default 4096
|
default 4096
|
||||||
|
|
||||||
config RPTUN_LOADER
|
config RPTUN_LOADER
|
||||||
|
@ -68,12 +68,8 @@ struct rptun_priv_s
|
|||||||
rmutex_t lock;
|
rmutex_t lock;
|
||||||
struct metal_list node;
|
struct metal_list node;
|
||||||
sem_t semtx;
|
sem_t semtx;
|
||||||
#ifdef CONFIG_RPTUN_WORKQUEUE
|
|
||||||
struct work_s work;
|
|
||||||
#else
|
|
||||||
sem_t semrx;
|
sem_t semrx;
|
||||||
pid_t tid;
|
pid_t tid;
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_RPTUN_PM
|
#ifdef CONFIG_RPTUN_PM
|
||||||
bool stay;
|
bool stay;
|
||||||
#endif
|
#endif
|
||||||
@ -239,25 +235,6 @@ static void rptun_worker(FAR void *arg)
|
|||||||
remoteproc_get_notification(&priv->rproc, RPTUN_NOTIFY_ALL);
|
remoteproc_get_notification(&priv->rproc, RPTUN_NOTIFY_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_RPTUN_WORKQUEUE
|
|
||||||
static void rptun_wakeup_rx(FAR struct rptun_priv_s *priv)
|
|
||||||
{
|
|
||||||
work_queue(HPWORK, &priv->work, rptun_worker, priv, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rptun_in_recursive(int tid, FAR void *arg)
|
|
||||||
{
|
|
||||||
*((FAR bool *)arg) = (nxsched_gettid() == tid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool rptun_is_recursive(FAR struct rptun_priv_s *priv)
|
|
||||||
{
|
|
||||||
bool in = false;
|
|
||||||
work_foreach(HPWORK, rptun_in_recursive, &in);
|
|
||||||
return in;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
static int rptun_thread(int argc, FAR char *argv[])
|
static int rptun_thread(int argc, FAR char *argv[])
|
||||||
{
|
{
|
||||||
FAR struct rptun_priv_s *priv;
|
FAR struct rptun_priv_s *priv;
|
||||||
@ -294,7 +271,6 @@ static bool rptun_is_recursive(FAR struct rptun_priv_s *priv)
|
|||||||
{
|
{
|
||||||
return nxsched_gettid() == priv->tid;
|
return nxsched_gettid() == priv->tid;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void rptun_wakeup_tx(FAR struct rptun_priv_s *priv)
|
static void rptun_wakeup_tx(FAR struct rptun_priv_s *priv)
|
||||||
{
|
{
|
||||||
@ -1200,10 +1176,8 @@ int rptun_initialize(FAR struct rptun_dev_s *dev)
|
|||||||
struct metal_init_params params = METAL_INIT_DEFAULTS;
|
struct metal_init_params params = METAL_INIT_DEFAULTS;
|
||||||
FAR struct rptun_priv_s *priv;
|
FAR struct rptun_priv_s *priv;
|
||||||
static bool onceinit;
|
static bool onceinit;
|
||||||
#ifndef CONFIG_RPTUN_WORKQUEUE
|
|
||||||
FAR char *argv[3];
|
FAR char *argv[3];
|
||||||
char arg1[19];
|
char arg1[19];
|
||||||
#endif
|
|
||||||
char name[32];
|
char name[32];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1239,13 +1213,6 @@ int rptun_initialize(FAR struct rptun_dev_s *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
nxsem_init(&priv->semtx, 0, 0);
|
nxsem_init(&priv->semtx, 0, 0);
|
||||||
|
|
||||||
#ifdef CONFIG_RPTUN_WORKQUEUE
|
|
||||||
if (RPTUN_IS_AUTOSTART(dev))
|
|
||||||
{
|
|
||||||
work_queue(HPWORK, &priv->work, rptun_start_worker, priv, 0);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
nxsem_init(&priv->semrx, 0, 0);
|
nxsem_init(&priv->semrx, 0, 0);
|
||||||
snprintf(arg1, sizeof(arg1), "0x%" PRIxPTR, (uintptr_t)priv);
|
snprintf(arg1, sizeof(arg1), "0x%" PRIxPTR, (uintptr_t)priv);
|
||||||
argv[0] = (void *)RPTUN_GET_CPUNAME(dev);
|
argv[0] = (void *)RPTUN_GET_CPUNAME(dev);
|
||||||
@ -1261,7 +1228,6 @@ int rptun_initialize(FAR struct rptun_dev_s *dev)
|
|||||||
nxsem_destroy(&priv->semrx);
|
nxsem_destroy(&priv->semrx);
|
||||||
goto err_driver;
|
goto err_driver;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Add priv to list */
|
/* Add priv to list */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user