goto bad_or_fault; 
goto bad_or_fault; 
do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs){	union offset_union offset;	unsigned long instr = 0, instrptr;	int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs);	unsigned int type;	mm_segment_t fs;	unsigned int fault;	u16 tinstr = 0;	instrptr = instruction_pointer(regs);	fs = get_fs();	set_fs(KERNEL_DS);	if thumb_mode(regs) {		fault = __get_user(tinstr, (u16 *)(instrptr & ~1));		if (!(fault))			instr = thumb2arm(tinstr);	} else		fault = __get_user(instr, (u32 *)instrptr);	set_fs(fs);	if (fault) {		type = TYPE_FAULT; 		goto bad_or_fault;	}	if (user_mode(regs))		goto user;	ai_sys += 1; fixup:	regs->ARM_pc += thumb_mode(regs) ? 2 : 4;	switch (CODING_BITS(instr)) {	case 0x00000000:	/* 3.13.4 load/store instruction extensions */		if (LDSTHD_I_BIT(instr))			offset.un = (instr & 0xf00) >> 4 | (instr & 15);		else			offset.un = regs->uregs[RM_BITS(instr)];		if ((instr & 0x000000f0) == 0x000000b0 || /* LDRH, STRH */		    (instr & 0x001000f0) == 0x001000f0)   /* LDRSH */			handler = do_alignment_ldrhstrh;		else if ((instr & 0x001000f0) == 0x000000d0 || /* LDRD */			 (instr & 0x001000f0) == 0x000000f0)   /* STRD */			handler = do_alignment_ldrdstrd;		else if ((instr & 0x01f00ff0) == 0x01000090) /* SWP */			goto swp;		else			goto bad;		break;	case 0x04000000:	/* ldr or str immediate */		offset.un = OFFSET_BITS(instr);		handler = do_alignment_ldrstr;		break;	case 0x06000000:	/* ldr or str register */		offset.un = regs->uregs[RM_BITS(instr)];		if (IS_SHIFT(instr)) {			unsigned int shiftval = SHIFT_BITS(instr);			switch(SHIFT_TYPE(instr)) {			case SHIFT_LSL:				offset.un <<= shiftval;				break;			case SHIFT_LSR:				offset.un >>= shiftval;				break;			case SHIFT_ASR:				offset.sn >>= shiftval;				break;			case SHIFT_RORRRX:				if (shiftval == 0) {					offset.un >>= 1;					if (regs->ARM_cpsr & PSR_C_BIT)						offset.un |= 1 << 31;				} else					offset.un = offset.un >> shiftval |							  offset.un << (32 - shiftval);				break;			}		}		handler = do_alignment_ldrstr;		break;	case 0x08000000:	/* ldm or stm */		handler = do_alignment_ldmstm;		break;	default:		goto bad;	}	type = handler(addr, instr, regs);	if (type == TYPE_ERROR || type == TYPE_FAULT)		goto bad_or_fault;	if (type == TYPE_LDST)		do_alignment_finish_ldst(addr, instr, regs, offset);	return 0; bad_or_fault:	if (type == TYPE_ERROR)		goto bad;	regs->ARM_pc -= thumb_mode(regs) ? 2 : 4;	/*	 * We got a fault - fix it up, or die.	 */	do_bad_area(current, current->mm, addr, fsr, regs);	return 0; swp:	printk(KERN_ERR "Alignment trap: not handling swp instruction\n"); bad:	/*	 * Oops, we didn't handle the instruction.	 */	printk(KERN_ERR "Alignment trap: not handling instruction "		"%0*lx at [<%08lx>]\n",		thumb_mode(regs) ? 4 : 8,		thumb_mode(regs) ? tinstr : instr, instrptr);	ai_skipped += 1;	return 1; user:	ai_user += 1;	if (ai_usermode & 1)		printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%0*lx "		       "Address=0x%08lx FSR 0x%03x\n", current->comm,			current->pid, instrptr,		        thumb_mode(regs) ? 4 : 8,		        thumb_mode(regs) ? tinstr : instr,		        addr, fsr);	if (ai_usermode & 2)		goto fixup;	if (ai_usermode & 4)		force_sig(SIGBUS, current);	else		set_cr(cr_no_alignment);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/737d0bb7701cdebb661e4db0236071a7df977777/alignment.c/buggy/arch/arm/mm/alignment.c