[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] Get the pid of a process from hypervisor
Hi, how can i get the pid of a systemcall from do_guest_trap in traps.c? I tried with this code put in do_guest_trap: uint32_t pid; uint32_t thread_info_address;
uint32_t task_struct_addr; int pid_offset=268; // i got this number using the module in xenaccess unsigned_long *tmp; //I start getting the address of the thread:
thread_info_address= v->arch.guest_context.kernel_sp & 0xFFFFE000; //then i get the struct of the task tmp=(unsigned long*)(thread_info_addr);
get_user(task_struct_addr,tmp); //finally i get pid: tmp =(unsigned long*)(task_struct_addr + pid_offset); get_user(pid,tmp); printk("pid %d",pid); What is wrong in the code? _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |