www.pudn.com > ScriptsSample.zip > GEN_TOOL.H
/*************************************************************************** * * * Copyright 1995 Symbios Logic Incorporated. All rights reserved. * * * * This software was written by Symbios Logic Inc. to develop and test new * * products. Symbios Logic assumes no liability for its use. This software* * is released to the public domain to illustrate certain programming * * techniques for testing the 53c8xx chips * * * ***************************************************************************/ /* Name: GEN_TOOL.H * Title: Validation test code gen_tool.c header * $Workfile: $ * $Revision: $ * $Modtime: $ * Programmer: Symbios Logic * Creation Date: 11/29/95 * * Version History * --------------- * * Date Who? Description * -------- ---- ------------------------------------------------------- #BeginRevision * 03/06/96 SYM Documented RMWon/off macros #EndRevision * * 11/29/95 SYM Initial Revision. * #BeginDescription * * This file contains structures and #defines used by the GEN_TOOL.C source * file. * #EndDescription * *------------------------------------------------------------------------- * * $Header: $ * */ #include "valtypes.h" /* Used in Writelog function to indicate a basic log entry */ #define LOG_BASIC 0 /* Used in Writelog function to indicate a detail log entry */ #define LOG_DETAIL 1 /* Used in Writelog function to indicate a PASSing test log entry */ #define LOG_PASS 0 /* Used in Writelog function to indicate a FAILing test log entry */ #define LOG_FAIL 1 /* Macro Functions */ /****************************************************************************** Function: RMWon Purpose: Used to turn on a bits in an 8 bit register Input: IO port address and mask indicating which bits to turn on 1 indicating turn bit on and 0 indicating leave bit alone. Output: None Assumptions: That the IO port actually exists Restrictions: Although IO_Addr is defined as a VULONG it must not exceed 16 bits in length as this is the maximum IO address the X86 archtecture can produce Other functions called: IOWrite8 and IORead8 to write and read to the io port ******************************************************************************/ #define RMWon(reg, value) IOWrite8(reg, IORead8(reg) | value) /****************************************************************************** Function: RMWoff Purpose: Used to turn off a bits in an 8 bit register Input: IO port address and mask indicating which bits to turn off 1 indicating turn bit off and 0 indicating leave bit alone. Output: None Assumptions: That the IO port actually exists Restrictions: Although IO_Addr is defined as a VULONG it must not exceed 16 bits in length as this is the maximum IO address the X86 archtecture can produce Other functions called: IOWrite8 and IORead8 to write and read to the io port ******************************************************************************/ #define RMWoff(reg, value) IOWrite8(reg, IORead8(reg) & ~value) /* function prototypes */ extern VULONG getPhysAddr(void far * addr); extern VUBYTE IORead8(VULONG IO_Addr); extern void IOWrite8(VULONG IO_Addr, VUBYTE value); extern VULONG IORead32(VULONG IO_Addr); extern void IOWrite32(VULONG IO_Addr, VULONG value); extern void far *ByteAlignBuffer(void far *buffer, VINT alignment); extern void far *CacheAlignBuffer(void far *buffer, VINT cls, VINT offset); extern void InitBuffer(VUBYTE far *buffer, VUINT size, VINT operation, VUBYTE fill_val); extern VULONG Get_Time(void); extern VINT HasTimeElapsed(VULONG StartTime, VINT Seconds); extern VINT WriteLog(VINT P_F, VINT B_D, VCHAR *Str1, VCHAR *Str2); extern VINT VDSActive( void ); /* global ptr for the log file name */ /* didn't really want to do this but to make the WriteLog function work */ /* anywhere without having to pass the flags structure everywhere is was */ /* necessary, this is the only global passed from one file to another */ extern VCHAR *logfilename_ptr;