1 /* $NetBSD: srt0.s,v 1.1.30.3 2004/09/21 13:21:07 skrll Exp $ */
4 * Copyright (C) 1996-1999 Cort Dougan (cort@fsmlasb.com).
5 * Copyright (C) 1996-1999 Gary Thomas (gdt@osf.org).
6 * Copyright (C) 1996-1999 Paul Mackeras (paulus@linuxcare.com).
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by TooLs GmbH.
20 * 4. The name of TooLs GmbH may not be used to endorse or promote products
21 * derived from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 #define HID0_DCI (1<<10)
38 #define HID0_ICFI (1<<11)
39 #define HID0_DCE (1<<14)
40 #define HID0_ICE (1<<15)
48 mr 11,3 /* Save pointer to residual/board data */
49 li 3,MSR_IP
/* Establish default MSR value */
56 lis 4,~
(HID0_ICE|HID0_DCE
)@h
57 ori 4,4,~
(HID0_ICE|HID0_DCE
)@
l
63 * check if we need to relocate ourselves to the link addr or were we
64 * loaded there to begin with -- Cort
69 subi 3,3,4 /* we get the nip, not the ip of the branch */
76 * no matter where we're loaded, move ourselves to -Ttext address
83 addi 5,5,3 /* Round up - just in case */
84 sub 5,5,4 /* Compute # longwords to move */
87 subi 3,3,4 /* Set up for loop */
95 mtlr 3 /* Easiest way to do an absolute jump */
98 mr 9,1 /* Save old stack pointer */
104 mr 3,11 /* arg1: residual/board data */
105 mr 4,8 /* arg2: loadaddr */
112 * run(startsym, endsym, args, bootinfo, entry)
116 mtctr 7 /* Entry point */
120 * Flush instruction cache
128 ori 4,4,HID0_ICE|HID0_ICFI