xref: /openbmc/u-boot/arch/powerpc/lib/reloc.S (revision a47a12be)
1*a47a12beSStefan Roese/*
2*a47a12beSStefan Roese * Copyright (C) 2009 Wolfgang Denk <wd@denx.de>
3*a47a12beSStefan Roese *
4*a47a12beSStefan Roese * See file CREDITS for list of people who contributed to this
5*a47a12beSStefan Roese * project.
6*a47a12beSStefan Roese *
7*a47a12beSStefan Roese * This program is free software; you can redistribute it and/or
8*a47a12beSStefan Roese * modify it under the terms of the GNU General Public License as
9*a47a12beSStefan Roese * published by the Free Software Foundation; either version 2 of
10*a47a12beSStefan Roese * the License, or (at your option) any later version.
11*a47a12beSStefan Roese *
12*a47a12beSStefan Roese * This program is distributed in the hope that it will be useful,
13*a47a12beSStefan Roese * but WITHOUT ANY WARRANTY; without even the implied warranty of
14*a47a12beSStefan Roese * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*a47a12beSStefan Roese * GNU General Public License for more details.
16*a47a12beSStefan Roese *
17*a47a12beSStefan Roese * You should have received a copy of the GNU General Public License
18*a47a12beSStefan Roese * along with this program; if not, write to the Free Software
19*a47a12beSStefan Roese * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20*a47a12beSStefan Roese * MA 02111-1307 USA
21*a47a12beSStefan Roese */
22*a47a12beSStefan Roese
23*a47a12beSStefan Roese#include <ppc_asm.tmpl>
24*a47a12beSStefan Roese
25*a47a12beSStefan Roese	.file	"reloc.S"
26*a47a12beSStefan Roese
27*a47a12beSStefan Roese	.text
28*a47a12beSStefan Roese#ifndef CONFIG_NAND_SPL
29*a47a12beSStefan Roese	/*
30*a47a12beSStefan Roese	 * Function: relocate entries for one exception vector
31*a47a12beSStefan Roese	 */
32*a47a12beSStefan Roese	.globl trap_reloc
33*a47a12beSStefan Roese	.type	trap_reloc, @function
34*a47a12beSStefan Roesetrap_reloc:
35*a47a12beSStefan Roese	lwz	r0, 0(r7)		/* hdlr ...		*/
36*a47a12beSStefan Roese	add	r0, r0, r3		/*  ... += dest_addr	*/
37*a47a12beSStefan Roese	stw	r0, 0(r7)
38*a47a12beSStefan Roese
39*a47a12beSStefan Roese	lwz	r0, 4(r7)		/* int_return ...	*/
40*a47a12beSStefan Roese	add	r0, r0, r3		/*  ... += dest_addr	*/
41*a47a12beSStefan Roese	stw	r0, 4(r7)
42*a47a12beSStefan Roese
43*a47a12beSStefan Roese	lwz	r0, 8(r7)		/* transfer_to_handler ...*/
44*a47a12beSStefan Roese	add	r0, r0, r3		/*  ... += dest_addr	*/
45*a47a12beSStefan Roese	stw	r0, 8(r7)
46*a47a12beSStefan Roese
47*a47a12beSStefan Roese	blr
48*a47a12beSStefan Roese	.size	trap_reloc, .-trap_reloc
49*a47a12beSStefan Roese#endif
50