Mercurial > ecos
comparison packages/redboot/current/src/main.c @ 1364:19f40f995cc2
Fix GDB exceptions - broken on 10/23
| author | gthomas |
|---|---|
| date | Thu, 13 Nov 2003 15:48:01 +0000 |
| parents | afd4dd211d3a |
| children | 1bc2e99ec44b |
comparison
equal
deleted
inserted
replaced
| 1363:70b10f2956d8 | 1364:19f40f995cc2 |
|---|---|
| 495 // need this to balance above CYGARC_HAL_SAVE_GP on | 495 // need this to balance above CYGARC_HAL_SAVE_GP on |
| 496 // some platforms. It will never run, though. | 496 // some platforms. It will never run, though. |
| 497 CYGARC_HAL_RESTORE_GP(); | 497 CYGARC_HAL_RESTORE_GP(); |
| 498 } | 498 } |
| 499 | 499 |
| 500 #if 0 | |
| 501 externC _get_cache_contents(unsigned char *buf); | |
| 502 unsigned char _hold_cache_contents[2][256*2*8]; | |
| 503 #endif | |
| 504 | |
| 505 void | 500 void |
| 506 do_go(int argc, char *argv[]) | 501 do_go(int argc, char *argv[]) |
| 507 { | 502 { |
| 508 int i, cur, num_options; | 503 int i, cur, num_options; |
| 509 unsigned long entry; | 504 unsigned long entry; |
| 516 #endif | 511 #endif |
| 517 struct option_info opts[3]; | 512 struct option_info opts[3]; |
| 518 char line[8]; | 513 char line[8]; |
| 519 hal_virtual_comm_table_t *__chan; | 514 hal_virtual_comm_table_t *__chan; |
| 520 | 515 |
| 516 __mem_fault_handler = 0; // Let GDB handle any faults directly | |
| 521 entry = entry_address; // Default from last 'load' operation | 517 entry = entry_address; // Default from last 'load' operation |
| 522 init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, | 518 init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, |
| 523 (void **)&wait_time, (bool *)&wait_time_set, "wait timeout"); | 519 (void **)&wait_time, (bool *)&wait_time_set, "wait timeout"); |
| 524 init_opts(&opts[1], 'c', false, OPTION_ARG_TYPE_FLG, | 520 init_opts(&opts[1], 'c', false, OPTION_ARG_TYPE_FLG, |
| 525 (void **)&cache_enabled, (bool *)0, "go with caches enabled"); | 521 (void **)&cache_enabled, (bool *)0, "go with caches enabled"); |
| 573 if (stop_net) | 569 if (stop_net) |
| 574 eth_drv_stop(); | 570 eth_drv_stop(); |
| 575 #endif | 571 #endif |
| 576 | 572 |
| 577 HAL_DISABLE_INTERRUPTS(oldints); | 573 HAL_DISABLE_INTERRUPTS(oldints); |
| 578 #if 0 | |
| 579 _get_cache_contents(CYGARC_UNCACHED_ADDRESS(&_hold_cache_contents[0][0])); | |
| 580 #endif | |
| 581 HAL_DCACHE_SYNC(); | 574 HAL_DCACHE_SYNC(); |
| 582 if (!cache_enabled) { | 575 if (!cache_enabled) { |
| 583 HAL_ICACHE_DISABLE(); | 576 HAL_ICACHE_DISABLE(); |
| 584 HAL_DCACHE_DISABLE(); | 577 HAL_DCACHE_DISABLE(); |
| 585 HAL_DCACHE_SYNC(); | 578 HAL_DCACHE_SYNC(); |
| 586 } | 579 } |
| 587 HAL_ICACHE_INVALIDATE_ALL(); | 580 HAL_ICACHE_INVALIDATE_ALL(); |
| 588 HAL_DCACHE_INVALIDATE_ALL(); | 581 HAL_DCACHE_INVALIDATE_ALL(); |
| 589 #if 0 | |
| 590 _get_cache_contents(CYGARC_UNCACHED_ADDRESS(&_hold_cache_contents[1][0])); | |
| 591 diag_printf("Cache before flush/invalidate\n"); | |
| 592 diag_dump_buf(&_hold_cache_contents[0][0], sizeof(_hold_cache_contents[0])); | |
| 593 diag_printf("Cache after flush/invalidate\n"); | |
| 594 diag_dump_buf(&_hold_cache_contents[1][0], sizeof(_hold_cache_contents[1])); | |
| 595 #endif | |
| 596 // set up a temporary context that will take us to the trampoline | 582 // set up a temporary context that will take us to the trampoline |
| 597 HAL_THREAD_INIT_CONTEXT((CYG_ADDRESS)workspace_end, entry, trampoline, 0); | 583 HAL_THREAD_INIT_CONTEXT((CYG_ADDRESS)workspace_end, entry, trampoline, 0); |
| 598 | 584 |
| 599 // switch context to trampoline | 585 // switch context to trampoline |
| 600 HAL_THREAD_SWITCH_CONTEXT(&saved_context, &workspace_end); | 586 HAL_THREAD_SWITCH_CONTEXT(&saved_context, &workspace_end); |
