Compiling RTX Kernel Files Using the GCC Compiler in the Eclipse IDE

We have a project in the KEIL IDE for LPC2148 that has RTX kernel programs along with other programs in it that have been compiled by ARM CC. Now we need to change the IDE from KEIL (ARM CC) to Eclipse (GCC). When we tried to compile it in the Eclipse GCC compiler, it shows errors in the RTX_Config.c and RTX_Config.h files. Other files are compiled using the GCC compiler. But the RTXConfig.c file has special compiler codes that GCC does not compile. Is there any solution to compile this project in the Eclipse IDE using the GCC compiler? Please help me with this as a newbie. thanks in advance

We have some keil keywords, such as irq, __swi, _ _task, __asm, which was successfully compiled by ARM CC (keil), but when we tried to port it to the GCC (Eclipse) compiler, this compiler cannot compile these keywords and show errors. Is there a way to compile these keil keywords in the GCC compiler?

+4
source share
1 answer

do_software_interrupt, do_irq and do_fiq are interrupt service routines for SWI, IRQ, and FIQ, respectively. These functions are implemented in c using the gccs attribute function. Here is the actual c code containing the procedures for irq, fiq and program interrupt.

entry.c

void __attribute__((interrupt("IRQ"))) do_irq() { //your irq service code goes here } void __attribute__((interrupt("FIQ"))) do_fiq() { //your fiq service code goes here } void __attribute__((interrupt("SWI"))) do_software_interrupt() { volatile unsigned int int_num; asm("LDR r0, [lr, #-4]"); asm("BIC r0, #0xFF000000"); asm("MOV %0, r0":"=r"(int_num):); //based on int_num, you can determine which system call is called } void c_start() { asm volatile ("SVC 0x5"); while(1){} } 
+2
source

Source: https://habr.com/ru/post/1444095/


All Articles