Tool/software: TI C/C++ Compiler
Hi,
I see that TI uses the following in their source code (for example in file "cpu.c" from StarterWare V2.0.1.1):
/* ** ** Wrapper function for the IRQ disable function ** */ void CPUirqd(void) { /* Disable IRQ in CPSR */ asm(" mrs r0, CPSR\n\t" " orr r0, r0, #0x80\n\t" " msr CPSR_c, r0"); }
At the same time TI says there might be a problem using _asm statement within a C function body:
Just to make shure I want to ask if the implementation above could cause any troubles or if one should write the following instead (code from the link above):
__asm(" .sect \".text:CPUirqd\"\n" " .clink\n" " .global CPUirqd\n" "CPUirqd:\n" " mrs r0, CPSR\n\t" " orr r0, r0, #0x80\n\t" " msr CPSR_c, r0\n\t" " bx lr");
I'm looking forward getting a clear statement from a TI compiler expert. Thanks.
Regards,
Patrick