⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fntable_types.h

📁 SOS操作系统用于无线传感器网络节点的源代码
💻 H
字号:
#ifndef _FNTABLE_TYPES_H_
#define _FNTABLE_TYPES_H_

/**
 * @brief function control block
 *
 * For provider: ptr points to real implementation
 *               proto stores function prototype
 *               pid is module ID
 *               fid is function ID
 *
 * For static user: ptr is NULL
 *                  proto stores function prototype
 *                  pid is module ID of provider
 *                  fid is function ID of provider
 *
 * For dynamic user: ptr is NULL
 *                  proto stores function prototype
 *                  pid is RUNTIME_PID
 *                  fid is RUNTIME_FID
 *
 * NOTE: when modifying this structure, please keep it even size.
 * The purpose is to keep func_cb align in 16 bits.
 */


#define RUNTIME_FID    255
#define RUNTIME_PID    NULL_PID
// NOTE: PLEASE MAKE SURE THAT THIS STRUCTURE
// IS WORD ALIGNED.
typedef struct func_cb {
	void *ptr;        //! function pointer
	uint8_t proto[4]; //! function prototype
	uint8_t pid;      //! function PID
	uint8_t fid;      //! function ID
} func_cb_t;


/**
 * @brief SOS Dynamic Function Call
 */
//#ifndef QUALNET_PLATFORM
//#define SOS_CALL(fnptrptr,type, args...)  \
//((type)(sos_read_header_ptr(fnptrptr, 0)))((fnptrptr), ##args)
//#else
//! XXX broken
//#define SOS_CALL(fnptrptr, prototype,...)  (*this.*(*(fnptrptr)))(prototype, ##args)
//#endif


#ifdef QUALNET_PLATFORM
typedef int8_t (SOSKernel::*fn_ptr_t)(void);
#else
typedef int8_t (*fn_ptr_t)(void);
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -