set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(1); 
schedule_timeout_interruptible(1); 
size_dram(emu8000_t *emu){	int i, size;	if (emu->dram_checked)		return;	size = 0;	/* write out a magic number */	snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_WRITE);	snd_emu8000_dma_chan(emu, 1, EMU8000_RAM_READ);	EMU8000_SMALW_WRITE(emu, EMU8000_DRAM_OFFSET);	EMU8000_SMLD_WRITE(emu, UNIQUE_ID1);	snd_emu8000_init_fm(emu); /* This must really be here and not 2 lines back even */	while (size < EMU8000_MAX_DRAM) {		size += 512 * 1024;  /* increment 512kbytes */		/* Write a unique data on the test address.		 * if the address is out of range, the data is written on		 * 0x200000(=EMU8000_DRAM_OFFSET).  Then the id word is		 * changed by this data.		 */		/*snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_WRITE);*/		EMU8000_SMALW_WRITE(emu, EMU8000_DRAM_OFFSET + (size>>1));		EMU8000_SMLD_WRITE(emu, UNIQUE_ID2);		snd_emu8000_write_wait(emu);		/*		 * read the data on the just written DRAM address		 * if not the same then we have reached the end of ram.		 */		/*snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_READ);*/		EMU8000_SMALR_WRITE(emu, EMU8000_DRAM_OFFSET + (size>>1));		/*snd_emu8000_read_wait(emu);*/		EMU8000_SMLD_READ(emu); /* discard stale data  */		if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2)			break; /* we must have wrapped around */		snd_emu8000_read_wait(emu);		/*		 * If it is the same it could be that the address just		 * wraps back to the beginning; so check to see if the		 * initial value has been overwritten.		 */		EMU8000_SMALR_WRITE(emu, EMU8000_DRAM_OFFSET);		EMU8000_SMLD_READ(emu); /* discard stale data  */		if (EMU8000_SMLD_READ(emu) != UNIQUE_ID1)			break; /* we must have wrapped around */		snd_emu8000_read_wait(emu);	}	/* wait until FULL bit in SMAxW register is false */	for (i = 0; i < 10000; i++) {		if ((EMU8000_SMALW_READ(emu) & 0x80000000) == 0)			break;		set_current_state(TASK_INTERRUPTIBLE);		schedule_timeout(1);		if (signal_pending(current))			break;	}	snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_CLOSE);	snd_emu8000_dma_chan(emu, 1, EMU8000_RAM_CLOSE);	snd_printdd("EMU8000 [0x%lx]: %d Kb on-board memory detected\n",		    emu->port1, size/1024);	emu->mem_size = size;	emu->dram_checked = 1;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/8433a509c0eb6bb1f33ce39c82c580b8901619ee/emu8000.c/buggy/sound/isa/sb/emu8000.c