sof/test/cmocka
Andy Ross b08effa8e9 comp_dev: Eliminate use of drvdata for module backpointer
The current SOF architecture splits a "module" across two structs, the
legacy comp_dev and a newer struct processing_module.  The latter
contains a pointer to the former, but in many places existing code has
needed a backpointer to recover the module from a component.

So far this has abused the drvdata mechanism to store this as a void*,
but that's fragile as many components are already (!) using drvdata
for other purposes and will clobber the setting.  The fact that it
worked is seeming just by luck.  That pointer is for the exclusive use
of the comp_driver code associated with a component to store its own
data.  We can't be touching it from the global module code.

Just give the pointer a properly-typed field of its own and make sure
the two are initialized in tandem.  Longer term, SOF really needs to
fix this bifurcation and unify the two structs.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-18 14:25:20 +03:00
..
include test: cmocka: further remove unused META related definitions 2024-01-23 19:43:02 +02:00
m Test: cmocka: Add tests for auditory functions library 2022-09-06 22:05:03 +01:00
src comp_dev: Eliminate use of drvdata for module backpointer 2024-06-18 14:25:20 +03:00
CMakeLists.txt mtl: Added meteorlake platform to the build system 2022-09-21 15:15:26 +02:00
cmocka-host-gcc-toolchain.cmake cmocka: add support to run mocks on host architecture 2021-04-20 15:35:18 +01:00
cmocka-xtensa-gcc-toolchain.cmake cmocka: add support to build mocks on xtensa GCC 2021-04-20 15:35:18 +01:00
cmocka-xtensa-xt-toolchain.cmake
memory_mock.x.in cmocka: align to the new heap management 2021-09-10 12:07:59 +01:00