<commit_before>### 内核驱动相关<br>

### 一.关键头文件及内含的结构体，函数：<br>


* linux/types.h:<br>
>   1.dev_t;<br>
    2.int MAJOR(dev_t dev);<br>
    3.int MINOR(dev_t dev);<br>
    4.dev MKDEV(unsigned int major,unsigned int minor);<br>

* linux/fs.h:<br>
>    1.int register_chrdev_region(dev_t first,unsigned int count,char* name);<br>
    2.int alloc_chrdev_region(dev_t* dev,unsigned int firstminor,unsigned int count,char* name);<br>
    3.void unregister_chrdev_region(dev_t first,unsigned int count);<br>
    4.struct file;<br>
    5.struct file_operations;<br>
    6.struct inode;<br>

* linux/cdev.h:<br>

    1.struct cdev cdev_alloc(void);
    2.void cdev_init(struct cdev* dev,struct file_operations* fops);
    3.int cdev_add(struct cdev* dev,dev_t num,unsigned int count);
    4.void cdev_del(struct cdev* dev);

* linux/kernel.h:<br>

        1. container_of(pointer,type,field);
<commit_msg>0926-update7<commit_after>### 内核驱动相关<br>

### 一.关键头文件及内含的结构体，函数：<br>


* linux/types.h:<br>
> 1.dev_t;<br>
  2.int MAJOR(dev_t dev);<br>
  3.int MINOR(dev_t dev);<br>
  4.dev MKDEV(unsigned int major,unsigned int minor);<br>

* linux/fs.h:<br>
> 1.int register_chrdev_region(dev_t first,unsigned int count,char* name);<br>
  2.int alloc_chrdev_region(dev_t* dev,unsigned int firstminor,unsigned int count,char* name);<br>
  3.void unregister_chrdev_region(dev_t first,unsigned int count);<br>
  4.struct file;<br>
  5.struct file_operations;<br>
  6.struct inode;<br>

* linux/cdev.h:<br>

    1.struct cdev cdev_alloc(void);
    2.void cdev_init(struct cdev* dev,struct file_operations* fops);
    3.int cdev_add(struct cdev* dev,dev_t num,unsigned int count);
    4.void cdev_del(struct cdev* dev);

* linux/kernel.h:<br>

        1. container_of(pointer,type,field);

{'fraction_non_alphanumeric': 0.1515323496027242, 'fraction_numerical': 0.019863791146424517, 'mean_word_length': 4.5968253968253965, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '409040', 'n_tokens_mistral': 771, 'n_tokens_neox': 750, 'n_words': 134}