github.com/aykevl/tinygo@v0.5.0/src/device/arm/semihosting.go (about)

     1  package arm
     2  
     3  // Semihosting commands.
     4  // http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjhiea.html
     5  const (
     6  	// Regular semihosting calls
     7  	SemihostingClock      = 0x10
     8  	SemihostingClose      = 0x02
     9  	SemihostingElapsed    = 0x30
    10  	SemihostingErrno      = 0x13
    11  	SemihostingFileLen    = 0x0C
    12  	SemihostingGetCmdline = 0x15
    13  	SemihostingHeapInfo   = 0x16
    14  	SemihostingIsError    = 0x08
    15  	SemihostingIsTTY      = 0x09
    16  	SemihostingOpen       = 0x01
    17  	SemihostingRead       = 0x06
    18  	SemihostingReadByte   = 0x07
    19  	SemihostingRemove     = 0x0E
    20  	SemihostingRename     = 0x0F
    21  	SemihostingSeek       = 0x0A
    22  	SemihostingSystem     = 0x12
    23  	SemihostingTickFreq   = 0x31
    24  	SemihostingTime       = 0x11
    25  	SemihostingTmpName    = 0x0D
    26  	SemihostingWrite      = 0x05
    27  	SemihostingWrite0     = 0x04
    28  	SemihostingWriteByte  = 0x03
    29  
    30  	// Angel semihosting calls
    31  	SemihostingEnterSVC        = 0x17
    32  	SemihostingReportException = 0x18
    33  )
    34  
    35  // Special codes for the Angel Semihosting interface.
    36  const (
    37  	// Hardware vector reason codes
    38  	SemihostingBranchThroughZero = 20000
    39  	SemihostingUndefinedInstr    = 20001
    40  	SemihostingSoftwareInterrupt = 20002
    41  	SemihostingPrefetchAbort     = 20003
    42  	SemihostingDataAbort         = 20004
    43  	SemihostingAddressException  = 20005
    44  	SemihostingIRQ               = 20006
    45  	SemihostingFIQ               = 20007
    46  
    47  	// Software reason codes
    48  	SemihostingBreakPoint          = 20020
    49  	SemihostingWatchPoint          = 20021
    50  	SemihostingStepComplete        = 20022
    51  	SemihostingRunTimeErrorUnknown = 20023
    52  	SemihostingInternalError       = 20024
    53  	SemihostingUserInterruption    = 20025
    54  	SemihostingApplicationExit     = 20026
    55  	SemihostingStackOverflow       = 20027
    56  	SemihostingDivisionByZero      = 20028
    57  	SemihostingOSSpecific          = 20029
    58  )
    59  
    60  // Call a semihosting function.
    61  // TODO: implement it here using inline assembly.
    62  //go:linkname SemihostingCall SemihostingCall
    63  func SemihostingCall(num int, arg uintptr) int