
II//T3ITINTR.0 7JUL06 JCK evt 2 to evt 0 spacing changed to 6 msec
//T3ITINTR.0 11JUN05 JCK FOR -TAG3I (NORDEN) CHANGE MAXCHANNEL:7->2 waitcnt max 10000->100000
/* t8itintr.c 12mar03 JCK BCD version CONNECT TSTOUT<7..0> to EXT<7:0> */
/*b37t8iintr.c 26jun02 JCK. CONNECT TSTOUT<7..0> to EXT<7:0> */
Ili*
P8 <21.48,47,45,43,42,41,25> to J3 pin <26,25,24,23,22,21,19,3> */
/* TST<7..0> generate sliding 1 moving LSB to MSB, so EVTn 1 msec after EVTn-1 */
/* t8iintr.c 20jul01 JCK convert -TAG8 to -TAG8I */
/* t8intr.c 2apr99 JCK tests pci-sync32-tag8 intr generation capability */
II/* connect all ext time tag inputs hi,lo, or to mat to prevent unwanted tags */
/* THIS DEMO CODE MAY HAVE PROBLEMS WORKING WITH IRQ LEVELS 3 or 5 */
typedef unsigned char byte;
#include "t8iregs.h" /* offsets for PCI-SYNCCLOCK regs + flag definitions */
#include "picdef.h" /* addresses for host x86 interrupt ctlrs & vectors */
include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
rinclude <ctype.h>
#include <dos.h>
#include <conio.h>
#include <i86.h>
union REGS regs;
IIunsigned long intcount=0,subsys id_vid;
int BASE,instance=0,any 9050 1()E5,any_9030_10b5;
void interrupt pc intTvoidT;
void setvects(voia);
IIvoid resvects(void);
void i_enable(void);
void i disable(void);
void ( interrupt far *oldvec)()=0;
lint bin (int valueYi
volatile long int c;
volatile char readlMR;
volatile unsigned long int busec,oldbusec,oldthi,oldtlo,t1o,thi,waitcnt;
int xnsec100,1,j,ready70,charcnt,MAXCHANNEL=2,error=0,expectedchannel;
IIint errcnt=0;errchan[10000],intflag=0,passcount=0;
unsigned char Extsts(64];
char IMRMASK,IMRENB[16]={0xff,Oxff,Oxff,Oxff,Oxff,Oxff,Oxff,Oxff,
Oxfe,Oxfd,Oxfb,0xf7,0xef,0xff,Oxff,0x7f};
char VECTOR,IRQVEC[16]={0,0,0,0,0,0,0,0,0x70,0x0A,0x72,0x73,0x74,0,0,0x77};
'rain()
{/* USE PCI BIOS CALLS TO DETERMINE MEM BASE ADDRESS */
do {
regs.h.ah=0x0b1;
regs.h.a1=0x02;
regs.w.cx=0x9030;
regs.w.dx=0x10b5;/* query if device id 9030/vendor id 10b5 is present */
regs.w.si=instance; /* search for 0th, 1st etc. */
int386(0x1a,®s,®s);
printf("9030/10b5 present if 0: %2x bus#: 962x dev/funct: %2x flags: %4x \n",
regs.h.ah,regs.h.bh,regs.h.bl,regs.w.cflag);
any 9030 10b5=regs.h.ah;
if Tany g030 10b5==0)
—{
regs.h.ah=0x0b1;
regs.h.a1=0x0a;
regs.w.di=0x2c; /* query Subsystem ID/ Subsystem Vendor ID*/
int386(0x1a,®s,®s);
printf("Read Subsystem id/vendor id. OK if 0: 962x Subsystem ID/VID: %8x flags: 964x \
regs.h.ah,regs.x.ecx,regs.w.cflag);
subsys_id_vid=regs.x.ecx;
regs.h.ah=0x0b1;
regs.h.a1=0x0a;
regs.w.di=0x18; /* query local address space 0 */
int386(0x1a,®s,®s);
printf("9030 Read PCI base address. OK if 0: %2x base addr: *8x flags: %4x \n",
regs.h.ah,regs.x.ecx,regs.w.cflag);
instance++; /* if wrong subsys_id_vid, try next */
}while} ((any 9030 10b5==0) && (subsys id vid!=0x104210b5));
if ((subsys id via!=0x104210b5) (any_9030 10b5!=0) )
{print!. ("SYNCCLOCK with PLX PCI9030not detected on PCI bus\n");
instance.();
do
{
regs.h.ah=0x0b1;