Changeset 031b57c in rtems


Ignore:
Timestamp:
Oct 9, 2009, 1:46:39 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
7cb7a5ef
Parents:
bbf6253
Message:

2009-10-09 Sebastian Huber <Sebastian.Huber@…>

  • cpukit/sapi/include/rtems/io.h: Documentation.
  • cpukit/sapi/src/ioregisterdriver.c: Call from interrupt context is an error.
  • cpukit/sapi/src/iounregisterdriver.c: Disable preemption during critical section.
Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rbbf6253 r031b57c  
     12009-10-09      Sebastian Huber <Sebastian.Huber@embedded-brains.de>
     2
     3        * cpukit/sapi/include/rtems/io.h: Documentation.
     4        * cpukit/sapi/src/ioregisterdriver.c: Call from interrupt context is
     5        an error.
     6        * cpukit/sapi/src/iounregisterdriver.c: Disable preemption during
     7        critical section.
     8
    192009-10-09      Chris Johns <chrisj@rtems.org>
    210
  • cpukit/sapi/include/rtems/io.h

    rbbf6253 r031b57c  
    9393 * @retval RTEMS_TOO_MANY No major number available.
    9494 * @retval RTEMS_RESOURCE_IN_USE Major number in use.
     95 * @retval RTEMS_CALLED_FROM_ISR Called from interrupt context.
    9596 * @retval * Status code depends on rtems_io_initialize().
    9697 */
     
    106107 * @retval RTEMS_SUCCESSFUL Device driver successfully unregistered.
    107108 * @retval RTEMS_UNSATISFIED Invalid major number.
     109 * @retval RTEMS_CALLED_FROM_ISR Called from interrupt context.
    108110 */
    109111rtems_status_code rtems_io_unregister_driver(
  • cpukit/sapi/src/ioregisterdriver.c

    rbbf6253 r031b57c  
    6969  rtems_device_major_number major_limit = _IO_Number_of_drivers;
    7070
     71  if ( rtems_interrupt_is_in_progress() )
     72    return RTEMS_CALLED_FROM_ISR;
     73
    7174  if ( registered_major == NULL )
    7275    return RTEMS_INVALID_ADDRESS;
  • cpukit/sapi/src/iounregisterdriver.c

    rbbf6253 r031b57c  
    1818#include <rtems/system.h>
    1919#include <rtems/io.h>
     20#include <rtems/rtems/intr.h>
     21#include <rtems/score/thread.h>
    2022#include <string.h>
    2123
     
    3739)
    3840{
     41  if ( rtems_interrupt_is_in_progress() )
     42    return RTEMS_CALLED_FROM_ISR;
     43
    3944  if ( major < _IO_Number_of_drivers ) {
     45    _Thread_Disable_dispatch();
    4046    memset(
    4147      &_IO_Driver_address_table[major],
     
    4349      sizeof( rtems_driver_address_table )
    4450    );
     51    _Thread_Enable_dispatch();
     52
    4553    return RTEMS_SUCCESSFUL;
    4654  }
     55
    4756  return RTEMS_UNSATISFIED;
    4857}
Note: See TracChangeset for help on using the changeset viewer.