1 /* startup.S - Startup code for the MIPS. */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2009 Free Software Foundation, Inc.
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.
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.
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/>.
20 #include <grub/symbol.h>
21 #include <grub/offsets.h>
22 #include <grub/machine/memory.h>
23 #include <grub/machine/kernel.h>
24 #include <grub/offsets.h>
28 .globl __start, _start, start
39 . = _start + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE
40 VARIABLE(grub_total_modules_size)
43 VARIABLE (grub_arch_busclock)
45 VARIABLE (grub_arch_cpuclock)
47 VARIABLE (grub_arch_memsize)
49 VARIABLE (grub_arch_highmemsize)
51 #ifdef GRUB_MACHINE_MIPS_LOONGSON
52 VARIABLE (grub_arch_machine)
53 .long GRUB_ARCH_MACHINE_FULOONG2F
59 #ifdef GRUB_MACHINE_MIPS_QEMU_MIPS
60 lui $t1, %hi(grub_arch_busclock)
61 addiu $t1, %lo(grub_arch_busclock)
65 #ifdef GRUB_MACHINE_MIPS_LOONGSON
66 lui $t1, %hi(grub_arch_busclock)
67 addiu $t1, %lo(grub_arch_busclock)
75 /* Move the modules out of BSS. */
76 #ifndef GRUB_MACHINE_ARC
77 lui $t2, %hi(__bss_start)
78 addiu $t2, %lo(__bss_start)
82 addiu $t1, (GRUB_KERNEL_MACHINE_MOD_ALIGN - 1)
83 li $t3, (GRUB_KERNEL_MACHINE_MOD_ALIGN - 1)
87 lw $t3, (GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE - BASE_ADDR)($s0)
95 /* $t2 is source. $t1 is destination. $t3 is size. */
97 beq $t3, $0, modulesmovdone
110 lui $t1, %hi(__bss_start)
111 addiu $t1, $t1, %lo(__bss_start)
113 addiu $t2, $t2, %lo(_end)
121 lui $t1, %hi(grub_main)
122 addiu $t1, %lo(grub_main)
124 lui $sp, %hi(GRUB_MACHINE_MEMORY_STACK_HIGH)
126 addiu $sp, $sp, %lo(GRUB_MACHINE_MEMORY_STACK_HIGH)