Minor code enhancement.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / LegacyRegion.h
CommitLineData
79964ac8 1/** @file\r
2 This protocol manages the legacy memory regions between 0xc0000 - 0xfffff\r
3\r
2bbaeb0d 4 Copyright (c) 2007 - 2009, Intel Corporation\r
79964ac8 5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
79964ac8 13 @par Revision Reference:\r
14 This protocol is defined in Framework for EFI Compatibility Support Module spec\r
0f899407 15 Version 0.97.\r
79964ac8 16\r
17**/\r
18\r
19#ifndef _EFI_LEGACY_REGION_H_\r
20#define _EFI_LEGACY_REGION_H_\r
21\r
b80fbe85 22\r
79964ac8 23#define EFI_LEGACY_REGION_PROTOCOL_GUID \\r
24 { \\r
25 0xfc9013a, 0x568, 0x4ba9, {0x9b, 0x7e, 0xc9, 0xc3, 0x90, 0xa6, 0x60, 0x9b } \\r
26 }\r
27\r
28typedef struct _EFI_LEGACY_REGION_PROTOCOL EFI_LEGACY_REGION_PROTOCOL;\r
29\r
30/**\r
31 Sets hardware to decode or not decode a region.\r
32\r
33 @param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
34 @param Start Start of region to decode.\r
35 @param Length Size in bytes of the region.\r
36 @param On Decode/nondecode flag.\r
37\r
38 @retval EFI_SUCCESS Decode range successfully changed.\r
39\r
40**/\r
41typedef\r
42EFI_STATUS\r
69686d56 43(EFIAPI *EFI_LEGACY_REGION_DECODE)(\r
79964ac8 44 IN EFI_LEGACY_REGION_PROTOCOL *This,\r
45 IN UINT32 Start,\r
46 IN UINT32 Length,\r
47 IN BOOLEAN *On\r
48 );\r
49\r
50/**\r
51 Sets a region to read only.\r
52\r
53 @param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
54 @param Start Start of region to lock.\r
55 @param Length Size in bytes of the region.\r
56 @param Granularity Lock attribute affects this granularity in bytes.\r
57\r
58 @retval EFI_SUCCESS The region was made read only.\r
59\r
60**/\r
61typedef\r
62EFI_STATUS\r
69686d56 63(EFIAPI *EFI_LEGACY_REGION_LOCK)(\r
79964ac8 64 IN EFI_LEGACY_REGION_PROTOCOL *This,\r
65 IN UINT32 Start,\r
66 IN UINT32 Length,\r
67 OUT UINT32 *Granularity OPTIONAL\r
68 );\r
69\r
70/**\r
71 Sets a region to read only and ensures that flash is locked from being\r
72 inadvertently modified.\r
73\r
74 @param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
75 @param Start Start of region to lock.\r
76 @param Length Size in bytes of the region.\r
77 @param Granularity Lock attribute affects this granularity in bytes.\r
78\r
79 @retval EFI_SUCCESS The region was made read only and flash is locked.\r
80\r
81**/\r
82typedef\r
83EFI_STATUS\r
69686d56 84(EFIAPI *EFI_LEGACY_REGION_BOOT_LOCK)(\r
79964ac8 85 IN EFI_LEGACY_REGION_PROTOCOL *This,\r
86 IN UINT32 Start,\r
87 IN UINT32 Length,\r
88 OUT UINT32 *Granularity OPTIONAL\r
89 );\r
90\r
91/**\r
92 Sets a region to read-write.\r
93\r
94 @param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
95 @param Start Start of region to lock.\r
96 @param Length Size in bytes of the region.\r
97 @param Granularity Lock attribute affects this granularity in bytes.\r
98\r
99 @retval EFI_SUCCESS The region was successfully made read-write.\r
100\r
101**/\r
102typedef\r
103EFI_STATUS\r
69686d56 104(EFIAPI *EFI_LEGACY_REGION_UNLOCK)(\r
79964ac8 105 IN EFI_LEGACY_REGION_PROTOCOL *This,\r
106 IN UINT32 Start,\r
107 IN UINT32 Length,\r
108 OUT UINT32 *Granularity OPTIONAL\r
109 );\r
110\r
111/**\r
79964ac8 112 Abstracts the hardware control of the physical address region 0xC0000-C0xFFFFF\r
113 for the traditional BIOS.\r
79964ac8 114**/\r
115struct _EFI_LEGACY_REGION_PROTOCOL {\r
2bbaeb0d 116 EFI_LEGACY_REGION_DECODE Decode; ///< Specifies a region for the chipset to decode\r
117 EFI_LEGACY_REGION_LOCK Lock; ///< Makes the specified OpROM region read only or locked.\r
118 EFI_LEGACY_REGION_BOOT_LOCK BootLock; ///< Sets a region to read only and ensures tat flash is locked from\r
119 ///< inadvertent modification.\r
120 EFI_LEGACY_REGION_UNLOCK UnLock; ///< Makes the specified OpROM region read-write or unlocked.\r
79964ac8 121};\r
122\r
123extern EFI_GUID gEfiLegacyRegionProtocolGuid;\r
124\r
125#endif\r