mirror of
https://github.com/ipxe/ipxe
synced 2025-12-17 18:11:49 +03:00
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).
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include <byteswap.h>
|
||||
#include <gpxe/scsi.h>
|
||||
#include <gpxe/process.h>
|
||||
#include <gpxe/uaccess.h>
|
||||
#include <gpxe/iscsi.h>
|
||||
|
||||
/** @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 );
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user