source: rtems/bsps/arm/lpc24xx/start/restart.c @ 74df15c

5
Last change on this file since 74df15c was 74df15c, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 25, 2018 at 8:40:40 AM

bsp/lpc24xx: Move source files to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 944 bytes
Line 
1/**
2 * @file
3 *
4 * @ingroup lpc24xx
5 *
6 * @brief Restart implementation.
7 */
8
9/*
10 * Copyright (c) 2011-2014 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Dornierstr. 4
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 */
22
23#include <rtems.h>
24
25#include <bsp.h>
26
27void bsp_restart(void *addr)
28{
29  #ifdef ARM_MULTILIB_ARCH_V4
30    ARM_SWITCH_REGISTERS;
31    rtems_interrupt_level level;
32
33    rtems_interrupt_disable(level);
34    (void) level;
35
36    asm volatile (
37      ARM_SWITCH_TO_ARM
38      "mov pc, %[addr]\n"
39      ARM_SWITCH_BACK
40      : ARM_SWITCH_OUTPUT
41      : [addr] "r" (addr)
42    );
43  #else
44    rtems_interrupt_level level;
45    void (*start)(void) = addr;
46
47    rtems_interrupt_disable(level);
48    (void) level;
49
50    (*start)();
51  #endif
52}
Note: See TracBrowser for help on using the repository browser.