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/offsets.h>
27
.globl __start, _start, start
38
. = _start + GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE
42
. = _start + GRUB_KERNEL_MACHINE_PREFIX
46
/* to be filled by grub-mkimage */
49
* Leave some breathing room for the prefix.
52
. = _start + GRUB_KERNEL_MACHINE_PREFIX_END
53
#ifdef GRUB_MACHINE_MIPS_YEELOONG
54
VARIABLE (grub_arch_busclock)
56
VARIABLE (grub_arch_cpuclock)
58
VARIABLE (grub_arch_memsize)
60
VARIABLE (grub_arch_highmemsize)
67
#ifdef GRUB_MACHINE_MIPS_YEELOONG
68
lui $t1, %hi(grub_arch_busclock)
69
addiu $t1, %lo(grub_arch_busclock)
76
/* Move the modules out of BSS. */
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
109
lui $t1, %hi(__bss_start)
110
addiu $t1, $t1, %lo(__bss_start)
112
addiu $t2, $t2, %lo(_end)
120
lui $t1, %hi(grub_main)
121
addiu $t1, %lo(grub_main)
123
lui $sp, %hi(GRUB_MACHINE_MEMORY_STACK_HIGH)
125
addiu $sp, $sp, %lo(GRUB_MACHINE_MEMORY_STACK_HIGH)