-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththreadCtx.cpp
More file actions
50 lines (46 loc) · 888 Bytes
/
threadCtx.cpp
File metadata and controls
50 lines (46 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* @file threadCtx.cpp
* @author d.deka (https://ddeka0.github.io/)
* @brief
*
* @version 0.1
* @date 2021-02-14
*/
#include "threadCtx.hpp"
#include "logger.hpp"
/** setRsp(uint64_t rsp)
* @brief
* Set the stack pointer of this thread
* @param rsp
*
*/
void ThreadCtx::setRsp(uint64_t rsp) {
Log("rsp set = ",rsp);
this->m_rctx.rsp = rsp;
}
/** setState(uState state)
* @brief
* Change the state of this thread
* @param state
*
*/
void ThreadCtx::setState(uState state) {
this->m_state = state;
}
/** getState()
* @brief
* Returns the current state
* @return uState
* Returns the current state
*/
uState ThreadCtx::getState() {
return this->m_state;
}
/** getRegCtxPtr()
* @brief
* Returns the pointer to register context
* @return RegisterContext*
*/
RegisterContext* ThreadCtx::getRegCtxPtr() {
return &m_rctx;
}