| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 | #include "sys.h"#include "sections.h"#include "picorv32.h"#define GP_IS_ZERO 1	// The code in this file is sensitive to alignment, so	// don't use compressed instructions (there are very few anyway)	.option norvc	// NULL pointer guard area	// This needs to be an explicitly allocated section or the binary	// memory initialization file ends up broken.	//	// This also contains a pointer to the ROM area associated	// with this image. For a non-primary image it is patched to	// the preferred value.	.section ".null","a"	.globl _NULL_NULL:	.space 8	.type	_NULL, @object	.size	_NULL, . - _NULL	.globl __dram_checksum__dram_checksum:	.long 0			// Filled in post-link	.type __dram_checksum, @object	.size __dram_checksum, . - __dram_checksum	.globl __rom_offset__rom_offset:	.long ROM_OFFSET	.type	__rom_offset, @object	.size	__rom_offset, . - __rom_offset	// The linker will always assign this to _PC_RESET	.section ".init.reset","ax"	.globl _reset_reset:	.option push	.option norvc	.option norelax	rdtime s0		// Record timer at reset	lui sp,%hi(___stack_top)	addi sp,sp,%lo(___stack_top)	j __start	.option pop	.type _reset, @function	.size _reset, . - _reset	.section ".text.hot","ax"	.globl __start	.balign 4__start:	.option push	.option norvc		// Weird things happen?	.option norelax		// Can't make gp references to set up gp...	not t0,zero	maskirq zero,t0,zero	// Interrupt stack	lui t0,%hi(___irqstack_top)	addqxi sp,t0,%lo(___irqstack_top)	// Global pointer register (not actually used...)#if GP_IS_ZERO	li gp, 0#else	la gp, __global_pointer$#endif	.option pop	addqxi gp,gp,0		// Set gp for interrupt code too	// Unblock fatal exceptions - only	li a0,~6	maskirq zero,a0,zero	// Clear esplink_head.magic as quickly as possible	sw zero,esplink_head,a0	// Clear bss	la a0,__BSS_START__	la a1,__BSS_END__.L_clear_bss_loop:	sw zero,(a0)	sw zero,4(a0)	sw zero,8(a0)	sw zero,12(a0)	sw zero,16(a0)	sw zero,20(a0)	sw zero,24(a0)	sw zero,28(a0)	addi a0,a0,32	bltu a0,a1,.L_clear_bss_loop	sw s0, time_zero, t0	j main	.type __start, @function	.size __start, . - __start	__sbss	.balign 4	.globl time_zerotime_zero:	.space 4	.type time_zero, @object	.size time_zero, . - time_zero	.popsection	// Time stamp definition as patched in by FPGA build	.section ".datestamp","a"	.globl __datestamp__datestamp:	.space 32	.type __datestamp, @object	.size __datestamp, . - __datestamp	// Stack definition	.section ".stack","aw",@nobits	.balign 4	.globl __irqstack_bottom___irqstack:	.space IRQSTACK_SIZE	.type ___irqstack, @object	.size ___irqstack, IRQSTACK_SIZE	.globl ___irqstack_top___irqstack_top:	.balign 4	.globl ___stack___stack:	.space STACK_SIZE	.type ___stack, @object	.size ___stack, STACK_SIZE	.globl ___stack_top___stack_top:
 |