📄 mbx.h
字号:
/*
* Copyright 2003 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/* "@(#) DSP/BIOS 4.90.270 12-18-03 (barracuda-o04)" */
/*
* ======== mbx.h ========
*
*/
#ifndef MBX_
#define MBX_
#include <que.h>
#include <sem.h>
#include <sys.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct MBX_Obj {
QUE_Obj dataQue; /* message queue */
QUE_Obj freeQue; /* free queue */
SEM_Obj dataSem; /* count = number of messages */
SEM_Obj freeSem; /* count = number of free slots */
Int segid; /* elements are allocated here */
Uns size; /* size of mailbox elements */
Uns length; /* number of elements in mailbox */
} MBX_Obj, *MBX_Handle;
typedef struct MBX_Attrs {
Int segid; /* segment for element allocation */
} MBX_Attrs;
extern MBX_Attrs MBX_ATTRS; /* default attributes */
extern MBX_Handle MBX_create(Uns size, Uns length, MBX_Attrs *attrs);
extern Void MBX_delete(MBX_Handle mbx);
extern Bool MBX_pend(MBX_Handle mbx, Ptr msg, Uns timeout);
extern Bool MBX_post(MBX_Handle mbx, Ptr msg, Uns timeout);
#ifdef __cplusplus
}
#endif /* extern "C" */
#endif /* MBX_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -