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 package ti.sysbios.smp;
39
40 /*!
41 * ======== SysStd ========
42 * Implementation of `{@link xdc.runtime.ISystemSupport}` using ANSI C Standard Library
43 *
44 * This implementation provides a fully functional implementation of
45 * all methods specified by `ISystemSupport`. As with all
46 * `ISystemSupport` modules, this module is the back-end for the
47 * `{@link xdc.runtime.System}` module.
48 *
49 * This implementation relies on the target's runtime support libraries
50 * (i.e. `fflush()` and `putchar()`). Therefore the functions are re-entrant
51 * (thread-safe) if the underlying rts library is re-entrant.
52 */
53 @CustomHeader
54 module SysStd inherits xdc.runtime.ISystemSupport {
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
106 internal:
107
108 struct LineBuffer {
109 UInt outidx;
110 Char outbuf[256];
111 }
112
113 struct Module_State {
114 LineBuffer lineBuffers[];
115 };
116
117 }