summaryrefslogtreecommitdiff
path: root/source/compiler/dtfield.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler/dtfield.c')
-rw-r--r--source/compiler/dtfield.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/source/compiler/dtfield.c b/source/compiler/dtfield.c
index 919ee9d35..46d56f801 100644
--- a/source/compiler/dtfield.c
+++ b/source/compiler/dtfield.c
@@ -383,21 +383,37 @@ DtCompileInteger (
return;
}
- /* Ensure that reserved fields are set to zero */
- /* TBD: should we set to zero, or just make this an ERROR? */
- /* TBD: Probably better to use a flag */
+ /*
+ * Ensure that reserved fields are set properly. Note: uses
+ * the DT_NON_ZERO flag to indicate that the reserved value
+ * must be exactly one. Otherwise, the value must be zero.
+ * This is sufficient for now.
+ */
+
+ /* TBD: Should use a flag rather than compare "Reserved" */
- if (!ACPI_STRCMP (Field->Name, "Reserved") &&
- (Value != 0))
+ if (!ACPI_STRCMP (Field->Name, "Reserved"))
{
- DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
- "Setting to zero");
- Value = 0;
+ if (Flags & DT_NON_ZERO)
+ {
+ if (Value != 1)
+ {
+ DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
+ "Must be one, setting to one");
+ Value = 1;
+ }
+ }
+ else if (Value != 0)
+ {
+ DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
+ "Must be zero, setting to zero");
+ Value = 0;
+ }
}
/* Check if the value must be non-zero */
- if ((Value == 0) && (Flags & DT_NON_ZERO))
+ else if ((Flags & DT_NON_ZERO) && (Value == 0))
{
DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL);
}