5 BREAK #SWID definition:
6 0x00 – 0x1F: Free to use
7 0x20 – 0x1FF: Reserved for EX9
8 0x0200 – 0x7EFF: Free to use
9 0x7F00 – 0x7FFF: Reserved for virtual hosting
11 /* These are #SWID defined for Virtual Hosting. */
12 #define VH_FOPEN 0x7F00
13 #define VH_FREOPEN 0x7F01
14 #define VH_FCLOSE 0x7F02
15 #define VH_FFLUSH 0x7F03
16 #define VH_FREAD 0x7F04
17 #define VH_FWRITE 0x7F05
18 #define VH_FGETC 0x7F06
19 #define VH_FGETS 0x7F07
20 #define VH_FPUTC 0x7F08
21 #define VH_FPUTS 0x7F09
22 #define VH_UNGETC 0x7F0A
23 #define VH_FTELL 0x7F0B
24 #define VH_FSEEK 0x7F0C
25 #define VH_REWIND 0x7F0D
26 #define VH_CLEARERR 0x7F0E
27 #define VH_FEOF 0x7F0F
28 #define VH_FERROR 0x7F10
29 #define VH_REMOVE 0x7F11
30 #define VH_TMPFILE 0x7F12
31 /* From here, define Low-level routines. */
32 #define VH_EXIT 0x7F20
33 #define VH_OPEN 0x7F21
34 #define VH_CLOSE 0x7F22
35 #define VH_READ 0x7F23
36 #define VH_WRITE 0x7F24
37 #define VH_LSEEK 0x7F25
38 #define VH_UNLINK 0x7F26
39 #define VH_RENAME 0x7F27
40 #define VH_FSTAT 0x7F28
41 #define VH_STAT 0x7F29
42 #define VH_GETTIMEOFDAY 0x7F2A
43 #define VH_ISATTY 0x7F2B
44 #define VH_SYSTEM 0x7F2C
45 #define VH_GETERR 0x7F2D /* The method we get errno. */
46 #define VH_GETPID 0x7F2E
47 #define VH_KILL 0x7F2F
48 #define VH_TIMES 0x7F30
51 /* Define macros that generate assembly output.
52 Generate a System Call exception to notify GDB
53 to handle this virtual I/O routine. */
56 /* If r0 is not NULL(0), set errno. */
59 .type
\name
, @function
62 BREAK
\num
/* Generate_Exception(Breakpoint); */
63 bnez $r0
, 1f
/* Branch if success.
64 r0 value is not NULL(0). */
67 swi $r0
, [$r15
] /* Set errno. */
68 move $r0
, 0 /* Set return value as 0. */
75 /* If r0 is EOF(-1), set errno. */
78 .type
\name
, @function
81 BREAK
\num
/* Generate_Exception(Breakpoint); */
83 bnezs8
1f
/* Branch if success.
84 r0 value is EOF(-1). */
87 swi $r0
, [$r15
] /* Set errno. */
88 move $r0
, -1 /* Set return value as -1. */
95 /* If r0 is less than r2, set errno. */
98 .type
\name
, @function
101 BREAK
\num
/* Generate_Exception(Breakpoint); */
102 slt $r15
, $r0
, $r2
/* If r15 is set, set errno. */
103 beqzs8
1f
/* Branch if success.
105 move $r4
, $r0
/* Keep return value r0. */
107 l
.w $r15
, _impure_ptr
108 swi $r0
, [$r15
] /* Set errno. */
109 move $r0
, $r4
/* Restore r0. */
115 .macro TYPE3 name num
116 /* No errors are defined. */
119 .type
\name
, @function
122 BREAK
\num
/* Generate_Exception(Breakpoint); */