📄 common_types.h
字号:
/*** Name: common_types.h** Purpose: This include file defines basic types.** Author : Alan Cudmore NASA/GSFC Code 582**** Modification History:** 12/05/03 - P.Kutt : Removed RTEMS system header files.** Removed CCSDS header typedefs; these are in ccsds.h.** Removed time typedefs; these are in timeutils.h.** Removed OS init modes; these are in osapiservices.h.** Removed semaphore control blocks; these are internal to OS.** 12/09/03 - P.Kutt : Added _USING_RTEMS_INCLUDES_ guard around typedef for boolean.** 04/29/04 - P.Kutt : Removed obsolete macro definitions that don't begin with OS_** and are not used by core tasks.*/#ifndef _common_types_#define _common_types_/*** Section 1: Basic typedefs*//******************************************************************************** NOTE: The RTEMS operating system defines a typedef named 'boolean' (which** is an unsigned int). When compiling a source file with RTEMS header files,** one should insert:** #define _USING_RTEMS_INCLUDES_** before including this file so that the definition of 'boolean' in this file** will be skipped. Otherwise, one will get a compiler warning about multiple** declarations.******************************************************************************//*----- Basic data types -----*/typedef signed char int8; /* 8 bits signed */typedef short int int16; /* 16 bits signed */typedef int int32; /* 32 bits signed */typedef unsigned char uint8; /* 8 bits unsigned */typedef unsigned short int uint16; /* 16 bits unsigned */typedef unsigned int uint32; /* 32 bits unsigned */#ifndef _USING_RTEMS_INCLUDES_#ifndef _HONEYWELL_BSP_typedef unsigned int boolean; /* TRUE or FALSE */#endif#endif/*----- Basic data types in heritage code -----*/typedef int8 byte; /* 8 bits signed */typedef int16 word; /* 16 bits signed */typedef int32 dword; /* 32 bits signed */typedef uint8 u_byte; /* 8 bits unsigned */typedef uint16 u_word; /* 16 bits unsigned */typedef uint32 u_dword; /* 32 bits unsigned */typedef unsigned short int bit_field; /* bit fields; no more than 16 *//*** Section 2: Defines and Macros*/#if defined(_ix86_)/* ----------------------- Intel x86 processor family -------------------------*/ /* Little endian */ #undef _STRUCT_HIGH_BIT_FIRST_ #define _STRUCT_LOW_BIT_FIRST_ typedef unsigned char boolean; typedef signed char int8; typedef short int int16; typedef long int int32; typedef unsigned char uint8; typedef unsigned short int uint16; typedef unsigned long int uint32; #elif defined(_ppc_) /* ----------------------- Motorola Power PC family ---------------------------*/ /* The PPC can be programmed to be big or little endian, we assume native */ /* Big endian */ #define _STRUCT_HIGH_BIT_FIRST_ #undef _STRUCT_LOW_BIT_FIRST_ typedef unsigned char boolean; typedef signed char int8; typedef short int int16; typedef long int int32; typedef unsigned char uint8; typedef unsigned short int uint16; typedef unsigned long int uint32; #endif /* processor types *//*----- boolean constants -----*/#ifdef TRUE #undef TRUE#endif#ifdef FALSE #undef FALSE#endif#define FALSE 0#define TRUE 1/*----- null pointer -----*/#ifndef NULL #define NULL ((void *) 0)#endif/*----- other macros (NOTE: these may be removed eventually) -----*/#define OS_ABS(x) ( ((x) < 0 ) ? -(x) : (x) )#define OS_PACK#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -