extern | IVOR4Handler(); |
extern | uint32_t | __IV_ADDR; /* Interrupt Vector Prefix value from link file */ | |
extern | const | vuint32_t | IntcIsrVectorTable[]; |
void initIrqVectors(void)
{
asm ("lis r5, __IV_ADDR@h"); /* IVPR = address base used with IVOR's */ | ||||||||
asm ("mtIVPR r5 "); | ||||||||
asm ("lis r5, IVOR4Handler@h"); /* IVOR4 = address of handler */ | ||||||||
asm ("ori r5, r5, IVOR4Handler@l"); | ||||||||
asm ("mtIVOR4 r5"); |
}
This is a IVPR and IVOR4 initialization routing .But the compiler say" _IV_ADDR "and "IVOR4Handler" are undefined.I search all datas .I don't know how to define them.
Not sure what the reason is.
For example, default liker file already contains:
_stack_addr = ADDR(stack)+SIZEOF(stack);
_stack_end = ADDR(stack);
_heap_addr = ADDR(heap);
_heap_end = ADDR(heap)+SIZEOF(heap);
EXCEPTION_HANDLERS = ADDR(exception_handlers);
If I use any value like _stack_addr or EXCEPTION_HANDLERS in C file then it always works fine. Meaningless example:
extern uint32_t _stack_addr;
void test(void)
{
asm ("lis r5, _stack_addr@h");
...
}
Lukas