WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_typedef.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2013-2019. All rights reserved.
3 * Description: Type define
4 * Author: Huawei LiteOS Team
5 * Create: 2013-01-01
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
34#ifndef _LOS_TYPEDEF_H
35#define _LOS_TYPEDEF_H
36#include "stddef.h"
37#include "stdbool.h"
38#include "stdint.h"
39#include "los_builddef.h"
40#include "los_toolchain.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif /* __cplusplus */
45
46#define OS_STRING(x) #x
47#define X_STRING(x) OS_STRING(x)
48
49/* type definitions */
50typedef unsigned char UINT8;
51typedef unsigned short UINT16;
52typedef unsigned int UINT32;
53typedef signed char INT8;
54typedef signed short INT16;
55typedef signed int INT32;
56typedef float FLOAT;
57typedef double DOUBLE;
58typedef char CHAR;
59
60#ifdef __LP64__
61typedef long unsigned int UINT64;
62typedef long signed int INT64;
63typedef unsigned long UINTPTR;
64typedef signed long INTPTR;
65typedef __uint128_t UINT128;
66#define LOSCFG_AARCH64
67#ifndef LOSCFG_LIB_LIBC
68typedef INT64 ssize_t;
69typedef UINT64 size_t;
70#endif
71#else
72typedef unsigned long long UINT64;
73typedef signed long long INT64;
74typedef unsigned int UINTPTR;
75typedef signed int INTPTR;
76#ifndef LOSCFG_LIB_LIBC
77typedef INT32 ssize_t;
78typedef UINT32 size_t;
79#endif
80#endif
81
83typedef size_t BOOL;
84
85typedef volatile INT32 Atomic;
86typedef volatile INT64 Atomic64;
87
88#define VOID void
89#ifndef STATIC
90#define STATIC static
91#endif
92
93#ifndef FALSE
94#define FALSE 0U
95#endif
96
97#ifndef TRUE
98#define TRUE 1U
99#endif
100
101#ifndef NULL
102#define NULL ((VOID *)0)
103#endif
104
105#ifdef YES
106#undef YES
107#endif
108#define YES 1
109
110#ifdef NO
111#undef NO
112#endif
113#define NO 0
114
115#define OS_NULL_BYTE ((UINT8)0xFF)
116#define OS_NULL_SHORT ((UINT16)0xFFFF)
117#define OS_NULL_INT ((UINT32)0xFFFFFFFF)
118
119#define OS_HEX_ADDR_WIDTH (sizeof(UINTPTR) * 2)
120
121#ifndef LOS_OK
122#define LOS_OK 0
123#endif
124
125#ifndef LOS_NOK
126#define LOS_NOK 1
127#endif
128
129#ifndef LOS_USED
130#define LOS_USED 1
131#endif
132
133#ifndef LOS_UNUSED
134#define LOS_UNUSED 0
135#endif
136
137#define OS_FAIL 1
138#define OS_ERROR (UINT32)(-1)
139#define OS_INVALID (UINT32)(-1)
140
141#define asm __asm
142#ifdef typeof
143#undef typeof
144#endif
145#define typeof __typeof__
146
147#ifndef LOS_LABEL_DEFN
148#define LOS_LABEL_DEFN(label) label
149#endif
150
151#ifndef LOSARC_ALIGNMENT
152#define LOSARC_ALIGNMENT 8
153#endif
154/* And corresponding power of two alignment */
155#ifndef LOSARC_P2ALIGNMENT
156#ifdef LOSCFG_AARCH64
157#define LOSARC_P2ALIGNMENT 3
158#else
159#define LOSARC_P2ALIGNMENT 2
160#endif
161#endif
162
163/* Give a type or object explicit minimum alignment */
164#if !defined(LOSBLD_ATTRIB_ALIGN)
165#define LOSBLD_ATTRIB_ALIGN(__align__) __attribute__((aligned(__align__)))
166#endif
167
168/* Assign a defined variable to a specific section */
169#if !defined(LOSBLD_ATTRIB_SECTION)
170#define LOSBLD_ATTRIB_SECTION(__sect__) __attribute__((section(__sect__)))
171#endif
172
173/*
174 * Tell the compiler not to throw away a variable or function. Only known
175 * available on 3.3.2 or above. Old version's didn't throw them away,
176 * but using the unused attribute should stop warnings.
177 */
178#define LOSBLD_ATTRIB_USED __attribute__((used))
179
180#ifdef __cplusplus
181}
182#endif /* __cplusplus */
183
184#endif /* _LOS_TYPEDEF_H */
unsigned short UINT16
Definition los_typedef.h:51
signed int INT32
Definition los_typedef.h:55
UINT32 size_t
Definition los_typedef.h:78
signed short INT16
Definition los_typedef.h:54
unsigned long long UINT64
Definition los_typedef.h:72
volatile INT64 Atomic64
Definition los_typedef.h:86
signed char INT8
Definition los_typedef.h:53
float FLOAT
Definition los_typedef.h:56
UINTPTR AARCHPTR
Definition los_typedef.h:82
volatile INT32 Atomic
Definition los_typedef.h:85
unsigned char UINT8
Definition los_typedef.h:50
unsigned int UINTPTR
Definition los_typedef.h:74
unsigned int UINT32
Definition los_typedef.h:52
double DOUBLE
Definition los_typedef.h:57
char CHAR
Definition los_typedef.h:58
size_t BOOL
Definition los_typedef.h:83
INT32 ssize_t
Definition los_typedef.h:77
signed long long INT64
Definition los_typedef.h:73
signed int INTPTR
Definition los_typedef.h:75