Support modular extension of service provider capabilities

To allow a service provider to be scalable in a modular way, the
existing chain-of-resopnsibility facilty provided by the base
service_provider is exploited to allow a set of sub providers
to extend the capabilities of the base provider.  The first
use of this will be to support modular extension of the crypto
service provider.

Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I4369d7a9cb99e54403768a9e3459b0ba1ac8f812
diff --git a/components/service/crypto/provider/crypto_provider.c b/components/service/crypto/provider/crypto_provider.c
index c3d55b5..6777fd2 100644
--- a/components/service/crypto/provider/crypto_provider.c
+++ b/components/service/crypto/provider/crypto_provider.c
@@ -75,6 +75,12 @@
 		context->serializers[encoding] = serializer;
 }
 
+void crypto_provider_extend(struct crypto_provider *context,
+                    struct service_provider *sub_provider)
+{
+	service_provider_extend(&context->base_provider, sub_provider);
+}
+
 static const struct crypto_provider_serializer* get_crypto_serializer(void *context,
 														const struct call_req *req)
 {
diff --git a/components/service/crypto/provider/crypto_provider.h b/components/service/crypto/provider/crypto_provider.h
index a45b14c..7cd91a9 100644
--- a/components/service/crypto/provider/crypto_provider.h
+++ b/components/service/crypto/provider/crypto_provider.h
@@ -46,6 +46,12 @@
 void crypto_provider_register_serializer(struct crypto_provider *context,
                     unsigned int encoding, const struct crypto_provider_serializer *serializer);
 
+/*
+ * Extend the core set of operations provided by the crypto provider.
+ */
+void crypto_provider_extend(struct crypto_provider *context,
+                    struct service_provider *sub_provider);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif