Only co-routines needed

ringzro wrote on Sunday, August 24, 2008:

I only need co-routines, but A LOT of ‘tasking’ code gets built(compiled) and linked in. This code ends up in the final object file without a chance of being ever called. Isn’t there any option to build and link ONLY co-routine code?

davedoors wrote on Sunday, August 24, 2008:

Which compiler are you using? Most will remove uncalled code. GCC will do it also but only if you add in the correct compile time options -

-ffunction-sections -fdata-sections

and link time options

–gc-sections

ringzro wrote on Sunday, August 24, 2008:

Well, I am trying to port freeRTOS on NXP PXA51, using an evaluation version of RIDE(8KB code). RIDE is the best choice I have since no other evaluation compiler offers me at least 8KB of code. Of course, I could use SDCC, but support for PXA51 is "not complete, discontinued" as they say.

So my best choice remains RIDE using my own introduced define ‘configUSE_FREE_RTOS’ which masks out ‘tasking’ code from both ‘tasks.c’ and ‘queue.c’.

ringzro wrote on Monday, August 25, 2008:

Another isssue I have come into after #ifdef’ing out the ‘tasking’ code is that there is no chance of getting rid of that ‘tasking’ code whatsoever when using ONLY co-routines. This is because queue management calls A LOT of ‘tasking’ functions. I want to use only and JUST ONLY co-routines with queues et al, but queue functions bring in ‘task’ functions. These ‘task’ functions perform housekeeping on tasks. But… on which tasks if I don’t use any?

Am I getting it wrong somewhere around here?

ringzro wrote on Monday, August 25, 2008:

Another isssue I have come into after #ifdef’ing out the ‘tasking’ code is that there is no chance of getting rid of that ‘tasking’ code whatsoever when using ONLY co-routines. This is because queue management calls A LOT of ‘tasking’ functions. I want to use only and JUST ONLY co-routines with queues et al, but queue functions bring in ‘task’ functions. These ‘task’ functions perform housekeeping on tasks. But… on which tasks if I don’t use any? 

Am I getting it wrong somewhere around here?

dmitrycherepanv wrote on Tuesday, August 26, 2008:

The FreeRTOS is the Real Time operating system with preemptive scheduling.
Do not need tasks using protothreads, OK.

no task protothreads -> no preemptive scheduling -> only cooperative scheduling -> no condition races, no problems with simultaneous access to data -> It is simple to replace queues on array or linked lists, any way if you want to use protothreads use Contikki Operating System for example.