#17603 - poslundc - Thu Mar 11, 2004 12:57 am
In order to improve the performance of an ISR I am attempting to use space local to the ISR as my global variables, then accessing those variables from C. Here is what I'm trying to do:
... That's my ASM file. The code all goes into IWRAM and is properly aligned. Then in C code:
By all rights, this should work, but for some reason it generates a "segmentation fault" on linking. (Something which I haven't run into since the days when I was accessing invalid array members in my Unix terminal programs... and that was always at run-time only!)
I've tried a few variations on my syntax but to no avail. Does anyone know how to do this?
Thanks,
Dan.
Code: |
.global InterruptHandler, JumpRoutine
InterruptHandler: blah blah ISR code bx lr JumpRoutine: .space 4 |
... That's my ASM file. The code all goes into IWRAM and is properly aligned. Then in C code:
Code: |
extern u32 *JumpRoutine;
void ISR_EnableHBlank(void) { ... code ... *JumpRoutine = (u32)MyHBlankFunction; } |
By all rights, this should work, but for some reason it generates a "segmentation fault" on linking. (Something which I haven't run into since the days when I was accessing invalid array members in my Unix terminal programs... and that was always at run-time only!)
I've tried a few variations on my syntax but to no avail. Does anyone know how to do this?
Thanks,
Dan.