Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:05

0001 /*
0002  *  Copyright (c) 2007 by Ray Xu <rayx.cn@gmail.com>
0003  *
0004  *  The license and distribution terms for this file may be
0005  *  found in the file LICENSE in this distribution or at
0006  *  http://www.rtems.org/license/LICENSE.
0007  */
0008 
0009 #include <bsp.h>
0010 #include <bsp/bootcard.h>
0011 #include <lpc22xx.h>
0012 
0013 void bsp_reset( rtems_fatal_source source, rtems_fatal_code code )
0014 {
0015 #if ON_SKYEYE == 1
0016   #define SKYEYE_MAGIC_ADDRESS (*(volatile unsigned int *)(0xb0000000))
0017 
0018   SKYEYE_MAGIC_ADDRESS = 0xff;
0019 #else
0020   rtems_interrupt_level level;
0021 
0022   rtems_interrupt_disable(level);
0023   (void) level;
0024 
0025   #ifdef __thumb__
0026     int tmp;
0027     __asm__ volatile (" .code 16            \n" \
0028                   "ldr %[tmp], =_start  \n" \
0029                   "bx  %[tmp]           \n" \
0030                   "nop                  \n" \
0031                   : [tmp]"=&r" (tmp) );
0032   #else
0033     __asm__ volatile ("b _start");
0034   #endif
0035   while(1);
0036 #endif
0037 
0038   (void) source;
0039   (void) code;
0040 }