software.h 4.42 KB
/************************************************************************
  WHAT:	SOFTWARE TYPEDEFS
  SCCS:	@(#)software.h	1.2 21 Sep 1994
  PTLS: $Id: software.h,v 1.1.1.1 2002/05/02 03:29:13 blythe Exp $
  ENGR:	Project Reality - Evan Y. Wang
   (C):	1994 Silicon Graphics, Inc.
 ************************************************************************/
#ifndef _software_h_
#define _software_h_

/****************************************************************
  UNSIGNED SIGNAL TYPEDEFS.
 ****************************************************************/
typedef	unsigned char		u1;
typedef	unsigned char		u2;
typedef	unsigned char		u3;
typedef	unsigned char		u4;
typedef	unsigned char		u5;
typedef	unsigned char		u6;
typedef	unsigned char		u7;
typedef	unsigned char		u8;
typedef unsigned short int	u9;
typedef unsigned short int	u10;
typedef unsigned short int	u11;
typedef unsigned short int	u12;
typedef unsigned short int	u13;
typedef unsigned short int	u14;
typedef unsigned short int	u15;
typedef unsigned short int	u16;
typedef unsigned long		u17;
typedef unsigned long		u18;
typedef unsigned long		u19;
typedef unsigned long		u20;
typedef unsigned long		u21;
typedef unsigned long		u22;
typedef unsigned long		u23;
typedef unsigned long		u24;
typedef unsigned long		u25;
typedef unsigned long		u26;
typedef unsigned long		u27;
typedef unsigned long		u28;
typedef unsigned long		u29;
typedef unsigned long		u30;
typedef unsigned long		u31;
typedef unsigned long		u32;
typedef unsigned long long	u64;

/****************************************************************
  SIGNED SIGNAL TYPEDEFS.
 ****************************************************************/
typedef	char		s1;
typedef	char		s2;
typedef	char		s3;
typedef	char		s4;
typedef	char		s5;
typedef	char		s6;
typedef	char		s7;
typedef	char		s8;
typedef short int	s9;
typedef short int	s10;
typedef short int	s11;
typedef short int	s12;
typedef short int	s13;
typedef short int	s14;
typedef short int	s15;
typedef short int	s16;
typedef long		s17;
typedef long		s18;
typedef long		s19;
typedef long		s20;
typedef long		s21;
typedef long		s22;
typedef long		s23;
typedef long		s24;
typedef long		s25;
typedef long		s26;
typedef long		s27;
typedef long		s28;
typedef long		s29;
typedef long		s30;
typedef long		s31;
typedef long		s32;

/****************************************************************
  FUNCTION ARRAY TYPEDEF.
 ****************************************************************/
typedef u1   (*PBF)();		/* pointer to boolean function	*/
typedef int  (*PIF)();		/* pointer to integer function	*/
typedef u32  (*PUF)();		/* pointer to u32     function	*/
typedef void (*PVF)();		/* pointer to void    function	*/

/****************************************************************
  UNION DATA TYPEDEF AND OPERATORS.
  Note: This typedef is setup for big endian and 32-bit words.
 ****************************************************************/
typedef union {
    u32	w;		/* word				*/
    struct {		/* union within word		*/
	union {		/* high half-word		*/
	    u16 hw;
	    struct {
		u8 hb;	/* high byte of high half-word	*/
		u8 lb;	/* low  byte of high half-word	*/
	    } u;
	} h;
	union {		/* low half-word		*/
	    u16 hw;
	    struct {
		u8 hb;	/* high byte of low half-word	*/
		u8 lb;	/* low  byte of low half-word	*/
	    } u;
	} l;
    } u;
} UD32;

#define UD32B0(ud)	((ud).u.h.u.hb)
#define UD32B1(ud)	((ud).u.h.u.lb)
#define UD32B2(ud)	((ud).u.l.u.hb)
#define UD32B3(ud)	((ud).u.l.u.lb)
#define UD32H0(ud)	((ud).u.h.hw)
#define UD32H1(ud)	((ud).u.l.hw)
#define UD32WD(ud)	((ud).w)

typedef union {
    u64	dw;		/* 64-bit double word		*/
    struct {
	UD32 h;
	UD32 l;
    } u;
} UD64;

#define UD64B0(ud)	((ud).u.h.u.h.u.hb)
#define UD64B1(ud)	((ud).u.h.u.h.u.lb)
#define UD64B2(ud)	((ud).u.h.u.l.u.hb)
#define UD64B3(ud)	((ud).u.h.u.l.u.lb)
#define UD64B4(ud)	((ud).u.l.u.l.u.lb)
#define UD64B5(ud)	((ud).u.l.u.h.u.hb)
#define UD64B6(ud)	((ud).u.l.u.h.u.lb)
#define UD64B7(ud)	((ud).u.l.u.l.u.hb)
#define UD64H0(ud)	((ud).u.h.u.h.hw)
#define UD64H1(ud)	((ud).u.h.u.l.hw)
#define UD64H2(ud)	((ud).u.l.u.h.hw)
#define UD64H3(ud)	((ud).u.l.u.l.hw)
#define UD64W0(ud)	((ud).u.h.w)
#define UD64W1(ud)	((ud).u.l.w)
#define UD64DW(ud)	((ud).dw)

/****************************************************************
  MISCELLANEOUS STYLISTIC DEFINES.
 ****************************************************************/
#define PRIVATE	static
#define PUBLIC

#ifndef TRUE
#define TRUE	1
#endif

#ifndef FALSE
#define FALSE	0
#endif

#endif