slimbootloader/BootloaderCommonPkg/Library/AhciLib/AhciDevice.h

88 lines
2.9 KiB
C
Raw Normal View History

Use LF line endings in the repository Convert the line endings stored for all text files in the repository to LF. The majority previously used DOS-style CRLF line endings. Add a .gitattributes file to enforce this and treat certain extensions as never being text files. Update PatchCheck.py to insist on LF line endings rather than CRLF. However, its other checks fail on this commit due to lots of pre-existing complaints that it only notices because the line endings have changed. Silicon/QemuSocPkg/FspBin/Patches/0001-Build-QEMU-FSP-2.0-binaries.patch needs to be treated as binary since it contains a mixture of line endings. This change has implications depending on the client platform you are using the repository from: * Windows The usual configuration for Git on Windows means that text files will be checked out to the work tree with DOS-style CRLF line endings. If that's not the case then you can configure Git to do so for the entire machine with: git config --global core.autocrlf true or for just the repository with: git config core.autocrlf true Line endings will be normalised to LF when they are committed to the repository. If you commit a text file with only LF line endings then it will be converted to CRLF line endings in your work tree. * Linux, MacOS and other Unices The usual configuration for Git on such platforms is to check files out of the repository with LF line endings. This is probably the right thing for you. In the unlikely even that you are using Git on Unix but editing or compiling on Windows for some reason then you may need to tweak your configuration to force the use of CRLF line endings as described above. * General For more information see https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings . Fixes: https://github.com/slimbootloader/slimbootloader/issues/1400 Signed-off-by: Mike Crowe <mac@mcrowe.com>
2021-11-10 19:36:23 +08:00
/** @file
This file provides AHCI SATA device specific structure.
Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _AHCI_DEVICE_H_
#define _AHCI_DEVICE_H_
#include <IndustryStandard/Pci.h>
#include <IndustryStandard/Atapi.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BootloaderCommonLib.h>
#include <Library/TimerLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/IoMmuLib.h>
#include "AhciMode.h"
#define ATA_ATAPI_DEVICE_SIGNATURE SIGNATURE_32 ('a', 'd', 'e', 'v')
#define AHCI_CONTROLLER_SIGNATURE SIGNATURE_32 ('a', 'h', 'c', 'i')
#define EFI_ATA_DEVICE_FROM_LINK(a) \
CR (a, EFI_ATA_DEVICE_INFO, Link, ATA_ATAPI_DEVICE_SIGNATURE)
#define ATAPI_BLOCK_SIZE 0x800
#define ATA_BLOCK_SIZE 0x200
#define ATAPI_INVALID_MAX_LBA_ADDRESS 0xFFFFFFFF
#define AHCI_MAX_48_TRANSFER_SECTOR 65536
#define AHCI_MAX_28_TRANSFER_SECTOR 256
#define DEVICE_LBA_48_SUPPORT BIT1
#define DMA_WAIT_TIMEOUT_MS 500
//
// ATA device info
//
typedef struct {
UINT32 Signature;
LIST_ENTRY Link;
UINT16 Port;
UINT16 PortMultiplier;
EFI_ATA_DEVICE_TYPE Type;
UINT32 BlockSize;
UINT32 DeviceFeature;
EFI_LBA TotalBlockNumber;
EFI_IDENTIFY_DATA IdentifyData;
EFI_AHCI_CONTROLLER *Controller;
} EFI_ATA_DEVICE_INFO;
/**
Block read/write to ATA device.
The function performs read or write operation to the ATA device.
@param[in] AtaDevice ATA device instance.
@param[in] Read Read or write.
@param[in] Lba The starting logical block address (LBA) to read from
on the device.
@param[in] BufferSize The size of the Buffer in bytes. This number must be
a multiple of the intrinsic block size of the device.
@param[out] Buffer A pointer to the destination buffer for the data.
The caller is responsible for the ownership of the
buffer.
@retval EFI_INVALID_PARAMETER Inpurt parameters are not valid.
@retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.
@retval EFI_TIMEOUT The operation is time out.
@retval EFI_UNSUPPORTED The device is not ready for transfer.
@retval EFI_SUCCESS The DMA data transfer executes successfully.
**/
EFI_STATUS
AhciReadWriteBlock (
IN EFI_ATA_DEVICE_INFO *AtaDevice,
IN BOOLEAN Read,
IN EFI_LBA Lba,
IN UINTN BufferSize,
OUT VOID *Buffer
);
#endif