mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling 1. Add semaphore uninterruptible wait function 2 .Replace semaphore wait loop with a single uninterruptible wait 3. Replace all sem_xxx to nxsem_xxx * Unify the void cast usage 1. Remove void cast for function because many place ignore the returned value witout cast 2. Replace void cast for variable with UNUSED macro
This commit is contained in:
@@ -156,7 +156,7 @@ void up_irqinitialize(void)
|
||||
{
|
||||
putreg32(0x00000000, A1X_INTC_EN(i)); /* 0 disables corresponding interrupt */
|
||||
putreg32(0xffffffff, A1X_INTC_MASK(i)); /* 1 masks corresponding interrupt */
|
||||
(void)getreg32(A1X_INTC_IRQ_PEND(i)); /* Reading status clears pending interrupts */
|
||||
getreg32(A1X_INTC_IRQ_PEND(i)); /* Reading status clears pending interrupts */
|
||||
}
|
||||
|
||||
/* Set the interrupt base address to zero. We do not use the vectored
|
||||
@@ -178,7 +178,7 @@ void up_irqinitialize(void)
|
||||
|
||||
/* And finally, enable interrupts */
|
||||
|
||||
(void)up_irq_enable();
|
||||
up_irq_enable();
|
||||
#endif
|
||||
|
||||
a1x_dumpintc("initial", 0);
|
||||
|
||||
@@ -163,7 +163,7 @@ static int a1x_pio_interrupt(int irq, void *context)
|
||||
{
|
||||
/* Yes.. dispatch the interrupt */
|
||||
|
||||
(void)arm_doirq(irq, regs);
|
||||
arm_doirq(irq, regs);
|
||||
}
|
||||
|
||||
irq++;
|
||||
|
||||
@@ -1528,31 +1528,31 @@ void up_earlyserialinit(void)
|
||||
void up_serialinit(void)
|
||||
{
|
||||
#ifdef CONSOLE_DEV
|
||||
(void)uart_register("/dev/console", &CONSOLE_DEV);
|
||||
uart_register("/dev/console", &CONSOLE_DEV);
|
||||
#endif
|
||||
#ifdef TTYS0_DEV
|
||||
(void)uart_register("/dev/ttyS0", &TTYS0_DEV);
|
||||
uart_register("/dev/ttyS0", &TTYS0_DEV);
|
||||
#endif
|
||||
#ifdef TTYS1_DEV
|
||||
(void)uart_register("/dev/ttyS1", &TTYS1_DEV);
|
||||
uart_register("/dev/ttyS1", &TTYS1_DEV);
|
||||
#endif
|
||||
#ifdef TTYS2_DEV
|
||||
(void)uart_register("/dev/ttyS2", &TTYS2_DEV);
|
||||
uart_register("/dev/ttyS2", &TTYS2_DEV);
|
||||
#endif
|
||||
#ifdef TTYS3_DEV
|
||||
(void)uart_register("/dev/ttyS3", &TTYS3_DEV);
|
||||
uart_register("/dev/ttyS3", &TTYS3_DEV);
|
||||
#endif
|
||||
#ifdef TTYS4_DEV
|
||||
(void)uart_register("/dev/ttyS4", &TTYS4_DEV);
|
||||
uart_register("/dev/ttyS4", &TTYS4_DEV);
|
||||
#endif
|
||||
#ifdef TTYS5_DEV
|
||||
(void)uart_register("/dev/ttyS5", &TTYS5_DEV);
|
||||
uart_register("/dev/ttyS5", &TTYS5_DEV);
|
||||
#endif
|
||||
#ifdef TTYS6_DEV
|
||||
(void)uart_register("/dev/ttyS6", &TTYS6_DEV);
|
||||
uart_register("/dev/ttyS6", &TTYS6_DEV);
|
||||
#endif
|
||||
#ifdef TTYS7_DEV
|
||||
(void)uart_register("/dev/ttyS7", &TTYS7_DEV);
|
||||
uart_register("/dev/ttyS7", &TTYS7_DEV);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(A1X_IRQ_TIMER0, (xcpt_t)a1x_timerisr, NULL);
|
||||
irq_attach(A1X_IRQ_TIMER0, (xcpt_t)a1x_timerisr, NULL);
|
||||
|
||||
/* Enable interrupts from the TIMER 0 port */
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ void am335x_gpio_irqinitialize(void)
|
||||
|
||||
/* Attach and enable the GPIO0 IRQ */
|
||||
|
||||
(void)irq_attach(AM335X_IRQ_GPIO0A, am335x_gpio0_interrupt, NULL);
|
||||
irq_attach(AM335X_IRQ_GPIO0A, am335x_gpio0_interrupt, NULL);
|
||||
up_enable_irq(AM335X_IRQ_GPIO0A);
|
||||
#endif
|
||||
|
||||
@@ -284,7 +284,7 @@ void am335x_gpio_irqinitialize(void)
|
||||
|
||||
/* Attach and enable the GPIO1 IRQ */
|
||||
|
||||
(void)irq_attach(AM335X_IRQ_GPIO1A, am335x_gpio1_interrupt, NULL);
|
||||
irq_attach(AM335X_IRQ_GPIO1A, am335x_gpio1_interrupt, NULL);
|
||||
up_enable_irq(AM335X_IRQ_GPIO1A);
|
||||
#endif
|
||||
|
||||
@@ -309,7 +309,7 @@ void am335x_gpio_irqinitialize(void)
|
||||
|
||||
/* Attach and enable the GPIO2 IRQ */
|
||||
|
||||
(void)irq_attach(AM335X_IRQ_GPIO2A, am335x_gpio2_interrupt, NULL);
|
||||
irq_attach(AM335X_IRQ_GPIO2A, am335x_gpio2_interrupt, NULL);
|
||||
up_enable_irq(AM335X_IRQ_GPIO2A);
|
||||
#endif
|
||||
|
||||
@@ -334,7 +334,7 @@ void am335x_gpio_irqinitialize(void)
|
||||
|
||||
/* Attach and enable the GPIO3 IRQ */
|
||||
|
||||
(void)irq_attach(AM335X_IRQ_GPIO3A, am335x_gpio3_interrupt, NULL);
|
||||
irq_attach(AM335X_IRQ_GPIO3A, am335x_gpio3_interrupt, NULL);
|
||||
up_enable_irq(AM335X_IRQ_GPIO3A);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -131,8 +131,8 @@ void up_irqinitialize(void)
|
||||
for (i = 0; i < AM335X_IRQ_NINT; i += 32)
|
||||
{
|
||||
putreg32(0xffffffff, AM335X_INTC_MIR_SET(i)); /* 1 masks corresponding interrupt */
|
||||
(void)getreg32(AM335X_INTC_PEND_IRQ(i)); /* Reading status clears pending interrupts */
|
||||
(void)getreg32(AM335X_INTC_PEND_FIQ(i)); /* Reading status clears pending interrupts */
|
||||
getreg32(AM335X_INTC_PEND_IRQ(i)); /* Reading status clears pending interrupts */
|
||||
getreg32(AM335X_INTC_PEND_FIQ(i)); /* Reading status clears pending interrupts */
|
||||
}
|
||||
|
||||
/* currents_regs is non-NULL only while processing an interrupt */
|
||||
@@ -150,7 +150,7 @@ void up_irqinitialize(void)
|
||||
|
||||
/* And finally, enable interrupts */
|
||||
|
||||
(void)up_irq_enable();
|
||||
up_irq_enable();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -585,7 +585,7 @@ int am335x_lcd_initialize(FAR const struct am335x_panel_info_s *panel)
|
||||
|
||||
/* Initialize the device state singleton */
|
||||
|
||||
sem_init(&priv->exclsem, 0, 1);
|
||||
nxsem_init(&priv->exclsem, 0, 1);
|
||||
memcpy(&priv->panel, panel, sizeof(struct am335x_panel_info_s));
|
||||
|
||||
/* Save framebuffer information */
|
||||
|
||||
@@ -1347,25 +1347,25 @@ void up_earlyserialinit(void)
|
||||
void up_serialinit(void)
|
||||
{
|
||||
#ifdef CONSOLE_DEV
|
||||
(void)uart_register("/dev/console", &CONSOLE_DEV);
|
||||
uart_register("/dev/console", &CONSOLE_DEV);
|
||||
#endif
|
||||
#ifdef TTYS0_DEV
|
||||
(void)uart_register("/dev/ttyS0", &TTYS0_DEV);
|
||||
uart_register("/dev/ttyS0", &TTYS0_DEV);
|
||||
#endif
|
||||
#ifdef TTYS1_DEV
|
||||
(void)uart_register("/dev/ttyS1", &TTYS1_DEV);
|
||||
uart_register("/dev/ttyS1", &TTYS1_DEV);
|
||||
#endif
|
||||
#ifdef TTYS2_DEV
|
||||
(void)uart_register("/dev/ttyS2", &TTYS2_DEV);
|
||||
uart_register("/dev/ttyS2", &TTYS2_DEV);
|
||||
#endif
|
||||
#ifdef TTYS3_DEV
|
||||
(void)uart_register("/dev/ttyS3", &TTYS3_DEV);
|
||||
uart_register("/dev/ttyS3", &TTYS3_DEV);
|
||||
#endif
|
||||
#ifdef TTYS4_DEV
|
||||
(void)uart_register("/dev/ttyS4", &TTYS4_DEV);
|
||||
uart_register("/dev/ttyS4", &TTYS4_DEV);
|
||||
#endif
|
||||
#ifdef TTYS5_DEV
|
||||
(void)uart_register("/dev/ttyS5", &TTYS5_DEV);
|
||||
uart_register("/dev/ttyS5", &TTYS5_DEV);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(AM335X_IRQ_TIMER1_1MS, (xcpt_t)am335x_timerisr, NULL);
|
||||
irq_attach(AM335X_IRQ_TIMER1_1MS, (xcpt_t)am335x_timerisr, NULL);
|
||||
|
||||
/* Clear interrupt status */
|
||||
|
||||
@@ -193,7 +193,7 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(AM335X_IRQ_TIMER2, (xcpt_t)am335x_timerisr, NULL);
|
||||
irq_attach(AM335X_IRQ_TIMER2, (xcpt_t)am335x_timerisr, NULL);
|
||||
|
||||
/* Enable overflow interrupt */
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ static void up_dumpstate(void)
|
||||
#ifdef CONFIG_ARCH_USBDUMP
|
||||
/* Dump USB trace data */
|
||||
|
||||
(void)usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
@@ -306,13 +306,13 @@ static void _up_assert(int errorcode)
|
||||
{
|
||||
/* Flush any buffered SYSLOG data */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
/* Are we in an interrupt handler or the idle task? */
|
||||
|
||||
if (CURRENT_REGS || running_task()->flink == NULL)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
for (; ; )
|
||||
{
|
||||
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1
|
||||
@@ -353,7 +353,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (prior to the assertion) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("Assertion failed at file:%s line: %d task: %s\n",
|
||||
@@ -367,7 +367,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (from the above) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), running_task(), filename, lineno);
|
||||
|
||||
@@ -161,7 +161,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(rtcb);
|
||||
group_addrenv(rtcb);
|
||||
#endif
|
||||
/* Reset scheduler parameters */
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ void up_doirq(int irq, uint32_t *regs)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(NULL);
|
||||
group_addrenv(NULL);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -130,7 +130,7 @@ void up_release_pending(void)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(rtcb);
|
||||
group_addrenv(rtcb);
|
||||
#endif
|
||||
/* Update scheduler parameters */
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(rtcb);
|
||||
group_addrenv(rtcb);
|
||||
#endif
|
||||
/* Update scheduler parameters */
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ void up_sigdeliver(void)
|
||||
*/
|
||||
|
||||
sinfo("Resuming\n");
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
/* Modify the saved return state with the actual saved values in the
|
||||
|
||||
@@ -145,7 +145,7 @@ void up_unblock_task(struct tcb_s *tcb)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(rtcb);
|
||||
group_addrenv(rtcb);
|
||||
#endif
|
||||
/* Update scheduler parameters */
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ static void up_dumpstate(void)
|
||||
#ifdef CONFIG_ARCH_USBDUMP
|
||||
/* Dump USB trace data */
|
||||
|
||||
(void)usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
@@ -363,13 +363,13 @@ static void _up_assert(int errorcode)
|
||||
{
|
||||
/* Flush any buffered SYSLOG data */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
/* Are we in an interrupt handler or the idle task? */
|
||||
|
||||
if (CURRENT_REGS || running_task()->flink == NULL)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
for (; ; )
|
||||
{
|
||||
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1
|
||||
@@ -410,7 +410,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (prior to the assertion) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("Assertion failed at file:%s line: %d task: %s\n",
|
||||
@@ -424,7 +424,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (from the above) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), running_task(), filename, lineno);
|
||||
|
||||
@@ -134,7 +134,7 @@ int up_hardfault(int irq, FAR void *context, FAR void *arg)
|
||||
getprimask(), getipsr());
|
||||
#endif
|
||||
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
hfalert("PANIC!!! Hard fault\n");
|
||||
PANIC();
|
||||
return OK; /* Won't get here */
|
||||
|
||||
@@ -111,7 +111,7 @@ void up_sigdeliver(void)
|
||||
*/
|
||||
|
||||
sinfo("Resuming\n");
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
/* Modify the saved return state with the actual saved values in the
|
||||
|
||||
@@ -84,8 +84,8 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo,
|
||||
{
|
||||
/* Let sys_call4() do all of the work */
|
||||
|
||||
(void)sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo,
|
||||
(uintptr_t)info, (uintptr_t)ucontext);
|
||||
sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo,
|
||||
(uintptr_t)info, (uintptr_t)ucontext);
|
||||
}
|
||||
|
||||
#endif /* (CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL) && !CONFIG_DISABLE_PTHREAD */
|
||||
|
||||
@@ -375,7 +375,7 @@ static void up_dumpstate(void)
|
||||
#ifdef CONFIG_ARCH_USBDUMP
|
||||
/* Dump USB trace data */
|
||||
|
||||
(void)usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
@@ -391,7 +391,7 @@ static void _up_assert(int errorcode)
|
||||
{
|
||||
/* Flush any buffered SYSLOG data */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
/* Are we in an interrupt handler or the idle task? */
|
||||
|
||||
@@ -399,14 +399,14 @@ static void _up_assert(int errorcode)
|
||||
{
|
||||
/* Disable interrupts on this CPU */
|
||||
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
|
||||
for (; ; )
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
/* Try (again) to stop activity on other CPUs */
|
||||
|
||||
(void)spin_trylock(&g_cpu_irqlock);
|
||||
spin_trylock(&g_cpu_irqlock);
|
||||
#endif
|
||||
|
||||
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1
|
||||
@@ -449,7 +449,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (prior to the assertion) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
@@ -473,7 +473,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (from the above) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), running_task(), filename, lineno);
|
||||
|
||||
@@ -182,7 +182,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(rtcb);
|
||||
group_addrenv(rtcb);
|
||||
#endif
|
||||
/* Reset scheduler parameters */
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ static inline uint32_t *_arm_doirq(int irq, uint32_t *regs)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(NULL);
|
||||
group_addrenv(NULL);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -163,7 +163,7 @@ static int get_pgtable(FAR group_addrenv_t *addrenv, uintptr_t vaddr)
|
||||
|
||||
/* And instantiate the modified environment */
|
||||
|
||||
(void)up_addrenv_select(addrenv, NULL);
|
||||
up_addrenv_select(addrenv, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ void up_release_pending(void)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(rtcb);
|
||||
group_addrenv(rtcb);
|
||||
#endif
|
||||
/* Update scheduler parameters */
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(rtcb);
|
||||
group_addrenv(rtcb);
|
||||
#endif
|
||||
/* Update scheduler parameters */
|
||||
|
||||
|
||||
@@ -152,9 +152,9 @@ void up_sigdeliver(void)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
(void)enter_critical_section();
|
||||
enter_critical_section();
|
||||
#else
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
#endif
|
||||
|
||||
/* Restore the saved errno value */
|
||||
@@ -187,7 +187,7 @@ void up_sigdeliver(void)
|
||||
DEBUGASSERT(rtcb->irqcount == 1);
|
||||
while (rtcb->irqcount < saved_irqcount)
|
||||
{
|
||||
(void)enter_critical_section();
|
||||
enter_critical_section();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo,
|
||||
{
|
||||
/* Yes.. Let sys_call4() do all of the work to get us into user space */
|
||||
|
||||
(void)sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo,
|
||||
(uintptr_t)info, (uintptr_t)ucontext);
|
||||
sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo,
|
||||
(uintptr_t)info, (uintptr_t)ucontext);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -166,7 +166,7 @@ void up_unblock_task(struct tcb_s *tcb)
|
||||
* thread at the head of the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(rtcb);
|
||||
group_addrenv(rtcb);
|
||||
#endif
|
||||
/* Update scheduler parameters */
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ static void up_dumpstate(void)
|
||||
#ifdef CONFIG_ARCH_USBDUMP
|
||||
/* Dump USB trace data */
|
||||
|
||||
(void)usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
@@ -385,19 +385,19 @@ static void _up_assert(int errorcode)
|
||||
{
|
||||
/* Flush any buffered SYSLOG data */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
/* Are we in an interrupt handler or the idle task? */
|
||||
|
||||
if (CURRENT_REGS || (running_task())->flink == NULL)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
for (; ; )
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
/* Try (again) to stop activity on other CPUs */
|
||||
|
||||
(void)spin_trylock(&g_cpu_irqlock);
|
||||
spin_trylock(&g_cpu_irqlock);
|
||||
#endif
|
||||
|
||||
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1
|
||||
@@ -438,7 +438,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (prior to the assertion) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
@@ -462,7 +462,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (from the above) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), running_task(), filename, lineno);
|
||||
|
||||
@@ -143,7 +143,7 @@ int up_hardfault(int irq, FAR void *context, FAR void *arg)
|
||||
getreg32(NVIC_DFAULTS), getreg32(NVIC_BFAULT_ADDR),
|
||||
getreg32(NVIC_AFAULTS));
|
||||
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
_alert("PANIC!!! Hard fault: %08x\n", getreg32(NVIC_HFAULTS));
|
||||
PANIC();
|
||||
return OK;
|
||||
|
||||
@@ -186,7 +186,7 @@ void itm_syslog_initialize(void)
|
||||
|
||||
/* Setup the SYSLOG channel */
|
||||
|
||||
(void)syslog_channel(&g_itm_channel);
|
||||
syslog_channel(&g_itm_channel);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARMV7M_ITMSYSLOG */
|
||||
|
||||
@@ -79,7 +79,7 @@ int up_memfault(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
/* Dump some memory management fault info */
|
||||
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
_alert("PANIC!!! Memory Management Fault:\n");
|
||||
mfinfo(" IRQ: %d context: %p\n", irq, context);
|
||||
_alert(" CFAULTS: %08x MMFAR: %08x\n",
|
||||
|
||||
@@ -156,9 +156,9 @@ void up_sigdeliver(void)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
(void)enter_critical_section();
|
||||
enter_critical_section();
|
||||
#else
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
#endif
|
||||
|
||||
/* Restore the saved errno value */
|
||||
@@ -199,7 +199,7 @@ void up_sigdeliver(void)
|
||||
DEBUGASSERT(rtcb->irqcount == 1);
|
||||
while (rtcb->irqcount < saved_irqcount)
|
||||
{
|
||||
(void)enter_critical_section();
|
||||
enter_critical_section();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -84,8 +84,8 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo,
|
||||
{
|
||||
/* Let sys_call4() do all of the work */
|
||||
|
||||
(void)sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo,
|
||||
(uintptr_t)info, (uintptr_t)ucontext);
|
||||
sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo,
|
||||
(uintptr_t)info, (uintptr_t)ucontext);
|
||||
}
|
||||
|
||||
#endif /* (CONFIG_BUILD_PROTECTED || CONFIG_BUILD_KERNEL) && !CONFIG_DISABLE_PTHREAD */
|
||||
|
||||
@@ -354,7 +354,7 @@ static void up_dumpstate(void)
|
||||
#ifdef CONFIG_ARCH_USBDUMP
|
||||
/* Dump USB trace data */
|
||||
|
||||
(void)usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
usbtrace_enumerate(assert_tracecallback, NULL);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
@@ -370,13 +370,13 @@ static void _up_assert(int errorcode)
|
||||
{
|
||||
/* Flush any buffered SYSLOG data */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
/* Are we in an interrupt handler or the idle task? */
|
||||
|
||||
if (CURRENT_REGS || (running_task())->flink == NULL)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
for (; ; )
|
||||
{
|
||||
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1
|
||||
@@ -417,7 +417,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (prior to the assertion) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("Assertion failed at file:%s line: %d task: %s\n",
|
||||
@@ -431,7 +431,7 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
/* Flush any buffered SYSLOG data (from the above) */
|
||||
|
||||
(void)syslog_flush();
|
||||
syslog_flush();
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), running_task(), filename, lineno);
|
||||
|
||||
@@ -106,7 +106,7 @@ void up_sigdeliver(void)
|
||||
*/
|
||||
|
||||
sinfo("Resuming\n");
|
||||
(void)up_irq_save();
|
||||
up_irq_save();
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
/* Modify the saved return state with the actual saved values in the
|
||||
|
||||
@@ -93,8 +93,8 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo,
|
||||
{
|
||||
/* Yes.. Let sys_call4() do all of the work to get us into user space */
|
||||
|
||||
(void)sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo,
|
||||
(uintptr_t)info, (uintptr_t)ucontext);
|
||||
sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo,
|
||||
(uintptr_t)info, (uintptr_t)ucontext);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -989,8 +989,8 @@ static int c5471_transmit(struct c5471_driver_s *priv)
|
||||
|
||||
/* Setup the TX timeout watchdog (perhaps restarting the timer) */
|
||||
|
||||
(void)wd_start(priv->c_txtimeout, C5471_TXTIMEOUT,
|
||||
c5471_txtimeout_expiry, 1, (wdparm_t)priv);
|
||||
wd_start(priv->c_txtimeout, C5471_TXTIMEOUT,
|
||||
c5471_txtimeout_expiry, 1, (wdparm_t)priv);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1539,7 +1539,7 @@ static void c5471_txdone(struct c5471_driver_s *priv)
|
||||
|
||||
/* Then poll the network for new XMIT data */
|
||||
|
||||
(void)devif_poll(&priv->c_dev, c5471_txpoll);
|
||||
devif_poll(&priv->c_dev, c5471_txpoll);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -1707,7 +1707,7 @@ static void c5471_txtimeout_work(FAR void *arg)
|
||||
|
||||
/* Then poll the network for new XMIT data */
|
||||
|
||||
(void)devif_poll(&priv->c_dev, c5471_txpoll);
|
||||
devif_poll(&priv->c_dev, c5471_txpoll);
|
||||
net_unlock();
|
||||
}
|
||||
|
||||
@@ -1778,13 +1778,13 @@ static void c5471_poll_work(FAR void *arg)
|
||||
{
|
||||
/* If so, update TCP timing states and poll the network for new XMIT data */
|
||||
|
||||
(void)devif_timer(&priv->c_dev, C5471_WDDELAY, c5471_txpoll);
|
||||
devif_timer(&priv->c_dev, C5471_WDDELAY, c5471_txpoll);
|
||||
}
|
||||
|
||||
/* Setup the watchdog poll timer again */
|
||||
|
||||
(void)wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry, 1,
|
||||
(wdparm_t)priv);
|
||||
wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry, 1,
|
||||
(wdparm_t)priv);
|
||||
net_unlock();
|
||||
}
|
||||
|
||||
@@ -1870,8 +1870,8 @@ static int c5471_ifup(struct net_driver_s *dev)
|
||||
|
||||
/* Set and activate a timer process */
|
||||
|
||||
(void)wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry,
|
||||
1, (wdparm_t)priv);
|
||||
wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry,
|
||||
1, (wdparm_t)priv);
|
||||
|
||||
/* Enable the Ethernet interrupt */
|
||||
|
||||
@@ -1969,7 +1969,7 @@ static void c5471_txavail_work(FAR void *arg)
|
||||
{
|
||||
/* If so, then poll the network for new XMIT data */
|
||||
|
||||
(void)devif_poll(&priv->c_dev, c5471_txpoll);
|
||||
devif_poll(&priv->c_dev, c5471_txpoll);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2458,7 +2458,7 @@ void up_netinitialize(void)
|
||||
|
||||
/* Register the device with the OS so that socket IOCTLs can be performed */
|
||||
|
||||
(void)netdev_register(&g_c5471[0].c_dev, NET_LL_ETHERNET);
|
||||
netdev_register(&g_c5471[0].c_dev, NET_LL_ETHERNET);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NET */
|
||||
|
||||
@@ -823,9 +823,9 @@ void up_earlyserialinit(void)
|
||||
|
||||
void up_serialinit(void)
|
||||
{
|
||||
(void)uart_register("/dev/console", &CONSOLE_DEV);
|
||||
(void)uart_register("/dev/ttyS0", &TTYS0_DEV);
|
||||
(void)uart_register("/dev/ttyS1", &TTYS1_DEV);
|
||||
uart_register("/dev/console", &CONSOLE_DEV);
|
||||
uart_register("/dev/ttyS0", &TTYS0_DEV);
|
||||
uart_register("/dev/ttyS1", &TTYS1_DEV);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -148,7 +148,7 @@ void _exit(int status)
|
||||
* The IRQ state will be restored when the next task is started.
|
||||
*/
|
||||
|
||||
(void)enter_critical_section();
|
||||
enter_critical_section();
|
||||
|
||||
sinfo("TCB=%p exiting\n", tcb);
|
||||
|
||||
@@ -163,7 +163,7 @@ void _exit(int status)
|
||||
|
||||
/* Destroy the task at the head of the ready to run list. */
|
||||
|
||||
(void)nxtask_exit();
|
||||
nxtask_exit();
|
||||
|
||||
/* Now, perform the context switch to the new ready-to-run task at the
|
||||
* head of the list.
|
||||
@@ -178,7 +178,7 @@ void _exit(int status)
|
||||
* the ready-to-run list.
|
||||
*/
|
||||
|
||||
(void)group_addrenv(tcb);
|
||||
group_addrenv(tcb);
|
||||
#endif
|
||||
|
||||
/* Reset scheduler parameters */
|
||||
|
||||
@@ -221,7 +221,7 @@ void up_initialize(void)
|
||||
#ifdef CONFIG_PSEUDOTERM_SUSV1
|
||||
/* Register the master pseudo-terminal multiplexor device */
|
||||
|
||||
(void)ptmx_register();
|
||||
ptmx_register();
|
||||
#endif
|
||||
|
||||
/* Early initialization of the system logging device. Some SYSLOG channel
|
||||
@@ -250,19 +250,19 @@ void up_initialize(void)
|
||||
#ifdef CONFIG_NETDEV_LOOPBACK
|
||||
/* Initialize the local loopback device */
|
||||
|
||||
(void)localhost_initialize();
|
||||
localhost_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_TUN
|
||||
/* Initialize the TUN device */
|
||||
|
||||
(void)tun_initialize();
|
||||
tun_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NETDEV_TELNET
|
||||
/* Initialize the Telnet session factory */
|
||||
|
||||
(void)telnet_initialize();
|
||||
telnet_initialize();
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST)
|
||||
|
||||
@@ -323,5 +323,5 @@ static ssize_t lwlconsole_write(struct file *filep, const char *buffer,
|
||||
void lwlconsole_init(void)
|
||||
{
|
||||
g_d.upword = 0;
|
||||
(void)register_driver("/dev/console", &g_consoleops, 0666, NULL);
|
||||
register_driver("/dev/console", &g_consoleops, 0666, NULL);
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ static int adc_stop(adc_ch_t ch, FAR struct seq_s *seq)
|
||||
return OK;
|
||||
}
|
||||
|
||||
(void) seq_ioctl(seq, 0, SCUIOC_STOP, 0);
|
||||
seq_ioctl(seq, 0, SCUIOC_STOP, 0);
|
||||
|
||||
if (ch <= CH3)
|
||||
{
|
||||
@@ -1006,11 +1006,7 @@ void cxd56_adc_getinterval(int adctype, uint32_t *interval, uint16_t *adjust)
|
||||
|
||||
int cxd56_adcinitialize(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* Avoid warnings when no ADC options enabled */
|
||||
|
||||
(void) ret;
|
||||
int ret = OK;
|
||||
|
||||
#if defined (CONFIG_CXD56_LPADC0) || defined (CONFIG_CXD56_LPADC0_1) || defined (CONFIG_CXD56_LPADC_ALL)
|
||||
ret = register_driver("/dev/lpadc0", &g_adcops, 0666, &g_lpadc0priv);
|
||||
@@ -1061,5 +1057,5 @@ int cxd56_adcinitialize(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ static int charger_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct charger_dev_s *priv = inode->i_private;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
sem_wait(&priv->batsem);
|
||||
nxsem_wait(&priv->batsem);
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
@@ -621,7 +621,7 @@ static int charger_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
break;
|
||||
}
|
||||
|
||||
sem_post(&priv->batsem);
|
||||
nxsem_post(&priv->batsem);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -650,7 +650,7 @@ int cxd56_charger_initialize(FAR const char *devpath)
|
||||
|
||||
/* Initialize the CXD5247 device structure */
|
||||
|
||||
sem_init(&priv->batsem, 0, 1);
|
||||
nxsem_init(&priv->batsem, 0, 1);
|
||||
|
||||
/* Register battery driver */
|
||||
|
||||
@@ -680,8 +680,7 @@ int cxd56_charger_initialize(FAR const char *devpath)
|
||||
|
||||
int cxd56_charger_uninitialize(FAR const char *devpath)
|
||||
{
|
||||
(void) unregister_driver(devpath);
|
||||
|
||||
unregister_driver(devpath);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ static void clock_semtake(sem_t *id)
|
||||
{
|
||||
if (!up_interrupt_context())
|
||||
{
|
||||
sem_wait(id);
|
||||
nxsem_wait(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ static void clock_semgive(sem_t *id)
|
||||
{
|
||||
if (!up_interrupt_context())
|
||||
{
|
||||
sem_post(id);
|
||||
nxsem_post(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
int up_cpu_idlestack(int cpu, FAR struct tcb_s *tcb, size_t stack_size)
|
||||
{
|
||||
#if CONFIG_SMP_NCPUS > 1
|
||||
(void)up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL);
|
||||
up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL);
|
||||
#endif
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ static void appdsp_boot(void)
|
||||
|
||||
/* Then transfer control to the IDLE task */
|
||||
|
||||
(void)nx_idle_task(0, NULL);
|
||||
nx_idle_task(0, NULL);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -677,7 +677,7 @@ void weak_function up_dma_initialize(void)
|
||||
g_dmach[i].chan = i;
|
||||
}
|
||||
|
||||
sem_init(&g_dmaexc, 0, 1);
|
||||
nxsem_init(&g_dmaexc, 0, 1);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -711,7 +711,7 @@ DMA_HANDLE cxd56_dmachannel(int ch, ssize_t maxsize)
|
||||
|
||||
/* Get exclusive access to allocate channel */
|
||||
|
||||
sem_wait(&g_dmaexc);
|
||||
nxsem_wait(&g_dmaexc);
|
||||
|
||||
if (ch < 0 || ch >= NCHANNELS)
|
||||
{
|
||||
@@ -754,12 +754,12 @@ DMA_HANDLE cxd56_dmachannel(int ch, ssize_t maxsize)
|
||||
|
||||
dmach->inuse = true;
|
||||
|
||||
sem_post(&g_dmaexc);
|
||||
nxsem_post(&g_dmaexc);
|
||||
|
||||
return (DMA_HANDLE)dmach;
|
||||
|
||||
err:
|
||||
sem_post(&g_dmaexc);
|
||||
nxsem_post(&g_dmaexc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -793,7 +793,7 @@ void cxd56_dmafree(DMA_HANDLE handle)
|
||||
return;
|
||||
}
|
||||
|
||||
sem_wait(&g_dmaexc);
|
||||
nxsem_wait(&g_dmaexc);
|
||||
|
||||
if (!dmach->inuse)
|
||||
{
|
||||
@@ -811,7 +811,7 @@ void cxd56_dmafree(DMA_HANDLE handle)
|
||||
dmach->inuse = false;
|
||||
|
||||
err:
|
||||
sem_post(&g_dmaexc);
|
||||
nxsem_post(&g_dmaexc);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -132,15 +132,12 @@ struct cxd56_emmc_state_s g_emmcdev;
|
||||
|
||||
static void emmc_takesem(FAR sem_t *sem)
|
||||
{
|
||||
while (sem_wait(sem) != 0)
|
||||
{
|
||||
ASSERT(errno == EINTR);
|
||||
}
|
||||
nxsem_wait_uninterruptible(sem);
|
||||
}
|
||||
|
||||
static void emmc_givesem(FAR sem_t *sem)
|
||||
{
|
||||
sem_post(sem);
|
||||
nxsem_post(sem);
|
||||
}
|
||||
|
||||
static void emmc_cmdstarted(void)
|
||||
@@ -908,8 +905,8 @@ int cxd56_emmcinitialize(void)
|
||||
priv = &g_emmcdev;
|
||||
|
||||
memset(priv, 0, sizeof(struct cxd56_emmc_state_s));
|
||||
sem_init(&priv->excsem, 0, 1);
|
||||
sem_init(&g_waitsem, 0, 0);
|
||||
nxsem_init(&priv->excsem, 0, 1);
|
||||
nxsem_init(&g_waitsem, 0, 0);
|
||||
|
||||
ret = emmc_hwinitialize();
|
||||
if (ret != OK)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user