Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner