rem: SHOW_FLOW( 4, "page_left=%d", page_left );  cur_len = min( page_left, length );  SHOW_FLOW( 4, "cur_len=%d", cur_len );  err = transfer_PIO_virtcont( device, (char *)virt_addr, cur_len, write, transferred );
context: transfer_PIO_physcont(ide_device_info *device, addr_t phys_addr, 	int length, bool write, int *transferred){	// we must split up chunk into B_PAGE_SIZE blocks as we can map only	// one page into address space at once	while( length > 0 ) {		void *virt_addr;		int page_left, cur_len;		status_t err;		SHOW_FLOW( 4, "Transmitting to/from physical address %x, %d bytes left", (int)phys_addr,			length );		if (map_mainmemory(phys_addr, &virt_addr) != B_OK) {			// ouch: this should never ever happen			set_sense( device, SCSIS_KEY_HARDWARE_ERROR, SCSIS_ASC_INTERNAL_FAILURE );			return B_ERROR;		}		// if chunks starts in the middle of a page, we have even less then		// a page left				page_left = B_PAGE_SIZE - phys_addr % B_PAGE_SIZE;				SHOW_FLOW( 4, "page_left=%d", page_left );				cur_len = min( page_left, length );				SHOW_FLOW( 4, "cur_len=%d", cur_len );				err = transfer_PIO_virtcont( device, (char *)virt_addr, 			cur_len, write, transferred );		if( err != B_OK ) {					unmap_mainmemory( virt_addr );			return err;		}				length -= cur_len;			phys_addr += cur_len;				unmap_mainmemory( virt_addr );	}		return B_OK;}