aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2021-03-06 04:36:26 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2021-04-06 17:17:38 +0300
commitce077064a4e5cc426e8198d90083e1be07d13637 (patch)
tree739e0c5d3f2692c216eac3b808aa71dea2a323b2
parent17b0e4d6b4a49fd5afc6e9af1694d9f93b93411a (diff)
downloadmeta-qcom-ce077064a4e5cc426e8198d90083e1be07d13637.tar.gz
meta-qcom-ce077064a4e5cc426e8198d90083e1be07d13637.tar.bz2
meta-qcom-ce077064a4e5cc426e8198d90083e1be07d13637.zip
fastrpc: fix search paths
Look for cDSP-related files in /usr/lib/rfsa/cdsp rather than /usr/lib/rfsa/adsp Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> (cherry picked from commit f84f3ab2721dd6588d2711f4a8a315e528f43cb7)
-rw-r--r--recipes-support/fastrpc/fastrpc/0001-apps_std_fopen_with_env-account-for-domain-kinds-whe.patch128
-rw-r--r--recipes-support/fastrpc/fastrpc_git.bb1
2 files changed, 129 insertions, 0 deletions
diff --git a/recipes-support/fastrpc/fastrpc/0001-apps_std_fopen_with_env-account-for-domain-kinds-whe.patch b/recipes-support/fastrpc/fastrpc/0001-apps_std_fopen_with_env-account-for-domain-kinds-whe.patch
new file mode 100644
index 0000000..1206c6e
--- /dev/null
+++ b/recipes-support/fastrpc/fastrpc/0001-apps_std_fopen_with_env-account-for-domain-kinds-whe.patch
@@ -0,0 +1,128 @@
+From 771c3bc695a18b3bdedea6fac44b3e71708cc540 Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Date: Sat, 6 Mar 2021 04:25:01 +0300
+Subject: [PATCH] apps_std_fopen_with_env: account for domain kinds when
+ looking for data
+
+Currenty apps_std_fopen_with_env() will care about domain only in the
+fallback path when looking into /dsp/ dir (/dsp/adsp, /dsp/cdsp, etc).
+Account for different domains when looking for the file in the path (so
+that e.g. cDSP files will be looked up in the /usr/lib/rfsa/cdsp
+directory rather than the default /usr/lib/rfsa/adsp).
+
+Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Change-Id: I1dac61d36edc9e8ff1fdc2d56f968d2578f10399
+---
+ src/apps_std_imp.c | 60 ++++++++++++++++++++++------------------------
+ 1 file changed, 28 insertions(+), 32 deletions(-)
+
+diff --git a/src/apps_std_imp.c b/src/apps_std_imp.c
+index d2559c60d2d6..701d799f5608 100644
+--- a/src/apps_std_imp.c
++++ b/src/apps_std_imp.c
+@@ -662,6 +662,7 @@ __QAIC_IMPL_EXPORT int __QAIC_IMPL(apps_std_fopen_with_env)(const char* envvarna
+ char *absName = NULL;
+ uint16 absNameLen = 0;
+ int domain;
++ const char *dspName = NULL;
+
+ VERIFYC(NULL != mode, AEE_EINVALIDMODE);
+ VERIFYC(NULL != delim, AEE_EINVALIDFORMAT);
+@@ -670,8 +671,23 @@ __QAIC_IMPL_EXPORT int __QAIC_IMPL(apps_std_fopen_with_env)(const char* envvarna
+ VERIFY(0 == (nErr = get_dirlist_from_env(envvarname, &dirListBuf )));
+ VERIFYC(NULL != (dirList = dirListBuf), AEE_EMEMPTR);
+
++ domain = get_domain_id() & DOMAIN_ID_MASK;
++
++ if (domain == ADSP_DOMAIN_ID){
++ dspName = "adsp";
++ } else if (domain == MDSP_DOMAIN_ID){
++ dspName = "mdsp";
++ } else if (domain == SDSP_DOMAIN_ID){
++ dspName = "sdsp";
++ } else if (domain == CDSP_DOMAIN_ID) {
++ dspName = "cdsp";
++ } else {
++ dspName = "adsp";
++ }
++
+ while(dirList)
+ {
++ int dirNameLen;
+ pos = strstr(dirList, delim);
+ dirName = dirList;
+ if (pos) {
+@@ -682,10 +698,13 @@ __QAIC_IMPL_EXPORT int __QAIC_IMPL(apps_std_fopen_with_env)(const char* envvarna
+ }
+
+ // Account for slash char
+- absNameLen = std_strlen(dirName) + std_strlen(name) + 2;
++ dirNameLen = std_strlen(dirName);
++ absNameLen = dirNameLen + std_strlen(name) + 2;
+ VERIFYC(NULL != (absName = (char*)malloc(sizeof(char) * absNameLen)), AEE_ENOMEMORY);
+ if ('\0' != *dirName) {
+ std_strlcpy(absName, dirName, absNameLen);
++ if (!std_strcmp(absName + dirNameLen - 4, "adsp"))
++ std_memscpy(absName + dirNameLen - 4, 4, dspName, 4);
+ std_strlcat(absName, "/", absNameLen);
+ std_strlcat(absName, name, absNameLen);
+ } else {
+@@ -699,47 +718,24 @@ __QAIC_IMPL_EXPORT int __QAIC_IMPL(apps_std_fopen_with_env)(const char* envvarna
+ goto bail;
+ }
+ }
+- domain = get_domain_id() & DOMAIN_ID_MASK;
+
+ #ifdef ANDROID_P
+ absNameLen = std_strlen("/vendor/dsp/adsp/") + std_strlen(name) + 1;
+ VERIFYC(NULL != (absName = (char*)malloc(sizeof(char) * absNameLen)), AEE_ENOMEMORY);
+
+- if (domain == ADSP_DOMAIN_ID){
+- std_strlcpy(absName, "/vendor/dsp/adsp/", absNameLen);
+- std_strlcat(absName, name,absNameLen);
+- } else if (domain == MDSP_DOMAIN_ID){
+- std_strlcpy(absName, "/vendor/dsp/mdsp/", absNameLen);
+- std_strlcat(absName, name,absNameLen);
+- } else if (domain == SDSP_DOMAIN_ID){
+- std_strlcpy(absName, "/vendor/dsp/sdsp/", absNameLen);
+- std_strlcat(absName, name,absNameLen);
+- } else if (domain == CDSP_DOMAIN_ID) {
+- std_strlcpy(absName, "/vendor/dsp/cdsp/", absNameLen);
+- std_strlcat(absName, name,absNameLen);
+- } else {
+- absName[0] = '\0';
+- }
++ std_strlcpy(absName, "/vendor/dsp/", absNameLen);
++ std_strlcat(absName, dspName, absNameLen);
++ std_strlcat(absName, "/", absNameLen);
++ std_strlcat(absName, name,absNameLen);
+ nErr = apps_std_fopen(absName, mode, psout);
+ #else
+ absNameLen = std_strlen("/dsp/adsp/") + std_strlen(name) + 1;
+ VERIFYC(NULL != (absName = (char*)malloc(sizeof(char) * absNameLen)), AEE_ENOMEMORY);
+
+- if (domain == ADSP_DOMAIN_ID){
+- std_strlcpy(absName, "/dsp/adsp/", absNameLen);
+- std_strlcat(absName, name,absNameLen);
+- } else if (domain == MDSP_DOMAIN_ID){
+- std_strlcpy(absName, "/dsp/mdsp/", absNameLen);
+- std_strlcat(absName, name,absNameLen);
+- } else if (domain == SDSP_DOMAIN_ID){
+- std_strlcpy(absName, "/dsp/sdsp/", absNameLen);
+- std_strlcat(absName, name,absNameLen);
+- } else if (domain == CDSP_DOMAIN_ID) {
+- std_strlcpy(absName, "/dsp/cdsp/", absNameLen);
+- std_strlcat(absName, name,absNameLen);
+- } else {
+- absName[0] = '\0';
+- }
++ std_strlcpy(absName, "/dsp/", absNameLen);
++ std_strlcat(absName, dspName, absNameLen);
++ std_strlcat(absName, "/", absNameLen);
++ std_strlcat(absName, name,absNameLen);
+ nErr = apps_std_fopen(absName, mode, psout);
+ #endif
+ bail:
+--
+2.30.0
+
diff --git a/recipes-support/fastrpc/fastrpc_git.bb b/recipes-support/fastrpc/fastrpc_git.bb
index 2cc343e..179d42b 100644
--- a/recipes-support/fastrpc/fastrpc_git.bb
+++ b/recipes-support/fastrpc/fastrpc_git.bb
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://src/fastrpc_apps_user.c;beginline=1;endline=29;md5=f9
SRCREV = "bc36c705c9b057ca880a423021d3c19f02edeadd"
SRC_URI = "\
git://git.linaro.org/landing-teams/working/qualcomm/fastrpc.git;branch=automake;protocol=https \
+ file://0001-apps_std_fopen_with_env-account-for-domain-kinds-whe.patch \
file://adsprpcd.service \
file://cdsprpcd.service \
file://usr-lib-rfsa.service \