Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Differences between v4.5.0 TCB and v4.4.0

Posted by John W. on October 9, 2007
Richard,

I looked at http://www.freertos.org/History.txt but didn't see any mention of the TCB changes from v4.4.0 to v4.5.0 - can
you please elaborate on the changes:

v4.4.0:

/*
* Task control block. A task control block (TCB) is allocated to each task,
* and stores the context of the task.
*/
typedef struct tskTaskControlBlock
{
volatile portSTACK_TYPE*pxTopOfStack;/*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE STRUCT. */
unsigned portBASE_TYPEuxTCBNumber;/*< This is used for tracing the scheduler and making debugging easier only. */
xListItemxGenericListItem;/*< List item used to place the TCB in ready and blocked queues. */
xListItemxEventListItem;/*< List item used to place the TCB in event lists. */
unsigned portBASE_TYPEuxPriority;/*< The priority of the task where 0 is the lowest priority. */
portSTACK_TYPE*pxStack;/*< Points to the start of the stack. */
signed portCHARpcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created. Facilitates debugging only. */
unsigned portSHORTusStackDepth;/*< Total depth of the stack (when empty). This is defined as the number of variables the stack can hold, not the number of bytes. */
} tskTCB;

/*lint -e956 */

tskTCB * volatile data pxCurrentTCB = NULL;

v4.5.0:

/*
* Task control block. A task control block (TCB) is allocated to each task,
* and stores the context of the task.
*/
typedef struct tskTaskControlBlock
{
volatile portSTACK_TYPE*pxTopOfStack;/*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE STRUCT. */
xListItemxGenericListItem;/*< List item used to place the TCB in ready and blocked queues. */
xListItemxEventListItem;/*< List item used to place the TCB in event lists. */
unsigned portBASE_TYPEuxPriority;/*< The priority of the task where 0 is the lowest priority. */
portSTACK_TYPE*pxStack;/*< Points to the start of the stack. */
signed portCHARpcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created. Facilitates debugging only. */

#if ( configUSE_TRACE_FACILITY == 1 )
unsigned portBASE_TYPEuxTCBNumber;/*< This is used for tracing the scheduler and making debugging easier only. */
#endif

#if ( configUSE_MUTEXES == 1 )
unsigned portBASE_TYPE uxBasePriority;
#endif

} tskTCB;

/*lint -e956 */

tskTCB * volatile pxCurrentTCB = NULL;


Thanks,
John W.

RE: Differences between v4.5.0 TCB and v4.4.0

Posted by Richard on October 9, 2007
There were only a couple of minor changes.

The uxBasePriority member was introduced for the priority inheritance mechanism. This is only used if mutexes are compiled in.

Adding this member could potentially increase the size of the TCB, depending on the configuration, so I optionally allowed another member to be excluded to lessen the impact. The uxTCBNumber member has no use other than debugging/tracing, so I excluded this is the trace facility was not compiled in.

Regards.

RE: Differences between v4.5.0 TCB and v4.4.0

Posted by John W. on October 9, 2007
Richard,

What about usStackDepth - can you explain why that was removed.

Also - can you point to the files for the following:

+ Optimised the GCC and IAR port layer code - specifically the context
switch code.

I'd like to take a look at the part that detects whether a context switch is needed or not - maybe that is part of this
optimization.

Thanks,
John

RE: Differences between v4.5.0 TCB and v4.4.0

Posted by Richard on October 9, 2007
>What about usStackDepth - can you explain why that was removed

This was obsolete. It was only used in one place, and at that location the depth was available as a function parameter, so it was not needed.

>+ Optimised the GCC and IAR port layer code - specifically the context
>switch code.

That comment is missing some vital information. It should say "Optimised the GCC and IAR port layer code for the Cortex M3 ports". The change does not effect any other ports as it is within the M3 specific assembly code.

Regards.

RE: Differences between v4.5.0 TCB and v4.4.0

Posted by John W. on October 10, 2007
Richard,

Thanks - I'm going to take a look at the M3 assembly since I'm curious as to what you have done.

Thanks Again,
John


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists