5
Last change
on this file since ef1a985f was
c499856,
checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47
|
Change all references of rtems.com to rtems.org.
|
-
Property mode set to
100644
|
File size:
959 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Unregister a Driver from the Device Driver Table. |
---|
5 | * |
---|
6 | * @ingroup ClassicIO |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2007. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #if HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <rtems/io.h> |
---|
23 | #include <rtems/rtems/intr.h> |
---|
24 | #include <rtems/score/threaddispatch.h> |
---|
25 | |
---|
26 | #include <string.h> |
---|
27 | |
---|
28 | rtems_status_code rtems_io_unregister_driver( |
---|
29 | rtems_device_major_number major |
---|
30 | ) |
---|
31 | { |
---|
32 | if ( rtems_interrupt_is_in_progress() ) |
---|
33 | return RTEMS_CALLED_FROM_ISR; |
---|
34 | |
---|
35 | if ( major < _IO_Number_of_drivers ) { |
---|
36 | _Thread_Disable_dispatch(); |
---|
37 | memset( |
---|
38 | &_IO_Driver_address_table[major], |
---|
39 | 0, |
---|
40 | sizeof( rtems_driver_address_table ) |
---|
41 | ); |
---|
42 | _Thread_Enable_dispatch(); |
---|
43 | |
---|
44 | return RTEMS_SUCCESSFUL; |
---|
45 | } |
---|
46 | |
---|
47 | return RTEMS_UNSATISFIED; |
---|
48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.