linux驅動常用標頭檔

來源:互聯網
上載者:User
驅動程式:


#include <linux/***.h>
是在linux-2.6.29/include/linux下面尋找源檔案。




#include <asm/***.h>
是在linux-2.6.29/arch/arm/include/asm下面尋找源檔案。



#include
<mach/***.h>
是在linux-2.6.29/arch/arm/mach-s3c2410/include/mach下面尋找源檔案。

#include <linux/module.h> 
 //最基本的檔案,支援動態添加和卸載模組。Hello World驅動要這一個檔案就可以了

#include <linux/fs.h>  
//包含了檔案操作
相關struct的定義,例如大名鼎鼎的struct file_operations

#include <linux/errno.h> 

 //包含了對傳回值的宏定義,這樣使用者程式可以用perror輸出錯誤資訊。

#include <linux/types.h>

  //對一些特殊類型的定義,例如dev_t, off_t,
pid_t.其實這些類型大部分都是unsigned int型通過一連串的typedef變過來的,只是為了方便閱讀。

#include <linux/cdev.h>

  //對字元裝置結構cdev以及一系列的操作函數的定義。

#include <linux/wait.h>

  //等代隊列相關標頭檔


應用程式:



#include <fcntl.h> 

//包含了open()函數的flags,mode參數的宏定義。



 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.