* misc/restart.c: New file.
	* Makefile.am: Reflect change from above.
	* include/bsp.h: Declare bsp_restart().
This commit is contained in:
Sebastian Huber
2011-02-21 12:56:34 +00:00
parent 21400c985e
commit c446d7c79a
4 changed files with 52 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
2011-02-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* misc/restart.c: New file.
* Makefile.am: Reflect change from above.
* include/bsp.h: Declare bsp_restart().
2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
* startup/bspstarthooks.c:

View File

@@ -124,6 +124,7 @@ libbsp_a_SOURCES += misc/system-clocks.c \
misc/bspidle.c \
misc/io.c \
misc/lcd.c \
misc/restart.c \
misc/timer.c
# SSP

View File

@@ -89,6 +89,8 @@ void *bsp_idle_thread(uintptr_t ignored);
#define BSP_CONSOLE_UART_BASE 0xe000c000
void bsp_restart(void *addr);
/** @} */
#endif /* ASM */

View File

@@ -0,0 +1,43 @@
/**
* @file
*
* @ingroup lpc24xx
*
* @brief Restart implementation.
*/
/*
* Copyright (c) 2011 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Obere Lagerstr. 30
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <rtems.h>
#include <bsp.h>
void bsp_restart(void *addr)
{
ARM_SWITCH_REGISTERS;
rtems_interrupt_level level;
rtems_interrupt_disable(level);
asm volatile (
ARM_SWITCH_TO_ARM
"mov pc, %[addr]\n"
ARM_SWITCH_BACK
: ARM_SWITCH_OUTPUT
: [addr] "r" (addr)
);
}