Extend SMM Variable function support
Extends base SMM Variable functions to support EDK2 specific
functions for setting and getting variable check properties and
for getting the maximum payload size. Includes the checking
of constraints specified by variable check properties. Component
and service level tests are extended to cover the new
functionality.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I9a48908caf2b72d490270a32e2e7ad618b7b6707
diff --git a/protocols/service/smm_variable/parameters.h b/protocols/service/smm_variable/parameters.h
index 24fab55..1f795a9 100644
--- a/protocols/service/smm_variable/parameters.h
+++ b/protocols/service/smm_variable/parameters.h
@@ -99,5 +99,48 @@
uint32_t Attributes;
} SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO;
+/**
+ * Variable check property structure. Specifies check constraints
+ * for a variable.
+ */
+typedef struct {
+ uint16_t Revision;
+ uint16_t Property;
+ uint32_t Attributes;
+ uint64_t MinSize;
+ uint64_t MaxSize;
+} VAR_CHECK_VARIABLE_PROPERTY;
+
+#define VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY (1U << 0)
+
+/* Supported check property revision */
+#define VAR_CHECK_VARIABLE_PROPERTY_REVISION (0x0001)
+
+/**
+ * Parameter structure for VarCheckVariableProperty Set/Get
+ */
+typedef struct {
+ EFI_GUID Guid;
+ uint64_t NameSize;
+ VAR_CHECK_VARIABLE_PROPERTY VariableProperty;
+ int16_t Name[1];
+} SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY;
+
+#define SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY_NAME_OFFSET \
+ offsetof(SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY, Name)
+
+#define SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY_TOTAL_SIZE(s) \
+ (offsetof(SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY, Name) + s->NameSize)
+
+#define SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY_SIZE(name_size) \
+ (offsetof(SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY, Name) + name_size)
+
+/**
+ * Parameter structure for GetPayloadSize.
+ */
+typedef struct {
+ uint64_t VariablePayloadSize;
+} SMM_VARIABLE_COMMUNICATE_GET_PAYLOAD_SIZE;
+
#endif /* TS_SMM_VARIABLE_PARAMETERS_H */