config-tools: refine MAX_MSIX_TABLE_NUM

If the MAX_MSIX_TABLE_NUM is specified in scenario.xml. Return the
largest number from count of MSI, table_size of MSIX or
MAX_MSIX_TABLE_NUM of scenario.xml.

Tracked-On: #6235
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
This commit is contained in:
Yang,Yu-chu 2021-08-09 13:18:31 -07:00 committed by wenlingz
parent 8333ba2c7b
commit 1ca9061b6d
4 changed files with 33 additions and 7 deletions

View File

@ -6,7 +6,9 @@
<xsl:stylesheet
version="1.0"
xmlns:xi="http://www.w3.org/2003/XInclude"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:acrn="http://projectacrn.org">
<xsl:include href="lib.xsl" />
<xsl:output method="text" />
<xsl:variable name="integer-suffix" select="'U'" />

View File

@ -6,7 +6,9 @@
<xsl:stylesheet
version="1.0"
xmlns:xi="http://www.w3.org/2003/XInclude"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:acrn="http://projectacrn.org">
<xsl:include href="lib.xsl" />
<xsl:output method="text" />
<xsl:variable name="integer-suffix" select="''" />

View File

@ -258,11 +258,20 @@
<xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="integer-by-key-value">
<xsl:with-param name="key" select="'MAX_MSIX_TABLE_NUM'" />
<xsl:with-param name="value" select="$max" />
<xsl:with-param name="default" select="'64'" />
</xsl:call-template>
<xsl:choose>
<xsl:when test="//CAPACITIES/MAX_MSIX_TABLE_NUM/text()">
<xsl:call-template name="integer-by-key-value">
<xsl:with-param name="key" select="'MAX_MSIX_TABLE_NUM'" />
<xsl:with-param name="value" select="acrn:max($max, //CAPACITIES/MAX_MSIX_TABLE_NUM)" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="integer-by-key-value">
<xsl:with-param name="key" select="'MAX_MSIX_TABLE_NUM'" />
<xsl:with-param name="value" select="$max" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="hex-to-bin">

View File

@ -128,6 +128,19 @@
</xsl:choose>
</func:function>
<func:function name="acrn:max">
<xsl:param name="a" />
<xsl:param name="b" />
<xsl:choose>
<xsl:when test="$a &gt; $b">
<func:result select="$a" />
</xsl:when>
<xsl:otherwise>
<func:result select="$b" />
</xsl:otherwise>
</xsl:choose>
</func:function>
<func:function name="acrn:find-list-min">
<xsl:param name="list" />
<xsl:param name="delimar" />