1 /** @file
2   This protocol manages the legacy memory regions between 0xc0000 - 0xfffff.
3 
4 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 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   @par Revision Reference:
14   This protocol is defined in Framework for EFI Compatibility Support Module spec
15   Version 0.97.
16 
17 **/
18 
19 #ifndef _EFI_LEGACY_REGION_H_
20 #define _EFI_LEGACY_REGION_H_
21 
22 
23 #define EFI_LEGACY_REGION_PROTOCOL_GUID \
24   { \
25     0xfc9013a, 0x568, 0x4ba9, {0x9b, 0x7e, 0xc9, 0xc3, 0x90, 0xa6, 0x60, 0x9b } \
26   }
27 
28 typedef struct _EFI_LEGACY_REGION_PROTOCOL EFI_LEGACY_REGION_PROTOCOL;
29 
30 /**
31   Sets hardware to decode or not decode a region.
32 
33   @param  This                  Indicates the EFI_LEGACY_REGION_PROTOCOL instance
34   @param  Start                 The start of the region to decode.
35   @param  Length                The size in bytes of the region.
36   @param  On                    The decode/nondecode flag.
37 
38   @retval EFI_SUCCESS           The decode range successfully changed.
39 
40 **/
41 typedef
42 EFI_STATUS
43 (EFIAPI *EFI_LEGACY_REGION_DECODE)(
44   IN EFI_LEGACY_REGION_PROTOCOL           *This,
45   IN  UINT32                              Start,
46   IN  UINT32                              Length,
47   IN  BOOLEAN                             *On
48   );
49 
50 /**
51   Sets a region to read only.
52 
53   @param  This                  Indicates the EFI_LEGACY_REGION_PROTOCOL instance.
54   @param  Start                 The start of region to lock.
55   @param  Length                The size in bytes of the region.
56   @param  Granularity           Lock attribute affects this granularity in bytes.
57 
58   @retval EFI_SUCCESS           The region was made read only.
59 
60 **/
61 typedef
62 EFI_STATUS
63 (EFIAPI *EFI_LEGACY_REGION_LOCK)(
64   IN EFI_LEGACY_REGION_PROTOCOL           *This,
65   IN  UINT32                              Start,
66   IN  UINT32                              Length,
67   OUT UINT32                              *Granularity OPTIONAL
68   );
69 
70 /**
71   Sets a region to read only and ensures that flash is locked from being
72   inadvertently modified.
73 
74   @param  This                  Indicates the EFI_LEGACY_REGION_PROTOCOL instance
75   @param  Start                 The start of region to lock.
76   @param  Length                The size in bytes of the region.
77   @param  Granularity           Lock attribute affects this granularity in bytes.
78 
79   @retval EFI_SUCCESS           The region was made read only and flash is locked.
80 
81 **/
82 typedef
83 EFI_STATUS
84 (EFIAPI *EFI_LEGACY_REGION_BOOT_LOCK)(
85   IN EFI_LEGACY_REGION_PROTOCOL           *This,
86   IN  UINT32                              Start,
87   IN  UINT32                              Length,
88   OUT UINT32                              *Granularity OPTIONAL
89   );
90 
91 /**
92   Sets a region to read-write.
93 
94   @param  This                  Indicates the EFI_LEGACY_REGION_PROTOCOL instance
95   @param  Start                 The start of region to lock.
96   @param  Length                The size in bytes of the region.
97   @param  Granularity           Lock attribute affects this granularity in bytes.
98 
99   @retval EFI_SUCCESS           The region was successfully made read-write.
100 
101 **/
102 typedef
103 EFI_STATUS
104 (EFIAPI *EFI_LEGACY_REGION_UNLOCK)(
105   IN EFI_LEGACY_REGION_PROTOCOL           *This,
106   IN  UINT32                              Start,
107   IN  UINT32                              Length,
108   OUT UINT32                              *Granularity OPTIONAL
109   );
110 
111 /**
112   Abstracts the hardware control of the physical address region 0xC0000-C0xFFFFF
113   for the traditional BIOS.
114 **/
115 struct _EFI_LEGACY_REGION_PROTOCOL {
116   EFI_LEGACY_REGION_DECODE    Decode;     ///< Specifies a region for the chipset to decode.
117   EFI_LEGACY_REGION_LOCK      Lock;       ///< Makes the specified OpROM region read only or locked.
118   EFI_LEGACY_REGION_BOOT_LOCK BootLock;   ///< Sets a region to read only and ensures tat flash is locked from.
119                                           ///< inadvertent modification.
120   EFI_LEGACY_REGION_UNLOCK    UnLock;     ///< Makes the specified OpROM region read-write or unlocked.
121 };
122 
123 extern EFI_GUID gEfiLegacyRegionProtocolGuid;
124 
125 #endif
126