16 EFI_BLOCK_IO_PROTOCOL_REVISION,
52 BlockIo = &PrivateData->BlockIo;
53 BlockIo2 = &PrivateData->BlockIo2;
54 Media = &PrivateData->Media;
59 BlockIo->
Media = Media;
60 BlockIo2->
Media = Media;
97 IN BOOLEAN ExtendedVerification
139 UINTN NumberOfBlocks;
141 PrivateData = RAM_DISK_PRIVATE_FROM_BLKIO (This);
143 if (MediaId != PrivateData->Media.
MediaId) {
144 return EFI_MEDIA_CHANGED;
147 if (Buffer ==
NULL) {
148 return EFI_INVALID_PARAMETER;
151 if (BufferSize == 0) {
155 if ((BufferSize % PrivateData->Media.
BlockSize) != 0) {
156 return EFI_BAD_BUFFER_SIZE;
159 if (Lba > PrivateData->Media.
LastBlock) {
160 return EFI_INVALID_PARAMETER;
163 NumberOfBlocks = BufferSize / PrivateData->Media.
BlockSize;
164 if ((Lba + NumberOfBlocks - 1) > PrivateData->Media.
LastBlock) {
165 return EFI_INVALID_PARAMETER;
213 UINTN NumberOfBlocks;
215 PrivateData = RAM_DISK_PRIVATE_FROM_BLKIO (This);
217 if (MediaId != PrivateData->Media.
MediaId) {
218 return EFI_MEDIA_CHANGED;
222 return EFI_WRITE_PROTECTED;
225 if (Buffer ==
NULL) {
226 return EFI_INVALID_PARAMETER;
229 if (BufferSize == 0) {
233 if ((BufferSize % PrivateData->Media.
BlockSize) != 0) {
234 return EFI_BAD_BUFFER_SIZE;
237 if (Lba > PrivateData->Media.
LastBlock) {
238 return EFI_INVALID_PARAMETER;
241 NumberOfBlocks = BufferSize / PrivateData->Media.
BlockSize;
242 if ((Lba + NumberOfBlocks - 1) > PrivateData->Media.
LastBlock) {
243 return EFI_INVALID_PARAMETER;
290 IN BOOLEAN ExtendedVerification
343 PrivateData = RAM_DISK_PRIVATE_FROM_BLKIO2 (This);
346 &PrivateData->BlockIo,
352 if (EFI_ERROR (Status)) {
359 if ((Token !=
NULL) && (Token->Event !=
NULL)) {
361 gBS->SignalEvent (Token->Event);
413 PrivateData = RAM_DISK_PRIVATE_FROM_BLKIO2 (This);
416 &PrivateData->BlockIo,
422 if (EFI_ERROR (Status)) {
429 if ((Token !=
NULL) && (Token->Event !=
NULL)) {
431 gBS->SignalEvent (Token->Event);
465 PrivateData = RAM_DISK_PRIVATE_FROM_BLKIO2 (This);
468 return EFI_WRITE_PROTECTED;
474 if ((Token !=
NULL) && (Token->Event !=
NULL)) {
476 gBS->SignalEvent (Token->Event);
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
UINT64 EFIAPI DivU64x32Remainder(IN UINT64 Dividend, IN UINT32 Divisor, OUT UINT32 *Remainder OPTIONAL)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS EFIAPI RamDiskBlkIo2ReadBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI RamDiskBlkIoFlushBlocks(IN EFI_BLOCK_IO_PROTOCOL *This)
EFI_STATUS EFIAPI RamDiskBlkIoWriteBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI RamDiskBlkIoReadBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer)
VOID RamDiskInitBlockIo(IN RAM_DISK_PRIVATE_DATA *PrivateData)
EFI_STATUS EFIAPI RamDiskBlkIo2WriteBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI RamDiskBlkIo2FlushBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN OUT EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS EFIAPI RamDiskBlkIoReset(IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI RamDiskBlkIo2Reset(IN EFI_BLOCK_IO2_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
#define RAM_DISK_DEFAULT_BLOCK_SIZE
EFI_BLOCK_IO_MEDIA * Media
EFI_BLOCK_IO_MEDIA * Media