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