FreeCalypso > hg > tcs211-l1-reconst
annotate chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_func.c @ 80:6c740cf30da3
l1_ctl.c: initial import of LoCosto source
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Tue, 29 Mar 2016 16:04:33 +0000 |
parents | 8abeb95e9766 |
children |
rev | line source |
---|---|
19
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1 /************* Revision Controle System Header ************* |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
2 * GSM Layer 1 software |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
3 * L1_DYN_DWL_FUNC.C |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
4 * |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
5 * Filename l1_dyn_dwl_func.c |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
6 * Copyright 2004 (C) Texas Instruments |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
7 * |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
8 ************* Revision Controle System Header *************/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
9 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
10 #include <stdio.h> |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
11 #include <string.h> |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
12 #include "l1_confg.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
13 #include "l1_types.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
14 #include "l1_const.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
15 #include "l1_signa.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
16 #include "sys_types.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
17 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
18 #if(L1_DYN_DSP_DWNLD == 1) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
19 #include "l1_dyn_dwl_const.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
20 #include "l1_dyn_dwl_proto.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
21 #include "l1_dyn_dwl_defty.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
22 #endif |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
23 #if TESTMODE |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
24 #include "l1tm_defty.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
25 #endif |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
26 #if (AUDIO_TASK == 1) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
27 #include "l1audio_const.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
28 #include "l1audio_cust.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
29 #include "l1audio_defty.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
30 #endif |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
31 #if (L1_GTT == 1) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
32 #include "l1gtt_const.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
33 #include "l1gtt_defty.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
34 #endif |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
35 #if (L1_MP3 == 1) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
36 #include "l1mp3_defty.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
37 #endif //L1_MP3 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
38 #if (L1_MIDI == 1) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
39 #include "l1midi_defty.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
40 #endif |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
41 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
42 #include "l1_defty.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
43 #include "l1_varex.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
44 #include "l1_macro.h" |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
45 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
46 #if (L1_DYN_DSP_DWNLD == 1) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
47 #ifndef NULL |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
48 #define NULL 0 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
49 #endif |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
50 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
51 extern T_DYN_DWNLD_MCU_DSP *dyn_dwl_ndb; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
52 #if (CODE_VERSION == SIMULATION) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
53 extern T_DYN_DWNLD_MCU_DSP dyn_dwl_ndb_sim; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
54 extern UWORD16 dwnld_area_array[SIZE_DWNLD_AREA_SIMU]; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
55 #endif // CODE_VERSION == SIMULATION |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
56 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
57 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
58 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
59 /* l1_initialize_patch_parameters */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
60 /*------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
61 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
62 /* Parameters : */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
63 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
64 /* Return : size of the patch */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
65 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
66 /* Description : Initialize patch parameters and returns the size of the patch*/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
67 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
68 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
69 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
70 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
71 UWORD16 l1_initialize_patch_parameters(void) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
72 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
73 UWORD16 patch_size = 0; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
74 |
26
428835f700ef
l1_dyn_dwl_func.c compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
19
diff
changeset
|
75 /* Initialize download patch parameters */ |
428835f700ef
l1_dyn_dwl_func.c compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
19
diff
changeset
|
76 l1_apihisr.dyn_dwnld.running_source_pointer = l1a_apihisr_com.dyn_dwnld.copy_parameters.start_MCU_copy_address[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter]; |
428835f700ef
l1_dyn_dwl_func.c compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
19
diff
changeset
|
77 patch_size = l1a_apihisr_com.dyn_dwnld.copy_parameters.size_array[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter]; |
19
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
78 dyn_dwl_ndb->d_api_dwl_crc = 0x0; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
79 return patch_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
80 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
81 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
82 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
83 /* l1_set_uninstall_parameters */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
84 /*------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
85 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
86 /* Parameters : void */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
87 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
88 /* Return : void */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
89 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
90 /* Description : Set uninstall parameters */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
91 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
92 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
93 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
94 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
95 void l1_set_uninstall_parameters(void) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
96 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
97 /* Set next uninstall adress (pointer incremented) */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
98 dyn_dwl_ndb->d_api_dwl_function_address[0] = (API) (l1a_apihisr_com.dyn_dwnld.uninstall_parameters.address[l1a_apihisr_com.dyn_dwnld.uninstall_parameters.num_of_elem - l1_apihisr.dyn_dwnld.uninstall_counter] & 0x0000FFFF); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
99 dyn_dwl_ndb->d_api_dwl_function_address[1] = (API) ((l1a_apihisr_com.dyn_dwnld.uninstall_parameters.address[l1a_apihisr_com.dyn_dwnld.uninstall_parameters.num_of_elem - l1_apihisr.dyn_dwnld.uninstall_counter] >> 16) & 0x0000FFFF); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
100 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
101 /* Set uninstall command */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
102 dyn_dwl_ndb->d_api_dwl_download_ctrl = (API) C_DWL_DOWNLOAD_CTRL_UNINSTALL; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
103 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
104 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
105 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
106 /* l1_initialize_pointers_for_copy */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
107 /*------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
108 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
109 /* Parameters : address of source and destination pointer */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
110 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
111 /* Return : source and destination address modified by reference */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
112 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
113 /* Description : Initialize the pointers for the copy */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
114 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
115 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
116 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
117 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
118 void l1_initialize_pointers_for_copy(UWORD16 **pp_dest_mcu, UWORD16 **pp_src_mcu) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
119 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
120 /* BEGIN: Initialize download area parameters at start download area */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
121 dyn_dwl_ndb->d_api_dwl_write_pointer = l1a_apihisr_com.dyn_dwnld.copy_parameters.start_of_dwnld_area - 1; // correction |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
122 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
123 /* Initialize pointers */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
124 #if (CODE_VERSION == SIMULATION) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
125 *pp_dest_mcu = (UWORD16 *) dwnld_area_array; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
126 #else |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
127 *pp_dest_mcu = (UWORD16 *) API_address_dsp2mcu(l1a_apihisr_com.dyn_dwnld.copy_parameters.start_of_dwnld_area); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
128 #endif // CODE_VERSION == SIMULATION |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
129 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
130 *pp_src_mcu = (UWORD16 *) l1_apihisr.dyn_dwnld.running_source_pointer; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
131 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
132 |
27
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
133 /*--------------------------------------------------------*/ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
134 /* l1_memcpy_16bit() */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
135 /*--------------------------------------------------------*/ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
136 /* */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
137 /* Description: */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
138 /* ------------ */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
139 /* This function is equivalemt of memcopy. Thid function */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
140 /* does only 8/16 bit accessed to both source and */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
141 /* destination */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
142 /* */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
143 /* Input parameter: */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
144 /* --------------- */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
145 /* "src" - input pointer */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
146 /* "len" - number of bytes to copy */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
147 /* */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
148 /* Output parameter: */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
149 /* ---------------- */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
150 /* "dst" - output pointer */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
151 /* */ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
152 /*--------------------------------------------------------*/ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
153 void l1_memcpy_16bit(void *dst,void* src,unsigned int len) |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
154 { |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
155 unsigned int i; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
156 unsigned int tempLen; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
157 unsigned char *cdst,*csrc; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
158 unsigned short *ssrc,*sdst; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
159 |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
160 cdst=dst; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
161 csrc=src; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
162 sdst=dst; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
163 ssrc=src; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
164 |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
165 if(((unsigned int)src&0x01) || ((unsigned int)dst&0x01)){ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
166 // if either source or destination is not 16-bit aligned do the entire memcopy |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
167 // in 8-bit |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
168 for(i=0;i<len;i++){ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
169 *cdst++=*csrc++; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
170 } |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
171 } |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
172 else{ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
173 // if both the source and destination are 16-bit aligned do the memcopy |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
174 // in 16-bits |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
175 tempLen = len>>1; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
176 for(i=0;i<tempLen;i++){ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
177 *sdst++ = *ssrc++; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
178 } |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
179 if(len & 0x1){ |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
180 // if the caller wanted to copy odd number of bytes do a last 8-bit copy |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
181 cdst=(unsigned char*)sdst; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
182 csrc=(unsigned char*)ssrc; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
183 *cdst++ = *csrc++; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
184 } |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
185 } |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
186 return; |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
187 } |
8abeb95e9766
l1_memcpy_16bit() moved from l1_func.c into l1_dyn_dwl_func.c
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
26
diff
changeset
|
188 |
19
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
189 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
190 /* l1_copy_till_the_end_of_the_patch_and_update_write_pointer */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
191 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
192 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
193 /* Parameters : size of the patch, source and destination pointer */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
194 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
195 /* Return : none */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
196 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
197 /* Description : Copy until the end of the patch is reached */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
198 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
199 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
200 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
201 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
202 void l1_copy_till_the_end_of_the_patch_and_update_write_pointer(UWORD16 tmp_patch_size, UWORD16* p_dest_mcu, UWORD16* p_src_mcu) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
203 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
204 while (tmp_patch_size > NUM_WORDS_COPY_API) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
205 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
206 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, NUM_WORDS_COPY_API*sizeof(UWORD16)); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
207 p_dest_mcu += NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
208 p_src_mcu += NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
209 tmp_patch_size -= NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
210 dyn_dwl_ndb->d_api_dwl_write_pointer += NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
211 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
212 if (tmp_patch_size != 0) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
213 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
214 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, tmp_patch_size*sizeof(UWORD16)); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
215 dyn_dwl_ndb->d_api_dwl_write_pointer += tmp_patch_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
216 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
217 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
218 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
219 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
220 /* l1_copy_till_end_of_dwnld_area_and_update_write_pointer */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
221 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
222 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
223 /* Parameters : address of size of the patch, size of download area, */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
224 /* addresses of source pointer, destination pointer */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
225 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
226 /* Return : source pointer and size modified by reference */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
227 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
228 /* Description : Copy until the end of download area is reached */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
229 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
230 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
231 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
232 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
233 void l1_copy_till_end_of_dwnld_area_and_update_write_pointer(UWORD16 tmp_dwnld_area_size,UWORD16 *p_dest_mcu, UWORD16 *p_tmp_patch_size, UWORD16 **pp_src_mcu) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
234 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
235 UWORD16 tmp_patch_size = *p_tmp_patch_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
236 UWORD16 *p_src_mcu = (UWORD16 *)*pp_src_mcu; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
237 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
238 while (tmp_dwnld_area_size > NUM_WORDS_COPY_API) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
239 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
240 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, NUM_WORDS_COPY_API*sizeof(UWORD16)); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
241 p_dest_mcu += NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
242 p_src_mcu += NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
243 tmp_patch_size -= NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
244 tmp_dwnld_area_size -= NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
245 dyn_dwl_ndb->d_api_dwl_write_pointer += NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
246 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
247 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
248 if (tmp_dwnld_area_size > 0) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
249 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
250 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, tmp_dwnld_area_size*sizeof(UWORD16)); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
251 p_src_mcu += tmp_dwnld_area_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
252 tmp_patch_size -= tmp_dwnld_area_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
253 dyn_dwl_ndb->d_api_dwl_write_pointer += tmp_dwnld_area_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
254 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
255 *pp_src_mcu = (UWORD16 *) p_src_mcu; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
256 *p_tmp_patch_size = tmp_patch_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
257 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
258 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
259 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
260 /* l1_copy_first_N_words */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
261 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
262 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
263 /* Parameters : address of size of the patch, address of size of download area,*/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
264 /* addresses of source pointer, address of destination pointer */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
265 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
266 /* Return : source and destination pointer modified by reference */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
267 /* size of download area and patch area modified by reference */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
268 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
269 /* Description : Copy the min(N, remaining size of the patch) at the beginning */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
270 /* download area */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
271 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
272 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
273 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
274 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
275 BOOL l1_copy_first_N_words (UWORD16 *dwnld_area_size_p, UWORD16 *patch_area_size_p, UWORD16 **pp_dest_mcu, UWORD16 **pp_src_mcu) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
276 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
277 BOOL return_flag; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
278 UWORD16 num_words_interrupt; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
279 UWORD16 tmp_patch_size = *patch_area_size_p; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
280 UWORD16 tmp_dwnld_area_size = *dwnld_area_size_p; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
281 UWORD16 *p_dest_mcu =(UWORD16 *)*pp_dest_mcu; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
282 UWORD16 *p_src_mcu = (UWORD16 *)*pp_src_mcu; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
283 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
284 /* Copy first N words and generate API interrupt*/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
285 if (tmp_patch_size > NUM_WORDS_COPY_API) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
286 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
287 num_words_interrupt = NUM_WORDS_COPY_API; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
288 return_flag = TRUE; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
289 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
290 else |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
291 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
292 num_words_interrupt = tmp_patch_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
293 return_flag = FALSE; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
294 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
295 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
296 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, num_words_interrupt*sizeof(UWORD16)); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
297 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
298 p_dest_mcu += num_words_interrupt; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
299 p_src_mcu += num_words_interrupt; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
300 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
301 tmp_patch_size -= num_words_interrupt; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
302 tmp_dwnld_area_size -= num_words_interrupt; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
303 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
304 dyn_dwl_ndb->d_api_dwl_write_pointer+=num_words_interrupt; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
305 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
306 *patch_area_size_p = tmp_patch_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
307 *dwnld_area_size_p = tmp_dwnld_area_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
308 *pp_dest_mcu = (UWORD16 *)p_dest_mcu; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
309 *pp_src_mcu = (UWORD16 *)p_src_mcu ; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
310 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
311 return return_flag; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
312 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
313 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
314 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
315 /* l1_initialize_download_area_parameters */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
316 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
317 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
318 /* Parameters : none */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
319 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
320 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
321 /* Return : download area size */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
322 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
323 /* Description : Initialize download area: all the parameters */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
324 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
325 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
326 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
327 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
328 UWORD16 l1_initialize_download_area_parameters(void) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
329 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
330 UWORD16 dwnld_area_size = 0; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
331 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
332 /* Set download address and size in API-DSP com */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
333 dyn_dwl_ndb->d_api_dwl_function_address[0] = l1a_apihisr_com.dyn_dwnld.copy_parameters.start_of_dwnld_area; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
334 dyn_dwl_ndb->d_api_dwl_function_address[1] = 0x0; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
335 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
336 #if (CODE_VERSION == SIMULATION) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
337 dyn_dwl_ndb->d_api_dwl_size = SIZE_DWNLD_AREA_SIMU; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
338 #else |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
339 dyn_dwl_ndb->d_api_dwl_size = l1a_apihisr_com.dyn_dwnld.copy_parameters.size_of_dwnld_area; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
340 #endif // CODE_VERSION == SIMULATION |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
341 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
342 dwnld_area_size = l1a_apihisr_com.dyn_dwnld.copy_parameters.size_of_dwnld_area; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
343 return dwnld_area_size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
344 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
345 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
346 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
347 /* l1_init_pointers_and_copy_first_block_of_data */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
348 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
349 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
350 /* Parameters : address of size of the patch, address of size of download area,*/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
351 /* addresses of source pointer, address of destination pointer */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
352 /* new patch flag */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
353 /* Return : TRUE if N< size of patch, FALSE otherwise */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
354 /* source and destination pointer modified by reference */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
355 /* size of download area and patch area modified by reference, */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
356 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
357 /* Description : Initialize pointers and starts the copy. */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
358 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
359 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
360 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
361 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
362 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
363 BOOL l1_init_pointers_and_copy_first_block_of_data(UWORD16 *dwnld_area_size_p, UWORD16 *patch_size_p, UWORD16 **pp_dest_mcu, UWORD16 **pp_src_mcu, BOOL new_patch) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
364 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
365 BOOL return_flag; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
366 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
367 /* Initialize download area*/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
368 *dwnld_area_size_p = l1_initialize_download_area_parameters(); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
369 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
370 /* In case this is a new patch, initialize patch parameters*/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
371 if (new_patch == TRUE) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
372 *patch_size_p = l1_initialize_patch_parameters(); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
373 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
374 /* Initialize pointers for the copy*/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
375 l1_initialize_pointers_for_copy(pp_dest_mcu, pp_src_mcu); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
376 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
377 /* If this is a new patch, the header of the patch must be taken off from the copy*/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
378 if (new_patch == TRUE) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
379 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
380 /* Take the initial header off */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
381 *pp_src_mcu= (*pp_src_mcu)+HEADER_PATCH_SIZE; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
382 *patch_size_p= (*patch_size_p)-HEADER_PATCH_SIZE; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
383 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
384 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
385 /* Copy first N words; if remaining size of the patch is smaller than N copy until the end of the patch */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
386 /* In this case, return FALSE as there are no more words to be copied*/ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
387 return_flag = l1_copy_first_N_words (dwnld_area_size_p, patch_size_p, pp_dest_mcu, pp_src_mcu); |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
388 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
389 return return_flag; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
390 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
391 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
392 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
393 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
394 /* l1_set_dyn_dwnld_install_vect */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
395 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
396 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
397 /* Parameters : size vector, destination address vector, crc vector */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
398 /* patch code vector, identifier i of the patch */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
399 /* new patch flag */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
400 /* Return : TRUE operation is successful, FALSE otherwise */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
401 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
402 /* Description : Compute address, size and crc of i-th patch */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
403 /* */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
404 /*---------------------------------------------------------------------------- */ |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
405 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
406 BOOL l1_set_dyn_dwnld_install_vect(UWORD16* size_p, UWORD32* dest_addr, UWORD16* crc_vect, const UWORD8 *patch_array_code, UWORD16 i) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
407 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
408 UWORD16 full_size_32_bit, size, size_ext, dsp_addr, dsp_addr_ext, crc_value; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
409 UWORD16 *codePtr; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
410 UWORD16 size_total = 0; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
411 BOOL status_flag = FALSE; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
412 codePtr = (UWORD16 *) patch_array_code; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
413 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
414 if ( (0 == *codePtr++) && (0 == *codePtr++)) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
415 { // NULL TAG detection |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
416 if ( (3 == *codePtr++) && (0 == *codePtr++)) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
417 { // coff2c version number detection |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
418 size = *codePtr++; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
419 size_ext = *codePtr++; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
420 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
421 // first header:4 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
422 size_total+=HEADER_PATCH_SIZE; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
423 while(size != 0 || size_ext != 0) |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
424 { |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
425 full_size_32_bit = (size_ext << 16) + size; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
426 // reconstruction of the total 32-bit size of the section |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
427 size_total+=HEADER_PATCH_SIZE+full_size_32_bit+1; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
428 // Header + size_block + cntrl_word(0xDEAD):1 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
429 codePtr+=full_size_32_bit+2+1; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
430 // Two words for address and one for the cntrl word 0xDEAD |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
431 size = *codePtr++; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
432 size_ext = *codePtr++; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
433 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
434 size_total+=HEADER_PATCH_SIZE; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
435 // Last header to consider |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
436 |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
437 dsp_addr = *codePtr++; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
438 dsp_addr_ext = *codePtr++; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
439 crc_value = *codePtr++; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
440 dest_addr[i] = (dsp_addr_ext << 16)+dsp_addr; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
441 crc_vect[i] = crc_value; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
442 size_p[i] = size_total; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
443 status_flag = TRUE; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
444 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
445 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
446 return status_flag; |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
447 } |
06d94fdaadf6
l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
448 #endif //L1_DYN_DSP_DWNLD == 1 |