root/loader/ixus155_elph150/main.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. my_restart

   1 #include "../generic/check_compat.c"
   2 
   3 extern long *blob_chdk_core;
   4 extern long blob_chdk_core_size;
   5 
   6 void __attribute__((noreturn)) my_restart()
   7 {
   8     {
   9         long *dst = (long*)MEMISOSTART;
  10         const long *src = blob_chdk_core;
  11         long length = (blob_chdk_core_size + 3) >> 2;
  12 
  13   core_copy(src, dst, length);
  14 
  15 }
  16 
  17     // restart function
  18     // from sub_FF836668 (Restart)
  19     asm volatile (
  20       "    MOV     R0, #0x78 \n" 
  21       "    MCR     p15, 0, R0, c1, c0 \n" 
  22       "    MOV     R0, #0 \n" 
  23       "    MCR     p15, 0, R0, c7, c10, 4 \n" 
  24       "    MCR     p15, 0, R0, c7, c5 \n" 
  25       "    MCR     p15, 0, R0, c7, c6 \n" 
  26       "    MOV     R0, #0x80000006 \n" 
  27       "    MCR     p15, 0, R0, c9, c1 \n" 
  28       "    MCR     p15, 0, R0, c9, c1, 1 \n" 
  29       "    MRC     p15, 0, R0, c1, c0 \n" 
  30       "    ORR     R0, R0, #0x50000 \n" 
  31       "    MCR     p15, 0, R0, c1, c0 \n" 
  32       "    LDR     R0, =0x12345678 \n" 
  33       "    MOV     R1, #0x80000000 \n" 
  34       "    STR     R0, [R1, #0xFFC] \n" 
  35       //"    LDR     R0, =0xFF820000 \n"        // -
  36       "    MOV     R0, %0\n"                    // +
  37       //"    LDMFD   SP!, {R4,LR} \n"           // -
  38       "    BX      R0 \n"
  39          : : "r"(MEMISOSTART) : "memory","r0","r1","r2","r3","r4"
  40         );
  41 
  42         while(1);
  43 }
  44 

/* [<][>][^][v][top][bottom][index][help] */