Changeset 96c73ab in rtems
- Timestamp:
- 02/19/98 23:02:16 (25 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 88a877b3
- Parents:
- fde74a3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/m68k/gen68360/console/console.c
rfde74a3 r96c73ab 2 2 * SMC1 raw console serial I/O. 3 3 * 4 * This driver is an example of `POLLING' or `INTERRUPT' input.5 * 6 * To compile with interrupt-driven input, define M360_SMC1_INTERRUPT7 * i n the make customization file for this bsp (gen68360.cfg).4 * This driver is an example of `POLLING' or `INTERRUPT' I/O. 5 * 6 * To run with interrupt-driven I/O, ensure m360_smc1_interrupt 7 * is set before calling the initialization routine. 8 8 * 9 9 * Author: … … 31 31 #include "m68360.h" 32 32 33 #if (defined (M360_SMC1_INTERRUPT)) 34 # define RXBUFSIZE 16 33 /* 34 * Interrupt-driven input buffer 35 */ 36 #define RXBUFSIZE 16 37 38 /* 39 * Interrupt-driven callback 40 */ 41 static int m360_smc1_interrupt = 1; 35 42 static void *smc1ttyp; 36 #else37 # define RXBUFSIZE 138 #endif39 43 40 44 /* … … 47 51 * Device-specific routines 48 52 */ 49 #if (defined (M360_SMC1_INTERRUPT))50 53 static rtems_isr 51 54 smc1InterruptHandler (rtems_vector_number v) … … 75 78 } 76 79 77 #endif78 79 80 static void 80 81 smc1Initialize (void) … … 111 112 m360.smc1p.rfcr = M360_RFCR_MOT | M360_RFCR_DMA_SPACE; 112 113 m360.smc1p.tfcr = M360_TFCR_MOT | M360_TFCR_DMA_SPACE; 113 m360.smc1p.mrblr = RXBUFSIZE; 114 if (m360_smc1_interrupt) 115 m360.smc1p.mrblr = RXBUFSIZE; 116 else 117 m360.smc1p.mrblr = 1; 114 118 115 119 /* … … 150 154 m360.smc1.smcmr |= M360_SMCMR_TEN | M360_SMCMR_REN; 151 155 152 #if (defined (M360_SMC1_INTERRUPT)) 153 { 156 if (m360_smc1_interrupt) { 154 157 rtems_isr_entry old_handler; 155 158 rtems_status_code sc; … … 161 164 m360.cimr |= 1UL << 4; /* Enable SMC1 interrupts */ 162 165 } 163 #endif164 166 } 165 167 … … 184 186 */ 185 187 static int 186 smc1Write (int minor, const char *buf, int len) 187 { 188 #if (defined (M360_SMC1_INTERRUPT)) 188 smc1InterruptWrite (int minor, const char *buf, int len) 189 { 189 190 smcTxBd->buffer = (char *)buf; 190 191 smcTxBd->length = len; 191 192 smcTxBd->status = M360_BD_READY | M360_BD_WRAP | M360_BD_INTERRUPT; 192 #else 193 return 0; 194 } 195 196 static int 197 smc1PollWrite (int minor, const char *buf, int len) 198 { 193 199 while (len--) { 194 200 static char txBuf; … … 200 206 smcTxBd->status = M360_BD_READY | M360_BD_WRAP; 201 207 } 202 #endif203 208 return 0; 204 209 } … … 261 266 rtems_status_code sc; 262 267 263 #if (defined (M360_SMC1_INTERRUPT)) 264 rtems_libio_open_close_args_t *args = arg; 265 266 sc = rtems_termios_open (major, minor, arg, 267 NULL, 268 NULL, 269 NULL, 270 smc1Write, 271 1); 272 smc1ttyp = args->iop->data1; 273 #else 274 sc = rtems_termios_open (major, minor, arg, 275 NULL, 276 NULL, 277 smc1Read, 278 smc1Write, 279 0); 280 #endif 268 if (m360_smc1_interrupt) { 269 rtems_libio_open_close_args_t *args = arg; 270 271 sc = rtems_termios_open (major, minor, arg, 272 NULL, 273 NULL, 274 NULL, 275 smc1InterruptWrite, 276 1); 277 smc1ttyp = args->iop->data1; 278 } 279 else { 280 sc = rtems_termios_open (major, minor, arg, 281 NULL, 282 NULL, 283 smc1Read, 284 smc1PollWrite, 285 0); 286 } 281 287 return sc; 282 288 } -
make/custom/gen68360.cfg
rfde74a3 r96c73ab 70 70 # If defined, debug checks in RTEMS and support library code are enabled. 71 71 # 72 # M360_SMC1_INTERRUPT (gen68360 BSP)73 # If defined, then the console driver operates in interrupt mode.74 # Otherwise it operates in polled mode.75 #76 72 77 73 define make-target-options … … 81 77 @echo "/* #define STACK_CHECKER_REPORT_USAGE 1 */" >>$@ 82 78 @echo "/* #define RTEMS_DEBUG 1 */" >>$@ 83 @echo "#define M360_SMC1_INTERRUPT 1" >>$@84 79 endef 85 80
Note: See TracChangeset
for help on using the changeset viewer.