mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-15 15:51:44 +00:00
d48d0fb1bb
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).
44 lines
837 B
C
44 lines
837 B
C
#ifndef _GPXE_BLOCKDEV_H
|
|
#define _GPXE_BLOCKDEV_H
|
|
|
|
/**
|
|
* @file
|
|
*
|
|
* Block devices
|
|
*
|
|
*/
|
|
|
|
#include <gpxe/uaccess.h>
|
|
|
|
/** A block device */
|
|
struct block_device {
|
|
/** Block size */
|
|
size_t blksize;
|
|
/** Total number of blocks */
|
|
uint64_t blocks;
|
|
/**
|
|
* Read block
|
|
*
|
|
* @v blockdev Block device
|
|
* @v block Block number
|
|
* @v count Block count
|
|
* @v buffer Data buffer
|
|
* @ret rc Return status code
|
|
*/
|
|
int ( * read ) ( struct block_device *blockdev, uint64_t block,
|
|
unsigned long count, userptr_t buffer );
|
|
/**
|
|
* Write block
|
|
*
|
|
* @v blockdev Block device
|
|
* @v block Block number
|
|
* @v count Block count
|
|
* @v buffer Data buffer
|
|
* @ret rc Return status code
|
|
*/
|
|
int ( * write ) ( struct block_device *blockdev, uint64_t block,
|
|
unsigned long count, userptr_t buffer );
|
|
};
|
|
|
|
#endif /* _GPXE_BLOCKDEV_H */
|