~elementary-os/elementaryos/os-patch-grub2-bionic

« back to all changes in this revision

Viewing changes to grub-core/lib/powerpc/relocator_asm.S

  • Committer: RabbitBot
  • Date: 2018-02-05 13:05:56 UTC
  • Revision ID: rabbitbot@elementary.io-20180205130556-qgaormf12qpm3v40
Initial import, version 2.02-2ubuntu4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  GRUB  --  GRand Unified Bootloader
 
3
 *  Copyright (C) 2009,2010  Free Software Foundation, Inc.
 
4
 *
 
5
 *  GRUB is free software: you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation, either version 3 of the License, or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  GRUB is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
#include <grub/symbol.h>
 
20
        
 
21
        .p2align        4       /* force 16-byte alignment */
 
22
 
 
23
VARIABLE (grub_relocator_forward_start)
 
24
        mr 3, 9
 
25
        mr 4, 10
 
26
 
 
27
copycont1:      
 
28
        lbz 11,0(8)
 
29
        stb 11,0(9)
 
30
        addi 8, 8, 0x1
 
31
        addi 9, 9, 0x1
 
32
        addi 10, 10, -1
 
33
        cmpwi 10, 0
 
34
        bne copycont1
 
35
 
 
36
#include "../../kern/powerpc/cache_flush.S"
 
37
 
 
38
VARIABLE (grub_relocator_forward_end)
 
39
 
 
40
VARIABLE (grub_relocator_backward_start)
 
41
        mr 3, 9
 
42
        mr 4, 10
 
43
 
 
44
        add 9, 9, 10
 
45
        add 8, 8, 10
 
46
        /* Backward movsl is implicitly off-by-one.  compensate that.  */
 
47
        addi 9, 9, -1
 
48
        addi 8, 8, -1
 
49
copycont2:      
 
50
        lbz 11,0(8)
 
51
        stb 11,0(9)
 
52
        addi 8, 8, -1
 
53
        addi 9, 9, -1
 
54
        addi 10, 10, -1
 
55
        cmpwi 10, 0
 
56
        bne copycont2
 
57
 
 
58
#include "../../kern/powerpc/cache_flush.S"
 
59
 
 
60
VARIABLE (grub_relocator_backward_end)