Add 'greater than' support in depex computation.
Added support in code to compute depex expressions
with _GE_ and _GTE_.
Tested:
With bios.xml file which had the following knob:
<knob
type="scalar"
setupType="numeric"
name="CoreDisableMask_0"
varstoreIndex="05"
prompt="CoreDisableMask_0"
description="Core Disable Bitmap (Hex) 0:
Enable all cores. 0xffff: Disable all cores "
size="8"
offset="0x014A"
depex="Sif( SstPpLevelTotalCount _GT_ 1
AND ( ( IssTdpLevel _EQU_ 0xFF
AND SstPpLevelEnableSystem_0 _NEQ_ 1 )
OR ( IssTdpLevel _NEQ_ 0xFF AND IssTdpLevel _GT_ 0 )
OR DynamicIss _EQU_ 1 ) )"
default="0x0000000000000000"
CurrentVal="0x0000000000000000"
min="0x0"
max="0xFFFFFFFFFFFFFFFF"
step="0x1"/>
Signed-off-by: Arun Lal K M <arun.lal@intel.com>
Change-Id: I45cd879ca1bb35e6cde9ea581b3a5c63577525d0
diff --git a/include/biosxml.hpp b/include/biosxml.hpp
index 4e41e61..573115d 100644
--- a/include/biosxml.hpp
+++ b/include/biosxml.hpp
@@ -62,6 +62,8 @@
unknown = 0,
OR,
AND,
+ GT,
+ GTE,
LTE,
LT,
EQU,
@@ -433,6 +435,26 @@
values.emplace(0);
break;
+ case knob::DepexOperators::GTE:
+ if (a >= b)
+ {
+ values.emplace(1);
+ break;
+ }
+
+ values.emplace(0);
+ break;
+
+ case knob::DepexOperators::GT:
+ if (a > b)
+ {
+ values.emplace(1);
+ break;
+ }
+
+ values.emplace(0);
+ break;
+
case knob::DepexOperators::MODULO:
if (b == 0)
{
@@ -539,6 +561,14 @@
{
operators.emplace(knob::DepexOperators::LT);
}
+ else if (word == "_GTE_")
+ {
+ operators.emplace(knob::DepexOperators::GTE);
+ }
+ else if (word == "_GT_")
+ {
+ operators.emplace(knob::DepexOperators::GT);
+ }
else if (word == "_NEQ_")
{
operators.emplace(knob::DepexOperators::NEQ);