發表文章

目前顯示的是 7月, 2017的文章

SPI + DMA

#define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N]) https://stackoverflow.com/questions/15541290/what-is-the-difference-between-module-init-and-subsys-initcall-while-initializ The difference relates to timing, or more precisely, order of execution. That is, the procedure declared as subsys_initcall is guaranteed to be executed before the procedure declared as module_init. This ordering ensures that subsystem and platform drivers are initialized before device drivers try to utilize the former's functionality (e.g. a device driver registers as a subsystem device). EXPORT_SYMBOL_GPL(spi_register_master); EXPORT_SYMBOL定義的函數對全部kernel代碼公開,不用修改kernel code就可以在您的kernel模組中直接使用。您還可以手動修改kernel code来導出另外的函數,用於重新编譯並加戴新kernel後的測試。