64
64
#include "fastrpc_perf.h"
65
65
#include "fastrpc_pm.h"
66
66
#include "fastrpc_procbuf.h"
67
- #include "listener_android .h"
67
+ #include "listener .h"
68
68
#include "log_config.h"
69
69
#include "platform_libs.h"
70
70
#include "remotectl.h"
86
86
#define DSP_MOUNT_LOCATION "/usr/lib/dsp/"
87
87
#define DSP_DOM_LOCATION "/usr/lib/dsp/xdspn"
88
88
#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
+
100
90
#define PROPERTY_VALUE_MAX 92
101
- #endif
102
91
103
92
#ifndef _WIN32
104
93
#include <poll.h>
@@ -241,26 +230,6 @@ const char *ENV_DEBUG_VAR_NAME[] = {"FASTRPC_PROCESS_ATTRS",
241
230
"FASTRPC_DEBUG_PDDUMP" ,
242
231
"FASTRPC_PROCESS_ATTRS_PERSISTENT" ,
243
232
"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" };
264
233
265
234
const char * SUBSYSTEM_NAME [] = {"adsp" , "mdsp" , "sdsp" , "cdsp" , "cdsp1" , "reserved" , "reserved" , "reserved" };
266
235
@@ -274,10 +243,6 @@ static const size_t invoke_end_trace_strlen = sizeof(INVOKE_END_TRACE_STR) - 1;
274
243
275
244
int NO_ENV_DEBUG_VAR_NAME_ARRAY_ELEMENTS =
276
245
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 * );
281
246
282
247
/* Shell prefix for signed and unsigned */
283
248
const char * const SIGNED_SHELL = "fastrpc_shell_" ;
@@ -505,29 +470,8 @@ int fastrpc_get_property_int(fastrpc_properties UserPropKey, int defValue) {
505
470
const char * env = getenv (ENV_DEBUG_VAR_NAME [UserPropKey ]);
506
471
if (env != 0 )
507
472
return (int )atoi (env );
508
- #if !defined(LE_ENABLE ) // Android platform
509
- #if !defined(SYSTEM_RPC_LIBRARY ) // vendor library
510
- if (((int )UserPropKey > NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS )) {
511
- FARF (
512
- ERROR ,
513
- "%s: Index %d out-of-bound for ANDROIDP_DEBUG_VAR_NAME array of len %d" ,
514
- __func__ , UserPropKey , NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS );
515
- return defValue ;
516
- }
517
- return (int )property_get_int32 (ANDROIDP_DEBUG_VAR_NAME [UserPropKey ],
518
- defValue );
519
- #else // system library
520
- if (((int )UserPropKey > NO_ANDROID_DEBUG_VAR_NAME_ARRAY_ELEMENTS )) {
521
- FARF (ERROR ,
522
- "%s: Index %d out-of-bound for ANDROID_DEBUG_VAR_NAME array of len %d" ,
523
- __func__ , UserPropKey , NO_ANDROID_DEBUG_VAR_NAME_ARRAY_ELEMENTS );
524
- return defValue ;
525
- }
526
- return (int )property_get_int32 (ANDROID_DEBUG_VAR_NAME [UserPropKey ], defValue );
527
- #endif
528
- #else // non-Android platforms
473
+
529
474
return defValue ;
530
- #endif
531
475
}
532
476
int fastrpc_get_property_string (fastrpc_properties UserPropKey , char * value ,
533
477
char * defValue ) {
@@ -544,33 +488,11 @@ int fastrpc_get_property_string(fastrpc_properties UserPropKey, char *value,
544
488
std_memscpy (value , PROPERTY_VALUE_MAX , env , len + 1 );
545
489
return len ;
546
490
}
547
- #if !defined(LE_ENABLE ) // Android platform
548
- #if !defined(SYSTEM_RPC_LIBRARY ) // vendor library
549
- if (((int )UserPropKey > NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS )) {
550
- FARF (
551
- ERROR ,
552
- "%s: Index %d out-of-bound for ANDROIDP_DEBUG_VAR_NAME array of len %d" ,
553
- __func__ , UserPropKey , NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS );
554
- return len ;
555
- }
556
- return property_get (ANDROIDP_DEBUG_VAR_NAME [UserPropKey ], (int * )value ,
557
- (int * )defValue );
558
- #else // system library
559
- if (((int )UserPropKey > NO_ANDROID_DEBUG_VAR_NAME_ARRAY_ELEMENTS )) {
560
- FARF (ERROR ,
561
- "%s: Index %d out-of-bound for ANDROID_DEBUG_VAR_NAME array of len %d" ,
562
- __func__ , UserPropKey , NO_ANDROID_DEBUG_VAR_NAME_ARRAY_ELEMENTS );
563
- return len ;
564
- }
565
- return property_get (ANDROID_DEBUG_VAR_NAME [UserPropKey ], value , defValue );
566
- #endif
567
- #else // non-Android platforms
568
491
if (defValue != NULL ) {
569
492
len = strlen (defValue );
570
493
std_memscpy (value , PROPERTY_VALUE_MAX , defValue , len + 1 );
571
494
}
572
495
return len ;
573
- #endif
574
496
}
575
497
576
498
/*
@@ -1611,7 +1533,7 @@ int remote_handle64_invoke_async(remote_handle64 local,
1611
1533
return nErr ;
1612
1534
}
1613
1535
1614
- int listener_android_geteventfd (int domain , int * fd );
1536
+ int listener_geteventfd (int domain , int * fd );
1615
1537
int remote_handle_open_domain (int domain , const char * name , remote_handle * ph ,
1616
1538
uint64_t * t_spawn , uint64_t * t_load ) {
1617
1539
char dlerrstr [255 ];
@@ -1634,7 +1556,7 @@ int remote_handle_open_domain(int domain, const char *name, remote_handle *ph,
1634
1556
if (!std_strncmp (name , ITRANSPORT_PREFIX "geteventfd" ,
1635
1557
std_strlen (ITRANSPORT_PREFIX "geteventfd" ))) {
1636
1558
FARF (RUNTIME_RPC_HIGH , "getting event fd" );
1637
- return listener_android_geteventfd (domain , (int * )ph );
1559
+ return listener_geteventfd (domain , (int * )ph );
1638
1560
}
1639
1561
if (!std_strncmp (name , ITRANSPORT_PREFIX "attachguestos" ,
1640
1562
std_strlen (ITRANSPORT_PREFIX "attachguestos" ))) {
@@ -3143,7 +3065,7 @@ PL_DEP(fastrpc_apps_user);
3143
3065
PL_DEP (gpls );
3144
3066
PL_DEP (apps_std );
3145
3067
PL_DEP (rpcmem );
3146
- PL_DEP (listener_android );
3068
+ PL_DEP (listener );
3147
3069
PL_DEP (fastrpc_async );
3148
3070
3149
3071
static int attach_guestos (int domain ) {
@@ -3191,7 +3113,7 @@ static void domain_deinit(int domain) {
3191
3113
pthread_mutex_unlock (& hlist [domain ].mut );
3192
3114
3193
3115
dspsignal_domain_deinit (domain );
3194
- listener_android_domain_deinit (domain );
3116
+ listener_domain_deinit (domain );
3195
3117
hlist [domain ].first_revrpc_done = 0 ;
3196
3118
pthread_mutex_lock (& hlist [domain ].async_init_deinit_mut );
3197
3119
fastrpc_async_domain_deinit (domain );
@@ -3507,28 +3429,6 @@ static int open_shell(int domain_id, apps_std_FILE *fh, int unsigned_shell) {
3507
3429
std_strlcat (absName , shell_absName , absNameLen );
3508
3430
nErr = apps_std_fopen (absName , "r" , fh );
3509
3431
}
3510
- if (nErr ) {
3511
- absNameLen = std_strlen (VENDOR_DSP_LOCATION ) + shell_absNameLen + 1 ;
3512
- VERIFYC (NULL !=
3513
- (absName = (char * )realloc (absName , sizeof (char ) * absNameLen )),
3514
- AEE_ENOMEMORY );
3515
- std_strlcpy (absName , VENDOR_DSP_LOCATION , absNameLen );
3516
- std_strlcat (absName , shell_absName , absNameLen );
3517
-
3518
- nErr = apps_std_fopen (absName , "r" , fh );
3519
- if (nErr ) {
3520
- absNameLen = std_strlen (VENDOR_DOM_LOCATION ) + shell_absNameLen + 1 ;
3521
- VERIFYC (NULL != (absName =
3522
- (char * )realloc (absName , sizeof (char ) * absNameLen )),
3523
- AEE_ENOMEMORY );
3524
- std_strlcpy (absName , VENDOR_DSP_LOCATION , absNameLen );
3525
- std_strlcat (absName , SUBSYSTEM_NAME [domain ], absNameLen );
3526
- std_strlcat (absName , "/" , absNameLen );
3527
- std_strlcat (absName , shell_absName , absNameLen );
3528
-
3529
- nErr = apps_std_fopen (absName , "r" , fh );
3530
- }
3531
- }
3532
3432
if (!nErr )
3533
3433
FARF (ALWAYS , "Successfully opened %s, domain %d" , absName , domain );
3534
3434
bail :
@@ -3550,10 +3450,10 @@ static int open_shell(int domain_id, apps_std_FILE *fh, int unsigned_shell) {
3550
3450
* fh = -1 ;
3551
3451
} else {
3552
3452
FARF (ERROR ,
3553
- "Error 0x%x: %s failed for domain %d search paths used are %s, %s, "
3554
- " %s (errno %s)\n" ,
3555
- nErr , __func__ , domain , DSP_MOUNT_LOCATION , VENDOR_DSP_LOCATION ,
3556
- VENDOR_DOM_LOCATION , strerror (errno ));
3453
+ "Error 0x%x: %s failed for domain %d search paths used are %s, "
3454
+ "%s/ %s (errno %s)\n" ,
3455
+ nErr , __func__ , domain , DSP_MOUNT_LOCATION , DSP_MOUNT_LOCATION ,
3456
+ SUBSYSTEM_NAME [ domain ] , strerror (errno ));
3557
3457
}
3558
3458
}
3559
3459
return nErr ;
@@ -4082,7 +3982,7 @@ static int domain_init(int domain, int *dev) {
4082
3982
hlist [domain ].state = FASTRPC_DOMAIN_STATE_INIT ;
4083
3983
hlist [domain ].ref = 0 ;
4084
3984
pthread_mutex_unlock (& hlist [domain ].mut );
4085
- VERIFY (AEE_SUCCESS == (nErr = listener_android_domain_init (
3985
+ VERIFY (AEE_SUCCESS == (nErr = listener_domain_init (
4086
3986
domain , hlist [domain ].th_params .update_requested ,
4087
3987
& hlist [domain ].th_params .r_sem )));
4088
3988
bail :
@@ -4128,7 +4028,7 @@ static void fastrpc_apps_user_deinit(void) {
4128
4028
pthread_mutex_destroy (& hlist [i ].init );
4129
4029
pthread_mutex_destroy (& hlist [i ].async_init_deinit_mut );
4130
4030
}
4131
- listener_android_deinit ();
4031
+ listener_deinit ();
4132
4032
free (hlist );
4133
4033
hlist = NULL ;
4134
4034
}
@@ -4236,7 +4136,7 @@ static int fastrpc_apps_user_init(void) {
4236
4136
pthread_mutex_init (& hlist [i ].init , 0 );
4237
4137
pthread_mutex_init (& hlist [i ].async_init_deinit_mut , 0 );
4238
4138
}
4239
- listener_android_init ();
4139
+ listener_init ();
4240
4140
VERIFY (AEE_SUCCESS == (nErr = pthread_key_create (& tlsKey , exit_thread )));
4241
4141
VERIFY (AEE_SUCCESS == (nErr = PL_INIT (apps_std )));
4242
4142
GenCrc32Tab (POLY32 , crc_table );
0 commit comments