📄 typedef.h
字号:
/******************************************************************
Copyright (C), UPTI 2003-2004
filename : Typedef.h
description : type define for compatible with root
author : Liuxu
modification : lx create 2003/01/01
********************************************************************/
#ifndef __TYPEDEF_H
#define __TYPEDEF_H
/*#include <timers.h>*/
#include <ioLib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/*将主机的INCLUDE目录拷贝到于target平级的目录下*/
#include "glb_type.h"
#include "Vpl_pub.h"
#define _M_LITTLE_ENDIAN 1 /* intel type */
#define _M_BIG_ENDIAN 2 /* motorola type */
#define DEV_TG 1
#define DEV_AG 2
#define DEV_HPBX 3
#define _M_BYTE_ORDER _M_BIG_ENDIAN
#if 1
#undef htonl /* undef the host=>network long conversion macro */
#undef ntohl /* undef the network=>host long conversion macro */
#undef htons /* undef the host=>network short conversion macro */
#undef ntohs /* undef the network=>host short conversion macro */
#if (_M_BYTE_ORDER == _M_LITTLE_ENDIAN) /* Intel type */
/*-----------------------------------------------------------------*/
/* Change byte order so the least significant byte is stored at */
/* the lowest address. Unsigned to prevent integer overflow on */
/* i960. Big endian cast unsigned for constant handling of vars. */
/*-----------------------------------------------------------------*/
#define htonl(addr) ( (((unsigned long)(addr) & 0x000000FF)<<24) | \
(((unsigned long)(addr) & 0x0000FF00)<<8) | \
(((unsigned long)(addr) & 0x00FF0000)>>8) | \
(((unsigned long)(addr) & 0xFF000000)>>24) )
#define ntohl(addr) htonl(addr)
#define htons(addr) ( (((unsigned short)(addr) & 0x000000FF)<<8) | \
(((unsigned short)(addr) & 0x0000FF00)>>8) )
#define ntohs(addr) htons(addr)
#elif _M_BYTE_ORDER == _M_BIG_ENDIAN /* Motorola type */
#define htonl(a) ((unsigned long)(a))
#define ntohl(a) ((unsigned long)(a))
#define htons(a) ((unsigned short)(a))
#define ntohs(a) ((unsigned short)(a))
#endif
#endif
/*#pragma (1,1,1)*/
#if 0/*ndef CAST*/
#ifdef _ASMLANGUAGE
#define CAST(x)
#else /* _ASMLANGUAGE */
#define CAST(x) (x)
#endif /* _ASMLANGUAGE */
#endif
#ifndef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y)) /* 取两个数中的最大数*/
#endif
#ifndef MIN
#define MIN(x, y) ((x) > (y) ? (y) : (x)) /* 取两个数中的最小数*/
#endif
#ifndef NOERR
#define NOERR (_U32)0x0L
#endif
#ifndef ERR
#define ERR (_U32)(-1)
#endif
#ifndef ON
#define ON (_U8)1
#endif
#ifndef OFF
#define OFF (_U8)0
#endif
#ifndef TRUE
#define TRUE G_TRUE
#endif
#ifndef FALSE
#define FALSE G_FALSE
#endif
#ifndef YES
#define YES (_U32)0x1
#endif
#ifndef NO
#define NO (_U32)0x0L
#endif
#ifndef NULL
#define NULL G_NULL
#endif
#ifndef SUCCESS
#define SUCCESS G_SUCCESS
#endif
#ifndef FAILURE
#define FAILURE G_FAILURE
#endif
typedef void (*PFUN_FREE)(void*);
typedef char * (*PFUN_MALLOC)(_U32);
#define SIZE_32 32
#define SIZE_64 64
#define SIZE_128 128
#define SIZE_256 256
#define SIZE_512 512
#define SIZE_1K 0x400
#define SIZE_2K 0x800
#define SIZE_4K 0x1000
#define SIZE_8K 0x2000
#define SIZE_16K 0x4000
#define SIZE_32K 0x8000
#define SIZE_64K 0x10000
#define SIZE_128K 0x20000
#define SIZE_256K 0x40000
#define SIZE_512K 0x80000
#define SIZE_1M 0x100000
#define SIZE_2M 0x200000
#define SIZE_4M 0x400000
#define SIZE_6M 0x600000
#define SIZE_8M 0x800000
#define SIZE_16M 0x1000000
#define SIZE_32M 0x2000000
#define SIZE_64M 0x4000000
typedef void (* Drv_free)( void *pBlock );
typedef void * (* Drv_alloc)( unsigned long ulSzie );
typedef void (* Drv_Func)(void);
#include "Drv_ErrBook.h"
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -