CHDK_DE Vorschauversion  Trunk Rev. 6014
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
boot.c-Dateireferenz
#include "lolevel.h"
#include "platform.h"
#include "core.h"
#include "dryos31.h"
#include "camera_info.h"
+ Include-Abhängigkeitsdiagramm für boot.c:

gehe zum Quellcode dieser Datei

Funktionen

void task_CaptSeq ()
 
void task_InitFileModules ()
 
void task_ExpDrv ()
 
void task_FsIoNotifyTask ()
 
void CreateTask_spytask ()
 
void __attribute__ ((naked, noinline))
 
void patch_mzrm_sendmsg ()
 
void init_required_fw_features (void)
 
int check_fsio_skip (char *msg)
 

Variablen

const char *const new_sa = &_end
 
int physw0_override
 

Dokumentation der Funktionen

void __attribute__ ( (naked, noinline)  )

!!

Definiert in Zeile 95 der Datei boot.c.

95  {
96  asm volatile (
97  " mrc p15, #0, r0, c0, c0, #5\n"
98  " ands r0, #0xf\n"
99  " beq loc_boot\n" // let core0 boot
100  " adr r0, loc_boot\n"
101  " orr r0, #1\n"
102  " bl sub_e0539e68\n" // park core1 then continue at r0
103  "loc_boot:\n"
104 
105  //capdis -f=chdk -s=0xe0020011 -c=65 -stubs PRIMARY.BIN 0xe0000000
106  " ldr r0, =0xe0020200\n"
107  " mcr p15, #0, r0, c12, c0, #0\n"
108  " isb sy\n"
109  " movw r0, #0x2000\n"
110  " movt r0, #0\n"
111  " mov sp, r0\n"
112  " mrc p15, #0, r5, c0, c0, #5\n"
113  " ands r0, r5, #0xf\n"
114  " bne loc_e0020032\n"
115  " b.w loc_e002003c\n"
116  "loc_e0020032:\n"
117  " b.w sub_e00200f8_my\n" // Patched
118 // " movs r0, r0\n" // Data
119 // " lsls r0, r0, #8\n" // Data
120 // " b loc_e0020042\n" // Data
121  "loc_e002003c:\n"
122  " ldr r0, =0xe0fd3770\n"
123  " ldr r1, =0x00008000\n"
124  " ldr r3, =0x0004c618\n"
125  "loc_e0020042:\n"
126  " cmp r1, r3\n"
127  " itt lo\n"
128  " ldrlo r2, [r0], #4\n"
129  " strlo r2, [r1], #4\n"
130  " blo loc_e0020042\n"
131  " ldr r1, =0x002c460c\n"
132  " mov.w r2, #0\n"
133  "loc_e0020056:\n"
134  " cmp r3, r1\n"
135  " it lo\n"
136  " strlo r2, [r3], #4\n"
137  " blo loc_e0020056\n"
138  " ldr r0, =0xe1017d88\n" // **"zH"
139  " ldr r1, =0x01900000\n" // **"zH"
140  " ldr r3, =0x0190139c\n"
141  "loc_e0020066:\n"
142  " cmp r1, r3\n"
143  " itt lo\n"
144  " ldrlo r2, [r0], #4\n"
145  " strlo r2, [r1], #4\n"
146  " blo loc_e0020066\n"
147  " ldr r0, =0x01900000\n" // **"zH"
148  " ldr r1, =0x0000139c\n"
149  " bl sub_e042eb74\n"
150  " ldr r0, =0x01900000\n" // **"zH"
151  " ldr r1, =0x0000139c\n"
152  " bl sub_e042ec4c\n"
153  " ldr r0, =0xe1019124\n"
154  " ldr r1, =0xdffc4900\n"
155  " ldr r3, =0xdffd0908\n"
156  "loc_e002008a:\n"
157  " cmp r1, r3\n"
158  " itt lo\n"
159  " ldrlo r2, [r0], #4\n"
160  " strlo r2, [r1], #4\n"
161  " blo loc_e002008a\n"
162  " ldr r1, =0xdffd0908\n"
163  " mov.w r2, #0\n"
164  "loc_e002009e:\n"
165  " cmp r3, r1\n"
166  " it lo\n"
167  " strlo r2, [r3], #4\n"
168  " blo loc_e002009e\n"
169 
170  " blx patch_mzrm_sendmsg\n"
171 
172  // Install CreateTask patch
173  // use half words in case source or destination not word aligned
174  " adr r0, patch_CreateTask\n" // src: Patch data
175  " ldr r1, =hook_CreateTask\n" // dest: Address to patch
176  " add r2, r0, #8\n" // two words
177  "patch_hook_loop:\n"
178  " ldrh r3, [r0],#2\n"
179  " strh r3, [r1],#2\n"
180  " cmp r0,r2\n"
181  " blo patch_hook_loop\n"
182 
183  " ldr r0, =0xdffc4900\n"
184  " ldr r1, =0x0000c008\n"
185  " bl sub_e042eb74\n"
186  " ldr r0, =0xdffc4900\n"
187  " ldr r1, =0x0000c008\n"
188  " bl sub_e042ec4c\n"
189 // " ldr r0, =loc_e0020032\n" // -
190 // " orr r0, r0, #1\n" // -
191 // " bx r0\n" // -
192  " b loc_e0020032\n" // +
193 
194  // CreateTask patch, must be aligned as the original
195  " .align 2\n"
196  " .short 0\n" // added for alignment
197  "patch_CreateTask:\n"
198  " ldr.w pc, _createtask_my\n" // Do jump to absolute address CreateTask_my
199  "_createtask_my:\n"
200  " .long CreateTask_my + 1\n" // has to be a thumb address
201  " .align 1\n"
202  );
203 }
int check_fsio_skip ( char *  msg)

