File: crt0.S

package info (click to toggle)
yaboot 1.3.6-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,192 kB
  • ctags: 2,696
  • sloc: ansic: 9,436; sh: 2,578; asm: 343; makefile: 231
file content (32 lines) | stat: -rw-r--r-- 560 bytes parent folder | download | duplicates (5)
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
#include "asm/ppc_asm.tmpl"
#include "asm/processor.h"

/*
 * Main entry point. should add code to clear BSS and more ...
 */
_GLOBAL(_start)
	lis	r10,edata@h
	ori	r10,r10,edata@l
	lis	r11,end@h
	ori	r11,r11,end@l
	subi	r10,r10,4
	subi	r11,r11,4
	li	r0, 0
1:	stwu	r0,4(r10)
	cmp	0,r10,r11
	bne	1b
	b	yaboot_start

/*
 * Returns (address we're running at) - (address we were linked at)
 * for use before the text and data are mapped to KERNELBASE.
 */
_GLOBAL(reloc_offset)
	mflr	r0
	bl	1f
1:	mflr	r3
	lis	r4,1b@ha
	addi	r4,r4,1b@l
	subf	r3,r4,r3
	mtlr	r0
	blr