xref: /openbmc/u-boot/arch/powerpc/lib/reloc.S (revision 63e22517)
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2009 Wolfgang Denk <wd@denx.de>
4 */
5
6#include <ppc_asm.tmpl>
7
8	.file	"reloc.S"
9
10	.text
11#ifndef CONFIG_NAND_SPL
12	/*
13	 * Function: relocate entries for one exception vector
14	 */
15	.globl trap_reloc
16	.type	trap_reloc, @function
17trap_reloc:
18	lwz	r0, 0(r7)		/* hdlr ...		*/
19	add	r0, r0, r3		/*  ... += dest_addr	*/
20	stw	r0, 0(r7)
21
22	lwz	r0, 4(r7)		/* int_return ...	*/
23	add	r0, r0, r3		/*  ... += dest_addr	*/
24	stw	r0, 4(r7)
25
26	lwz	r0, 8(r7)		/* transfer_to_handler ...*/
27	add	r0, r0, r3		/*  ... += dest_addr	*/
28	stw	r0, 8(r7)
29
30	blr
31	.size	trap_reloc, .-trap_reloc
32#endif
33