+
+int
+tf_session_get_sram_db(struct tf *tfp,
+ void **sram_handle)
+{
+ struct tf_session *tfs = NULL;
+ int rc = 0;
+
+ *sram_handle = NULL;
+
+ if (tfp == NULL)
+ return (-EINVAL);
+
+ rc = tf_session_get_session_internal(tfp, &tfs);
+ if (rc)
+ return rc;
+
+ *sram_handle = tfs->sram_handle;
+ return rc;
+}
+
+int
+tf_session_set_sram_db(struct tf *tfp,
+ void *sram_handle)
+{
+ struct tf_session *tfs = NULL;
+ int rc = 0;
+
+ if (tfp == NULL)
+ return (-EINVAL);
+
+ rc = tf_session_get_session_internal(tfp, &tfs);
+ if (rc)
+ return rc;
+
+ tfs->sram_handle = sram_handle;
+ return rc;
+}
+