1 /** @file
2 
3   Utility functions for serializing (persistently storing) and deserializing
4   OVMF's platform configuration.
5 
6   Copyright (C) 2014, Red Hat, Inc.
7 
8   This program and the accompanying materials are licensed and made available
9   under the terms and conditions of the BSD License which accompanies this
10   distribution. The full text of the license may be found at
11   http://opensource.org/licenses/bsd-license.php
12 
13   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
14   WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 
16 **/
17 
18 #ifndef _PLATFORM_CONFIG_H_
19 #define _PLATFORM_CONFIG_H_
20 
21 #include <Base.h>
22 
23 //
24 // This structure participates in driver configuration. It does not
25 // (necessarily) reflect the wire format in the persistent store.
26 //
27 #pragma pack(1)
28 typedef struct {
29   //
30   // preferred graphics console resolution when booting
31   //
32   UINT32 HorizontalResolution;
33   UINT32 VerticalResolution;
34 } PLATFORM_CONFIG;
35 #pragma pack()
36 
37 //
38 // Please see the API documentation near the function definitions.
39 //
40 EFI_STATUS
41 EFIAPI
42 PlatformConfigSave (
43   IN PLATFORM_CONFIG *PlatformConfig
44   );
45 
46 EFI_STATUS
47 EFIAPI
48 PlatformConfigLoad (
49   OUT PLATFORM_CONFIG *PlatformConfig,
50   OUT UINT64          *OptionalElements
51   );
52 
53 //
54 // Feature flags for OptionalElements.
55 //
56 #define PLATFORM_CONFIG_F_GRAPHICS_RESOLUTION BIT0
57 #define PLATFORM_CONFIG_F_DOWNGRADE           BIT63
58 
59 #endif // _PLATFORM_CONFIG_H_
60