/sound/sh/

itmus-rt-tegra.git' title='litmus-rt-tegra.git Git repository'/>
aboutsummaryrefslogblamecommitdiffstats
path: root/arch/mips/kernel/branch.c
blob: 76fd3f22c76624363d94b7e4b870d0e798ff282d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                             
                    








                                                                            
                                                   











































































                                                                                











                                                                                






























































                                                                        

                                   
                                                                    
                    
                                                          

                                 


                                              
                                               


























                                                                                




                                                                                    
 
/*
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 1996, 97, 2000, 2001 by Ralf Baechle
 * Copyright (C) 2001 MIPS Technologies, Inc.
 */
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <asm/branch.h>
#include <asm/cpu.h>
#include <asm/cpu-features.h>
#include <asm/fpu.h>
#include <asm/inst.h>
#include <asm/ptrace.h>
#include <asm/uaccess.h>

/*
 * Compute the return address and do emulate branch simulation, if required.
 */
int __compute_return_epc(struct pt_regs *regs)
{
	unsigned int *addr, bit, fcr31, dspcontrol;
	long epc;
	union mips_instruction insn;

	epc = regs->cp0_epc;
	if (epc & 3)
		goto unaligned;

	/*
	 * Read the instruction
	 */
	addr = (unsigned int *) epc;
	if (__get_user(insn.word, addr)) {
		force_sig(SIGSEGV, current);
		return -EFAULT;
	}

	regs->regs[0] = 0;
	switch (insn.i_format.opcode) {
	/*
	 * jr and jalr are in r_format format.
	 */
	case spec_op:
		switch (insn.r_format.func) {
		case jalr_op:
			regs->regs[insn.r_format.rd] = epc + 8;
			/* Fall through */
		case jr_op: