pull/8/head
eonaholic 11 months ago
parent 5d032e444b
commit 4d16b4937b

@ -25,9 +25,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --------------------------------------------------------------------------- */
/*以上代码是一个类型定义的头文件用于定义各种数据类型。其中包括基本的整数类型如UINT8、INT16、浮点类型如FLOAT、DOUBLE、字符类型CHAR等。
NULLTRUEFALSELOS_OK
*/
/**
* @defgroup los_typedef Type define
* @ingroup kernel
@ -50,7 +48,8 @@ extern "C" {
#define OS_STRING(x) #x
#define X_STRING(x) OS_STRING(x)
/* type definitions *//*类型定义*/
/* type definitions */
//定义数据类型
typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef unsigned int UINT32;
@ -61,7 +60,10 @@ typedef float FLOAT;
typedef double DOUBLE;
typedef char CHAR;
#ifdef __LP64__
//64位数据模型
typedef long unsigned int UINT64;
typedef long signed int INT64;
typedef unsigned long UINTPTR;
@ -73,6 +75,7 @@ typedef INT64 ssize_t;
typedef UINT64 size_t;
#endif
#else
//32位数据模型
typedef unsigned long long UINT64;
typedef signed long long INT64;
typedef unsigned int UINTPTR;
@ -82,7 +85,7 @@ typedef INT32 ssize_t;
typedef UINT32 size_t;
#endif
#endif
//一些常数的定义
typedef UINTPTR AARCHPTR;
typedef size_t BOOL;
@ -151,7 +154,7 @@ typedef volatile INT64 Atomic64;
#ifndef LOSARC_ALIGNMENT
#define LOSARC_ALIGNMENT 8
#endif
/* And corresponding power of two alignment *//*使用 2 的幂次方作为对齐大小*/
/* And corresponding power of two alignment */
#ifndef LOSARC_P2ALIGNMENT
#ifdef LOSCFG_AARCH64
#define LOSARC_P2ALIGNMENT 3
@ -160,12 +163,12 @@ typedef volatile INT64 Atomic64;
#endif
#endif
/* Give a type or object explicit minimum alignment *//*为类型或对象指定明确的最小对齐方式*/
/* Give a type or object explicit minimum alignment */
#if !defined(LOSBLD_ATTRIB_ALIGN)
#define LOSBLD_ATTRIB_ALIGN(__align__) __attribute__((aligned(__align__)))
#endif
/* Assign a defined variable to a specific section *//*将定义的变量分配给特定节*/
/* Assign a defined variable to a specific section */
#if !defined(LOSBLD_ATTRIB_SECTION)
#define LOSBLD_ATTRIB_SECTION(__sect__) __attribute__((section(__sect__)))
#endif
@ -176,11 +179,6 @@ typedef volatile INT64 Atomic64;
* but using the unused attribute should stop warnings.
*/
#define LOSBLD_ATTRIB_USED __attribute__((used))
/*告诉编译器不要丢弃变量或函数。仅已知
*3.3.2
*使使*/
#ifdef __cplusplus
#if __cplusplus

Loading…
Cancel
Save