Line 40... |
Line 40... |
|
|
_start:
|
_start:
|
.cfi_startproc
|
.cfi_startproc
|
.cfi_undefined ra
|
.cfi_undefined ra
|
|
|
|
nop
|
|
|
// *********************************************************
|
// *********************************************************
|
// Clear integer 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
|
Line 208... |
Line 210... |
// *********************************************************
|
// *********************************************************
|
// Go to endless sleep mode if main returns
|
// Go to endless sleep mode if main returns
|
// *********************************************************
|
// *********************************************************
|
__crt0_this_is_the_end:
|
__crt0_this_is_the_end:
|
csrrci zero, mstatus, 8 // mstatus: disable global IRQs (MIE)
|
csrrci zero, mstatus, 8 // mstatus: disable global IRQs (MIE)
|
nop
|
|
wfi
|
|
__crt0_this_is_the_end_my_friend:
|
__crt0_this_is_the_end_my_friend:
|
j __crt0_this_is_the_end_my_friend // in case WFI is not available
|
wfi
|
|
j __crt0_this_is_the_end_my_friend
|
|
|
|
|
// *********************************************************
|
// *********************************************************
|
// dummy trap handler (for exceptions & IRQs)
|
// dummy trap handler (for exceptions & IRQs)
|
// tries to move on to next instruction
|
// tries to move on to next instruction
|