Changeset 7cafde22 in rtems


Ignore:
Timestamp:
Oct 13, 2009, 11:34:49 AM (11 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, 5, master
Children:
253c3a1d
Parents:
94d7bd7
Message:

Enable interrupts during open to avoid NULL pointer access in interrupt handler.

Location:
c/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/ChangeLog

    r94d7bd7 r7cafde22  
     12009-10-13      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * libchip/serial/ns16550.c: Enable interrupts during open to avoid
     4        NULL pointer access in interrupt handler.
     5
    162009-10-09      Sebastian Huber <sebastian.huber@embedded-brains.de>
    27
  • c/src/libchip/serial/ns16550.c

    r94d7bd7 r7cafde22  
    174174  struct rtems_termios_tty *tty = (struct rtems_termios_tty *) oc->iop->data1;
    175175  console_tbl *c = &Console_Port_Tbl [minor];
     176  console_data *d = &Console_Port_Data [minor];
     177
     178  d->termios_data = tty;
    176179
    177180  /* Assert DTR */
     
    182185  /* Set initial baud */
    183186  rtems_termios_set_initial_baud( tty, (int32_t) c->pDeviceParams);
     187
     188  if (c->pDeviceFns->deviceOutputUsesInterrupts) {
     189    ns16550_enable_interrupts( minor, NS16550_ENABLE_ALL_INTR_EXCEPT_TX);
     190  }
    184191
    185192  return RTEMS_SUCCESSFUL;
     
    202209    ns16550_negate_DTR(minor);
    203210  }
     211
     212  ns16550_enable_interrupts(minor, NS16550_DISABLE_ALL_INTR);
    204213
    205214  return(RTEMS_SUCCESSFUL);
     
    649658    }
    650659  #endif
    651  
    652   ns16550_enable_interrupts( minor, NS16550_ENABLE_ALL_INTR_EXCEPT_TX);
    653660}
    654661
Note: See TracChangeset for help on using the changeset viewer.