This source file includes following definitions.
- my_restart
- clean_data_cache_line_my
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 check_compat();
9
10 long *dst = (long*)MEMISOSTART;
11 const long *src = blob_chdk_core;
12 long length = (blob_chdk_core_size + 3) >> 2;
13
14 core_copy(src, dst, length);
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 *(volatile unsigned *)(0x4ffc)=0x12345678;
40
41 asm volatile (
42 "mov r1, %1\n"
43 "mov r0, %0\n"
44
45
46
47 "blx clean_data_cache_line_my\n"
48
49
50 "mov r0, %0\n"
51 "add r0, r0, #1\n"
52 "bx r0\n"
53 : : "r"(MEMISOSTART), "r"(((blob_chdk_core_size+3)>>2)<<2) : "memory","r0","r1","r2","r3","r4"
54 );
55 while(1);
56 }
57
58 void __attribute__((naked,noinline)) clean_data_cache_line_my() {
59 asm volatile (
60 " cmp.w r1, #0x4000\n"
61 " bhs loc_fc119444\n"
62 " dsb sy\n"
63 " add r1, r0\n"
64 " bic r0, r0, #0x1f\n"
65 "loc_fc119432:\n"
66 " mcr p15, #0, r0, c7, c10, #1\n"
67 " add.w r0, r0, #0x20\n"
68 " cmp r0, r1\n"
69 " blo loc_fc119432\n"
70 " dsb sy\n"
71 " bx lr\n"
72 "loc_fc119444:\n"
73 " dsb sy\n"
74 " mov.w r1, #0\n"
75 "loc_fc11944c:\n"
76 " mov.w r0, #0\n"
77 "loc_fc119450:\n"
78 " orr.w r2, r1, r0\n"
79 " mcr p15, #0, r2, c7, c10, #2\n"
80 " add.w r0, r0, #0x20\n"
81 " cmp.w r0, #0x1000\n"
82 " bne loc_fc119450\n"
83 " add.w r1, r1, #0x40000000\n"
84 " cmp r1, #0\n"
85 " bne loc_fc11944c\n"
86 " dsb sy\n"
87 " bx lr\n"
88 ".ltorg\n"
89 );
90 }
91