source: trunk/packages/xen-3.1/xen-3.1/xen/arch/powerpc/start.S @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.9 KB
Line 
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 *
16 * Copyright (C) 2005, 2006 IBM Corp.
17 *
18 * Authors: Jimi Xenidis <jimix@watson.ibm.com>
19 *          Hollis Blanchard <hollisb@us.ibm.com>
20 *
21 */
22
23#include <asm/config.h>
24#include <asm/msr.h>
25#include <asm/processor.h>
26#include <asm/page.h>
27
28    .globl _start
29_start:
30    /* pass the original MSR along */
31    mfmsr r8
32
33    /* set initial MSR */
34    li r22, 0
35    ori r22, r22, (MSR_SF | MSR_HV) >> 48
36    sldi r22, r22, 48
37    mtmsrd r22
38
39_start64:
40    /* load up the stack */
41    SET_REG_TO_LABEL(r1, cpu0_stack)
42
43    /* call the init function */
44    LOADADDR(r21,__start_xen_ppc)
45    ld r2, 8(r21)
46    ld r21, 0(r21)
47    mtctr r21
48    bctrl
49    /* should never return */
50    trap
51
52    /* Note! GDB 6.3 makes the very stupid assumption that PC > SP means we are
53     * in a Linux signal trampoline, and it begins groping for a struct
54     * rt_sigframe on the stack. Naturally, this fails miserably for our
55     * backtrace. To work around this behavior, we must make certain that our
56     * stack is always above our text, e.g. in the data section. */
57    .data /* DO NOT REMOVE; see GDB note above */
58    .align 4
59cpu0_stack_bottom:
60    .space STACK_SIZE
61cpu0_stack:
62    .space STACK_FRAME_OVERHEAD
Note: See TracBrowser for help on using the repository browser.