pppd.h

来自「windows系统下实时代码,可以进行底层硬件的实时操作」· C头文件 代码 · 共 63 行

H
63
字号
/*++
 *
 * Copyright (c) 1998-2005, Ardence, Inc.  All rights reserved.
 *
 * Module Name:
 *
 *      Pppd.h
 *
 * Abstract:
 *
 *      This header provides simple macros for Per-Process Private Data (PPPD)
 *		inside a RTDLL.
 *
 * Author:
 *
 *      Lev Zaltsman   3/1/2000
 *
 * Environment:
 *
 *      RTX application (RTSS only). 
 *
 * Revision History:
 *
 *     Initial revision (LDZ)
--*/

//
// Maximum number of RTSS processes (default limit is 10 on RTSS).  Increase if
// your system has additional RTSS process slots.
//
#ifndef	MAX_PROCESSES
#  define	MAX_PROCESSES 10
#endif

//
// Macros to scope private data in the RTDLL (do only once).
//
#define	PPPD_DATA_BEGIN		typedef struct _PppdData {

#define	PPPD_DATA_END		} _PPPD_DATA, *_PPPPD_DATA;

#define	PPPD_ALLOCATE	_PPPD_DATA _PppdBuffer[MAX_PROCESSES];

#define	PPPD_EXTERN extern _PPPD_DATA _PppdBuffer[MAX_PROCESSES];

//
// Macros to use in a RTDLL function to access private data.  PPPD_FUNC_ENTRY
// must be used in the beginning of any function that will use private data.
//
// NOTE: As an optimization, the pointer can be passed as a formal parameter
//       lower level functions.
//
#define	PPPD_PTR			_PPPPD_DATA	_PppdPtr

#define PPPD_FUNC_ENTRY		PPPD_PTR;								\
	  {if ((_PppdPtr = &_PppdBuffer[GetCurrentProcessId()]) >=		\
                      &_PppdBuffer[MAX_PROCESSES])					\
		RtPrintf ("\nPPPD ERROR: Current Process Id is >= MAX_PROCESSES\n");}

#define PPPD(x)				(_PppdPtr->x)


⌨️ 快捷键说明

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