/*
 * Copyright (c) 2003 Linuxant inc.
 * Copyright (c) 2001-2003 Conexant Systems, Inc.
 *
 * NOTE: The use and distribution of this software is governed by the terms in
 * the file LICENSE, which is included in the package. You must read this and
 * agree to these terms before using or distributing this software.
 *
 */
#ifndef __LINUX_RES_H
#define __LINUX_RES_H

#ifdef __cplusplus
extern "C" {
#endif

typedef BOOL  (*LINUXPMCB)(PVOID inst);

typedef struct {
	LINUXPMCB SuspendOKCB;
	PVOID SuspendOKInst;
	LINUXPMCB SuspendCB;
	PVOID SuspendInst;
	LINUXPMCB ResumeCB;
	PVOID ResumeInst;
} LINUX_PM_CONFIG, *PLINUX_PM_CONFIG;


BOOL	LinuxGetHwPciRes(void **pPciDev, unsigned long *pbaseaddr0, 
						     unsigned long *pbaseaddr1, unsigned short DeviceId, unsigned short VendorId);
void *  LinuxInitPowerManagement(void *pPciDev, PLINUX_PM_CONFIG pPmConf);
void    LinuxTermPowerManagement(void *pmdev);
BOOL	LinuxHookInterrupt(void *pPciDev, void (*isr)(int irq, void *devidp, void *unused),void *devid);
void	LinuxUnhookInterrupt(void *pPciDev, void *devid);
void	*LinuxMapPhys(unsigned long offset, unsigned long size);
void	LinuxWritel(void *addr, unsigned int dwVal);
void	LinuxWritew(void *addr, unsigned short wVal);
unsigned char LinuxReadb(void *addr);
unsigned short LinuxReadw(void *addr);
unsigned int LinuxReadl(void *addr);
unsigned char LinuxIoReadb(unsigned int port);
unsigned short LinuxIoReadw(unsigned int port);
unsigned int  LinuxIoReadl(unsigned int port);
void	LinuxIoWriteb(unsigned int port, unsigned char  bVal);
void	LinuxIoWritew(unsigned int port, unsigned short wVal);
void	LinuxIoWritel(unsigned int port, unsigned int   dwVal);
void LinuxPciReadConfigdw(void *pPciDev, unsigned char Offset, unsigned long *pVal);
void LinuxPciReadConfigw(void *pPciDev, unsigned char Offset, unsigned short *pVal);
void LinuxPciReadConfigb(void *pPciDev, unsigned char Offset, unsigned char *pVal);
void LinuxPciWriteConfigdw(void *pPciDev, unsigned char Offset, unsigned long Val);
void LinuxPciWriteConfigw(void *pPciDev, unsigned char Offset, unsigned short Val);
void LinuxPciWriteConfigb(void *pPciDev, unsigned char Offset, unsigned char Val);
unsigned long crit_section_start(void);
void crit_section_end(unsigned long flags);
unsigned long LinuxCalcCpuRate(void);

#ifdef __cplusplus
}
#endif

#endif
