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");
81 panic(
"curThreadInfo() not implemented for this ISA");
92 return sp & ~
ULL(0x3fff);
99 if (!
get_data(
"thread_info_task", offset))
115 if (!
get_data(
"task_struct_pid", offset))
128 if (!
get_data(
"task_struct_tgid", offset))
141 if (!
get_data(
"task_struct_start_time", offset))
158 if (!
get_data(
"task_struct_comm", offset))
159 return "FailureIn_curTaskName";
161 if (!
get_data(
"task_struct_comm_size", size))
162 return "FailureIn_curTaskName";
164 char buffer[size + 1];
174 if (!
get_data(
"task_struct_mm", offset))
186 #endif // __ARCH_GENERIC_LINUX_THREADINFO_HH__
Addr curTaskInfo(Addr thread_info=0)
int64_t curTaskStart(Addr thread_info=0)
const bool CurThreadInfoImplemented
virtual MiscReg readMiscRegNoEffect(int misc_reg) const =0
bool findAddress(const std::string &symbol, Addr &address) const
void CopyOut(ThreadContext *tc, void *dest, Addr src, size_t cplen)
ThreadInfo(ThreadContext *_tc, Addr _pcbb=0)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
virtual PortProxy & getPhysProxy()=0
This class encapsulates the types, structures, constants, functions, and syscall-number mappings spec...
void CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen)
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
virtual void readBlob(Addr addr, uint8_t *p, int size) const
Read size bytes memory at address and store in p.
This object is a proxy for a structural port, to be used for debug accesses.
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)