VirtualBox

Ignore:
Timestamp:
Oct 29, 2015 4:30:44 AM (9 years ago)
Author:
vboxsync
Message:

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Pci/IdeBusPei/AtapiPeim.c

    r58459 r58466  
    2020
    2121/**
    22   Initializes the Atapi Block Io PPI. 
    23  
     22  Initializes the Atapi Block Io PPI.
     23
    2424  @param[in]  FileHandle           Handle of the file being invoked.
    2525  @param[in]  PeiServices          Describes the list of possible PEI Services.
     
    8888  Gets the count of block I/O devices that one specific block driver detects.
    8989
    90   This function is used for getting the count of block I/O devices that one 
     90  This function is used for getting the count of block I/O devices that one
    9191  specific block driver detects.  To the PEI ATAPI driver, it returns the number
    92   of all the detected ATAPI devices it detects during the enumeration process. 
    93   To the PEI legacy floppy driver, it returns the number of all the legacy 
    94   devices it finds during its enumeration process. If no device is detected, 
    95   then the function will return zero. 
    96  
    97   @param[in]  PeiServices          General-purpose services that are available 
     92  of all the detected ATAPI devices it detects during the enumeration process.
     93  To the PEI legacy floppy driver, it returns the number of all the legacy
     94  devices it finds during its enumeration process. If no device is detected,
     95  then the function will return zero.
     96
     97  @param[in]  PeiServices          General-purpose services that are available
    9898                                   to every PEIM.
    99   @param[in]  This                 Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI 
     99  @param[in]  This                 Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI
    100100                                   instance.
    101101  @param[out] NumberBlockDevices   The number of block I/O devices discovered.
     
    126126  Gets a block device's media information.
    127127
    128   This function will provide the caller with the specified block device's media 
    129   information. If the media changes, calling this function will update the media 
     128  This function will provide the caller with the specified block device's media
     129  information. If the media changes, calling this function will update the media
    130130  information accordingly.
    131131
     
    133133                            PEIM
    134134  @param[in]  This          Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
    135   @param[in]  DeviceIndex   Specifies the block device to which the function wants 
    136                             to talk. Because the driver that implements Block I/O 
    137                             PPIs will manage multiple block devices, the PPIs that 
    138                             want to talk to a single device must specify the 
     135  @param[in]  DeviceIndex   Specifies the block device to which the function wants
     136                            to talk. Because the driver that implements Block I/O
     137                            PPIs will manage multiple block devices, the PPIs that
     138                            want to talk to a single device must specify the
    139139                            device index that was assigned during the enumeration
    140                             process. This index is a number from one to 
     140                            process. This index is a number from one to
    141141                            NumberBlockDevices.
    142   @param[out] MediaInfo     The media information of the specified block media. 
    143                             The caller is responsible for the ownership of this 
     142  @param[out] MediaInfo     The media information of the specified block media.
     143                            The caller is responsible for the ownership of this
    144144                            data structure.
    145  
    146   @retval EFI_SUCCESS           Media information about the specified block device 
     145
     146  @retval EFI_SUCCESS           Media information about the specified block device
    147147                                was obtained successfully.
    148   @retval EFI_DEVICE_ERROR      Cannot get the media information due to a hardware 
     148  @retval EFI_DEVICE_ERROR      Cannot get the media information due to a hardware
    149149                                error.
    150150  @retval Others                Other failure occurs.
     
    187187  // probe media and retrieve latest media information
    188188  //
    189   DEBUG ((EFI_D_INFO, "Atatpi GetInfo DevicePosition is %d\n", AtapiBlkIoDev->DeviceInfo[Index].DevicePosition)); 
     189  DEBUG ((EFI_D_INFO, "Atatpi GetInfo DevicePosition is %d\n", AtapiBlkIoDev->DeviceInfo[Index].DevicePosition));
    190190  DEBUG ((EFI_D_INFO, "Atatpi GetInfo DeviceType is   %d\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.DeviceType));
    191191  DEBUG ((EFI_D_INFO, "Atatpi GetInfo MediaPresent is %d\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.MediaPresent));
     
    207207  DEBUG ((EFI_D_INFO, "Atatpi GetInfo BlockSize is  0x%x\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.BlockSize));
    208208  DEBUG ((EFI_D_INFO, "Atatpi GetInfo LastBlock is  0x%x\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.LastBlock));
    209  
     209
    210210  //
    211211  // Get media info from AtapiBlkIoDev
     
    219219  Reads the requested number of blocks from the specified block device.
    220220
    221   The function reads the requested number of blocks from the device. All the 
     221  The function reads the requested number of blocks from the device. All the
    222222  blocks are read, or an error is returned. If there is no media in the device,
    223223  the function returns EFI_NO_MEDIA.
    224224
    225   @param[in]  PeiServices   General-purpose services that are available to 
     225  @param[in]  PeiServices   General-purpose services that are available to
    226226                            every PEIM.
    227227  @param[in]  This          Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
    228   @param[in]  DeviceIndex   Specifies the block device to which the function wants 
    229                             to talk. Because the driver that implements Block I/O 
    230                             PPIs will manage multiple block devices, the PPIs that 
    231                             want to talk to a single device must specify the device 
    232                             index that was assigned during the enumeration process. 
     228  @param[in]  DeviceIndex   Specifies the block device to which the function wants
     229                            to talk. Because the driver that implements Block I/O
     230                            PPIs will manage multiple block devices, the PPIs that
     231                            want to talk to a single device must specify the device
     232                            index that was assigned during the enumeration process.
    233233                            This index is a number from one to NumberBlockDevices.
    234234  @param[in]  StartLBA      The starting logical block address (LBA) to read from
     
    237237                            a multiple of the intrinsic block size of the device.
    238238  @param[out] Buffer        A pointer to the destination buffer for the data.
    239                             The caller is responsible for the ownership of the 
     239                            The caller is responsible for the ownership of the
    240240                            buffer.
    241                          
     241
    242242  @retval EFI_SUCCESS             The data was read correctly from the device.
    243   @retval EFI_DEVICE_ERROR        The device reported an error while attempting 
     243  @retval EFI_DEVICE_ERROR        The device reported an error while attempting
    244244                                  to perform the read operation.
    245   @retval EFI_INVALID_PARAMETER   The read request contains LBAs that are not 
     245  @retval EFI_INVALID_PARAMETER   The read request contains LBAs that are not
    246246                                  valid, or the buffer is not properly aligned.
    247247  @retval EFI_NO_MEDIA            There is no media in the device.
     
    366366
    367367  //
    368   // Allow SATA Devices to spin-up. This is needed if 
     368  // Allow SATA Devices to spin-up. This is needed if
    369369  // SEC and PEI phase is too short, for example Release Build.
    370370  //
     
    384384  // Using Command and Control Regs Base Address to fill other registers.
    385385  //
    386   for (Index1 = 0; Index1 < IdeEnabledNumber; Index1 ++) { 
     386  for (Index1 = 0; Index1 < IdeEnabledNumber; Index1 ++) {
    387387    CommandBlockBaseAddr               = IdeRegsBaseAddr[Index1].CommandBlockBaseAddr;
    388388    AtapiBlkIoDev->IdeIoPortReg[Index1].Data         = CommandBlockBaseAddr;
     
    398398    AtapiBlkIoDev->IdeIoPortReg[Index1].Alt.DeviceControl = ControlBlockBaseAddr;
    399399    AtapiBlkIoDev->IdeIoPortReg[Index1].DriveAddress      = (UINT16) (ControlBlockBaseAddr + 0x1);
    400    
     400
    401401    //
    402402    // Scan IDE bus for ATAPI devices IDE or Sata device
     
    418418        Status  = DetectMedia (AtapiBlkIoDev, DevicePosition, &MediaInfo);
    419419        CopyMem (&(AtapiBlkIoDev->DeviceInfo[DeviceCount].MediaInfo), &MediaInfo, sizeof (MediaInfo));
    420        
     420
    421421        DEBUG ((EFI_D_INFO, "Atatpi Device Position is %d\n", DevicePosition));
    422422        DEBUG ((EFI_D_INFO, "Atatpi DeviceType is   %d\n", MediaInfo.DeviceType));
     
    438438/**
    439439  Detect Atapi devices.
    440  
     440
    441441  @param[in]  AtapiBlkIoDev   A pointer to atapi block IO device.
    442442  @param[in]  DevicePosition  An integer to signify device position.
     
    475475/**
    476476  Check power mode of Atapi devices.
    477  
     477
    478478  @param[in]  AtapiBlkIoDev   A pointer to atapi block IO device.
    479479  @param[in]  DevicePosition  An integer to signify device position.
     
    608608/**
    609609  Detect if an IDE controller exists in specified position.
    610  
     610
    611611  @param[in]  AtapiBlkIoDev   A pointer to atapi block IO device.
    612612  @param[in]  DevicePosition  An integer to signify device position.
     
    650650/**
    651651  Wait specified time interval to poll for BSY bit clear in the Status Register.
    652  
     652
    653653  @param[in]  AtapiBlkIoDev          A pointer to atapi block IO device.
    654654  @param[in]  IdeIoRegisters         A pointer to IDE IO registers.
     
    695695/**
    696696  Wait specified time interval to poll for DRDY bit set in the Status register.
    697  
     697
    698698  @param[in]  AtapiBlkIoDev          A pointer to atapi block IO device.
    699699  @param[in]  IdeIoRegisters         A pointer to IDE IO registers.
     
    736736    }
    737737  }
    738  
     738
    739739    MicroSecondDelay (250);
    740740
     
    752752/**
    753753  Wait specified time interval to poll for DRQ bit clear in the Status Register.
    754  
     754
    755755  @param[in]  AtapiBlkIoDev          A pointer to atapi block IO device.
    756756  @param[in]  IdeIoRegisters         A pointer to IDE IO registers.
     
    795795    }
    796796  }
    797  
     797
    798798    MicroSecondDelay (250);
    799799
     
    810810/**
    811811  Wait specified time interval to poll for DRQ bit clear in the Alternate Status Register.
    812  
     812
    813813  @param[in]  AtapiBlkIoDev          A pointer to atapi block IO device.
    814814  @param[in]  IdeIoRegisters         A pointer to IDE IO registers.
     
    853853    }
    854854  }
    855  
     855
    856856    MicroSecondDelay (250);
    857857
     
    12141214/**
    12151215  Send out ATAPI commands conforms to the Packet Command with PIO Data In Protocol.
    1216  
     1216
    12171217  @param[in]  AtapiBlkIoDev         A pointer to atapi block IO device.
    12181218  @param[in]  DevicePosition        An integer to signify device position.
     
    14961496}
    14971497
    1498 /** 
    1499   Used before read/write blocks from/to ATAPI device media. 
     1498/**
     1499  Used before read/write blocks from/to ATAPI device media.
    15001500  Since ATAPI device media is removable, it is necessary to detect
    15011501  whether media is present and get current present media's information.
     
    15311531    return EFI_OUT_OF_RESOURCES;
    15321532  }
    1533  
     1533
    15341534  //
    15351535  // Test Unit Ready command is used to detect whether device is accessible,
     
    16661666}
    16671667
    1668 /** 
     1668/**
    16691669  Reset specified Atapi device.
    16701670
     
    17641764}
    17651765
    1766 /** 
     1766/**
    17671767  Sends out ATAPI Request Sense Packet Command to the specified device.
    17681768
     
    18601860}
    18611861
    1862 /** 
     1862/**
    18631863  Sends out ATAPI Read Capacity Packet Command to the specified device.
    18641864  This command will return the information regarding the capacity of the
     
    19611961}
    19621962
    1963 /** 
     1963/**
    19641964  Perform read from disk in block unit.
    19651965
     
    20642064}
    20652065
    2066 /** 
     2066/**
    20672067  Check if there is media according to sense data.
    20682068
     
    21002100}
    21012101
    2102 /** 
     2102/**
    21032103  Check if device state is unclear according to sense data.
    21042104
     
    21072107
    21082108  @retval TRUE    Device state is unclear
    2109   @retval FALSE   Device state is clear 
     2109  @retval FALSE   Device state is clear
    21102110
    21112111**/
     
    21412141}
    21422142
    2143 /** 
     2143/**
    21442144  Check if there is media error according to sense data.
    21452145
     
    22142214}
    22152215
    2216 /** 
     2216/**
    22172217  Check if drive is ready according to sense data.
    22182218
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette