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)
36 /* Copy the modules past the end of the kernel image.
37 * They are currently sitting in the BSS.
39 sethi %hi(__bss_start), %o2
40 or %o2, %lo(__bss_start), %o2
42 or %o3, %lo(_end), %o3
43 sethi %hi(grub_total_module_size), %o4
44 lduw [%o4 + %lo(grub_total_module_size)], %o4
49 /* Save ieee1275 stack for future use by booter. */
51 /* Our future stack. */
52 sethi %hi(GRUB_KERNEL_MACHINE_STACK_SIZE), %o5
53 or %o5, %lo(GRUB_KERNEL_MACHINE_STACK_SIZE), %o5
67 /* Now it's safe to clear out the BSS. */
68 sethi %hi(__bss_start), %o2
69 or %o2, %lo(__bss_start), %o2
71 or %o3, %lo(_end), %o3
77 sethi %hi(grub_ieee1275_original_stack), %o2
78 stx %o1, [%o2 + %lo(grub_ieee1275_original_stack)]
79 sethi %hi(grub_ieee1275_entry_fn), %o2
81 stx %o0, [%o2 + %lo(grub_ieee1275_entry_fn)]