/* * Check chipset's NO_REBOOT bit */ 
 /* Check chipset's NO_REBOOT bit */ 
static unsigned char __init i8xx_tco_getdevice (void){	struct pci_dev *dev = NULL;	u8 val1, val2;	u16 badr;	/*	 *      Find the PCI device	 */	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {		if (pci_match_id(i8xx_tco_pci_tbl, dev)) {			i8xx_tco_pci = dev;			break;		}	}	if (i8xx_tco_pci) {		/*		 *      Find the ACPI base I/O address which is the base		 *      for the TCO registers (TCOBASE=ACPIBASE + 0x60)		 *      ACPIBASE is bits [15:7] from 0x40-0x43		 */		pci_read_config_byte (i8xx_tco_pci, 0x40, &val1);		pci_read_config_byte (i8xx_tco_pci, 0x41, &val2);		badr = ((val2 << 1) | (val1 >> 7)) << 7;		ACPIBASE = badr;		/* Something's wrong here, ACPIBASE has to be set */		if (badr == 0x0001 || badr == 0x0000) {			printk (KERN_ERR PFX "failed to get TCOBASE address\n");			return 0;		}		/*		 * Check chipset's NO_REBOOT bit		 */		pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1);		if (val1 & 0x02) {			val1 &= 0xfd;			pci_write_config_byte (i8xx_tco_pci, 0xd4, val1);			pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1);			if (val1 & 0x02) {				printk (KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");				return 0;	/* Cannot reset NO_REBOOT bit */			}		}		/* Set the TCO_EN bit in SMI_EN register */		if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) {			printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",				SMI_EN + 1);			return 0;		}		val1 = inb (SMI_EN + 1);		val1 &= 0xdf;		outb (val1, SMI_EN + 1);		release_region (SMI_EN + 1, 1);		return 1;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/01df0e3a79d3913df178e9a1047ade425a7c118f/i8xx_tco.c/buggy/drivers/char/watchdog/i8xx_tco.c