12 #ifndef INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_STACK_HPP_ 13 #define INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_STACK_HPP_ 19 #if defined(DISTORTOS_ARCHITECTURE_ASCENDING_STACK) || defined(DISTORTOS_ARCHITECTURE_EMPTY_STACK) 20 #error "Support for \"empty ascending\", \"empty descending\" or \"full ascending\" stack not implemented!" 21 #endif // defined(DISTORTOS_ARCHITECTURE_ASCENDING_STACK) || defined(DISTORTOS_ARCHITECTURE_EMPTY_STACK) 63 Stack(
void* storage,
size_t size);
143 const Stack& operator=(
const Stack&) =
delete;
165 #endif // INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_STACK_HPP_ size_t getSize() const
Definition: Stack.hpp:103
RunnableThread class defines additional interface functions required for the thread to be actually ru...
Definition: RunnableThread.hpp:24
Stack(StorageUniquePointer &&storageUniquePointer, size_t size)
Stack's constructor.
Definition: Stack.cpp:85
const size_t adjustedSize_
adjusted size of stack's storage
Definition: Stack.hpp:155
bool checkStackPointer(const void *const stackPointer) const
Checks whether stack pointer value is within range of this stack.
Definition: Stack.hpp:87
std::unique_ptr< void, void(&)(void *)> StorageUniquePointer
unique_ptr (with deleter) to storage
Definition: Stack.hpp:37
bool checkStackGuard() const
Definition: Stack.cpp:108
~Stack()
Stack's destructor.
Definition: Stack.cpp:103
void *const adjustedStorage_
adjusted address of stack's storage
Definition: Stack.hpp:152
Top-level namespace of distortos project.
Definition: buttons.hpp:33
Stack class is an abstraction of architecture's stack.
Definition: Stack.hpp:32
StorageUniquePointer storageUniquePointer_
storage for stack
Definition: Stack.hpp:149
constexpr size_t stackGuardSize
size of "stack guard", bytes
Definition: stackGuardSize.hpp:26
void setStackPointer(void *const stackPointer)
Sets value of stack pointer.
Definition: Stack.hpp:136
size_t getHighWaterMark() const
Definition: Stack.cpp:118
void * stackPointer_
current value of stack pointer register
Definition: Stack.hpp:158
int initialize(RunnableThread &runnableThread)
Fills the stack with stack sentinel, initializes its contents and stack pointer value.
Definition: Stack.cpp:131
void * getStackPointer() const
Gets current value of stack pointer.
Definition: Stack.hpp:114