3 VfrCompiler internal defintions.
5 Copyright (c) 2004 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef _VFRCOMPILER_H_
17 #define _VFRCOMPILER_H_
19 #include "Common/UefiBaseTypes.h"
21 #include "VfrFormPkg.h"
22 #include "VfrUtilityLib.h"
24 #define PROGRAM_NAME "VfrCompile"
25 #define VFR_COMPILER_VERSION " 1.95 (UEFI 2.1)"
26 #define VFR_COMPILER_UPDATE_TIME " updated on 2009/05/20"
28 // This is how we invoke the C preprocessor on the VFR source file
29 // to resolve #defines, #includes, etc. To make C source files
30 // shareable between VFR and drivers, define VFRCOMPILE so that
31 // #ifdefs can be used in shared .h files.
33 #define PREPROCESSOR_COMMAND "cl "
34 #define PREPROCESSOR_OPTIONS "/nologo /E /TC /DVFRCOMPILE "
37 // Specify the filename extensions for the files we generate.
39 #define VFR_PREPROCESS_FILENAME_EXTENSION ".i"
40 #define VFR_PACKAGE_FILENAME_EXTENSION ".hpk"
41 #define VFR_RECORDLIST_FILENAME_EXTENSION ".lst"
44 CHAR8 VfrFileName
[MAX_PATH
];
45 CHAR8 RecordListFile
[MAX_PATH
];
46 CHAR8 PkgOutputFileName
[MAX_PATH
];
47 CHAR8 COutputFileName
[MAX_PATH
];
48 bool CreateRecordListFile
;
49 bool CreateIfrPkgFile
;
50 CHAR8 OutputDirectory
[MAX_PATH
];
51 CHAR8 PreprocessorOutputFileName
[MAX_PATH
];
52 CHAR8 VfrBaseFileName
[MAX_PATH
]; // name of input VFR file with no path or extension
54 bool SkipCPreprocessor
;
55 CHAR8
*CPreprocessorOptions
;
56 BOOLEAN CompatibleMode
;
60 STATUS_INITIALIZED
= 1,
67 } COMPILER_RUN_STATUS
;
71 COMPILER_RUN_STATUS mRunStatus
;
73 CHAR8
*mPreProcessCmd
;
74 CHAR8
*mPreProcessOpt
;
76 VOID
OptionInitialization (IN INT32
, IN CHAR8
**);
77 VOID
AppendIncludePath (IN CHAR8
*);
78 VOID
AppendCPreprocessorOptions (IN CHAR8
*);
79 INT8
SetBaseFileName (VOID
);
80 INT8
SetPkgOutputFileName (VOID
);
81 INT8
SetCOutputFileName(VOID
);
82 INT8
SetPreprocessorOutputFileName (VOID
);
83 INT8
SetRecordListFileName (VOID
);
85 VOID
SET_RUN_STATUS (IN COMPILER_RUN_STATUS
);
86 BOOLEAN
IS_RUN_STATUS (IN COMPILER_RUN_STATUS
);
89 COMPILER_RUN_STATUS
RunStatus (VOID
) {
94 CVfrCompiler (IN INT32
, IN CHAR8
**);
99 VOID
PreProcess (VOID
);
101 VOID
AdjustBin (VOID
);
102 VOID
GenBinary (VOID
);
103 VOID
GenCFile (VOID
);
104 VOID
GenRecordListFile (VOID
);
105 VOID
DebugError (VOID
);