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

📄 macros.h

📁 VRTX 商用嵌入式实时操作系统
💻 H
字号:
/***************************************************************************
*
*               Copyright (c) 1993 READY SYSTEMS CORPORATION.
*
*       All rights reserved. READY SYSTEMS' source code is an unpublished
*       work and the use of a copyright notice does not imply otherwise.
*       This source code contains confidential, trade secret material of
*       READY SYSTEMS. Any attempt or participation in deciphering, decoding,
*       reverse engineering or in any way altering the source code is
*       strictly prohibited, unless the prior written consent of
*       READY SYSTEMS is obtained.
*
*
*       Module Name:            macros.h
*
*       Identification:         @(#) 1.5 macros.h
*
*       Date:                   1/10/94  11:22:37
*
****************************************************************************
*/

/*
 RCS header identifier - $Id: macros.h,v 1.3 1993/10/05 18:08:12 robert Exp $
*/
/*
 * Copyrighted as an unpublished work.
 * (c) Copyright 1991-1993 Lachman Technology, Incorporated
 * All rights reserved.
 * 
 * RESTRICTED RIGHTS
 * 
 * These programs are supplied under a license.  They may be used,
 * disclosed, and/or copied only as permitted under such license
 * agreement.  Any copy must contain the above copyright notice and
 * this restricted rights notice.  Use, copying, and/or disclosure
 * of the programs is strictly prohibited unless otherwise provided
 * in the license agreement.
 */
#ifndef _H_MACROS
#define _H_MACROS

#ifdef __cplusplus
extern "C" {
#endif

#define FP_SEG(fp) (*((unsigned int *)&(fp)+1))
#define FP_OFF(fp) (*((unsigned int *)&(fp)))
#define FP_POFF(fp) (*((unsigned int *)&(fp)) & 0xf)

#define FP_NULL		((char *)0)
#ifndef NULL
#define NULL		0
#endif /* NULL */

#define NBPP		16		/* Number of bytes per paragraph */
#define NBPDW		 4		/* Number of bytes per double word */

#define NB2P(nb)	((nb)>>4)	/* Convert bytes to paragraphs */
#define NB2DW(nb)	((nb)>>2)	/* Convert bytes to double words */

#define FP_NORM(fp)	((char *)((((unsigned long)(fp) & 0xffff0000) +   \
				       (((unsigned long)(fp) & 0xfff0)<<12)) | \
				         (unsigned long)(fp) & 0xf))

#define FP_PALIGN(fp)	((char *)((unsigned long)(fp) & 0xffff ?	       \
				 ((unsigned long)(fp) & 0xffff0000) +	       \
				(((unsigned long)(fp) & 0xfff0) << 12) +       \
				                                   0x10000 :   \
				((unsigned long)(fp))))

#define FP_DALIGN(fp)	((char *)((unsigned long)(fp) & 0x3 ? \
				((unsigned long)(fp)+3) & ~0x3 : \
				((unsigned long)(fp))))

#define SIZE_DALIGN(s)	 (((long)(s) + 3) & ~3)
#define SIZE_PALIGN(s)	 (((long)(s) + (NBPP-1)) & ~(NBPP-1))

#define FP2ADR(fp)	(((unsigned long)FP_SEG(fp) << 4) + FP_OFF(fp))

#define ADR2FP(a)	\
	((char *)(((long)(a) & 0xf) | (((long)(a) & 0xfffffff0) << 12)))

#define FP_DIFF(p1,p2)	(((long)(FP_SEG(p1) - FP_SEG(p2)) << 4) +  \
				 FP_OFF(p1) - FP_OFF(p2))

#define FP_MAKE(seg, off)	((char *) \
				       ((((unsigned long)(seg)) << 16) | (off)))

#define FD_NULL		((fhdl_t)-1)
#define FD_STDIN	((fhdl_t)0)
#define FD_STDOUT	((fhdl_t)1)
#define FD_STDERR	((fhdl_t)2)

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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