📄 su_types.h
字号:
typedef unsigned int SU_SIZE;/* The SU_RET_STATUS type is the return type for many SUAPI services containing both the VRTXmc error code and the SUAPI error code enumeration. The bits corresponding to the VRTXmc error code are masked by 0xFF00. The bits corresponding to the SUAPI error code are masked by 0xFF. The SU_ERROR_STATUS type represents just the SUAPI error code.*/typedef INT32 SU_RET_STATUS;typedef INT32 SU_ERROR_STATUS;/* The type SU_EVMASK is a 32 bit integer used to specify events. */typedef unsigned int SU_EVMASK;/* * This mask shows which events in an event group have been allocated for use.*/typedef UINT32 SU_EVENT_ALLOC_MASK;/* SU_EENUM is an enumeration used for SUAPI return status codes. */enumSU_EENUM { SU_OK = 0, /* Successful completion */ SU_EDELETED, /* Resource deleted */ SU_EEMPTY, /* Resource is empty */ SU_EINUSE, /* Resource in use */ SU_EINVFUNC, /* Invalid function */ SU_EINVPARAM, /* Invalid parameter */ SU_EINVTIME, /* Invalid timeout specified */ SU_ENOEXIST, /* Invalid object handle */ SU_ENOMEM, /* Insufficient memory */ SU_ETIMEOUT, /* Timeout occurred before service completed */ SU_ETOOMANY, /* Object resource limit exceeded */ SU_EFULL, /* Resource is full */ SU_EUNIMPLEMENTED, /* Feature not implemented on this platform */ SU_EINVEVENT, /* Event not allocated to calling task */ SU_EOWN, /* Task tried to release mutex it doesn't own */ SU_EINVFLAG, /* Specified flag is unallocated */ SU_EINVLPF=SU_EINVFLAG, /* Specified LP flag is unallocated */ SU_ENOTFOUND, /* Object was not found (suFindName) */ SU_EINVFLGGRP /* Specified flag group is invalid */};/* SU_MINNODE: The base structure which contains the forward and backward * pointers used in the queues implementation. The queue head and message * structures (SU_SUBQUEUE_HEAD and SU_MSG_HDR) are based upon this base * structure. */typedef struct SU_MINNODE{ struct SU_MINNODE * su_n_next; /* Pointer to next node in linked list.*/ struct SU_MINNODE * su_n_prev; /* Pointer to previous node in list. */} SU_MINNODE;/* SU_SUBQUEUE_HEAD: This structure defines the beginning and end of a linked * list which acts as the head of a queue. In the case of priority queues, * each queue will have the same number of these subqueue heads as there are * priorities. In the current implementation, priority queues have 3 subqueue * heads. *//* Note: The SU_SUBQUEUE_HEAD structure cannot have anything inserted before *or in between its minnode members. */typedef struct{ SU_MINNODE * su_q_head; SU_MINNODE * su_q_null; SU_MINNODE * su_q_tailpred;} SU_SUBQUEUE_HEAD;/* SU_QUEUE_METHODS: Queue methods are objects containing pointers to * functions that represent the individual actions to be performed on queues. */typedef void (*SU_QUEUE_ENQUEUE)(SU_QUEUE_HANDLE, SU_MINNODE *);typedef SU_MINNODE * (*SU_QUEUE_DEQUEUE)(SU_QUEUE_HANDLE);typedef void (*SU_QUEUE_RMQUEUE)(SU_QUEUE_HANDLE, SU_RET_STATUS * );typedef struct { SU_QUEUE_ENQUEUE su_qm_enqueue; /* Function for enqueuing */ SU_QUEUE_DEQUEUE su_qm_dequeue; /* Function for dequeuing. */ SU_QUEUE_RMQUEUE su_qm_rmqueue; /* Function for deleting the queue */} SU_QUEUE_METHODS;/* SU_QUEUE: Defines a queue, which contains pointers to the beginning and * end of the queue as well as information required to implement queue * manipulation. */typedef struct SU_QUEUE{ SU_SUBQUEUE_HEAD su_subqueue[SU_NUM_QUEUE_PRIORITIES];/*subqueues*/ UINT32 su_prioritymask; /*keeps status info. for each priority*/ const SU_QUEUE_METHODS *su_qmethods; /* methods for manipulating the different * types of queues. */ char * su_state; /* used to post and pend queue state to a * VRTXmc mailbox */ char * su_pendmb; /* Queue services use VRTXmc mailbox services * to allow atomic test & set on a queue. */ int su_veid; /* VRTXmc event id */ int su_emask; /* event mask, 0 = unallocated entry*/ UINT32 su_qmsgcount; /* total number of messages on the queue */} SU_QUEUE;/* SU_MSG_HDR: Contains the structure for individual message nodes. */typedef struct SU_MSG_HDR{ SU_MINNODE su_minnode; /* this must be first */ SU_PORT_HANDLE replyport; /* send reply to this port */ int reply_logging:1; /* indicates if logging for replies is needed*/ int priority:2; /* priority of message */ int padding:5; /* unused bits */ int length:24; /* message size of data portion */ UINT32 type; /* implementation-dependent message type */ SU_PORT_HANDLE destport; /* port handle of the destination port */} SU_MSG_HDR;/* The SU_AFTER_MSG_HDR structure is used to ensure proper alignment when * creating and accessing a SUAPI message. The offset of the beginning_of_data * field is calculated when skipping over the message header in order to return * a pointer to the usable data portion of a message. */typedef struct SU_AFTER_MSG_HDR{ SU_MSG_HDR su_msg_hdr; union beginning_of_data { INT8 int8; UINT8 uint8; INT16 int16; UINT16 uint16; INT32 int32; UINT32 uint32; INT64 int64; UINT64 uint64; } beginning_of_data;} SU_AFTER_MSG_HDR;/* The SU_SCHED type is used for functions which deal with schedulers which maintain a state or status information. */typedef void SU_SCHED;/* The type SU_VERSION holds the version information returned from su_version(). */typedef const struct{ unsigned short su_suapi_version; unsigned char su_rtos;} SU_VERSION;/* The SU_PORT_HANDLE_STRUCT structure contains all the information relating to a port.*/typedef struct SU_PORT_HANDLE_STRUCT{ UINT8 port_type; int logging_enabled : 1; int routing_mode : 2; int port_pad : 5; /* to explicitly use all the eight bits. */ UINT16 port_id; union { SU_QUEUE_HANDLE qhandle; } port_transport;} SU_PORT_HANDLE_STRUCT;/* SU_FLAGGROUP_HANDLE identifies an allocated flag group */typedef UINT32 SU_FLAGGROUP_HANDLE;/* SU_FLAG_HANDLE identifies an allocated flag*/typedef UINT32 SU_FLAG_HANDLE;/* handle type used to identify low power flags */typedef SU_FLAG_HANDLE SU_LOWPWR_HANDLE;/***************** MACRO DEFINITIONS *****************************************//***************** RTOS SPECIFIC *********************************************//***************** SUAPI SPECIFIC ********************************************//* This macro makes a bit mask with the bit indicated by the parameter index set to 1. It can be used to set a bit in an unsigned bit array to the value of 1 by logically or'ing the mask to the appropriate word in the array. This macro starts filling in the bit array from MSB to LSB to facilitate use of the find first bit (ff1) M稢ORE instruction. */#define SU_BIT_ONE_MASK(index) \ (((UINT32) 1) << (SU_UINT32_BITS - (index) - 1))/* This macro makes a bit mask with the bit indicated by the parameter index set to 0. It can be used to set a bit in an unsigned bit array to the value of 0 by logically and'ing the mask to the appropriate word in the array. */#define SU_BIT_ZERO_MASK(index) (~ SU_BIT_ONE_MASK(index))#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -