Skip to content

Support allocating stack from separate heap #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

aggarg
Copy link
Member

@aggarg aggarg commented Feb 24, 2021

Description

The change adds support for allocating task stacks from separate heap. When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 1 in FreeRTOSConfig.h, task stacks are allocated and freed using pvPortMallocStack and vPortFreeStack functions. This allows the application writer to provide a separate allocator for task stacks.

When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 0, task stacks are allocated and freed using FreeRTOS heap functions pvPortMalloc and vPortFree.

For backward compatibility, configSTACK_ALLOCATION_FROM_SEPARATE_HEAP defaults to 0.

This change was originally submitted by eboling in this PR: #262

The change adds support for allocating task stacks from separate heap.
When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 1 in
FreeRTOSConfig.h, task stacks are allocated and freed using
pvPortMallocStack and vPortFreeStack functions. This allows the
application writer to provide a separate allocator for task stacks.

When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 0, task
stacks are allocated and freed using FreeRTOS heap functions
pvPortMalloc and vPortFree.

For backward compatibility, configSTACK_ALLOCATION_FROM_SEPARATE_HEAP
defaults to 0.

Signed-off-by: Gaurav Aggarwal <[email protected]>
@aggarg aggarg requested a review from a team as a code owner February 24, 2021 00:06
@paulbartell paulbartell self-requested a review February 24, 2021 00:55
Copy link
Contributor

@paulbartell paulbartell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a straightforward change.

