FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/services/dar/dar_emergency.c @ 308:3c5a17928fda
DAR: starting to clean and compile .c files
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 16 Mar 2014 20:46:10 +0000 |
parents | 4dccc9d3305f |
children | 083f262b7bbe |
comparison
equal
deleted
inserted
replaced
307:749ca89741fa | 308:3c5a17928fda |
---|---|
6 /* an emergency ( Error or exception) */ | 6 /* an emergency ( Error or exception) */ |
7 /* */ | 7 /* */ |
8 /* */ | 8 /* */ |
9 /* Version 0.1 */ | 9 /* Version 0.1 */ |
10 /* */ | 10 /* */ |
11 /* Date Modification */ | 11 /* Date Modification */ |
12 /* ------------------------------------ */ | 12 /* ------------------------------------ */ |
13 /* 17 October 2001 Create */ | 13 /* 17 October 2001 Create */ |
14 /* */ | 14 /* */ |
15 /* Author Stephanie Gerthoux */ | 15 /* Author Stephanie Gerthoux */ |
16 /* */ | 16 /* */ |
17 /* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved*/ | 17 /* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved*/ |
18 /****************************************************************************/ | 18 /****************************************************************************/ |
19 | 19 |
20 #include "rv/rv_defined_swe.h" | 20 #include "../../riviera/rv/rv_defined_swe.h" |
21 #ifdef RVM_DAR_SWE | 21 #ifdef RVM_DAR_SWE |
22 /* ************************************************ */ | 22 /* ************************************************ */ |
23 /* THE DAR ENTITY IS ENABLED */ | 23 /* THE DAR ENTITY IS ENABLED */ |
24 /* ************************************************ */ | 24 /* ************************************************ */ |
25 | 25 |
26 #include <string.h> | 26 #include <string.h> |
27 #include "rvm/rvm_gen.h" | 27 #include "../../riviera/rvm/rvm_gen.h" |
28 #include "dar/dar_api.h" | 28 #include "dar_api.h" |
29 #include "dar/dar_macro_i.h" | 29 #include "dar_macro_i.h" |
30 #include "dar/dar_messages_i.h" | 30 #include "dar_messages_i.h" |
31 #include "dar/dar_const_i.h" | 31 #include "dar_const_i.h" |
32 #include "dar/dar_diagnose_i.h" | 32 #include "dar_diagnose_i.h" |
33 #include "dar/dar_msg_ft.h" | 33 #include "dar_msg_ft.h" |
34 | 34 |
35 #ifndef _WINDOWS | 35 #ifndef _WINDOWS |
36 #include "timer/timer.h" | 36 #include "../../bsp/timer.h" |
37 #endif | 37 #endif |
38 | 38 |
39 /**** Global variable ****/ | 39 /**** Global variable ****/ |
40 /* index used in the circular buffer*/ | 40 /* index used in the circular buffer*/ |
41 extern UINT16 dar_current_index; | 41 extern UINT16 dar_current_index; |
63 extern void * dar_read_mbox (UINT8 mbox); | 63 extern void * dar_read_mbox (UINT8 mbox); |
64 | 64 |
65 extern void exception(void); | 65 extern void exception(void); |
66 | 66 |
67 | 67 |
68 /********************************************************************************/ | 68 /***************************************************************************/ |
69 /* */ | 69 /* */ |
70 /* Function Name: dar_process_emergency */ | 70 /* Function Name: dar_process_emergency */ |
71 /* */ | 71 /* */ |
72 /* Purpose: This function is called to process emergency data and to store */ | 72 /* Purpose: This function is called to process emergency data and to */ |
73 /* them in RAM buffer when an emergency has been detected */ | 73 /* store them in RAM buffer when an emergency has been */ |
74 /* */ | 74 /* detected. */ |
75 /* */ | 75 /* */ |
76 /* Input Parameters: */ | 76 /* Input Parameters: */ |
77 /* Pointer to the message to store */ | 77 /* Pointer to the message to store */ |
78 /* Data Format, ( the Binary format is not supported) */ | 78 /* Data Format, ( the Binary format is not supported) */ |
79 /* Data Use Id, */ | 79 /* Data Use Id, */ |
80 /* Flags */ | 80 /* Flags */ |
81 /* */ | 81 /* */ |
82 /* Output Parameters: */ | 82 /* Output Parameters: */ |
83 /* Validation of the diagnose execution. */ | 83 /* Validation of the diagnose execution. */ |
84 /* */ | 84 /* */ |
85 /* */ | 85 /* */ |
86 /* */ | 86 /* */ |
87 /* Revision History: */ | 87 /* Revision History: */ |
88 /* None. */ | 88 /* None. */ |
89 /* */ | 89 /* */ |
90 /********************************************************************************/ | 90 /***************************************************************************/ |
91 T_RV_RET dar_process_emergency( T_DAR_INFO *buffer_p, | 91 T_RV_RET dar_process_emergency( T_DAR_INFO *buffer_p, |
92 T_DAR_FORMAT format, | 92 T_DAR_FORMAT format, |
93 T_RVM_USE_ID dar_use_id, | 93 T_RVM_USE_ID dar_use_id, |
94 UINT32 flags) | 94 UINT32 flags) |
95 { | 95 { |
134 if ( flags & DAR_NEW_ENTRY ) | 134 if ( flags & DAR_NEW_ENTRY ) |
135 { | 135 { |
136 /** Circular buffer to store data **/ | 136 /** Circular buffer to store data **/ |
137 /* Add 0xFF to separate 2 strings */ | 137 /* Add 0xFF to separate 2 strings */ |
138 dar_write_buffer[dar_current_index] = 0xF; | 138 dar_write_buffer[dar_current_index] = 0xF; |
139 DAR_PLUS_PLUS(dar_current_index); /* to detected if it is the end of the buffer */ | 139 DAR_PLUS_PLUS(dar_current_index); /* increment with wraparound */ |
140 dar_write_buffer[dar_current_index] = 0xF; | 140 dar_write_buffer[dar_current_index] = 0xF; |
141 DAR_PLUS_PLUS(dar_current_index); /* to detected if it is the end of the buffer */ | 141 DAR_PLUS_PLUS(dar_current_index); /* increment with wraparound */ |
142 | 142 |
143 /* The group_nb is 16 bit length, and the buffer is an UINT8 length */ | 143 /* The group_nb is 16 bit length, and the buffer is an UINT8 length */ |
144 /* So the group_nb must be stocked by dividing it in 2 parts */ | 144 /* So the group_nb must be stocked by dividing it in 2 parts */ |
145 dar_write_buffer[dar_current_index] = ((dar_use_id>>16)& 0x7FFF)>>8; | 145 dar_write_buffer[dar_current_index] = ((dar_use_id>>16)& 0x7FFF)>>8; |
146 /*add the 8 first bits of the Use id group*/ | 146 /*add the 8 first bits of the Use id group*/ |
147 DAR_PLUS_PLUS(dar_current_index); | 147 DAR_PLUS_PLUS(dar_current_index); |
148 dar_write_buffer[dar_current_index] = (dar_use_id>>16)& 0x7FFF; | 148 dar_write_buffer[dar_current_index] = (dar_use_id>>16)& 0x7FFF; |
149 /*add the 8 last bits of the Use id group*/ | 149 /*add the 8 last bits of the Use id group*/ |
150 DAR_PLUS_PLUS(dar_current_index); | 150 DAR_PLUS_PLUS(dar_current_index); |
151 | 151 |
152 /* The mask is 16 bit length, and the buffer is an UINT8 length */ | 152 /* The mask is 16 bit length, and the buffer is an UINT8 length */ |
153 /* So the mask must be stocked by dividing it in 2 parts */ | 153 /* So the mask must be stocked by dividing it in 2 parts */ |
154 dar_write_buffer[dar_current_index] = ((dar_use_id)&0xFFFF)>>8; | 154 dar_write_buffer[dar_current_index] = ((dar_use_id)&0xFFFF)>>8; |
155 /* add the 8 first bits of the Use id mask */ | 155 /* add the 8 first bits of the Use id mask */ |
156 DAR_PLUS_PLUS(dar_current_index); | 156 DAR_PLUS_PLUS(dar_current_index); |
157 dar_write_buffer[dar_current_index] = (dar_use_id)&0xFFFF; | 157 dar_write_buffer[dar_current_index] = (dar_use_id)&0xFFFF; |
158 /* add the 8 last bits of the Use id mask */ | 158 /* add the 8 last bits of the Use id mask */ |
159 DAR_PLUS_PLUS(dar_current_index); | 159 DAR_PLUS_PLUS(dar_current_index); |
160 | 160 |
161 /* Add the dar_level data */ | 161 /* Add the dar_level data */ |
162 dar_write_buffer[dar_current_index] = DAR_ERROR; | 162 dar_write_buffer[dar_current_index] = DAR_ERROR; |
163 DAR_PLUS_PLUS(dar_current_index); | 163 DAR_PLUS_PLUS(dar_current_index); |
185 /**** Check if the DAR entity is started ****/ | 185 /**** Check if the DAR entity is started ****/ |
186 if (dar_gbl_var_p != NULL ) | 186 if (dar_gbl_var_p != NULL ) |
187 { | 187 { |
188 if (dar_gbl_var_p->entity_dar_callback != NULL ) | 188 if (dar_gbl_var_p->entity_dar_callback != NULL ) |
189 { | 189 { |
190 /* Call the MMI callback function to save some parameters before reset */ | 190 /* Call the MMI callback function to save some parameters before |
191 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer,DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | 191 reset */ |
192 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer, | |
193 DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | |
192 } | 194 } |
193 } | 195 } |
194 | 196 |
195 /* The system is reset if requested */ | 197 /* The system is reset if requested */ |
196 if ( flags & DAR_EMERGENCY_RESET ) | 198 if ( flags & DAR_EMERGENCY_RESET ) |
200 return(RV_OK); | 202 return(RV_OK); |
201 | 203 |
202 } /* dar_process_emergency */ | 204 } /* dar_process_emergency */ |
203 | 205 |
204 | 206 |
205 /********************************************************************************/ | 207 /***************************************************************************/ |
206 /* */ | 208 /* */ |
207 /* Function Name: dar_exception_arm_undefined */ | 209 /* Function Name: dar_exception_arm_undefined */ |
208 /* */ | 210 /* */ |
209 /* Purpose: This function is called to process ARM undefined instruction */ | 211 /* Purpose: This function is called to process ARM undefined */ |
210 /* exception and to store this exception in the RAM buffer */ | 212 /* instruction exception and to store this exception in the */ |
211 /* */ | 213 /* RAM buffer. */ |
212 /* Input Parameters: */ | 214 /* */ |
213 /* None */ | 215 /* Input Parameters: */ |
214 /* */ | 216 /* None */ |
215 /* Output Parameters: */ | 217 /* */ |
216 /* Validation of the diagnose execution. */ | 218 /* Output Parameters: */ |
217 /* */ | 219 /* Validation of the diagnose execution. */ |
218 /* */ | 220 /* */ |
219 /* */ | 221 /* */ |
220 /* Revision History: */ | 222 /* */ |
221 /* None. */ | 223 /* Revision History: */ |
222 /* */ | 224 /* None. */ |
223 /********************************************************************************/ | 225 /* */ |
226 /***************************************************************************/ | |
224 void dar_exception_arm_undefined(void) | 227 void dar_exception_arm_undefined(void) |
225 { | 228 { |
226 /* Declare local variables */ | 229 /* Declare local variables */ |
227 T_DAR_INFO *buffer_p= " DAR Emergency exception : ARM undefined ";/*exception data to store*/ | 230 T_DAR_INFO *buffer_p= " DAR Emergency exception : ARM undefined ";/*exception data to store*/ |
228 | 231 |
238 /* Check if the DAR entity is started */ | 241 /* Check if the DAR entity is started */ |
239 if (dar_gbl_var_p != NULL ) | 242 if (dar_gbl_var_p != NULL ) |
240 { | 243 { |
241 if (dar_gbl_var_p->entity_dar_callback != NULL) | 244 if (dar_gbl_var_p->entity_dar_callback != NULL) |
242 { | 245 { |
243 /* Call the MMI callback function to save some parameters before reset */ | 246 /* Call the MMI callback function to save some parameters before |
244 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer,DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | 247 reset */ |
248 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer, | |
249 DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | |
245 } | 250 } |
246 } | 251 } |
247 | 252 |
248 #ifndef _WINDOWS | 253 #ifndef _WINDOWS |
249 /* branch to "exception" defined in the int.s*/ | 254 /* branch to "exception" defined in the int.s*/ |
250 exception(); | 255 exception(); |
251 #endif | 256 #endif |
252 | 257 |
253 } /* dar_exception_arm_undefined */ | 258 } /* dar_exception_arm_undefined */ |
254 | 259 |
255 /********************************************************************************/ | 260 /***************************************************************************/ |
256 /* */ | 261 /* */ |
257 /* Function Name: dar_exception_arm_swi */ | 262 /* Function Name: dar_exception_arm_swi */ |
258 /* */ | 263 /* */ |
259 /* Purpose: This function is called to process ARM SW Interrupt exception */ | 264 /* Purpose: This function is called to process ARM SW Interrupt */ |
260 /* and to store this exception in the RAM buffer */ | 265 /* exception and to store this exception in the RAM buffer. */ |
261 /* */ | 266 /* */ |
262 /* Input Parameters: */ | 267 /* Input Parameters: */ |
263 /* None */ | 268 /* None */ |
264 /* */ | 269 /* */ |
265 /* Output Parameters: */ | 270 /* Output Parameters: */ |
266 /* Validation of the diagnose execution. */ | 271 /* Validation of the diagnose execution. */ |
267 /* */ | 272 /* */ |
268 /* */ | 273 /* */ |
269 /* */ | 274 /* */ |
270 /* Revision History: */ | 275 /* Revision History: */ |
271 /* None. */ | 276 /* None. */ |
272 /* */ | 277 /* */ |
273 /********************************************************************************/ | 278 /***************************************************************************/ |
274 void dar_exception_arm_swi(void) | 279 void dar_exception_arm_swi(void) |
275 { | 280 { |
276 /* Declare local variables */ | 281 /* Declare local variables */ |
277 T_DAR_INFO *buffer_p= " DAR Emergency exception : ARM SWI ";/*exception data to store*/ | 282 T_DAR_INFO *buffer_p= " DAR Emergency exception : ARM SWI ";/*exception data to store*/ |
278 | 283 |
288 /* Check if the DAR entity is started */ | 293 /* Check if the DAR entity is started */ |
289 if (dar_gbl_var_p != NULL ) | 294 if (dar_gbl_var_p != NULL ) |
290 { | 295 { |
291 if ( dar_gbl_var_p->entity_dar_callback != NULL) | 296 if ( dar_gbl_var_p->entity_dar_callback != NULL) |
292 { | 297 { |
293 /* Call the MMI callback function to save some parameters before reset */ | 298 /* Call the MMI callback function to save some parameters before |
294 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer,DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | 299 reset */ |
300 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer, | |
301 DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | |
295 } | 302 } |
296 } | 303 } |
297 | 304 |
298 #ifndef _WINDOWS | 305 #ifndef _WINDOWS |
299 /* branch to "exception" defined in the int.s*/ | 306 /* branch to "exception" defined in the int.s*/ |
300 exception(); | 307 exception(); |
301 #endif | 308 #endif |
302 | 309 |
303 } /* dar_exception_arm_swi */ | 310 } /* dar_exception_arm_swi */ |
304 | 311 |
305 /********************************************************************************/ | 312 /***************************************************************************/ |
306 /* */ | 313 /* */ |
307 /* Function Name: dar_exception_arm_abort_prefetch */ | 314 /* Function Name: dar_exception_arm_abort_prefetch */ |
308 /* */ | 315 /* */ |
309 /* Purpose: This function is called to process ARM abort prefetch exception */ | 316 /* Purpose: This function is called to process ARM abort prefetch */ |
310 /* and to store this exception in the RAM buffer */ | 317 /* exception and to store this exception in the RAM buffer. */ |
311 /* */ | 318 /* */ |
312 /* Input Parameters: */ | 319 /* Input Parameters: */ |
313 /* None */ | 320 /* None */ |
314 /* */ | 321 /* */ |
315 /* Output Parameters: */ | 322 /* Output Parameters: */ |
316 /* Validation of the diagnose execution. */ | 323 /* Validation of the diagnose execution. */ |
317 /* */ | 324 /* */ |
318 /* */ | 325 /* */ |
319 /* */ | 326 /* */ |
320 /* Revision History: */ | 327 /* Revision History: */ |
321 /* None. */ | 328 /* None. */ |
322 /* */ | 329 /* */ |
323 /********************************************************************************/ | 330 /***************************************************************************/ |
324 void dar_exception_arm_abort_prefetch(void) | 331 void dar_exception_arm_abort_prefetch(void) |
325 { | 332 { |
326 #ifndef _WINDOWS | 333 #ifndef _WINDOWS |
327 /* Local variable */ | 334 /* Local variable */ |
328 UINT8 i; | 335 UINT8 i; |
329 #endif | 336 #endif |
330 | 337 |
331 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 338 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \ |
332 /* Debug unit pointer */ | 339 (CHIPSET == 11) || (CHIPSET == 12)) |
333 volatile UINT32 *debug_register_p; | 340 /* Debug unit pointer */ |
334 #endif | 341 volatile UINT32 *debug_register_p; |
342 #endif | |
335 | 343 |
336 /* Declare local variables */ | 344 /* Declare local variables */ |
337 T_DAR_INFO *buffer_p = " DAR Emergency exception : ARM abort prefetch";/*exception data to store*/ | 345 T_DAR_INFO *buffer_p = " DAR Emergency exception : ARM abort prefetch";/*exception data to store*/ |
338 | 346 |
339 /* Update the DAR recovery status */ | 347 /* Update the DAR recovery status */ |
348 /* Check if the DAR entity is started */ | 356 /* Check if the DAR entity is started */ |
349 if (dar_gbl_var_p != NULL ) | 357 if (dar_gbl_var_p != NULL ) |
350 { | 358 { |
351 if (dar_gbl_var_p->entity_dar_callback != NULL) | 359 if (dar_gbl_var_p->entity_dar_callback != NULL) |
352 { | 360 { |
353 /* Call the MMI callback function to save some parameters before reset */ | 361 /* Call the MMI callback function to save some parameters before |
354 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer,DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | 362 reset */ |
355 } | 363 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer, |
356 } | 364 DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); |
357 | 365 } |
358 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 366 } |
359 /* Initialize the adress of the Debug Unit pointer */ | 367 |
360 debug_register_p = (volatile UINT32*) DAR_DEBUG_UNIT_REGISTER; | 368 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \ |
361 #endif | 369 (CHIPSET == 11) || (CHIPSET == 12)) |
362 | 370 /* Initialize the adress of the Debug Unit pointer */ |
363 #ifndef _WINDOWS | 371 debug_register_p = (volatile UINT32*) DAR_DEBUG_UNIT_REGISTER; |
364 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 372 #endif |
365 /* Save the Debug Unit into the RAM */ | 373 |
366 for (i=0; i<DEBUG_UNIT_WORD_SIZE; i++ ) | 374 #ifndef _WINDOWS |
367 { | 375 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \ |
368 debug_RAM[i] = *debug_register_p; | 376 (CHIPSET == 11) || (CHIPSET == 12)) |
369 debug_register_p++; | 377 /* Save the Debug Unit into the RAM */ |
370 } | 378 for (i=0; i<DEBUG_UNIT_WORD_SIZE; i++ ) |
371 #endif | 379 { |
380 debug_RAM[i] = *debug_register_p; | |
381 debug_register_p++; | |
382 } | |
383 #endif | |
372 | 384 |
373 /* branch to "exception" defined in the int.s*/ | 385 /* branch to "exception" defined in the int.s*/ |
374 exception(); | 386 exception(); |
375 #endif | 387 #endif |
376 | 388 |
377 } /* dar_exception_arm_abort_prefetch */ | 389 } /* dar_exception_arm_abort_prefetch */ |
378 | 390 |
379 /********************************************************************************/ | 391 /***************************************************************************/ |
380 /* */ | 392 /* */ |
381 /* Function Name: dar_exception_arm_abort_data */ | 393 /* Function Name: dar_exception_arm_abort_data */ |
382 /* */ | 394 /* */ |
383 /* Purpose: This function is called to process ARM abort data exception */ | 395 /* Purpose: This function is called to process ARM abort data exception*/ |
384 /* and to store this exception in the RAM buffer */ | 396 /* and to store this exception in the RAM buffer */ |
385 /* */ | 397 /* */ |
386 /* Input Parameters: */ | 398 /* Input Parameters: */ |
387 /* None */ | 399 /* None */ |
388 /* */ | 400 /* */ |
389 /* Output Parameters: */ | 401 /* Output Parameters: */ |
390 /* Validation of the diagnose execution. */ | 402 /* Validation of the diagnose execution. */ |
391 /* */ | 403 /* */ |
392 /* */ | 404 /* */ |
393 /* */ | 405 /* */ |
394 /* Revision History: */ | 406 /* Revision History: */ |
395 /* None. */ | 407 /* None. */ |
396 /* */ | 408 /* */ |
397 /********************************************************************************/ | 409 /***************************************************************************/ |
398 void dar_exception_arm_abort_data(void) | 410 void dar_exception_arm_abort_data(void) |
399 { | 411 { |
400 #ifndef _WINDOWS | 412 #ifndef _WINDOWS |
401 /* Local variable */ | 413 /* Local variable */ |
402 UINT8 i; | 414 UINT8 i; |
403 #endif | 415 #endif |
404 | 416 |
405 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 417 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \ |
406 /* Debug unit pointer */ | 418 (CHIPSET == 11) || (CHIPSET == 12)) |
407 volatile UINT32 *debug_register_p; | 419 /* Debug unit pointer */ |
408 #endif | 420 volatile UINT32 *debug_register_p; |
421 #endif | |
409 | 422 |
410 /* Declare local variables */ | 423 /* Declare local variables */ |
411 T_DAR_INFO *buffer_p= " DAR Emergency exception : ARM abort data";/*exception data to store*/ | 424 T_DAR_INFO *buffer_p= " DAR Emergency exception : ARM abort data";/*exception data to store*/ |
412 | 425 |
413 /* Update the DAR recovery status */ | 426 /* Update the DAR recovery status */ |
423 if (dar_gbl_var_p != NULL ) | 436 if (dar_gbl_var_p != NULL ) |
424 { | 437 { |
425 if (dar_gbl_var_p->entity_dar_callback != NULL) | 438 if (dar_gbl_var_p->entity_dar_callback != NULL) |
426 { | 439 { |
427 | 440 |
428 /* Call the MMI callback function to save some parameters before reset */ | 441 /* Call the MMI callback function to save some parameters before |
429 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer,DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | 442 reset */ |
430 } | 443 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer, |
431 } | 444 DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); |
432 | 445 } |
433 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 446 } |
434 /* Initialize the adress of the Debug Unit pointer */ | 447 |
435 debug_register_p = (volatile UINT32*) DAR_DEBUG_UNIT_REGISTER; | 448 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \ |
436 #endif | 449 (CHIPSET == 11) || (CHIPSET == 12)) |
437 | 450 /* Initialize the adress of the Debug Unit pointer */ |
438 #ifndef _WINDOWS | 451 debug_register_p = (volatile UINT32*) DAR_DEBUG_UNIT_REGISTER; |
439 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | 452 #endif |
440 /* Save the Debug Unit into the RAM */ | 453 |
441 for (i=0; i<DEBUG_UNIT_WORD_SIZE; i++ ) | 454 #ifndef _WINDOWS |
442 { | 455 #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \ |
456 (CHIPSET == 11) || (CHIPSET == 12)) | |
457 /* Save the Debug Unit into the RAM */ | |
458 for (i=0; i<DEBUG_UNIT_WORD_SIZE; i++ ) | |
459 { | |
443 debug_RAM[i] = *debug_register_p; | 460 debug_RAM[i] = *debug_register_p; |
444 debug_register_p++; | 461 debug_register_p++; |
445 } | 462 } |
446 #endif | 463 #endif |
447 | 464 |
448 /* branch to "exception" defined in the int.s*/ | 465 /* branch to "exception" defined in the int.s*/ |
449 exception(); | 466 exception(); |
450 #endif | 467 #endif |
451 | 468 |
452 } /* dar_exception_arm_abort_data */ | 469 } /* dar_exception_arm_abort_data */ |
453 | 470 |
454 /********************************************************************************/ | 471 /***************************************************************************/ |
455 /* */ | 472 /* */ |
456 /* Function Name: dar_exception_arm_reserved */ | 473 /* Function Name: dar_exception_arm_reserved */ |
457 /* */ | 474 /* */ |
458 /* Purpose: This function is called to process ARM exception */ | 475 /* Purpose: This function is called to process ARM exception */ |
459 /* and to store this exception in the RAM buffer */ | 476 /* and to store this exception in the RAM buffer */ |
460 /* */ | 477 /* */ |
461 /* Input Parameters: */ | 478 /* Input Parameters: */ |
462 /* None */ | 479 /* None */ |
463 /* */ | 480 /* */ |
464 /* Output Parameters: */ | 481 /* Output Parameters: */ |
465 /* Validation of the diagnose execution. */ | 482 /* Validation of the diagnose execution. */ |
466 /* */ | 483 /* */ |
467 /* */ | 484 /* */ |
468 /* */ | 485 /* */ |
469 /* Revision History: */ | 486 /* Revision History: */ |
470 /* None. */ | 487 /* None. */ |
471 /* */ | 488 /* */ |
472 /********************************************************************************/ | 489 /***************************************************************************/ |
473 void dar_exception_arm_reserved(void) | 490 void dar_exception_arm_reserved(void) |
474 { | 491 { |
475 /* Declare local variables */ | 492 /* Declare local variables */ |
476 T_DAR_INFO *buffer_p= " DAR Emergency exception : ARM reserved";/*exception data to store*/ | 493 T_DAR_INFO *buffer_p= " DAR Emergency exception : ARM reserved";/*exception data to store*/ |
477 | 494 |
487 /* Check if the DAR entity is started */ | 504 /* Check if the DAR entity is started */ |
488 if (dar_gbl_var_p != NULL ) | 505 if (dar_gbl_var_p != NULL ) |
489 { | 506 { |
490 if (dar_gbl_var_p->entity_dar_callback != NULL) | 507 if (dar_gbl_var_p->entity_dar_callback != NULL) |
491 { | 508 { |
492 /* Call the MMI callback function to save some parameters before reset */ | 509 /* Call the MMI callback function to save some parameters before |
493 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer,DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | 510 reset */ |
511 dar_gbl_var_p->entity_dar_callback(dar_recovery_buffer, | |
512 DAR_RECOVERY_DATA_MAX_BUFFER_SIZE); | |
494 } | 513 } |
495 } | 514 } |
496 | 515 |
497 #ifndef _WINDOWS | 516 #ifndef _WINDOWS |
498 /* branch to "exception" defined in the int.s*/ | 517 /* branch to "exception" defined in the int.s*/ |
499 exception(); | 518 exception(); |
500 #endif | 519 #endif |
501 | 520 |
502 } /* dar_exception_arm_reserved */ | 521 } /* dar_exception_arm_reserved */ |
503 | 522 |
504 /********************************************************************************/ | 523 /****************************************************************************/ |
505 /* */ | 524 /* */ |
506 /* Function Name: dar_exception */ | 525 /* Function Name: dar_exception */ |
507 /* */ | 526 /* */ |
508 /* Purpose: This function is called to vector exceptions to the correct */ | 527 /* Purpose: This function is called to vector exceptions to the correct */ |
509 /* handler */ | 528 /* handler */ |
510 /* */ | 529 /* */ |
511 /* Input Parameters: */ | 530 /* Input Parameters: */ |
512 /* abort type which come from int.s ( -> magic number) */ | 531 /* abort type which come from int.s ( -> magic number) */ |
513 /* */ | 532 /* */ |
514 /* Output Parameters: */ | 533 /* Output Parameters: */ |
515 /* Validation of the diagnose execution. */ | 534 /* Validation of the diagnose execution. */ |
516 /* */ | 535 /* */ |
517 /* */ | 536 /* */ |
518 /* */ | 537 /* */ |
519 /* Revision History: */ | 538 /* Revision History: */ |
520 /* None. */ | 539 /* None. */ |
521 /* */ | 540 /* */ |
522 /********************************************************************************/ | 541 /****************************************************************************/ |
523 void dar_exception(int abort_type) | 542 void dar_exception(int abort_type) |
524 { | 543 { |
525 switch (abort_type) | 544 switch (abort_type) |
526 { | 545 { |
527 /* magic numbers come from int.s There is no way to make compiler derived | 546 /* magic numbers come from int.s There is no way to make compiler |
528 * constants out of them | 547 * derived constants out of them |
529 */ | 548 */ |
530 case 1: | 549 case 1: |
531 dar_exception_arm_undefined(); | 550 dar_exception_arm_undefined(); |
532 break; | 551 break; |
533 case 2: | 552 case 2: |
557 exception(); | 576 exception(); |
558 #endif | 577 #endif |
559 } /* dar_exception */ | 578 } /* dar_exception */ |
560 | 579 |
561 #endif /* #ifdef RVM_DAR_SWE */ | 580 #endif /* #ifdef RVM_DAR_SWE */ |
562 |