]> git.proxmox.com Git - grub2.git/blob - grub-core/lib/mips/relocator_asm.S
Import grub2_2.02+dfsg1.orig.tar.xz
[grub2.git] / grub-core / lib / mips / relocator_asm.S
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2009 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 .set noreorder
24 .set nomacro
25
26 VARIABLE (grub_relocator_forward_start)
27 move $a0, $9
28 move $a1, $10
29
30 copycont1:
31 lb $11,0($8)
32 sb $11,0($9)
33 addiu $8, $8, 1
34 addiu $10, $10, -1
35 bne $10, $0, copycont1
36 addiu $9, $9, 1
37
38 #include "../../kern/mips/cache_flush.S"
39
40 VARIABLE (grub_relocator_forward_end)
41
42 VARIABLE (grub_relocator_backward_start)
43 move $a0, $9
44 move $a1, $10
45
46 addu $9, $9, $10
47 addu $8, $8, $10
48 /* Backward movsl is implicitly off-by-one. compensate that. */
49 addiu $9, $9, -1
50 addiu $8, $8, -1
51 copycont2:
52 lb $11,0($8)
53 sb $11,0($9)
54 addiu $8, $8, -1
55 addiu $10, $10, -1
56 bne $10, $0, copycont2
57 addiu $9, $9, -1
58
59 #include "../../kern/mips/cache_flush.S"
60
61 VARIABLE (grub_relocator_backward_end)