FlashMapTask class.\r
\r
FlashMapTask is used to call FlashMap.exe to lay out the flash.\r
- \r
- \r
+\r
+\r
Copyright (c) 2006, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
- \r
+\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
import org.apache.tools.ant.Task;\r
import org.apache.tools.ant.Project;\r
import org.apache.tools.ant.BuildException;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
\r
/**\r
- * SecFixupTask class.\r
- * \r
- * SecFixupTask is used to call SecFixup.exe to fix up sec image.\r
+ * FlashMapTask class.\r
+ *\r
+ * FlashMapTask is used to call FlashMap.exe to generate flash map defition files and fd files.\r
*/\r
public class FlashMapTask extends Task implements EfiDefine {\r
// /\r
private final String toolName = "FlashMap";\r
\r
// /\r
- // / Flash default file\r
+ // / Flash definition file\r
// /\r
private String flashDefFile = "";\r
\r
// /\r
// / output directory\r
// /\r
- private String outputDir = "";\r
+ private String outputDir = ".";\r
\r
// /\r
// / MCI file array\r
\r
/**\r
* execute\r
- * \r
+ *\r
* FlashMapTask execute function is to assemble tool command line & execute\r
* tool command line\r
- * \r
+ *\r
* @throws BuidException\r
*/\r
public void execute() throws BuildException {\r
argList.add(this.inStrFile);\r
argList.add(this.outStrFile);\r
}\r
- \r
- \r
+\r
+\r
//\r
// add microcode binary files\r
//\r
}\r
}\r
\r
- EdkLog.log(EdkLog.EDK_INFO, argList.toString().replace(",",""));\r
//\r
// lauch the program\r
//\r
//\r
// log command line string.\r
//\r
- EdkLog.log(EdkLog.EDK_INFO, cmdProc.getOutputStream().toString());\r
+ EdkLog.log(EdkLog.EDK_VERBOSE, cmdProc.getOutputStream().toString());\r
+ EdkLog.log(EdkLog.EDK_INFO, (new File(this.flashDefFile)).getName());\r
if (exitCode != 0) {\r
int len = cmdOut.read(buf, 0, 1024);\r
- EdkLog.log(EdkLog.EDK_ERROR, new String(buf, 0, len));\r
+ EdkLog.log(EdkLog.EDK_INFO, new String(buf, 0, len));\r
} else {\r
- EdkLog.log(EdkLog.EDK_INFO, "FlashMap succeed!");\r
+ EdkLog.log(EdkLog.EDK_VERBOSE, "FlashMap succeeded!");\r
}\r
} catch (Exception e) {\r
throw new BuildException(e.getMessage());\r
} finally {\r
if (exitCode != 0) {\r
- // throw new BuildException("GenFvImage: failed to generate FV\r
- // file!");\r
+ throw new BuildException("FlashMap failed!");\r
}\r
}\r
}\r
\r
/**\r
* getFlashDefFile\r
- * \r
+ *\r
* This function is to get class member "flashDefFile"\r
- * \r
+ *\r
* @return flashDeFile Name of flash definition file.\r
*/\r
public String getFlashDefFile() {\r
\r
/**\r
* setFlashDefFile\r
- * \r
+ *\r
* This function is to set class member "flashDefFile"\r
- * \r
+ *\r
* @param flashDefFile\r
* Name of flash definition file.\r
*/\r
\r
/**\r
* getAligment\r
- * \r
+ *\r
* This function is to get class member "aligment"\r
- * \r
+ *\r
* @return aligment String of aligment value.\r
*/\r
public String getAligment() {\r
\r
/**\r
* setAligment\r
- * \r
+ *\r
* This function is to set class member "aligment"\r
- * \r
+ *\r
* @param aligment\r
* String of aligment value.\r
*/\r
\r
/**\r
* getAsmIncFile\r
- * \r
+ *\r
* This function is to get class member "asmIncFile"\r
- * \r
+ *\r
* @return asmIncFile String of ASM include file.\r
*/\r
public String getAsmIncFile() {\r
\r
/**\r
* setAsmIncFile\r
- * \r
+ *\r
* This function is to set class member "asmIncFile"\r
- * \r
+ *\r
* @param asmIncFile\r
* String of ASM include file.\r
*/\r
\r
/**\r
* getBaseAddr\r
- * \r
+ *\r
* This function is to get class member "baseAddr"\r
- * \r
+ *\r
* @return baseAddr String of base address value.\r
*/\r
public String getBaseAddr() {\r
\r
/**\r
* setBaseAddr\r
- * \r
+ *\r
* This function is to set class member "baseAddr"\r
- * \r
+ *\r
* @param baseAddr\r
* String of base address value.\r
*/\r
\r
/**\r
* getDscFile\r
- * \r
+ *\r
* This function is to get class member "dscFile"\r
- * \r
+ *\r
* @return dscFile name of DSC file\r
*/\r
public String getDscFile() {\r
\r
/**\r
* setDscFile\r
- * \r
+ *\r
* This function is to set class member "dscFile"\r
- * \r
+ *\r
* @param dscFile\r
* name of DSC file\r
*/\r
\r
/**\r
* getFdImage\r
- * \r
+ *\r
* This function is to get class member "fdImage"\r
- * \r
+ *\r
* @return fdImage name of input FDI image file.\r
*/\r
public String getFdImage() {\r
\r
/**\r
* setFdImage\r
- * \r
+ *\r
* This function is to set class member "fdImage"\r
- * \r
+ *\r
* @param fdImage\r
* name of input FDI image file.\r
*/\r
\r
/**\r
* getFlashDevice\r
- * \r
+ *\r
* This function is to get class member "flashDevice".\r
- * \r
+ *\r
* @return flashDevice name of flash device.\r
*/\r
public String getFlashDevice() {\r
\r
/**\r
* setFlashDevice\r
- * \r
+ *\r
* This function is to set class member "flashDevice"\r
- * \r
+ *\r
* @param flashDevice\r
* name of flash device.\r
*/\r
\r
/**\r
* getFlashDeviceImage\r
- * \r
+ *\r
* This function is to get class member "flashDeviceImage"\r
- * \r
+ *\r
* @return flashDeviceImage name of flash device image\r
*/\r
public String getFlashDeviceImage() {\r
\r
/**\r
* setFlashDeviceImage\r
- * \r
+ *\r
* This function is to set class member "flashDeviceImage"\r
- * \r
+ *\r
* @param flashDeviceImage\r
* name of flash device image\r
*/\r
\r
/**\r
* getHeaderFile\r
- * \r
+ *\r
* This function is to get class member "headerFile"\r
- * \r
+ *\r
* @return headerFile name of include file\r
*/\r
public String getHeaderFile() {\r
\r
/**\r
* setHeaderFile\r
- * \r
+ *\r
* This function is to set class member "headerFile"\r
- * \r
+ *\r
* @param headerFile\r
* name of include file\r
*/\r
\r
/**\r
* getImageOutFile\r
- * \r
+ *\r
* This function is to get class member "imageOutFile"\r
- * \r
+ *\r
* @return imageOutFile name of output image file\r
*/\r
public String getImageOutFile() {\r
\r
/**\r
* setImageOutFile\r
- * \r
+ *\r
* This function is to set class member "ImageOutFile"\r
- * \r
+ *\r
* @param imageOutFile\r
* name of output image file\r
*/\r
\r
/**\r
* getInStrFile\r
- * \r
+ *\r
* This function is to get class member "inStrFile"\r
- * \r
+ *\r
* @return inStrFile name of input file which used to replace symbol names.\r
*/\r
public String getInStrFile() {\r
\r
/**\r
* setInStrFile\r
- * \r
+ *\r
* This function is to set class member "inStrFile"\r
- * \r
+ *\r
* @param inStrFile\r
* name of input file which used to replace symbol names.\r
*/\r
\r
/**\r
* getMciFile\r
- * \r
+ *\r
* This function is to get class member "mciFile"\r
- * \r
+ *\r
* @return mciFile name of input microcode file\r
*/\r
public String getMciFile() {\r
\r
/**\r
* setMciFile\r
- * \r
+ *\r
* This function is to set class member "mciFile"\r
- * \r
+ *\r
* @param mciFile\r
* name of input microcode file\r
*/\r
\r
/**\r
* getMcoFile\r
- * \r
+ *\r
* This function is to get class member "mcoFile"\r
- * \r
+ *\r
* @return mcoFile name of output binary microcode image\r
*/\r
public String getMcoFile() {\r
\r
/**\r
* setMcoFile\r
- * \r
+ *\r
* This function is to set class member "mcoFile"\r
- * \r
+ *\r
* @param mcoFile\r
* name of output binary microcode image\r
*/\r
\r
/**\r
* getOutStrFile\r
- * \r
+ *\r
* This function is to get class member "outStrFile"\r
- * \r
+ *\r
* @return outStrFile name of output string substitution file\r
*/\r
public String getOutStrFile() {\r
\r
/**\r
* setOutStrFile\r
- * \r
+ *\r
* This function is to set class member "outStrFile"\r
- * \r
+ *\r
* @param outStrFile\r
* name of output string substitution file\r
*/\r
\r
/**\r
* getPadValue\r
- * \r
+ *\r
* This function is to get class member "padValue"\r
- * \r
+ *\r
* @return padValue string of byte value to use as padding\r
*/\r
public String getPadValue() {\r
\r
/**\r
* setPadValue\r
- * \r
+ *\r
* This function is to set class member "padValue"\r
- * \r
+ *\r
* @param padValue\r
* string of byte value to use as padding\r
*/\r
\r
/**\r
* addMciFile\r
- * \r
+ *\r
* This function is to add Microcode binary file\r
- * \r
+ *\r
* @param mciFile\r
* instance of input class\r
*/\r
\r
/**\r
* getOutputDir\r
- * \r
+ *\r
* This function is to get class member "outputDir"\r
- * \r
+ *\r
* @return outputDir string of output directory\r
*/\r
public String getOutputDir() {\r
\r
/**\r
* setOutputDir\r
- * \r
+ *\r
* This function is to set class member "outputDir"\r
- * \r
+ *\r
* @param outputDir\r
* string of output directory\r
*/\r