diff options
Diffstat (limited to 'nuttx/arch/arm/src')
56 files changed, 391 insertions, 483 deletions
diff --git a/nuttx/arch/arm/src/arm/up_assert.c b/nuttx/arch/arm/src/arm/up_assert.c index e5bf00d6e..03f6e4d8f 100644 --- a/nuttx/arch/arm/src/arm/up_assert.c +++ b/nuttx/arch/arm/src/arm/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_assert.c * - * Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -291,6 +291,7 @@ void up_assert(const uint8_t *filename, int lineno) #endif up_ledon(LED_ASSERTION); + #ifdef CONFIG_PRINT_TASKNAME lldbg("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); @@ -301,26 +302,3 @@ void up_assert(const uint8_t *filename, int lineno) up_dumpstate(); _up_assert(EXIT_FAILURE); } - -/**************************************************************************** - * Name: up_assert_code - ****************************************************************************/ - -void up_assert_code(const uint8_t *filename, int lineno, int errorcode) -{ -#ifdef CONFIG_PRINT_TASKNAME - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; -#endif - - up_ledon(LED_ASSERTION); - -#ifdef CONFIG_PRINT_TASKNAME - lldbg("Assertion failed at file:%s line: %d task: %s error code: %d\n", - filename, lineno, rtcb->name, errorcode); -#else - lldbg("Assertion failed at file:%s line: %d error code: %d\n", - filename, lineno, errorcode); -#endif - up_dumpstate(); - _up_assert(errorcode); -} diff --git a/nuttx/arch/arm/src/arm/up_blocktask.c b/nuttx/arch/arm/src/arm/up_blocktask.c index 090cc6407..04caa4481 100644 --- a/nuttx/arch/arm/src/arm/up_blocktask.c +++ b/nuttx/arch/arm/src/arm/up_blocktask.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_blocktask.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -86,82 +86,77 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { + struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + bool switch_needed; + /* Verify that the context switch can be performed */ - if ((tcb->task_state < FIRST_READY_TO_RUN_STATE) || - (tcb->task_state > LAST_READY_TO_RUN_STATE)) - { - PANIC(OSERR_BADBLOCKSTATE); - } - else - { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; - bool switch_needed; - - /* Remove the tcb task from the ready-to-run list. If we - * are blocking the task at the head of the task list (the - * most likely case), then a context switch to the next - * ready-to-run task is needed. In this case, it should - * also be true that rtcb == tcb. - */ + ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) && + (tcb->task_state <= LAST_READY_TO_RUN_STATE)); - switch_needed = sched_removereadytorun(tcb); + /* Remove the tcb task from the ready-to-run list. If we + * are blocking the task at the head of the task list (the + * most likely case), then a context switch to the next + * ready-to-run task is needed. In this case, it should + * also be true that rtcb == tcb. + */ - /* Add the task to the specified blocked task list */ + switch_needed = sched_removereadytorun(tcb); - sched_addblocked(tcb, (tstate_t)task_state); + /* Add the task to the specified blocked task list */ - /* If there are any pending tasks, then add them to the g_readytorun - * task list now - */ + sched_addblocked(tcb, (tstate_t)task_state); - if (g_pendingtasks.head) - { - switch_needed |= sched_mergepending(); - } + /* If there are any pending tasks, then add them to the g_readytorun + * task list now + */ - /* Now, perform the context switch if one is needed */ + if (g_pendingtasks.head) + { + switch_needed |= sched_mergepending(); + } - if (switch_needed) + /* Now, perform the context switch if one is needed */ + + if (switch_needed) + { + /* Are we in an interrupt handler? */ + + if (current_regs) { - /* Are we in an interrupt handler? */ + /* Yes, then we have to do things differently. + * Just copy the current_regs into the OLD rtcb. + */ - if (current_regs) - { - /* Yes, then we have to do things differently. - * Just copy the current_regs into the OLD rtcb. - */ + up_savestate(rtcb->xcp.regs); - up_savestate(rtcb->xcp.regs); + /* Restore the exception context of the rtcb at the (new) head + * of the g_readytorun task list. + */ - /* Restore the exception context of the rtcb at the (new) head - * of the g_readytorun task list. - */ + rtcb = (struct tcb_s*)g_readytorun.head; - rtcb = (struct tcb_s*)g_readytorun.head; + /* Then switch contexts */ - /* Then switch contexts */ + up_restorestate(rtcb->xcp.regs); + } - up_restorestate(rtcb->xcp.regs); - } + /* Copy the user C context into the TCB at the (old) head of the + * g_readytorun Task list. if up_saveusercontext returns a non-zero + * value, then this is really the previously running task restarting! + */ - /* Copy the user C context into the TCB at the (old) head of the - * g_readytorun Task list. if up_saveusercontext returns a non-zero - * value, then this is really the previously running task restarting! + else if (!up_saveusercontext(rtcb->xcp.regs)) + { + /* Restore the exception context of the rtcb at the (new) head + * of the g_readytorun task list. */ - else if (!up_saveusercontext(rtcb->xcp.regs)) - { - /* Restore the exception context of the rtcb at the (new) head - * of the g_readytorun task list. - */ - - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s*)g_readytorun.head; - /* Then switch contexts */ + /* Then switch contexts */ - up_fullcontextrestore(rtcb->xcp.regs); - } + up_fullcontextrestore(rtcb->xcp.regs); } } } diff --git a/nuttx/arch/arm/src/arm/up_dataabort.c b/nuttx/arch/arm/src/arm/up_dataabort.c index 99b3bf2ab..d5e652856 100644 --- a/nuttx/arch/arm/src/arm/up_dataabort.c +++ b/nuttx/arch/arm/src/arm/up_dataabort.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_dataabort.c * - * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -179,7 +179,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr) segfault: #endif lldbg("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr); - PANIC(OSERR_ERREXCEPTION); + PANIC(); } #else /* CONFIG_PAGING */ @@ -195,7 +195,7 @@ void up_dataabort(uint32_t *regs) /* Crash -- possibly showing diagnost debug information. */ lldbg("Data abort. PC: %08x\n", regs[REG_PC]); - PANIC(OSERR_ERREXCEPTION); + PANIC(); } #endif /* CONFIG_PAGING */ diff --git a/nuttx/arch/arm/src/arm/up_doirq.c b/nuttx/arch/arm/src/arm/up_doirq.c index 7cd1a6a1b..3b47a56b0 100644 --- a/nuttx/arch/arm/src/arm/up_doirq.c +++ b/nuttx/arch/arm/src/arm/up_doirq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_doirq.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -74,7 +74,7 @@ void up_doirq(int irq, uint32_t *regs) { up_ledon(LED_INIRQ); #ifdef CONFIG_SUPPRESS_INTERRUPTS - PANIC(OSERR_ERREXCEPTION); + PANIC(); #else uint32_t *savestate; diff --git a/nuttx/arch/arm/src/arm/up_prefetchabort.c b/nuttx/arch/arm/src/arm/up_prefetchabort.c index 541586de9..78ca496ab 100644 --- a/nuttx/arch/arm/src/arm/up_prefetchabort.c +++ b/nuttx/arch/arm/src/arm/up_prefetchabort.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/src/up_prefetchabort.c * - * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -149,6 +149,6 @@ void up_prefetchabort(uint32_t *regs) #endif { lldbg("Prefetch abort. PC: %08x\n", regs[REG_PC]); - PANIC(OSERR_ERREXCEPTION); + PANIC(); } } diff --git a/nuttx/arch/arm/src/arm/up_reprioritizertr.c b/nuttx/arch/arm/src/arm/up_reprioritizertr.c index 769794083..9d898ed7b 100644 --- a/nuttx/arch/arm/src/arm/up_reprioritizertr.c +++ b/nuttx/arch/arm/src/arm/up_reprioritizertr.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_reprioritizertr.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -98,7 +98,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) #endif ) { - PANIC(OSERR_BADREPRIORITIZESTATE); + PANIC(); } else { diff --git a/nuttx/arch/arm/src/arm/up_syscall.c b/nuttx/arch/arm/src/arm/up_syscall.c index eb9bac8ad..db3231646 100644 --- a/nuttx/arch/arm/src/arm/up_syscall.c +++ b/nuttx/arch/arm/src/arm/up_syscall.c @@ -92,5 +92,5 @@ void up_syscall(uint32_t *regs) { lldbg("Syscall from 0x%x\n", regs[REG_PC]); current_regs = regs; - PANIC(OSERR_ERREXCEPTION); + PANIC(); } diff --git a/nuttx/arch/arm/src/arm/up_unblocktask.c b/nuttx/arch/arm/src/arm/up_unblocktask.c index a2dc0f694..2e373f38e 100644 --- a/nuttx/arch/arm/src/arm/up_unblocktask.c +++ b/nuttx/arch/arm/src/arm/up_unblocktask.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_unblocktask.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -81,79 +81,74 @@ void up_unblock_task(struct tcb_s *tcb) { + struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + /* Verify that the context switch can be performed */ - if ((tcb->task_state < FIRST_BLOCKED_STATE) || - (tcb->task_state > LAST_BLOCKED_STATE)) - { - PANIC(OSERR_BADUNBLOCKSTATE); - } - else - { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) && + (tcb->task_state <= LAST_BLOCKED_STATE)); - /* Remove the task from the blocked task list */ + /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + sched_removeblocked(tcb); - /* Reset its timeslice. This is only meaningful for round - * robin tasks but it doesn't here to do it for everything - */ + /* Reset its timeslice. This is only meaningful for round + * robin tasks but it doesn't here to do it for everything + */ #if CONFIG_RR_INTERVAL > 0 - tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK; + tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK; #endif - /* Add the task in the correct location in the prioritized - * g_readytorun task list + /* Add the task in the correct location in the prioritized + * g_readytorun task list + */ + + if (sched_addreadytorun(tcb)) + { + /* The currently active task has changed! We need to do + * a context switch to the new task. + * + * Are we in an interrupt handler? */ - if (sched_addreadytorun(tcb)) + if (current_regs) { - /* The currently active task has changed! We need to do - * a context switch to the new task. - * - * Are we in an interrupt handler? + /* Yes, then we have to do things differently. + * Just copy the current_regs into the OLD rtcb. */ - if (current_regs) - { - /* Yes, then we have to do things differently. - * Just copy the current_regs into the OLD rtcb. - */ + up_savestate(rtcb->xcp.regs); - up_savestate(rtcb->xcp.regs); + /* Restore the exception context of the rtcb at the (new) head + * of the g_readytorun task list. + */ - /* Restore the exception context of the rtcb at the (new) head - * of the g_readytorun task list. - */ + rtcb = (struct tcb_s*)g_readytorun.head; - rtcb = (struct tcb_s*)g_readytorun.head; + /* Then switch contexts */ - /* Then switch contexts */ + up_restorestate(rtcb->xcp.regs); + } - up_restorestate(rtcb->xcp.regs); - } + /* We are not in an interrupt handler. Copy the user C context + * into the TCB of the task that was previously active. if + * up_saveusercontext returns a non-zero value, then this is really the + * previously running task restarting! + */ - /* We are not in an interrupt handler. Copy the user C context - * into the TCB of the task that was previously active. if - * up_saveusercontext returns a non-zero value, then this is really the - * previously running task restarting! + else if (!up_saveusercontext(rtcb->xcp.regs)) + { + /* Restore the exception context of the new task that is ready to + * run (probably tcb). This is the new rtcb at the head of the + * g_readytorun task list. */ - else if (!up_saveusercontext(rtcb->xcp.regs)) - { - /* Restore the exception context of the new task that is ready to - * run (probably tcb). This is the new rtcb at the head of the - * g_readytorun task list. - */ - - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s*)g_readytorun.head; - /* Then switch contexts */ + /* Then switch contexts */ - up_fullcontextrestore(rtcb->xcp.regs); - } + up_fullcontextrestore(rtcb->xcp.regs); } } } diff --git a/nuttx/arch/arm/src/arm/up_undefinedinsn.c b/nuttx/arch/arm/src/arm/up_undefinedinsn.c index 88e3a79d9..dd4f15e35 100644 --- a/nuttx/arch/arm/src/arm/up_undefinedinsn.c +++ b/nuttx/arch/arm/src/arm/up_undefinedinsn.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_undefinedinsn.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -77,5 +77,5 @@ void up_undefinedinsn(uint32_t *regs) { lldbg("Undefined instruction at 0x%x\n", regs[REG_PC]); current_regs = regs; - PANIC(OSERR_UNDEFINEDINSN); + PANIC(); } diff --git a/nuttx/arch/arm/src/armv6-m/up_assert.c b/nuttx/arch/arm/src/armv6-m/up_assert.c index 86347672e..3afef2dff 100644 --- a/nuttx/arch/arm/src/armv6-m/up_assert.c +++ b/nuttx/arch/arm/src/armv6-m/up_assert.c @@ -307,6 +307,7 @@ void up_assert(const uint8_t *filename, int lineno) #endif up_ledon(LED_ASSERTION); + #ifdef CONFIG_PRINT_TASKNAME lldbg("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); @@ -314,28 +315,7 @@ void up_assert(const uint8_t *filename, int lineno) lldbg("Assertion failed at file:%s line: %d\n", filename, lineno); #endif - up_dumpstate(); - _up_assert(EXIT_FAILURE); -} -/**************************************************************************** - * Name: up_assert_code - ****************************************************************************/ - -void up_assert_code(const uint8_t *filename, int lineno, int errorcode) -{ -#ifdef CONFIG_PRINT_TASKNAME - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; -#endif - - up_ledon(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME - lldbg("Assertion failed at file:%s line: %d task: %s error code: %d\n", - filename, lineno, rtcb->name, errorcode); -#else - lldbg("Assertion failed at file:%s line: %d error code: %d\n", - filename, lineno, errorcode); -#endif up_dumpstate(); - _up_assert(errorcode); + _up_assert(EXIT_FAILURE); } diff --git a/nuttx/arch/arm/src/armv6-m/up_blocktask.c b/nuttx/arch/arm/src/armv6-m/up_blocktask.c index a332cbefd..57db2b4aa 100644 --- a/nuttx/arch/arm/src/armv6-m/up_blocktask.c +++ b/nuttx/arch/arm/src/armv6-m/up_blocktask.c @@ -85,82 +85,77 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { - /* Verify that the context switch can be performed */ - - if ((tcb->task_state < FIRST_READY_TO_RUN_STATE) || - (tcb->task_state > LAST_READY_TO_RUN_STATE)) - { - PANIC(OSERR_BADBLOCKSTATE); - } - else - { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; - bool switch_needed; + struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + bool switch_needed; - /* Remove the tcb task from the ready-to-run list. If we - * are blocking the task at the head of the task list (the - * most likely case), then a context switch to the next - * ready-to-run task is needed. In this case, it should - * also be true that rtcb == tcb. - */ + /* Verify that the context switch can be performed */ - switch_needed = sched_removereadytorun(tcb); + ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) && + (tcb->task_state <= LAST_READY_TO_RUN_STATE)); - /* Add the task to the specified blocked task list */ + /* Remove the tcb task from the ready-to-run list. If we + * are blocking the task at the head of the task list (the + * most likely case), then a context switch to the next + * ready-to-run task is needed. In this case, it should + * also be true that rtcb == tcb. + */ - sched_addblocked(tcb, (tstate_t)task_state); + switch_needed = sched_removereadytorun(tcb); - /* If there are any pending tasks, then add them to the g_readytorun - * task list now - */ + /* Add the task to the specified blocked task list */ - if (g_pendingtasks.head) - { - switch_needed |= sched_mergepending(); - } + sched_addblocked(tcb, (tstate_t)task_state); - /* Now, perform the context switch if one is needed */ + /* If there are any pending tasks, then add them to the g_readytorun + * task list now + */ - if (switch_needed) - { - /* Are we in an interrupt handler? */ + if (g_pendingtasks.head) + { + switch_needed |= sched_mergepending(); + } - if (current_regs) - { - /* Yes, then we have to do things differently. - * Just copy the current_regs into the OLD rtcb. - */ + /* Now, perform the context switch if one is needed */ - up_savestate(rtcb->xcp.regs); + if (switch_needed) + { + /* Are we in an interrupt handler? */ - /* Restore the exception context of the rtcb at the (new) head - * of the g_readytorun task list. - */ + if (current_regs) + { + /* Yes, then we have to do things differently. + * Just copy the current_regs into the OLD rtcb. + */ - rtcb = (struct tcb_s*)g_readytorun.head; + up_savestate(rtcb->xcp.regs); - /* Then switch contexts */ + /* Restore the exception context of the rtcb at the (new) head + * of the g_readytorun task list. + */ - up_restorestate(rtcb->xcp.regs); - } + rtcb = (struct tcb_s*)g_readytorun.head; - /* No, then we will need to perform the user context switch */ + /* Then switch contexts */ - else - { - /* Switch context to the context of the task at the head of the - * ready to run list. - */ + up_restorestate(rtcb->xcp.regs); + } - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + /* No, then we will need to perform the user context switch */ - /* up_switchcontext forces a context switch to the task at the - * head of the ready-to-run list. It does not 'return' in the - * normal sense. When it does return, it is because the blocked - * task is again ready to run and has execution priority. - */ - } + else + { + /* Switch context to the context of the task at the head of the + * ready to run list. + */ + + struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + + /* up_switchcontext forces a context switch to the task at the + * head of the ready-to-run list. It does not 'return' in the + * normal sense. When it does return, it is because the blocked + * task is again ready to run and has execution priority. + */ } } } diff --git a/nuttx/arch/arm/src/armv6-m/up_doirq.c b/nuttx/arch/arm/src/armv6-m/up_doirq.c index 7dec21152..2edbc55dd 100644 --- a/nuttx/arch/arm/src/armv6-m/up_doirq.c +++ b/nuttx/arch/arm/src/armv6-m/up_doirq.c @@ -74,7 +74,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) { up_ledon(LED_INIRQ); #ifdef CONFIG_SUPPRESS_INTERRUPTS - PANIC(OSERR_ERREXCEPTION); + PANIC(); #else uint32_t *savestate; diff --git a/nuttx/arch/arm/src/armv6-m/up_hardfault.c b/nuttx/arch/arm/src/armv6-m/up_hardfault.c index 049f71d05..a2a0982a7 100644 --- a/nuttx/arch/arm/src/armv6-m/up_hardfault.c +++ b/nuttx/arch/arm/src/armv6-m/up_hardfault.c @@ -151,6 +151,6 @@ int up_hardfault(int irq, FAR void *context) (void)irqsave(); lldbg("PANIC!!! Hard fault\n"); - PANIC(OSERR_UNEXPECTEDISR); - return OK; + PANIC(); + return OK; /* Won't get here */ } diff --git a/nuttx/arch/arm/src/armv6-m/up_reprioritizertr.c b/nuttx/arch/arm/src/armv6-m/up_reprioritizertr.c index 0bc0d4170..07eeef14b 100644 --- a/nuttx/arch/arm/src/armv6-m/up_reprioritizertr.c +++ b/nuttx/arch/arm/src/armv6-m/up_reprioritizertr.c @@ -98,7 +98,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) #endif ) { - PANIC(OSERR_BADREPRIORITIZESTATE); + PANIC(); } else { diff --git a/nuttx/arch/arm/src/armv6-m/up_unblocktask.c b/nuttx/arch/arm/src/armv6-m/up_unblocktask.c index c496a8f43..e4bfede97 100644 --- a/nuttx/arch/arm/src/armv6-m/up_unblocktask.c +++ b/nuttx/arch/arm/src/armv6-m/up_unblocktask.c @@ -80,77 +80,72 @@ void up_unblock_task(struct tcb_s *tcb) { + struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + /* Verify that the context switch can be performed */ - if ((tcb->task_state < FIRST_BLOCKED_STATE) || - (tcb->task_state > LAST_BLOCKED_STATE)) - { - PANIC(OSERR_BADUNBLOCKSTATE); - } - else - { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) && + (tcb->task_state <= LAST_BLOCKED_STATE)); - /* Remove the task from the blocked task list */ + /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + sched_removeblocked(tcb); - /* Reset its timeslice. This is only meaningful for round - * robin tasks but it doesn't here to do it for everything - */ + /* Reset its timeslice. This is only meaningful for round + * robin tasks but it doesn't here to do it for everything + */ #if CONFIG_RR_INTERVAL > 0 - tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK; + tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK; #endif - /* Add the task in the correct location in the prioritized - * g_readytorun task list + /* Add the task in the correct location in the prioritized + * g_readytorun task list + */ + + if (sched_addreadytorun(tcb)) + { + /* The currently active task has changed! We need to do + * a context switch to the new task. + * + * Are we in an interrupt handler? */ - if (sched_addreadytorun(tcb)) + if (current_regs) { - /* The currently active task has changed! We need to do - * a context switch to the new task. - * - * Are we in an interrupt handler? + /* Yes, then we have to do things differently. + * Just copy the current_regs into the OLD rtcb. */ - if (current_regs) - { - /* Yes, then we have to do things differently. - * Just copy the current_regs into the OLD rtcb. - */ + up_savestate(rtcb->xcp.regs); - up_savestate(rtcb->xcp.regs); - - /* Restore the exception context of the rtcb at the (new) head - * of the g_readytorun task list. - */ + /* Restore the exception context of the rtcb at the (new) head + * of the g_readytorun task list. + */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s*)g_readytorun.head; - /* Then switch contexts */ + /* Then switch contexts */ - up_restorestate(rtcb->xcp.regs); - } + up_restorestate(rtcb->xcp.regs); + } - /* No, then we will need to perform the user context switch */ + /* No, then we will need to perform the user context switch */ - else - { - /* Switch context to the context of the task at the head of the - * ready to run list. - */ + else + { + /* Switch context to the context of the task at the head of the + * ready to run list. + */ - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the - * head of the ready-to-run list. It does not 'return' in the - * normal sense. When it does return, it is because the blocked - * task is again ready to run and has execution priority. - */ - } + /* up_switchcontext forces a context switch to the task at the + * head of the ready-to-run list. It does not 'return' in the + * normal sense. When it does return, it is because the blocked + * task is again ready to run and has execution priority. + */ } } } diff --git a/nuttx/arch/arm/src/armv7-m/up_assert.c b/nuttx/arch/arm/src/armv7-m/up_assert.c index b0df6d729..5d14ff34a 100644 --- a/nuttx/arch/arm/src/armv7-m/up_assert.c +++ b/nuttx/arch/arm/src/armv7-m/up_assert.c @@ -318,6 +318,7 @@ void up_assert(const uint8_t *filename, int lineno) #endif up_ledon(LED_ASSERTION); + #ifdef CONFIG_PRINT_TASKNAME lldbg("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); @@ -325,28 +326,7 @@ void up_assert(const uint8_t *filename, int lineno) lldbg("Assertion failed at file:%s line: %d\n", filename, lineno); #endif - up_dumpstate(); - _up_assert(EXIT_FAILURE); -} -/**************************************************************************** - * Name: up_assert_code - ****************************************************************************/ - -void up_assert_code(const uint8_t *filename, int lineno, int errorcode) -{ -#ifdef CONFIG_PRINT_TASKNAME - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; -#endif - - up_ledon(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME - lldbg("Assertion failed at file:%s line: %d task: %s error code: %d\n", - filename, lineno, rtcb->name, errorcode); -#else - lldbg("Assertion failed at file:%s line: %d error code: %d\n", - filename, lineno, errorcode); -#endif up_dumpstate(); - _up_assert(errorcode); + _up_assert(EXIT_FAILURE); } diff --git a/nuttx/arch/arm/src/armv7-m/up_blocktask.c b/nuttx/arch/arm/src/armv7-m/up_blocktask.c index 15558ed4d..8caf4a2b6 100644 --- a/nuttx/arch/arm/src/armv7-m/up_blocktask.c +++ b/nuttx/arch/arm/src/armv7-m/up_blocktask.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-m/up_blocktask.c * - * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -86,82 +86,77 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) { - /* Verify that the context switch can be performed */ - - if ((tcb->task_state < FIRST_READY_TO_RUN_STATE) || - (tcb->task_state > LAST_READY_TO_RUN_STATE)) - { - PANIC(OSERR_BADBLOCKSTATE); - } - else - { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; - bool switch_needed; + struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + bool switch_needed; - /* Remove the tcb task from the ready-to-run list. If we - * are blocking the task at the head of the task list (the - * most likely case), then a context switch to the next - * ready-to-run task is needed. In this case, it should - * also be true that rtcb == tcb. - */ + /* Verify that the context switch can be performed */ - switch_needed = sched_removereadytorun(tcb); + ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) && + (tcb->task_state <= LAST_READY_TO_RUN_STATE)); - /* Add the task to the specified blocked task list */ + /* Remove the tcb task from the ready-to-run list. If we + * are blocking the task at the head of the task list (the + * most likely case), then a context switch to the next + * ready-to-run task is needed. In this case, it should + * also be true that rtcb == tcb. + */ - sched_addblocked(tcb, (tstate_t)task_state); + switch_needed = sched_removereadytorun(tcb); - /* If there are any pending tasks, then add them to the g_readytorun - * task list now - */ + /* Add the task to the specified blocked task list */ - if (g_pendingtasks.head) - { - switch_needed |= sched_mergepending(); - } + sched_addblocked(tcb, (tstate_t)task_state); - /* Now, perform the context switch if one is needed */ + /* If there are any pending tasks, then add them to the g_readytorun + * task list now + */ - if (switch_needed) - { - /* Are we in an interrupt handler? */ + if (g_pendingtasks.head) + { + switch_needed |= sched_mergepending(); + } - if (current_regs) - { - /* Yes, then we have to do things differently. - * Just copy the current_regs into the OLD rtcb. - */ + /* Now, perform the context switch if one is needed */ - up_savestate(rtcb->xcp.regs); + if (switch_needed) + { + /* Are we in an interrupt handler? */ - /* Restore the exception context of the rtcb at the (new) head - * of the g_readytorun task list. - */ + if (current_regs) + { + /* Yes, then we have to do things differently. + * Just copy the current_regs into the OLD rtcb. + */ - rtcb = (struct tcb_s*)g_readytorun.head; + up_savestate(rtcb->xcp.regs); - /* Then switch contexts */ + /* Restore the exception context of the rtcb at the (new) head + * of the g_readytorun task list. + */ - up_restorestate(rtcb->xcp.regs); - } + rtcb = (struct tcb_s*)g_readytorun.head; - /* No, then we will need to perform the user context switch */ + /* Then switch contexts */ - else - { - /* Switch context to the context of the task at the head of the - * ready to run list. - */ + up_restorestate(rtcb->xcp.regs); + } - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + /* No, then we will need to perform the user context switch */ - /* up_switchcontext forces a context switch to the task at the - * head of the ready-to-run list. It does not 'return' in the - * normal sense. When it does return, it is because the blocked - * task is again ready to run and has execution priority. - */ - } + else + { + /* Switch context to the context of the task at the head of the + * ready to run list. + */ + + struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + + /* up_switchcontext forces a context switch to the task at the + * head of the ready-to-run list. It does not 'return' in the + * normal sense. When it does return, it is because the blocked + * task is again ready to run and has execution priority. + */ } } } diff --git a/nuttx/arch/arm/src/armv7-m/up_doirq.c b/nuttx/arch/arm/src/armv7-m/up_doirq.c index 6063f9ca1..d8a1446de 100644 --- a/nuttx/arch/arm/src/armv7-m/up_doirq.c +++ b/nuttx/arch/arm/src/armv7-m/up_doirq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-m/up_doirq.c * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -74,7 +74,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs) { up_ledon(LED_INIRQ); #ifdef CONFIG_SUPPRESS_INTERRUPTS - PANIC(OSERR_ERREXCEPTION); + PANIC(); #else uint32_t *savestate; diff --git a/nuttx/arch/arm/src/armv7-m/up_hardfault.c b/nuttx/arch/arm/src/armv7-m/up_hardfault.c index e43b18cb3..d99473bde 100644 --- a/nuttx/arch/arm/src/armv7-m/up_hardfault.c +++ b/nuttx/arch/arm/src/armv7-m/up_hardfault.c @@ -181,6 +181,6 @@ int up_hardfault(int irq, FAR void *context) (void)irqsave(); lldbg("PANIC!!! Hard fault: %08x\n", getreg32(NVIC_HFAULTS)); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return OK; } diff --git a/nuttx/arch/arm/src/armv7-m/up_memfault.c b/nuttx/arch/arm/src/armv7-m/up_memfault.c index c9f1b57b1..6ab160d03 100644 --- a/nuttx/arch/arm/src/armv7-m/up_memfault.c +++ b/nuttx/arch/arm/src/armv7-m/up_memfault.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-m/up_memfault.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -126,6 +126,6 @@ int up_memfault(int irq, FAR void *context) # endif #endif - PANIC(OSERR_UNEXPECTEDISR); - return OK; + PANIC(); + return OK; /* Won't get here */ } diff --git a/nuttx/arch/arm/src/armv7-m/up_reprioritizertr.c b/nuttx/arch/arm/src/armv7-m/up_reprioritizertr.c index 94708a3be..a0d54a688 100644 --- a/nuttx/arch/arm/src/armv7-m/up_reprioritizertr.c +++ b/nuttx/arch/arm/src/armv7-m/up_reprioritizertr.c @@ -98,7 +98,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) #endif ) { - PANIC(OSERR_BADREPRIORITIZESTATE); + PANIC(); } else { diff --git a/nuttx/arch/arm/src/armv7-m/up_unblocktask.c b/nuttx/arch/arm/src/armv7-m/up_unblocktask.c index b2ff98879..8c6551b8e 100644 --- a/nuttx/arch/arm/src/armv7-m/up_unblocktask.c +++ b/nuttx/arch/arm/src/armv7-m/up_unblocktask.c @@ -81,77 +81,72 @@ void up_unblock_task(struct tcb_s *tcb) { + struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + /* Verify that the context switch can be performed */ - if ((tcb->task_state < FIRST_BLOCKED_STATE) || - (tcb->task_state > LAST_BLOCKED_STATE)) - { - PANIC(OSERR_BADUNBLOCKSTATE); - } - else - { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) && + (tcb->task_state <= LAST_BLOCKED_STATE)); - /* Remove the task from the blocked task list */ + /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + sched_removeblocked(tcb); - /* Reset its timeslice. This is only meaningful for round - * robin tasks but it doesn't here to do it for everything - */ + /* Reset its timeslice. This is only meaningful for round + * robin tasks but it doesn't here to do it for everything + */ #if CONFIG_RR_INTERVAL > 0 - tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK; + tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK; #endif - /* Add the task in the correct location in the prioritized - * g_readytorun task list + /* Add the task in the correct location in the prioritized + * g_readytorun task list + */ + + if (sched_addreadytorun(tcb)) + { + /* The currently active task has changed! We need to do + * a context switch to the new task. + * + * Are we in an interrupt handler? */ - if (sched_addreadytorun(tcb)) + if (current_regs) { - /* The currently active task has changed! We need to do - * a context switch to the new task. - * - * Are we in an interrupt handler? + /* Yes, then we have to do things differently. + * Just copy the current_regs into the OLD rtcb. */ - if (current_regs) - { - /* Yes, then we have to do things differently. - * Just copy the current_regs into the OLD rtcb. - */ + up_savestate(rtcb->xcp.regs); - up_savestate(rtcb->xcp.regs); - - /* Restore the exception context of the rtcb at the (new) head - * of the g_readytorun task list. - */ + /* Restore the exception context of the rtcb at the (new) head + * of the g_readytorun task list. + */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s*)g_readytorun.head; - /* Then switch contexts */ + /* Then switch contexts */ - up_restorestate(rtcb->xcp.regs); - } + up_restorestate(rtcb->xcp.regs); + } - /* No, then we will need to perform the user context switch */ + /* No, then we will need to perform the user context switch */ - else - { - /* Switch context to the context of the task at the head of the - * ready to run list. - */ + else + { + /* Switch context to the context of the task at the head of the + * ready to run list. + */ - struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head; + up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the - * head of the ready-to-run list. It does not 'return' in the - * normal sense. When it does return, it is because the blocked - * task is again ready to run and has execution priority. - */ - } + /* up_switchcontext forces a context switch to the task at the + * head of the ready-to-run list. It does not 'return' in the + * normal sense. When it does return, it is because the blocked + * task is again ready to run and has execution priority. + */ } } } diff --git a/nuttx/arch/arm/src/c5471/c5471_serial.c b/nuttx/arch/arm/src/c5471/c5471_serial.c index db28e196d..cdc5b6f24 100644 --- a/nuttx/arch/arm/src/c5471/c5471_serial.c +++ b/nuttx/arch/arm/src/c5471/c5471_serial.c @@ -547,7 +547,7 @@ static int up_interrupt(int irq, void *context) } else { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; diff --git a/nuttx/arch/arm/src/calypso/calypso_serial.c b/nuttx/arch/arm/src/calypso/calypso_serial.c index 01e65d062..5817b338b 100644 --- a/nuttx/arch/arm/src/calypso/calypso_serial.c +++ b/nuttx/arch/arm/src/calypso/calypso_serial.c @@ -607,7 +607,7 @@ static int up_interrupt(int irq, void *context) } else { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; diff --git a/nuttx/arch/arm/src/dm320/dm320_decodeirq.c b/nuttx/arch/arm/src/dm320/dm320_decodeirq.c index 98ba76097..c29207a5b 100644 --- a/nuttx/arch/arm/src/dm320/dm320_decodeirq.c +++ b/nuttx/arch/arm/src/dm320/dm320_decodeirq.c @@ -76,7 +76,7 @@ void up_decodeirq(uint32_t* regs) #ifdef CONFIG_SUPPRESS_INTERRUPTS lowsyslog("Unexpected IRQ\n"); current_regs = regs; - PANIC(OSERR_ERREXCEPTION); + PANIC(); #else /* Decode the interrupt. First, fetch the interrupt id register. */ diff --git a/nuttx/arch/arm/src/dm320/dm320_serial.c b/nuttx/arch/arm/src/dm320/dm320_serial.c index 58ff1e710..fbeefd8e9 100644 --- a/nuttx/arch/arm/src/dm320/dm320_serial.c +++ b/nuttx/arch/arm/src/dm320/dm320_serial.c @@ -485,7 +485,7 @@ static int up_interrupt(int irq, void *context) } else { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; diff --git a/nuttx/arch/arm/src/imx/imx_decodeirq.c b/nuttx/arch/arm/src/imx/imx_decodeirq.c index 230a4fc20..dc2326524 100644 --- a/nuttx/arch/arm/src/imx/imx_decodeirq.c +++ b/nuttx/arch/arm/src/imx/imx_decodeirq.c @@ -76,7 +76,7 @@ void up_decodeirq(uint32_t* regs) #ifdef CONFIG_SUPPRESS_INTERRUPTS lowsyslog("Unexpected IRQ\n"); current_regs = regs; - PANIC(OSERR_ERREXCEPTION); + PANIC(); #else uint32_t* savestate; uint32_t regval; diff --git a/nuttx/arch/arm/src/imx/imx_serial.c b/nuttx/arch/arm/src/imx/imx_serial.c index 9182d4ac8..d7a4c3296 100644 --- a/nuttx/arch/arm/src/imx/imx_serial.c +++ b/nuttx/arch/arm/src/imx/imx_serial.c @@ -799,7 +799,7 @@ static inline struct uart_dev_s *up_mapirq(int irq) #endif default: - PANIC(OSERR_INTERNAL); + PANIC(); break; } return dev; diff --git a/nuttx/arch/arm/src/kinetis/kinetis_irq.c b/nuttx/arch/arm/src/kinetis/kinetis_irq.c index f651c9e5d..f8b35656c 100644 --- a/nuttx/arch/arm/src/kinetis/kinetis_irq.c +++ b/nuttx/arch/arm/src/kinetis/kinetis_irq.c @@ -164,7 +164,7 @@ static int kinetis_nmi(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! NMI received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -172,7 +172,7 @@ static int kinetis_busfault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Bus fault recived\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -180,7 +180,7 @@ static int kinetis_usagefault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Usage fault received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -188,7 +188,7 @@ static int kinetis_pendsv(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! PendSV received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -196,7 +196,7 @@ static int kinetis_dbgmonitor(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Debug Monitor receieved\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -204,7 +204,7 @@ static int kinetis_reserved(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Reserved interrupt\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } #endif diff --git a/nuttx/arch/arm/src/kinetis/kinetis_serial.c b/nuttx/arch/arm/src/kinetis/kinetis_serial.c index 8ede027ec..f176f5fa0 100644 --- a/nuttx/arch/arm/src/kinetis/kinetis_serial.c +++ b/nuttx/arch/arm/src/kinetis/kinetis_serial.c @@ -782,7 +782,7 @@ static int up_interrupte(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; DEBUGASSERT(priv); @@ -871,7 +871,7 @@ static int up_interrupts(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; DEBUGASSERT(priv); diff --git a/nuttx/arch/arm/src/kl/kl_irq.c b/nuttx/arch/arm/src/kl/kl_irq.c index cc2303ae1..9e7d84e35 100644 --- a/nuttx/arch/arm/src/kl/kl_irq.c +++ b/nuttx/arch/arm/src/kl/kl_irq.c @@ -138,7 +138,7 @@ static int kl_nmi(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! NMI received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -146,7 +146,7 @@ static int kl_pendsv(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! PendSV received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -154,7 +154,7 @@ static int kl_reserved(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Reserved interrupt\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } #endif diff --git a/nuttx/arch/arm/src/kl/kl_serial.c b/nuttx/arch/arm/src/kl/kl_serial.c index d4f37f9f2..290192dcd 100644 --- a/nuttx/arch/arm/src/kl/kl_serial.c +++ b/nuttx/arch/arm/src/kl/kl_serial.c @@ -528,7 +528,7 @@ static int up_interrupts(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; DEBUGASSERT(priv); diff --git a/nuttx/arch/arm/src/lm/lm_irq.c b/nuttx/arch/arm/src/lm/lm_irq.c index 11ea6fbb6..920eee8af 100644 --- a/nuttx/arch/arm/src/lm/lm_irq.c +++ b/nuttx/arch/arm/src/lm/lm_irq.c @@ -146,7 +146,7 @@ static int lm_nmi(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! NMI received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -154,7 +154,7 @@ static int lm_busfault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Bus fault recived\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -162,7 +162,7 @@ static int lm_usagefault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Usage fault received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -170,7 +170,7 @@ static int lm_pendsv(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! PendSV received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -178,7 +178,7 @@ static int lm_dbgmonitor(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Debug Monitor receieved\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -186,7 +186,7 @@ static int lm_reserved(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Reserved interrupt\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } #endif diff --git a/nuttx/arch/arm/src/lm/lm_serial.c b/nuttx/arch/arm/src/lm/lm_serial.c index e9b9f72fb..6e772ecd5 100644 --- a/nuttx/arch/arm/src/lm/lm_serial.c +++ b/nuttx/arch/arm/src/lm/lm_serial.c @@ -962,7 +962,7 @@ static int up_interrupt(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c b/nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c index 866a668ab..777349def 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c @@ -364,7 +364,7 @@ static int i2c_interrupt(int irq, FAR void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } /* Reference UM10360 19.10.5 */ diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_irq.c b/nuttx/arch/arm/src/lpc17xx/lpc17_irq.c index 80de4596c..770874717 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_irq.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_irq.c @@ -145,7 +145,7 @@ static int lpc17_nmi(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! NMI received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -153,7 +153,7 @@ static int lpc17_busfault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Bus fault recived\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -161,7 +161,7 @@ static int lpc17_usagefault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Usage fault received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -169,7 +169,7 @@ static int lpc17_pendsv(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! PendSV received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -177,7 +177,7 @@ static int lpc17_dbgmonitor(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Debug Monitor receieved\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -185,7 +185,7 @@ static int lpc17_reserved(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Reserved interrupt\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } #endif diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c index 713426b6e..b2da4839f 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c @@ -1068,7 +1068,7 @@ static int up_interrupt(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c b/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c index 057e526c2..7886e5500 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c @@ -114,7 +114,7 @@ static void lpc214x_decodeirq( uint32_t *regs) #ifdef CONFIG_SUPPRESS_INTERRUPTS lowsyslog("Unexpected IRQ\n"); current_regs = regs; - PANIC(OSERR_ERREXCEPTION); + PANIC(); #else /* Decode the interrupt. We have to do this by search for the lowest numbered diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_serial.c b/nuttx/arch/arm/src/lpc214x/lpc214x_serial.c index b035e91fc..c647e458a 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_serial.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_serial.c @@ -468,7 +468,7 @@ static int up_interrupt(int irq, void *context) } else { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; diff --git a/nuttx/arch/arm/src/lpc2378/lpc23xx_decodeirq.c b/nuttx/arch/arm/src/lpc2378/lpc23xx_decodeirq.c index 3a50beb50..75e6c98b4 100644 --- a/nuttx/arch/arm/src/lpc2378/lpc23xx_decodeirq.c +++ b/nuttx/arch/arm/src/lpc2378/lpc23xx_decodeirq.c @@ -113,7 +113,7 @@ static void lpc23xx_decodeirq(uint32_t *regs) #ifdef CONFIG_SUPPRESS_INTERRUPTS lowsyslog("Unexpected IRQ\n"); current_regs = regs; - PANIC(OSERR_ERREXCEPTION); + PANIC(); #else /* Check which IRQ fires */ diff --git a/nuttx/arch/arm/src/lpc2378/lpc23xx_serial.c b/nuttx/arch/arm/src/lpc2378/lpc23xx_serial.c index c17a57840..08fe4ec73 100644 --- a/nuttx/arch/arm/src/lpc2378/lpc23xx_serial.c +++ b/nuttx/arch/arm/src/lpc2378/lpc23xx_serial.c @@ -598,7 +598,7 @@ static int up_interrupt(int irq, void *context) } else { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s *)dev->priv; diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_decodeirq.c b/nuttx/arch/arm/src/lpc31xx/lpc31_decodeirq.c index 0e73f131b..1929d864d 100644 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_decodeirq.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_decodeirq.c @@ -79,7 +79,7 @@ void up_decodeirq(uint32_t *regs) #ifdef CONFIG_SUPPRESS_INTERRUPTS lowsyslog("Unexpected IRQ\n"); current_regs = regs; - PANIC(OSERR_ERREXCEPTION); + PANIC(); #else int index; int irq; diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_i2c.c b/nuttx/arch/arm/src/lpc43xx/lpc43_i2c.c index 64a044f13..1dc8b7679 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_i2c.c +++ b/nuttx/arch/arm/src/lpc43xx/lpc43_i2c.c @@ -370,7 +370,7 @@ static int i2c_interrupt(int irq, FAR void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } /* Reference UM10360 19.10.5 */ diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_irq.c b/nuttx/arch/arm/src/lpc43xx/lpc43_irq.c index 042b3360b..7195092bb 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_irq.c +++ b/nuttx/arch/arm/src/lpc43xx/lpc43_irq.c @@ -147,7 +147,7 @@ static int lpc43_nmi(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! NMI received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -155,7 +155,7 @@ static int lpc43_busfault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Bus fault recived\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -163,7 +163,7 @@ static int lpc43_usagefault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Usage fault received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -171,7 +171,7 @@ static int lpc43_pendsv(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! PendSV received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -179,7 +179,7 @@ static int lpc43_dbgmonitor(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Debug Monitor receieved\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -187,7 +187,7 @@ static int lpc43_reserved(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Reserved interrupt\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } #endif diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_serial.c b/nuttx/arch/arm/src/lpc43xx/lpc43_serial.c index a6e6b7b18..adbfb282a 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_serial.c +++ b/nuttx/arch/arm/src/lpc43xx/lpc43_serial.c @@ -777,7 +777,7 @@ static int up_interrupt(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; diff --git a/nuttx/arch/arm/src/nuc1xx/nuc_irq.c b/nuttx/arch/arm/src/nuc1xx/nuc_irq.c index 01a7bd7ba..2ee01762d 100644 --- a/nuttx/arch/arm/src/nuc1xx/nuc_irq.c +++ b/nuttx/arch/arm/src/nuc1xx/nuc_irq.c @@ -138,7 +138,7 @@ static int nuc_nmi(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! NMI received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -146,7 +146,7 @@ static int nuc_pendsv(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! PendSV received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -154,7 +154,7 @@ static int nuc_reserved(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Reserved interrupt\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } #endif diff --git a/nuttx/arch/arm/src/nuc1xx/nuc_serial.c b/nuttx/arch/arm/src/nuc1xx/nuc_serial.c index dbf34f8ec..c07ef1109 100644 --- a/nuttx/arch/arm/src/nuc1xx/nuc_serial.c +++ b/nuttx/arch/arm/src/nuc1xx/nuc_serial.c @@ -640,7 +640,7 @@ static int up_interrupt(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct nuc_dev_s*)dev->priv; diff --git a/nuttx/arch/arm/src/sam3u/sam3u_irq.c b/nuttx/arch/arm/src/sam3u/sam3u_irq.c index 9c1e9bb3e..29c9908c9 100644 --- a/nuttx/arch/arm/src/sam3u/sam3u_irq.c +++ b/nuttx/arch/arm/src/sam3u/sam3u_irq.c @@ -140,7 +140,7 @@ static int sam3u_nmi(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! NMI received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -148,7 +148,7 @@ static int sam3u_busfault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Bus fault recived\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -156,7 +156,7 @@ static int sam3u_usagefault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Usage fault received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -164,7 +164,7 @@ static int sam3u_pendsv(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! PendSV received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -172,7 +172,7 @@ static int sam3u_dbgmonitor(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Debug Monitor receieved\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -180,7 +180,7 @@ static int sam3u_reserved(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Reserved interrupt\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } #endif diff --git a/nuttx/arch/arm/src/sam3u/sam3u_serial.c b/nuttx/arch/arm/src/sam3u/sam3u_serial.c index 149474207..a4d79a11b 100644 --- a/nuttx/arch/arm/src/sam3u/sam3u_serial.c +++ b/nuttx/arch/arm/src/sam3u/sam3u_serial.c @@ -1077,7 +1077,7 @@ static int up_interrupt(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; diff --git a/nuttx/arch/arm/src/stm32/stm32_can.c b/nuttx/arch/arm/src/stm32/stm32_can.c index 86a53dab0..a3011cde4 100644 --- a/nuttx/arch/arm/src/stm32/stm32_can.c +++ b/nuttx/arch/arm/src/stm32/stm32_can.c @@ -1009,7 +1009,7 @@ static int can_rx0interrupt(int irq, void *context) } else { - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); } #elif defined(CONFIG_STM32_CAN1) dev = &g_can1dev; @@ -1125,7 +1125,7 @@ static int can_txinterrupt(int irq, void *context) } else { - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); } #elif defined(CONFIG_STM32_CAN1) dev = &g_can1dev; diff --git a/nuttx/arch/arm/src/stm32/stm32_irq.c b/nuttx/arch/arm/src/stm32/stm32_irq.c index 96b239c36..d1cd37e36 100644 --- a/nuttx/arch/arm/src/stm32/stm32_irq.c +++ b/nuttx/arch/arm/src/stm32/stm32_irq.c @@ -144,7 +144,7 @@ static int stm32_nmi(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! NMI received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -152,7 +152,7 @@ static int stm32_busfault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Bus fault recived\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -160,7 +160,7 @@ static int stm32_usagefault(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Usage fault received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -168,7 +168,7 @@ static int stm32_pendsv(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! PendSV received\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -176,7 +176,7 @@ static int stm32_dbgmonitor(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Debug Monitor receieved\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } @@ -184,7 +184,7 @@ static int stm32_reserved(int irq, FAR void *context) { (void)irqsave(); dbg("PANIC!!! Reserved interrupt\n"); - PANIC(OSERR_UNEXPECTEDISR); + PANIC(); return 0; } #endif diff --git a/nuttx/arch/arm/src/stm32/stm32f10xxx_dma.c b/nuttx/arch/arm/src/stm32/stm32f10xxx_dma.c index 80408e58b..29b09150d 100644 --- a/nuttx/arch/arm/src/stm32/stm32f10xxx_dma.c +++ b/nuttx/arch/arm/src/stm32/stm32f10xxx_dma.c @@ -299,7 +299,7 @@ static int stm32_dmainterrupt(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } dmach = &g_dma[chndx]; diff --git a/nuttx/arch/arm/src/stm32/stm32f20xxx_dma.c b/nuttx/arch/arm/src/stm32/stm32f20xxx_dma.c index e5905a909..844fa6a67 100644 --- a/nuttx/arch/arm/src/stm32/stm32f20xxx_dma.c +++ b/nuttx/arch/arm/src/stm32/stm32f20xxx_dma.c @@ -406,7 +406,7 @@ static int stm32_dmainterrupt(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } /* Get the stream structure from the stream and controller numbers */ diff --git a/nuttx/arch/arm/src/stm32/stm32f40xxx_dma.c b/nuttx/arch/arm/src/stm32/stm32f40xxx_dma.c index 850ab62ae..fd8164a32 100644 --- a/nuttx/arch/arm/src/stm32/stm32f40xxx_dma.c +++ b/nuttx/arch/arm/src/stm32/stm32f40xxx_dma.c @@ -405,7 +405,7 @@ static int stm32_dmainterrupt(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } /* Get the stream structure from the stream and controller numbers */ diff --git a/nuttx/arch/arm/src/str71x/str71x_decodeirq.c b/nuttx/arch/arm/src/str71x/str71x_decodeirq.c index 48c9aa7e4..da7b5a48e 100644 --- a/nuttx/arch/arm/src/str71x/str71x_decodeirq.c +++ b/nuttx/arch/arm/src/str71x/str71x_decodeirq.c @@ -93,7 +93,7 @@ void up_decodeirq(uint32_t *regs) up_ledon(LED_INIRQ); lowsyslog("Unexpected IRQ\n"); current_regs = regs; - PANIC(OSERR_ERREXCEPTION); + PANIC(); #else unsigned int irq; @@ -139,7 +139,7 @@ void up_decodeirq(uint32_t *regs) #if CONFIG_DEBUG else { - PANIC(OSERR_ERREXCEPTION); /* Normally never happens */ + PANIC(); /* Normally never happens */ } #endif up_ledoff(LED_INIRQ); diff --git a/nuttx/arch/arm/src/str71x/str71x_serial.c b/nuttx/arch/arm/src/str71x/str71x_serial.c index 5de63a1b9..2098758b1 100644 --- a/nuttx/arch/arm/src/str71x/str71x_serial.c +++ b/nuttx/arch/arm/src/str71x/str71x_serial.c @@ -698,7 +698,7 @@ static int up_interrupt(int irq, void *context) else #endif { - PANIC(OSERR_INTERNAL); + PANIC(); } priv = (struct up_dev_s*)dev->priv; |