github.com/usbarmory/tamago@v0.0.0-20240508072735-8612bbe1e454/soc/sifive/fu540/init.go (about)

     1  // SiFive FU540 initialization
     2  // https://github.com/usbarmory/tamago
     3  //
     4  // Copyright (c) WithSecure Corporation
     5  // https://foundry.withsecure.com
     6  //
     7  // Use of this source code is governed by the license
     8  // that can be found in the LICENSE file.
     9  
    10  package fu540
    11  
    12  import (
    13  	_ "unsafe"
    14  )
    15  
    16  //go:linkname ramStackOffset runtime.ramStackOffset
    17  var ramStackOffset uint64 = 0x100
    18  
    19  // Init takes care of the lower level SoC initialization triggered early in
    20  // runtime setup (e.g. runtime.hwinit).
    21  func Init() {
    22  	RV64.Init()
    23  }
    24  
    25  //go:linkname nanotime1 runtime.nanotime1
    26  func nanotime1() int64 {
    27  	return CLINT.Nanotime()
    28  }