33 #ifndef __ARCH_GENERIC_LINUX_THREADINFO_HH__ 34 #define __ARCH_GENERIC_LINUX_THREADINFO_HH__ 55 warn_once(
"Unable to find kernel symbol %s\n", symbol);
56 warn_once(
"Kernel not compiled with task_struct info; can't get " 57 "currently executing task/process/thread name/ids!\n");
68 : tc(_tc), sys(tc->getSystemPtr()), pcbb(_pcbb)
79 panic(
"curThreadInfo() not implemented for this ISA");
90 return sp & ~
ULL(0x3fff);
100 if (!
get_data(
"thread_info_task", offset))
112 if (!
get_data(
"task_struct_pid", offset))
128 if (!
get_data(
"task_struct_tgid", offset))
144 if (!
get_data(
"task_struct_start_time", offset))
164 if (!
get_data(
"task_struct_comm", offset))
165 return "FailureIn_curTaskName";
167 if (!
get_data(
"task_struct_comm_size", size))
168 return "FailureIn_curTaskName";
170 char buffer[size + 1];
186 if (!
get_data(
"task_struct_mm", offset))
201 #endif // __ARCH_GENERIC_LINUX_THREADINFO_HH__ #define panic(...)
This implements a cprintf based panic() function.
Addr curTaskInfo(Addr thread_info=0)
int64_t curTaskStart(Addr thread_info=0)
const bool CurThreadInfoImplemented
virtual PortProxy & getVirtProxy()=0
T read(Addr address) const
Read sizeof(T) bytes from address and return as object T.
std::string curTaskNameFromTaskStruct(Addr task_struct)
int64_t curTaskStartFromTaskStruct(Addr task_struct)
ThreadInfo(ThreadContext *_tc, Addr _pcbb=0)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
const ByteOrder GuestByteOrder
int32_t curTaskMmFromTaskStruct(Addr task_struct)
int32_t curTaskPIDFromTaskStruct(Addr task_struct)
virtual PortProxy & getPhysProxy()=0
bool findAddress(const std::string &symbol, Addr &address) const
int32_t curTaskTGIDFromTaskStruct(Addr task_struct)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define ULL(N)
uint64_t constant
SymbolTable * kernelSymtab
kernel symbol table
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
This object is a proxy for a port or other object which implements the functional response protocol...
void readString(std::string &str, Addr addr) const
Same as tryReadString, but insists on success.
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
int32_t curTaskPID(Addr thread_info=0)
int32_t curTaskMm(Addr thread_info=0)
std::string curTaskName(Addr thread_info=0)
const int CurThreadInfoReg
int32_t curTaskTGID(Addr thread_info=0)
bool get_data(const char *symbol, T &data)