Add Build Macro to build SEC modules.
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 18 Oct 2006 02:38:01 +0000 (02:38 +0000)
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 18 Oct 2006 02:38:01 +0000 (02:38 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1784 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/EdkModulePkg.fpd
Tools/Conf/BuildMacro.xml
Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java
Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java
Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java
Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java

index e847ed1..5529116 100644 (file)
         <Section SectionType="EFI_SECTION_RAW">\r
           <!--add 12 bytes blank.pad file-->\r
           <Filenames>\r
-            <Filename>Blank.pad</Filename>\r
+            <Filename>${PLATFORM_DIR}/Blank.pad</Filename>\r
           </Filenames>\r
         </Section>\r
         <Section SectionType="EFI_SECTION_PE32"/>\r
index 8e7ef78..621ec60 100644 (file)
@@ -738,6 +738,29 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     </sequential>\r
   </macrodef>\r
 \r
+  <!--\r
+      Build the real mode ASM file\r
+    -->\r
+  <macrodef name="Build_RealAsm">\r
+    <attribute name="FILEPATH"/>\r
+    <attribute name="FILENAME"/>\r
+    <attribute name="FILEEXT" default="asm"/>\r
+\r
+    <element name="EXTRA.INC" optional="yes"/>\r
+    <element name="EXTRA.ARG" optional="yes"/>\r
+    \r
+    <sequential>\r
+      <!-- Lack Dependency Check -->\r
+      <exec dir="${DEST_DIR_OUTPUT}" executable="${ASM}" failonerror="true">\r
+        <arg line="/nologo /omf ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT} /Bl${ASMLINK} ${ASMLINK_FLAGS}"/>\r
+      </exec>\r
+      <concat destfile="${DEST_DIR_OUTPUT}/@{FILENAME}.cat" binary="yes">\r
+        <filelist dir="${MODULE_DIR}" files="Blank2.pad"/>\r
+        <filelist dir="${DEST_DIR_OUTPUT}" files="@{FILENAME}.com"/>\r
+      </concat>\r
+    </sequential>\r
+  </macrodef>\r
+  \r
   <!--\r
     DUMMY\r
     -->\r
@@ -1124,6 +1147,41 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     </sequential>\r
   </macrodef>\r
 \r
+  <!--\r
+    EFI_SECTION_RAW_SEC\r
+    -->\r
+  <macrodef name="EFI_SECTION_RAW_SEC">\r
+    <attribute name="FILEPATH"/>\r
+    <attribute name="FILENAME"/>\r
+    <attribute name="FILEEXT" default="cat"/>\r
+\r
+    <element name="PRE.PROCESS" optional="yes"/>\r
+    <element name="POST.PROCESS" optional="yes"/>\r
+\r
+    <sequential>\r
+      <OnDependency>\r
+        <sourcefiles>\r
+          <file name="${DEST_DIR_OUTPUT}/ResetVec.@{FILEEXT}"/>\r
+          <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.te"/>\r
+        </sourcefiles>\r
+        <targetfiles>\r
+          <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
+        </targetfiles>\r
+\r
+        <sequential>\r
+          <PRE.PROCESS/>\r
+          <secfixup secexefile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" resetvectorDatafile="${DEST_DIR_OUTPUT}/ResetVec.@{FILEEXT}"\r
+                   outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.bin"/>\r
+                   \r
+          <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.bin" \r
+                      outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
+                      sectiontype="EFI_SECTION_RAW"/>\r
+          <POST.PROCESS/>\r
+        </sequential>\r
+      </OnDependency>\r
+    </sequential>\r
+  </macrodef>\r
+  \r
   <!--\r
     EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
     -->\r
index 26b9390..baa9eab 100644 (file)
@@ -379,7 +379,7 @@ public class FfsProcess {
             if (fileName == null) {\r
                 ele.setAttribute("file", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
             } else {\r
-                ele.setAttribute("file", "${PLATFORM_DIR}" + File.separatorChar + fileName);\r
+                ele.setAttribute("file", fileName);\r
             }\r
             root.appendChild(ele);\r
         } else {\r
@@ -390,7 +390,7 @@ public class FfsProcess {
             if (fileName == null) {\r
                 ele.setAttribute("fileName", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
             } else {\r
-                ele.setAttribute("fileName", "${PLATFORM_DIR}" + File.separatorChar + fileName);\r
+                ele.setAttribute("fileName", fileName);\r
             }\r
             root.appendChild(ele);\r
         }\r
index 4ba6ec4..3d17bef 100644 (file)
@@ -77,9 +77,9 @@ public class FrameworkBuildTask extends Task{
     \r
     private Set<File> msaFiles = new LinkedHashSet<File>();\r
     \r
-    //\r
-    // This is only for none-multi-thread build to reduce overriding message\r
-    //\r
+    ///\r
+    /// This is only for none-multi-thread build to reduce overriding message\r
+    ///\r
     public static Hashtable<String, String> originalProperties = new Hashtable<String, String>();\r
     \r
     String toolsDefFilename = ToolDefinitions.DEFAULT_TOOLS_DEF_FILE_PATH;\r
index a38c3c6..da6847d 100644 (file)
@@ -465,7 +465,11 @@ public class ModuleBuildFileGenerator {
             String[] list = fp.getGenSectionElements(document, "${BASE_NAME}", fpdModuleId.getModule().getGuid(), targetFilename);\r
 \r
             for (int i = 0; i < list.length; i++) {\r
-                Element ele = document.createElement(list[i]);\r
+                String sectiontype = list[i];\r
+                if (sectiontype.equalsIgnoreCase("EFI_SECTION_RAW") && project.getProperty("MODULE_TYPE").equalsIgnoreCase("SEC")) {\r
+                    sectiontype += "_SEC";\r
+                }\r
+                Element ele = document.createElement(sectiontype);\r
                 ele.setAttribute("FILEPATH", ".");\r
                 ele.setAttribute("FILENAME", "${BASE_NAME}");\r
                 root.appendChild(ele);\r
index 86fb256..d45abcd 100644 (file)
@@ -337,10 +337,10 @@ public class FpdParserTask extends Task {
             }\r
         }\r
     }\r
+    \r
     /**\r
       This method is used for Single Module Build.\r
 \r
-\r
       @throws BuildException\r
                   FPD file is not valid.\r
     **/\r