pid_t: unify usage of special task IDs

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2022-03-21 23:47:09 +01:00 committed by Xiang Xiao
parent 2ee12b2c5d
commit 68902d8732
150 changed files with 359 additions and 456 deletions

View file

@ -104,7 +104,7 @@ typedef struct
fault_flags_t flags; /* What is in the dump */
uintptr_t current_regs; /* Used to validate the dump */
int lineno; /* __LINE__ to up_assert */
int pid; /* Process ID */
pid_t pid; /* Process ID */
uint32_t regs[XCPTCONTEXT_REGS]; /* Interrupt register save area */
stack_t stacks; /* Stack info */
#if CONFIG_TASK_NAME_SIZE > 0

View file

@ -61,7 +61,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -62,7 +62,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -61,7 +61,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -63,7 +63,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -61,7 +61,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -63,7 +63,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -26,6 +26,7 @@
#include <stdlib.h>
#include <errno.h>
#include <sched.h>
#include <nuttx/sched.h>
#include <nuttx/kthread.h>
#include <debug.h>
@ -59,7 +60,7 @@ struct cxd56_sigtype_s
struct cxd56cpu1_info_s
{
int workerpid;
pid_t workerpid;
int ndev;
struct cxd56_sigtype_s sigtype[CXD56_CPU1_DATA_TYPE_MAX];
};
@ -70,7 +71,11 @@ struct cxd56cpu1_info_s
static struct cxd56cpu1_info_s g_cpu1_info =
{
0
INVALID_PROCESS_ID,
0,
{
0
}
};
/****************************************************************************
@ -193,9 +198,9 @@ int cxd56_cpu1siginit(uint8_t sigtype, FAR void *data)
}
pid = kthread_create("gnss_receiver",
CONFIG_CXD56CPU1_WORKER_THREAD_PRIORITY,
CONFIG_CXD56CPU1_WORKER_STACKSIZE, cxd56cpu1_worker,
(FAR char * const *) NULL);
CONFIG_CXD56CPU1_WORKER_THREAD_PRIORITY,
CONFIG_CXD56CPU1_WORKER_STACKSIZE, cxd56cpu1_worker,
(FAR char * const *) NULL);
if (pid < 0)
{
@ -221,7 +226,7 @@ err1:
int cxd56_cpu1siguninit(uint8_t sigtype)
{
struct cxd56cpu1_info_s *priv = &g_cpu1_info;
int pid;
pid_t pid;
int ret;
if (sigtype >= CXD56_CPU1_DATA_TYPE_MAX)
@ -249,7 +254,7 @@ int cxd56_cpu1siguninit(uint8_t sigtype)
}
pid = priv->workerpid;
priv->workerpid = 0;
priv->workerpid = INVALID_PROCESS_ID;
sched_unlock();

View file

@ -135,7 +135,7 @@ extern int fw_pm_sleepcpu(int cpuid, int mode);
struct cxd56_gnss_sig_s
{
uint8_t enable;
int pid;
pid_t pid;
FAR struct cxd56_gnss_signal_info_s info;
};
@ -1466,7 +1466,7 @@ static int cxd56_gnss_set_signal(FAR struct file *filep, unsigned long arg)
FAR struct cxd56_gnss_signal_setting_s *setting;
FAR struct cxd56_gnss_sig_s *sig;
FAR struct cxd56_gnss_sig_s *checksig;
int pid;
pid_t pid;
int i;
if (!arg)

View file

@ -116,7 +116,7 @@ struct iccdev_s
/* for POSIX signal */
int signo;
int pid;
pid_t pid;
FAR void *sigdata;
struct sq_queue_s recvq;

View file

@ -113,7 +113,7 @@
struct ev_notify_s
{
int signo; /* Signal number */
int pid; /* Target PID */
pid_t pid; /* Target PID */
struct scuev_arg_s *arg; /* Event argument */
struct scufifo_s *fifo; /* Reverse reference to FIFO */
};
@ -121,7 +121,7 @@ struct ev_notify_s
struct wm_notify_s
{
int signo; /* Signal number */
int pid; /* Target PID */
pid_t pid; /* Target PID */
struct scutimestamp_s *ts; /* Event argument */
struct scufifo_s *fifo; /* Reverse reference to FIFO */
};

View file

