Zephyr Project Requirements
Stacks

SPDX-License-Identifier: Apache-2.0

ZEP-SRS-30-1
1. Stack definition at compile time UID: ZEP-SRS-30-1 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall provide a mechanism to define and initialize a stack at compile time.

ZEP-SRS-30-2
2. Stack initialization at run time with an user-defined memory area UID: ZEP-SRS-30-2 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall provide a mechanism to initialize a stack at run time, using a data buffer provided by the user.

ZEP-SRS-30-3
3. Stack initialization at run time with automatically allocated memory area UID: ZEP-SRS-30-3 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall provide a mechanism to initialize a stack at run time, with automatic allocation of the stack memory.

ZEP-SRS-30-4
4. Releasing a dynamically allocated stack buffer UID: ZEP-SRS-30-4 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall provide a mechanism to deallocate all resources previously allocated by a run-time stack definition.

ZEP-SRS-30-5
5. Push an item to the stack UID: ZEP-SRS-30-5 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall provide a mechanism to add a new item on top of the stack.

ZEP-SRS-30-6
6. Pop an item from the stack UID: ZEP-SRS-30-6 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall provide a mechanism to retrieve the current item from the top of the stack and to remove such item from the stack.

ZEP-SRS-30-7
7. Pushing onto a full stack UID: ZEP-SRS-30-7 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): RELATIONS (Child): STATEMENT:

If the stack is full when an item is pushed, the Zephyr RTOS shall return an error and not add the item.

ZEP-SRS-30-8
8. Concurrent access protection UID: ZEP-SRS-30-8 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall provide a mechanism to push items to or pop items from the same stack object from multiple execution contexts which can run concurrently.

USER_STORY:

As a Zephyr RTOS user I want to access a stack from different execution contexts (like threads), including interrupt handlers.

ZEP-SRS-30-9
9. Stack data retrieval with timeout UID: ZEP-SRS-30-9 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): RELATIONS (Child): STATEMENT:

The Zephyr RTOS shall provide a mechanism to allow waiting for a stack item availability within a specified timeout.

USER_STORY:

As a Zephyr RTOS user I want to share a stack object between a producer and a consumer threads. The producer thread pushes items into the stack, while the consumer thread is waiting for an item to appear in the stack.

  • ZEP-SRS-30-6
    6. Pop an item from the stack UID: ZEP-SRS-30-6 STATUS: Draft TYPE: Functional COMPONENT: Stacks RELATIONS (Parent): STATEMENT:

    The Zephyr RTOS shall provide a mechanism to retrieve the current item from the top of the stack and to remove such item from the stack.