Re: context switch values "C"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you Robert, pc is program counter, and yes i686 with kernel 2.4.26.
what values in /dev/kmem.  

On Wed, 6 Oct 2004, Robert Love wrote:

> On Wed, 2004-10-06 at 17:02 -0500, FD wrote:
> 
> > how can I find the context switch values (pc, psw, reg) for a process 
> > for example if I need to get process #1 init values? 
> > is there a function in c that can do that? thanks 
> 
> It is architecture-dependent.
> 
> If task is the task_struct of the process in question, on i386
> task->thread->eip is the instruction pointer (what you mean by "pc"
> above I presume).
> 
> Other processor state is in task->thread.  See asm-i386/processor.h for
> i386.
> 
> The registers are stored on the stack.  See arch/i386/kernel/entry.S.
> 
> 	Robert Love
> 
> 
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux