AuditLog: PSA API header
This change introduces the first draft of the PSA Audit Log
API header. The Audit logging service allows secure services
in the system to log critical system events and information
that have security implications.
Change-Id: Ib5f7e594db68091356325caf6d98288adfb66946
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/interface/include/psa_audit_defs.h b/interface/include/psa_audit_defs.h
new file mode 100644
index 0000000..1aeee33
--- /dev/null
+++ b/interface/include/psa_audit_defs.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2018, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __PSA_AUDIT_DEFS_H__
+#define __PSA_AUDIT_DEFS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include "tfm_api.h"
+#include "limits.h"
+
+/* The return value is shared with the TFM partition status value. The Audit
+ * Log return codes shouldn't overlap with predefined TFM status values
+ */
+#define PSA_AUDIT_ERR_OFFSET (TFM_PARTITION_SPECIFIC_ERROR_MIN)
+
+enum psa_audit_err {
+ PSA_AUDIT_ERR_SUCCESS = 0, /*!< Operation successful */
+ PSA_AUDIT_ERR_FAILURE = PSA_AUDIT_ERR_OFFSET, /*!< Generic failure */
+ PSA_AUDIT_ERR_NOT_SUPPORTED, /*!< Operation not supported */
+
+ /* Following entry is only to ensure the error code of int size */
+ PSA_AUDIT_ERR_FORCE_INT_SIZE = INT_MAX
+};
+
+/*!
+ * \struct psa_audit_record
+ *
+ * \brief This structure contains the record that is added to the audit log
+ * by the requesting secure service
+ */
+struct psa_audit_record {
+ uint32_t size; /*!< Size in bytes of the id and payload fields */
+ uint32_t id; /*!< ID of the record */
+ uint8_t payload[]; /*!< Flexible array member for payload */
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __PSA_AUDIT_DEFS_H__ */