@@ -1506,6 +1506,13 @@ int remote_handle64_invoke(remote_handle64 local, uint32_t sc,
15061506 int nErr = AEE_SUCCESS , domain = -1 , ref = 0 ;
15071507 struct handle_info * h = (struct handle_info * )local ;
15081508
1509+ if (IS_STATICPD_HANDLE (local )) {
1510+ nErr = AEE_EINVHANDLE ;
1511+ FARF (ERROR , "Error 0x%x: %s cannot be called for staticPD handle 0x%" PRIx64 "\n" ,
1512+ nErr , __func__ , local );
1513+ goto bail ;
1514+ }
1515+
15091516 VERIFY (AEE_SUCCESS == (nErr = fastrpc_init_once ()));
15101517
15111518 FASTRPC_ATRACE_BEGIN_L ("%s called with handle 0x%x , scalar 0x%x" , __func__ ,
@@ -1632,6 +1639,7 @@ int remote_handle_open_domain(int domain, const char *name, remote_handle *ph,
16321639 if (!std_strncmp (name , ITRANSPORT_PREFIX "attachguestos" ,
16331640 std_strlen (ITRANSPORT_PREFIX "attachguestos" ))) {
16341641 FARF (RUNTIME_RPC_HIGH , "setting attach mode to guestos : %d" , domain );
1642+ * ph = ATTACHGUESTOS_HANDLE ;
16351643 hlist [domain ].dsppd = ROOT_PD ;
16361644 return AEE_SUCCESS ;
16371645 }
@@ -1666,15 +1674,20 @@ int remote_handle_open_domain(int domain, const char *name, remote_handle *ph,
16661674 VERIFYC (MAX_DSPPD_NAMELEN > std_strlen (pdName ), AEE_EBADPARM );
16671675 std_strlcpy (hlist [domain ].dsppdname , pdName , std_strlen (pdName ) + 1 );
16681676 if (!std_strncmp (pdName , "audiopd" , std_strlen ("audiopd" ))) {
1677+ * ph = AUDIOPD_HANDLE ;
16691678 hlist [domain ].dsppd = AUDIO_STATICPD ;
16701679 } else if (!std_strncmp (pdName , "securepd" , std_strlen ("securepd" ))) {
16711680 FARF (ALWAYS , "%s: attaching to securePD\n" , __func__ );
1681+ * ph = SECUREPD_HANDLE ;
16721682 hlist [domain ].dsppd = SECURE_STATICPD ;
16731683 } else if (!std_strncmp (pdName , "sensorspd" , std_strlen ("sensorspd" ))) {
1684+ * ph = SENSORPD_HANDLE ;
16741685 hlist [domain ].dsppd = SENSORS_STATICPD ;
16751686 } else if (!std_strncmp (pdName , "rootpd" , std_strlen ("rootpd" ))) {
1687+ * ph = ROOTPD_HANDLE ;
16761688 hlist [domain ].dsppd = GUEST_OS_SHARED ;
16771689 } else if (!std_strncmp (pdName , "oispd" , std_strlen ("oispd" ))) {
1690+ * ph = OISPD_HANDLE ;
16781691 hlist [domain ].dsppd = OIS_STATICPD ;
16791692 }
16801693 return AEE_SUCCESS ;
@@ -1801,7 +1814,8 @@ int remote_handle64_open(const char *name, remote_handle64 *ph) {
18011814 polls on it, hence return remote handle (which is the actual fd) for
18021815 "geteventd" call*/
18031816 if (!std_strncmp (name , ITRANSPORT_PREFIX "geteventfd" ,
1804- std_strlen (ITRANSPORT_PREFIX "geteventfd" ))) {
1817+ std_strlen (ITRANSPORT_PREFIX "geteventfd" )) ||
1818+ IS_STATICPD_HANDLE (h )) {
18051819 * ph = h ;
18061820 } else {
18071821 fastrpc_update_module_list (DOMAIN_LIST_PREPEND , domain , h , & local , name );
@@ -1916,6 +1930,8 @@ int remote_handle64_close(remote_handle64 handle) {
19161930 bool start_deinit = false;
19171931 struct handle_info * hi = (struct handle_info * )handle ;
19181932
1933+ if (IS_STATICPD_HANDLE (handle ))
1934+ return AEE_SUCCESS ;
19191935 FARF (RUNTIME_RPC_HIGH , "Entering %s, handle %llu\n" , __func__ , handle );
19201936 FASTRPC_ATRACE_BEGIN_L ("%s called with handle 0x%" PRIx64 "\n" , __func__ ,
19211937 handle );
0 commit comments