📄 su_types.h
字号:
/***************************************************************************** * * * (c) Copyright 1999, 2000, 2002 Motorola Inc. All rights reserved. * * Motorola Confidential Proprietary * * Contains confidential proprietary information of Motorola, Inc. * * Reverse engineering is prohibited. * * The copyright notice does not imply publication. * * * *****************************************************************************//* * DESCRIPTION: * The su_types.h header file contains constants, structures, enums, * typedefs, function prototypes, class definitions, and global * variable external references that are RTOS and SUAPI specific. *//************** REVISION HISTORY ********************************************** * * Date Author Reference * ========== ======== ========================================= * 1999-09-01 nhoch File created from suapi.h split (CR 4359) * 1999-09-28 achan Move SU_BIT_ZERO_MASK and SU_BIT_ONE_MASK from * su_private.h (CR 4547) * 1999-09-27 rdubey Added new types for data logging(CR 3071) * 1999-09-30 nhoch SU_ENOTFOUND added to errors (CR 4357) * 1999-10-26 pduda added routing to port structure (CR 4291) * 1999-10-06 vagarwal Adding support for priority queues (CR * 4050) * 1999-12-06 jjohlas Fix consts to enable uses of 4.3d compiler * (CR 4687). * 1999-11-19 rdubey Added support for flag services(CR 4635) * 1999-12-08 jjohlas Fix ANSI C++ violation (CR 5467) * 1999-11-05 vagarwal Changing SU_PRIO_HIGH to SU_PRIO_LOW as the default * priority(CR 5029) * 1999-11-16 vagarwal Hiding the priority field in the message * length (CR 5201) * 2000-01-18 rclayton Add comment for synchronization (CR 4553). * 2000-01-05 rdubey Use sizeof(UINT32) to calculate SU_UINT32_BITS and * remove SU_UNSIGNED_BITS(CR 5397). * 2000-01-14 rdubey Remove port_control struct from port struct(CR5956) * 2000-01-12 vagarwal Using fundamental types for SU_TICKS * and fix SU_TIMER_HANDLE comment (CR 5952). * 2000-02-04 rdubey moved SU_SIZE_* in this file(CR 6576). * 2000-02-14 afay Typedef'd SU_RET_STATUS and SU_ERROR_STATUS * to be SUAPI basic types (CR 6546) * 2000-02-25 rdubey Moved SU_INTERRUPT from su_int.h to this * file, and made it UINT32 (CR6892). * 2002-12-23 nilee Add definition for NULL. * 2002-12-27 nilee Update Copyright. *****************************************************************************/#ifndef SU_TYPES_H#define SU_TYPES_H#ifdef __cplusplusextern "C" {#endif/************** HEADER FILE INCLUDES *****************************************/#include <stdarg.h>#include "su_basictypes.h"/********************** CONSTANTS ********************************************//********************** RTOS SPECIFIC ****************************************//* The SU_ISR and SU_SELF defines are special values used to indicate interrupt subroutine (ISR) context and the shorthand task handle for the calling task. */#define SU_ISR ((SU_TASK_HANDLE) (-1))#define SU_SELF ((SU_TASK_HANDLE) (-2))/* * Defines the invalid event number. */#define SU_NO_EVENT 32/* Message priorities may be low, medium, or high. */#define SU_PRIO_LOW 0#define SU_PRIO_MEDIUM 1#define SU_PRIO_HIGH 2/* SU_NUM_QUEUE_PRIORITIES specifies the total number of priorities * supported by the implementation */#define SU_NUM_QUEUE_PRIORITIES 3/* NULL definition */#ifndef NULL#define NULL (0)#endif/********************** SUAPI SPECIFIC **************************************//* * Defines special event mask. */#define SU_NO_EVENT_MASK 0x00/* SU_INVALID_HANDLE is used to identify invalid handles. It should be cast to the object's proper handle type.*/#define SU_INVALID_HANDLE 0/* This macro is used to calculate the number of bits in the unsigned type..*/#define SU_BITS_PER_BYTE 8#define SU_UINT32_BITS (sizeof(UINT32) * SU_BITS_PER_BYTE)/* The following constants are used to identify the size of values passed to * variable argument routines when data values are passed instead of pointers * to data. */#define SU_SIZE_8 ((int)-1) /* To pass eight bits of data */#define SU_SIZE_16 ((int)-2) /* To pass sixteen bits of data */#define SU_SIZE_32 ((int)-3) /* To pass 32 bits of data */#define SU_SIZE_64 ((int)-4) /* To pass 64 bits of data *//************** STRUCTURES, ENUMS, AND TYPEDEFS ******************************//********************** RTOS SPECIFIC ****************************************//* The SU_QUEUE_HANDLE type is used for variables that identify queues. It is implemented as a pointer to an element in a queue table. The queue storage will be allocated during configuration. The number of queues can be obtained from su_sysconfig.nqueues. */ typedef struct SU_QUEUE * SU_QUEUE_HANDLE;/* The SU_TIMER_HANDLE type is used for identifying timers. VRTXmc virtual timers are created at system configuration time and assigned fixed ID numbers ranging from 0 to 254. *//* SU_TIMER_HANDLE is an int because it is the same type used by VRTXmc. Because this type is a "pass through" type to VRTXmc, it is convenient to use the same type as VRTXmc. In this way, if Mentor Graphics recompiles on a different compiler, we get the same type. If they change it in the future, then we'll have to change it, but we would have had to anyway. */typedef int SU_TIMER_HANDLE; /* The SU_SEMA_HANDLE type is used to identify semaphores. Semaphores are implemented using VRTXmc mailboxes. */typedef unsigned int SU_SEMA_HANDLE;/* The SU_TASK_HANDLE type is used for variables which identifytasks. On VRTXmc, the task identifier is an 8 bit value. */typedef int SU_TASK_HANDLE;/* The SU_TASK_PRI type is used for task priorities. */typedef int SU_TASK_PRI;/* The SU_TICKS type is used for variables that are times in ticks. */typedef INT64 SU_TICKS;/* The SU_TIME type is used for variables that are durations or timeouts in milliseconds. Times provided in milliseconds are converted to clock ticks before being passed to VRTXmc services.The maximum SU_TIME value is 2^63 - 1 clock ticks. The maximum SU_TIME value in milliseconds is determined by the characteristics of the host hardware. */typedef int SU_TIME; /* The SU_SYSCONFIG type is used for system configuration information *//* Make sure that the SU_TEST_START macro is updated when this data structure is updated (in file suapi_test.h). */typedef const struct{ SU_TIME maxtimeout; SU_TIME mintimeout; unsigned int nqueues; unsigned int npartition; unsigned int ntimers; unsigned int nbinarysemaphores; unsigned int nmutexsemaphores; unsigned int memorypromotion; unsigned int namehashtablesize; unsigned int nports; unsigned int nflaggroups;} SU_SYSCONFIG; /* * This data type defines the event number used in event services. */typedef UINT32 SU_EVNUM; /* The SU_PORT_HANDLE identifies a port. */typedef struct SU_PORT_HANDLE_STRUCT *SU_PORT_HANDLE; /* The type SU_INTERRUPT is a 32-bit unsigned integer used to store the * interrupt state. */typedef UINT32 SU_INTERRUPT; /***************** SUAPI SPECIFIC ********************************************//* The SU_SIZE type is the generic type for passing sizes to SUAPI service calls. Since sizes are never returned, the application is free to keep sizes however it wants. In particular, the maximum number of messages in a queue could be stored in an unsigned char and likewise for the number of buffers in a memory pool. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -