summaryrefslogtreecommitdiff
path: root/Include/Protocol/DiskIo.h
blob: c06b811e30fdbee47ac178a59d96d1a198664f1f (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2005, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**             6145-F Northbelt Pkwy, Norcross, GA 30071            **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************

//**********************************************************************
// $Header: /Alaska/BIN/Core/Include/Protocol/DiskIo.h 4     4/20/07 3:47p Robert $
//
// $Revision: 4 $
//
// $Date: 4/20/07 3:47p $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Core/Include/Protocol/DiskIo.h $
// 
// 4     4/20/07 3:47p Robert
// Updated File header for Coding standard compliance
// 
// 3     3/13/06 1:40a Felixp
// 
// 2     3/04/05 10:34a Mandal
// 
// 1     1/28/05 12:44p Felixp
// 
// 2     1/18/05 3:22p Felixp
// PrintDebugMessage renamed to Trace
// 
// 1     12/23/04 9:41a Felixp
// 
// 1     8/19/04 6:26p Robert
//
// 1     1/26/04 3:25p Markw
//
//**********************************************************************
//<AMI_FHDR_START>
//
// Name: DiskIo.h
//
// Description: Contains Function Prototypes and Data Structures for 
//      the DiskIo Protocol
//
//<AMI_FHDR_END>
//**********************************************************************
#ifndef __DISK_IO_PROTOCOL_H__
#define __DISK_IO_PROTOCOL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <EFI.h>

#define EFI_DISK_IO_PROTOCOL_GUID \
		{ 0xCE345171, 0xBA0B, 0x11d2, 0x8e, 0x4F, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }

GUID_VARIABLE_DECLARATION(gEfiDiskIoProtocolGuid, EFI_DISK_IO_PROTOCOL_GUID);

#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000


typedef	struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;


//=============================================================================
// Function Prototypes

//=============================================================================
// Function: ReadDisk
//
// Description: rreads the number of bytes specified by BufferSize from the device
//
// Inputs:
//		This - Indicates a pointer to the calling context. 
//		MediaId - ID of the medium to be read.
//		Offset - The starting byte offset on the logical block I/O device to read from.
//		BufferSize - The size in bytes of Buffer. The number of bytes to read from
//			the device.
//
// Outputs: Returns EFI_STATUS
//		Buffer - A pointer to the destination buffer for the data. The caller is responsible
//			for either having implicit or explicit ownership of the buffer.
//
// Notes:
//
//=============================================================================
typedef EFI_STATUS (*EFI_DISK_READ) (
		IN	EFI_DISK_IO_PROTOCOL		*This,
		IN	UINT32			MediaId,
		IN	UINT64			Offset,
		IN	UINTN			BufferSize,
		OUT	VOID			*Buffer
		);



//=============================================================================
// Function: WriteDisk
//
// Description: writes the number of bytes specified by BufferSize to the device
//
// Inputs:
//		This - Indicates a pointer to the calling context. 
//		MediaId - ID of the medium to be read.
//		Offset - The starting byte offset on the logical block I/O device to read from.
//		BufferSize - The size in bytes of Buffer. The number of bytes to read from
//			the device.
//		Buffer - A pointer to the destination buffer for the data. The caller is responsible
//			for either having implicit or explicit ownership of the buffer.
//
// Outputs: Returns EFI_STATUS
//
// Notes:
//
//=============================================================================
typedef EFI_STATUS (*EFI_DISK_WRITE) (
		IN	EFI_DISK_IO_PROTOCOL		*This,
		IN	UINT32			MediaId,
		IN	UINT64			Offset,
		IN	UINTN			BufferSize,
		IN	VOID			*Buffer
		);



//=============================================================================
// Protocol Definition
typedef struct _EFI_DISK_IO_PROTOCOL {
		UINT64				Revision;
		EFI_DISK_READ		ReadDisk;
		EFI_DISK_WRITE		WriteDisk;
		} EFI_DISK_IO_PROTOCOL;


/****** DO NOT WRITE BELOW THIS LINE *******/
#ifdef __cplusplus
}
#endif
#endif

//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2005, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**             6145-F Northbelt Pkwy, Norcross, GA 30071            **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************