Remove own_id global variable from SP deployments
Move own_id to local namespace as both ffarpc_call_ep and ffarpc_caller
dependency on global own_id has been resolved.
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I86b68a4a05285763218a9e60d6e4d4877b322707
diff --git a/deployments/attestation/common/attestation_sp.c b/deployments/attestation/common/attestation_sp.c
index c4d4e9c..aaa6695 100644
--- a/deployments/attestation/common/attestation_sp.c
+++ b/deployments/attestation/common/attestation_sp.c
@@ -25,9 +25,6 @@
#include <sp_rxtx.h>
#include <trace.h>
-uint16_t own_id = 0; /* !!Needs refactoring as parameter to ffarpc_caller_init */
-
-
static int sp_init(uint16_t *own_sp_id);
static void locate_crypto_service(void);
@@ -38,6 +35,7 @@
struct rpc_interface *attest_iface;
struct ffa_call_ep ffarpc_call_ep;
struct sp_msg req_msg;
+ uint16_t own_id = 0;
/* Claim source objects */
struct claim_source *claim_source;
diff --git a/deployments/crypto/common/crypto_sp.c b/deployments/crypto/common/crypto_sp.c
index b198d19..eba486b 100644
--- a/deployments/crypto/common/crypto_sp.c
+++ b/deployments/crypto/common/crypto_sp.c
@@ -17,10 +17,6 @@
#include <sp_rxtx.h>
#include <trace.h>
-
-uint16_t own_id = 0; /* !!Needs refactoring as parameter to ffarpc_caller_init */
-
-
static int sp_init(uint16_t *own_sp_id);
void __noreturn sp_main(struct ffa_init_info *init_info)
@@ -31,6 +27,7 @@
struct sp_msg req_msg = { 0 };
struct sp_msg resp_msg = { 0 };
struct storage_backend *storage_backend;
+ uint16_t own_id = 0;
/* Boot phase */
if (sp_init(&own_id) != 0) goto fatal_error;
diff --git a/deployments/env-test/common/env_test.c b/deployments/env-test/common/env_test.c
index 5b8b84a..1e24c0b 100644
--- a/deployments/env-test/common/env_test.c
+++ b/deployments/env-test/common/env_test.c
@@ -16,10 +16,6 @@
#include <trace.h>
#include "env_test_tests.h"
-
-uint16_t own_id = 0; /* !!Needs refactoring as parameter to ffarpc_caller_init */
-
-
static int sp_init(uint16_t *own_sp_id);
void __noreturn sp_main(struct ffa_init_info *init_info)
@@ -29,6 +25,7 @@
struct rpc_interface *test_runner_iface;
struct ffarpc_caller ffarpc_caller;
struct sp_msg req_msg;
+ uint16_t own_id = 0;
/* Boot */
if (sp_init(&own_id) != 0) goto fatal_error;
diff --git a/deployments/internal-trusted-storage/common/its_sp.c b/deployments/internal-trusted-storage/common/its_sp.c
index f3a6837..c89c5b2 100644
--- a/deployments/internal-trusted-storage/common/its_sp.c
+++ b/deployments/internal-trusted-storage/common/its_sp.c
@@ -14,7 +14,6 @@
#include <sp_rxtx.h>
#include <trace.h>
-uint16_t own_id = 0;
static uint8_t tx_buffer[4096] __aligned(4096);
static uint8_t rx_buffer[4096] __aligned(4096);
@@ -28,6 +27,7 @@
struct sp_msg resp_msg = { 0 };
struct secure_storage_provider secure_storage_provider;
struct storage_backend *storage_backend;
+ uint16_t own_id = 0;
/* Boot */
(void) init_info;
diff --git a/deployments/protected-storage/common/ps_sp.c b/deployments/protected-storage/common/ps_sp.c
index 9b55e9a..2859dba 100644
--- a/deployments/protected-storage/common/ps_sp.c
+++ b/deployments/protected-storage/common/ps_sp.c
@@ -14,7 +14,6 @@
#include <sp_rxtx.h>
#include <trace.h>
-uint16_t own_id = 0;
static uint8_t tx_buffer[4096] __aligned(4096);
static uint8_t rx_buffer[4096] __aligned(4096);
@@ -28,6 +27,7 @@
struct sp_msg resp_msg = { 0 };
struct secure_storage_provider secure_storage_provider;
struct storage_backend *storage_backend;
+ uint16_t own_id = 0;
/* Boot */
(void) init_info;
diff --git a/deployments/se-proxy/common/se_proxy_sp.c b/deployments/se-proxy/common/se_proxy_sp.c
index fd314e4..70eddb8 100644
--- a/deployments/se-proxy/common/se_proxy_sp.c
+++ b/deployments/se-proxy/common/se_proxy_sp.c
@@ -14,9 +14,6 @@
#include "service_proxy_factory.h"
#include "../se_proxy_interfaces.h"
-uint16_t own_id = 0; /* !!Needs refactoring as parameter to ffarpc_caller_init */
-
-
static int sp_init(uint16_t *own_sp_id);
void __noreturn sp_main(struct ffa_init_info *init_info)
@@ -25,6 +22,7 @@
struct sp_msg req_msg;
struct rpc_demux rpc_demux;
struct rpc_interface *rpc_iface;
+ uint16_t own_id = 0;
/* Boot phase */
if (sp_init(&own_id) != 0) goto fatal_error;
diff --git a/deployments/sfs-demo/common/sfs_demo_sp.c b/deployments/sfs-demo/common/sfs_demo_sp.c
index 0b749b4..558f5b3 100644
--- a/deployments/sfs-demo/common/sfs_demo_sp.c
+++ b/deployments/sfs-demo/common/sfs_demo_sp.c
@@ -23,7 +23,6 @@
{ 0x48, 0xef, 0x1e, 0xdc, 0x7a, 0xb1, 0xcf, 0x4c, \
0xac, 0x8b, 0xdf, 0xcf, 0xf7, 0x71, 0x1b, 0x14, }
-uint16_t own_id = 0;
static uint8_t tx_buffer[4096] __aligned(4096);
static uint8_t rx_buffer[4096] __aligned(4096);
static const uint8_t its_uuid[] = SP_ITS_UUID_BYTES;
@@ -138,6 +137,7 @@
struct storage_backend *storage_backend;
uint16_t sp_ids[3];
uint32_t sp_id_cnt = 0;
+ uint16_t own_id = 0;
/* Boot */
(void) init_info;
diff --git a/deployments/smm-gateway/common/smm_gateway_sp.c b/deployments/smm-gateway/common/smm_gateway_sp.c
index 3062877..9f930b4 100644
--- a/deployments/smm-gateway/common/smm_gateway_sp.c
+++ b/deployments/smm-gateway/common/smm_gateway_sp.c
@@ -20,8 +20,6 @@
#define CONFIG_NAME_MM_COMM_BUFFER_REGION "mm-comm-buffer"
-uint16_t own_id = 0; /* !!Needs refactoring as parameter to ffarpc_caller_init */
-
static int sp_init(uint16_t *own_sp_id);
void __noreturn sp_main(struct ffa_init_info *init_info)
@@ -33,6 +31,7 @@
struct mm_communicate_ep mm_communicate_call_ep = { 0 };
struct ffa_direct_msg req_msg = { 0 };
struct ffa_direct_msg resp_msg = { 0 };
+ uint16_t own_id = 0;
static const EFI_GUID smm_variable_guid = SMM_VARIABLE_GUID;