]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrCompiler.h
Add the missing BDS license header.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Tools / Source / UefiVfrCompile / VfrCompiler.h
1 /*++
2
3 Copyright (c) 2004 - 2009, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 VfrCompiler.h
15
16 Abstract:
17
18 --*/
19
20 #ifndef _VFRCOMPILER_H_
21 #define _VFRCOMPILER_H_
22
23 #include "Tiano.h"
24 #include "EfiTypes.h"
25 #include "EfiVfr.h"
26 #include "VfrFormPkg.h"
27 #include "VfrUtilityLib.h"
28
29 #define PROGRAM_NAME "VfrCompile"
30 #define VFR_COMPILER_VERSION "UEFI 2.1"
31
32 //
33 // This is how we invoke the C preprocessor on the VFR source file
34 // to resolve #defines, #includes, etc. To make C source files
35 // shareable between VFR and drivers, define VFRCOMPILE so that
36 // #ifdefs can be used in shared .h files.
37 //
38 #define PREPROCESSOR_COMMAND "cl "
39 #define PREPROCESSOR_OPTIONS "/nologo /E /TC /DVFRCOMPILE "
40
41 //
42 // Specify the filename extensions for the files we generate.
43 //
44 #define VFR_PREPROCESS_FILENAME_EXTENSION ".i"
45 #define VFR_PACKAGE_FILENAME_EXTENSION ".hpk"
46 #define VFR_RECORDLIST_FILENAME_EXTENSION ".lst"
47
48 typedef struct {
49 INT8 VfrFileName[MAX_PATH];
50 INT8 RecordListFile[MAX_PATH];
51 INT8 PkgOutputFileName[MAX_PATH];
52 INT8 COutputFileName[MAX_PATH];
53 bool CreateRecordListFile;
54 bool CreateIfrPkgFile;
55 INT8 OutputDirectory[MAX_PATH];
56 INT8 PreprocessorOutputFileName[MAX_PATH];
57 INT8 VfrBaseFileName[MAX_PATH]; // name of input VFR file with no path or extension
58 INT8 *IncludePaths;
59 INT8 *CPreprocessorOptions;
60 } OPTIONS;
61
62 typedef enum {
63 STATUS_INITIALIZED = 1,
64 STATUS_PREPROCESSED,
65 STATUS_COMPILEED,
66 STATUS_GENBINARY,
67 STATUS_FINISHED,
68 STATUS_FAILED,
69 STATUS_DEAD,
70 } COMPILER_RUN_STATUS;
71
72 class CVfrCompiler {
73 private:
74 COMPILER_RUN_STATUS mRunStatus;
75 OPTIONS mOptions;
76 INT8 *mPreProcessCmd;
77 INT8 *mPreProcessOpt;
78
79 VOID OptionInitialization (IN INT32 , IN INT8 **);
80 VOID AppendIncludePath (IN INT8 *);
81 VOID AppendCPreprocessorOptions (IN INT8 *);
82 INT8 SetBaseFileName (VOID);
83 INT8 SetPkgOutputFileName (VOID);
84 INT8 SetCOutputFileName(VOID);
85 INT8 SetPreprocessorOutputFileName (VOID);
86 INT8 SetRecordListFileName (VOID);
87
88 VOID SET_RUN_STATUS (IN COMPILER_RUN_STATUS);
89 BOOLEAN IS_RUN_STATUS (IN COMPILER_RUN_STATUS);
90
91 public:
92 COMPILER_RUN_STATUS RunStatus (VOID) {
93 return mRunStatus;
94 }
95
96 public:
97 CVfrCompiler (IN INT32 , IN INT8 **);
98 ~CVfrCompiler ();
99
100 VOID Usage (VOID);
101
102 VOID PreProcess (VOID);
103 VOID Compile (VOID);
104 VOID GenBinary (VOID);
105 VOID GenCFile (VOID);
106 VOID GenRecordListFile (VOID);
107 };
108
109 #endif