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 *****************************************************************************/
13 #define STACKSIZE 0x100000
17 .section ".toc","aw" # TOC entries are needed for relocation
18 .exception_stack_frame_toc:
19 .tc exception_stack_frame[TC],exception_stack_frame
21 .tc _exit_sp[TC],_exit_sp
23 .tc _prom_entry[TC],_prom_entry
36 Decription: Main entry point, called from OF
40 mr r3, r6 # parm 0 passed in r6
41 mr r4, r7 # parm 1 passed in r7
42 mr r6, r1 # save stack pointer
43 mflr r7 # save link register
44 bcl 20,31,over # branch after pointer table
47 .LCgot: .quad _got-base
48 .LCstack: .quad _stack+STACKSIZE-0x80-base
50 mflr r8 # gpr 8 is the base
51 ld r1,.LCstack-base(r8) # load new stack pointer
52 add r1, r1, r8 # add base
53 std r2, 64(r1) # save got
54 std r7, 56(r1) # save link register
55 ld r2, .LCgot-base(r8) # load got pointer
56 add r2, r2, r8 # add base
57 std r6, 0(r1) # save stack pointer
59 ld r6, .prom_entry_toc@toc(r2)
60 std r5, 0(r6) # Save prom handle
62 ld r10, .exit_sp_toc@toc(r2) # save stack pointer for exit call
65 bl ._start_kernel # call kernel init code
68 ld r4, 56(r1) # Restore link register
70 ld r2, 64(r1) # restore got
76 * Function: _callback_entry
77 * Input: r6 start address of parameter string
78 * r7 length of parameter string.
80 * Description: If a client application wants to register a callback function,
81 * this function is registered w/ SLOF, not the application's function. SLOF
82 * passes the parameter string in Forth representation in R6 and R7. This
83 * function moves R6 to R3 and R7 to R4 and then calls callback_entry().
86 C_ENTRY(_callback_entry)
94 # SLOF passes the parameters in Registers R6 and R7 but the target
95 # wants them in registers R3 and R4
99 # Branch to the callback_entry function
102 # Destroy stack frame
122 ld r1, .exit_sp_toc@toc(r2)
127 .lcomm _stack,STACKSIZE,16