1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32
33 34 35 36
37
38 /*!
39 * ======== SysSemihost ========
40 * Implementation of `{@link xdc.runtime.ISystemSupport}` using
41 * ANSI C Standard Library
42 *
43 * This implementation provides a fully functional implementation of
44 * all methods specified by `ISystemSupport`. As with all
45 * `ISystemSupport` modules, this module is the back-end for the
46 * `{@link xdc.runtime.System}` module.
47 *
48 * This implementation relies on the target's runtime support libraries
49 * (i.e. `fflush()` and `putchar()`). Therefore the functions are re-entrant
50 * (thread-safe) if the underlying rts library is re-entrant.
51 */
52 @ModuleStartup
53 module SysSemihost inherits xdc.runtime.ISystemSupport {
54
55 /*!
56 * ======== abort ========
57 * Backend for `{@link xdc.runtime.System#abort()}`
58 *
59 * This abort function writes the string via `putchar()`
60 * and flushes via `fflush()` to `stdout`.
61 *
62 * @see xdc.runtime.ISystemSupport#abort
63 */
64 override Void abort(CString str);
65
66 /*!
67 * ======== exit ========
68 * Backend for `{@link xdc.runtime.System#exit()}`
69 *
70 * This exit function flushes via `fflush()` to `stdout`.
71 *
72 * @see xdc.runtime.ISystemSupport#exit
73 */
74 override Void exit(Int stat);
75
76 /*!
77 * ======== flush ========
78 * Backend for `{@link xdc.runtime.System#flush()}`
79 *
80 * This flush function flushes via `fflush()` to `stdout`.
81 *
82 * @see xdc.runtime.ISystemSupport#flush
83 */
84 override Void flush();
85
86 /*!
87 * ======== putch ========
88 * Backend for `{@link xdc.runtime.System#printf()}` and `{@link xdc.runtime.System#putch()}`
89 *
90 * This function outputs the character via `putchar()`.
91 *
92 * @see xdc.runtime.ISystemSupport#putch
93 */
94 override Void putch(Char ch);
95
96 /*!
97 * ======== ready ========
98 * Test if character output can proceed
99 *
100 * This always returns TRUE.
101 *
102 * @see xdc.runtime.ISystemSupport#ready
103 */
104 override Bool ready();
105 }