fabtor wrote on Monday, October 16, 2006:
Hi,
I’ve a problem with the functions vPortDisableInterruptFromThumb and vPortEnableInterruptFromThumb.
In IAR arm7 (AT91SAM7S) the function are defined in portmacro.h as:
__arm __interwork void vPortDisableInterruptsFromThumb( void );
__arm __interwork void
vPortEnableInterruptsFromThumb( void );
They are been ported in gcc in the file portISR.c as follows:
void vPortDisableInterruptsFromThumb( void ) __attribute__ ((naked));
void vPortEnableInterruptsFromThumb( void ) __attribute__ ((naked));
void vPortDisableInterruptsFromThumb( void )
{
asm volatile (
“STMDB SP!, {R0} \n\t” /* Push R0. */
“MRS R0, CPSR \n\t” /* Get CPSR. */
“ORR R0, R0, #0xC0 \n\t” /* Disable IRQ, FIQ. */
“MSR CPSR, R0 \n\t” /* Write back modified value. */
“LDMIA SP!, {R0} \n\t” /* Pop R0. */
“BX R14” ); /* Return back to thumb. */
}
void vPortEnableInterruptsFromThumb( void )
{
asm volatile (
“STMDB SP!, {R0} \n\t” /* Push R0. */
“MRS R0, CPSR \n\t” /* Get CPSR. */
“BIC R0, R0, #0xC0 \n\t” /* Enable IRQ, FIQ. */
“MSR CPSR, R0 \n\t” /* Write back modified value. */
“LDMIA SP!, {R0} \n\t” /* Pop R0. */
“BX R14” ); /* Return back to thumb. */
}
In IAR STR91x portmacro.h file, i don’t have these functions but i’ve only two defines:
#define portDISABLE_INTERRUPTS() __disable_interrupt()
#define portENABLE_INTERRUPTS() __enable_interrupt()
My question is: How can i port these function in portISR.c in GCC STR91x file?
Thanks.
Fabrizio.