Anh Tran / Mbed OS GR-Boards_WebCamera

Dependencies:   HttpServer_snapshot_mbed-os

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ioif_aio.h Source File

ioif_aio.h

00001 /******************************************************************************
00002  *
00003  *  V. 2.03.00
00004  * $Rev: $
00005  * $Date::                           $
00006  *
00007  * Description : ioif_aio header file
00008  *
00009  * Copyright (C) 2009,2012 Renesas Electronics Corporation. All rights reserved.
00010  *****************************************************************************/
00011 
00012 #ifndef IOIF_AIO_H
00013 #define IOIF_AIO_H
00014 
00015 /*************************************************************************
00016  System Includes
00017 *************************************************************************/
00018 
00019 #include <cmsis_os.h>
00020 #include <posix_types.h>
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 /*************************************************************************
00027  User Includes
00028 *************************************************************************/
00029 
00030 /*************************************************************************
00031  Defines
00032 *************************************************************************/
00033 
00034 /* sigev_notify values */
00035 
00036 #define SIGEV_NONE      (1) /**< No notification */
00037 #define SIGEV_THREAD    (2) /**< A notification function is called in the driver's context */
00038 #define SIGEV_EVENT     (3) /**< An event flag is set */
00039 #define SIGEV_CALLBACK  (4) /**< An inter-process callback is made */
00040 
00041 /*************************************************************************
00042  Constant Macros
00043 *************************************************************************/
00044 
00045 /*************************************************************************
00046  Function Macros
00047 *************************************************************************/
00048 
00049 /*************************************************************************
00050  Typedefs
00051 *************************************************************************/
00052 
00053 #if(1) /* mbed */
00054 #else  /* not mbed */
00055 typedef void *      pthread_attr_t;     /**< unsupported */
00056 #endif /* end mbed */
00057 
00058 union sigval
00059 {
00060     int             sival_int;          /**< Integer interpretation */
00061     void *          sival_ptr;          /**< Pointer interpretation */
00062 };
00063 
00064 struct sigevent
00065 {
00066     int             sigev_notify;       /**< SIGEV_NONE, SIGEV_THREAD, SIGEV_EVENT */
00067     int             sigev_signo;        /**< signal or callback fp */
00068     union sigval    sigev_value;        /**< user defined value to pass */
00069     void            (*sigev_notify_function) (union sigval);
00070                                         /**< notification function */
00071 };
00072 
00073 struct aiocb
00074 {
00075     /* Implementation specific stuff */
00076     struct aiocb *  pNext;              /**< next aio request */
00077     struct aiocb *  pPrev;              /**< previous aio request */
00078     ssize_t         aio_return;         /**< return value of operation */
00079     int             aio_complete;       /**< non-zero when op is completed */
00080 
00081     /* User parameters */
00082     int             aio_fildes;         /**< FD for asynchronous op */
00083     off_t           aio_offset;         /**< Absolute offset to seek to */
00084     volatile void*  aio_buf;            /**< Buffer to read from/write to */
00085     size_t          aio_nbytes;         /**< Number of bytes to read/write */
00086     struct sigevent aio_sigevent;       /**< Signal to deliver */
00087 
00088     /* Private implementation specific function pointer used by IOIF. Application should not set. */
00089     ssize_t (*aio_iofn)(void *,void *,size_t,int);  /* synchronous I/O function */
00090 };
00091 typedef struct aiocb AIOCB;
00092 
00093 #if(1) /* mbed */
00094 #else  /* not mbed */
00095 struct timespec
00096 {
00097     time_t   tv_sec;            /* Seconds.  */
00098     long int tv_nsec;           /* Nanoseconds.  */
00099 };
00100 #endif /* end mbed */
00101 
00102 #ifdef __cplusplus
00103 }
00104 #endif
00105 
00106 #endif