los_typedef.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_typedef Type define
00036  * @ingroup kernel
00037 */
00038 
00039 #ifndef _LOS_TYPEDEF_H
00040 #define _LOS_TYPEDEF_H
00041 
00042 #include "los_builddef.h"
00043 
00044 #ifdef __cplusplus
00045 #if __cplusplus
00046 extern "C" {
00047 #endif /* __cplusplus */
00048 #endif /* __cplusplus */
00049 
00050 #ifndef LOS_TYPE_DEF
00051 #define LOS_TYPE_DEF
00052 
00053 /* type definitions */
00054 typedef unsigned char                                       UINT8;
00055 typedef unsigned short                                      UINT16;
00056 typedef unsigned int                                        UINT32;
00057 typedef signed char                                         INT8;
00058 typedef signed short                                        INT16;
00059 typedef signed int                                          INT32;
00060 typedef float                                               FLOAT;
00061 typedef double                                              DOUBLE;
00062 typedef char                                                CHAR;
00063 
00064 typedef unsigned int                                        BOOL;
00065 typedef unsigned long long                                  UINT64;
00066 typedef signed long long                                    INT64;
00067 typedef unsigned int                                        UINTPTR;
00068 typedef signed int                                          INTPTR;
00069 
00070 #define VOID                                                void
00071 #endif  /*end of #ifndef LOS_TYPE_DEF*/
00072 
00073 #ifndef FALSE
00074 #define FALSE                                               ((BOOL)0)
00075 #endif
00076 
00077 #ifndef TRUE
00078 #define TRUE                                                ((BOOL)1)
00079 #endif
00080 
00081 #ifndef NULL
00082 #define NULL                                                ((VOID *)0)
00083 #endif
00084 
00085 #ifdef YES
00086 #undef YES
00087 #endif
00088 #define YES                                                 (1)
00089 
00090 #ifdef  NO
00091 #undef  NO
00092 #endif
00093 #define NO                                                  (0)
00094 
00095 #define OS_NULL_BYTE                                        ((UINT8)0xFF)
00096 #define OS_NULL_SHORT                                       ((UINT16)0xFFFF)
00097 #define OS_NULL_INT                                         ((UINT32)0xFFFFFFFF)
00098 
00099 #ifndef LOS_OK
00100 #define LOS_OK                                              (0U)
00101 #endif
00102 
00103 #ifndef LOS_NOK
00104 #define LOS_NOK                                             (1U)
00105 #endif
00106 
00107 #define OS_FAIL                                             (1)
00108 #define OS_ERROR                                            (UINT32)(-1)
00109 #define OS_INVALID                                          (UINT32)(-1)
00110 
00111 #define asm                                                 __asm
00112 #ifdef typeof
00113 #undef typeof
00114 #endif
00115 #define typeof                                              __typeof__
00116 
00117 
00118 #ifdef __cplusplus
00119 #if __cplusplus
00120 }
00121 #endif /* __cplusplus */
00122 #endif /* __cplusplus */
00123 
00124 #endif /* _LOS_TYPEDEF_H */