CHDK_DE Vorschauversion  Trunk Rev. 5429
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
filewrite.c-Dateireferenz
#include "lolevel.h"
#include "platform.h"
#include "../../../generic/filewrite.c"
+ Include-Abhängigkeitsdiagramm für filewrite.c:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  cam_ptp_data_chunk
 
struct  fwt_data_struct
 

Makrodefinitionen

#define MAX_CHUNKS_FOR_JPEG   7
 
#define FWT_MUSTSEEK   2
 
#define FWT_SEEKMASK   0xffffffff
 

Funktionen

void __attribute__ ((naked, noinline))
 

Makro-Dokumentation

#define FWT_MUSTSEEK   2

Definiert in Zeile 27 der Datei filewrite.c.

#define FWT_SEEKMASK   0xffffffff

Definiert in Zeile 28 der Datei filewrite.c.

#define MAX_CHUNKS_FOR_JPEG   7

Definiert in Zeile 9 der Datei filewrite.c.

Dokumentation der Funktionen

void __attribute__ ( (naked, noinline)  )

!!

Definiert in Zeile 34 der Datei filewrite.c.

34  {
35 asm volatile (
36  " STMFD SP!, {R1-R7,LR} \n"
37  " LDR R7, =0x96B0 \n"
38  " MOV R6, #0 \n"
39 "loc_FFA52400:\n"
40  " LDR R0, [R7, #0x14] \n"
41  " MOV R2, #0 \n"
42  " ADD R1, SP, #8 \n"
43  " MOV R5, R7 \n"
44  " BL sub_003F7218 \n" //ReceiveMessageQueue
45  " CMP R0, #0 \n"
46  " LDRNE R1, =0x38E \n"
47  " LDRNE R0, =0xFFA52538 \n" // dwFWrite.c
48  " BLNE _DebugAssert \n" //DebugAssert
49  " LDR R0, [SP, #8] \n"
50  " LDR R1, [R0] \n" // state (aka msg number)
51  " CMP R1, #0xB \n"
52  " ADDCC PC, PC, R1, LSL #2 \n"
53  " B loc_FFA52400 \n"
54  " B loc_FFA52508 \n"
55  " B loc_FFA52508 \n"
56  " B loc_FFA52508 \n"
57  " B loc_FFA52508 \n"
58  " B loc_FFA52508 \n"
59  " B loc_FFA52508 \n"
60  " B loc_FFA52508 \n"
61  " B loc_FFA52510 \n"
62  " B loc_FFA52464 \n"
63  " B loc_FFA524D4 \n"
64  " B loc_FFA524CC \n"
65 "loc_FFA52464:\n" // (state 8) empties the message queue
66  " STR R6, [SP] \n"
67 "loc_FFA52468:\n"
68  " LDR R0, [R5, #0x14] \n"
69  " MOV R1, SP \n"
70  " BL sub_003F745C \n" //GetNumberOfPostedMessages
71  " LDR R0, [SP] \n"
72  " CMP R0, #0 \n"
73  " BEQ loc_FFA52494 \n" // no message left in queue
74  " LDR R0, [R5, #0x14] \n"
75  " MOV R2, #0 \n"
76  " ADD R1, SP, #4 \n"
77  " BL sub_003F7218 \n" //ReceiveMessageQueue
78  " B loc_FFA52468 \n"
79 "loc_FFA52494:\n"
80  " LDR R0, [R5, #8] \n" // file descriptor
81  " CMN R0, #1 \n"
82  " BEQ loc_FFA524C0 \n"
83  " BL fwt_close\n" // mod! sub_FF830158 Close
84 "loc_FFA524A4:\n"
85  " MVN R0, #0 \n"
86  " STR R0, [R5, #8] \n" // file descriptor
87  " LDR R0, =0x131D20 \n"
88  " STR R6, [R5, #4] \n"
89  " BL sub_FF86671C \n" // path check or something
90  " MOV R1, #0 \n"
91  " BL sub_FF8647B8 \n" // file semaphore related
92 "loc_FFA524C0:\n"
93  " LDR R0, [R5, #0x10] \n"
94  " BL sub_003F7704 \n" //GiveSemaphore
95  " B loc_FFA52400 \n"
96 "loc_FFA524CC:\n"
97  " BL sub_FFA520F0_my \n" // -> open stage (state 10)
98  " B loc_FFA52400 \n"
99 "loc_FFA524D4:\n" // (state 9), append? overwrite?
100  " LDR R1, [R0, #4] \n"
101  " MOV R4, R0 \n"
102  " LDR R0, [R5, #8] \n" // file descriptor
103  " MOV R2, #0 \n" // SEEK_SET
104  " BL fwt_lseek\n" // mod! sub_FF8302F0 lseek
105  " CMN R0, #1 \n"
106  " LDREQ R0, =0x9200013 \n"
107  " MOV R1, R4 \n"
108  " STREQ R0, [R4, #0x14] \n"
109  " MOVNE R0, #0 \n" // next state = 0 (write)
110  " MOVEQ R0, #7 \n" // next state = 7 (close)
111  " BL sub_FFA52034 \n" // next state = 7 (close)
112  " B loc_FFA52400 \n"
113 "loc_FFA52508:\n"
114  " BL sub_FFA52730_my \n" // -> write stage (states 0..6)
115  " B loc_FFA52400 \n"
116 "loc_FFA52510:\n"
117  " BL sub_FFA5225C_my \n" // -> close stage (state 7)
118  " B loc_FFA52400 \n"
119  );
120 }