Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inc/AEEStdErr.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#define AEE_EINVALIDITEM (AEE_EOFFSET + 0x02A) ///< Current item is invalid, it can be a switch case or a pointer to memory
#define AEE_ENOTALLOWED (AEE_EOFFSET + 0x02B) ///< Not allowed to perform the
///< operation
#define AEE_EINVHANDLE (AEE_EOFFSET + 0x02C) ///< Invalid handle - adding here as its defined in vendor AEEStdErr.h - needed to check valid handle in stub.c
#define AEE_EINVHANDLE (AEE_EOFFSET + 0x02C) ///< Invalid handle - needed to check valid handle in stub.c
#define AEE_EOUTOFHANDLES (AEE_EOFFSET + 0x02D) ///< Out of handles (Handle list is already full)
//Hole here
#define AEE_ENOMORE (AEE_EOFFSET + 0x02F) ///< No more items available --
Expand Down
3 changes: 2 additions & 1 deletion inc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ noinst_HEADERS = \
dspqueue_rpc.h \
dspqueue_shared.h \
dspsignal.h \
fastrpc_android.h \
fastrpc_apps_user.h \
fastrpc_async.h \
fastrpc_cap.h \
Expand All @@ -53,7 +54,7 @@ noinst_HEADERS = \
fastrpc_procbuf.h \
fastrpc_process_attributes.h \
fastrpc_trace.h \
listener_android.h \
listener.h \
listener_buf.h \
log_config.h \
mod_table.h \
Expand Down
7 changes: 0 additions & 7 deletions inc/apps_std_internal.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are removing the support for /vendor/dsp, where is shell expected to be pushed for android targets ? if it is /usr/lib/dsp/ like other LE targets, is /usr partition available on android targets ?

how is this change tested on android targets ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to check where the shell should be placed if /vendor/dsp support is removed, or if we actually need to remove it in the first place.

Regarding testing: earlier, the daemons were already running (opened the shell) and the tests passed. After killing and updating with new daemons, the tests are now failing. I will check this further and update.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell is loaded from the same folder as all other DSP libraries. What's the question?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are removing the support for /vendor/dsp, where is shell expected to be pushed for android targets ? if it is /usr/lib/dsp/ like other LE targets, is /usr partition available on android targets ?

All DSP binaries are located in the subdirs of /usr/share/qcom, one subdir per device.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Android systems you can reuse the same approach, changing /usr/share/qcom/ to /vendor or its subdir. All config files should be relative to that path,

Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@
#define MAX_NON_PRELOAD_LIBS_LEN 2048
#define FILE_EXT ".so"

#ifndef VENDOR_DSP_LOCATION
#define VENDOR_DSP_LOCATION "/vendor/dsp/"
#endif
#ifndef VENDOR_DOM_LOCATION
#define VENDOR_DOM_LOCATION "/vendor/dsp/xdsp/"
#endif

// Search path used by fastRPC for acdb path
#ifndef ADSP_AVS_CFG_PATH
#define ADSP_AVS_CFG_PATH ";/etc/acdbdata/;"
Expand Down
17 changes: 17 additions & 0 deletions inc/fastrpc_android.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// SPDX-License-Identifier: BSD-3-Clause-Clear

#ifndef FASTRPC_ANDROID_H
#define FASTRPC_ANDROID_H

#include "fastrpc_common.h"

/* Platform property system functions */
int property_get_int32(const char *name, int value);
int property_get(const char *name, int *def, int *value);

/* Platform-specific property getter functions */
int platform_get_property_int(fastrpc_properties UserPropKey, int defValue);
int platform_get_property_string(fastrpc_properties UserPropKey, char *value, char *defValue);

#endif /*FASTRPC_ANDROID_H*/
6 changes: 3 additions & 3 deletions inc/fastrpc_apps_user.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause

#ifndef FASTRPC_ANDROID_USER_H
#define FASTRPC_ANDROID_USER_H
#ifndef FASTRPC_APPS_USER_H
#define FASTRPC_APPS_USER_H

#include <assert.h>
#include <fcntl.h>
Expand Down Expand Up @@ -134,4 +134,4 @@ int get_unsigned_pd_attribute(uint32_t domain, int *unsigned_module);
*/
int is_userspace_allocation_supported();

#endif //FASTRPC_ANDROID_USER_H
#endif //FASTRPC_APPS_USER_H
3 changes: 0 additions & 3 deletions inc/fastrpc_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#ifndef FASTRPC_TRACE_H
#define FASTRPC_TRACE_H

#if ((defined _ANDROID) || (defined ANDROID)) || (defined DISABLE_ATRACE) && !defined(LE_ENABLE)
//TODO: Bharath #include "cutils/trace.h" //for systrace support
#endif
#include "HAP_farf.h"

//for systrace support
Expand Down
12 changes: 6 additions & 6 deletions inc/listener_android.h → inc/listener.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause

#ifndef LISTENER_ANDROID_H
#define LISTENER_ANDROID_H
#ifndef LISTENER_H
#define LISTENER_H

#include <semaphore.h>
#include <dlfcn.h>
Expand All @@ -22,18 +22,18 @@
/*
* API to initialize globals and internal data structures used in listener modules
*/
int listener_android_init(void);
int listener_init(void);
/*
* API to de-initialize globals and internal data structures used in listener modules
*/
void listener_android_deinit(void);
void listener_deinit(void);
/*
* API to initialize domain specific data strcutures used in listener modules
*/
int listener_android_domain_init(int domain, int update_requested, sem_t *r_sem);
int listener_domain_init(int domain, int update_requested, sem_t *r_sem);
/*
* API to de-initialize domain specific data strcutures used in listener modules
*/
void listener_android_domain_deinit(int domain);
void listener_domain_deinit(int domain);

