~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

Viewing changes to grub-core/kern/powerpc/ieee1275/startup.S

Tags: upstream-1.99~20101122
ImportĀ upstreamĀ versionĀ 1.99~20101122

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
.extern __bss_start
 
24
.extern _end
 
25
 
 
26
        .text
 
27
        .align  2
 
28
        .globl  start, _start
 
29
start:
 
30
_start:
 
31
        b       codestart
 
32
 
 
33
        . = _start + GRUB_KERNEL_MACHINE_PREFIX
 
34
 
 
35
VARIABLE(grub_prefix)
 
36
        /* to be filled by grub-mkimage */
 
37
 
 
38
        /*
 
39
         *  Leave some breathing room for the prefix.
 
40
         */
 
41
 
 
42
        . = _start + GRUB_KERNEL_MACHINE_PREFIX_END
 
43
 
 
44
codestart:
 
45
        li      2, 0
 
46
        li      13, 0
 
47
 
 
48
        /* Stage1 won't zero BSS for us. In other cases, why not do it again?  */
 
49
        lis     6, (__bss_start - 4)@h
 
50
        ori     6, 6, (__bss_start - 4)@l
 
51
        lis     7, (_end - 4)@h
 
52
        ori     7, 7, (_end - 4)@l
 
53
        subf    7, 6, 7
 
54
        srwi    7, 7, 2 /* We store 4 bytes at a time.  */
 
55
        mtctr   7
 
56
2:      stwu    2, 4(6) /* We know r2 is already 0 from above.  */
 
57
        bdnz    2b
 
58
 
 
59
        /* Store r5 in grub_ieee1275_entry_fn.  */
 
60
        lis     9, grub_ieee1275_entry_fn@ha
 
61
        stw     5, grub_ieee1275_entry_fn@l(9)
 
62
 
 
63
        bl      grub_main
 
64
1:      b       1b