mirror of
git://projects.qi-hardware.com/iris.git
synced 2024-11-17 10:30:37 +02:00
50 lines
1.5 KiB
COBOL
50 lines
1.5 KiB
COBOL
#pypp 0
|
|
// Iris: micro-kernel for a capability-based operating system.
|
|
// mips/nanonote/sdram-setup.ccp: bootstrapping over usb.
|
|
// Copyright 2009 Bas Wijnen <wijnen@debian.org>
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
// This runs like the kernel. In particular, it doesn't want userspace declarations.
|
|
#define __KERNEL__
|
|
#define dbg_log(x) do {} while (0)
|
|
#define dbg_log_char(x) do {} while (0)
|
|
#define dbg_log_num(...) do {} while (0)
|
|
#include "jz4740.hh"
|
|
|
|
asm volatile (".set noreorder\n"
|
|
"\t.globl __start\n"
|
|
"\t.text\n"
|
|
"__start:\n"
|
|
"\tla $sp, 0x80004000\n"
|
|
"__hack_label:\n"
|
|
"\tmove $a0, $ra\n"
|
|
"\tbal 1f\n"
|
|
"\tnop\n"
|
|
"\t.word _gp\n"
|
|
"1:\n"
|
|
"\tlw $gp, 0($ra)\n"
|
|
"\tla $t9, start_cpp\n"
|
|
"\tmove $ra, $a0\n"
|
|
"\tjr $t9\n"
|
|
"\tnop\n"
|
|
".set reorder")
|
|
|
|
extern "C":
|
|
void start_cpp ()
|
|
|
|
void start_cpp ():
|
|
setup_sdram ()
|
|
// everything is ok now: return to boot loader to load stage 2.
|