我正在尝试使用Android NdK独立工具链构建一些东西.但是,我遇到了这些错误.
CMake Warning at cmake/android.toolchain.cmake:387 (message):
Using value of obsolete variable ANDROID_NDK_TOOLCHAIN_ROOT as initial
value for ANDROID_STANDALONE_TOOLCHAIN. Please note, that
ANDROID_NDK_TOOLCHAIN_ROOT can be completely removed in future versions of
the toolchain.
Call Stack (most recent call first):
cmake/android.toolchain.cmake:476 (__INIT_VARIABLE)
/usr/local/Cellar/cmake/2.8.10.2/share/cmake/Modules/CMakeDetermineSystem.cmake:86 (include)
CMakeLists.txt:16 (PROJECT)
CMake Error at cmake/android.toolchain.cmake:412 (FILE):
file STRINGS file
"/Users/vgokhale/Desktop/android-ndk-r8e/sysroot/usr/include/android/api-level.h"
cannot be read.
Call Stack (most recent call first):
cmake/android.toolchain.cmake:548 (__DETECT_NATIVE_API_LEVEL)
/usr/local/Cellar/cmake/2.8.10.2/share/cmake/Modules/CMakeDetermineSystem.cmake:86 (include)
CMakeLists.txt:16 (PROJECT)
CMake Error: Error required internal CMake variable not set, cmake may be …Run Code Online (Sandbox Code Playgroud) 我正在考虑为DMA事务分配缓冲区.我读到有两种方法可以做到这一点 - 连贯映射或流映射.
现在,我们需要缓存一致缓冲区.但是,我们没有进行任何分散/聚集,因此我们希望获得dma_map_single呼叫的好处.我们在bootargs中留出了一些连续的内存,因此我们总是有足够的连续内存可用.
所以我想知道,我们可以调用dma_alloc_coherent然后dma_map_single使用dma_alloc_coherent返回的虚拟地址吗?然后,将单个映射的返回物理地址设置为dma_alloc_coherent在其调用中返回的dma句柄.
这有意义吗?或者这样做是多余/不正确的?
我试图弄清楚驱动程序中的文件操作是如何工作的.我知道有几个文件操作,但这些操作的函数是用几个参数调用的,而操作本身是在没有任何参数的情况下定义的.
所以,如果我有这个 -
static const struct file_operations proc_myled_operations = {
.open = proc_myled_open,
.read = seq_read,
.write = proc_myled_write,
.llseek = seq_lseek,
.release = single_release
};
Run Code Online (Sandbox Code Playgroud)
现在我知道内核级驱动程序只能作为来自用户应用程序的文件进行访问.这是一个嵌入式系统,所以我有一些LED可以通过写入它们的存储器映射寄存器来打开.
所以.write或"proc_myled_write"调用将在我通过使用fopen打开此文件然后使用fputs打开此文件来执行我可以执行的指令时执行.但是如果.write被映射为"proc_myled_write并且这个函数有这样的参数 -
static ssize_t proc_myled_write(struct file *file, const char __user * buf,
size_t count, loff_t * ppos)
Run Code Online (Sandbox Code Playgroud)
争论会怎样?使用这些参数没有函数调用上述函数.我在几个司机中看过这个.我刚用过这个,因为这是一个简单的例子.文件操作如何映射到这些函数?例如,用户空间中的"写入"如何跟踪驱动程序中的写入?
谢谢.