File indexing completed on 2025-05-11 08:22:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef _BSPS_ARM_FVP_SEMIHOSTING_H
0037 #define _BSPS_ARM_FVP_SEMIHOSTING_H
0038
0039 #include <stdint.h>
0040
0041 #ifdef __cplusplus
0042 extern "C" {
0043 #endif
0044
0045
0046
0047
0048
0049
0050
0051 #define SYS_CLOCK 0x10
0052 #define SYS_CLOSE 0x02
0053 #define SYS_ELAPSED 0x30
0054 #define SYS_ERRNO 0x13
0055 #define SYS_EXIT 0x18
0056 #define SYS_EXIT_EXTENDED 0x20
0057 #define SYS_FLEN 0x0c
0058 #define SYS_GET_CMDLINE 0x15
0059 #define SYS_HEAPINFO 0x16
0060 #define SYS_ISERROR 0x08
0061 #define SYS_ISTTY 0x09
0062 #define SYS_OPEN 0x01
0063 #define SYS_READ 0x06
0064 #define SYS_READC 0x07
0065 #define SYS_REMOVE 0x0e
0066 #define SYS_RENAME 0x0f
0067 #define SYS_SEEK 0x0a
0068 #define SYS_SYSTEM 0x12
0069 #define SYS_TICKFREQ 0x31
0070 #define SYS_TIME 0x11
0071 #define SYS_TMPNAM 0x0d
0072 #define SYS_WRITE 0x05
0073 #define SYS_WRITEC 0x03
0074 #define SYS_WRITE0 0x04
0075
0076 #define ADP_Stopped_BranchThroughZero 0x20000
0077 #define ADP_Stopped_UndefinedInstr 0x20001
0078 #define ADP_Stopped_SoftwareInterrupt 0x20002
0079 #define ADP_Stopped_PrefetchAbort 0x20003
0080 #define ADP_Stopped_DataAbort 0x20004
0081 #define ADP_Stopped_AddressException 0x20005
0082 #define ADP_Stopped_IRQ 0x20006
0083 #define ADP_Stopped_FIQ 0x20007
0084 #define ADP_Stopped_BreakPoint 0x20020
0085 #define ADP_Stopped_WatchPoint 0x20021
0086 #define ADP_Stopped_StepComplete 0x20022
0087 #define ADP_Stopped_RunTimeErrorUnknown 0x20023
0088 #define ADP_Stopped_InternalError 0x20024
0089 #define ADP_Stopped_UserInterruption 0x20025
0090 #define ADP_Stopped_ApplicationExit 0x20026
0091 #define ADP_Stopped_StackOverflow 0x20027
0092 #define ADP_Stopped_DivisionByZero 0x20028
0093 #define ADP_Stopped_OSSpecific 0x20029
0094
0095 static inline uintptr_t arm_fvp_semihosting_call(
0096 uintptr_t op,
0097 uintptr_t params
0098 )
0099 {
0100 register uintptr_t op_and_return_reg __asm__("r0");
0101 register uintptr_t params_reg __asm__("r1");
0102
0103 op_and_return_reg = op;
0104 params_reg = params;
0105
0106 __asm__ volatile (
0107 #ifdef __thumb__
0108 "svc #0xab"
0109 #else
0110 "svc #0x123456"
0111 #endif
0112 : "=r" (op_and_return_reg)
0113 : "0" (op_and_return_reg), "r" (params_reg)
0114 : "memory"
0115 );
0116
0117 return op_and_return_reg;
0118 }
0119
0120 void arm_fvp_console_output( char c );
0121
0122 int arm_fvp_console_input( void );
0123
0124
0125
0126 #ifdef __cplusplus
0127 }
0128 #endif
0129
0130 #endif