-
Notifications
You must be signed in to change notification settings - Fork 56
Refactor: Generalize Code by Moving Vendor and Android-Specific Elements #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from all commits
69b4f49
9206dcc
f9e6ee3
e0b0293
e4aee33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are removing the support for /vendor/dsp, where is shell expected to be pushed for android targets ? if it is /usr/lib/dsp/ like other LE targets, is /usr partition available on android targets ? how is this change tested on android targets ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to check where the shell should be placed if /vendor/dsp support is removed, or if we actually need to remove it in the first place. Regarding testing: earlier, the daemons were already running (opened the shell) and the tests passed. After killing and updating with new daemons, the tests are now failing. I will check this further and update.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The shell is loaded from the same folder as all other DSP libraries. What's the question?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
All DSP binaries are located in the subdirs of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Android systems you can reuse the same approach, changing /usr/share/qcom/ to /vendor or its subdir. All config files should be relative to that path, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
| // SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
|
||
| #ifndef FASTRPC_ANDROID_H | ||
| #define FASTRPC_ANDROID_H | ||
|
|
||
| #include "fastrpc_common.h" | ||
|
|
||
| /* Platform property system functions */ | ||
| int property_get_int32(const char *name, int value); | ||
| int property_get(const char *name, int *def, int *value); | ||
|
|
||
| /* Platform-specific property getter functions */ | ||
| int platform_get_property_int(fastrpc_properties UserPropKey, int defValue); | ||
| int platform_get_property_string(fastrpc_properties UserPropKey, char *value, char *defValue); | ||
|
|
||
| #endif /*FASTRPC_ANDROID_H*/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
| // SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
|
||
| #include "fastrpc_android.h" | ||
| #include "HAP_farf.h" | ||
| #include <string.h> | ||
|
|
||
| #define PROPERTY_VALUE_MAX 92 | ||
|
|
||
| /* Android P (vendor) property names */ | ||
| const char *ANDROIDP_DEBUG_VAR_NAME[] = {"vendor.fastrpc.process.attrs", | ||
| "vendor.fastrpc.debug.trace", | ||
| "vendor.fastrpc.debug.testsig", | ||
| "vendor.fastrpc.perf.kernel", | ||
| "vendor.fastrpc.perf.adsp", | ||
| "vendor.fastrpc.perf.freq", | ||
| "vendor.fastrpc.debug.systrace", | ||
| "vendor.fastrpc.debug.pddump", | ||
| "persist.vendor.fastrpc.process.attrs", | ||
| "ro.build.type"}; | ||
|
|
||
| int NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS = | ||
| sizeof(ANDROIDP_DEBUG_VAR_NAME) / sizeof(char *); | ||
|
|
||
| /* Stub implementations for property functions - to be implemented with actual Android property API */ | ||
| int property_get_int32(const char *name, int value) { | ||
| return 0; | ||
| } | ||
|
|
||
| int property_get(const char *name, int *def, int *value) { | ||
| return 0; | ||
| } | ||
|
|
||
| int platform_get_property_int(fastrpc_properties UserPropKey, int defValue) { | ||
| if (((int)UserPropKey > NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS)) { | ||
| FARF( | ||
| ERROR, | ||
| "%s: Index %d out-of-bound for ANDROIDP_DEBUG_VAR_NAME array of len %d", | ||
| __func__, UserPropKey, NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS); | ||
| return defValue; | ||
| } | ||
| return (int)property_get_int32(ANDROIDP_DEBUG_VAR_NAME[UserPropKey], | ||
| defValue); | ||
| } | ||
|
|
||
| int platform_get_property_string(fastrpc_properties UserPropKey, char *value, | ||
| char *defValue) { | ||
| int len = 0; | ||
| if (((int)UserPropKey > NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS)) { | ||
| FARF( | ||
| ERROR, | ||
| "%s: Index %d out-of-bound for ANDROIDP_DEBUG_VAR_NAME array of len %d", | ||
| __func__, UserPropKey, NO_ANDROIDP_DEBUG_VAR_NAME_ARRAY_ELEMENTS); | ||
| return len; | ||
| } | ||
| return property_get(ANDROIDP_DEBUG_VAR_NAME[UserPropKey], (int *)value, | ||
| (int *)defValue); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.