Updates specified exception vector to jump to given handler. * * Addresses of handlers are stored in memory following exception vectors. */
| 64 | * Addresses of handlers are stored in memory following exception vectors. |
| 65 | */ |
| 66 | static void install_handler(unsigned handler_addr, unsigned *vector) |
| 67 | { |
| 68 | /* |
| 69 | * Relative address (related to exc. vector) of the word |
| 70 | * where handler's address is stored |
| 71 | */ |
| 72 | volatile uint32_t handler_address_ptr = EXC_VECTORS_SIZE - |
| 73 | PREFETCH_OFFSET; |
| 74 | |
| 75 | /* Make it LDR instruction and store at exception vector */ |
| 76 | *vector = handler_address_ptr | LDR_OPCODE; |
| 77 | smc_coherence(vector, 4); |
| 78 | |
| 79 | /* Store handler's address */ |
| 80 | *(vector + EXC_VECTORS) = handler_addr; |
| 81 | |
| 82 | } |
| 83 | |
| 84 | /** Software Interrupt handler. |
| 85 | * |
no test coverage detected