File: start.S

package info (click to toggle)
delo 0.8-2.5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 476 kB
  • ctags: 1,272
  • sloc: ansic: 4,027; makefile: 200; sh: 141; asm: 55
file content (46 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * This file is licensed under the terms of the GNU General Public License,
 * version 2. See the file COPYING in the main directory for details.
 *
 *  Copyright (C) 2003  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
 */

#include "dec_prom.h"

#include <regdef.h>

/*
 * This is the bootloader's execution entry.
 */
	.text
	.globl	__start
	.ent	__start
__start:
	# Set up gp, sp (for PIC code)
	.frame	fp, 32, ra
 	.set noreorder
	bltzal	zero, 1f
	 nop
1:
	.cpload ra
	.set reorder
	la	sp, _stack_start - 32
	sw	ra, 20(sp)
	.cprestore 16
	move	fp, sp

	# Clear .bss before compiler generated code uses it.
	la	t0, _fbss
	la	t1, _end
clearbss:
	sw	zero, (t0)
	addiu	t0, 4
	bne	t0, t1, clearbss

	la	t9, delomain
	jalr	t9

	# If we ever return, jump to the reset vector.
	lw	t9, 0xbfc00000
	jalr	t9
	.end	__start