Ignore:
Timestamp:
08/31/98 23:03:45 (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
d9d75fc
Parents:
de9edc4
Message:

Patch from Eric Valette <valette@…>:

Eric> NB : there is still a bug on PC386 serial line : exit does not
Eric> flush the remaining output queue. As this is not a bug in the
Eric> driver itself but somewhere in PC386 initialization/termios
Eric> relationship it will be part of another patch.

Eric> NB2 : As Emmanuel excerced the exception hanlder code, while
Eric> porting the SMC driver to the new BSD stack, we found a bug
Eric> in the exception handler : it shall not delete the current
Eric> thread in case we are running at interrupt level. This will
Eric> be part of another patch...

So here is the patch. This patch fixes the two problems mentionned above

+ it use vpath mechanism intead of copying the irq related files in

the right directory. This avoid to compile them each time and is
more homogenous with other Makefiles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/console/console.c

    rde9edc4 rb285860  
    5050 */
    5151
    52 int PC386ConsolePort = PC386_UART_COM2;
     52int PC386ConsolePort = PC386_CONSOLE_PORT_CONSOLE;
    5353
    5454static int conSetAttr(int minor, const struct termios *);
     
    9292   * assert can fail inside ISR too
    9393   */
     94  /*
     95   * Close console
     96   */
     97  __rtems_close(2);
     98  __rtems_close(1);
     99  __rtems_close(0);
     100
    94101  printk("\nassert failed: %s: ", file);
    95102  printk("%d: ", line);
     
    206213
    207214
     215static int console_open_count = 0;
     216
     217static void console_last_close()
     218{
     219  pc386_remove_rtems_irq_handler (&console_isr_data);
     220}
     221
    208222/*-------------------------------------------------------------------------+
    209223| Console device driver OPEN entry point
     
    218232  {
    219233    NULL,                     /* firstOpen */
    220     NULL,                     /* lastClose */
     234    console_last_close,       /* lastClose */
    221235    NULL,                     /* pollRead */
    222236    PC386_uart_termios_write_com1, /* write */
     
    229243  if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE)
    230244    {
     245      ++console_open_count;
    231246      return RTEMS_SUCCESSFUL;
    232247    }
     
    266281{
    267282  rtems_device_driver res = RTEMS_SUCCESSFUL;
    268  
     283
    269284  if(PC386ConsolePort != PC386_CONSOLE_PORT_CONSOLE)
    270285    {
    271286      res =  rtems_termios_close (arg);
    272287    }
    273   pc386_remove_rtems_irq_handler (&console_isr_data);
     288  else {
     289    if (--console_open_count == 0) {
     290      console_last_close();
     291    }
     292  }
    274293 
    275294  return res;
Note: See TracChangeset for help on using the changeset viewer.