source: rtems/cpukit/sapi/src/ioopen.c @ 9c556023

4.104.114.84.95
Last change on this file since 9c556023 was 9c556023, checked in by Joel Sherrill <joel.sherrill@…>, on 05/29/07 at 19:56:35

2007-05-29 Joel Sherrill <joel.sherrill@…>

  • sapi/Makefile.am, sapi/include/rtems/io.h, sapi/src/io.c: Split into one function per file execpt io.c which contains required initialization methods.
  • sapi/src/ioclose.c, sapi/src/iocontrol.c, sapi/src/iodata.c, sapi/src/ioinitialize.c, sapi/src/ioopen.c, sapi/src/ioread.c, sapi/src/ioregisterdriver.c, sapi/src/iounregisterdriver.c, sapi/src/iowrite.c: New files.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  Input/Output Manager - Open Device
3 *
4 *  COPYRIGHT (c) 1989-2007.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/io.h>
20
21/*
22 *  rtems_io_open
23 *
24 *  This routine is the open directive of the IO manager.
25 *
26 *  Input Paramters:
27 *    major        - device driver number
28 *    minor        - device number
29 *    argument     - pointer to argument(s)
30 *
31 *  Output Parameters:
32 *    returns       - return code
33 */
34
35rtems_status_code rtems_io_open(
36  rtems_device_major_number  major,
37  rtems_device_minor_number  minor,
38  void                      *argument
39)
40{
41  rtems_device_driver_entry callout;
42
43  if ( major >= _IO_Number_of_drivers )
44    return RTEMS_INVALID_NUMBER;
45
46  callout = _IO_Driver_address_table[major].open_entry;
47  return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
48}
Note: See TracBrowser for help on using the repository browser.