12,6 → 12,40 |
extern FTrace_Chunk_Ptr ActualChunk; |
extern void *OSD_current_pointer; |
|
/** |
* This flag keeps track of the current chunk sending action. |
* It is 1 if the output is still ongoing. |
* It is reset to 0 if the output is finished. |
*/ |
int chunk_sending = 0; |
|
/** |
* Pointer to the function that actually perform the chunk send. |
*/ |
void (*FTrace_internal_send_chunk)(FTrace_Chunk_Ptr) = NULL; |
|
/** |
* Initializes the poiter to the function for actually sending the chunk. |
*/ |
void FTrace_set_internal_chunk_sender(void (*ptr)(FTrace_Chunk_Ptr)) { |
FTrace_internal_send_chunk = ptr; |
} |
|
/** |
* This function is called before starting the chunck sending. |
*/ |
void FTrace_chunck_output_start() { |
chunk_sending = 1; |
} |
|
/** |
* This function is called after the chunck has been entirely sent. |
*/ |
void FTrace_chunck_output_end() { |
chunk_sending = 0; |
} |
|
|
void FTrace_fsave() |
{ |
|
110,17 → 144,24 |
|
} |
|
int FTrace_OSD_send_chunk(FTrace_Chunk_Ptr c, int osd_flag) |
{ |
int FTrace_OSD_send_chunk(FTrace_Chunk_Ptr c, int osd_flag) { |
|
extern volatile int sending_flag; |
// Tool: send the chunk using the selected method |
if (FTrace_internal_send_chunk != NULL) |
FTrace_internal_send_chunk(c); |
|
FTrace_OSD_create_udp_task(c); |
|
struct timespec t; |
t.tv_sec = 2; |
t.tv_nsec = 0; |
//cprintf("Chunk sending"); // Tool: DEBUG |
while(chunk_sending) { |
//cprintf("."); // Tool: DEBUG |
nanosleep(&t,NULL); |
} |
//cprintf("\n"); // Tool: DEBUG |
|
while(sending_flag); |
|
return 0; |
|
} |
|
int FTrace_OSD_chunk_dump(FTrace_Chunk_Ptr c) |