@ -380,7 +380,7 @@ struct cxd56_usbdev_s
/* signal */
int signo;
int pid;
pid_t pid;
};
/* For maintaining tables of endpoint info */

View file

@ -661,7 +661,7 @@ int rtw_create_task(struct task_struct *task, const char *name,
return pid;
}
wrap->pid = pid;
wrap->pid = (pid_t)pid;
return 1;
}

View file

@ -66,7 +66,7 @@ struct task_struct
};
struct nthread_wrapper
{
int pid;
pid_t pid;
thread_func_t func;
void *thctx;
};

View file

@ -141,7 +141,7 @@ struct tiva_canmod_s
/* kthread message handler thread ID */
int kthd_id;
pid_t kthd_id;
#ifdef CONFIG_CAN_ERRORS
/* Asynchronously report errors when status interrupts are disabled */
@ -438,7 +438,7 @@ static int tivacan_setup(FAR struct can_dev_s *dev)
}
else
{
canmod->kthd_id = ret;
canmod->kthd_id = (pid_t)ret;
}
#ifdef CONFIG_CAN_EXTID

View file

@ -58,7 +58,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -55,7 +55,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -296,7 +296,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (CURRENT_REGS || running_task()->pid == 0)
if (up_interrupt_context() || sched_idletask())
{
up_irq_save();
for (; ; )

View file

@ -55,7 +55,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = g_idle_basestack;
tcb->stack_base_ptr = tcb->stack_alloc_ptr;

View file

@ -61,7 +61,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = g_idle_basestack;
tcb->stack_base_ptr = tcb->stack_alloc_ptr;

View file

@ -56,7 +56,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -59,7 +59,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -57,7 +57,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -61,7 +61,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -74,7 +74,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -57,7 +57,7 @@ void up_initial_state(FAR struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -62,7 +62,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -74,7 +74,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -340,9 +340,9 @@ int bl_os_task_create(const char *name,
void bl_os_task_delete(void *task_handle)
{
pid_t task = (int)task_handle;
pid_t pid = (pid_t)((uintptr_t)task_handle);
task_delete((pid_t)task);
task_delete(pid);
}
/****************************************************************************
@ -358,7 +358,9 @@ void bl_os_task_delete(void *task_handle)
void *bl_os_task_get_current_task(void)
{
return (void *)0;
pid_t pid = getpid();
return (void *)((uintptr_t)pid);
}
/****************************************************************************

View file

@ -57,7 +57,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -553,7 +553,7 @@ static int32_t esp_task_create_pinned_to_core(void *entry,
wlerr("Failed to create task\n");
}
return pid > 0 ? true : false;
return pid > 0;
}
/****************************************************************************

View file

@ -68,7 +68,7 @@
struct esp32c3_rt_priv_s
{
int pid;
pid_t pid;
sem_t toutsem;
struct list_node runlist;
struct list_node toutlist;
@ -81,7 +81,7 @@ struct esp32c3_rt_priv_s
static struct esp32c3_rt_priv_s g_rt_priv =
{
.pid = -EINVAL,
.pid = INVALID_PROCESS_ID,
};
/****************************************************************************
@ -736,7 +736,7 @@ int esp32c3_rt_timer_init(void)
list_initialize(&priv->runlist);
list_initialize(&priv->toutlist);
priv->pid = pid;
priv->pid = (pid_t)pid;
flags = enter_critical_section();
@ -789,10 +789,10 @@ void esp32c3_rt_timer_deinit(void)
leave_critical_section(flags);
if (priv->pid != -EINVAL)
if (priv->pid != INVALID_PROCESS_ID)
{
kthread_delete(priv->pid);
priv->pid = -EINVAL;
priv->pid = INVALID_PROCESS_ID;
}
nxsem_destroy(&priv->toutsem);

View file

@ -1997,7 +1997,7 @@ static int32_t esp_task_create_pinned_to_core(void *entry,
wlerr("ERROR: Failed to create task\n");
}
return pid > 0 ? true : false;
return pid > 0;
}
/****************************************************************************

View file

@ -54,7 +54,7 @@
void up_initial_state(struct tcb_s *tcb)
{
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(up_getsp() -
CONFIG_IDLETHREAD_STACKSIZE -

View file

@ -108,7 +108,7 @@ void up_dumpstate(void)
/* Get the limits on the user stack memory */
if (rtcb->pid == 0) /* Check for CPU0 IDLE thread */
if (rtcb->pid == IDLE_PROCESS_ID) /* Check for CPU0 IDLE thread */
{
ustackbase = g_idle_topstack - 4;
ustacksize = CONFIG_IDLETHREAD_STACKSIZE;

View file

@ -68,7 +68,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -55,7 +55,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -56,7 +56,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);

View file

@ -60,7 +60,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
tcb->stack_alloc_ptr = g_idlestack;
tcb->stack_base_ptr = tcb->stack_alloc_ptr;

View file

@ -802,7 +802,7 @@ static int32_t esp_task_create_pinned_to_core(void *entry,
wlerr("Failed to create task, error %d\n", pid);
}
return pid > 0 ? true : false;
return pid > 0;
}
/****************************************************************************

View file

@ -66,7 +66,7 @@
struct esp32_rt_priv_s
{
int pid;
pid_t pid;
sem_t toutsem;
@ -81,7 +81,10 @@ struct esp32_rt_priv_s
* Private Data
****************************************************************************/
static struct esp32_rt_priv_s g_rt_priv;
static struct esp32_rt_priv_s g_rt_priv =
{
.pid = INVALID_PROCESS_ID
};
/****************************************************************************
* Private Function Prototypes
@ -705,7 +708,7 @@ int esp32_rt_timer_init(void)
list_initialize(&priv->toutlist);
priv->timer = tim;
priv->pid = pid;
priv->pid = (pid_t)pid;
flags = spin_lock_irqsave(&priv->lock);
@ -757,7 +760,12 @@ void esp32_rt_timer_deinit(void)
spin_unlock_irqrestore(&priv->lock, flags);
kthread_delete(priv->pid);
if (priv->pid != INVALID_PROCESS_ID)
{
kthread_delete(priv->pid);
priv->pid = INVALID_PROCESS_ID;
}
nxsem_destroy(&priv->toutsem);
}

View file

@ -1933,7 +1933,7 @@ static int32_t esp_task_create_pinned_to_core(void *entry,
wlerr("Failed to create task\n");
}
return pid > 0 ? true : false;
return pid > 0;
}
/****************************************************************************

View file

@ -74,7 +74,7 @@
struct esp32s2_rt_priv_s
{
int pid;
pid_t pid;
sem_t toutsem;
struct list_node runlist;
struct list_node toutlist;
@ -87,7 +87,7 @@ struct esp32s2_rt_priv_s
static struct esp32s2_rt_priv_s g_rt_priv =
{
.pid = -EINVAL,
.pid = INVALID_PROCESS_ID,
};
/****************************************************************************
@ -752,7 +752,7 @@ int esp32s2_rt_timer_init(void)
list_initialize(&priv->runlist);
list_initialize(&priv->toutlist);
priv->pid = pid;
priv->pid = (pid_t)pid;
priv->timer = tim;
flags = enter_critical_section();
@ -832,10 +832,10 @@ void esp32s2_rt_timer_deinit(void)
leave_critical_section(flags);
if (priv->pid != -EINVAL)
if (priv->pid != INVALID_PROCESS_ID)
{
kthread_delete(priv->pid);
priv->pid = -EINVAL;
priv->pid = INVALID_PROCESS_ID;
}
nxsem_destroy(&priv->toutsem);

View file

@ -72,7 +72,7 @@ static_assert(RT_TIMER_TASK_PRIORITY < CONFIG_SCHED_HPWORKPRIORITY,
struct esp32s3_rt_priv_s
{
int pid; /* PID of RT Timer kernel thread */
pid_t pid; /* PID of RT Timer kernel thread */
int cpuint; /* CPU interrupt assigned to this timer */
int core; /* Core that is taking care of the timer
* interrupts
@ -91,7 +91,7 @@ struct esp32s3_rt_priv_s
static struct esp32s3_rt_priv_s g_rt_priv =
{
.pid = -EINVAL,
.pid = INVALID_PROCESS_ID,
.cpuint = -ENOMEM,
.core = -ENODEV
};
@ -961,7 +961,7 @@ int esp32s3_rt_timer_init(void)
list_initialize(&priv->runlist);
list_initialize(&priv->toutlist);
priv->pid = pid;
priv->pid = (pid_t)pid;
flags = spin_lock_irqsave(&priv->lock);
@ -1044,10 +1044,10 @@ void esp32s3_rt_timer_deinit(void)
spin_unlock_irqrestore(&priv->lock, flags);
if (priv->pid != -EINVAL)
if (priv->pid != INVALID_PROCESS_ID)
{
kthread_delete(priv->pid);
priv->pid = -EINVAL;
priv->pid = INVALID_PROCESS_ID;
}
nxsem_destroy(&priv->toutsem);

View file

@ -54,7 +54,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)CONFIG_STACK_BASE;
#ifdef CONFIG_STACK_COLORATION

View file

@ -54,7 +54,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the idle thread stack */
if (tcb->pid == 0)
if (tcb->pid == IDLE_PROCESS_ID)
{
char *stack_ptr = (char *)CONFIG_STACK_BASE;
#ifdef CONFIG_STACK_COLORATION

View file

@ -131,7 +131,6 @@ static int ehci_waiter(int argc, char *argv[])
int imxrt_usbhost_initialize(void)
{
pid_t pid;
int ret;
imxrt_clockall_usboh3();
@ -205,10 +204,10 @@ int imxrt_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -131,7 +131,6 @@ static int ehci_waiter(int argc, char *argv[])
int imxrt_usbhost_initialize(void)
{
pid_t pid;
int ret;
imxrt_clockall_usboh3();
@ -203,10 +202,10 @@ int imxrt_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -131,7 +131,6 @@ static int ehci_waiter(int argc, char *argv[])
int imxrt_usbhost_initialize(void)
{
pid_t pid;
int ret;
imxrt_clockall_usboh3();
@ -203,10 +202,10 @@ int imxrt_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -398,7 +398,6 @@ static void usb_msc_disconnect(FAR void *arg)
int k28_usbhost_initialize(void)
{
pid_t pid;
int ret;
# ifdef HAVE_USB_AUTOMOUNTER
int index;
@ -479,10 +478,10 @@ int k28_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -36,7 +36,7 @@ Kinetis TWR-K64F120M Features:
o Touch TWRPI Socket adds support for various capacitive touch boards
(e.g. keypads, rotary dials, sliders, etc.)
o Tower connectivity for access to USB, Ethernet, RS232/RS485, CAN, SPI,
I²C, Flexbus, etc.
I²C, Flexbus, etc.
o Plus: Potentiometer, 4 LEDs, 2 pushbuttons, accelerometer, RTC battery
Kinetis TWR-K64F120M Pin Configuration

View file

@ -260,7 +260,6 @@ static int nsh_sdinitialize(void)
#ifdef NSH_HAVE_USBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -302,10 +301,10 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_INFO, "Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -296,7 +296,6 @@ static int nsh_sdinitialize(void)
#ifdef NSH_HAVE_USBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -338,10 +337,10 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_INFO, "Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -294,7 +294,6 @@ static int nsh_sdinitialize(void)
#ifdef NSH_HAVE_USBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -337,10 +336,10 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_INFO, "Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
UNUSED(ret);

View file

@ -238,7 +238,6 @@ errout:
#ifdef HAVE_USBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -294,10 +293,10 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_ERR, "ERROR: Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_MCB1700_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_MCB1700_USBHOST_PRIO,
CONFIG_MCB1700_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -237,7 +237,6 @@ errout:
#ifdef HAVE_USBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -313,10 +312,10 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_ERR, "ERROR: Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_LPC1766STK_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_LPC1766STK_USBHOST_PRIO,
CONFIG_LPC1766STK_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -295,7 +295,6 @@ static int nsh_sdinitialize(void)
#ifdef NSH_HAVE_USBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -337,10 +336,10 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_INFO, "Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -159,7 +159,6 @@ void weak_function lpc31_usbhost_bootinitialize(void)
int lpc31_usbhost_initialize(void)
{
pid_t pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -218,10 +217,10 @@ int lpc31_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -160,7 +160,6 @@ void weak_function lpc31_usbhost_bootinitialize(void)
int lpc31_usbhost_initialize(void)
{
pid_t pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -218,10 +217,10 @@ int lpc31_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO, i
ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO, i
CONFIG_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -230,7 +230,6 @@ void weak_function sam_usbinitialize(void)
#ifdef HAVE_USBHOST
int sam_usbhost_initialize(void)
{
pid_t pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -291,11 +290,11 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("OHCI Monitor",
ret = kthread_create("OHCI Monitor",
CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_PRIO,
CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_STACKSIZE,
(main_t)ohci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
return -ENODEV;
@ -314,11 +313,11 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor",
ret = kthread_create("EHCI Monitor",
CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_PRIO,
CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -278,7 +278,6 @@ void weak_function sam_usbinitialize(void)
#ifdef HAVE_USBHOST
int sam_usbhost_initialize(void)
{
pid_t pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -339,10 +338,10 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("OHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO,
ret = kthread_create("OHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO,
CONFIG_SAMA5D2XULT_USBHOST_STACKSIZE,
(main_t)ohci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
return -ENODEV;
@ -361,10 +360,10 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO,
ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO,
CONFIG_SAMA5D2XULT_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -286,7 +286,6 @@ void weak_function sam_usbinitialize(void)
#ifdef HAVE_USBHOST
int sam_usbhost_initialize(void)
{
pid_t pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -347,10 +346,10 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("OHCI Monitor", CONFIG_SAMA5D3XPLAINED_USBHOST_PRIO,
ret = kthread_create("OHCI Monitor", CONFIG_SAMA5D3XPLAINED_USBHOST_PRIO,
CONFIG_SAMA5D3XPLAINED_USBHOST_STACKSIZE,
(main_t)ohci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
return -ENODEV;
@ -369,10 +368,10 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_SAMA5D3XPLAINED_USBHOST_PRIO,
ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D3XPLAINED_USBHOST_PRIO,
CONFIG_SAMA5D3XPLAINED_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -284,7 +284,6 @@ void weak_function sam_usbinitialize(void)
#ifdef HAVE_USBHOST
int sam_usbhost_initialize(void)
{
pid_t pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -345,11 +344,11 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("OHCI Monitor",
ret = kthread_create("OHCI Monitor",
CONFIG_SAMA5D3XEK_USBHOST_PRIO,
CONFIG_SAMA5D3XEK_USBHOST_STACKSIZE,
(main_t)ohci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
return -ENODEV;
@ -368,10 +367,10 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_SAMA5D3XEK_USBHOST_PRIO,
ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D3XEK_USBHOST_PRIO,
CONFIG_SAMA5D3XEK_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -284,7 +284,6 @@ void weak_function sam_usbinitialize(void)
#ifdef HAVE_USBHOST
int sam_usbhost_initialize(void)
{
pid_t pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -345,10 +344,10 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("OHCI Monitor", CONFIG_SAMA5D4EK_USBHOST_PRIO,
ret = kthread_create("OHCI Monitor", CONFIG_SAMA5D4EK_USBHOST_PRIO,
CONFIG_SAMA5D4EK_USBHOST_STACKSIZE,
(main_t)ohci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
return -ENODEV;
@ -367,10 +366,10 @@ int sam_usbhost_initialize(void)
/* Start a thread to handle device connection. */
pid = kthread_create("EHCI Monitor", CONFIG_SAMA5D4EK_USBHOST_PRIO,
ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D4EK_USBHOST_PRIO,
CONFIG_SAMA5D4EK_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL);
if (pid < 0)
if (ret < 0)
{
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
return -ENODEV;

View file

@ -171,7 +171,6 @@ void sam_usbhost_vbusdrive(int iface, bool enable)
#ifdef CONFIG_USBHOST
int samd_usbhost_initialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -219,11 +218,10 @@ int samd_usbhost_initialize(void)
/* Start a thread to handle device connection. */
uinfo("Start usbhost_waiter\n");
pid =
kthread_create("usbhost", CONFIG_METRO_M4_USBHOST_PRIO,
CONFIG_METRO_M4_USBHOST_STACKSIZE,
(main_t) usbhost_waiter, (FAR char *const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
ret = kthread_create("usbhost", CONFIG_METRO_M4_USBHOST_PRIO,
CONFIG_METRO_M4_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char *const *)NULL);
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -203,7 +203,6 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -251,11 +250,10 @@ int stm32_usbhost_initialize(void)
/* Start a thread to handle device connection. */
uinfo("Start usbhost_waiter\n");
pid =
kthread_create("usbhost", CONFIG_AXOLOTI_USBHOST_PRIO,
CONFIG_AXOLOTI_USBHOST_STACKSIZE,
(main_t) usbhost_waiter, (FAR char *const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
ret = kthread_create("usbhost", CONFIG_AXOLOTI_USBHOST_PRIO,
CONFIG_AXOLOTI_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char *const *)NULL);
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -160,7 +160,6 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -199,10 +198,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -160,7 +160,6 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -199,10 +198,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -157,11 +157,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -229,10 +225,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_NUCLEOF207ZG_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_NUCLEOF207ZG_USBHOST_PRIO,
CONFIG_NUCLEOF207ZG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -170,12 +170,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE) || \
defined(CONFIG_USBHOST_XBOXCONTROLLER)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -253,10 +248,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F411DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32F411DISCO_USBHOST_PRIO,
CONFIG_STM32F411DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -235,7 +235,7 @@ typedef struct
fault_flags_t flags; /* What is in the dump */
uintptr_t current_regs; /* Used to validate the dump */
int lineno; /* __LINE__ to up_assert */
int pid; /* Process ID */
pid_t pid; /* Process ID */
uint32_t regs[XCPTCONTEXT_REGS]; /* Interrupt register save area */
stack_t stacks; /* Stack info */
#if CONFIG_TASK_NAME_SIZE > 0

View file

@ -156,11 +156,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -228,10 +224,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -155,11 +155,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -227,10 +223,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -157,7 +157,6 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -206,10 +205,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32H407_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32H407_USBHOST_PRIO,
CONFIG_STM32H407_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -159,10 +159,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_STM32_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || defined(CONFIG_USBHOST_CDCACM)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -210,10 +207,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -156,7 +156,6 @@ void stm32_usb_configure(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_setup(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -215,8 +214,6 @@ int stm32_usbhost_setup(void)
}
#endif
UNUSED(ret);
/* Then get an instance of the USB host interface */
uinfo("Initialize USB host\n");
@ -227,10 +224,10 @@ int stm32_usbhost_setup(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_OLIMEXP407_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_OLIMEXP407_USBHOST_PRIO,
CONFIG_OLIMEXP407_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -154,12 +154,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE) || \
defined(CONFIG_USBHOST_XBOXCONTROLLER)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -237,10 +232,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_OMNIBUSF4_USBHOST_PRIO,
CONFIG_OMNIBUSF4_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
ret = kthread_create("usbhost", CONFIG_OMNIBUSF4_USBHOST_PRIO,
CONFIG_OMNIBUSF4_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -160,7 +160,6 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -199,10 +198,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -160,7 +160,6 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -199,10 +198,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -160,7 +160,6 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -199,10 +198,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -152,12 +152,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE) || \
defined(CONFIG_USBHOST_XBOXCONTROLLER)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -235,10 +230,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F411MINIMUM_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32F411MINIMUM_USBHOST_PRIO,
CONFIG_STM32F411MINIMUM_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -171,12 +171,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE) || \
defined(CONFIG_USBHOST_XBOXCONTROLLER)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -254,10 +249,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F411DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32F411DISCO_USBHOST_PRIO,
CONFIG_STM32F411DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -156,7 +156,6 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -205,10 +204,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F429IDISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32F429IDISCO_USBHOST_PRIO,
CONFIG_STM32F429IDISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -156,12 +156,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE) || \
defined(CONFIG_USBHOST_XBOXCONTROLLER)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -239,10 +234,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
ret = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -276,7 +276,6 @@ static int usbhost_detect(int argc, FAR char *argv[])
int stm32_max3421e_setup(void)
{
FAR struct spi_dev_s *spi;
pid_t monpid;
int ret;
/* Configure the MAX3421E interrupt pin as an input and the reset and power
@ -396,13 +395,13 @@ int stm32_max3421e_setup(void)
/* Start the USB connection monitor kernel thread */
monpid = kthread_create("MAX3421E ConnMon",
CONFIG_VIEWTOOL_MAX3421E_CONNMON_PRIORITY,
CONFIG_VIEWTOOL_MAX3421E_CONNMON_STACKSIZE,
usbhost_detect, NULL);
if (monpid < 0)
ret = kthread_create("MAX3421E ConnMon",
CONFIG_VIEWTOOL_MAX3421E_CONNMON_PRIORITY,
CONFIG_VIEWTOOL_MAX3421E_CONNMON_STACKSIZE,
usbhost_detect, NULL);
if (ret < 0)
{
uerr("ERROR: Failed to start connection monitor: %d\n", monpid);
uerr("ERROR: Failed to start connection monitor: %d\n", ret);
}
return OK;

View file

@ -157,11 +157,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -229,10 +225,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -159,11 +159,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -231,10 +227,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F7F4DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32F7F4DISCO_USBHOST_PRIO,
CONFIG_STM32F7F4DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -157,11 +157,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -229,10 +225,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_NUCLEOH743ZI_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_NUCLEOH743ZI_USBHOST_PRIO,
CONFIG_NUCLEOH743ZI_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -157,11 +157,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -229,10 +225,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -148,11 +148,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -220,10 +216,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32H747XI_DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32H747XI_DISCO_USBHOST_PRIO,
CONFIG_STM32H747XI_DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -157,11 +157,7 @@ void stm32_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -229,10 +225,10 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -156,11 +156,7 @@ void stm32l4_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32l4_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -228,10 +224,10 @@ int stm32l4_usbhost_initialize(void)
uvdbg("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32L4DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32L4DISCO_USBHOST_PRIO,
CONFIG_STM32L4DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -156,11 +156,7 @@ void stm32l4_usbinitialize(void)
#ifdef CONFIG_USBHOST
int stm32l4_usbhost_initialize(void)
{
int pid;
#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \
defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
int ret;
#endif
/* First, register all of the class drivers needed to support the drivers
* that we care about:
@ -228,10 +224,10 @@ int stm32l4_usbhost_initialize(void)
uvdbg("Start usbhost_waiter\n");
pid = kthread_create("usbhost", CONFIG_STM32L4DISCO_USBHOST_PRIO,
ret = kthread_create("usbhost", CONFIG_STM32L4DISCO_USBHOST_PRIO,
CONFIG_STM32L4DISCO_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -259,7 +259,6 @@ errout:
#ifdef NSH_HAVEUSBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -301,10 +300,10 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_INFO, "Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -272,7 +272,6 @@ errout:
#ifdef NSH_HAVEUSBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -314,10 +313,10 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_INFO, "Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -271,7 +271,6 @@ errout:
#ifdef NSH_HAVE_USBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -314,10 +313,10 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_INFO, "Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -149,7 +149,6 @@ static int nsh_waiter(int argc, char *argv[])
#ifdef NSH_HAVE_USBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -210,11 +209,11 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_INFO, "Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
syslog(LOG_INFO, "USBHost: Created pid = %d\n", pid);
return pid < 0 ? -ENOEXEC : OK;
syslog(LOG_INFO, "USBHost: Created pid = %d\n", ret);
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -184,7 +184,7 @@ typedef struct
fault_flags_t flags; /* What is in the dump */
uintptr_t current_regs; /* Used to validate the dump */
int lineno; /* __LINE__ to up_assert */
int pid; /* Process ID */
pid_t pid; /* Process ID */
uint32_t regs[XCPTCONTEXT_REGS]; /* Interrupt register save area */
stack_t stacks; /* Stack info */
#if CONFIG_TASK_NAME_SIZE > 0

View file

@ -146,7 +146,6 @@ static int nsh_waiter(int argc, char *argv[])
#ifdef NSH_HAVE_USBHOST
static int nsh_usbhostinitialize(void)
{
int pid;
int ret;
/* First, register all of the class drivers needed to support the drivers
@ -209,11 +208,11 @@ static int nsh_usbhostinitialize(void)
syslog(LOG_INFO, "Start nsh_waiter\n");
pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
syslog(LOG_INFO, "USBHost: Created pid = %d\n", pid);
return pid < 0 ? -ENOEXEC : OK;
syslog(LOG_INFO, "USBHost: Created pid = %d\n", ret);
return ret < 0 ? -ENOEXEC : OK;
}
return -ENODEV;

View file

@ -184,7 +184,7 @@ typedef struct
fault_flags_t flags; /* What is in the dump */
uintptr_t current_regs; /* Used to validate the dump */
int lineno; /* __LINE__ to up_assert */
int pid; /* Process ID */
pid_t pid; /* Process ID */
uint32_t regs[XCPTCONTEXT_REGS]; /* Interrupt register save area */
stack_t stacks; /* Stack info */
#if CONFIG_TASK_NAME_SIZE > 0

Some files were not shown because too many files have changed in this diff Show more