FF-A: Error code should be 32-bit sized
Change-Id: I35a17d4801cdb9456a68495a248807aacb175e8d
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/hf/ffa_internal.h b/inc/hf/ffa_internal.h
index 8a35ebe..fa28251 100644
--- a/inc/hf/ffa_internal.h
+++ b/inc/hf/ffa_internal.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 The Hafnium Authors.
+ * Copyright 2021 The Hafnium Authors.
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file or at
@@ -15,10 +15,10 @@
#include "vmapi/hf/ffa.h"
#define FFA_VERSION_RESERVED_BIT UINT32_C(1U << 31)
-
-static inline struct ffa_value ffa_error(uint64_t error_code)
+static inline struct ffa_value ffa_error(int32_t error_code)
{
- return (struct ffa_value){.func = FFA_ERROR_32, .arg2 = error_code};
+ return (struct ffa_value){.func = FFA_ERROR_32,
+ .arg2 = (uint32_t)error_code};
}
/**
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 2cb0514..4e09301 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 The Hafnium Authors.
+ * Copyright 2021 The Hafnium Authors.
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file or at
@@ -228,6 +228,11 @@
uint64_t arg7;
};
+static inline int32_t ffa_error_code(struct ffa_value val)
+{
+ return (int32_t)val.arg2;
+}
+
static inline ffa_vm_id_t ffa_msg_send_sender(struct ffa_value args)
{
return (args.arg1 >> 16) & 0xffff;