OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [common/] [crt0.S] - Diff between revs 52 and 53

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 52 Rev 53
Line 1... Line 1...
/* ################################################################################################# */
/* ################################################################################################# */
/* # << NEORV32 - crt0.S - Start-Up Code >>                                                        # */
/* # << NEORV32 - crt0.S - Start-Up Code >>                                                        # */
/* # ********************************************************************************************* # */
/* # ********************************************************************************************* # */
/* # BSD 3-Clause License                                                                          # */
/* # BSD 3-Clause License                                                                          # */
/* #                                                                                               # */
/* #                                                                                               # */
/* # Copyright (c) 2020, Stephan Nolting. All rights reserved.                                     # */
/* # Copyright (c) 2021, Stephan Nolting. All rights reserved.                                     # */
/* #                                                                                               # */
/* #                                                                                               # */
/* # Redistribution and use in source and binary forms, with or without modification, are          # */
/* # Redistribution and use in source and binary forms, with or without modification, are          # */
/* # permitted provided that the following conditions are met:                                     # */
/* # permitted provided that the following conditions are met:                                     # */
/* #                                                                                               # */
/* #                                                                                               # */
/* # 1. Redistributions of source code must retain the above copyright notice, this list of        # */
/* # 1. Redistributions of source code must retain the above copyright notice, this list of        # */
Line 101... 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 287... Line 245...
  addi  x8, x8, +2  // add another 2 (making +4) for uncompressed instructions
  addi  x8, x8, +2  // add another 2 (making +4) for uncompressed instructions
  csrw  mepc, x8
  csrw  mepc, x8
 
 
__crt0_dummy_trap_handler_irq:
__crt0_dummy_trap_handler_irq:
 
 
  lw    x9, 0(sp)
  lw    x8, 0(sp)
  lw    x8, 4(sp)
  lw    x9, 4(sp)
  addi  sp, sp, +8
  addi  sp, sp, +8
 
 
  mret
  mret
 
 
.cfi_endproc
.cfi_endproc

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.