Generally if you want to do this you can setup a PCEvent on __switch_to in the kernel and you'll know at that point what the user code that is about to execute is going to be.
Ali On Mar 14, 2013, at 2:29 AM, huangyongbing <[email protected]> wrote: > Hi all, > > I want to get the task_struct entry of running process under arm > platform in gem5. How can I get the entry? > > In kernel mode, I can get the thread_info struct by operating the > kernel stack pointer stored in the r13 (SP) register. And the task_struct is > stored in the thread_info struct. The code is : > addr = context->readIntReg(INTREG_SP) & (~0x1fff); > task_addr = vp.readGtoH<int32_t>(addr + 0xc); //task_struct > > If using the same method in user mode, how can I get the content of > kernel r13 register? > > Or are there other methods in order to get the task_struct entry of > current running process? For example, in x86 platform, there is a kernel > symbol indicating to the task_struct entry directly. > > Thanks! > > Best regards, > > Yongbing Huang > > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
