Hi I am working on a RTOS. The RTOS code is available for IAR and GCC compiler. However I need it to work i with CCS. I have changed mny things including the syntax of interrupt declare. However there are some assembly codes which are causing errors and I am unable to resolve them despite me looking for solution desperately. I am using CCS 6.0 and I have successfully compiled the mentioned code in RHGCC GNU 4.9.1. Now I want to compile it in TI compiler v 4.3.3.
The errors I am receiving are all the same kind. and in the same file and are concerned only to two functions. So wherever these functions are used, i get the error.
The file I am getting errors is "tiros.c" and the error is "#18 expected a ")""
Where ever these following lines are used, i get the error
OS_CRITICAL_BEGIN();
OS_CRITICAL_END();
when I right click and "Open Declaration", I get following lines in "tiros.h"
/** Begin a critical section.
*
* This should always be matched with an
* OS_CRITICAL_END() in the same function. Critical sections should be
* enabled in the function using OS_CRITICAL_ENABLE() */
#define OS_CRITICAL_BEGIN() OS_PORT_CRITICAL_BEGIN()
/** End a critical section.
* This should be matched to a corresponding \ref OS_BEGIN_CRITICAL() call. */
#define OS_CRITICAL_END() OS_PORT_CRITICAL_END()
when I right click OS_PORT_CRITICAL_BEGIN() and OS_PORT_CRITICAL_END() then click "Open Declaration" , I get following lines in "tr_port.h".
/* Begin a critical section
*
* The current interrupt state is saved in osint_int_status and then
* interrupts are disabled
* According to MSP430 documentation Pg 3-39, 3-40, the instuction
* following EINT is always executed even if an ISR is pending.
* Similarly, if any code sequence should be protected from
* interruption, the DINT should be executed at least one instruction
* before the uninterruptible sequence, or be followed by a nop.
* The osint_int_status &= GIE, saves only the interrupt
* state. Similarly, only the interrupt state is restored later.
* In this case, we don't add a NOP in OS_PORT_CRITICAL_BEGIN since
* dint is followed by a non critical instruction.
*/
#define OS_PORT_CRITICAL_BEGIN() \
asm volatile("mov r2, %0 \n\t" \
"dint \n\t" : "=r" (osint_int_status) : ); \
osint_int_status &= GIE;
/* End a critical section
*
* The saved interrupt state is restored */
#define OS_PORT_CRITICAL_END() \
asm volatile("bis %0, r2 \n\t" \
"nop \n\t" : : "r" (osint_int_status) );
because I dont know any assembly language, I am clueless however it seems all perfect to me since the same code compiles with GNU 4.9.1.
Can anyone please identify whats wrong here and provide solution?
Also tiros.h indirectly includes tr_port.h via tr_types.h.