source: grub-pc/trunk/fuentes/grub-core/kern/powerpc/ieee1275/startup.S @ 22

Last change on this file since 22 was 22, checked in by mabarracus, 4 years ago

updated version and apply net.ifnames=0 into debian/rules

File size: 1.9 KB
Line 
1/* startup.S - Startup code for the PowerPC.  */
2/*
3 *  GRUB  --  GRand Unified Bootloader
4 *  Copyright (C) 2003,2004,2005,2007,2008  Free Software Foundation, Inc.
5 *
6 *  GRUB is free software: you can redistribute it and/or modify
7 *  it under the terms of the GNU General Public License as published by
8 *  the Free Software Foundation, either version 3 of the License, or
9 *  (at your option) any later version.
10 *
11 *  GRUB is distributed in the hope that it will be useful,
12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *  GNU General Public License for more details.
15 *
16 *  You should have received a copy of the GNU General Public License
17 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <grub/symbol.h>
21#include <grub/offsets.h>
22
23#define MSR_VSX 0x80
24
25.extern __bss_start
26.extern _end
27
28        .text
29        .align  2
30        .globl  start, _start
31start:
32_start:
33 _start:
34
35    /* Disable VSX instruction */
36        mfmsr  0
37        oris   0,0,MSR_VSX
38        /* The "VSX Available" bit is in the lower half of the MSR, so we
39           don't need mtmsrd, which in any case won't work in 32-bit mode.  */
40        mtmsr  0
41        isync
42
43        li      2, 0
44        li      13, 0
45
46        /* Stage1 won't zero BSS for us. In other cases, why not do it again?  */
47        lis     6, (__bss_start - 4)@h
48        ori     6, 6, (__bss_start - 4)@l
49
502:      stb     2, 4(6)
51        addi    6, 6, 1
52        andi.   7, 6, 3
53        cmpi    0, 1, 7, 0
54        bne     2b
55       
56        lis     7, (_end - 4)@h
57        ori     7, 7, (_end - 4)@l
58        subf    7, 6, 7
59        subi    8, 7, 1
60        andi.   8, 8, 3
61        addi    8, 8, 1
62        sub     7, 7, 8
63
64        srwi    7, 7, 2 /* We store 4 bytes at a time.  */
65        mtctr   7
662:      stwu    2, 4(6) /* We know r2 is already 0 from above.  */
67        bdnz    2b
68
69        mtctr   8
702:      stb     2, 4(6) /* We know r2 is already 0 from above.  */
71        addi    6, 6, 1
72        bdnz    2b
73
74        /* Store r5 in grub_ieee1275_entry_fn.  */
75        lis     9, grub_ieee1275_entry_fn@ha
76        stw     5, grub_ieee1275_entry_fn@l(9)
77
78        bl      grub_main
791:      b       1b
Note: See TracBrowser for help on using the repository browser.