![]() |
nsbaci 1.0
|
Represents a thread in the runtime service. More...
#include <thread.h>
Public Member Functions | |
| nsbaci::types::ThreadID | getId () const |
| Gets the thread ID. | |
| nsbaci::types::ThreadState | getState () const |
| Gets the current state of the thread. | |
| void | setState (nsbaci::types::ThreadState newState) |
| Sets the state of the thread. | |
| nsbaci::types::Priority | getPriority () const |
| Gets the priority of the thread. | |
| void | setPriority (nsbaci::types::Priority newPriority) |
| Sets the priority of the thread. | |
| void | push (int32_t value) |
| Push a value onto the thread's stack. | |
| int32_t | pop () |
| Pop a value from the thread's stack. | |
| int32_t | top () const |
| Peek at the top of the stack without removing. | |
| uint32_t | getPC () const |
| Get the program counter. | |
| void | setPC (uint32_t addr) |
| Set the program counter. | |
| void | advancePC () |
| Increment the program counter. | |
| uint32_t | getBP () const |
| void | setBP (uint32_t addr) |
| uint32_t | getSP () const |
| void | setSP (uint32_t addr) |
| void | pushReturnAddress (uint32_t addr) |
| Push return address onto call stack. | |
| uint32_t | popReturnAddress () |
| Pop return address from call stack. | |
| bool | callStackEmpty () const |
| Check if call stack is empty. | |
| void | pushFrame (const std::vector< int32_t > &savedLocals) |
| Push a frame with saved local variable values. | |
| std::vector< int32_t > | popFrame () |
| Pop a frame and get saved local variable values. | |
| bool | frameStackEmpty () const |
| Check if frame stack is empty. | |
Represents a thread in the runtime service.
Each thread has its own stack, program counter, and execution state.
| ThreadID nsbaci::services::runtime::Thread::getId | ( | ) | const |
Gets the thread ID.
| Priority nsbaci::services::runtime::Thread::getPriority | ( | ) | const |
Gets the priority of the thread.
| ThreadState nsbaci::services::runtime::Thread::getState | ( | ) | const |
Gets the current state of the thread.

|
inline |
Pop return address from call stack.

| void nsbaci::services::runtime::Thread::setPriority | ( | nsbaci::types::Priority | newPriority | ) |
Sets the priority of the thread.
| newPriority | The new priority level to set. |
| void nsbaci::services::runtime::Thread::setState | ( | nsbaci::types::ThreadState | newState | ) |
Sets the state of the thread.
| newState | The new state to set. |
