Srdan Suka wrote:
> I have moved inline code to separet .S file and now it looks as follows:
> But interrupts don't work.
> Where is the problem?
> Thanks.
>
> Srdan
>
> // unsigned __get_cpsr (void);
>
> .global __get_cpsr
> .func __get_cpsr
> __get_cpsr:
> mrs r0, cpsr /* get CPSR */
> bx lr /* return to caller */
>
> .endfunc
>
>
> // void __set_cpsr (unsigned val);
>
> .global __set_cpsr
> .func __set_cpsr
> __set_cpsr:
> msr cpsr, r0 /* set CPSR */
> .endfunc
>
>
> // void ISR_ENTRY(void);
>
> .global ISR_ENTRY
> .func ISR_ENTRY
> ISR_ENTRY:
> sub lr, lr,#4
> stmfd sp!,{r0-r12,lr}
> mrs r1, spsr
> stmfd sp!,{r1}
> .endfunc
>
>
> // void ISR_EXIT(void);
>
> .global ISR_EXIT
> .func ISR_EXIT
> ISR_EXIT:
> ldmfd sp!,{r1}
> msr spsr_c,r1
> ldmfd sp!,{r0-r12,pc}^
> .endfunc
ENTRY and EXIT are intented C-macros in the original code not functions.
Why don't you just compile the original C souce-file containing CPSR
set/get without thumb (and with interwork if thumb code calls the
functions)?
"Don't work" is not a very good report.
Why don't you just take the code from the example from where you have
copied the code, do a "make all" and watch what parameters are used for
compiler and link the code?
Sorry for the short answers but I guess you have crossposted the request
to other forums/lists again and you might receive answers from there. If
not please ask again and I will try to help with a longer answer.