Zephyr Project Requirements
Stacks

Stacks

UID:
VERSION:
CLASSIFICATION:
PREFIX:
ZEP-SRS-30-
Type
Level
UID
STATUS
TYPE
COMPONENT
REFS
Title
Statement
USER_STORY
TEXT

SPDX-License-Identifier: Apache-2.0

REQUIREMENT
1
ZEP-SRS-30-1
Draft
Functional
Stacks
ZEP-SRS-30-1
Stack definition at compile time

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

REQUIREMENT
2
ZEP-SRS-30-2
Draft
Functional
Stacks
ZEP-SRS-30-2
Stack initialization at run time with an user-defined memory area

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

REQUIREMENT
3
ZEP-SRS-30-3
Draft
Functional
Stacks
ZEP-SRS-30-3
Stack initialization at run time with automatically allocated memory area

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

REQUIREMENT
4
ZEP-SRS-30-4
Draft
Functional
Stacks
ZEP-SRS-30-4
Releasing a dynamically allocated stack buffer

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

REQUIREMENT
5
ZEP-SRS-30-5
Draft
Functional
Stacks
ZEP-SRS-30-5
Push an item to the stack

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

REQUIREMENT
6
ZEP-SRS-30-6
Draft
Functional
Stacks
ZEP-SRS-30-6
Pop an item from the stack

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.

REQUIREMENT
7
ZEP-SRS-30-7
Draft
Functional
Stacks
ZEP-SRS-30-7
Pushing onto a full stack

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

REQUIREMENT
8
ZEP-SRS-30-8
Draft
Functional
Stacks
ZEP-SRS-30-8
Concurrent access protection

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.

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

REQUIREMENT
9
ZEP-SRS-30-9
Draft
Functional
Stacks
ZEP-SRS-30-9
Stack data retrieval with timeout

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

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.