@aggarg aggarg merged commit 2a604f4 into FreeRTOS:main Feb 24, 2021
@aggarg aggarg deleted the stacK_separate_heap branch February 24, 2021 02:36
mbruno-xmos pushed a commit to xmos/FreeRTOS-Kernel that referenced this pull request Mar 9, 2021
* main:
  Add some assertions and coverage exceptions to queue.c (FreeRTOS#273)
  Moved git-secrets check to a different workflow (FreeRTOS#271)
  Comment: fix code comment for xTaskAbortDelay (FreeRTOS#272)
  Added git-secrets check to Github Actions (FreeRTOS#270)
  fixed documentation for ulTaskNotifyTake() and ulTaskNotifyTakeIndexed() (FreeRTOS#269)
  Add description for vTaskList (FreeRTOS#206)
  Support allocating stack from separate heap (FreeRTOS#267)
  Update python version to 3.7.10 (FreeRTOS#265)
  Update URL in history.txt (FreeRTOS#259)
  Remove unmatched braces in MessageBuffer pre tags (FreeRTOS#256)
  Check: improve verbosity of url verifier (FreeRTOS#260)
  Update issue templates
  incorporate updates from common (FreeRTOS#255)
  Typos (FreeRTOS#248)
  Delete gitattributes (FreeRTOS#253)
  Fix typo in comment in task.h (FreeRTOS#244)
  Fix Github checks after move from master to main (FreeRTOS#246)
mbruno-xmos pushed a commit to xmos/FreeRTOS-Kernel that referenced this pull request Mar 9, 2021
* feature/xcore:
  Add some assertions and coverage exceptions to queue.c (FreeRTOS#273)
  Moved git-secrets check to a different workflow (FreeRTOS#271)
  Comment: fix code comment for xTaskAbortDelay (FreeRTOS#272)
  Added git-secrets check to Github Actions (FreeRTOS#270)
  fixed documentation for ulTaskNotifyTake() and ulTaskNotifyTakeIndexed() (FreeRTOS#269)
  Add description for vTaskList (FreeRTOS#206)
  Support allocating stack from separate heap (FreeRTOS#267)
  Update python version to 3.7.10 (FreeRTOS#265)
  Update URL in history.txt (FreeRTOS#259)
  Remove unmatched braces in MessageBuffer pre tags (FreeRTOS#256)
  Check: improve verbosity of url verifier (FreeRTOS#260)
  Update issue templates
  incorporate updates from common (FreeRTOS#255)
  Typos (FreeRTOS#248)
  Delete gitattributes (FreeRTOS#253)
  Fix typo in comment in task.h (FreeRTOS#244)
  Fix Github checks after move from master to main (FreeRTOS#246)
mbruno-xmos pushed a commit to xmos/FreeRTOS-Kernel that referenced this pull request Mar 9, 2021
* main:
  Add some assertions and coverage exceptions to queue.c (FreeRTOS#273)
  Moved git-secrets check to a different workflow (FreeRTOS#271)
  Comment: fix code comment for xTaskAbortDelay (FreeRTOS#272)
  Added git-secrets check to Github Actions (FreeRTOS#270)
  fixed documentation for ulTaskNotifyTake() and ulTaskNotifyTakeIndexed() (FreeRTOS#269)
  Add description for vTaskList (FreeRTOS#206)
  Support allocating stack from separate heap (FreeRTOS#267)
  Update python version to 3.7.10 (FreeRTOS#265)
  Update URL in history.txt (FreeRTOS#259)
  Remove unmatched braces in MessageBuffer pre tags (FreeRTOS#256)
  Check: improve verbosity of url verifier (FreeRTOS#260)
  Update issue templates
  incorporate updates from common (FreeRTOS#255)
  Typos (FreeRTOS#248)
  Delete gitattributes (FreeRTOS#253)
  Fix typo in comment in task.h (FreeRTOS#244)
  Fix Github checks after move from master to main (FreeRTOS#246)
mbruno-xmos pushed a commit to xmos/FreeRTOS-Kernel that referenced this pull request Mar 9, 2021
* feature/xcore:
  Add some assertions and coverage exceptions to queue.c (FreeRTOS#273)
  Moved git-secrets check to a different workflow (FreeRTOS#271)
  Comment: fix code comment for xTaskAbortDelay (FreeRTOS#272)
  Added git-secrets check to Github Actions (FreeRTOS#270)
  fixed documentation for ulTaskNotifyTake() and ulTaskNotifyTakeIndexed() (FreeRTOS#269)
  Add description for vTaskList (FreeRTOS#206)
  Support allocating stack from separate heap (FreeRTOS#267)
  Update python version to 3.7.10 (FreeRTOS#265)
  Update URL in history.txt (FreeRTOS#259)
  Remove unmatched braces in MessageBuffer pre tags (FreeRTOS#256)
  Check: improve verbosity of url verifier (FreeRTOS#260)
  Update issue templates
  incorporate updates from common (FreeRTOS#255)
  Typos (FreeRTOS#248)
  Delete gitattributes (FreeRTOS#253)
  Fix typo in comment in task.h (FreeRTOS#244)
  Fix Github checks after move from master to main (FreeRTOS#246)
aggarg added a commit to aggarg/FreeRTOS-Kernel that referenced this pull request Mar 31, 2021
configSTACK_ALLOCATION_FROM_SEPARATE_HEAP was added recently in
FreeRTOS#267. This macro was
used in portable.h before its default value was defined, resulting in a
warning when built with -Wundef. This changes moves the default value
definition for configSTACK_ALLOCATION_FROM_SEPARATE_HEAP to portable.h
to ensure that it is defined before first use.

portUSING_MPU_WRAPPERS check in mpu_wrappers.h was updated in
FreeRTOS#285. The new check
results in a warning when built with -Wundef because
portUSING_MPU_WRAPPERS is not defined yet. This changes adds the default
value definition for portUSING_MPU_WRAPPERS to portable.h to ensure that
it is defined before first use.

Signed-off-by: Gaurav Aggarwal <[email protected]>
n9wxu pushed a commit that referenced this pull request Apr 2, 2021
configSTACK_ALLOCATION_FROM_SEPARATE_HEAP was added recently in
#267. This macro was
used in portable.h before its default value was defined, resulting in a
warning when built with -Wundef. This changes moves the default value
definition for configSTACK_ALLOCATION_FROM_SEPARATE_HEAP to portable.h
to ensure that it is defined before first use.

portUSING_MPU_WRAPPERS check in mpu_wrappers.h was updated in
#285. The new check
results in a warning when built with -Wundef because
portUSING_MPU_WRAPPERS is not defined yet. This changes adds the default
value definition for portUSING_MPU_WRAPPERS to portable.h to ensure that
it is defined before first use.

Signed-off-by: Gaurav Aggarwal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants