Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / SLOF / slof / lowmem.S
1 /******************************************************************************
2  * Copyright (c) 2004, 2008 IBM Corporation
3  * All rights reserved.
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
8  *
9  * Contributors:
10  *     IBM Corporation - initial implementation
11  *****************************************************************************/
12
13 #include <cpu.h>
14 #include <xvect.h>
15
16         .globl _start
17         /* All exception vectors *******************/
18 _start:
19         .org 0x100
20         /* check if Master / Slave *****************/
21         /* Master will go to XVECT_M_HANDLER       */
22         /* Slave  will go to XVECT_S_HANDLER       */
23 #ifdef SECONDARY_CPUS_STOPPED
24         ld      r3,XVECT_S_HANDLER(0)
25         mfspr   r0, PIR
26         cmpwi   r0, 0
27         bne     0f
28 #endif
29         ld      r3,XVECT_M_HANDLER(0)
30 0:
31         mtctr   r3
32         li      r0,0x100
33         bctr
34
35         /* FIXME: Also need 0280, 0380, 0f20, etc. */
36
37         .irp i, 0x0200,0x0280,0x0300,0x0380,0x0400,0x0480,0x0500,0x0600,0x0700, \
38                 0x0800,0x0900,0x0a00,0x0b00,0x0c00,0x0d00,0x0e00,0x0f00, \
39                 0x1000,0x1100,0x1200,0x1300,0x1400,0x1500,0x1600,0x1700, \
40                 0x1800,0x1900,0x1a00,0x1b00,0x1c00,0x1d00,0x1e00,0x1f00, \
41                 0x2000,0x2100,0x2200,0x2300,0x2400,0x2500,0x2600,0x2700, \
42                 0x2800,0x2900,0x2a00,0x2b00,0x2c00,0x2d00,0x2e00,0x2f00
43         .org \i
44
45         /* enable this if you get exceptions before the console works    */
46         /* this will allow using the hardware debugger to see where      */
47         /* it traps, and with what register values etc.                  */
48         // b    $
49
50         mtsprg  0,r0
51         mfctr   r0
52         mtsprg  2,r0
53         mflr    r0
54         mtsprg  3,r0
55         ld      r0, XVECT_M_HANDLER(0)
56         mtctr   r0
57         li      r0,\i
58         bctr
59         .endr
60
61
62         .org XVECT_M_HANDLER
63         .quad 0
64
65         .org XVECT_S_HANDLER
66         .quad 0
67
68         .org XVECT_TOPADDR
69         .byte 0x36              # to fill out to exactly 16kB