#endif
4 changes: 2 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LIBDSPRPC_SOURCES = \
dspsignal.c \
dspqueue/dspqueue_cpu.c \
dspqueue/dspqueue_rpc_stub.c \
listener_android.c \
listener.c \
apps_std_imp.c \
apps_mem_imp.c \
apps_mem_skel.c \
Expand Down Expand Up @@ -54,7 +54,7 @@ LIBDSPRPC_SOURCES = \
fastrpc_context.c

if ANDROID_CC
# Do nothing (or Android-specific sources)
LIBDSPRPC_SOURCES += fastrpc_android.c
else
LIBDSPRPC_SOURCES += fastrpc_config_parser.c
endif
Expand Down
21 changes: 0 additions & 21 deletions src/adspmsgd_printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,6 @@ typedef struct __attribute__((packed)) {
char file[LOG_FILENAME_SIZE];
} LogNode;

#if 0
static inline android_LogPriority convert_level_to_android_priority(
enum adspmsgd_apps_Level level)
{
switch (level) {
case LOW:
return LOW;
case MEDIUM:
return MEDIUM;
case HIGH:
return HIGH;
case ERROR:
return ERROR;
case FATAL:
return FATAL;
default:
return 0;
}
}
#endif

int adspmsgd_apps_log(const unsigned char *log_message_buffer,
int log_message_bufferLen) {
LogNode *logMessage = (LogNode *)log_message_buffer;
Expand Down
13 changes: 3 additions & 10 deletions src/apps_std_imp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ int fopen_from_dirlist(const char *dirList, const char *delim,
}
FREEIF(absName);

// fallback: If not found in domain path /vendor/dsp/adsp try in /vendor/dsp
// fallback to open the file without domain
absNameLen = strlen(dirName) + strlen(name) + 2;
VERIFYC(NULL != (absName = (char *)malloc(sizeof(char) * absNameLen)),
AEE_ENOMEMORY);
Expand Down Expand Up @@ -1172,14 +1172,7 @@ __QAIC_IMPL_EXPORT int __QAIC_IMPL(apps_std_fopen_with_env_fd)(
VERIFYC(NULL != delim, AEE_EBADPARM);
VERIFYC(NULL != name, AEE_EBADPARM);
VERIFYC(NULL != envvarname, AEE_EBADPARM);
#if 0 //TODO: Bharath
char *tempName = name;
tempName += 2;
if (tempName[0] == '\0') {
nErr = AEE_EBADPARM;
goto bail;
}
#endif

FASTRPC_ATRACE_BEGIN_L("%s for %s in %s mode from path in environment "
"variable %s delimited with %s",
__func__, name, mode, envvarname, delim);
Expand Down Expand Up @@ -1238,7 +1231,7 @@ __QAIC_IMPL_EXPORT int __QAIC_IMPL(apps_std_fopen_with_env_fd)(
}
FREEIF(absName);

// fallback: If not found in domain path /vendor/dsp/adsp try in /vendor/dsp
// fallback to open the file without domain
absNameLen = strlen(dirName) + strlen(name) + 2;
VERIFYC(NULL != (absName = (char *)malloc(sizeof(char) * absNameLen)),
AEE_ENOMEMORY);
Expand Down
58 changes: 58 additions & 0 deletions src/fastrpc_android.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// SPDX-License-Identifier: BSD-3-Clause-Clear

#include "fastrpc_android.h"
#include "HAP_farf.h"
#include <string.h>

#define PROPERTY_VALUE_MAX 92

/* Android P (vendor) property names */
const char *ANDROIDP_DEBUG_VAR_NAME[] = {"vendor.fastrpc.process.attrs",
"vendor.fastrpc.debug.trace",
"vendor.fastrpc.debug.testsig",
"vendor.fastrpc.perf.kernel",
"vendor.fastrpc.perf.adsp",
"vendor.fastrpc.perf.freq",
"vendor.fastrpc.debug.systrace",
"vendor.fastrpc.debug.pddump",
"persist.vendor.fastrpc.process.attrs",
"ro.build.type"};

int NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS =
sizeof(ANDROIDP_DEBUG_VAR_NAME) / sizeof(char *);

/* Stub implementations for property functions - to be implemented with actual Android property API */
int property_get_int32(const char *name, int value) {
return 0;
}

int property_get(const char *name, int *def, int *value) {
return 0;
}

int platform_get_property_int(fastrpc_properties UserPropKey, int defValue) {
if (((int)UserPropKey > NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS)) {
FARF(
ERROR,
"%s: Index %d out-of-bound for ANDROIDP_DEBUG_VAR_NAME array of len %d",
__func__, UserPropKey, NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS);
return defValue;
}
return (int)property_get_int32(ANDROIDP_DEBUG_VAR_NAME[UserPropKey],
defValue);
}

int platform_get_property_string(fastrpc_properties UserPropKey, char *value,
char *defValue) {
int len = 0;
if (((int)UserPropKey > NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS)) {
FARF(
ERROR,
"%s: Index %d out-of-bound for ANDROIDP_DEBUG_VAR_NAME array of len %d",
__func__, UserPropKey, NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS);
return len;
}
return property_get(ANDROIDP_DEBUG_VAR_NAME[UserPropKey], (int *)value,
(int *)defValue);
}
Loading
Loading