Mercurial > nand-ecoscentric
comparison packages/hal/arm/arch/current/src/vectors.S @ 46:797268ecc331 ecos-sw-1999-10-19
Merge from eCos master repository on 1999-10-19-18:55:31-BST
| author | jlarmour |
|---|---|
| date | Tue, 19 Oct 1999 19:19:52 +0000 |
| parents | a3cc6665b684 |
| children | a0774359f013 |
comparison
equal
deleted
inserted
replaced
| 45:91d213c0da48 | 46:797268ecc331 |
|---|---|
| 114 PTR(FIQ) // 0x3c | 114 PTR(FIQ) // 0x3c |
| 115 PTR(start) // This is copied to 0x28 for bootup // 0x40 | 115 PTR(start) // This is copied to 0x28 for bootup // 0x40 |
| 116 // location 0x40 is used for storing DRAM size if known | 116 // location 0x40 is used for storing DRAM size if known |
| 117 // for some platforms. | 117 // for some platforms. |
| 118 | 118 |
| 119 // Other vectors | |
| 120 .balign 16 // Should be at 0x50 | |
| 121 .balign 32 | |
| 122 | |
| 119 .text | 123 .text |
| 120 // Startup code which will get the machine into supervisor mode | 124 // Startup code which will get the machine into supervisor mode |
| 121 .global reset_vector | 125 .global reset_vector |
| 122 .type reset_vector,function | 126 .type reset_vector,function |
| 123 reset_vector: | 127 reset_vector: |
| 128 PLATFORM_SETUP1 // Early stage platform initialization | |
| 129 // which can set DRAM size at 0x40 | |
| 130 // see <cyg/hal/hal_platform_setup.h> | |
| 124 | 131 |
| 125 #if defined(CYG_HAL_STARTUP_RAM) && \ | 132 #if defined(CYG_HAL_STARTUP_RAM) && \ |
| 126 !defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) | 133 !defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) |
| 127 mrs r7,cpsr // move back to IRQ mode | 134 mrs r7,cpsr // move back to IRQ mode |
| 128 and r7,r7,#CPSR_MODE_BITS | 135 and r7,r7,#CPSR_MODE_BITS |
| 129 cmp r7,#CPSR_SUPERVISOR_MODE | 136 cmp r7,#CPSR_SUPERVISOR_MODE |
| 130 beq start | 137 beq start |
| 131 #endif | 138 #endif |
| 132 | 139 |
| 133 PLATFORM_SETUP1 // Early stage platform initialization | |
| 134 // which can set DRAM size at 0x40 | |
| 135 // see <cyg/hal/hal_platform_setup.h> | |
| 136 // We cannot access any LED registers until after PLATFORM_SETUP1 | 140 // We cannot access any LED registers until after PLATFORM_SETUP1 |
| 137 LED 7 | 141 LED 7 |
| 138 | 142 |
| 139 mov r0,#0 // move vectors | 143 mov r0,#0 // move vectors |
| 140 // We cannot perform a store until after PLATFORM_SETUP1 | 144 // We cannot perform a store until after PLATFORM_SETUP1 |
| 141 str r0, [r0,#0x40] // DRAM size to zero => unknown | 145 str r0, [r0,#0x40] // DRAM size to zero => unknown |
| 142 ldr r1,.__exception_handlers | 146 |
| 147 ldr r1,=__exception_handlers | |
| 143 #ifndef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS | 148 #ifndef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS |
| 144 // Wait with this if stubs are included (see further down). | 149 // Wait with this if stubs are included (see further down). |
| 145 ldr r2,[r1,#0x04] // undefined instruction | 150 ldr r2,[r1,#0x04] // undefined instruction |
| 146 str r2,[r0,#0x04] | 151 str r2,[r0,#0x04] |
| 147 ldr r2,[r1,#0x24] | 152 ldr r2,[r1,#0x24] |
| 148 str r2,[r0,#0x24] | 153 str r2,[r0,#0x24] |
| 149 #endif | 154 #endif |
| 150 ldr r2,[r1,#0x08] // software interrupt | 155 ldr r2,[r1,#0x08] // software interrupt |
| 151 str r2,[r0,#0x08] | 156 str r2,[r0,#0x08] |
| 157 | |
| 158 | |
| 152 #if defined(CYG_HAL_STARTUP_RAM) | 159 #if defined(CYG_HAL_STARTUP_RAM) |
| 153 // Ugly hack to get into supervisor mode | 160 // Ugly hack to get into supervisor mode |
| 154 ldr r2,[r1,#0x40] | 161 ldr r2,[r1,#0x40] |
| 155 str r2,[r0,#0x28] | 162 str r2,[r0,#0x28] |
| 156 | 163 |
| 293 init_done: | 300 init_done: |
| 294 .long 0xDEADB00B | 301 .long 0xDEADB00B |
| 295 | 302 |
| 296 // | 303 // |
| 297 // Exception handlers | 304 // Exception handlers |
| 298 // Assmumption: get here from a Supervisor context [mode] | 305 // Assumption: get here from a Supervisor context [mode] |
| 299 // | 306 // |
| 300 .code 32 | 307 .code 32 |
| 301 undefined_instruction: | 308 undefined_instruction: |
| 302 ldr sp,.__undef_exception_stack // get good stack | 309 ldr sp,.__undef_exception_stack // get good stack |
| 303 sub lr,lr,#4 // PC at time of interrupt | 310 sub lr,lr,#4 // PC at time of interrupt |
