rem: switch (si->ps.card_type) { case NM2070: regs = (uint32 *)((uint8 *)si->framebuffer + 0x100000); break; case NM2090: case NM2093: regs = (uint32 *)((uint8 *)si->framebuffer + 0x200000); break; }
add: regs = si->clone_bugfix_regs;
context: static status_t init_common(int the_fd) {	status_t result;	nm_get_private_data gpd;		// LOG not available from here to next LOG: NULL si	/* memorize the file descriptor */	fd = the_fd;	/* set the magic number so the driver knows we're for real */	gpd.magic = NM_PRIVATE_DATA_MAGIC;	/* contact driver and get a pointer to the registers and shared data */	result = ioctl(fd, NM_GET_PRIVATE_DATA, &gpd, sizeof(gpd));	if (result != B_OK) goto error0;	/* clone the shared area for our use */	shared_info_area = clone_area(DRIVER_PREFIX " shared", (void **)&si, B_ANY_ADDRESS,		B_READ_AREA | B_WRITE_AREA, gpd.shared_info_area);	if (shared_info_area < 0) {			result = shared_info_area;			goto error0;	}	// LOG is now available, si !NULL	LOG(4,("init_common: logmask 0x%08x, memory %dMB, hardcursor %d, usebios %d\n",		si->settings.logmask, si->settings.memory, si->settings.hardcursor, si->settings.usebios));	/* clone register area(s) */	if (si->ps.card_type < NM2097)	{		/* we can't clone as no register area exists! */		LOG(2,("InitACC: Can't clone register area, integrated in framebuffer!\n"));		switch (si->ps.card_type)		{		case NM2070:			regs = (uint32 *)((uint8 *)si->framebuffer + 0x100000);			break;		case NM2090:		case NM2093:			regs = (uint32 *)((uint8 *)si->framebuffer + 0x200000);			break;		}		/* not used */		regs2 = 0;	}	else 	{ 		/*Check for R4.5.0 and if it is running, use work around*/ 		if (si->use_clone_bugfix) 		{ 			/*check for R4.5.0 bug and attempt to work around*/ 			LOG(2,("InitACC: Found R4.5.0 bug - attempting to work around\n")); 			regs = si->clone_bugfix_regs; 			regs2 = si->clone_bugfix_regs2; 		} 		else 		{			/* clone the memory mapped registers for our use  - does not work on <4.5.2 (but is better this way)*/			regs_area = clone_area(DRIVER_PREFIX " regs", (void **)&regs, B_ANY_ADDRESS,				B_READ_AREA | B_WRITE_AREA, si->regs_area);			if (regs_area < 0)			{				result = regs_area;				goto error1;			}			else			{				regs2_area = clone_area(DRIVER_PREFIX " regs2", (void **)&regs2, B_ANY_ADDRESS,				B_READ_AREA | B_WRITE_AREA, si->regs2_area);				if (regs2_area < 0)				{					result = regs2_area;					goto error2;				}			} 		} 	}	/*FIXME - print dma addresses*/	//LOG(4,("DMA_virtual:%x\tDMA_physical:%x\tDMA_area:%x\n",si->dma_buffer,si->dma_buffer_pci,si->dma_buffer_area));	/* all done */	goto error0;error2:	delete_area(regs_area);error1:	delete_area(shared_info_area);error0:	return result;}