source: rtems/c/src/lib/libbsp/arm/gdbarmsim/include/swi.h @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*
2 *  Copied from libgloss 1 Oct 2009.
3 *  Minor modifications to work with RTEMS.
4 */
5
6/* SWI numbers for RDP (Demon) monitor.  */
7#define SWI_WriteC                 0x0
8#define SWI_Write0                 0x2
9#define SWI_ReadC                  0x4
10#define SWI_CLI                    0x5
11#define SWI_GetEnv                 0x10
12#define SWI_Exit                   0x11
13#define SWI_EnterOS                0x16
14
15#define SWI_GetErrno               0x60
16#define SWI_Clock                  0x61
17#define SWI_Time                   0x63
18#define SWI_Remove                 0x64
19#define SWI_Rename                 0x65
20#define SWI_Open                   0x66
21
22#define SWI_Close                  0x68
23#define SWI_Write                  0x69
24#define SWI_Read                   0x6a
25#define SWI_Seek                   0x6b
26#define SWI_Flen                   0x6c
27
28#define SWI_IsTTY                  0x6e
29#define SWI_TmpNam                 0x6f
30#define SWI_InstallHandler         0x70
31#define SWI_GenerateError          0x71
32
33
34/* Now the SWI numbers and reason codes for RDI (Angel) monitors.  */
35#define AngelSWI_ARM                    0x123456
36#ifdef __thumb__
37#define AngelSWI                        0xAB
38#else
39#define AngelSWI                        AngelSWI_ARM
40#endif
41/* For Thumb-2 code use the BKPT instruction instead of SWI.  */
42#ifdef __thumb2__
43#define AngelSWIInsn                    "bkpt"
44#define AngelSWIAsm                     bkpt
45#else
46#define AngelSWIInsn                    "swi"
47#define AngelSWIAsm                     swi
48#endif
49
50/* The reason codes:  */
51#define AngelSWI_Reason_Open            0x01
52#define AngelSWI_Reason_Close           0x02
53#define AngelSWI_Reason_WriteC          0x03
54#define AngelSWI_Reason_Write0          0x04
55#define AngelSWI_Reason_Write           0x05
56#define AngelSWI_Reason_Read            0x06
57#define AngelSWI_Reason_ReadC           0x07
58#define AngelSWI_Reason_IsTTY           0x09
59#define AngelSWI_Reason_Seek            0x0A
60#define AngelSWI_Reason_FLen            0x0C
61#define AngelSWI_Reason_TmpNam          0x0D
62#define AngelSWI_Reason_Remove          0x0E
63#define AngelSWI_Reason_Rename          0x0F
64#define AngelSWI_Reason_Clock           0x10
65#define AngelSWI_Reason_Time            0x11
66#define AngelSWI_Reason_System          0x12
67#define AngelSWI_Reason_Errno           0x13
68#define AngelSWI_Reason_GetCmdLine      0x15
69#define AngelSWI_Reason_HeapInfo        0x16
70#define AngelSWI_Reason_EnterSVC        0x17
71#define AngelSWI_Reason_ReportException 0x18
72#define ADP_Stopped_ApplicationExit     ((2 << 16) + 38)
73#define ADP_Stopped_RunTimeError        ((2 << 16) + 35)
74
75#if defined(ARM_RDI_MONITOR) && !defined(__ASSEMBLER__)
76
77static inline int
78do_AngelSWI (int reason, void * arg)
79{
80  int value;
81  __asm__ volatile ("mov r0, %1; mov r1, %2; " AngelSWIInsn " %a3; mov %0, r0"
82       : "=r" (value) /* Outputs */
83       : "r" (reason), "r" (arg), "i" (AngelSWI) /* Inputs */
84       : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc"
85                /* Clobbers r0 and r1, and lr if in supervisor mode */);
86                /* Accordingly to page 13-77 of ARM DUI 0040D other registers
87                   can also be clobbered.  Some memory positions may also be
88                   changed by a system call, so they should not be kept in
89                   registers. Note: we are assuming the manual is right and
90                   Angel is respecting the APCS.  */
91  return value;
92}
93
94#endif
Note: See TracBrowser for help on using the repository browser.