Skip to content

Commit

Permalink
Compilation errors on the propagations
Browse files Browse the repository at this point in the history
Signed-off-by: Bharath Kumar V <[email protected]>
  • Loading branch information
quic-bkumar committed Jul 31, 2024
1 parent 0fba5f8 commit 1082b07
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 34 deletions.
15 changes: 15 additions & 0 deletions inc/fastrpc_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@
fastrpc_session_put(domain); \
ref = 0; \
}
/**
* @brief Process types on remote subsystem
* Always add new PD types at the end, before MAX_PD_TYPE,
* for maintaining back ward compatibility
**/
#define DEFAULT_UNUSED 0 /* pd type not configured for context banks */
#define ROOT_PD 1 /* Root PD */
#define AUDIO_STATICPD 2 /* ADSP Audio Static PD */
#define SENSORS_STATICPD 3 /* ADSP Sensors Static PD */
#define SECURE_STATICPD 4 /* CDSP Secure Static PD */
#define OIS_STATICPD 5 /* ADSP OIS Static PD */
#define CPZ_USERPD 6 /* CDSP CPZ USER PD */
#define USERPD 7 /* DSP User Dynamic PD */
#define GUEST_OS_SHARED 8 /* Legacy Guest OS Shared */
#define MAX_PD_TYPE 9 /* Max PD type */

/*
* Enum defined for fastrpc User Properties
Expand Down
20 changes: 2 additions & 18 deletions inc/fastrpc_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,6 @@ static __inline uint32 Q6_R_cl0_R(uint32 num) {
#define FASTRPC_INIT_CREATE_STATIC 2
#define FASTRPC_INIT_ATTACH_SENSORS 3

/**
* @brief Process types on remote subsystem
* Always add new PD types at the end, before MAX_PD_TYPE,
* for maintaining back ward compatibility
**/
#define DEFAULT_UNUSED 0 /* pd type not configured for context banks */
#define ROOT_PD 1 /* Root PD */
#define AUDIO_STATICPD 2 /* ADSP Audio Static PD */
#define SENSORS_STATICPD 3 /* ADSP Sensors Static PD */
#define SECURE_STATICPD 4 /* CDSP Secure Static PD */
#define OIS_STATICPD 5 /* ADSP OIS Static PD */
#define CPZ_USERPD 6 /* CDSP CPZ USER PD */
#define USERPD 7 /* DSP User Dynamic PD */
#define GUEST_OS_SHARED 8 /* Legacy Guest OS Shared */
#define MAX_PD_TYPE 9 /* Max PD type */


// Attribute to specify the process is a debug process
#define FASTRPC_ATTR_DEBUG_PROCESS (1)

Expand Down Expand Up @@ -537,11 +520,12 @@ remote_handle64 get_adsp_perf1_handle(int domain);
* @handle: handle to prepend or dequeue
* @req: request id from enum handle_list_update_id
* @domain: domain id
* @name: Module name
* Prepend and dequeue operations can be performed on reverse and non-domain handle list
* @returns: 0 on success, valid non-zero error code on failure
*
**/
int fastrpc_update_module_list(uint32_t req, int domain, remote_handle64 handle, remote_handle64 *local);
int fastrpc_update_module_list(uint32_t req, int domain, remote_handle64 handle, remote_handle64 *local, const char *name);

