Changeset e6890ba in rtems
- Timestamp:
- 08/01/00 15:23:59 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 4f8473e
- Parents:
- 16112442
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libcsupport/src/termios.c
r16112442 re6890ba 127 127 volatile unsigned int rawOutBufTail; 128 128 rtems_id rawOutBufSemaphore; 129 enum {rob_idle, rob_busy, rob_wait } rawOutBufState;129 volatile enum {rob_idle, rob_busy, rob_wait } rawOutBufState; 130 130 131 131 /* … … 220 220 rtems_build_name ('T', 'R', 'x', c), 221 221 0, 222 RTEMS_ COUNTING_SEMAPHORE | RTEMS_PRIORITY,222 RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, 223 223 RTEMS_NO_PRIORITY, 224 224 &tty->rawOutBufSemaphore); … … 532 532 /* check, whether XOFF has been received */ 533 533 if (!(tty->flow_ctrl & FL_ORCVXOF)) { 534 534 (*tty->device.write)(tty->minor, 535 535 (char *)&tty->rawOutBuf[tty->rawOutBufTail],1); 536 536 } … … 1102 1102 if (tty->rawOutBufState == rob_wait) 1103 1103 rtems_semaphore_release (tty->rawOutBufSemaphore); 1104 if ( tty->rawOutBufHead == tty->rawOutBufTail ) 1104 if ( tty->rawOutBufHead == tty->rawOutBufTail ) { 1105 tty->rawOutBufState = rob_idle; 1105 1106 return 0; 1107 } 1106 1108 newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE; 1107 1109 if (newTail == tty->rawOutBufHead) { … … 1118 1120 /* set flag, that output has been stopped */ 1119 1121 tty->flow_ctrl |= FL_OSTOP; 1122 tty->rawOutBufState = rob_busy; 1120 1123 nToSend = 0; 1121 1124 } … … 1131 1134 /* to allow fast reaction on incoming flow ctrl and low latency*/ 1132 1135 /* for outgoing flow control */ 1133 if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) {1136 if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) 1134 1137 nToSend = 1; 1135 }1138 tty->rawOutBufState = rob_busy; 1136 1139 (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[newTail], nToSend); 1137 tty->rawOutBufState = rob_busy;1138 1140 } 1139 1141 tty->rawOutBufTail = newTail; … … 1141 1143 return nToSend; 1142 1144 } 1143 1144 -
c/src/lib/libc/termios.c
r16112442 re6890ba 127 127 volatile unsigned int rawOutBufTail; 128 128 rtems_id rawOutBufSemaphore; 129 enum {rob_idle, rob_busy, rob_wait } rawOutBufState;129 volatile enum {rob_idle, rob_busy, rob_wait } rawOutBufState; 130 130 131 131 /* … … 220 220 rtems_build_name ('T', 'R', 'x', c), 221 221 0, 222 RTEMS_ COUNTING_SEMAPHORE | RTEMS_PRIORITY,222 RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, 223 223 RTEMS_NO_PRIORITY, 224 224 &tty->rawOutBufSemaphore); … … 532 532 /* check, whether XOFF has been received */ 533 533 if (!(tty->flow_ctrl & FL_ORCVXOF)) { 534 534 (*tty->device.write)(tty->minor, 535 535 (char *)&tty->rawOutBuf[tty->rawOutBufTail],1); 536 536 } … … 1102 1102 if (tty->rawOutBufState == rob_wait) 1103 1103 rtems_semaphore_release (tty->rawOutBufSemaphore); 1104 if ( tty->rawOutBufHead == tty->rawOutBufTail ) 1104 if ( tty->rawOutBufHead == tty->rawOutBufTail ) { 1105 tty->rawOutBufState = rob_idle; 1105 1106 return 0; 1107 } 1106 1108 newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE; 1107 1109 if (newTail == tty->rawOutBufHead) { … … 1118 1120 /* set flag, that output has been stopped */ 1119 1121 tty->flow_ctrl |= FL_OSTOP; 1122 tty->rawOutBufState = rob_busy; 1120 1123 nToSend = 0; 1121 1124 } … … 1131 1134 /* to allow fast reaction on incoming flow ctrl and low latency*/ 1132 1135 /* for outgoing flow control */ 1133 if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) {1136 if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) 1134 1137 nToSend = 1; 1135 }1138 tty->rawOutBufState = rob_busy; 1136 1139 (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[newTail], nToSend); 1137 tty->rawOutBufState = rob_busy;1138 1140 } 1139 1141 tty->rawOutBufTail = newTail; … … 1141 1143 return nToSend; 1142 1144 } 1143 1144 -
cpukit/libcsupport/src/termios.c
r16112442 re6890ba 127 127 volatile unsigned int rawOutBufTail; 128 128 rtems_id rawOutBufSemaphore; 129 enum {rob_idle, rob_busy, rob_wait } rawOutBufState;129 volatile enum {rob_idle, rob_busy, rob_wait } rawOutBufState; 130 130 131 131 /* … … 220 220 rtems_build_name ('T', 'R', 'x', c), 221 221 0, 222 RTEMS_ COUNTING_SEMAPHORE | RTEMS_PRIORITY,222 RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, 223 223 RTEMS_NO_PRIORITY, 224 224 &tty->rawOutBufSemaphore); … … 532 532 /* check, whether XOFF has been received */ 533 533 if (!(tty->flow_ctrl & FL_ORCVXOF)) { 534 534 (*tty->device.write)(tty->minor, 535 535 (char *)&tty->rawOutBuf[tty->rawOutBufTail],1); 536 536 } … … 1102 1102 if (tty->rawOutBufState == rob_wait) 1103 1103 rtems_semaphore_release (tty->rawOutBufSemaphore); 1104 if ( tty->rawOutBufHead == tty->rawOutBufTail ) 1104 if ( tty->rawOutBufHead == tty->rawOutBufTail ) { 1105 tty->rawOutBufState = rob_idle; 1105 1106 return 0; 1107 } 1106 1108 newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE; 1107 1109 if (newTail == tty->rawOutBufHead) { … … 1118 1120 /* set flag, that output has been stopped */ 1119 1121 tty->flow_ctrl |= FL_OSTOP; 1122 tty->rawOutBufState = rob_busy; 1120 1123 nToSend = 0; 1121 1124 } … … 1131 1134 /* to allow fast reaction on incoming flow ctrl and low latency*/ 1132 1135 /* for outgoing flow control */ 1133 if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) {1136 if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) 1134 1137 nToSend = 1; 1135 }1138 tty->rawOutBufState = rob_busy; 1136 1139 (*tty->device.write)(tty->minor, (char *)&tty->rawOutBuf[newTail], nToSend); 1137 tty->rawOutBufState = rob_busy;1138 1140 } 1139 1141 tty->rawOutBufTail = newTail; … … 1141 1143 return nToSend; 1142 1144 } 1143 1144
Note: See TracChangeset
for help on using the changeset viewer.