Skip to content

Commit

Permalink
[Hexagon] Don't use {} initialization with FastRPC structures (apache…
Browse files Browse the repository at this point in the history
…#9033)

The data members in FastRPC structures aren't guaranteed to remain
in the same order. Replace aggregate initialization with direct,
member-by-member initialization.
  • Loading branch information
Krzysztof Parzyszek authored and ylc committed Jan 13, 2022
1 parent 86b296f commit 2596a8f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/runtime/hexagon/launcher/launcher_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
#include "launcher_rpc.h"

AEEResult enable_unsigned_pd(bool enable) {
remote_rpc_control_unsigned_module data{static_cast<int>(enable), CDSP_DOMAIN_ID};
remote_rpc_control_unsigned_module data;
data.domain = CDSP_DOMAIN_ID;
data.enable = static_cast<int>(enable);
AEEResult rc = remote_session_control(DSPRPC_CONTROL_UNSIGNED_MODULE, &data, sizeof(data));
if (rc != AEE_SUCCESS) {
std::cout << "error " << (enable ? "enabling" : "disabling") << " unsigned PD\n";
Expand All @@ -41,8 +43,11 @@ AEEResult enable_unsigned_pd(bool enable) {
}

AEEResult set_remote_stack_size(int size) {
remote_rpc_thread_params th_data{CDSP_DOMAIN_ID, -1, size};
AEEResult rc = remote_session_control(FASTRPC_THREAD_PARAMS, &th_data, sizeof(th_data));
remote_rpc_thread_params data;
data.domain = CDSP_DOMAIN_ID;
data.prio = -1;
data.stack_size = size;
AEEResult rc = remote_session_control(FASTRPC_THREAD_PARAMS, &data, sizeof(data));
if (rc != AEE_SUCCESS) {
std::cout << "error setting remote stack size: " << std::hex << rc << '\n';
}
Expand Down

0 comments on commit 2596a8f

Please sign in to comment.