6464#include "fastrpc_perf.h"
6565#include "fastrpc_pm.h"
6666#include "fastrpc_procbuf.h"
67- #include "listener_android .h"
67+ #include "listener .h"
6868#include "log_config.h"
6969#include "platform_libs.h"
7070#include "remotectl.h"
8686#define DSP_MOUNT_LOCATION "/usr/lib/dsp/"
8787#define DSP_DOM_LOCATION "/usr/lib/dsp/xdspn"
8888#endif
89- #define VENDOR_DSP_LOCATION "/vendor/dsp/"
90- #define VENDOR_DOM_LOCATION "/vendor/dsp/xdsp/"
91-
92- #ifdef LE_ENABLE
93- #define PROPERTY_VALUE_MAX \
94- 92 // as this macro is defined in cutils for Android platforms, defined
95- // explicitly for LE platform
96- #elif (defined _ANDROID ) || (defined ANDROID )
97- /// TODO: Bharath #include "cutils/properties.h"
98- #define PROPERTY_VALUE_MAX 92
99- #else
89+
10090#define PROPERTY_VALUE_MAX 92
101- #endif
10291
10392#ifndef _WIN32
10493#include <poll.h>
@@ -241,26 +230,6 @@ const char *ENV_DEBUG_VAR_NAME[] = {"FASTRPC_PROCESS_ATTRS",
241230 "FASTRPC_DEBUG_PDDUMP" ,
242231 "FASTRPC_PROCESS_ATTRS_PERSISTENT" ,
243232 "ro.debuggable" };
244- const char * ANDROIDP_DEBUG_VAR_NAME [] = {"vendor.fastrpc.process.attrs" ,
245- "vendor.fastrpc.debug.trace" ,
246- "vendor.fastrpc.debug.testsig" ,
247- "vendor.fastrpc.perf.kernel" ,
248- "vendor.fastrpc.perf.adsp" ,
249- "vendor.fastrpc.perf.freq" ,
250- "vendor.fastrpc.debug.systrace" ,
251- "vendor.fastrpc.debug.pddump" ,
252- "persist.vendor.fastrpc.process.attrs" ,
253- "ro.build.type" };
254- const char * ANDROID_DEBUG_VAR_NAME [] = {"fastrpc.process.attrs" ,
255- "fastrpc.debug.trace" ,
256- "fastrpc.debug.testsig" ,
257- "fastrpc.perf.kernel" ,
258- "fastrpc.perf.adsp" ,
259- "fastrpc.perf.freq" ,
260- "fastrpc.debug.systrace" ,
261- "fastrpc.debug.pddump" ,
262- "persist.fastrpc.process.attrs" ,
263- "ro.build.type" };
264233
265234const char * SUBSYSTEM_NAME [] = {"adsp" , "mdsp" , "sdsp" , "cdsp" , "cdsp1" , "reserved" , "reserved" , "reserved" };
266235
@@ -274,10 +243,6 @@ static const size_t invoke_end_trace_strlen = sizeof(INVOKE_END_TRACE_STR) - 1;
274243
275244int NO_ENV_DEBUG_VAR_NAME_ARRAY_ELEMENTS =
276245 sizeof (ENV_DEBUG_VAR_NAME ) / sizeof (char * );
277- int NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS =
278- sizeof (ANDROIDP_DEBUG_VAR_NAME ) / sizeof (char * );
279- int NO_ANDROID_DEBUG_VAR_NAME_ARRAY_ELEMENTS =
280- sizeof (ANDROID_DEBUG_VAR_NAME ) / sizeof (char * );
281246
282247/* Shell prefix for signed and unsigned */
283248const char * const SIGNED_SHELL = "fastrpc_shell_" ;
@@ -504,29 +469,8 @@ int fastrpc_get_property_int(fastrpc_properties UserPropKey, int defValue) {
504469 const char * env = getenv (ENV_DEBUG_VAR_NAME [UserPropKey ]);
505470 if (env != 0 )
506471 return (int )atoi (env );
507- #if !defined(LE_ENABLE ) // Android platform
508- #if !defined(SYSTEM_RPC_LIBRARY ) // vendor library
509- if (((int )UserPropKey > NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS )) {
510- FARF (
511- ERROR ,
512- "%s: Index %d out-of-bound for ANDROIDP_DEBUG_VAR_NAME array of len %d" ,
513- __func__ , UserPropKey , NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS );
514- return defValue ;
515- }
516- return (int )property_get_int32 (ANDROIDP_DEBUG_VAR_NAME [UserPropKey ],
517- defValue );
518- #else // system library
519- if (((int )UserPropKey > NO_ANDROID_DEBUG_VAR_NAME_ARRAY_ELEMENTS )) {
520- FARF (ERROR ,
521- "%s: Index %d out-of-bound for ANDROID_DEBUG_VAR_NAME array of len %d" ,
522- __func__ , UserPropKey , NO_ANDROID_DEBUG_VAR_NAME_ARRAY_ELEMENTS );
523- return defValue ;
524- }
525- return (int )property_get_int32 (ANDROID_DEBUG_VAR_NAME [UserPropKey ], defValue );
526- #endif
527- #else // non-Android platforms
472+
528473 return defValue ;
529- #endif
530474}
531475int fastrpc_get_property_string (fastrpc_properties UserPropKey , char * value ,
532476 char * defValue ) {
@@ -543,34 +487,12 @@ int fastrpc_get_property_string(fastrpc_properties UserPropKey, char *value,
543487 value [PROPERTY_VALUE_MAX - 1 ] = '\0' ;
544488 return strlen (env );
545489 }
546- #if !defined(LE_ENABLE ) // Android platform
547- #if !defined(SYSTEM_RPC_LIBRARY ) // vendor library
548- if (((int )UserPropKey > NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS )) {
549- FARF (
550- ERROR ,
551- "%s: Index %d out-of-bound for ANDROIDP_DEBUG_VAR_NAME array of len %d" ,
552- __func__ , UserPropKey , NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS );
553- return len ;
554- }
555- return property_get (ANDROIDP_DEBUG_VAR_NAME [UserPropKey ], (int * )value ,
556- (int * )defValue );
557- #else // system library
558- if (((int )UserPropKey > NO_ANDROID_DEBUG_VAR_NAME_ARRAY_ELEMENTS )) {
559- FARF (ERROR ,
560- "%s: Index %d out-of-bound for ANDROID_DEBUG_VAR_NAME array of len %d" ,
561- __func__ , UserPropKey , NO_ANDROID_DEBUG_VAR_NAME_ARRAY_ELEMENTS );
562- return len ;
563- }
564- return property_get (ANDROID_DEBUG_VAR_NAME [UserPropKey ], value , defValue );
565- #endif
566- #else // non-Android platforms
567490 if (defValue != NULL ) {
568491 strncpy (value , defValue , PROPERTY_VALUE_MAX - 1 );
569492 value [PROPERTY_VALUE_MAX - 1 ] = '\0' ;
570493 return strlen (defValue );
571494 }
572495 return len ;
573- #endif
574496}
575497
576498/*
@@ -1611,7 +1533,7 @@ int remote_handle64_invoke_async(remote_handle64 local,
16111533 return nErr ;
16121534}
16131535
1614- int listener_android_geteventfd (int domain , int * fd );
1536+ int listener_geteventfd (int domain , int * fd );
16151537int remote_handle_open_domain (int domain , const char * name , remote_handle * ph ,
16161538 uint64_t * t_spawn , uint64_t * t_load ) {
16171539 char dlerrstr [255 ];
@@ -1634,7 +1556,7 @@ int remote_handle_open_domain(int domain, const char *name, remote_handle *ph,
16341556 if (!strncmp (name , ITRANSPORT_PREFIX "geteventfd" ,
16351557 strlen (ITRANSPORT_PREFIX "geteventfd" ))) {
16361558 FARF (RUNTIME_RPC_HIGH , "getting event fd" );
1637- return listener_android_geteventfd (domain , (int * )ph );
1559+ return listener_geteventfd (domain , (int * )ph );
16381560 }
16391561 if (!strncmp (name , ITRANSPORT_PREFIX "attachguestos" ,
16401562 strlen (ITRANSPORT_PREFIX "attachguestos" ))) {
@@ -3143,7 +3065,7 @@ PL_DEP(fastrpc_apps_user);
31433065PL_DEP (gpls );
31443066PL_DEP (apps_std );
31453067PL_DEP (rpcmem );
3146- PL_DEP (listener_android );
3068+ PL_DEP (listener );
31473069PL_DEP (fastrpc_async );
31483070
31493071static int attach_guestos (int domain ) {
@@ -3191,7 +3113,7 @@ static void domain_deinit(int domain) {
31913113 pthread_mutex_unlock (& hlist [domain ].mut );
31923114
31933115 dspsignal_domain_deinit (domain );
3194- listener_android_domain_deinit (domain );
3116+ listener_domain_deinit (domain );
31953117 hlist [domain ].first_revrpc_done = 0 ;
31963118 pthread_mutex_lock (& hlist [domain ].async_init_deinit_mut );
31973119 fastrpc_async_domain_deinit (domain );
@@ -3489,28 +3411,6 @@ static int open_shell(int domain_id, apps_std_FILE *fh, int unsigned_shell) {
34893411 strlcat (absName , shell_absName , absNameLen );
34903412 nErr = apps_std_fopen (absName , "r" , fh );
34913413 }
3492- if (nErr ) {
3493- absNameLen = strlen (VENDOR_DSP_LOCATION ) + shell_absNameLen + 1 ;
3494- VERIFYC (NULL !=
3495- (absName = (char * )realloc (absName , sizeof (char ) * absNameLen )),
3496- AEE_ENOMEMORY );
3497- strlcpy (absName , VENDOR_DSP_LOCATION , absNameLen );
3498- strlcat (absName , shell_absName , absNameLen );
3499-
3500- nErr = apps_std_fopen (absName , "r" , fh );
3501- if (nErr ) {
3502- absNameLen = strlen (VENDOR_DOM_LOCATION ) + shell_absNameLen + 1 ;
3503- VERIFYC (NULL != (absName =
3504- (char * )realloc (absName , sizeof (char ) * absNameLen )),
3505- AEE_ENOMEMORY );
3506- strlcpy (absName , VENDOR_DSP_LOCATION , absNameLen );
3507- strlcat (absName , SUBSYSTEM_NAME [domain ], absNameLen );
3508- strlcat (absName , "/" , absNameLen );
3509- strlcat (absName , shell_absName , absNameLen );
3510-
3511- nErr = apps_std_fopen (absName , "r" , fh );
3512- }
3513- }
35143414 if (!nErr )
35153415 FARF (ALWAYS , "Successfully opened %s, domain %d" , absName , domain );
35163416bail :
@@ -3532,10 +3432,10 @@ static int open_shell(int domain_id, apps_std_FILE *fh, int unsigned_shell) {
35323432 * fh = -1 ;
35333433 } else {
35343434 FARF (ERROR ,
3535- "Error 0x%x: %s failed for domain %d search paths used are %s, %s, "
3536- " %s (errno %s)\n" ,
3537- nErr , __func__ , domain , DSP_MOUNT_LOCATION , VENDOR_DSP_LOCATION ,
3538- VENDOR_DOM_LOCATION , strerror (errno ));
3435+ "Error 0x%x: %s failed for domain %d search paths used are %s, "
3436+ "%s/ %s (errno %s)\n" ,
3437+ nErr , __func__ , domain , DSP_MOUNT_LOCATION , DSP_MOUNT_LOCATION ,
3438+ SUBSYSTEM_NAME [ domain ] , strerror (errno ));
35393439 }
35403440 }
35413441 return nErr ;
@@ -4064,7 +3964,7 @@ static int domain_init(int domain, int *dev) {
40643964 hlist [domain ].state = FASTRPC_DOMAIN_STATE_INIT ;
40653965 hlist [domain ].ref = 0 ;
40663966 pthread_mutex_unlock (& hlist [domain ].mut );
4067- VERIFY (AEE_SUCCESS == (nErr = listener_android_domain_init (
3967+ VERIFY (AEE_SUCCESS == (nErr = listener_domain_init (
40683968 domain , hlist [domain ].th_params .update_requested ,
40693969 & hlist [domain ].th_params .r_sem )));
40703970bail :
@@ -4110,7 +4010,7 @@ static void fastrpc_apps_user_deinit(void) {
41104010 pthread_mutex_destroy (& hlist [i ].init );
41114011 pthread_mutex_destroy (& hlist [i ].async_init_deinit_mut );
41124012 }
4113- listener_android_deinit ();
4013+ listener_deinit ();
41144014 free (hlist );
41154015 hlist = NULL ;
41164016 }
@@ -4218,7 +4118,7 @@ static int fastrpc_apps_user_init(void) {
42184118 pthread_mutex_init (& hlist [i ].init , 0 );
42194119 pthread_mutex_init (& hlist [i ].async_init_deinit_mut , 0 );
42204120 }
4221- listener_android_init ();
4121+ listener_init ();
42224122 VERIFY (AEE_SUCCESS == (nErr = pthread_key_create (& tlsKey , exit_thread )));
42234123 VERIFY (AEE_SUCCESS == (nErr = PL_INIT (apps_std )));
42244124 GenCrc32Tab (POLY32 , crc_table );
0 commit comments