Definiert in Zeile 916 der Datei boot.c.

917 {
918  // Short file name (< 32 chars)
919  char* name = msg + 4;
920  // Long file name (will be 0 if not allocated)
921  char* long_name = *((char**)(msg+0x5c));
922  if (long_name != 0) name = long_name;
923  int l = strlen(name);
924 
925  // G7X2 crashes when deleting or creating non-Canon files in DCIM image folder if camera is connected to PC via USB
926  // This causes the FsIoNotify task to ignore files that are not Canon image files.
927  // Only applies to files in A/DCIM folders with filename xxx_nnnn.ext, and ext is not JPG or CR2.
928  int skip = ((strncmp(name,"A/DCIM",6) == 0) && (name[l-9] == '_') && (strncmp(name+l-4, ".JPG", 4) != 0) && (strncmp(name+l-4, ".CR2", 4) != 0));
929 
930  // If we tell FsIoNotify to skip processing message, then we need to free the long name memory buffer
931  if (skip && (long_name != 0))
932  free(long_name);
933 
934  return skip;
935 }
void CreateTask_spytask ( )

Definiert in Zeile 82 der Datei boot.c.

83 {
84 // _CreateTask("BlinkTask", 0x19, 0x800, blinktask, 0);
85  _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
86 }
void init_required_fw_features ( void  )

Definiert in Zeile 584 der Datei boot.c.

585 {
586  extern void _init_focus_eventflag();
587  _init_focus_eventflag();
588  extern void _init_nd_eventflag();
589  _init_nd_eventflag();
590  extern int av_override_semaphore;
591  extern int _CreateBinarySemaphoreStrictly(int x, int y);
592  av_override_semaphore = _CreateBinarySemaphoreStrictly(0,0);
593 }
void patch_mzrm_sendmsg ( )

Definiert in Zeile 238 der Datei boot.c.

239 {
240  extern int debug_logging_flag;
241  extern void (*debug_logging_ptr)(char* fmt, ...);
242 
243  // Each bit in debug_logging_flag enables logging in different areas of the firmware code - only set the bit required for mzrm logging.
244  debug_logging_flag = 0x200;
245  debug_logging_ptr = debug_logging_my;
246 }
void task_CaptSeq ( )
void task_ExpDrv ( )
void task_FsIoNotifyTask ( )
void task_InitFileModules ( )

Variablen-Dokumentation

const char* const new_sa = &_end

Definiert in Zeile 9 der Datei boot.c.

int physw0_override

Definiert in Zeile 122 der Datei kbd.c.