1
2
3
4
5
6
7
8 #include <linux/jump_label.h>
9 #include <asm/ppc_asm.h>
10 #include <asm/hvcall.h>
11 #include <asm/asm-offsets.h>
12 #include <asm/opal.h>
13 #include <asm/asm-compat.h>
14 #include <asm/feature-fixups.h>
15
16 .section ".text"
17
18
19
20
21
22
23 _GLOBAL_TOC(__opal_call)
24 mflr r0
25 std r0,PPC_LR_STKOFF(r1)
26 ld r12,STK_PARAM(R12)(r1)
27 li r0,MSR_IR|MSR_DR|MSR_LE
28 andc r12,r12,r0
29 LOAD_REG_ADDR(r11, opal_return)
30 mtlr r11
31 LOAD_REG_ADDR(r11, opal)
32 ld r2,0(r11)
33 ld r11,8(r11)
34 mtspr SPRN_HSRR0,r11
35 mtspr SPRN_HSRR1,r12
36
37 ld r0,STK_PARAM(R11)(r1)
38 hrfid
39 opal_return:
40
41
42
43 #ifdef __BIG_ENDIAN__
44 ld r11,STK_PARAM(R12)(r1)
45 mtmsrd r11
46 #else
47
48 .short 0x4039
49 .byte (STK_PARAM(R12) >> 8) & 0xff
50 .byte STK_PARAM(R12) & 0xff
51
52 .long 0x280c6a7d
53 .long 0x05009f42
54 .long 0xa602487d
55 .long 0x14004a39
56 .long 0xa64b5a7d
57 .long 0xa64b7b7d
58 .long 0x2402004c
59 #endif
60 ld r2,PACATOC(r13)
61 ld r0,PPC_LR_STKOFF(r1)
62 mtlr r0
63 blr