1 /* exc_vector.S - exception handling vector
3 Copyright (C) 2010-2011 Hector Martin "marcan" <hector@marcansoft.com>
5 This code is licensed to you under the terms of the GNU GPL, version 2;
6 see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
9 #include "../common/assembly.h"
12 .section .start,"ax",@progbits
15 .global _exc_vec, _exc_vec_end, _exception_start
21 lis r0, _exception_start@h
22 ori r0, r0, _exception_start@l
24 li r0, 0 /* exception number */
61 mfcr r3 ; std r3, 0x2100(0)
62 mfxer r3 ; std r3, 0x2108(0)
63 mfctr r3 ; std r3, 0x2118(0)
64 mfsrr0 r3 ; std r3, 0x2120(0)
65 mfsrr1 r3 ; std r3, 0x2128(0)
66 mfdar r3 ; std r3, 0x2130(0)
67 mfdsisr r3 ; std r3, 0x2138(0)
69 /* make stack space (at least 288 bytes required per ABI */
72 /* exception number = arg */
74 /* set up the TOC register */
75 lis r2, (__toc_start+0x8000)@h
76 ori r2, r2, (__toc_start+0x8000)@l
79 ld r3, 0x2100(0) ; mtcr r3
80 ld r3, 0x2108(0) ; mtxer r3
81 ld r3, 0x2110(0) ; mtlr r3
82 ld r3, 0x2118(0) ; mtctr r3
83 ld r3, 0x2120(0) ; mtsrr0 r3
84 ld r3, 0x2128(0) ; mtsrr1 r3