Changeset 18ff889 in rtems


Ignore:
Timestamp:
Mar 14, 2016, 9:11:38 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
df91dd9
Parents:
734118d9
git-author:
Sebastian Huber <sebastian.huber@…> (03/14/16 09:11:38)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/14/16 09:56:22)
Message:

score: Use ISR lock for IO driver registration

Create implementation header file.

Update #2555.

Files:
1 added
17 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/monitor/mon-driver.c

    r734118d9 r18ff889  
    2323
    2424#include <rtems.h>
     25#include <rtems/ioimpl.h>
    2526#include <rtems/monitor.h>
    2627
  • cpukit/sapi/Makefile.am

    r734118d9 r18ff889  
    1414include_rtems_HEADERS += include/rtems/init.h
    1515include_rtems_HEADERS += include/rtems/io.h
     16include_rtems_HEADERS += include/rtems/ioimpl.h
    1617include_rtems_HEADERS += include/rtems/mptables.h
    1718include_rtems_HEADERS += include/rtems/cbs.h
  • cpukit/sapi/include/confdefs.h

    r734118d9 r18ff889  
    2727 */
    2828#include <rtems.h>
     29#include <rtems/ioimpl.h>
    2930#include <rtems/sysinit.h>
    3031#include <rtems/score/apimutex.h>
  • cpukit/sapi/include/rtems/io.h

    r734118d9 r18ff889  
    247247) RTEMS_DEPRECATED;
    248248
    249 extern const size_t _IO_Number_of_drivers;
    250 
    251 extern rtems_driver_address_table _IO_Driver_address_table[];
    252 
    253 extern bool _IO_All_drivers_initialized;
    254 
    255 /**
    256  * @brief Initialization of all device drivers.
    257  *
    258  * Initializes all device drivers.
    259  */
    260 void _IO_Initialize_all_drivers( void );
    261 
    262249#ifdef __cplusplus
    263250}
  • cpukit/sapi/preinstall.am

    r734118d9 r18ff889  
    5959PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/io.h
    6060
     61$(PROJECT_INCLUDE)/rtems/ioimpl.h: include/rtems/ioimpl.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     62        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/ioimpl.h
     63PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/ioimpl.h
     64
    6165$(PROJECT_INCLUDE)/rtems/mptables.h: include/rtems/mptables.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    6266        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/mptables.h
  • cpukit/sapi/src/exinit.c

    r734118d9 r18ff889  
    2424#include <rtems/extensionimpl.h>
    2525#include <rtems/init.h>
    26 #include <rtems/io.h>
     26#include <rtems/ioimpl.h>
    2727#include <rtems/sysinit.h>
    2828#include <rtems/score/sysstate.h>
  • cpukit/sapi/src/io.c

    r734118d9 r18ff889  
    2020#endif
    2121
    22 #include <rtems/io.h>
     22#include <rtems/ioimpl.h>
    2323
    2424bool _IO_All_drivers_initialized;
  • cpukit/sapi/src/ioclose.c

    r734118d9 r18ff889  
    2222#endif
    2323
    24 #include <rtems/system.h>
    25 #include <rtems/io.h>
     24#include <rtems/ioimpl.h>
    2625
    2726rtems_status_code rtems_io_close(
  • cpukit/sapi/src/iocontrol.c

    r734118d9 r18ff889  
    2020#endif
    2121
    22 #include <rtems/system.h>
    23 #include <rtems/io.h>
     22#include <rtems/ioimpl.h>
    2423
    2524rtems_status_code rtems_io_control(
  • cpukit/sapi/src/ioinitialize.c

    r734118d9 r18ff889  
    2020#endif
    2121
    22 #include <rtems/system.h>
    23 #include <rtems/io.h>
     22#include <rtems/ioimpl.h>
    2423
    2524rtems_status_code rtems_io_initialize(
  • cpukit/sapi/src/ioopen.c

    r734118d9 r18ff889  
    2222#endif
    2323
    24 #include <rtems/system.h>
    25 #include <rtems/io.h>
     24#include <rtems/ioimpl.h>
    2625
    2726rtems_status_code rtems_io_open(
  • cpukit/sapi/src/ioread.c

    r734118d9 r18ff889  
    2020#endif
    2121
    22 #include <rtems/system.h>
    23 #include <rtems/io.h>
     22#include <rtems/ioimpl.h>
    2423
    2524rtems_status_code rtems_io_read(
  • cpukit/sapi/src/ioregisterdriver.c

    r734118d9 r18ff889  
    2222#endif
    2323
    24 #include <rtems/io.h>
    25 #include <rtems/rtems/intr.h>
    26 #include <rtems/score/threaddispatch.h>
     24#include <rtems/ioimpl.h>
     25
     26ISR_LOCK_DEFINE( , _IO_Driver_registration_lock, "IO Driver Registration" )
    2727
    2828static inline bool rtems_io_is_empty_table(
     
    6565{
    6666  rtems_device_major_number major_limit = _IO_Number_of_drivers;
     67  ISR_lock_Context lock_context;
    6768
    6869  if ( rtems_interrupt_is_in_progress() )
     
    8485    return RTEMS_INVALID_NUMBER;
    8586
    86   _Thread_Disable_dispatch();
     87  _IO_Driver_registration_acquire( &lock_context );
    8788
    8889  if ( major == 0 ) {
     
    9091
    9192    if ( sc != RTEMS_SUCCESSFUL ) {
    92       _Thread_Enable_dispatch();
     93      _IO_Driver_registration_release( &lock_context );
    9394      return sc;
    9495    }
     
    9899
    99100    if ( !rtems_io_is_empty_table( table ) ) {
    100       _Thread_Enable_dispatch();
     101      _IO_Driver_registration_release( &lock_context );
    101102      return RTEMS_RESOURCE_IN_USE;
    102103    }
     
    107108  _IO_Driver_address_table [major] = *driver_table;
    108109
    109   _Thread_Enable_dispatch();
     110  _IO_Driver_registration_release( &lock_context );
    110111
    111112  if ( _IO_All_drivers_initialized ) {
  • cpukit/sapi/src/iounregisterdriver.c

    r734118d9 r18ff889  
    2020#endif
    2121
    22 #include <rtems/io.h>
    23 #include <rtems/rtems/intr.h>
    24 #include <rtems/score/threaddispatch.h>
     22#include <rtems/ioimpl.h>
    2523
    2624#include <string.h>
     
    3432
    3533  if ( major < _IO_Number_of_drivers ) {
    36     _Thread_Disable_dispatch();
     34    ISR_lock_Context lock_context;
     35
     36    _IO_Driver_registration_acquire( &lock_context );
    3737    memset(
    3838      &_IO_Driver_address_table[major],
     
    4040      sizeof( rtems_driver_address_table )
    4141    );
    42     _Thread_Enable_dispatch();
     42    _IO_Driver_registration_release( &lock_context );
    4343
    4444    return RTEMS_SUCCESSFUL;
  • cpukit/sapi/src/iowrite.c

    r734118d9 r18ff889  
    2020#endif
    2121
    22 #include <rtems/system.h>
    23 #include <rtems/io.h>
     22#include <rtems/ioimpl.h>
    2423
    2524rtems_status_code rtems_io_write(
  • testsuites/sptests/sp40/init.c

    r734118d9 r18ff889  
    1717
    1818#include <tmacros.h>
     19
     20#include <rtems/ioimpl.h>
    1921
    2022const char rtems_test_name[] = "SP 40";
  • testsuites/sptests/spsysinit01/init.c

    r734118d9 r18ff889  
    2727
    2828#include <rtems.h>
     29#include <rtems/ioimpl.h>
    2930#include <rtems/libio_.h>
    3031#include <rtems/sysinit.h>
Note: See TracChangeset for help on using the changeset viewer.