/**
* @brief functions to wrap ioctl syscalls for downstream and upstream kernel
Expand Down
41 changes: 27 additions & 14 deletions src/fastrpc_apps_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,9 +836,9 @@ static void print_open_handles(int domain) {
pthread_mutex_lock(&hlist[domain].mut);
QLIST_FOR_ALL(&hlist[domain].ql, pn) {
hi = STD_RECOVER_REC(struct handle_info, qn, pn);
if (hi->lib_name)
if (hi->name)
FARF(ALWAYS, "%s, handle 0x%"PRIx64"",
hi->lib_name, hi->remote);
hi->name, hi->remote);
}
pthread_mutex_unlock(&hlist[domain].mut);
}
Expand Down Expand Up @@ -877,7 +877,7 @@ static char* get_lib_name(char *uri) {
}

static int fastrpc_alloc_handle(int domain, QList *me, remote_handle64 remote,
remote_handle64 *local, char *name) {
remote_handle64 *local, const char *name) {
struct handle_info *hinfo = {0};
int nErr = 0;
char *libname = NULL;
Expand Down Expand Up @@ -925,7 +925,7 @@ static int fastrpc_free_handle(int domain, QList *me, remote_handle64 remote) {
}

int fastrpc_update_module_list(uint32_t req, int domain, remote_handle64 h,
remote_handle64 *local, char *name) {
remote_handle64 *local, const char *name) {
int nErr = AEE_SUCCESS;

switch (req) {
Expand Down Expand Up @@ -960,17 +960,29 @@ int fastrpc_update_module_list(uint32_t req, int domain, remote_handle64 h,
case NON_DOMAIN_LIST_PREPEND: {
VERIFY(AEE_SUCCESS ==
(nErr = fastrpc_alloc_handle(domain, &hlist[domain].nql, h, local, name)));
pthread_mutex_lock(&hlist[domain].lmut);
hlist[domain].nondomainsCount++;
pthread_mutex_unlock(&hlist[domain].lmut);
if(IS_CONST_HANDLE(h)) {
pthread_mutex_lock(&hlist[domain].lmut);
hlist[domain].nconstCount++;
pthread_mutex_unlock(&hlist[domain].lmut);
} else {
pthread_mutex_lock(&hlist[domain].lmut);
hlist[domain].nondomainsCount++;
pthread_mutex_unlock(&hlist[domain].lmut);
}
break;
}
case NON_DOMAIN_LIST_DEQUEUE: {
VERIFY(AEE_SUCCESS ==
(nErr = fastrpc_free_handle(domain, &hlist[domain].nql, h)));
pthread_mutex_lock(&hlist[domain].lmut);
hlist[domain].nondomainsCount--;
pthread_mutex_unlock(&hlist[domain].lmut);
if(IS_CONST_HANDLE(h)) {
pthread_mutex_lock(&hlist[domain].lmut);
hlist[domain].nconstCount--;
pthread_mutex_unlock(&hlist[domain].lmut);
} else {
pthread_mutex_lock(&hlist[domain].lmut);
hlist[domain].nondomainsCount--;
pthread_mutex_unlock(&hlist[domain].lmut);
}
break;
}
case REVERSE_HANDLE_LIST_PREPEND: {
Expand Down Expand Up @@ -1457,7 +1469,7 @@ int remote_handle_invoke_domain(int domain, remote_handle handle,

int remote_handle_invoke(remote_handle handle, uint32_t sc, remote_arg *pra) {
int domain = -1, nErr = AEE_SUCCESS, ref = 0;
struct handle_info *h = container_of(handle, struct handle_info, local);
struct handle_info *h = container_of((void*)(uint64_t)handle, struct handle_info, local);

VERIFY(AEE_SUCCESS == (nErr = fastrpc_init_once()));

Expand Down Expand Up @@ -1496,7 +1508,7 @@ int remote_handle64_invoke(remote_handle64 local, uint32_t sc,
remote_arg *pra) {
remote_handle64 remote = 0;
int nErr = AEE_SUCCESS, domain = -1, ref = 0;
struct handle_info *h = container_of(local, struct handle_info, local);
struct handle_info *h = container_of((void*)(uint64_t)local, struct handle_info, local);

VERIFY(AEE_SUCCESS == (nErr = fastrpc_init_once()));

Expand Down Expand Up @@ -1824,7 +1836,8 @@ int remote_handle_close_domain(int domain, remote_handle h) {
int dlerr = 0, nErr = AEE_SUCCESS;
size_t err_str_len = MAX_DLERRSTR_LEN * sizeof(char);
uint64_t t_close = 0;
char *name = container_of(h, struct handle_info, local), nullname = "(null)";
struct *hi = container_of((void*)(uint64_t)h, struct handle_info, local);
char *name = hi->name, *nullname = "(null)";
remote_handle64 handle = INVALID_HANDLE;

FASTRPC_ATRACE_BEGIN_L("%s called with handle 0x%x", __func__, (int)h);
Expand Down Expand Up @@ -3581,7 +3594,7 @@ static int remote_init(int domain) {
apps_std_FILE fh = -1;
int pd_type = 0, errno_save = 0;
uint32_t info = domain & DOMAIN_ID_MASK;
int one_mb = 1024 * 1024, shared_buf_support = 0;
int shared_buf_support = 0;
char *file = NULL;
int flags = 0, filelen = 0, memlen = 0, filefd = -1;

Expand Down
1 change: 1 addition & 0 deletions src/fastrpc_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#define CONFIG_LOGPACKET "logPackets"
#define CONFIG_LEAK_DETECT "leak_detect"
#define CONFIG_CALL_STACK_NUM "num_call_stack"
#define CONFIG_SETDMABUFNAME "setdmabufname"

struct fastrpc_config_param {
boolean pddump;
Expand Down
2 changes: 1 addition & 1 deletion src/fastrpc_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "HAP_farf_internal.h"
#include "fastrpc_common.h"
#include "fastrpc_trace.h"
#include "rpcmem.h"
#include "rpcmem_internal.h"
#include "verify.h"

#define PROPERTY_VALUE_MAX 72
Expand Down
2 changes: 1 addition & 1 deletion src/fastrpc_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ int fastrpc_munmap(int domain, int fd, void *vaddr, size_t length) {
PRINT_WARN_USE_DOMAINS();
domain = get_current_domain();
}
VERIFYC(fd >= 0 && IS_VALID_EFFECTIVE_DOMAIN_ID(domain)),
VERIFYC(fd >= 0 && IS_VALID_EFFECTIVE_DOMAIN_ID(domain),
AEE_EBADPARM);
FASTRPC_GET_REF(domain);
VERIFY(AEE_SUCCESS == (nErr = fastrpc_session_dev(domain, &dev)));
Expand Down

0 comments on commit 1082b07

Please sign in to comment.