Code scrub for IdeBusDxe driver and PeiS3Lib.(undergoing)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8609 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -96,7 +96,7 @@ ATAIdentify (
|
|||||||
//
|
//
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
|
|
||||||
IdeDev->pIdData = AtaIdentifyPointer;
|
IdeDev->IdData = AtaIdentifyPointer;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Print ATA Module Name
|
// Print ATA Module Name
|
||||||
@ -173,7 +173,7 @@ ATAIdentify (
|
|||||||
//
|
//
|
||||||
// Make sure the pIdData will not be freed again.
|
// Make sure the pIdData will not be freed again.
|
||||||
//
|
//
|
||||||
IdeDev->pIdData = NULL;
|
IdeDev->IdData = NULL;
|
||||||
|
|
||||||
return EFI_DEVICE_ERROR;
|
return EFI_DEVICE_ERROR;
|
||||||
}
|
}
|
||||||
@ -212,11 +212,11 @@ AtaAtapi6Identify (
|
|||||||
EFI_LBA Capacity;
|
EFI_LBA Capacity;
|
||||||
EFI_IDENTIFY_DATA *Atapi6IdentifyStruct;
|
EFI_IDENTIFY_DATA *Atapi6IdentifyStruct;
|
||||||
|
|
||||||
if (IdeDev->pIdData == NULL) {
|
if (IdeDev->IdData == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
Atapi6IdentifyStruct = IdeDev->pIdData;
|
Atapi6IdentifyStruct = IdeDev->IdData;
|
||||||
|
|
||||||
if ((Atapi6IdentifyStruct->AtapiData.cmd_set_support_83 & (BIT15 | BIT14)) != 0x4000) {
|
if ((Atapi6IdentifyStruct->AtapiData.cmd_set_support_83 & (BIT15 | BIT14)) != 0x4000) {
|
||||||
//
|
//
|
||||||
@ -282,11 +282,11 @@ PrintAtaModuleName (
|
|||||||
IN IDE_BLK_IO_DEV *IdeDev
|
IN IDE_BLK_IO_DEV *IdeDev
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (IdeDev->pIdData == NULL) {
|
if (IdeDev->IdData == NULL) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
SwapStringChars (IdeDev->ModelName, IdeDev->pIdData->AtaData.ModelName, 40);
|
SwapStringChars (IdeDev->ModelName, IdeDev->IdData->AtaData.ModelName, 40);
|
||||||
IdeDev->ModelName[40] = 0x00;
|
IdeDev->ModelName[40] = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1779,13 +1779,13 @@ AtaSMARTSupport (
|
|||||||
//
|
//
|
||||||
// Detect if the device supports S.M.A.R.T.
|
// Detect if the device supports S.M.A.R.T.
|
||||||
//
|
//
|
||||||
if ((IdeDev->pIdData->AtaData.command_set_supported_83 & 0xc000) != 0x4000) {
|
if ((IdeDev->IdData->AtaData.command_set_supported_83 & 0xc000) != 0x4000) {
|
||||||
//
|
//
|
||||||
// Data in word 82 is not valid (bit15 shall be zero and bit14 shall be to one)
|
// Data in word 82 is not valid (bit15 shall be zero and bit14 shall be to one)
|
||||||
//
|
//
|
||||||
return ;
|
return ;
|
||||||
} else {
|
} else {
|
||||||
if ((IdeDev->pIdData->AtaData.command_set_supported_82 & 0x0001) != 0x0001) {
|
if ((IdeDev->IdData->AtaData.command_set_supported_82 & 0x0001) != 0x0001) {
|
||||||
//
|
//
|
||||||
// S.M.A.R.T is not supported by the device
|
// S.M.A.R.T is not supported by the device
|
||||||
//
|
//
|
||||||
@ -1921,12 +1921,12 @@ AtaEnableLongPhysicalSector (
|
|||||||
EFI_ATA_IDENTIFY_DATA *AtaIdentifyData;
|
EFI_ATA_IDENTIFY_DATA *AtaIdentifyData;
|
||||||
UINT16 PhyLogicSectorSupport;
|
UINT16 PhyLogicSectorSupport;
|
||||||
|
|
||||||
ASSERT (IdeDev->pIdData != NULL);
|
ASSERT (IdeDev->IdData != NULL);
|
||||||
//
|
//
|
||||||
// Only valid for ATA device
|
// Only valid for ATA device
|
||||||
//
|
//
|
||||||
AtaIdentifyData = (EFI_ATA_IDENTIFY_DATA *) &IdeDev->pIdData->AtaData;
|
AtaIdentifyData = (EFI_ATA_IDENTIFY_DATA *) &IdeDev->IdData->AtaData;
|
||||||
if (AtaIdentifyData->config & 0x8000) {
|
if ((AtaIdentifyData->config & 0x8000) != 0) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
PhyLogicSectorSupport = AtaIdentifyData->phy_logic_sector_support;
|
PhyLogicSectorSupport = AtaIdentifyData->phy_logic_sector_support;
|
||||||
@ -1939,7 +1939,7 @@ AtaEnableLongPhysicalSector (
|
|||||||
//
|
//
|
||||||
// Check whether one physical block contains multiple physical blocks
|
// Check whether one physical block contains multiple physical blocks
|
||||||
//
|
//
|
||||||
if (PhyLogicSectorSupport & 0x2000) {
|
if ((PhyLogicSectorSupport & 0x2000) != 0) {
|
||||||
IdeDev->BlkIo.Media->LogicalBlocksPerPhysicalBlock =
|
IdeDev->BlkIo.Media->LogicalBlocksPerPhysicalBlock =
|
||||||
(UINT32) (1 << (PhyLogicSectorSupport & 0x000f));
|
(UINT32) (1 << (PhyLogicSectorSupport & 0x000f));
|
||||||
//
|
//
|
||||||
@ -1954,7 +1954,7 @@ AtaEnableLongPhysicalSector (
|
|||||||
// Check logical block size
|
// Check logical block size
|
||||||
//
|
//
|
||||||
IdeDev->BlkIo.Media->BlockSize = 0x200;
|
IdeDev->BlkIo.Media->BlockSize = 0x200;
|
||||||
if (PhyLogicSectorSupport & 0x1000) {
|
if ((PhyLogicSectorSupport & 0x1000) != 0) {
|
||||||
IdeDev->BlkIo.Media->BlockSize = (UINT32) (
|
IdeDev->BlkIo.Media->BlockSize = (UINT32) (
|
||||||
((AtaIdentifyData->logic_sector_size_hi << 16) |
|
((AtaIdentifyData->logic_sector_size_hi << 16) |
|
||||||
AtaIdentifyData->logic_sector_size_lo) * sizeof (UINT16)
|
AtaIdentifyData->logic_sector_size_lo) * sizeof (UINT16)
|
||||||
|
@ -259,7 +259,7 @@ ATAPIIdentify (
|
|||||||
return EFI_DEVICE_ERROR;
|
return EFI_DEVICE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
IdeDev->pIdData = AtapiIdentifyPointer;
|
IdeDev->IdData = AtapiIdentifyPointer;
|
||||||
PrintAtaModuleName (IdeDev);
|
PrintAtaModuleName (IdeDev);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -267,22 +267,22 @@ ATAPIIdentify (
|
|||||||
//
|
//
|
||||||
Status = AtapiInquiry (IdeDev);
|
Status = AtapiInquiry (IdeDev);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
gBS->FreePool (IdeDev->pIdData);
|
gBS->FreePool (IdeDev->IdData);
|
||||||
//
|
//
|
||||||
// Make sure the pIdData will not be freed again.
|
// Make sure the pIdData will not be freed again.
|
||||||
//
|
//
|
||||||
IdeDev->pIdData = NULL;
|
IdeDev->IdData = NULL;
|
||||||
return EFI_DEVICE_ERROR;
|
return EFI_DEVICE_ERROR;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Get media removable info from INQUIRY data.
|
// Get media removable info from INQUIRY data.
|
||||||
//
|
//
|
||||||
IdeDev->BlkIo.Media->RemovableMedia = (UINT8) ((IdeDev->pInquiryData->RMB & 0x80) == 0x80);
|
IdeDev->BlkIo.Media->RemovableMedia = (UINT8) ((IdeDev->InquiryData->RMB & 0x80) == 0x80);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Identify device type via INQUIRY data.
|
// Identify device type via INQUIRY data.
|
||||||
//
|
//
|
||||||
switch (IdeDev->pInquiryData->peripheral_type & 0x1f) {
|
switch (IdeDev->InquiryData->peripheral_type & 0x1f) {
|
||||||
|
|
||||||
//
|
//
|
||||||
// Magnetic Disk
|
// Magnetic Disk
|
||||||
@ -338,13 +338,13 @@ ATAPIIdentify (
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
IdeDev->Type = IdeUnknown;
|
IdeDev->Type = IdeUnknown;
|
||||||
gBS->FreePool (IdeDev->pIdData);
|
gBS->FreePool (IdeDev->IdData);
|
||||||
gBS->FreePool (IdeDev->pInquiryData);
|
gBS->FreePool (IdeDev->InquiryData);
|
||||||
//
|
//
|
||||||
// Make sure the pIdData and pInquiryData will not be freed again.
|
// Make sure the pIdData and pInquiryData will not be freed again.
|
||||||
//
|
//
|
||||||
IdeDev->pIdData = NULL;
|
IdeDev->IdData = NULL;
|
||||||
IdeDev->pInquiryData = NULL;
|
IdeDev->InquiryData = NULL;
|
||||||
return EFI_DEVICE_ERROR;
|
return EFI_DEVICE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,13 +355,13 @@ ATAPIIdentify (
|
|||||||
|
|
||||||
IdeDev->SenseData = AllocatePool (IdeDev->SenseDataNumber * sizeof (ATAPI_REQUEST_SENSE_DATA));
|
IdeDev->SenseData = AllocatePool (IdeDev->SenseDataNumber * sizeof (ATAPI_REQUEST_SENSE_DATA));
|
||||||
if (IdeDev->SenseData == NULL) {
|
if (IdeDev->SenseData == NULL) {
|
||||||
gBS->FreePool (IdeDev->pIdData);
|
gBS->FreePool (IdeDev->IdData);
|
||||||
gBS->FreePool (IdeDev->pInquiryData);
|
gBS->FreePool (IdeDev->InquiryData);
|
||||||
//
|
//
|
||||||
// Make sure the pIdData and pInquiryData will not be freed again.
|
// Make sure the pIdData and pInquiryData will not be freed again.
|
||||||
//
|
//
|
||||||
IdeDev->pIdData = NULL;
|
IdeDev->IdData = NULL;
|
||||||
IdeDev->pInquiryData = NULL;
|
IdeDev->InquiryData = NULL;
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,7 +423,7 @@ AtapiInquiry (
|
|||||||
return EFI_DEVICE_ERROR;
|
return EFI_DEVICE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
IdeDev->pInquiryData = InquiryData;
|
IdeDev->InquiryData = InquiryData;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1368,14 +1368,14 @@ ReleaseIdeResources (
|
|||||||
IdeBlkIoDevice->Cache = NULL;
|
IdeBlkIoDevice->Cache = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IdeBlkIoDevice->pIdData != NULL) {
|
if (IdeBlkIoDevice->IdData != NULL) {
|
||||||
gBS->FreePool (IdeBlkIoDevice->pIdData);
|
gBS->FreePool (IdeBlkIoDevice->IdData);
|
||||||
IdeBlkIoDevice->pIdData = NULL;
|
IdeBlkIoDevice->IdData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IdeBlkIoDevice->pInquiryData != NULL) {
|
if (IdeBlkIoDevice->InquiryData != NULL) {
|
||||||
gBS->FreePool (IdeBlkIoDevice->pInquiryData);
|
gBS->FreePool (IdeBlkIoDevice->InquiryData);
|
||||||
IdeBlkIoDevice->pInquiryData = NULL;
|
IdeBlkIoDevice->InquiryData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IdeBlkIoDevice->ControllerNameTable != NULL) {
|
if (IdeBlkIoDevice->ControllerNameTable != NULL) {
|
||||||
|
@ -506,7 +506,7 @@ AtaSoftReset (
|
|||||||
|
|
||||||
@param IdeBlkIoDevice TODO: add argument description
|
@param IdeBlkIoDevice TODO: add argument description
|
||||||
@param MediaId TODO: add argument description
|
@param MediaId TODO: add argument description
|
||||||
@param LBA TODO: add argument description
|
@param Lba TODO: add argument description
|
||||||
@param BufferSize TODO: add argument description
|
@param BufferSize TODO: add argument description
|
||||||
@param Buffer TODO: add argument description
|
@param Buffer TODO: add argument description
|
||||||
|
|
||||||
@ -517,7 +517,7 @@ EFI_STATUS
|
|||||||
AtaBlkIoReadBlocks (
|
AtaBlkIoReadBlocks (
|
||||||
IN IDE_BLK_IO_DEV *IdeBlkIoDevice,
|
IN IDE_BLK_IO_DEV *IdeBlkIoDevice,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA LBA,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
);
|
);
|
||||||
@ -527,7 +527,7 @@ AtaBlkIoReadBlocks (
|
|||||||
|
|
||||||
@param IdeBlkIoDevice TODO: add argument description
|
@param IdeBlkIoDevice TODO: add argument description
|
||||||
@param MediaId TODO: add argument description
|
@param MediaId TODO: add argument description
|
||||||
@param LBA TODO: add argument description
|
@param Lba TODO: add argument description
|
||||||
@param BufferSize TODO: add argument description
|
@param BufferSize TODO: add argument description
|
||||||
@param Buffer TODO: add argument description
|
@param Buffer TODO: add argument description
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ EFI_STATUS
|
|||||||
AtaBlkIoWriteBlocks (
|
AtaBlkIoWriteBlocks (
|
||||||
IN IDE_BLK_IO_DEV *IdeBlkIoDevice,
|
IN IDE_BLK_IO_DEV *IdeBlkIoDevice,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA LBA,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
);
|
);
|
||||||
@ -751,7 +751,7 @@ AtapiSoftReset (
|
|||||||
|
|
||||||
@param IdeBlkIoDevice TODO: add argument description
|
@param IdeBlkIoDevice TODO: add argument description
|
||||||
@param MediaId TODO: add argument description
|
@param MediaId TODO: add argument description
|
||||||
@param LBA TODO: add argument description
|
@param Lba TODO: add argument description
|
||||||
@param BufferSize TODO: add argument description
|
@param BufferSize TODO: add argument description
|
||||||
@param Buffer TODO: add argument description
|
@param Buffer TODO: add argument description
|
||||||
|
|
||||||
@ -762,7 +762,7 @@ EFI_STATUS
|
|||||||
AtapiBlkIoReadBlocks (
|
AtapiBlkIoReadBlocks (
|
||||||
IN IDE_BLK_IO_DEV *IdeBlkIoDevice,
|
IN IDE_BLK_IO_DEV *IdeBlkIoDevice,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA LBA,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
);
|
);
|
||||||
@ -772,7 +772,7 @@ AtapiBlkIoReadBlocks (
|
|||||||
|
|
||||||
@param IdeBlkIoDevice TODO: add argument description
|
@param IdeBlkIoDevice TODO: add argument description
|
||||||
@param MediaId TODO: add argument description
|
@param MediaId TODO: add argument description
|
||||||
@param LBA TODO: add argument description
|
@param Lba TODO: add argument description
|
||||||
@param BufferSize TODO: add argument description
|
@param BufferSize TODO: add argument description
|
||||||
@param Buffer TODO: add argument description
|
@param Buffer TODO: add argument description
|
||||||
|
|
||||||
@ -783,7 +783,7 @@ EFI_STATUS
|
|||||||
AtapiBlkIoWriteBlocks (
|
AtapiBlkIoWriteBlocks (
|
||||||
IN IDE_BLK_IO_DEV *IdeBlkIoDevice,
|
IN IDE_BLK_IO_DEV *IdeBlkIoDevice,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA LBA,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
);
|
);
|
||||||
|
@ -413,7 +413,7 @@ IDEBusDriverBindingStart (
|
|||||||
}
|
}
|
||||||
|
|
||||||
EndIdeDevice = (UINT8) MIN ((MaxDevices - 1), EndIdeDevice);
|
EndIdeDevice = (UINT8) MIN ((MaxDevices - 1), EndIdeDevice);
|
||||||
|
ASSERT (EndIdeDevice < IdeMaxDevice);
|
||||||
//
|
//
|
||||||
// Now inform the IDE Controller Init Module. Sept10
|
// Now inform the IDE Controller Init Module. Sept10
|
||||||
//
|
//
|
||||||
@ -556,7 +556,7 @@ IDEBusDriverBindingStart (
|
|||||||
//
|
//
|
||||||
// Submit identify data to IDE controller init driver
|
// Submit identify data to IDE controller init driver
|
||||||
//
|
//
|
||||||
CopyMem (&IdentifyData, IdeBlkIoDevicePtr->pIdData, sizeof (IdentifyData));
|
CopyMem (&IdentifyData, IdeBlkIoDevicePtr->IdData, sizeof (IdentifyData));
|
||||||
IdeBusDriverPrivateData->DeviceFound[IdeChannel * 2 + IdeDevice] = TRUE;
|
IdeBusDriverPrivateData->DeviceFound[IdeChannel * 2 + IdeDevice] = TRUE;
|
||||||
IdeInit->SubmitData (IdeInit, IdeChannel, IdeDevice, &IdentifyData);
|
IdeInit->SubmitData (IdeInit, IdeChannel, IdeDevice, &IdentifyData);
|
||||||
} else {
|
} else {
|
||||||
@ -611,7 +611,7 @@ IDEBusDriverBindingStart (
|
|||||||
//
|
//
|
||||||
// Set best supported PIO mode on this IDE device
|
// Set best supported PIO mode on this IDE device
|
||||||
//
|
//
|
||||||
if (SupportedModes->PioMode.Mode <= ATA_PIO_MODE_2) {
|
if (SupportedModes->PioMode.Mode <= AtaPioMode2) {
|
||||||
TransferMode.ModeCategory = ATA_MODE_CATEGORY_DEFAULT_PIO;
|
TransferMode.ModeCategory = ATA_MODE_CATEGORY_DEFAULT_PIO;
|
||||||
} else {
|
} else {
|
||||||
TransferMode.ModeCategory = ATA_MODE_CATEGORY_FLOW_PIO;
|
TransferMode.ModeCategory = ATA_MODE_CATEGORY_FLOW_PIO;
|
||||||
@ -672,9 +672,9 @@ IDEBusDriverBindingStart (
|
|||||||
//
|
//
|
||||||
// Init driver parameters
|
// Init driver parameters
|
||||||
//
|
//
|
||||||
DriveParameters.Sector = (UINT8) IdeBlkIoDevicePtr->pIdData->AtaData.sectors_per_track;
|
DriveParameters.Sector = (UINT8) IdeBlkIoDevicePtr->IdData->AtaData.sectors_per_track;
|
||||||
DriveParameters.Heads = (UINT8) (IdeBlkIoDevicePtr->pIdData->AtaData.heads - 1);
|
DriveParameters.Heads = (UINT8) (IdeBlkIoDevicePtr->IdData->AtaData.heads - 1);
|
||||||
DriveParameters.MultipleSector = (UINT8) IdeBlkIoDevicePtr->pIdData->AtaData.multi_sector_cmd_max_sct_cnt;
|
DriveParameters.MultipleSector = (UINT8) IdeBlkIoDevicePtr->IdData->AtaData.multi_sector_cmd_max_sct_cnt;
|
||||||
//
|
//
|
||||||
// Set Parameters for the device:
|
// Set Parameters for the device:
|
||||||
// 1) Init
|
// 1) Init
|
||||||
@ -1307,11 +1307,11 @@ IDEDiskInfoInquiry (
|
|||||||
return EFI_BUFFER_TOO_SMALL;
|
return EFI_BUFFER_TOO_SMALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IdeBlkIoDevice->pInquiryData == NULL) {
|
if (IdeBlkIoDevice->InquiryData == NULL) {
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBS->CopyMem (InquiryData, IdeBlkIoDevice->pInquiryData, sizeof (ATAPI_INQUIRY_DATA));
|
gBS->CopyMem (InquiryData, IdeBlkIoDevice->InquiryData, sizeof (ATAPI_INQUIRY_DATA));
|
||||||
*InquiryDataSize = sizeof (ATAPI_INQUIRY_DATA);
|
*InquiryDataSize = sizeof (ATAPI_INQUIRY_DATA);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -1348,11 +1348,11 @@ IDEDiskInfoIdentify (
|
|||||||
return EFI_BUFFER_TOO_SMALL;
|
return EFI_BUFFER_TOO_SMALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IdeBlkIoDevice->pIdData == NULL) {
|
if (IdeBlkIoDevice->IdData == NULL) {
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBS->CopyMem (IdentifyData, IdeBlkIoDevice->pIdData, sizeof (EFI_IDENTIFY_DATA));
|
gBS->CopyMem (IdentifyData, IdeBlkIoDevice->IdData, sizeof (EFI_IDENTIFY_DATA));
|
||||||
*IdentifyDataSize = sizeof (EFI_IDENTIFY_DATA);
|
*IdentifyDataSize = sizeof (EFI_IDENTIFY_DATA);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
@ -95,8 +95,8 @@ typedef struct {
|
|||||||
IDE_BASE_REGISTERS *IoPort;
|
IDE_BASE_REGISTERS *IoPort;
|
||||||
UINT16 AtapiError;
|
UINT16 AtapiError;
|
||||||
|
|
||||||
ATAPI_INQUIRY_DATA *pInquiryData;
|
ATAPI_INQUIRY_DATA *InquiryData;
|
||||||
EFI_IDENTIFY_DATA *pIdData;
|
EFI_IDENTIFY_DATA *IdData;
|
||||||
ATA_PIO_MODE PioMode;
|
ATA_PIO_MODE PioMode;
|
||||||
EFI_ATA_MODE UdmaMode;
|
EFI_ATA_MODE UdmaMode;
|
||||||
CHAR8 ModelName[41];
|
CHAR8 ModelName[41];
|
||||||
@ -315,7 +315,7 @@ IDEBlkIoReset (
|
|||||||
|
|
||||||
@param This TODO: add argument description
|
@param This TODO: add argument description
|
||||||
@param MediaId TODO: add argument description
|
@param MediaId TODO: add argument description
|
||||||
@param LBA TODO: add argument description
|
@param Lba TODO: add argument description
|
||||||
@param BufferSize TODO: add argument description
|
@param BufferSize TODO: add argument description
|
||||||
@param Buffer TODO: add argument description
|
@param Buffer TODO: add argument description
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ EFIAPI
|
|||||||
IDEBlkIoReadBlocks (
|
IDEBlkIoReadBlocks (
|
||||||
IN EFI_BLOCK_IO_PROTOCOL *This,
|
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA LBA,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
);
|
);
|
||||||
@ -337,7 +337,7 @@ IDEBlkIoReadBlocks (
|
|||||||
|
|
||||||
@param This TODO: add argument description
|
@param This TODO: add argument description
|
||||||
@param MediaId TODO: add argument description
|
@param MediaId TODO: add argument description
|
||||||
@param LBA TODO: add argument description
|
@param Lba TODO: add argument description
|
||||||
@param BufferSize TODO: add argument description
|
@param BufferSize TODO: add argument description
|
||||||
@param Buffer TODO: add argument description
|
@param Buffer TODO: add argument description
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ EFIAPI
|
|||||||
IDEBlkIoWriteBlocks (
|
IDEBlkIoWriteBlocks (
|
||||||
IN EFI_BLOCK_IO_PROTOCOL *This,
|
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA LBA,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
IN VOID *Buffer
|
IN VOID *Buffer
|
||||||
);
|
);
|
||||||
|
@ -52,7 +52,6 @@
|
|||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
MdeModulePkg/MdeModulePkg.dec
|
|
||||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||||
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
||||||
|
|
||||||
@ -72,15 +71,15 @@
|
|||||||
|
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiDiskInfoIdeInterfaceGuid # SOMETIMES_CONSUMED
|
gEfiDiskInfoIdeInterfaceGuid # CONSUMES ## GUID
|
||||||
gEfiEventExitBootServicesGuid
|
gEfiEventExitBootServicesGuid # CONSUMES ## Event
|
||||||
|
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiDiskInfoProtocolGuid # PROTOCOL BY_START
|
gEfiDiskInfoProtocolGuid # BY_START
|
||||||
gEfiBlockIoProtocolGuid # PROTOCOL BY_START
|
gEfiBlockIoProtocolGuid # BY_START
|
||||||
gEfiIdeControllerInitProtocolGuid # PROTOCOL TO_START
|
gEfiIdeControllerInitProtocolGuid # TO_START
|
||||||
gEfiPciIoProtocolGuid # PROTOCOL TO_START
|
gEfiPciIoProtocolGuid # TO_START
|
||||||
gEfiDevicePathProtocolGuid # PROTOCOL TO_START
|
gEfiDevicePathProtocolGuid # TO_START
|
||||||
|
|
||||||
|
|
||||||
|
@ -197,35 +197,35 @@ typedef struct {
|
|||||||
#define SETFEATURE TRUE
|
#define SETFEATURE TRUE
|
||||||
#define CLEARFEATURE FALSE
|
#define CLEARFEATURE FALSE
|
||||||
|
|
||||||
//
|
///
|
||||||
// PIO mode definition
|
/// PIO mode definition
|
||||||
//
|
///
|
||||||
typedef enum {
|
typedef enum _ATA_PIO_MODE_ {
|
||||||
ATA_PIO_MODE_BELOW_2,
|
AtaPioModeBelow2,
|
||||||
ATA_PIO_MODE_2,
|
AtaPioMode2,
|
||||||
ATA_PIO_MODE_3,
|
AtaPioMode3,
|
||||||
ATA_PIO_MODE_4
|
AtaPioMode4
|
||||||
} ATA_PIO_MODE;
|
} ATA_PIO_MODE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Multi word DMA definition
|
// Multi word DMA definition
|
||||||
//
|
//
|
||||||
typedef enum {
|
typedef enum _ATA_MDMA_MODE_ {
|
||||||
ATA_MDMA_MODE_0,
|
AtaMdmaMode0,
|
||||||
ATA_MDMA_MODE_1,
|
AtaMdmaMode1,
|
||||||
ATA_MDMA_MODE_2
|
AtaMdmaMode2
|
||||||
} ATA_MDMA_MODE;
|
} ATA_MDMA_MODE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// UDMA mode definition
|
// UDMA mode definition
|
||||||
//
|
//
|
||||||
typedef enum {
|
typedef enum _ATA_UDMA_MODE_ {
|
||||||
ATA_UDMA_MODE_0,
|
AtaUdmaMode0,
|
||||||
ATA_UDMA_MODE_1,
|
AtaUdmaMode1,
|
||||||
ATA_UDMA_MODE_2,
|
AtaUdmaMode2,
|
||||||
ATA_UDMA_MODE_3,
|
AtaUdmaMode3,
|
||||||
ATA_UDMA_MODE_4,
|
AtaUdmaMode4,
|
||||||
ATA_UDMA_MODE_5
|
AtaUdmaMode5
|
||||||
} ATA_UDMA_MODE;
|
} ATA_UDMA_MODE;
|
||||||
|
|
||||||
#define ATA_MODE_CATEGORY_DEFAULT_PIO 0x00
|
#define ATA_MODE_CATEGORY_DEFAULT_PIO 0x00
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/**@file
|
/**@file
|
||||||
S3 Library. This library class defines a set of methods related do S3 mode
|
This library provides API to invoke the S3 resume vector in the APCI Table in S3 resume mode.
|
||||||
|
This library instance is only for PEI phase use and the APIs in this instance
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008 Intel Corporation
|
Copyright (c) 2006 - 2008 Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#/** @file
|
#/** @file
|
||||||
# Graphics Library for UEFI drivers
|
|
||||||
#
|
#
|
||||||
# This library provides supports for basic graphic functions.
|
# This library provides API to invoke the S3 resume vector in the APCI Table in S3 resume mode.
|
||||||
|
# This library instance is only for PEI phase use and the APIs in this instance
|
||||||
|
#
|
||||||
# Copyright (c) 2006 - 2009, Intel Corporation.
|
# Copyright (c) 2006 - 2009, Intel Corporation.
|
||||||
#
|
#
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
@ -39,11 +40,10 @@
|
|||||||
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseLib
|
|
||||||
PeiServicesTablePointerLib
|
PeiServicesTablePointerLib
|
||||||
DebugLib
|
DebugLib
|
||||||
|
|
||||||
[Ppis]
|
[Ppis]
|
||||||
gEfiPeiS3ResumePpiGuid # PPI ALWAYS_CONSUMED
|
gEfiPeiS3ResumePpiGuid # ALWAYS_CONSUMES
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user