source: mainline/kernel/arch/sparc64/src/start.S@ a5f76758

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since a5f76758 was 94d614e, checked in by Jakub Jermar <jakub@…>, 19 years ago

Remove OpenFirmware calls from kernel/ entirely.

Switch the sparc64 port to use bootinfo.

Copy memcpy from boot/ to sparc64 kernel/ and
adjust it for memcpy_from/to_uspace.

  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[2a99fa8]1#
2# Copyright (C) 2005 Jakub Jermar
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8#
9# - Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# - Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution.
14# - The name of the author may not be used to endorse or promote products
15# derived from this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28
[63cda71]29#include <arch/regdef.h>
[0e4dd7b]30
[437ee6a4]31.register %g2, #scratch
32.register %g3, #scratch
33.register %g6, #scratch
34.register %g7, #scratch
35
[2a99fa8]36.section K_TEXT_START, "ax"
37
[c1e43e4]38/*
[63cda71]39 * Here is where the kernel is passed control
40 * from the boot loader.
[94d614e]41 *
42 * The registers are expected to be in this state:
43 * %o0 bootinfo structure address
44 * %o1 bootinfo structure size
[c1e43e4]45 */
46
[2a99fa8]47.global kernel_image_start
48kernel_image_start:
[0e4dd7b]49 flushw ! flush all but the active register window
50
[94d614e]51 /*
52 * Disable interrupts and disable 32-bit address masking.
53 */
[0ffa3ef5]54 rdpr %pstate, %l0
[94d614e]55 and %l0, ~(PSTATE_AM_BIT|PSTATE_IE_BIT), %l0
[0ffa3ef5]56 wrpr %l0, 0, %pstate
57
[94d614e]58 /*
59 * Copy the bootinfo structure passed from the boot loader
60 * to the kernel bootinfo structure.
61 */
62 mov %o1, %o2
63 mov %o0, %o1
64 set bootinfo, %o0
65 call memcpy
[778c1e1]66 nop
67
[30ab05f]68 wrpr %r0, 0, %pil
69
[437ee6a4]70 call main_bsp
71 nop
72
73 /* Not reached. */
74
[39cb79a]752:
76 b 2b
77 nop
Note: See TracBrowser for help on using the repository browser.