Other Parts Discussed in Thread: OMAP-L138, OMAPL138
Hi
Is it possible to use DSPLink functions inside a kernel module or are they only to be used in user-space?
Regards
Szymon
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
A kernel module can call the DSPLink functions since it is a kernel mode driver. The API is not the same as the user-mode version so you may need to check the user guides for the list of APIs.
Hi
I changed the memory mappings of the default DSPLink configuration for OMAP-L138 (addes some POOLs, changed their size etc.). It resulted in creating a different dsplink.lib library which I then recompile against my user-space application. If I used DSPLink functions like POOL_open in my kernel module would the driver know of the changes I made to the configuration? Right now I'm not replacing dsplinkk.ko module in my system, as recompiling the userspace application against dsplink.lib is sufficient. Is dsplinkk.ko also changed accordingly to what I set up in the configuration?
And also what do you think about mixing DSPLink code between a kernel module and a userspace application? I'm thinking about handling MSGQ messages in a kernel module, and transferring RINGIO data through an application?
Are there any wiki sites or documents that describe using DSPLink in a kernel module?
Regards
Szymon
There's extensive DSPLink FAQs and explanation on various topics at TI's Wiki http://processors.wiki.ti.com/index.php/Category:BIOSLink
I think your question pertains to how DSPLink's POOL allocator assigns requests for allocating buffers. Regarless of how many requests, there's only ONE static pool that has the max amount of memory used by any process. So I don't think there's a difference between kernel or user space requests as long as they the max size is accounted for. What's going to be important is the handling of physical vs. virtual addresses when you interact between your kernel module and user space app. The CMEM module contains a good example of a kernel space module accessing dsplinkk.ko. You can also implement your own POOL allocator to handle special memory situations like special purpose pools (see http://processors.wiki.ti.com/index.php/Creating_custom_pool_allocators)
Loc said:The CMEM module contains a good example of a kernel space module accessing dsplinkk.ko.
Quick clarifying point - CMEM doesn't use Link.
Chris
Sorry about the cmem module info, Chris is right. CMEM is independent of DSPLink and there's no example in this regard. There are some examples of virtual to physical address handling in CMEM example code (e.g. <OMAPL138 SDK install dir>/linuxutils_2_25_01_06/packages/ti/sdo/linuxutils/cmem/apps) that may help. Regarding the DSPLink kernel API I think all the LDRV_xxx API for POOL and MSGQ can be accessed in kernel space but unfortunately I can't think of where else we would have direct example source code available for your use case.