1 /******************************************************************************
2 * Copyright (c) 2004, 2008 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
19 r3: rtas parm structure
23 Decription: Main entry point, called from OS. Second parameter is not
29 mfmsr r11 # Get MSR to enable 64-bit mode
32 ori r11,r11,1 # Always enable 64-bit mode flag
34 mtmsrd r11 # Switch to 64-bit mode
37 mr r9,r1 # save old stack pointer
38 mflr r10 # save link register
39 bcl 20,31,.over # branch to over
42 ..got: .quad _got-.base+0x8000
43 ..stack: .quad .stack+RTAS_STACKSIZE-0x60-.base
45 mflr r8 # gpr 8 is the base
46 ld r1,..stack-.base(r8) # load new stack pointer
47 add r1,r1,r8 # add base
48 std r2,64(r1) # save toc
49 ld r2,..got-.base(r8) # load got pointer
50 std r7,72(r1) # save original msr
51 std r10,80(r1) # save link register
52 std r9,0(r1) # save stack pointer
53 add r2,r2,r8 # add base
57 bl restore_regs_r3_r12
60 ld r11,72(r1) # restore msr value
61 ld r0,80(r1) # restore link register value
62 ld r2,64(r1) # restore toc
63 ld r1,0(r1) # get old stack
64 mtmsrd r11 # restore msr (32 bit ?)
72 .lcomm .stack,RTAS_STACKSIZE