Remove up_assert_code

This commit is contained in:
Gregory Nutt
2013-04-25 15:19:59 -06:00
parent e9a29d9465
commit 86b815373a
142 changed files with 1664 additions and 2190 deletions
+5
View File
@@ -4623,3 +4623,8 @@
KL architecture directory as need to get the interrupt-driven KL architecture directory as need to get the interrupt-driven
serial driver to work. The Freedom KL25Z NSH configuration now serial driver to work. The Freedom KL25Z NSH configuration now
works (2014-4-25). works (2014-4-25).
* include/nuttx/assert.h, arch/*/src/*/up_assert.c, and other file:
Remove up_assert_code(). While asserting with an encoded value
could be a good feature, the codes have not be well utilized nor
documented. Give that situation it is better to remove the API
and reduce the footprint a little (2014-4-25).
+2 -4
View File
@@ -1910,13 +1910,11 @@ The system can be re-made subsequently by just typing <code>make</code>.
<h3><a name="upassert">4.1.13 <code>up_assert()</code></a></h3> <h3><a name="upassert">4.1.13 <code>up_assert()</code></a></h3>
<p><b>Prototype</b>:<br> <p><b>Prototype</b>:<br>
<code>void up_assert(FAR const uint8_t *filename, int linenum);</code></br> <code>void up_assert(FAR const uint8_t *filename, int linenum);</code>
<code>void up_assert_code(FAR const uint8_t *filename, int linenum, int error_code);</code></br>
</p> </p>
<p><b>Description</b>. <p><b>Description</b>.
Assertions may be handled in an architecture-specific Assertions may be handled in an architecture-specific way.
way.
</p> </p>
<h3><a name="upschedulesigaction">4.1.14 <code>up_schedule_sigaction()</code></a></h3> <h3><a name="upschedulesigaction">4.1.14 <code>up_schedule_sigaction()</code></a></h3>
+1 -25
View File
@@ -1,7 +1,7 @@
/************************************************************************ /************************************************************************
* up_assert.c * up_assert.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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -116,27 +116,3 @@ void up_assert(const uint8_t *filename, int lineno)
up_dumpstack(); up_dumpstack();
_up_assert(EXIT_FAILURE); _up_assert(EXIT_FAILURE);
} }
/************************************************************************
* Name: up_assert_code
************************************************************************/
void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{
#if CONFIG_TASK_NAME_SIZE > 0
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif
up_ledon(LED_ASSERTION);
#if CONFIG_TASK_NAME_SIZE > 0
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_dumpstack();
_up_assert(errorcode);
}
+5 -10
View File
@@ -84,19 +84,15 @@
************************************************************************/ ************************************************************************/
void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state) void up_block_task(FAR 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
{ {
FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Verify that the context switch can be performed */
ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) &&
(tcb->task_state <= LAST_READY_TO_RUN_STATE));
dbg("Blocking TCB=%p\n", tcb); dbg("Blocking TCB=%p\n", tcb);
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
@@ -169,4 +165,3 @@ void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state)
} }
} }
} }
}
+1 -1
View File
@@ -99,7 +99,7 @@ void up_reprioritize_rtr(FAR struct tcb_s *tcb, uint8_t priority)
#endif #endif
) )
{ {
PANIC(OSERR_BADREPRIORITIZESTATE); PANIC();
} }
else else
{ {
+5 -10
View File
@@ -1,7 +1,7 @@
/************************************************************************ /************************************************************************
* up_unblocktask.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -82,16 +82,12 @@
void up_unblock_task(FAR struct tcb_s *tcb) void up_unblock_task(FAR struct tcb_s *tcb)
{ {
FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head;
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
if ((tcb->task_state < FIRST_BLOCKED_STATE) || ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) &&
(tcb->task_state > LAST_BLOCKED_STATE)) (tcb->task_state <= LAST_BLOCKED_STATE));
{
PANIC(OSERR_BADUNBLOCKSTATE);
}
else
{
FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("Unblocking TCB=%p\n", tcb); dbg("Unblocking TCB=%p\n", tcb);
@@ -163,4 +159,3 @@ void up_unblock_task(FAR struct tcb_s *tcb)
} }
} }
} }
}
+2 -24
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/arm/up_assert.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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 #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
lldbg("Assertion failed at file:%s line: %d task: %s\n", lldbg("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name); filename, lineno, rtcb->name);
@@ -301,26 +302,3 @@ void up_assert(const uint8_t *filename, int lineno)
up_dumpstate(); up_dumpstate();
_up_assert(EXIT_FAILURE); _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);
}
+6 -11
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/arm/up_blocktask.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -85,19 +85,15 @@
****************************************************************************/ ****************************************************************************/
void up_block_task(struct tcb_s *tcb, tstate_t task_state) 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; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Verify that the context switch can be performed */
ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) &&
(tcb->task_state <= LAST_READY_TO_RUN_STATE));
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
* are blocking the task at the head of the task list (the * are blocking the task at the head of the task list (the
* most likely case), then a context switch to the next * most likely case), then a context switch to the next
@@ -164,4 +160,3 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
} }
} }
} }
}
+3 -3
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/arm/up_dataabort.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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: segfault:
#endif #endif
lldbg("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr); lldbg("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr);
PANIC(OSERR_ERREXCEPTION); PANIC();
} }
#else /* CONFIG_PAGING */ #else /* CONFIG_PAGING */
@@ -195,7 +195,7 @@ void up_dataabort(uint32_t *regs)
/* Crash -- possibly showing diagnost debug information. */ /* Crash -- possibly showing diagnost debug information. */
lldbg("Data abort. PC: %08x\n", regs[REG_PC]); lldbg("Data abort. PC: %08x\n", regs[REG_PC]);
PANIC(OSERR_ERREXCEPTION); PANIC();
} }
#endif /* CONFIG_PAGING */ #endif /* CONFIG_PAGING */
+2 -2
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/arm/up_doirq.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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); up_ledon(LED_INIRQ);
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
PANIC(OSERR_ERREXCEPTION); PANIC();
#else #else
uint32_t *savestate; uint32_t *savestate;
+2 -2
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/src/up_prefetchabort.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -149,6 +149,6 @@ void up_prefetchabort(uint32_t *regs)
#endif #endif
{ {
lldbg("Prefetch abort. PC: %08x\n", regs[REG_PC]); lldbg("Prefetch abort. PC: %08x\n", regs[REG_PC]);
PANIC(OSERR_ERREXCEPTION); PANIC();
} }
} }
+2 -2
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/arm/up_reprioritizertr.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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 #endif
) )
{ {
PANIC(OSERR_BADREPRIORITIZESTATE); PANIC();
} }
else else
{ {
+1 -1
View File
@@ -92,5 +92,5 @@ void up_syscall(uint32_t *regs)
{ {
lldbg("Syscall from 0x%x\n", regs[REG_PC]); lldbg("Syscall from 0x%x\n", regs[REG_PC]);
current_regs = regs; current_regs = regs;
PANIC(OSERR_ERREXCEPTION); PANIC();
} }
+5 -10
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/arm/up_unblocktask.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -81,16 +81,12 @@
void up_unblock_task(struct tcb_s *tcb) 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 */ /* Verify that the context switch can be performed */
if ((tcb->task_state < FIRST_BLOCKED_STATE) || ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) &&
(tcb->task_state > LAST_BLOCKED_STATE)) (tcb->task_state <= LAST_BLOCKED_STATE));
{
PANIC(OSERR_BADUNBLOCKSTATE);
}
else
{
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
@@ -156,4 +152,3 @@ void up_unblock_task(struct tcb_s *tcb)
} }
} }
} }
}
+2 -2
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/arm/up_undefinedinsn.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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]); lldbg("Undefined instruction at 0x%x\n", regs[REG_PC]);
current_regs = regs; current_regs = regs;
PANIC(OSERR_UNDEFINEDINSN); PANIC();
} }
+2 -22
View File
@@ -307,6 +307,7 @@ void up_assert(const uint8_t *filename, int lineno)
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
lldbg("Assertion failed at file:%s line: %d task: %s\n", lldbg("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name); 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", lldbg("Assertion failed at file:%s line: %d\n",
filename, lineno); filename, lineno);
#endif #endif
up_dumpstate(); up_dumpstate();
_up_assert(EXIT_FAILURE); _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);
}
+5 -10
View File
@@ -84,19 +84,15 @@
****************************************************************************/ ****************************************************************************/
void up_block_task(struct tcb_s *tcb, tstate_t task_state) 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; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Verify that the context switch can be performed */
ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) &&
(tcb->task_state <= LAST_READY_TO_RUN_STATE));
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
* are blocking the task at the head of the task list (the * are blocking the task at the head of the task list (the
* most likely case), then a context switch to the next * most likely case), then a context switch to the next
@@ -163,4 +159,3 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
} }
} }
} }
}
+1 -1
View File
@@ -74,7 +74,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs)
{ {
up_ledon(LED_INIRQ); up_ledon(LED_INIRQ);
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
PANIC(OSERR_ERREXCEPTION); PANIC();
#else #else
uint32_t *savestate; uint32_t *savestate;
+2 -2
View File
@@ -151,6 +151,6 @@ int up_hardfault(int irq, FAR void *context)
(void)irqsave(); (void)irqsave();
lldbg("PANIC!!! Hard fault\n"); lldbg("PANIC!!! Hard fault\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return OK; return OK; /* Won't get here */
} }
+1 -1
View File
@@ -98,7 +98,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
#endif #endif
) )
{ {
PANIC(OSERR_BADREPRIORITIZESTATE); PANIC();
} }
else else
{ {
+4 -9
View File
@@ -80,16 +80,12 @@
void up_unblock_task(struct tcb_s *tcb) 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 */ /* Verify that the context switch can be performed */
if ((tcb->task_state < FIRST_BLOCKED_STATE) || ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) &&
(tcb->task_state > LAST_BLOCKED_STATE)) (tcb->task_state <= LAST_BLOCKED_STATE));
{
PANIC(OSERR_BADUNBLOCKSTATE);
}
else
{
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
@@ -153,4 +149,3 @@ void up_unblock_task(struct tcb_s *tcb)
} }
} }
} }
}
+2 -22
View File
@@ -318,6 +318,7 @@ void up_assert(const uint8_t *filename, int lineno)
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
lldbg("Assertion failed at file:%s line: %d task: %s\n", lldbg("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name); 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", lldbg("Assertion failed at file:%s line: %d\n",
filename, lineno); filename, lineno);
#endif #endif
up_dumpstate(); up_dumpstate();
_up_assert(EXIT_FAILURE); _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);
}
+6 -11
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/up_blocktask.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -85,19 +85,15 @@
****************************************************************************/ ****************************************************************************/
void up_block_task(struct tcb_s *tcb, tstate_t task_state) 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; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Verify that the context switch can be performed */
ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) &&
(tcb->task_state <= LAST_READY_TO_RUN_STATE));
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
* are blocking the task at the head of the task list (the * are blocking the task at the head of the task list (the
* most likely case), then a context switch to the next * most likely case), then a context switch to the next
@@ -164,4 +160,3 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
} }
} }
} }
}
+2 -2
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/up_doirq.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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); up_ledon(LED_INIRQ);
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
PANIC(OSERR_ERREXCEPTION); PANIC();
#else #else
uint32_t *savestate; uint32_t *savestate;
+1 -1
View File
@@ -181,6 +181,6 @@ int up_hardfault(int irq, FAR void *context)
(void)irqsave(); (void)irqsave();
lldbg("PANIC!!! Hard fault: %08x\n", getreg32(NVIC_HFAULTS)); lldbg("PANIC!!! Hard fault: %08x\n", getreg32(NVIC_HFAULTS));
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return OK; return OK;
} }
+3 -3
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/up_memfault.c * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * 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
#endif #endif
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return OK; return OK; /* Won't get here */
} }
+1 -1
View File
@@ -98,7 +98,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
#endif #endif
) )
{ {
PANIC(OSERR_BADREPRIORITIZESTATE); PANIC();
} }
else else
{ {
+4 -9
View File
@@ -81,16 +81,12 @@
void up_unblock_task(struct tcb_s *tcb) 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 */ /* Verify that the context switch can be performed */
if ((tcb->task_state < FIRST_BLOCKED_STATE) || ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) &&
(tcb->task_state > LAST_BLOCKED_STATE)) (tcb->task_state <= LAST_BLOCKED_STATE));
{
PANIC(OSERR_BADUNBLOCKSTATE);
}
else
{
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
@@ -154,4 +150,3 @@ void up_unblock_task(struct tcb_s *tcb)
} }
} }
} }
}
+1 -1
View File
@@ -547,7 +547,7 @@ static int up_interrupt(int irq, void *context)
} }
else else
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s*)dev->priv; priv = (struct up_dev_s*)dev->priv;
+1 -1
View File
@@ -607,7 +607,7 @@ static int up_interrupt(int irq, void *context)
} }
else else
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s*)dev->priv; priv = (struct up_dev_s*)dev->priv;
+1 -1
View File
@@ -76,7 +76,7 @@ void up_decodeirq(uint32_t* regs)
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog("Unexpected IRQ\n"); lowsyslog("Unexpected IRQ\n");
current_regs = regs; current_regs = regs;
PANIC(OSERR_ERREXCEPTION); PANIC();
#else #else
/* Decode the interrupt. First, fetch the interrupt id register. */ /* Decode the interrupt. First, fetch the interrupt id register. */
+1 -1
View File
@@ -485,7 +485,7 @@ static int up_interrupt(int irq, void *context)
} }
else else
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s*)dev->priv; priv = (struct up_dev_s*)dev->priv;
+1 -1
View File
@@ -76,7 +76,7 @@ void up_decodeirq(uint32_t* regs)
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog("Unexpected IRQ\n"); lowsyslog("Unexpected IRQ\n");
current_regs = regs; current_regs = regs;
PANIC(OSERR_ERREXCEPTION); PANIC();
#else #else
uint32_t* savestate; uint32_t* savestate;
uint32_t regval; uint32_t regval;
+1 -1
View File
@@ -799,7 +799,7 @@ static inline struct uart_dev_s *up_mapirq(int irq)
#endif #endif
default: default:
PANIC(OSERR_INTERNAL); PANIC();
break; break;
} }
return dev; return dev;
+6 -6
View File
@@ -164,7 +164,7 @@ static int kinetis_nmi(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! NMI received\n"); dbg("PANIC!!! NMI received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -172,7 +172,7 @@ static int kinetis_busfault(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Bus fault recived\n"); dbg("PANIC!!! Bus fault recived\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -180,7 +180,7 @@ static int kinetis_usagefault(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Usage fault received\n"); dbg("PANIC!!! Usage fault received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -188,7 +188,7 @@ static int kinetis_pendsv(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! PendSV received\n"); dbg("PANIC!!! PendSV received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -196,7 +196,7 @@ static int kinetis_dbgmonitor(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Debug Monitor receieved\n"); dbg("PANIC!!! Debug Monitor receieved\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -204,7 +204,7 @@ static int kinetis_reserved(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Reserved interrupt\n"); dbg("PANIC!!! Reserved interrupt\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
#endif #endif
+2 -2
View File
@@ -782,7 +782,7 @@ static int up_interrupte(int irq, void *context)
else else
#endif #endif
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s*)dev->priv; priv = (struct up_dev_s*)dev->priv;
DEBUGASSERT(priv); DEBUGASSERT(priv);
@@ -871,7 +871,7 @@ static int up_interrupts(int irq, void *context)
else else
#endif #endif
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s*)dev->priv; priv = (struct up_dev_s*)dev->priv;
DEBUGASSERT(priv); DEBUGASSERT(priv);
+3 -3
View File
@@ -138,7 +138,7 @@ static int kl_nmi(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! NMI received\n"); dbg("PANIC!!! NMI received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -146,7 +146,7 @@ static int kl_pendsv(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! PendSV received\n"); dbg("PANIC!!! PendSV received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -154,7 +154,7 @@ static int kl_reserved(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Reserved interrupt\n"); dbg("PANIC!!! Reserved interrupt\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
#endif #endif
+1 -1
View File
@@ -528,7 +528,7 @@ static int up_interrupts(int irq, void *context)
else else
#endif #endif
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s*)dev->priv; priv = (struct up_dev_s*)dev->priv;
DEBUGASSERT(priv); DEBUGASSERT(priv);
+6 -6
View File
@@ -146,7 +146,7 @@ static int lm_nmi(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! NMI received\n"); dbg("PANIC!!! NMI received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -154,7 +154,7 @@ static int lm_busfault(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Bus fault recived\n"); dbg("PANIC!!! Bus fault recived\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -162,7 +162,7 @@ static int lm_usagefault(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Usage fault received\n"); dbg("PANIC!!! Usage fault received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -170,7 +170,7 @@ static int lm_pendsv(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! PendSV received\n"); dbg("PANIC!!! PendSV received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -178,7 +178,7 @@ static int lm_dbgmonitor(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Debug Monitor receieved\n"); dbg("PANIC!!! Debug Monitor receieved\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -186,7 +186,7 @@ static int lm_reserved(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Reserved interrupt\n"); dbg("PANIC!!! Reserved interrupt\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
#endif #endif
+1 -1
View File
@@ -962,7 +962,7 @@ static int up_interrupt(int irq, void *context)
else else
#endif #endif
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s*)dev->priv; priv = (struct up_dev_s*)dev->priv;
+1 -1
View File
@@ -364,7 +364,7 @@ static int i2c_interrupt(int irq, FAR void *context)
else else
#endif #endif
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
/* Reference UM10360 19.10.5 */ /* Reference UM10360 19.10.5 */
+6 -6
View File
@@ -145,7 +145,7 @@ static int lpc17_nmi(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! NMI received\n"); dbg("PANIC!!! NMI received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -153,7 +153,7 @@ static int lpc17_busfault(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Bus fault recived\n"); dbg("PANIC!!! Bus fault recived\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -161,7 +161,7 @@ static int lpc17_usagefault(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Usage fault received\n"); dbg("PANIC!!! Usage fault received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -169,7 +169,7 @@ static int lpc17_pendsv(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! PendSV received\n"); dbg("PANIC!!! PendSV received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -177,7 +177,7 @@ static int lpc17_dbgmonitor(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Debug Monitor receieved\n"); dbg("PANIC!!! Debug Monitor receieved\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -185,7 +185,7 @@ static int lpc17_reserved(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Reserved interrupt\n"); dbg("PANIC!!! Reserved interrupt\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
#endif #endif
+1 -1
View File
@@ -1068,7 +1068,7 @@ static int up_interrupt(int irq, void *context)
else else
#endif #endif
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s*)dev->priv; priv = (struct up_dev_s*)dev->priv;
+1 -1
View File
@@ -114,7 +114,7 @@ static void lpc214x_decodeirq( uint32_t *regs)
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog("Unexpected IRQ\n"); lowsyslog("Unexpected IRQ\n");
current_regs = regs; current_regs = regs;
PANIC(OSERR_ERREXCEPTION); PANIC();
#else #else
/* Decode the interrupt. We have to do this by search for the lowest numbered /* Decode the interrupt. We have to do this by search for the lowest numbered
+1 -1
View File
@@ -468,7 +468,7 @@ static int up_interrupt(int irq, void *context)
} }
else else
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s*)dev->priv; priv = (struct up_dev_s*)dev->priv;
+1 -1
View File
@@ -113,7 +113,7 @@ static void lpc23xx_decodeirq(uint32_t *regs)
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog("Unexpected IRQ\n"); lowsyslog("Unexpected IRQ\n");
current_regs = regs; current_regs = regs;
PANIC(OSERR_ERREXCEPTION); PANIC();
#else #else
/* Check which IRQ fires */ /* Check which IRQ fires */
+1 -1
View File
@@ -598,7 +598,7 @@ static int up_interrupt(int irq, void *context)
} }
else else
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
priv = (struct up_dev_s *)dev->priv; priv = (struct up_dev_s *)dev->priv;
+1 -1
View File
@@ -79,7 +79,7 @@ void up_decodeirq(uint32_t *regs)
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog("Unexpected IRQ\n"); lowsyslog("Unexpected IRQ\n");
current_regs = regs; current_regs = regs;
PANIC(OSERR_ERREXCEPTION); PANIC();
#else #else
int index; int index;
int irq; int irq;
+1 -1
View File
@@ -370,7 +370,7 @@ static int i2c_interrupt(int irq, FAR void *context)
else else
#endif #endif
{ {
PANIC(OSERR_INTERNAL); PANIC();
} }
/* Reference UM10360 19.10.5 */ /* Reference UM10360 19.10.5 */
+6 -6
View File
@@ -147,7 +147,7 @@ static int lpc43_nmi(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! NMI received\n"); dbg("PANIC!!! NMI received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -155,7 +155,7 @@ static int lpc43_busfault(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Bus fault recived\n"); dbg("PANIC!!! Bus fault recived\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -163,7 +163,7 @@ static int lpc43_usagefault(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Usage fault received\n"); dbg("PANIC!!! Usage fault received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -171,7 +171,7 @@ static int lpc43_pendsv(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! PendSV received\n"); dbg("PANIC!!! PendSV received\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -179,7 +179,7 @@ static int lpc43_dbgmonitor(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Debug Monitor receieved\n"); dbg("PANIC!!! Debug Monitor receieved\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
@@ -187,7 +187,7 @@ static int lpc43_reserved(int irq, FAR void *context)
{ {
(void)irqsave(); (void)irqsave();
dbg("PANIC!!! Reserved interrupt\n"); dbg("PANIC!!! Reserved interrupt\n");
PANIC(OSERR_UNEXPECTEDISR); PANIC();
return 0; return 0;
} }
#endif #endif

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