los_errno.h

浏览该文件的文档。
00001 /*----------------------------------------------------------------------------
00002  * Copyright (c) <2013-2015>, <Huawei Technologies Co., Ltd>
00003  * All rights reserved.
00004  * Redistribution and use in source and binary forms, with or without modification,
00005  * are permitted provided that the following conditions are met:
00006  * 1. Redistributions of source code must retain the above copyright notice, this list of
00007  * conditions and the following disclaimer.
00008  * 2. Redistributions in binary form must reproduce the above copyright notice, this list
00009  * of conditions and the following disclaimer in the documentation and/or other materials
00010  * provided with the distribution.
00011  * 3. Neither the name of the copyright holder nor the names of its contributors may be used
00012  * to endorse or promote products derived from this software without specific prior written
00013  * permission.
00014  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00015  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00016  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00017  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
00018  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00019  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00020  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00021  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00022  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00023  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00024  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00025  *---------------------------------------------------------------------------*/
00026 /*----------------------------------------------------------------------------
00027  * Notice of Export Control Law
00028  * ===============================================
00029  * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
00030  * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
00031  * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
00032  * applicable export control laws and regulations.
00033  *---------------------------------------------------------------------------*/
00034 
00035 /**@defgroup los_errno Error code
00036  * @ingroup kernel
00037  */
00038 
00039 #ifndef _LOS_ERRNO_H
00040 #define _LOS_ERRNO_H
00041 
00042 #include "los_typedef.h"
00043 #include "los_err.h"
00044 
00045 #ifdef __cplusplus
00046 #if __cplusplus
00047 extern "C" {
00048 #endif /* __cplusplus */
00049 #endif /* __cplusplus */
00050 
00051 
00052 /**
00053   * @ingroup los_errno
00054   * OS error code flag.
00055   */
00056 #define LOS_ERRNO_OS_ID                                     ((UINT32)0x00 << 16)
00057 
00058 /**
00059   * @ingroup los_errno
00060   * Define the error level as informative.
00061   */
00062 #define LOS_ERRTYPE_NORMAL                                  ((UINT32)0x00 << 24)
00063 
00064 /**
00065   * @ingroup los_errno
00066   * Define the error level as warning.
00067   */
00068 #define LOS_ERRTYPE_WARN                                    ((UINT32)0x01 << 24)
00069 
00070 /**
00071   * @ingroup los_errno
00072   * Define the error level as critical.
00073   */
00074 #define LOS_ERRTYPE_ERROR                                   ((UINT32)0x02 << 24)
00075 
00076 /**
00077   * @ingroup los_errno
00078   * Define the error level as fatal.
00079   */
00080 #define LOS_ERRTYPE_FATAL                                   ((UINT32)0x03 << 24)
00081 
00082 /**
00083   * @ingroup los_errno
00084   * Define fatal OS errors.
00085   */
00086 #define LOS_ERRNO_OS_FATAL(MID, ERRNO)   \
00087             (LOS_ERRTYPE_FATAL | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) |  (ERRNO))
00088 
00089 /**
00090   * @ingroup los_errno
00091   * Define critical OS errors.
00092   */
00093 #define LOS_ERRNO_OS_ERROR(MID, ERRNO)  \
00094             (LOS_ERRTYPE_ERROR | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | (ERRNO))
00095 
00096 /**
00097   * @ingroup los_errno
00098   * Define warning OS errors.
00099   */
00100 #define LOS_ERRNO_OS_WARN(MID, ERRNO)  \
00101             (LOS_ERRTYPE_WARN | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | (ERRNO))
00102 
00103 /**
00104   * @ingroup los_errno
00105   * Define informative OS errors.
00106   */
00107 #define LOS_ERRNO_OS_NORMAL(MID, ERRNO)  \
00108             (LOS_ERRTYPE_NORMAL | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | (ERRNO))
00109 
00110 
00111 #ifdef __cplusplus
00112 #if __cplusplus
00113 }
00114 #endif /* __cplusplus */
00115 #endif /* __cplusplus */
00116 
00117 #endif /* _LOS_ERRNO_H */