This source file includes following definitions.
- boot
- h_usrInit
- h_usrKernelInit
- h_usrRoot
1 #include "lolevel.h"
2 #include "platform.h"
3 #include "core.h"
4
5 const char * const new_sa = &_end;
6
7
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
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*)0xFFB6DA40;
24 long *canon_data_dst = (void*)0x1900;
25 long canon_data_len = 0xCC00;
26 long *canon_bss_start = (void*)0xE500;
27 long canon_bss_len = 0xA4D10 - 0xE500;
28
29 long i;
30
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
41 for(i=0; i<canon_data_len/4; i++)
42 canon_data_dst[i]=canon_data_src[i];
43
44 for(i=0; i<canon_bss_len/4; i++)
45 canon_bss_start[i]=0;
46
47
48 asm volatile(
49 "MRC p15, 0, R0,c1,c0\n"
50 "ORR R0, R0, #0x1000\n"
51 "BIC R0, R0, #4\n"
52 "ORR R0, R0, #1\n"
53 "MCR p15, 0, R0,c1,c0\n"
54 :::"r0"
55 );
56
57 h_usrInit();
58 }
59
60
61 void h_usrInit() {
62 asm volatile(
63 "STR LR, [SP,#-4]!\n"
64 "BL sub_FF811968\n"
65 "MOV R0, #2\n"
66 "MOV R1, R0\n"
67 "BL sub_FFB54584\n"
68 "BL sub_FFB46DF8\n"
69 "BL sub_FF8111C4\n"
70 "BL sub_FF811728\n"
71 "LDR LR, [SP],#4\n"
72 "B h_usrKernelInit\n"
73 );
74 }
75
76
77 void h_usrKernelInit() {
78 asm volatile(
79 "STMFD SP!, {R4,LR}\n"
80 "SUB SP, SP, #8\n"
81 "BL sub_FFB54A84\n"
82 "BL sub_FFB6786C\n"
83 "LDR R3, =0xD520\n"
84 "LDR R2, =0xA1960\n"
85 "LDR R1, [R3]\n"
86 "LDR R0, =0xA46D0\n"
87 "MOV R3, #0x100\n"
88 "BL sub_FFB6097C\n"
89 "LDR R3, =0xD4E0\n"
90 "LDR R0, =0xDD28\n"
91 "LDR R1, [R3]\n"
92 "BL sub_FFB6097C\n"
93 "LDR R3, =0xD59C\n"
94 "LDR R0, =0xA46A4\n"
95 "LDR R1, [R3]\n"
96 "BL sub_FFB6097C\n"
97 "BL sub_FFB6BC28\n"
98 "BL sub_FF8112AC\n"
99 "MOV R4, #0\n"
100 "MOV R3, R0\n"
101 "MOV R12, #0x800\n"
102 "LDR R0, =h_usrRoot\n"
103 "MOV R1, #0x4000\n"
104 "LDR R2, =new_sa\n"
105 "LDR R2, [R2]\n"
106 "STR R12, [SP]\n"
107 "STR R4, [SP,#4]\n"
108 "BL sub_FFB64AAC\n"
109 "ADD SP, SP, #8\n"
110 "LDMFD SP!, {R4,PC}\n"
111 );
112 }
113
114 void h_usrRoot() {
115
116 asm volatile(
117 "STMFD SP!, {R4,R5,LR}\n"
118 "MOV R5, R0\n"
119 "MOV R4, R1\n"
120 "BL sub_FF8119D0\n"
121 "MOV R1, R4\n"
122 "MOV R0, R5\n"
123 "BL sub_FFB59718\n"
124 "MOV R1, R4\n"
125 "MOV R0, R5\n"
126 "BL sub_FFB5A190\n"
127
128 "BL sub_FF811704\n"
129 "BL sub_FF811A0C\n"
130
131 "BL sub_FF8119F0\n"
132 "BL sub_FF811A38\n"
133 "BL sub_FF8119C4\n"
134 );
135
136 _taskCreateHookAdd(createHook);
137 _taskDeleteHookAdd(deleteHook);
138
139 drv_self_hide();
140
141
142 asm volatile(
143 "LDMFD SP!, {R4,R5,LR}\n"
144 "B sub_FF81136C\n"
145 );
146 }
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165