1 /* Copyright 2013-2014 IBM Corp.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #define STACK_TOP 0x2000
19 #define FIXUP_ENDIAN \
20 tdi 0,0,0x48; /* Reverse endian of b . + 8 */ \
21 b 191f; /* Skip trampoline if endian is good */ \
22 .long 0xa600607d; /* mfmsr r11 */ \
23 .long 0x01006b69; /* xori r11,r11,1 */ \
24 .long 0x05009f42; /* bcl 20,31,$+4 */ \
25 .long 0xa602487d; /* mflr r10 */ \
26 .long 0x14004a39; /* addi r10,r10,20 */ \
27 .long 0xa64b5a7d; /* mthsrr0 r10 */ \
28 .long 0xa64b7b7d; /* mthsrr1 r11 */ \
29 .long 0x2402004c; /* hrfid */ \
33 /* Load an immediate 64-bit value into a register */
34 #define LOAD_IMM64(r, e) \
44 * Microwatt currently enters in LE mode at 0x0, so we don't need to
45 * do any endian fix ups>
52 /* QEMU enters at 0x10 */
64 LOAD_IMM64(%r1, STACK_TOP - 0x100)
65 LOAD_IMM64(%r12, main)
70 #define EXCEPTION(nr) \
74 /* More exception stubs */