root/platform/ixus70_sd1000/sub/101b/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 
  14 void boot();
  15 
  16 /* "relocated" functions */
  17 void __attribute__((naked,noinline)) h_usrInit();
  18 void __attribute__((naked,noinline)) h_usrKernelInit();
  19 void __attribute__((naked,noinline)) h_usrRoot();
  20 
  21 
  22 
  23 void boot()
  24 {
  25     long *canon_data_src = (void*)0xFFB87FA0; 
  26     long *canon_data_dst = (void*)0x1900; 
  27     long canon_data_len = 0xCA00; 
  28     long *canon_bss_start = (void*)0xE300; 
  29     long canon_bss_len = 0xBEF70 - 0xE300; 
  30     long i;
  31 
  32     asm volatile (
  33         "MRC     p15, 0, R0,c1,c0\n"
  34         "ORR     R0, R0, #0x1000\n"
  35         "ORR     R0, R0, #4\n"
  36         "ORR     R0, R0, #1\n"
  37         "MCR     p15, 0, R0,c1,c0\n"
  38     :::"r0");
  39 
  40     for(i=0;i<canon_data_len/4;i++)
  41         canon_data_dst[i]=canon_data_src[i];
  42 
  43     for(i=0;i<canon_bss_len/4;i++)
  44         canon_bss_start[i]=0;
  45 
  46     asm volatile (
  47         "MRC     p15, 0, R0,c1,c0\n"
  48         "ORR     R0, R0, #0x1000\n"
  49         "BIC     R0, R0, #4\n"
  50         "ORR     R0, R0, #1\n"
  51         "MCR     p15, 0, R0,c1,c0\n"
  52     :::"r0");
  53 
  54     h_usrInit();
  55 }
  56 
  57 
  58 void h_usrInit()
  59 {
  60     asm volatile (
  61         "STR     LR, [SP,#-4]!\n"
  62         "BL      sub_FF811968\n"
  63         "MOV     R0, #2\n"
  64         "MOV     R1, R0\n"
  65         "BL      sub_FF919D64\n" //unknown_libname_230
  66         "BL      sub_FF90DE5C\n" //excVecInit
  67         "BL      sub_FF8111C4\n"
  68         "BL      sub_FF811728\n"
  69         "LDR     LR, [SP],#4\n"
  70         "B       h_usrKernelInit\n"
  71     );
  72 }
  73 
  74 void  h_usrKernelInit()
  75 {
  76     asm volatile (
  77         "STMFD   SP!, {R4,LR}\n"
  78         "SUB     SP, SP, #8\n"
  79         "BL      sub_FF91A264\n" //classLibInit
  80         "BL      sub_FF92A390\n" //taskLibInit
  81         "LDR     R3, =0x59C0\n"
  82         "LDR     R2, =0xBBFE0\n"
  83         "LDR     R1, [R3]\n"
  84         "LDR     R0, =0xBCC30\n"
  85         "MOV     R3, #0x100\n"
  86         "BL      sub_FF925F80\n" //qInit
  87         "LDR     R3, =0x5980\n"
  88         "LDR     R0, =0x5D20\n"
  89         "LDR     R1, [R3]\n"
  90         "BL      sub_FF925F80\n" //qInit
  91         "LDR     R3, =0x5A3C\n"
  92         "LDR     R0, =0xBCC04\n"
  93         "LDR     R1, [R3]\n"
  94         "BL      sub_FF925F80\n" //qInit
  95         "BL      sub_FF92E74C\n" //workQInit
  96         "BL      sub_FF8112AC\n"
  97         "MOV     R4, #0\n"
  98         "MOV     R3, R0\n"
  99         "MOV     R12, #0x800\n"
 100         "LDR     R0, =h_usrRoot\n" // R0, =sub_FF811A60 (h_usrRoot))
 101         "MOV     R1, #0x4000\n"
 102     );    
 103 //      "LDR     R2, =0xEEF70\n" // 0xBEF70 + 0x30000
 104     asm volatile (
 105         "LDR     R2, =new_sa\n"
 106         "LDR     R2, [R2]\n"
 107     );
 108     asm volatile (
 109         "STR     R12, [SP]\n"
 110         "STR     R4, [SP,#4]\n"
 111         "BL      sub_FF9275D0\n" //kernelInit
 112         "ADD     SP, SP, #8\n"
 113         "LDMFD   SP!, {R4,PC}\n"
 114     );
 115 }
 116 
 117 
 118 
 119 void  h_usrRoot()
 120 {
 121     asm volatile (
 122         "STMFD   SP!, {R4,R5,LR}\n"
 123         "MOV     R5, R0\n"
 124         "MOV     R4, R1\n"
 125         "BL      sub_FF8119D0\n"
 126         "MOV     R1, R4\n"
 127         "MOV     R0, R5\n"
 128         "BL      sub_FF91ED1C\n" //memInit
 129         "MOV     R1, R4\n"
 130         "MOV     R0, R5\n"
 131         "BL      sub_FF91F794\n" //memPartLibInit
 132 //      "BL      sub_FF8117E8\n" //nullSub_1
 133         "BL      sub_FF811704\n"
 134         "BL      sub_FF811A0C\n"
 135         "BL      sub_FF8119F0\n"
 136         "BL      sub_FF811A38\n"
 137         "BL      sub_FF8119C4\n"
 138     );
 139 
 140     _taskCreateHookAdd(createHook);
 141     _taskDeleteHookAdd(deleteHook);
 142 
 143     drv_self_hide();
 144 
 145     asm volatile (
 146         "LDMFD   SP!, {R4,R5,LR}\n"
 147         "B       sub_FF81136C\n" //IsEmptyWriteCache_2
 148     );
 149 }
 150 

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