DPE: Create new DICE Protection Environment partition
Create the basic partition source files, manifest and build system for
the DICE Protection Environment (DPE) partition.
Implements a CBOR decoding layer for decoding DPE commands received as
CBOR objects. Provides a convenience client API that encodes the CBOR
commands from DPE API calls.
The implementation of the DPE commands inside the service is empty in
this patch.
Signed-off-by: Jamie Fox <jamie.fox@arm.com>
Change-Id: Id9c17a75ea738c77407f1c552b15b6b88dfef53e
diff --git a/partitions/dice_protection_environment/dpe_cmd_decode.h b/partitions/dice_protection_environment/dpe_cmd_decode.h
new file mode 100644
index 0000000..b7ac721
--- /dev/null
+++ b/partitions/dice_protection_environment/dpe_cmd_decode.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __DPE_CMD_DECODE_H__
+#define __DPE_CMD_DECODE_H__
+
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Call the DPE service with a CBOR-encoded DPE command.
+ *
+ * \param[in] client_id Identifier of the client calling the service.
+ * \param[in] cmd_input Pointer to buffer containing the input
+ * CBOR-encoded DPE command.
+ * \param[in] cmd_input_size Size of the input command, in bytes.
+ * \param[out] cmd_output Pointer to buffer to write the CBOR-encoded
+ * DPE command output.
+ * \param[in,out] cmd_output_size On input, size of the command output buffer
+ * in bytes. On successful return, size of the
+ * response written to the buffer.
+ *
+ * \note The cmd_input and cmd_output memory areas may overlap.
+ *
+ * \return Returns 0 if call succeeded and cmd_output contains a valid response
+ * and returns less than 0 otherwise.
+ */
+int32_t dpe_command_decode(int32_t client_id,
+ const char *cmd_input, size_t cmd_input_size,
+ char *cmd_output, size_t *cmd_output_size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __DPE_CMD_DECODE_H__ */