summaryrefslogtreecommitdiff
path: root/EDK/Foundation/Framework/Ppi/BlockIo/BlockIo.h
blob: c518b37784768cf15c1cd20a5b577d522667ad68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*++

Copyright (c) 1999 - 2002, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution.  The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Module Name:

  BlockIo.h

Abstract:

  BlockIo PPI as defined in EFI 2.0

  Used to access block-oriented storage devices

--*/

#ifndef _PEI_BLOCK_IO_H_
#define _PEI_BLOCK_IO_H_

#define PEI_BLOCK_IO_PPI_GUID \
  { \
    0x695d8aa1, 0x42ee, 0x4c46, 0x80, 0x5c, 0x6e, 0xa6, 0xbc, 0xe7, 0x99, 0xe3 \
  }

EFI_FORWARD_DECLARATION (PEI_RECOVERY_BLOCK_IO_INTERFACE);

typedef UINT64  PEI_LBA;

typedef enum {
  LegacyFloppy  = 0,
  IdeCDROM      = 1,
  IdeLS120      = 2,
  UsbMassStorage= 3,
  MaxDeviceType
} PEI_BLOCK_DEVICE_TYPE;

typedef struct {
  PEI_BLOCK_DEVICE_TYPE DeviceType;
  BOOLEAN               MediaPresent;
  UINTN                 LastBlock;
  UINTN                 BlockSize;
} PEI_BLOCK_IO_MEDIA;

typedef
EFI_STATUS
(EFIAPI *PEI_GET_NUMBER_BLOCK_DEVICES) (
  IN  EFI_PEI_SERVICES                         **PeiServices,
  IN PEI_RECOVERY_BLOCK_IO_INTERFACE           * This,
  OUT UINTN                                    *NumberBlockDevices
  );

typedef
EFI_STATUS
(EFIAPI *PEI_GET_DEVICE_MEDIA_INFORMATION) (
  IN  EFI_PEI_SERVICES                         **PeiServices,
  IN PEI_RECOVERY_BLOCK_IO_INTERFACE           * This,
  IN UINTN                                     DeviceIndex,
  OUT PEI_BLOCK_IO_MEDIA                       * MediaInfo
  );

typedef
EFI_STATUS
(EFIAPI *PEI_READ_BLOCKS) (
  IN  EFI_PEI_SERVICES                         **PeiServices,
  IN PEI_RECOVERY_BLOCK_IO_INTERFACE           * This,
  IN UINTN                                     DeviceIndex,
  IN PEI_LBA                                   StartLBA,
  IN UINTN                                     BufferSize,
  OUT VOID                                     *Buffer
  );

typedef struct _PEI_RECOVERY_BLOCK_IO_INTERFACE {
  PEI_GET_NUMBER_BLOCK_DEVICES      GetNumberOfBlockDevices;
  PEI_GET_DEVICE_MEDIA_INFORMATION  GetBlockDeviceMediaInfo;
  PEI_READ_BLOCKS                   ReadBlocks;
} PEI_RECOVERY_BLOCK_IO_INTERFACE;

extern EFI_GUID gPeiBlockIoPpiGuid;

#endif