1
/* crt0.S - Startup code for the Sparc64. */
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/>.
19
#include <grub/symbol.h>
20
#include <grub/machine/kernel.h>
21
#include <grub/offsets.h>
30
. = EXT_C(_start) + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE
32
VARIABLE(grub_total_module_size)
34
VARIABLE(grub_kernel_image_size)
36
VARIABLE(grub_compressed_size)
39
/* to be filled by grub-mkimage */
42
* Leave some breathing room for the prefix.
45
. = EXT_C(_start) + GRUB_KERNEL_MACHINE_DATA_END
48
/* Copy the modules past the end of the kernel image.
49
* They are currently sitting in the BSS.
51
sethi %hi(__bss_start), %o2
52
or %o2, %lo(__bss_start), %o2
54
or %o3, %lo(_end), %o3
55
sethi %hi(grub_total_module_size), %o4
56
lduw [%o4 + %lo(grub_total_module_size)], %o4
61
/* Save ieee1275 stack for future use by booter. */
63
/* Our future stack. */
64
sethi %hi(GRUB_KERNEL_MACHINE_STACK_SIZE - 2047), %o5
65
or %o5, %lo(GRUB_KERNEL_MACHINE_STACK_SIZE - 2047), %o5
77
/* Now it's safe to clear out the BSS. */
78
sethi %hi(__bss_start), %o2
79
or %o2, %lo(__bss_start), %o2
81
or %o3, %lo(_end), %o3
87
sethi %hi(grub_ieee1275_original_stack), %o2
88
stx %o1, [%o2 + %lo(grub_ieee1275_original_stack)]
89
sethi %hi(grub_ieee1275_entry_fn), %o2
91
stx %o0, [%o2 + %lo(grub_ieee1275_entry_fn)]