Re: user_mode(regs) macro in kernel

2012-06-20 Thread Anirban Roy
It checks whether exception happened in user mode or supervisor mode On Jun 20, 2012 5:15 PM, "sumeet linux" wrote: > Hi All, > > What is the meaning of user_mode(regs) macro ? What does it do ? > This macro used in many files in kernel like signal.c, trap.c, process.c > files. > From the code i

Re: user_mode(regs) macro in kernel

2012-06-20 Thread Mulyadi Santosa
On Wed, Jun 20, 2012 at 6:45 PM, sumeet linux wrote: > Hi All, > > What is the meaning of user_mode(regs) macro ?  What does it do ? I assume you were referring to: http://lxr.linux.no/#linux+v3.4.3/arch/x86/include/asm/ptrace.h#L164 right? let me paste the code here: return !!(regs->cs & 3) A

user_mode(regs) macro in kernel

2012-06-20 Thread sumeet linux
Hi All, What is the meaning of user_mode(regs) macro ? What does it do ? This macro used in many files in kernel like signal.c, trap.c, process.c files. >From the code it looks like it checks is in USER mode or KERNEL mode, but still not clear on usage and implementation of this macro. Thanks.