root/platform/ixus750_sd550/sub/100g/boot.c

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

DEFINITIONS

This source file includes following definitions.
  1. boot
  2. h_usrInit
  3. h_usrKernelInit
  4. h_usrRoot

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 #include "core.h"
   4 
   5 const char * const new_sa = &_end;
   6 
   7 /* Ours stuff */
   8 extern long wrs_kernel_bss_start;
   9 extern long wrs_kernel_bss_end;
  10 extern void createHook (void *pNewTcb);
  11 extern void deleteHook (void *pTcb);
  12 
  13 void boot();
  14 
  15 /* "relocated" functions */
  16 void __attribute__((naked,noinline)) h_usrInit();
  17 void __attribute__((naked,noinline)) h_usrKernelInit();
  18 void __attribute__((naked,noinline)) h_usrRoot();
  19 
  20 
  21 void boot()
  22 {
  23     long *canon_data_src = (void*)0xFFAEAEF0;
  24     long *canon_data_dst = (void*)0x1900;
  25     long canon_data_len = 0xEA00;
  26     long *canon_bss_start = (void*)0x10300; // just after data
  27     long canon_bss_len = 0x9f5B0 - 0x10300;
  28     long i;
  29 
  30     asm volatile (
  31         "MRC     p15, 0, R0,c1,c0\n"
  32         "ORR     R0, R0, #0x1000\n"
  33         "ORR     R0, R0, #4\n"
  34         "ORR     R0, R0, #1\n"
  35         "MCR     p15, 0, R0,c1,c0\n"
  36     :::"r0");
  37 
  38 
  39     for(i=0;i<canon_data_len/4;i++)
  40         canon_data_dst[i]=canon_data_src[i];
  41 
  42     for(i=0;i<canon_bss_len/4;i++)
  43         canon_bss_start[i]=0;
  44 
  45     asm volatile (
  46         "MRC     p15, 0, R0,c1,c0\n"
  47         "ORR     R0, R0, #0x1000\n"
  48         "BIC     R0, R0, #4\n"
  49         "ORR     R0, R0, #1\n"
  50         "MCR     p15, 0, R0,c1,c0\n"
  51     :::"r0");
  52 
  53     h_usrInit();
  54 }
  55 
  56 
  57 void h_usrInit()
  58 {
  59     asm volatile (
  60         "STR    LR, [SP,#-4]!\n"
  61         "BL     sub_FF811A40\n"
  62         "MOV    R0, #2\n"
  63         "MOV    R1, R0\n"
  64         "BL     sub_FFACEB54\n"
  65         "BL     sub_FFABB22C\n"
  66         "BL     sub_FF811298\n"
  67         "BL     sub_FF811800\n"
  68         "LDR    LR, [SP],#4\n"
  69         "B      h_usrKernelInit\n"
  70     );
  71 }
  72 
  73 void  h_usrKernelInit()
  74 {
  75     asm volatile (
  76         "STMFD   SP!, {R4,LR}\n"
  77         "SUB     SP, SP, #8\n"
  78         "BL      sub_FFACF054\n" //classlibinit
  79         "BL      sub_FFAE4340\n" //tasklibinit
  80         "LDR     R3, =0xf294\n"
  81         "LDR     R2, =0x9b6a0\n"
  82         "LDR     R1, [R3]\n"
  83         "LDR     R0, =0x9ef70\n"
  84         "MOV     R3, #0x100\n"
  85         "BL      sub_FFADD190\n" //qinit
  86         "LDR     R3, =0xf254\n"
  87         "LDR     R0, =0xfb1c\n"
  88         "LDR     R1, [R3]\n"
  89         "BL      sub_FFADD190\n" //qinit
  90         "LDR     R3, =0xf310\n"
  91         "LDR     R0, =0x9ef44\n"
  92         "LDR     R1, [R3]\n"
  93         "BL      sub_FFADD190\n" //qinit
  94         "BL      sub_FFAE8EC0\n" //workqinit
  95         "BL      sub_FF811384\n"
  96         "MOV     R4, #0\n"
  97         "MOV     R3, R0\n"
  98         "MOV     R12, #0x800\n"
  99         "LDR     R0, =h_usrRoot\n"
 100         "MOV     R1, #0x4000\n"
 101     );
 102 //        "LDR     R2, =0xAC2B0\n"      // 0x7C2B0 + 0x30000
 103     asm volatile (
 104         "LDR     R2, =new_sa\n"
 105         "LDR     R2, [R2]\n"
 106     );
 107     asm volatile (
 108         "STR     R12, [SP]\n"
 109         "STR     R4, [SP,#4]\n"
 110         "BL      sub_FFAE1580\n" //kernelinit
 111         "ADD     SP, SP, #8\n"
 112         "LDMFD   SP!, {R4,PC}\n"
 113     );
 114 }
 115 
 116 
 117 
 118 void  h_usrRoot()
 119 {
 120     asm volatile (
 121         "STMFD   SP!, {R4,R5,LR}\n"
 122         "MOV     R5, R0\n"
 123         "MOV     R4, R1\n"
 124         "BL      sub_FF811AA8\n"
 125         "MOV     R1, R4\n"
 126         "MOV     R0, R5\n"
 127         "BL      sub_FFAD51D0\n" //meminit
 128         "MOV     R1, R4\n"
 129         "MOV     R0, R5\n"
 130         "BL      sub_FFAD5C48\n" //mempartlibinit
 131         "BL      sub_FF8118C0\n"
 132         "BL      sub_FF8117DC\n"
 133         "MOV     R0, #0x32\n"
 134         "BL      sub_FFAD7BEC\n" //selectinit
 135         "BL      sub_FF811AEC\n"
 136         "BL      sub_FF811ACC\n"
 137         "BL      sub_FF811B18\n"
 138         "BL      sub_FFAD74AC\n" //seltaskdeletehookadd
 139         "BL      sub_FF811A9C\n"
 140     );
 141 
 142     _taskCreateHookAdd(createHook);
 143     _taskDeleteHookAdd(deleteHook);
 144 
 145     drv_self_hide();
 146 
 147     asm volatile (
 148         "LDMFD   SP!, {R4,R5,LR}\n"
 149         "B       sub_FF811444\n"
 150     );
 151 }

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