Line 45... |
Line 45... |
_start:
|
_start:
|
.cfi_startproc
|
.cfi_startproc
|
.cfi_undefined ra
|
.cfi_undefined ra
|
|
|
// *********************************************************
|
// *********************************************************
|
// Clear register file (lower half, assume E extension)
|
// Clear integer register file (lower half, assume E extension)
|
// *********************************************************
|
// *********************************************************
|
__crt0_reg_file_clear:
|
__crt0_reg_file_clear:
|
//addi x0, x0, 0 // hardwired to zero
|
//addi x0, x0, 0 // hardwired to zero
|
addi x1, x0, 0
|
addi x1, x0, 0
|
addi x2, x0, 0
|
addi x2, x0, 0
|
Line 67... |
Line 67... |
addi x14, x0, 0
|
addi x14, x0, 0
|
addi x15, x0, 0
|
addi x15, x0, 0
|
|
|
|
|
// *********************************************************
|
// *********************************************************
|
// Clear register file (upper half, if no E extension)
|
// Initialize dummy trap handler base address
|
|
// *********************************************************
|
|
__crt0_neorv32_trap_init:
|
|
la x11, __crt0_dummy_trap_handler
|
|
csrw mtvec, x11 // set address of first-level exception handler
|
|
|
|
|
|
// *********************************************************
|
|
// Clear integer register file (upper half, if no E extension)
|
// *********************************************************
|
// *********************************************************
|
#ifndef __riscv_32e
|
#ifndef __riscv_32e
|
// save some program space if compiling bootloader
|
// DO NOT DO THIS if compiling bootloader (to save some program space)
|
#ifndef make_bootloader
|
#ifndef make_bootloader
|
addi x16, x0, 0
|
addi x16, x0, 0
|
addi x17, x0, 0
|
addi x17, x0, 0
|
addi x18, x0, 0
|
addi x18, x0, 0
|
addi x19, x0, 0
|
addi x19, x0, 0
|
Line 93... |
Line 101... |
#endif
|
#endif
|
#endif
|
#endif
|
|
|
|
|
// *********************************************************
|
// *********************************************************
|
|
// Clear floating-point register file (if F extension enabled)
|
|
// *********************************************************
|
|
#ifdef __riscv_flen
|
|
// DO NOT DO THIS if compiling bootloader (to save some program space)
|
|
#ifndef make_bootloader
|
|
fmv.s.x f0, x0
|
|
fmv.s.x f1, x0
|
|
fmv.s.x f2, x0
|
|
fmv.s.x f3, x0
|
|
fmv.s.x f4, x0
|
|
fmv.s.x f5, x0
|
|
fmv.s.x f6, x0
|
|
fmv.s.x f7, x0
|
|
fmv.s.x f8, x0
|
|
fmv.s.x f9, x0
|
|
fmv.s.x f10, x0
|
|
fmv.s.x f11, x0
|
|
fmv.s.x f12, x0
|
|
fmv.s.x f13, x0
|
|
fmv.s.x f14, x0
|
|
fmv.s.x f15, x0
|
|
fmv.s.x f16, x0
|
|
fmv.s.x f17, x0
|
|
fmv.s.x f18, x0
|
|
fmv.s.x f19, x0
|
|
fmv.s.x f20, x0
|
|
fmv.s.x f21, x0
|
|
fmv.s.x f22, x0
|
|
fmv.s.x f23, x0
|
|
fmv.s.x f24, x0
|
|
fmv.s.x f25, x0
|
|
fmv.s.x f26, x0
|
|
fmv.s.x f27, x0
|
|
fmv.s.x f28, x0
|
|
fmv.s.x f29, x0
|
|
fmv.s.x f30, x0
|
|
fmv.s.x f31, x0
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// *********************************************************
|
// No interrupts, thanks
|
// No interrupts, thanks
|
// *********************************************************
|
// *********************************************************
|
__crt0_status_init:
|
__crt0_status_init:
|
li x10, 0x00001800 // clear mstatus and set mpp(1:0)
|
li x10, 0x00001800 // clear mstatus and set mpp(1:0)
|
csrrw zero, mstatus, x10
|
csrrw zero, mstatus, x10
|
Line 115... |
Line 165... |
la gp, __global_pointer$ // global pointer
|
la gp, __global_pointer$ // global pointer
|
.option pop
|
.option pop
|
|
|
|
|
// *********************************************************
|
// *********************************************************
|
// Initialize dummy trap handler base address
|
|
// *********************************************************
|
|
__crt0_neorv32_trap_init:
|
|
la x11, __crt0_dummy_trap_handler
|
|
csrw mtvec, x11 // set address of first-level exception handler
|
|
|
|
|
|
// *********************************************************
|
|
// Reset/deactivate IO/peripheral devices
|
// Reset/deactivate IO/peripheral devices
|
// Devices, that are not implemented, will cause a store access fault
|
// Devices, that are not implemented, will cause a store access fault
|
// which is captured but actually ignored due to the dummy handler.
|
// which is captured but actually ignored due to the dummy handler.
|
// *********************************************************
|
// *********************************************************
|
__crt0_reset_io:
|
__crt0_reset_io:
|