//////////////////////////////////////////////////////////////////////////////
// Hardware-Specific Macros
//    This file contains the definitions of macros used by the generic
// skeleton that are hardware-specific.
//
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
// Macros ////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
// Vertical blanking interrupt macros.
//    These are called from within the vertical blanking interrupt handler.


// This macro returns nonzero if the card in the present scope caused a
// vertical blanking interrupt.
#define CARD_CAUSED_VB_INTERRUPT ( si->card.regs[GEN_INT_STATUS] & 0x04 )


// This macro should clears the vertical blanking interrupt generated by the
// card in the present scope.
#define CLEAR_VB_INTERRUPT                                          \
  { si->card.regs[GEN_INT_STATUS] = 0x04; }


// This macro enables vertical blanking interrupts for the card in the
// present scope.
#define RESUME_CARD_INTERRUPTS 											\
  { si->card.regs[GEN_INT_CNTL] |= 0x04; /* enable vblank status */		\
    si->card.regs[GEN_INT_STATUS] = 0x04; /* reset current VB status */ }


// This macro disables vertical blanking interrupts for the card in the
// present scope, clearing any interrupts that were pending.
#define DISABLE_CARD_INTERRUPTS                                     \
  { si->card.regs[GEN_INT_CNTL] &= ~0x04; }


// This macro spins until the vertical blanking interval
// occurs. It does *not* use the vertical blanking semaphore, as this
// function is used to trigger that semaphore when a real interrupt handler
// can't be installed.

// The period between interrupts will still slowly get longer,
// but we should get useful test data in the meantime.
#define POLL_FOR_VBI                                                \
	{ while( si->card.regs[GEN_INT_STATUS] & 0x04)					\
	  	spin(100); /* in microseconds*/							\
	}
  
////////////////////////////////////////////////////////
// Function prototype for standard bios rom mapping.
// this is required to read bios revision, card id, and 
// to read crystal clock frequency.
int32 map_bios(DEVICE_INFO *di);


///////////////////////////////////////////////////////////////////
// function prototypes used by hardware specific IOCTL's in driver
///////////////////////////////////////////////////////////////////
int32 map_bios(DEVICE_INFO *di);
int32 unmap_bios(DEVICE_INFO *di);
int32 Bios_scan( SHARED_INFO *si);





// Macros to cause the skeleton driver to call map_bios();
// this is called only at initialization.
#define PROC_ALTERNATE_MEMORY_APPERATURE
#define PROC_ALTERNATE_MEMORY_APPERATURE_FUNC(di) map_bios(di)


//////////////////////////////////////////////////////////////////////////////
// This Is The End Of The File ///////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
