int in_kernel = (regs->cs & 3) == 0; 
int in_kernel = !user_mode(regs); 
void show_registers(struct pt_regs *regs){	int i;	int in_kernel = (regs->cs & 3) == 0;	unsigned long rsp;	const int cpu = safe_smp_processor_id(); 	struct task_struct *cur = cpu_pda[cpu].pcurrent; 		rsp = regs->rsp;	printk("CPU %d ", cpu);	__show_regs(regs);	printk("Process %s (pid: %d, threadinfo %p, task %p)\n",		cur->comm, cur->pid, cur->thread_info, cur);	/*	 * When in-kernel, we also print out the stack and code at the	 * time of the fault..	 */	if (in_kernel) {		printk("Stack: ");		show_stack(NULL, (unsigned long*)rsp);		printk("\nCode: ");		if(regs->rip < PAGE_OFFSET)			goto bad;		for(i=0;i<20;i++)		{			unsigned char c;			if(__get_user(c, &((unsigned char*)regs->rip)[i])) {bad:				printk(" Bad RIP value.");				break;			}			printk("%02x ", c);		}	}	printk("\n");}	
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/76381fee7e8feb4c22be636aa5d4765dbe4fbf9e/traps.c/buggy/arch/x86_64/kernel/traps.c