From d48d0fb1bb53262bf44a03dbe8388529f1566a1c Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 19 May 2006 15:06:51 +0000 Subject: Add the concept of a "user pointer" (similar to the void __user * in the kernel), which encapsulates the information needed to refer to an external buffer. Under normal operation, this can just be a void * equivalent, but under -DKEEP_IT_REAL it would be a segoff_t equivalent. Use this concept to avoid the need for bounce buffers in int13.c, which reduces memory usage and opens up the possibility of using multi-sector reads. Extend the block-device API and the SCSI block device implementation to support multi-sector reads. Update iscsi.c to use user buffers. Move the obsolete portions of realmode.h to old_realmode.h. MS-DOS now boots an order of magnitude faster over iSCSI (~10 seconds from power-up to C:> prompt in bochs). --- src/net/tcp/iscsi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/net/tcp/iscsi.c') diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c index 633c895c..d7c4b120 100644 --- a/src/net/tcp/iscsi.c +++ b/src/net/tcp/iscsi.c @@ -24,6 +24,7 @@ #include #include #include +#include #include /** @file @@ -130,7 +131,7 @@ static void iscsi_rx_data_in ( struct iscsi_session *iscsi, void *data, assert ( iscsi->command != NULL ); assert ( iscsi->command->data_in != NULL ); assert ( ( offset + len ) <= iscsi->command->data_in_len ); - memcpy ( ( iscsi->command->data_in + offset ), data, len ); + copy_to_user ( iscsi->command->data_in, offset, data, len ); /* Record SCSI status, if present */ if ( data_in->flags & ISCSI_DATA_FLAG_STATUS ) @@ -234,7 +235,11 @@ static void iscsi_tx_data_out ( struct iscsi_session *iscsi ) { assert ( iscsi->command->data_out != NULL ); assert ( ( offset + len ) <= iscsi->command->data_out_len ); - tcp_send ( &iscsi->tcp, iscsi->command->data_out + offset, len ); + if ( len > tcp_buflen ) + len = tcp_buflen; + copy_from_user ( tcp_buffer, iscsi->command->data_out, offset, len ); + + tcp_send ( &iscsi->tcp, tcp_buffer, len ); } /**************************************************************************** -- cgit